Merge tag 'v6.11-rc6' into android-mainline
Linux 6.11-rc6 Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: I321f364a91703f6814332ef96c1d9ae3747625af
This commit is contained in:
@@ -354,6 +354,8 @@ Kenneth Westfield <quic_kwestfie@quicinc.com> <kwestfie@codeaurora.org>
|
||||
Kiran Gunda <quic_kgunda@quicinc.com> <kgunda@codeaurora.org>
|
||||
Kirill Tkhai <tkhai@ya.ru> <ktkhai@virtuozzo.com>
|
||||
Kishon Vijay Abraham I <kishon@kernel.org> <kishon@ti.com>
|
||||
Konrad Dybcio <konradybcio@kernel.org> <konrad.dybcio@linaro.org>
|
||||
Konrad Dybcio <konradybcio@kernel.org> <konrad.dybcio@somainline.org>
|
||||
Konstantin Khlebnikov <koct9i@gmail.com> <khlebnikov@yandex-team.ru>
|
||||
Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
|
||||
Koushik <raghavendra.koushik@neterion.com>
|
||||
@@ -614,6 +616,7 @@ Simon Kelley <simon@thekelleys.org.uk>
|
||||
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
|
||||
Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>
|
||||
Sriram R <quic_srirrama@quicinc.com> <srirrama@codeaurora.org>
|
||||
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com> <sriram.yagnaraman@est.tech>
|
||||
Stanislav Fomichev <sdf@fomichev.me> <sdf@google.com>
|
||||
Stefan Wahren <wahrenst@gmx.net> <stefan.wahren@i2se.com>
|
||||
Stéphane Witzmann <stephane.witzmann@ubpmes.univ-bpclermont.fr>
|
||||
|
||||
@@ -10,7 +10,7 @@ maintainers:
|
||||
- Fabio Estevam <festevam@gmail.com>
|
||||
|
||||
allOf:
|
||||
- $ref: usb-hcd.yaml#
|
||||
- $ref: usb-device.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
@@ -36,6 +36,13 @@ required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
patternProperties:
|
||||
"^.*@[0-9a-f]{1,2}$":
|
||||
description: The hard wired USB devices
|
||||
type: object
|
||||
$ref: /schemas/usb/usb-device.yaml
|
||||
additionalProperties: true
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
|
||||
@@ -629,18 +629,6 @@ The preferred style for long (multi-line) comments is:
|
||||
* with beginning and ending almost-blank lines.
|
||||
*/
|
||||
|
||||
For files in net/ and drivers/net/ the preferred style for long (multi-line)
|
||||
comments is a little different.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
/* The preferred comment style for files in net/ and drivers/net
|
||||
* looks like this.
|
||||
*
|
||||
* It is nearly the same as the generally preferred comment style,
|
||||
* but there is no initial almost-blank line.
|
||||
*/
|
||||
|
||||
It's also important to comment data, whether they are basic types or derived
|
||||
types. To this end, use just one data declaration per line (no commas for
|
||||
multiple data declarations). This leaves you room for a small comment on each
|
||||
|
||||
@@ -355,23 +355,6 @@ just do it. As a result, a sequence of smaller series gets merged quicker and
|
||||
with better review coverage. Re-posting large series also increases the mailing
|
||||
list traffic.
|
||||
|
||||
Multi-line comments
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Comment style convention is slightly different for networking and most of
|
||||
the tree. Instead of this::
|
||||
|
||||
/*
|
||||
* foobar blah blah blah
|
||||
* another line of text
|
||||
*/
|
||||
|
||||
it is requested that you make it look like this::
|
||||
|
||||
/* foobar blah blah blah
|
||||
* another line of text
|
||||
*/
|
||||
|
||||
Local variable ordering ("reverse xmas tree", "RCS")
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
+13
-10
@@ -1880,6 +1880,10 @@ F: Documentation/devicetree/bindings/iommu/arm,smmu*
|
||||
F: drivers/iommu/arm/
|
||||
F: drivers/iommu/io-pgtable-arm*
|
||||
|
||||
ARM SMMU SVA SUPPORT
|
||||
R: Jean-Philippe Brucker <jean-philippe@linaro.org>
|
||||
F: drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
|
||||
|
||||
ARM SUB-ARCHITECTURES
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Maintained
|
||||
@@ -2535,8 +2539,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
S: Supported
|
||||
W: http://www.linux4sam.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux.git
|
||||
F: arch/arm/boot/dts/microchip/at91*
|
||||
F: arch/arm/boot/dts/microchip/sama*
|
||||
F: arch/arm/boot/dts/microchip/
|
||||
F: arch/arm/include/debug/at91.S
|
||||
F: arch/arm/mach-at91/
|
||||
F: drivers/memory/atmel*
|
||||
@@ -2745,7 +2748,7 @@ F: include/linux/soc/qcom/
|
||||
|
||||
ARM/QUALCOMM SUPPORT
|
||||
M: Bjorn Andersson <andersson@kernel.org>
|
||||
M: Konrad Dybcio <konrad.dybcio@linaro.org>
|
||||
M: Konrad Dybcio <konradybcio@kernel.org>
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
|
||||
@@ -7108,7 +7111,7 @@ F: drivers/gpu/drm/tiny/panel-mipi-dbi.c
|
||||
DRM DRIVER for Qualcomm Adreno GPUs
|
||||
M: Rob Clark <robdclark@gmail.com>
|
||||
R: Sean Paul <sean@poorly.run>
|
||||
R: Konrad Dybcio <konrad.dybcio@linaro.org>
|
||||
R: Konrad Dybcio <konradybcio@kernel.org>
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
L: dri-devel@lists.freedesktop.org
|
||||
L: freedreno@lists.freedesktop.org
|
||||
@@ -12174,7 +12177,7 @@ KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
|
||||
M: Chuck Lever <chuck.lever@oracle.com>
|
||||
M: Jeff Layton <jlayton@kernel.org>
|
||||
R: Neil Brown <neilb@suse.de>
|
||||
R: Olga Kornievskaia <kolga@netapp.com>
|
||||
R: Olga Kornievskaia <okorniev@redhat.com>
|
||||
R: Dai Ngo <Dai.Ngo@oracle.com>
|
||||
R: Tom Talpey <tom@talpey.com>
|
||||
L: linux-nfs@vger.kernel.org
|
||||
@@ -17442,6 +17445,7 @@ M: Roy Zang <roy.zang@nxp.com>
|
||||
L: linuxppc-dev@lists.ozlabs.org
|
||||
L: linux-pci@vger.kernel.org
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
L: imx@lists.linux.dev
|
||||
S: Maintained
|
||||
F: drivers/pci/controller/dwc/*layerscape*
|
||||
|
||||
@@ -17468,6 +17472,7 @@ M: Richard Zhu <hongxing.zhu@nxp.com>
|
||||
M: Lucas Stach <l.stach@pengutronix.de>
|
||||
L: linux-pci@vger.kernel.org
|
||||
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
|
||||
L: imx@lists.linux.dev
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
|
||||
F: Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
|
||||
@@ -17646,6 +17651,7 @@ F: drivers/pci/controller/pci-xgene-msi.c
|
||||
PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
|
||||
M: Lorenzo Pieralisi <lpieralisi@kernel.org>
|
||||
M: Krzysztof Wilczyński <kw@linux.com>
|
||||
R: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
R: Rob Herring <robh@kernel.org>
|
||||
L: linux-pci@vger.kernel.org
|
||||
S: Supported
|
||||
@@ -18552,7 +18558,6 @@ F: drivers/crypto/intel/qat/
|
||||
|
||||
QCOM AUDIO (ASoC) DRIVERS
|
||||
M: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
M: Banajit Goswami <bgoswami@quicinc.com>
|
||||
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
S: Supported
|
||||
@@ -18801,7 +18806,7 @@ F: include/uapi/drm/qaic_accel.h
|
||||
|
||||
QUALCOMM CORE POWER REDUCTION (CPR) AVS DRIVER
|
||||
M: Bjorn Andersson <andersson@kernel.org>
|
||||
M: Konrad Dybcio <konrad.dybcio@linaro.org>
|
||||
M: Konrad Dybcio <konradybcio@kernel.org>
|
||||
L: linux-pm@vger.kernel.org
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
S: Maintained
|
||||
@@ -23850,10 +23855,8 @@ F: drivers/media/usb/uvc/
|
||||
F: include/uapi/linux/uvcvideo.h
|
||||
|
||||
USB WEBCAM GADGET
|
||||
M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
M: Daniel Scally <dan.scally@ideasonboard.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: drivers/usb/gadget/function/*uvc*
|
||||
F: drivers/usb/gadget/legacy/webcam.c
|
||||
F: include/uapi/linux/usb/g_uvc.h
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
VERSION = 6
|
||||
PATCHLEVEL = 11
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc5
|
||||
EXTRAVERSION = -rc6
|
||||
NAME = Baby Opossum Posse
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
@@ -274,24 +274,24 @@
|
||||
|
||||
led@0 {
|
||||
chan-name = "R";
|
||||
led-cur = /bits/ 8 <0x20>;
|
||||
max-cur = /bits/ 8 <0x60>;
|
||||
led-cur = /bits/ 8 <0x6e>;
|
||||
max-cur = /bits/ 8 <0xc8>;
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
};
|
||||
|
||||
led@1 {
|
||||
chan-name = "G";
|
||||
led-cur = /bits/ 8 <0x20>;
|
||||
max-cur = /bits/ 8 <0x60>;
|
||||
led-cur = /bits/ 8 <0xbe>;
|
||||
max-cur = /bits/ 8 <0xc8>;
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
led@2 {
|
||||
chan-name = "B";
|
||||
led-cur = /bits/ 8 <0x20>;
|
||||
max-cur = /bits/ 8 <0x60>;
|
||||
led-cur = /bits/ 8 <0xbe>;
|
||||
max-cur = /bits/ 8 <0xc8>;
|
||||
reg = <2>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
|
||||
@@ -781,7 +781,7 @@
|
||||
|
||||
mount-matrix = "-1", "0", "0",
|
||||
"0", "1", "0",
|
||||
"0", "0", "1";
|
||||
"0", "0", "-1";
|
||||
};
|
||||
|
||||
cam1: camera@3e {
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster-thermal {
|
||||
cluster-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 1>;
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster-thermal {
|
||||
cluster-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 3>;
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster-thermal {
|
||||
cluster-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 3>;
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
core-cluster-thermal {
|
||||
cluster-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 0>;
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster1-thermal {
|
||||
cluster1-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 4>;
|
||||
@@ -151,7 +151,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster2-thermal {
|
||||
cluster2-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 5>;
|
||||
@@ -180,7 +180,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster3-thermal {
|
||||
cluster3-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 6>;
|
||||
@@ -209,7 +209,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
core-cluster4-thermal {
|
||||
cluster4-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 7>;
|
||||
|
||||
@@ -492,7 +492,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
ddr-cluster5-thermal {
|
||||
ddr-ctrl5-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tmu 1>;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
&gpio3 {
|
||||
pinctrl-names = "default";
|
||||
pinctrcl-0 = <&pinctrl_gpio3_hog>;
|
||||
pinctrl-0 = <&pinctrl_gpio3_hog>;
|
||||
|
||||
uart4_rs485_en {
|
||||
gpio-hog;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
&gpio3 {
|
||||
pinctrl-names = "default";
|
||||
pinctrcl-0 = <&pinctrl_gpio3_hog>;
|
||||
pinctrl-0 = <&pinctrl_gpio3_hog>;
|
||||
|
||||
uart4_rs485_en {
|
||||
gpio-hog;
|
||||
|
||||
@@ -211,13 +211,12 @@
|
||||
|
||||
simple-audio-card,cpu {
|
||||
sound-dai = <&sai3>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
|
||||
simple-audio-card,codec {
|
||||
sound-dai = <&wm8962>;
|
||||
clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO1>;
|
||||
frame-master;
|
||||
bitclock-master;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -507,10 +506,9 @@
|
||||
&sai3 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_sai3>;
|
||||
assigned-clocks = <&clk IMX8MP_CLK_SAI3>,
|
||||
<&clk IMX8MP_AUDIO_PLL2> ;
|
||||
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL2_OUT>;
|
||||
assigned-clock-rates = <12288000>, <361267200>;
|
||||
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
|
||||
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
|
||||
assigned-clock-rates = <12288000>;
|
||||
fsl,sai-mclk-direction-output;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
pinctrl-0 = <&pinctrl_usdhc2_hs>, <&pinctrl_usdhc2_gpio>;
|
||||
pinctrl-1 = <&pinctrl_usdhc2_uhs>, <&pinctrl_usdhc2_gpio>;
|
||||
pinctrl-2 = <&pinctrl_usdhc2_uhs>, <&pinctrl_usdhc2_gpio>;
|
||||
cd-gpios = <&gpio3 00 GPIO_ACTIVE_LOW>;
|
||||
cd-gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
|
||||
vmmc-supply = <®_usdhc2_vmmc>;
|
||||
bus-width = <4>;
|
||||
no-sdio;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
linux,cma {
|
||||
compatible = "shared-dma-pool";
|
||||
reusable;
|
||||
alloc-ranges = <0 0x60000000 0 0x40000000>;
|
||||
alloc-ranges = <0 0x80000000 0 0x40000000>;
|
||||
size = <0 0x10000000>;
|
||||
linux,cma-default;
|
||||
};
|
||||
@@ -156,6 +156,7 @@
|
||||
&wdog3 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_wdog>;
|
||||
fsl,ext-reset-output;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -1105,7 +1105,7 @@
|
||||
<&clk IMX93_CLK_SYS_PLL_PFD0_DIV2>;
|
||||
assigned-clock-rates = <100000000>, <250000000>;
|
||||
intf_mode = <&wakeupmix_gpr 0x28>;
|
||||
snps,clk-csr = <0>;
|
||||
snps,clk-csr = <6>;
|
||||
nvmem-cells = <ð_mac2>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
status = "disabled";
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
reg = <0x0>;
|
||||
enable-method = "psci";
|
||||
#cooling-cells = <2>;
|
||||
power-domains = <&scmi_devpd IMX95_PERF_A55>;
|
||||
power-domains = <&scmi_perf IMX95_PERF_A55>;
|
||||
power-domain-names = "perf";
|
||||
i-cache-size = <32768>;
|
||||
i-cache-line-size = <64>;
|
||||
@@ -44,7 +44,7 @@
|
||||
reg = <0x100>;
|
||||
enable-method = "psci";
|
||||
#cooling-cells = <2>;
|
||||
power-domains = <&scmi_devpd IMX95_PERF_A55>;
|
||||
power-domains = <&scmi_perf IMX95_PERF_A55>;
|
||||
power-domain-names = "perf";
|
||||
i-cache-size = <32768>;
|
||||
i-cache-line-size = <64>;
|
||||
@@ -61,7 +61,7 @@
|
||||
reg = <0x200>;
|
||||
enable-method = "psci";
|
||||
#cooling-cells = <2>;
|
||||
power-domains = <&scmi_devpd IMX95_PERF_A55>;
|
||||
power-domains = <&scmi_perf IMX95_PERF_A55>;
|
||||
power-domain-names = "perf";
|
||||
i-cache-size = <32768>;
|
||||
i-cache-line-size = <64>;
|
||||
@@ -78,7 +78,7 @@
|
||||
reg = <0x300>;
|
||||
enable-method = "psci";
|
||||
#cooling-cells = <2>;
|
||||
power-domains = <&scmi_devpd IMX95_PERF_A55>;
|
||||
power-domains = <&scmi_perf IMX95_PERF_A55>;
|
||||
power-domain-names = "perf";
|
||||
i-cache-size = <32768>;
|
||||
i-cache-line-size = <64>;
|
||||
@@ -93,7 +93,7 @@
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a55";
|
||||
reg = <0x400>;
|
||||
power-domains = <&scmi_devpd IMX95_PERF_A55>;
|
||||
power-domains = <&scmi_perf IMX95_PERF_A55>;
|
||||
power-domain-names = "perf";
|
||||
enable-method = "psci";
|
||||
#cooling-cells = <2>;
|
||||
@@ -110,7 +110,7 @@
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a55";
|
||||
reg = <0x500>;
|
||||
power-domains = <&scmi_devpd IMX95_PERF_A55>;
|
||||
power-domains = <&scmi_perf IMX95_PERF_A55>;
|
||||
power-domain-names = "perf";
|
||||
enable-method = "psci";
|
||||
#cooling-cells = <2>;
|
||||
@@ -187,7 +187,7 @@
|
||||
compatible = "cache";
|
||||
cache-size = <524288>;
|
||||
cache-line-size = <64>;
|
||||
cache-sets = <1024>;
|
||||
cache-sets = <512>;
|
||||
cache-level = <3>;
|
||||
cache-unified;
|
||||
};
|
||||
|
||||
@@ -320,8 +320,8 @@
|
||||
reg = <0x08af8800 0x400>;
|
||||
|
||||
interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 53 IRQ_TYPE_EDGE_BOTH>,
|
||||
<GIC_SPI 52 IRQ_TYPE_EDGE_BOTH>;
|
||||
<GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "pwr_event",
|
||||
"dp_hs_phy_irq",
|
||||
"dm_hs_phy_irq";
|
||||
|
||||
@@ -278,6 +278,13 @@
|
||||
vdd-l3-supply = <&vreg_s1f_0p7>;
|
||||
vdd-s1-supply = <&vph_pwr>;
|
||||
vdd-s2-supply = <&vph_pwr>;
|
||||
|
||||
vreg_l3i_0p8: ldo3 {
|
||||
regulator-name = "vreg_l3i_0p8";
|
||||
regulator-min-microvolt = <880000>;
|
||||
regulator-max-microvolt = <920000>;
|
||||
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
|
||||
};
|
||||
};
|
||||
|
||||
regulators-7 {
|
||||
@@ -423,11 +430,17 @@
|
||||
};
|
||||
|
||||
&pcie4 {
|
||||
perst-gpios = <&tlmm 146 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
|
||||
|
||||
pinctrl-0 = <&pcie4_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie4_phy {
|
||||
vdda-phy-supply = <&vreg_l3j_0p8>;
|
||||
vdda-phy-supply = <&vreg_l3i_0p8>;
|
||||
vdda-pll-supply = <&vreg_l3e_1p2>;
|
||||
|
||||
status = "okay";
|
||||
@@ -517,7 +530,30 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
pcie6a_default: pcie2a-default-state {
|
||||
pcie4_default: pcie4-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio147";
|
||||
function = "pcie4_clk";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
perst-n-pins {
|
||||
pins = "gpio146";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio148";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
pcie6a_default: pcie6a-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio153";
|
||||
function = "pcie6a_clk";
|
||||
@@ -529,7 +565,7 @@
|
||||
pins = "gpio152";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
|
||||
@@ -268,7 +268,6 @@
|
||||
pinctrl-0 = <&edp_reg_en>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
@@ -637,6 +636,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
&gpu {
|
||||
status = "okay";
|
||||
|
||||
zap-shader {
|
||||
firmware-name = "qcom/x1e80100/gen70500_zap.mbn";
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
clock-frequency = <400000>;
|
||||
|
||||
@@ -724,9 +731,13 @@
|
||||
|
||||
aux-bus {
|
||||
panel {
|
||||
compatible = "edp-panel";
|
||||
compatible = "samsung,atna45af01", "samsung,atna33xc20";
|
||||
enable-gpios = <&pmc8380_3_gpios 4 GPIO_ACTIVE_HIGH>;
|
||||
power-supply = <&vreg_edp_3p3>;
|
||||
|
||||
pinctrl-0 = <&edp_bl_en>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
port {
|
||||
edp_panel_in: endpoint {
|
||||
remote-endpoint = <&mdss_dp3_out>;
|
||||
@@ -756,11 +767,17 @@
|
||||
};
|
||||
|
||||
&pcie4 {
|
||||
perst-gpios = <&tlmm 146 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
|
||||
|
||||
pinctrl-0 = <&pcie4_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie4_phy {
|
||||
vdda-phy-supply = <&vreg_l3j_0p8>;
|
||||
vdda-phy-supply = <&vreg_l3i_0p8>;
|
||||
vdda-pll-supply = <&vreg_l3e_1p2>;
|
||||
|
||||
status = "okay";
|
||||
@@ -785,6 +802,16 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pmc8380_3_gpios {
|
||||
edp_bl_en: edp-bl-en-state {
|
||||
pins = "gpio4";
|
||||
function = "normal";
|
||||
power-source = <1>; /* 1.8V */
|
||||
input-disable;
|
||||
output-enable;
|
||||
};
|
||||
};
|
||||
|
||||
&qupv3_0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -931,7 +958,30 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
pcie6a_default: pcie2a-default-state {
|
||||
pcie4_default: pcie4-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio147";
|
||||
function = "pcie4_clk";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
perst-n-pins {
|
||||
pins = "gpio146";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio148";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
pcie6a_default: pcie6a-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio153";
|
||||
function = "pcie6a_clk";
|
||||
@@ -943,15 +993,15 @@
|
||||
pins = "gpio152";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio154";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
pins = "gpio154";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
tpad_default: tpad-default-state {
|
||||
|
||||
@@ -625,16 +625,31 @@
|
||||
};
|
||||
|
||||
&pcie4 {
|
||||
perst-gpios = <&tlmm 146 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
|
||||
|
||||
pinctrl-0 = <&pcie4_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie4_phy {
|
||||
vdda-phy-supply = <&vreg_l3j_0p8>;
|
||||
vdda-phy-supply = <&vreg_l3i_0p8>;
|
||||
vdda-pll-supply = <&vreg_l3e_1p2>;
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie4_port0 {
|
||||
wifi@0 {
|
||||
compatible = "pci17cb,1107";
|
||||
reg = <0x10000 0x0 0x0 0x0 0x0>;
|
||||
|
||||
qcom,ath12k-calibration-variant = "LES790";
|
||||
};
|
||||
};
|
||||
|
||||
&pcie6a {
|
||||
perst-gpios = <&tlmm 152 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&tlmm 154 GPIO_ACTIVE_LOW>;
|
||||
@@ -782,7 +797,30 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
pcie6a_default: pcie2a-default-state {
|
||||
pcie4_default: pcie4-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio147";
|
||||
function = "pcie4_clk";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
perst-n-pins {
|
||||
pins = "gpio146";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio148";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
pcie6a_default: pcie6a-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio153";
|
||||
function = "pcie6a_clk";
|
||||
@@ -794,15 +832,15 @@
|
||||
pins = "gpio152";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio154";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
pins = "gpio154";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
tpad_default: tpad-default-state {
|
||||
|
||||
@@ -606,6 +606,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
&gpu {
|
||||
status = "okay";
|
||||
|
||||
zap-shader {
|
||||
firmware-name = "qcom/x1e80100/gen70500_zap.mbn";
|
||||
};
|
||||
};
|
||||
|
||||
&lpass_tlmm {
|
||||
spkr_01_sd_n_active: spkr-01-sd-n-active-state {
|
||||
pins = "gpio12";
|
||||
@@ -660,11 +668,17 @@
|
||||
};
|
||||
|
||||
&pcie4 {
|
||||
perst-gpios = <&tlmm 146 GPIO_ACTIVE_LOW>;
|
||||
wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
|
||||
|
||||
pinctrl-0 = <&pcie4_default>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie4_phy {
|
||||
vdda-phy-supply = <&vreg_l3j_0p8>;
|
||||
vdda-phy-supply = <&vreg_l3i_0p8>;
|
||||
vdda-pll-supply = <&vreg_l3e_1p2>;
|
||||
|
||||
status = "okay";
|
||||
@@ -804,7 +818,30 @@
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
pcie6a_default: pcie2a-default-state {
|
||||
pcie4_default: pcie4-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio147";
|
||||
function = "pcie4_clk";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
perst-n-pins {
|
||||
pins = "gpio146";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio148";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
pcie6a_default: pcie6a-default-state {
|
||||
clkreq-n-pins {
|
||||
pins = "gpio153";
|
||||
function = "pcie6a_clk";
|
||||
@@ -816,15 +853,15 @@
|
||||
pins = "gpio152";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-down;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
wake-n-pins {
|
||||
pins = "gpio154";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
pins = "gpio154";
|
||||
function = "gpio";
|
||||
drive-strength = <2>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
wcd_default: wcd-reset-n-active-state {
|
||||
|
||||
@@ -2901,7 +2901,7 @@
|
||||
|
||||
dma-coherent;
|
||||
|
||||
linux,pci-domain = <7>;
|
||||
linux,pci-domain = <6>;
|
||||
num-lanes = <2>;
|
||||
|
||||
interrupts = <GIC_SPI 773 IRQ_TYPE_LEVEL_HIGH>,
|
||||
@@ -2959,6 +2959,7 @@
|
||||
"link_down";
|
||||
|
||||
power-domains = <&gcc GCC_PCIE_6A_GDSC>;
|
||||
required-opps = <&rpmhpd_opp_nom>;
|
||||
|
||||
phys = <&pcie6a_phy>;
|
||||
phy-names = "pciephy";
|
||||
@@ -3022,7 +3023,7 @@
|
||||
|
||||
dma-coherent;
|
||||
|
||||
linux,pci-domain = <5>;
|
||||
linux,pci-domain = <4>;
|
||||
num-lanes = <2>;
|
||||
|
||||
interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
|
||||
@@ -3080,11 +3081,22 @@
|
||||
"link_down";
|
||||
|
||||
power-domains = <&gcc GCC_PCIE_4_GDSC>;
|
||||
required-opps = <&rpmhpd_opp_nom>;
|
||||
|
||||
phys = <&pcie4_phy>;
|
||||
phy-names = "pciephy";
|
||||
|
||||
status = "disabled";
|
||||
|
||||
pcie4_port0: pcie@0 {
|
||||
device_type = "pci";
|
||||
reg = <0x0 0x0 0x0 0x0 0x0>;
|
||||
bus-range = <0x01 0xff>;
|
||||
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
};
|
||||
};
|
||||
|
||||
pcie4_phy: phy@1c0e000 {
|
||||
@@ -3155,9 +3167,10 @@
|
||||
interconnects = <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>;
|
||||
interconnect-names = "gfx-mem";
|
||||
|
||||
status = "disabled";
|
||||
|
||||
zap-shader {
|
||||
memory-region = <&gpu_microcode_mem>;
|
||||
firmware-name = "qcom/gen70500_zap.mbn";
|
||||
};
|
||||
|
||||
gpu_opp_table: opp-table {
|
||||
@@ -3288,7 +3301,7 @@
|
||||
reg = <0x0 0x03da0000 0x0 0x40000>;
|
||||
#iommu-cells = <2>;
|
||||
#global-interrupts = <1>;
|
||||
interrupts = <GIC_SPI 673 IRQ_TYPE_LEVEL_HIGH>,
|
||||
interrupts = <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 678 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 679 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 680 IRQ_TYPE_LEVEL_HIGH>,
|
||||
|
||||
@@ -887,6 +887,7 @@ CONFIG_DRM_PANEL_KHADAS_TS050=m
|
||||
CONFIG_DRM_PANEL_MANTIX_MLAF057WE51=m
|
||||
CONFIG_DRM_PANEL_NOVATEK_NT36672E=m
|
||||
CONFIG_DRM_PANEL_RAYDIUM_RM67191=m
|
||||
CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20=m
|
||||
CONFIG_DRM_PANEL_SITRONIX_ST7703=m
|
||||
CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA=m
|
||||
CONFIG_DRM_PANEL_VISIONOX_VTDR6130=m
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
|
||||
*/
|
||||
#ifndef _LOONGARCH_DMA_DIRECT_H
|
||||
#define _LOONGARCH_DMA_DIRECT_H
|
||||
|
||||
dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
|
||||
phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
|
||||
|
||||
#endif /* _LOONGARCH_DMA_DIRECT_H */
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
extern atomic_t irq_err_count;
|
||||
|
||||
#define ARCH_IRQ_INIT_FLAGS IRQ_NOPROBE
|
||||
|
||||
/*
|
||||
* interrupt-retrigger: NOP for now. This may not be appropriate for all
|
||||
* machines, we'll see ...
|
||||
|
||||
@@ -76,7 +76,6 @@ static inline void kvm_restore_lasx(struct loongarch_fpu *fpu) { }
|
||||
#endif
|
||||
|
||||
void kvm_init_timer(struct kvm_vcpu *vcpu, unsigned long hz);
|
||||
void kvm_reset_timer(struct kvm_vcpu *vcpu);
|
||||
void kvm_save_timer(struct kvm_vcpu *vcpu);
|
||||
void kvm_restore_timer(struct kvm_vcpu *vcpu);
|
||||
|
||||
|
||||
@@ -530,6 +530,10 @@ SYM_FUNC_END(_restore_lasx_context)
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LBT
|
||||
STACK_FRAME_NON_STANDARD _restore_fp
|
||||
#ifdef CONFIG_CPU_HAS_LSX
|
||||
STACK_FRAME_NON_STANDARD _restore_lsx
|
||||
#endif
|
||||
#ifdef CONFIG_CPU_HAS_LASX
|
||||
STACK_FRAME_NON_STANDARD _restore_lasx
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -102,9 +102,6 @@ void __init init_IRQ(void)
|
||||
mp_ops.init_ipi();
|
||||
#endif
|
||||
|
||||
for (i = 0; i < NR_IRQS; i++)
|
||||
irq_set_noprobe(i);
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
page = alloc_pages_node(cpu_to_node(i), GFP_KERNEL, order);
|
||||
|
||||
|
||||
@@ -277,6 +277,10 @@ SYM_DATA(kvm_enter_guest_size, .quad kvm_enter_guest_end - kvm_enter_guest)
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LBT
|
||||
STACK_FRAME_NON_STANDARD kvm_restore_fpu
|
||||
#ifdef CONFIG_CPU_HAS_LSX
|
||||
STACK_FRAME_NON_STANDARD kvm_restore_lsx
|
||||
#endif
|
||||
#ifdef CONFIG_CPU_HAS_LASX
|
||||
STACK_FRAME_NON_STANDARD kvm_restore_lasx
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -188,10 +188,3 @@ void kvm_save_timer(struct kvm_vcpu *vcpu)
|
||||
kvm_save_hw_gcsr(csr, LOONGARCH_CSR_ESTAT);
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
void kvm_reset_timer(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
write_gcsr_timercfg(0);
|
||||
kvm_write_sw_gcsr(vcpu->arch.csr, LOONGARCH_CSR_TCFG, 0);
|
||||
hrtimer_cancel(&vcpu->arch.swtimer);
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ static int kvm_set_one_reg(struct kvm_vcpu *vcpu,
|
||||
vcpu->kvm->arch.time_offset = (signed long)(v - drdtime());
|
||||
break;
|
||||
case KVM_REG_LOONGARCH_VCPU_RESET:
|
||||
kvm_reset_timer(vcpu);
|
||||
vcpu->arch.st.guest_addr = 0;
|
||||
memset(&vcpu->arch.irq_pending, 0, sizeof(vcpu->arch.irq_pending));
|
||||
memset(&vcpu->arch.irq_clear, 0, sizeof(vcpu->arch.irq_clear));
|
||||
break;
|
||||
|
||||
@@ -193,11 +193,6 @@ asmlinkage void __init mmu_init(void)
|
||||
{
|
||||
unsigned int kstart, ksize;
|
||||
|
||||
if (!memblock.reserved.cnt) {
|
||||
pr_emerg("Error memory count\n");
|
||||
machine_restart(NULL);
|
||||
}
|
||||
|
||||
if ((u32) memblock.memory.regions[0].size < 0x400000) {
|
||||
pr_emerg("Memory must be greater than 4MB\n");
|
||||
machine_restart(NULL);
|
||||
|
||||
@@ -21,9 +21,7 @@ static struct clocksource clocksource_mips = {
|
||||
.name = "MIPS",
|
||||
.read = c0_hpt_read,
|
||||
.mask = CLOCKSOURCE_MASK(32),
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS |
|
||||
CLOCK_SOURCE_MUST_VERIFY |
|
||||
CLOCK_SOURCE_VERIFY_PERCPU,
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
};
|
||||
|
||||
static u64 __maybe_unused notrace r4k_read_sched_clock(void)
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ static int blkdev_issue_write_zeroes(struct block_device *bdev, sector_t sector,
|
||||
* on an I/O error, in which case we'll turn any error into
|
||||
* "not supported" here.
|
||||
*/
|
||||
if (ret && !limit)
|
||||
if (ret && !bdev_write_zeroes_sectors(bdev))
|
||||
return -EOPNOTSUPP;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <linux/efi.h>
|
||||
|
||||
#include <net/bluetooth/bluetooth.h>
|
||||
#include <net/bluetooth/hci_core.h>
|
||||
@@ -26,6 +27,8 @@
|
||||
#define ECDSA_OFFSET 644
|
||||
#define ECDSA_HEADER_LEN 320
|
||||
|
||||
#define BTINTEL_EFI_DSBR L"UefiCnvCommonDSBR"
|
||||
|
||||
enum {
|
||||
DSM_SET_WDISABLE2_DELAY = 1,
|
||||
DSM_SET_RESET_METHOD = 3,
|
||||
@@ -2616,6 +2619,120 @@ static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
return hci_skb_pkt_type(skb);
|
||||
}
|
||||
|
||||
/*
|
||||
* UefiCnvCommonDSBR UEFI variable provides information from the OEM platforms
|
||||
* if they have replaced the BRI (Bluetooth Radio Interface) resistor to
|
||||
* overcome the potential STEP errors on their designs. Based on the
|
||||
* configauration, bluetooth firmware shall adjust the BRI response line drive
|
||||
* strength. The below structure represents DSBR data.
|
||||
* struct {
|
||||
* u8 header;
|
||||
* u32 dsbr;
|
||||
* } __packed;
|
||||
*
|
||||
* header - defines revision number of the structure
|
||||
* dsbr - defines drive strength BRI response
|
||||
* bit0
|
||||
* 0 - instructs bluetooth firmware to use default values
|
||||
* 1 - instructs bluetooth firmware to override default values
|
||||
* bit3:1
|
||||
* Reserved
|
||||
* bit7:4
|
||||
* DSBR override values (only if bit0 is set. Default value is 0xF
|
||||
* bit31:7
|
||||
* Reserved
|
||||
* Expected values for dsbr field:
|
||||
* 1. 0xF1 - indicates that the resistor on board is 33 Ohm
|
||||
* 2. 0x00 or 0xB1 - indicates that the resistor on board is 10 Ohm
|
||||
* 3. Non existing UEFI variable or invalid (none of the above) - indicates
|
||||
* that the resistor on board is 10 Ohm
|
||||
* Even if uefi variable is not present, driver shall send 0xfc0a command to
|
||||
* firmware to use default values.
|
||||
*
|
||||
*/
|
||||
static int btintel_uefi_get_dsbr(u32 *dsbr_var)
|
||||
{
|
||||
struct btintel_dsbr {
|
||||
u8 header;
|
||||
u32 dsbr;
|
||||
} __packed data;
|
||||
|
||||
efi_status_t status;
|
||||
unsigned long data_size = 0;
|
||||
efi_guid_t guid = EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, 0x8d, 0x03,
|
||||
0x77, 0x2e, 0xcc, 0x3d, 0xa5, 0x31);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_EFI))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
status = efi.get_variable(BTINTEL_EFI_DSBR, &guid, NULL, &data_size,
|
||||
NULL);
|
||||
|
||||
if (status != EFI_BUFFER_TOO_SMALL || !data_size)
|
||||
return -EIO;
|
||||
|
||||
status = efi.get_variable(BTINTEL_EFI_DSBR, &guid, NULL, &data_size,
|
||||
&data);
|
||||
|
||||
if (status != EFI_SUCCESS)
|
||||
return -ENXIO;
|
||||
|
||||
*dsbr_var = data.dsbr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int btintel_set_dsbr(struct hci_dev *hdev, struct intel_version_tlv *ver)
|
||||
{
|
||||
struct btintel_dsbr_cmd {
|
||||
u8 enable;
|
||||
u8 dsbr;
|
||||
} __packed;
|
||||
|
||||
struct btintel_dsbr_cmd cmd;
|
||||
struct sk_buff *skb;
|
||||
u8 status;
|
||||
u32 dsbr;
|
||||
bool apply_dsbr;
|
||||
int err;
|
||||
|
||||
/* DSBR command needs to be sent for BlazarI + B0 step product after
|
||||
* downloading IML image.
|
||||
*/
|
||||
apply_dsbr = (ver->img_type == BTINTEL_IMG_IML &&
|
||||
((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) &&
|
||||
INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01);
|
||||
|
||||
if (!apply_dsbr)
|
||||
return 0;
|
||||
|
||||
dsbr = 0;
|
||||
err = btintel_uefi_get_dsbr(&dsbr);
|
||||
if (err < 0)
|
||||
bt_dev_dbg(hdev, "Error reading efi: %ls (%d)",
|
||||
BTINTEL_EFI_DSBR, err);
|
||||
|
||||
cmd.enable = dsbr & BIT(0);
|
||||
cmd.dsbr = dsbr >> 4 & 0xF;
|
||||
|
||||
bt_dev_info(hdev, "dsbr: enable: 0x%2.2x value: 0x%2.2x", cmd.enable,
|
||||
cmd.dsbr);
|
||||
|
||||
skb = __hci_cmd_sync(hdev, 0xfc0a, sizeof(cmd), &cmd, HCI_CMD_TIMEOUT);
|
||||
if (IS_ERR(skb))
|
||||
return -bt_to_errno(PTR_ERR(skb));
|
||||
|
||||
status = skb->data[0];
|
||||
kfree_skb(skb);
|
||||
|
||||
if (status)
|
||||
return -bt_to_errno(status);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
|
||||
struct intel_version_tlv *ver)
|
||||
{
|
||||
@@ -2650,6 +2767,13 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* set drive strength of BRI response */
|
||||
err = btintel_set_dsbr(hdev, ver);
|
||||
if (err) {
|
||||
bt_dev_err(hdev, "Failed to send dsbr command (%d)", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* If image type returned is BTINTEL_IMG_IML, then controller supports
|
||||
* intermediate loader image
|
||||
*/
|
||||
|
||||
@@ -449,6 +449,23 @@ static bool ps_wakeup(struct btnxpuart_dev *nxpdev)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ps_cleanup(struct btnxpuart_dev *nxpdev)
|
||||
{
|
||||
struct ps_data *psdata = &nxpdev->psdata;
|
||||
u8 ps_state;
|
||||
|
||||
mutex_lock(&psdata->ps_lock);
|
||||
ps_state = psdata->ps_state;
|
||||
mutex_unlock(&psdata->ps_lock);
|
||||
|
||||
if (ps_state != PS_STATE_AWAKE)
|
||||
ps_control(psdata->hdev, PS_STATE_AWAKE);
|
||||
|
||||
ps_cancel_timer(nxpdev);
|
||||
cancel_work_sync(&psdata->work);
|
||||
mutex_destroy(&psdata->ps_lock);
|
||||
}
|
||||
|
||||
static int send_ps_cmd(struct hci_dev *hdev, void *data)
|
||||
{
|
||||
struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
|
||||
@@ -1363,7 +1380,6 @@ static int btnxpuart_close(struct hci_dev *hdev)
|
||||
{
|
||||
struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
|
||||
|
||||
ps_wakeup(nxpdev);
|
||||
serdev_device_close(nxpdev->serdev);
|
||||
skb_queue_purge(&nxpdev->txq);
|
||||
if (!IS_ERR_OR_NULL(nxpdev->rx_skb)) {
|
||||
@@ -1516,8 +1532,8 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
|
||||
nxpdev->new_baudrate = nxpdev->fw_init_baudrate;
|
||||
nxp_set_baudrate_cmd(hdev, NULL);
|
||||
}
|
||||
ps_cancel_timer(nxpdev);
|
||||
}
|
||||
ps_cleanup(nxpdev);
|
||||
hci_unregister_dev(hdev);
|
||||
hci_free_dev(hdev);
|
||||
}
|
||||
|
||||
@@ -698,6 +698,10 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
|
||||
rc = tpm2_get_cc_attrs_tbl(chip);
|
||||
if (rc)
|
||||
goto init_irq_cleanup;
|
||||
|
||||
rc = tpm2_sessions_init(chip);
|
||||
if (rc)
|
||||
goto init_irq_cleanup;
|
||||
}
|
||||
|
||||
return tpm_chip_register(chip);
|
||||
|
||||
@@ -160,14 +160,17 @@ static void amd_pstate_ut_check_perf(u32 index)
|
||||
lowest_perf = AMD_CPPC_LOWEST_PERF(cap1);
|
||||
}
|
||||
|
||||
if ((highest_perf != READ_ONCE(cpudata->highest_perf)) ||
|
||||
(nominal_perf != READ_ONCE(cpudata->nominal_perf)) ||
|
||||
if (highest_perf != READ_ONCE(cpudata->highest_perf) && !cpudata->hw_prefcore) {
|
||||
pr_err("%s cpu%d highest=%d %d highest perf doesn't match\n",
|
||||
__func__, cpu, highest_perf, cpudata->highest_perf);
|
||||
goto skip_test;
|
||||
}
|
||||
if ((nominal_perf != READ_ONCE(cpudata->nominal_perf)) ||
|
||||
(lowest_nonlinear_perf != READ_ONCE(cpudata->lowest_nonlinear_perf)) ||
|
||||
(lowest_perf != READ_ONCE(cpudata->lowest_perf))) {
|
||||
amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
|
||||
pr_err("%s cpu%d highest=%d %d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n",
|
||||
__func__, cpu, highest_perf, cpudata->highest_perf,
|
||||
nominal_perf, cpudata->nominal_perf,
|
||||
pr_err("%s cpu%d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n",
|
||||
__func__, cpu, nominal_perf, cpudata->nominal_perf,
|
||||
lowest_nonlinear_perf, cpudata->lowest_nonlinear_perf,
|
||||
lowest_perf, cpudata->lowest_perf);
|
||||
goto skip_test;
|
||||
|
||||
@@ -321,7 +321,7 @@ static inline int pstate_enable(bool enable)
|
||||
return 0;
|
||||
|
||||
for_each_present_cpu(cpu) {
|
||||
unsigned long logical_id = topology_logical_die_id(cpu);
|
||||
unsigned long logical_id = topology_logical_package_id(cpu);
|
||||
|
||||
if (test_bit(logical_id, &logical_proc_id_mask))
|
||||
continue;
|
||||
@@ -692,7 +692,7 @@ static int amd_pstate_cpu_boost_update(struct cpufreq_policy *policy, bool on)
|
||||
struct amd_cpudata *cpudata = policy->driver_data;
|
||||
struct cppc_perf_ctrls perf_ctrls;
|
||||
u32 highest_perf, nominal_perf, nominal_freq, max_freq;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
highest_perf = READ_ONCE(cpudata->highest_perf);
|
||||
nominal_perf = READ_ONCE(cpudata->nominal_perf);
|
||||
|
||||
@@ -17,8 +17,8 @@ enum dw_hdma_control {
|
||||
DW_HDMA_V0_CB = BIT(0),
|
||||
DW_HDMA_V0_TCB = BIT(1),
|
||||
DW_HDMA_V0_LLP = BIT(2),
|
||||
DW_HDMA_V0_LIE = BIT(3),
|
||||
DW_HDMA_V0_RIE = BIT(4),
|
||||
DW_HDMA_V0_LWIE = BIT(3),
|
||||
DW_HDMA_V0_RWIE = BIT(4),
|
||||
DW_HDMA_V0_CCS = BIT(8),
|
||||
DW_HDMA_V0_LLE = BIT(9),
|
||||
};
|
||||
@@ -195,25 +195,14 @@ static void dw_hdma_v0_write_ll_link(struct dw_edma_chunk *chunk,
|
||||
static void dw_hdma_v0_core_write_chunk(struct dw_edma_chunk *chunk)
|
||||
{
|
||||
struct dw_edma_burst *child;
|
||||
struct dw_edma_chan *chan = chunk->chan;
|
||||
u32 control = 0, i = 0;
|
||||
int j;
|
||||
|
||||
if (chunk->cb)
|
||||
control = DW_HDMA_V0_CB;
|
||||
|
||||
j = chunk->bursts_alloc;
|
||||
list_for_each_entry(child, &chunk->burst->list, list) {
|
||||
j--;
|
||||
if (!j) {
|
||||
control |= DW_HDMA_V0_LIE;
|
||||
if (!(chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL))
|
||||
control |= DW_HDMA_V0_RIE;
|
||||
}
|
||||
|
||||
list_for_each_entry(child, &chunk->burst->list, list)
|
||||
dw_hdma_v0_write_ll_data(chunk, i++, control, child->sz,
|
||||
child->sar, child->dar);
|
||||
}
|
||||
|
||||
control = DW_HDMA_V0_LLP | DW_HDMA_V0_TCB;
|
||||
if (!chunk->cb)
|
||||
@@ -247,10 +236,11 @@ static void dw_hdma_v0_core_start(struct dw_edma_chunk *chunk, bool first)
|
||||
if (first) {
|
||||
/* Enable engine */
|
||||
SET_CH_32(dw, chan->dir, chan->id, ch_en, BIT(0));
|
||||
/* Interrupt enable&unmask - done, abort */
|
||||
tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup) |
|
||||
HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK |
|
||||
HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN;
|
||||
/* Interrupt unmask - stop, abort */
|
||||
tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup);
|
||||
tmp &= ~(HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK);
|
||||
/* Interrupt enable - stop, abort */
|
||||
tmp |= HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN;
|
||||
if (!(dw->chip->flags & DW_EDMA_CHIP_LOCAL))
|
||||
tmp |= HDMA_V0_REMOTE_STOP_INT_EN | HDMA_V0_REMOTE_ABORT_INT_EN;
|
||||
SET_CH_32(dw, chan->dir, chan->id, int_setup, tmp);
|
||||
|
||||
+109
-22
@@ -16,6 +16,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -621,12 +622,10 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
struct dw_desc *prev;
|
||||
struct dw_desc *first;
|
||||
u32 ctllo, ctlhi;
|
||||
u8 m_master = dwc->dws.m_master;
|
||||
u8 lms = DWC_LLP_LMS(m_master);
|
||||
u8 lms = DWC_LLP_LMS(dwc->dws.m_master);
|
||||
dma_addr_t reg;
|
||||
unsigned int reg_width;
|
||||
unsigned int mem_width;
|
||||
unsigned int data_width = dw->pdata->data_width[m_master];
|
||||
unsigned int i;
|
||||
struct scatterlist *sg;
|
||||
size_t total_len = 0;
|
||||
@@ -660,7 +659,7 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
mem = sg_dma_address(sg);
|
||||
len = sg_dma_len(sg);
|
||||
|
||||
mem_width = __ffs(data_width | mem | len);
|
||||
mem_width = __ffs(sconfig->src_addr_width | mem | len);
|
||||
|
||||
slave_sg_todev_fill_desc:
|
||||
desc = dwc_desc_get(dwc);
|
||||
@@ -720,7 +719,7 @@ slave_sg_fromdev_fill_desc:
|
||||
lli_write(desc, sar, reg);
|
||||
lli_write(desc, dar, mem);
|
||||
lli_write(desc, ctlhi, ctlhi);
|
||||
mem_width = __ffs(data_width | mem);
|
||||
mem_width = __ffs(sconfig->dst_addr_width | mem);
|
||||
lli_write(desc, ctllo, ctllo | DWC_CTLL_DST_WIDTH(mem_width));
|
||||
desc->len = dlen;
|
||||
|
||||
@@ -780,20 +779,108 @@ bool dw_dma_filter(struct dma_chan *chan, void *param)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dw_dma_filter);
|
||||
|
||||
static int dwc_config(struct dma_chan *chan, struct dma_slave_config *sconfig)
|
||||
static int dwc_verify_maxburst(struct dma_chan *chan)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
|
||||
dwc->dma_sconfig.src_maxburst =
|
||||
clamp(dwc->dma_sconfig.src_maxburst, 1U, dwc->max_burst);
|
||||
dwc->dma_sconfig.dst_maxburst =
|
||||
clamp(dwc->dma_sconfig.dst_maxburst, 1U, dwc->max_burst);
|
||||
|
||||
dwc->dma_sconfig.src_maxburst =
|
||||
rounddown_pow_of_two(dwc->dma_sconfig.src_maxburst);
|
||||
dwc->dma_sconfig.dst_maxburst =
|
||||
rounddown_pow_of_two(dwc->dma_sconfig.dst_maxburst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dwc_verify_p_buswidth(struct dma_chan *chan)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
struct dw_dma *dw = to_dw_dma(chan->device);
|
||||
u32 reg_width, max_width;
|
||||
|
||||
if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV)
|
||||
reg_width = dwc->dma_sconfig.dst_addr_width;
|
||||
else if (dwc->dma_sconfig.direction == DMA_DEV_TO_MEM)
|
||||
reg_width = dwc->dma_sconfig.src_addr_width;
|
||||
else /* DMA_MEM_TO_MEM */
|
||||
return 0;
|
||||
|
||||
max_width = dw->pdata->data_width[dwc->dws.p_master];
|
||||
|
||||
/* Fall-back to 1-byte transfer width if undefined */
|
||||
if (reg_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
|
||||
reg_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
|
||||
else if (!is_power_of_2(reg_width) || reg_width > max_width)
|
||||
return -EINVAL;
|
||||
else /* bus width is valid */
|
||||
return 0;
|
||||
|
||||
/* Update undefined addr width value */
|
||||
if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV)
|
||||
dwc->dma_sconfig.dst_addr_width = reg_width;
|
||||
else /* DMA_DEV_TO_MEM */
|
||||
dwc->dma_sconfig.src_addr_width = reg_width;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dwc_verify_m_buswidth(struct dma_chan *chan)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
struct dw_dma *dw = to_dw_dma(chan->device);
|
||||
u32 reg_width, reg_burst, mem_width;
|
||||
|
||||
mem_width = dw->pdata->data_width[dwc->dws.m_master];
|
||||
|
||||
/*
|
||||
* It's possible to have a data portion locked in the DMA FIFO in case
|
||||
* of the channel suspension. Subsequent channel disabling will cause
|
||||
* that data silent loss. In order to prevent that maintain the src and
|
||||
* dst transfer widths coherency by means of the relation:
|
||||
* (CTLx.SRC_TR_WIDTH * CTLx.SRC_MSIZE >= CTLx.DST_TR_WIDTH)
|
||||
* Look for the details in the commit message that brings this change.
|
||||
*
|
||||
* Note the DMA configs utilized in the calculations below must have
|
||||
* been verified to have correct values by this method call.
|
||||
*/
|
||||
if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV) {
|
||||
reg_width = dwc->dma_sconfig.dst_addr_width;
|
||||
if (mem_width < reg_width)
|
||||
return -EINVAL;
|
||||
|
||||
dwc->dma_sconfig.src_addr_width = mem_width;
|
||||
} else if (dwc->dma_sconfig.direction == DMA_DEV_TO_MEM) {
|
||||
reg_width = dwc->dma_sconfig.src_addr_width;
|
||||
reg_burst = dwc->dma_sconfig.src_maxburst;
|
||||
|
||||
dwc->dma_sconfig.dst_addr_width = min(mem_width, reg_width * reg_burst);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dwc_config(struct dma_chan *chan, struct dma_slave_config *sconfig)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
int ret;
|
||||
|
||||
memcpy(&dwc->dma_sconfig, sconfig, sizeof(*sconfig));
|
||||
|
||||
dwc->dma_sconfig.src_maxburst =
|
||||
clamp(dwc->dma_sconfig.src_maxburst, 0U, dwc->max_burst);
|
||||
dwc->dma_sconfig.dst_maxburst =
|
||||
clamp(dwc->dma_sconfig.dst_maxburst, 0U, dwc->max_burst);
|
||||
ret = dwc_verify_maxburst(chan);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dw->encode_maxburst(dwc, &dwc->dma_sconfig.src_maxburst);
|
||||
dw->encode_maxburst(dwc, &dwc->dma_sconfig.dst_maxburst);
|
||||
ret = dwc_verify_p_buswidth(chan);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = dwc_verify_m_buswidth(chan);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1068,7 +1155,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
|
||||
bool autocfg = false;
|
||||
unsigned int dw_params;
|
||||
unsigned int i;
|
||||
int err;
|
||||
int ret;
|
||||
|
||||
dw->pdata = devm_kzalloc(chip->dev, sizeof(*dw->pdata), GFP_KERNEL);
|
||||
if (!dw->pdata)
|
||||
@@ -1084,7 +1171,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
|
||||
|
||||
autocfg = dw_params >> DW_PARAMS_EN & 1;
|
||||
if (!autocfg) {
|
||||
err = -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_pdata;
|
||||
}
|
||||
|
||||
@@ -1104,7 +1191,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
|
||||
pdata->chan_allocation_order = CHAN_ALLOCATION_ASCENDING;
|
||||
pdata->chan_priority = CHAN_PRIORITY_ASCENDING;
|
||||
} else if (chip->pdata->nr_channels > DW_DMA_MAX_NR_CHANNELS) {
|
||||
err = -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_pdata;
|
||||
} else {
|
||||
memcpy(dw->pdata, chip->pdata, sizeof(*dw->pdata));
|
||||
@@ -1116,7 +1203,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
|
||||
dw->chan = devm_kcalloc(chip->dev, pdata->nr_channels, sizeof(*dw->chan),
|
||||
GFP_KERNEL);
|
||||
if (!dw->chan) {
|
||||
err = -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto err_pdata;
|
||||
}
|
||||
|
||||
@@ -1134,15 +1221,15 @@ int do_dma_probe(struct dw_dma_chip *chip)
|
||||
sizeof(struct dw_desc), 4, 0);
|
||||
if (!dw->desc_pool) {
|
||||
dev_err(chip->dev, "No memory for descriptors dma pool\n");
|
||||
err = -ENOMEM;
|
||||
ret = -ENOMEM;
|
||||
goto err_pdata;
|
||||
}
|
||||
|
||||
tasklet_setup(&dw->tasklet, dw_dma_tasklet);
|
||||
|
||||
err = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED,
|
||||
ret = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED,
|
||||
dw->name, dw);
|
||||
if (err)
|
||||
if (ret)
|
||||
goto err_pdata;
|
||||
|
||||
INIT_LIST_HEAD(&dw->dma.channels);
|
||||
@@ -1254,8 +1341,8 @@ int do_dma_probe(struct dw_dma_chip *chip)
|
||||
*/
|
||||
dma_set_max_seg_size(dw->dma.dev, dw->chan[0].block_size);
|
||||
|
||||
err = dma_async_device_register(&dw->dma);
|
||||
if (err)
|
||||
ret = dma_async_device_register(&dw->dma);
|
||||
if (ret)
|
||||
goto err_dma_register;
|
||||
|
||||
dev_info(chip->dev, "DesignWare DMA Controller, %d channels\n",
|
||||
@@ -1269,7 +1356,7 @@ err_dma_register:
|
||||
free_irq(chip->irq, dw);
|
||||
err_pdata:
|
||||
pm_runtime_put_sync_suspend(chip->dev);
|
||||
return err;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int do_dma_remove(struct dw_dma_chip *chip)
|
||||
|
||||
+26
-18
@@ -64,28 +64,37 @@ static size_t dw_dma_block2bytes(struct dw_dma_chan *dwc, u32 block, u32 width)
|
||||
return DWC_CTLH_BLOCK_TS(block) << width;
|
||||
}
|
||||
|
||||
static u32 dw_dma_prepare_ctllo(struct dw_dma_chan *dwc)
|
||||
{
|
||||
struct dma_slave_config *sconfig = &dwc->dma_sconfig;
|
||||
u8 smsize = (dwc->direction == DMA_DEV_TO_MEM) ? sconfig->src_maxburst : 0;
|
||||
u8 dmsize = (dwc->direction == DMA_MEM_TO_DEV) ? sconfig->dst_maxburst : 0;
|
||||
u8 p_master = dwc->dws.p_master;
|
||||
u8 m_master = dwc->dws.m_master;
|
||||
u8 dms = (dwc->direction == DMA_MEM_TO_DEV) ? p_master : m_master;
|
||||
u8 sms = (dwc->direction == DMA_DEV_TO_MEM) ? p_master : m_master;
|
||||
|
||||
return DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN |
|
||||
DWC_CTLL_DST_MSIZE(dmsize) | DWC_CTLL_SRC_MSIZE(smsize) |
|
||||
DWC_CTLL_DMS(dms) | DWC_CTLL_SMS(sms);
|
||||
}
|
||||
|
||||
static void dw_dma_encode_maxburst(struct dw_dma_chan *dwc, u32 *maxburst)
|
||||
static inline u8 dw_dma_encode_maxburst(u32 maxburst)
|
||||
{
|
||||
/*
|
||||
* Fix burst size according to dw_dmac. We need to convert them as:
|
||||
* 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3.
|
||||
*/
|
||||
*maxburst = *maxburst > 1 ? fls(*maxburst) - 2 : 0;
|
||||
return maxburst > 1 ? fls(maxburst) - 2 : 0;
|
||||
}
|
||||
|
||||
static u32 dw_dma_prepare_ctllo(struct dw_dma_chan *dwc)
|
||||
{
|
||||
struct dma_slave_config *sconfig = &dwc->dma_sconfig;
|
||||
u8 smsize = 0, dmsize = 0;
|
||||
u8 sms, dms;
|
||||
|
||||
if (dwc->direction == DMA_MEM_TO_DEV) {
|
||||
sms = dwc->dws.m_master;
|
||||
dms = dwc->dws.p_master;
|
||||
dmsize = dw_dma_encode_maxburst(sconfig->dst_maxburst);
|
||||
} else if (dwc->direction == DMA_DEV_TO_MEM) {
|
||||
sms = dwc->dws.p_master;
|
||||
dms = dwc->dws.m_master;
|
||||
smsize = dw_dma_encode_maxburst(sconfig->src_maxburst);
|
||||
} else /* DMA_MEM_TO_MEM */ {
|
||||
sms = dwc->dws.m_master;
|
||||
dms = dwc->dws.m_master;
|
||||
}
|
||||
|
||||
return DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN |
|
||||
DWC_CTLL_DST_MSIZE(dmsize) | DWC_CTLL_SRC_MSIZE(smsize) |
|
||||
DWC_CTLL_DMS(dms) | DWC_CTLL_SMS(sms);
|
||||
}
|
||||
|
||||
static void dw_dma_set_device_name(struct dw_dma *dw, int id)
|
||||
@@ -116,7 +125,6 @@ int dw_dma_probe(struct dw_dma_chip *chip)
|
||||
dw->suspend_chan = dw_dma_suspend_chan;
|
||||
dw->resume_chan = dw_dma_resume_chan;
|
||||
dw->prepare_ctllo = dw_dma_prepare_ctllo;
|
||||
dw->encode_maxburst = dw_dma_encode_maxburst;
|
||||
dw->bytes2block = dw_dma_bytes2block;
|
||||
dw->block2bytes = dw_dma_block2bytes;
|
||||
|
||||
|
||||
+11
-8
@@ -199,21 +199,25 @@ static size_t idma32_block2bytes(struct dw_dma_chan *dwc, u32 block, u32 width)
|
||||
return IDMA32C_CTLH_BLOCK_TS(block);
|
||||
}
|
||||
|
||||
static inline u8 idma32_encode_maxburst(u32 maxburst)
|
||||
{
|
||||
return maxburst > 1 ? fls(maxburst) - 1 : 0;
|
||||
}
|
||||
|
||||
static u32 idma32_prepare_ctllo(struct dw_dma_chan *dwc)
|
||||
{
|
||||
struct dma_slave_config *sconfig = &dwc->dma_sconfig;
|
||||
u8 smsize = (dwc->direction == DMA_DEV_TO_MEM) ? sconfig->src_maxburst : 0;
|
||||
u8 dmsize = (dwc->direction == DMA_MEM_TO_DEV) ? sconfig->dst_maxburst : 0;
|
||||
u8 smsize = 0, dmsize = 0;
|
||||
|
||||
if (dwc->direction == DMA_MEM_TO_DEV)
|
||||
dmsize = idma32_encode_maxburst(sconfig->dst_maxburst);
|
||||
else if (dwc->direction == DMA_DEV_TO_MEM)
|
||||
smsize = idma32_encode_maxburst(sconfig->src_maxburst);
|
||||
|
||||
return DWC_CTLL_LLP_D_EN | DWC_CTLL_LLP_S_EN |
|
||||
DWC_CTLL_DST_MSIZE(dmsize) | DWC_CTLL_SRC_MSIZE(smsize);
|
||||
}
|
||||
|
||||
static void idma32_encode_maxburst(struct dw_dma_chan *dwc, u32 *maxburst)
|
||||
{
|
||||
*maxburst = *maxburst > 1 ? fls(*maxburst) - 1 : 0;
|
||||
}
|
||||
|
||||
static void idma32_set_device_name(struct dw_dma *dw, int id)
|
||||
{
|
||||
snprintf(dw->name, sizeof(dw->name), "idma32:dmac%d", id);
|
||||
@@ -270,7 +274,6 @@ int idma32_dma_probe(struct dw_dma_chip *chip)
|
||||
dw->suspend_chan = idma32_suspend_chan;
|
||||
dw->resume_chan = idma32_resume_chan;
|
||||
dw->prepare_ctllo = idma32_prepare_ctllo;
|
||||
dw->encode_maxburst = idma32_encode_maxburst;
|
||||
dw->bytes2block = idma32_bytes2block;
|
||||
dw->block2bytes = idma32_block2bytes;
|
||||
|
||||
|
||||
+10
-10
@@ -29,7 +29,7 @@ static int dw_probe(struct platform_device *pdev)
|
||||
struct dw_dma_chip_pdata *data;
|
||||
struct dw_dma_chip *chip;
|
||||
struct device *dev = &pdev->dev;
|
||||
int err;
|
||||
int ret;
|
||||
|
||||
match = device_get_match_data(dev);
|
||||
if (!match)
|
||||
@@ -51,9 +51,9 @@ static int dw_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(chip->regs))
|
||||
return PTR_ERR(chip->regs);
|
||||
|
||||
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (err)
|
||||
return err;
|
||||
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!data->pdata)
|
||||
data->pdata = dev_get_platdata(dev);
|
||||
@@ -69,14 +69,14 @@ static int dw_probe(struct platform_device *pdev)
|
||||
chip->clk = devm_clk_get_optional(chip->dev, "hclk");
|
||||
if (IS_ERR(chip->clk))
|
||||
return PTR_ERR(chip->clk);
|
||||
err = clk_prepare_enable(chip->clk);
|
||||
if (err)
|
||||
return err;
|
||||
ret = clk_prepare_enable(chip->clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
err = data->probe(chip);
|
||||
if (err)
|
||||
ret = data->probe(chip);
|
||||
if (ret)
|
||||
goto err_dw_dma_probe;
|
||||
|
||||
platform_set_drvdata(pdev, data);
|
||||
@@ -90,7 +90,7 @@ static int dw_probe(struct platform_device *pdev)
|
||||
err_dw_dma_probe:
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
clk_disable_unprepare(chip->clk);
|
||||
return err;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void dw_remove(struct platform_device *pdev)
|
||||
|
||||
@@ -327,7 +327,6 @@ struct dw_dma {
|
||||
void (*suspend_chan)(struct dw_dma_chan *dwc, bool drain);
|
||||
void (*resume_chan)(struct dw_dma_chan *dwc, bool drain);
|
||||
u32 (*prepare_ctllo)(struct dw_dma_chan *dwc);
|
||||
void (*encode_maxburst)(struct dw_dma_chan *dwc, u32 *maxburst);
|
||||
u32 (*bytes2block)(struct dw_dma_chan *dwc, size_t bytes,
|
||||
unsigned int width, size_t *len);
|
||||
size_t (*block2bytes)(struct dw_dma_chan *dwc, u32 block, u32 width);
|
||||
|
||||
@@ -403,6 +403,7 @@ static struct stm32_dma3_swdesc *stm32_dma3_chan_desc_alloc(struct stm32_dma3_ch
|
||||
swdesc = kzalloc(struct_size(swdesc, lli, count), GFP_NOWAIT);
|
||||
if (!swdesc)
|
||||
return NULL;
|
||||
swdesc->lli_size = count;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
swdesc->lli[i].hwdesc = dma_pool_zalloc(chan->lli_pool, GFP_NOWAIT,
|
||||
@@ -410,7 +411,6 @@ static struct stm32_dma3_swdesc *stm32_dma3_chan_desc_alloc(struct stm32_dma3_ch
|
||||
if (!swdesc->lli[i].hwdesc)
|
||||
goto err_pool_free;
|
||||
}
|
||||
swdesc->lli_size = count;
|
||||
swdesc->ccr = 0;
|
||||
|
||||
/* Set LL base address */
|
||||
|
||||
@@ -1186,10 +1186,10 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
|
||||
d->dev_addr = dev_addr;
|
||||
d->fi = burst;
|
||||
d->es = es;
|
||||
d->sglen = 1;
|
||||
d->sg[0].addr = buf_addr;
|
||||
d->sg[0].en = period_len / es_bytes[es];
|
||||
d->sg[0].fn = buf_len / period_len;
|
||||
d->sglen = 1;
|
||||
|
||||
d->ccr = c->ccr;
|
||||
if (dir == DMA_DEV_TO_MEM)
|
||||
@@ -1258,10 +1258,10 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_memcpy(
|
||||
d->dev_addr = src;
|
||||
d->fi = 0;
|
||||
d->es = data_type;
|
||||
d->sglen = 1;
|
||||
d->sg[0].en = len / BIT(data_type);
|
||||
d->sg[0].fn = 1;
|
||||
d->sg[0].addr = dest;
|
||||
d->sglen = 1;
|
||||
d->ccr = c->ccr;
|
||||
d->ccr |= CCR_DST_AMODE_POSTINC | CCR_SRC_AMODE_POSTINC;
|
||||
|
||||
@@ -1309,6 +1309,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_interleaved(
|
||||
if (data_type > CSDP_DATA_TYPE_32)
|
||||
data_type = CSDP_DATA_TYPE_32;
|
||||
|
||||
d->sglen = 1;
|
||||
sg = &d->sg[0];
|
||||
d->dir = DMA_MEM_TO_MEM;
|
||||
d->dev_addr = xt->src_start;
|
||||
@@ -1316,7 +1317,6 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_interleaved(
|
||||
sg->en = xt->sgl[0].size / BIT(data_type);
|
||||
sg->fn = xt->numf;
|
||||
sg->addr = xt->dst_start;
|
||||
d->sglen = 1;
|
||||
d->ccr = c->ccr;
|
||||
|
||||
src_icg = dmaengine_get_src_icg(xt, &xt->sgl[0]);
|
||||
|
||||
@@ -166,7 +166,7 @@ static enum fw_upload_err mpfs_auto_update_poll_complete(struct fw_upload *fw_up
|
||||
*/
|
||||
ret = wait_for_completion_timeout(&priv->programming_complete,
|
||||
msecs_to_jiffies(AUTO_UPDATE_TIMEOUT_MS));
|
||||
if (ret)
|
||||
if (!ret)
|
||||
return FW_UPLOAD_ERR_TIMEOUT;
|
||||
|
||||
return FW_UPLOAD_ERR_NONE;
|
||||
|
||||
@@ -73,7 +73,7 @@ int scm_get_wq_ctx(u32 *wq_ctx, u32 *flags, u32 *more_pending)
|
||||
struct arm_smccc_res get_wq_res;
|
||||
struct arm_smccc_args get_wq_ctx = {0};
|
||||
|
||||
get_wq_ctx.args[0] = ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL,
|
||||
get_wq_ctx.args[0] = ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,
|
||||
ARM_SMCCC_SMC_64, ARM_SMCCC_OWNER_SIP,
|
||||
SCM_SMC_FNID(QCOM_SCM_SVC_WAITQ, QCOM_SCM_WAITQ_GET_WQ_CTX));
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ struct qcom_tzmem_pool {
|
||||
};
|
||||
|
||||
struct qcom_tzmem_chunk {
|
||||
phys_addr_t paddr;
|
||||
size_t size;
|
||||
struct qcom_tzmem_pool *owner;
|
||||
};
|
||||
@@ -78,6 +77,7 @@ static bool qcom_tzmem_using_shm_bridge;
|
||||
/* List of machines that are known to not support SHM bridge correctly. */
|
||||
static const char *const qcom_tzmem_blacklist[] = {
|
||||
"qcom,sc8180x",
|
||||
"qcom,sdm670", /* failure in GPU firmware loading */
|
||||
"qcom,sdm845", /* reset in rmtfs memory assignment */
|
||||
"qcom,sm8150", /* reset in rmtfs memory assignment */
|
||||
NULL
|
||||
@@ -385,7 +385,6 @@ again:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
chunk->paddr = gen_pool_virt_to_phys(pool->genpool, vaddr);
|
||||
chunk->size = size;
|
||||
chunk->owner = pool;
|
||||
|
||||
@@ -431,25 +430,37 @@ void qcom_tzmem_free(void *vaddr)
|
||||
EXPORT_SYMBOL_GPL(qcom_tzmem_free);
|
||||
|
||||
/**
|
||||
* qcom_tzmem_to_phys() - Map the virtual address of a TZ buffer to physical.
|
||||
* @vaddr: Virtual address of the buffer allocated from a TZ memory pool.
|
||||
* qcom_tzmem_to_phys() - Map the virtual address of TZ memory to physical.
|
||||
* @vaddr: Virtual address of memory allocated from a TZ memory pool.
|
||||
*
|
||||
* Can be used in any context. The address must have been returned by a call
|
||||
* to qcom_tzmem_alloc().
|
||||
* Can be used in any context. The address must point to memory allocated
|
||||
* using qcom_tzmem_alloc().
|
||||
*
|
||||
* Returns: Physical address of the buffer.
|
||||
* Returns:
|
||||
* Physical address mapped from the virtual or 0 if the mapping failed.
|
||||
*/
|
||||
phys_addr_t qcom_tzmem_to_phys(void *vaddr)
|
||||
{
|
||||
struct qcom_tzmem_chunk *chunk;
|
||||
struct radix_tree_iter iter;
|
||||
void __rcu **slot;
|
||||
phys_addr_t ret;
|
||||
|
||||
guard(spinlock_irqsave)(&qcom_tzmem_chunks_lock);
|
||||
|
||||
chunk = radix_tree_lookup(&qcom_tzmem_chunks, (unsigned long)vaddr);
|
||||
if (!chunk)
|
||||
return 0;
|
||||
radix_tree_for_each_slot(slot, &qcom_tzmem_chunks, &iter, 0) {
|
||||
chunk = radix_tree_deref_slot_protected(slot,
|
||||
&qcom_tzmem_chunks_lock);
|
||||
|
||||
return chunk->paddr;
|
||||
ret = gen_pool_virt_to_phys(chunk->owner->genpool,
|
||||
(unsigned long)vaddr);
|
||||
if (ret == -1)
|
||||
continue;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_tzmem_to_phys);
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ static struct platform_device *pd;
|
||||
static DEFINE_MUTEX(disable_lock);
|
||||
static bool disabled;
|
||||
|
||||
static struct device *sysfb_parent_dev(const struct screen_info *si);
|
||||
|
||||
static bool sysfb_unregister(void)
|
||||
{
|
||||
if (IS_ERR_OR_NULL(pd))
|
||||
@@ -52,6 +54,7 @@ static bool sysfb_unregister(void)
|
||||
|
||||
/**
|
||||
* sysfb_disable() - disable the Generic System Framebuffers support
|
||||
* @dev: the device to check if non-NULL
|
||||
*
|
||||
* This disables the registration of system framebuffer devices that match the
|
||||
* generic drivers that make use of the system framebuffer set up by firmware.
|
||||
@@ -61,17 +64,21 @@ static bool sysfb_unregister(void)
|
||||
* Context: The function can sleep. A @disable_lock mutex is acquired to serialize
|
||||
* against sysfb_init(), that registers a system framebuffer device.
|
||||
*/
|
||||
void sysfb_disable(void)
|
||||
void sysfb_disable(struct device *dev)
|
||||
{
|
||||
struct screen_info *si = &screen_info;
|
||||
|
||||
mutex_lock(&disable_lock);
|
||||
sysfb_unregister();
|
||||
disabled = true;
|
||||
if (!dev || dev == sysfb_parent_dev(si)) {
|
||||
sysfb_unregister();
|
||||
disabled = true;
|
||||
}
|
||||
mutex_unlock(&disable_lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sysfb_disable);
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
static __init bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
|
||||
static bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
|
||||
{
|
||||
/*
|
||||
* TODO: Try to integrate this code into the PCI subsystem
|
||||
@@ -87,13 +94,13 @@ static __init bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
static __init bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
|
||||
static bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static __init struct device *sysfb_parent_dev(const struct screen_info *si)
|
||||
static struct device *sysfb_parent_dev(const struct screen_info *si)
|
||||
{
|
||||
struct pci_dev *pdev;
|
||||
|
||||
|
||||
@@ -1500,6 +1500,7 @@ union gc_info {
|
||||
struct gc_info_v1_0 v1;
|
||||
struct gc_info_v1_1 v1_1;
|
||||
struct gc_info_v1_2 v1_2;
|
||||
struct gc_info_v1_3 v1_3;
|
||||
struct gc_info_v2_0 v2;
|
||||
struct gc_info_v2_1 v2_1;
|
||||
};
|
||||
@@ -1558,6 +1559,16 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
|
||||
adev->gfx.config.gc_gl1c_size_per_instance = le32_to_cpu(gc_info->v1_2.gc_gl1c_size_per_instance);
|
||||
adev->gfx.config.gc_gl2c_per_gpu = le32_to_cpu(gc_info->v1_2.gc_gl2c_per_gpu);
|
||||
}
|
||||
if (le16_to_cpu(gc_info->v1.header.version_minor) >= 3) {
|
||||
adev->gfx.config.gc_tcp_size_per_cu = le32_to_cpu(gc_info->v1_3.gc_tcp_size_per_cu);
|
||||
adev->gfx.config.gc_tcp_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcp_cache_line_size);
|
||||
adev->gfx.config.gc_instruction_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_size_per_sqc);
|
||||
adev->gfx.config.gc_instruction_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_line_size);
|
||||
adev->gfx.config.gc_scalar_data_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_scalar_data_cache_size_per_sqc);
|
||||
adev->gfx.config.gc_scalar_data_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_scalar_data_cache_line_size);
|
||||
adev->gfx.config.gc_tcc_size = le32_to_cpu(gc_info->v1_3.gc_tcc_size);
|
||||
adev->gfx.config.gc_tcc_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcc_cache_line_size);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
adev->gfx.config.max_shader_engines = le32_to_cpu(gc_info->v2.gc_num_se);
|
||||
|
||||
@@ -240,6 +240,12 @@ struct amdgpu_gfx_config {
|
||||
uint32_t gc_tcp_size_per_cu;
|
||||
uint32_t gc_num_cu_per_sqc;
|
||||
uint32_t gc_tcc_size;
|
||||
uint32_t gc_tcp_cache_line_size;
|
||||
uint32_t gc_instruction_cache_size_per_sqc;
|
||||
uint32_t gc_instruction_cache_line_size;
|
||||
uint32_t gc_scalar_data_cache_size_per_sqc;
|
||||
uint32_t gc_scalar_data_cache_line_size;
|
||||
uint32_t gc_tcc_cache_line_size;
|
||||
};
|
||||
|
||||
struct amdgpu_cu_info {
|
||||
|
||||
@@ -3005,7 +3005,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
(order_base_2(prop->queue_size / 4) - 1));
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, RPTR_BLOCK_SIZE,
|
||||
(order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1));
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 0);
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 1);
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, TUNNEL_DISPATCH, 0);
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, PRIV_STATE, 1);
|
||||
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, KMD_QUEUE, 1);
|
||||
|
||||
@@ -187,6 +187,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd,
|
||||
m->cp_hqd_pq_control = 5 << CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT;
|
||||
m->cp_hqd_pq_control |=
|
||||
ffs(q->queue_size / sizeof(unsigned int)) - 1 - 1;
|
||||
m->cp_hqd_pq_control |= CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK;
|
||||
pr_debug("cp_hqd_pq_control 0x%x\n", m->cp_hqd_pq_control);
|
||||
|
||||
m->cp_hqd_pq_base_lo = lower_32_bits((uint64_t)q->queue_address >> 8);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <drm/drm_blend.h>
|
||||
#include <drm/drm_gem_atomic_helper.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_gem_framebuffer_helper.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
|
||||
#include "amdgpu.h"
|
||||
@@ -935,10 +936,14 @@ static int amdgpu_dm_plane_helper_prepare_fb(struct drm_plane *plane,
|
||||
}
|
||||
|
||||
afb = to_amdgpu_framebuffer(new_state->fb);
|
||||
obj = new_state->fb->obj[0];
|
||||
obj = drm_gem_fb_get_obj(new_state->fb, 0);
|
||||
if (!obj) {
|
||||
DRM_ERROR("Failed to get obj from framebuffer\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rbo = gem_to_amdgpu_bo(obj);
|
||||
adev = amdgpu_ttm_adev(rbo->tbo.bdev);
|
||||
|
||||
r = amdgpu_bo_reserve(rbo, true);
|
||||
if (r) {
|
||||
dev_err(adev->dev, "fail to reserve bo (%d)\n", r);
|
||||
|
||||
@@ -258,6 +258,48 @@ struct gc_info_v1_2 {
|
||||
uint32_t gc_gl2c_per_gpu;
|
||||
};
|
||||
|
||||
struct gc_info_v1_3 {
|
||||
struct gpu_info_header header;
|
||||
uint32_t gc_num_se;
|
||||
uint32_t gc_num_wgp0_per_sa;
|
||||
uint32_t gc_num_wgp1_per_sa;
|
||||
uint32_t gc_num_rb_per_se;
|
||||
uint32_t gc_num_gl2c;
|
||||
uint32_t gc_num_gprs;
|
||||
uint32_t gc_num_max_gs_thds;
|
||||
uint32_t gc_gs_table_depth;
|
||||
uint32_t gc_gsprim_buff_depth;
|
||||
uint32_t gc_parameter_cache_depth;
|
||||
uint32_t gc_double_offchip_lds_buffer;
|
||||
uint32_t gc_wave_size;
|
||||
uint32_t gc_max_waves_per_simd;
|
||||
uint32_t gc_max_scratch_slots_per_cu;
|
||||
uint32_t gc_lds_size;
|
||||
uint32_t gc_num_sc_per_se;
|
||||
uint32_t gc_num_sa_per_se;
|
||||
uint32_t gc_num_packer_per_sc;
|
||||
uint32_t gc_num_gl2a;
|
||||
uint32_t gc_num_tcp_per_sa;
|
||||
uint32_t gc_num_sdp_interface;
|
||||
uint32_t gc_num_tcps;
|
||||
uint32_t gc_num_tcp_per_wpg;
|
||||
uint32_t gc_tcp_l1_size;
|
||||
uint32_t gc_num_sqc_per_wgp;
|
||||
uint32_t gc_l1_instruction_cache_size_per_sqc;
|
||||
uint32_t gc_l1_data_cache_size_per_sqc;
|
||||
uint32_t gc_gl1c_per_sa;
|
||||
uint32_t gc_gl1c_size_per_instance;
|
||||
uint32_t gc_gl2c_per_gpu;
|
||||
uint32_t gc_tcp_size_per_cu;
|
||||
uint32_t gc_tcp_cache_line_size;
|
||||
uint32_t gc_instruction_cache_size_per_sqc;
|
||||
uint32_t gc_instruction_cache_line_size;
|
||||
uint32_t gc_scalar_data_cache_size_per_sqc;
|
||||
uint32_t gc_scalar_data_cache_line_size;
|
||||
uint32_t gc_tcc_size;
|
||||
uint32_t gc_tcc_cache_line_size;
|
||||
};
|
||||
|
||||
struct gc_info_v2_0 {
|
||||
struct gpu_info_header header;
|
||||
|
||||
|
||||
@@ -2224,8 +2224,9 @@ static int smu_bump_power_profile_mode(struct smu_context *smu,
|
||||
}
|
||||
|
||||
static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
||||
enum amd_dpm_forced_level level,
|
||||
bool skip_display_settings)
|
||||
enum amd_dpm_forced_level level,
|
||||
bool skip_display_settings,
|
||||
bool force_update)
|
||||
{
|
||||
int ret = 0;
|
||||
int index = 0;
|
||||
@@ -2254,7 +2255,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
||||
}
|
||||
}
|
||||
|
||||
if (smu_dpm_ctx->dpm_level != level) {
|
||||
if (force_update || smu_dpm_ctx->dpm_level != level) {
|
||||
ret = smu_asic_set_performance_level(smu, level);
|
||||
if (ret) {
|
||||
dev_err(smu->adev->dev, "Failed to set performance level!");
|
||||
@@ -2265,13 +2266,12 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
||||
smu_dpm_ctx->dpm_level = level;
|
||||
}
|
||||
|
||||
if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL &&
|
||||
smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM) {
|
||||
if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM) {
|
||||
index = fls(smu->workload_mask);
|
||||
index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;
|
||||
workload[0] = smu->workload_setting[index];
|
||||
|
||||
if (smu->power_profile_mode != workload[0])
|
||||
if (force_update || smu->power_profile_mode != workload[0])
|
||||
smu_bump_power_profile_mode(smu, workload, 0);
|
||||
}
|
||||
|
||||
@@ -2292,11 +2292,13 @@ static int smu_handle_task(struct smu_context *smu,
|
||||
ret = smu_pre_display_config_changed(smu);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = smu_adjust_power_state_dynamic(smu, level, false);
|
||||
ret = smu_adjust_power_state_dynamic(smu, level, false, false);
|
||||
break;
|
||||
case AMD_PP_TASK_COMPLETE_INIT:
|
||||
ret = smu_adjust_power_state_dynamic(smu, level, true, true);
|
||||
break;
|
||||
case AMD_PP_TASK_READJUST_POWER_STATE:
|
||||
ret = smu_adjust_power_state_dynamic(smu, level, true);
|
||||
ret = smu_adjust_power_state_dynamic(smu, level, true, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2343,8 +2345,7 @@ static int smu_switch_power_profile(void *handle,
|
||||
workload[0] = smu->workload_setting[index];
|
||||
}
|
||||
|
||||
if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL &&
|
||||
smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM)
|
||||
if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM)
|
||||
smu_bump_power_profile_mode(smu, workload, 0);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -92,7 +92,6 @@
|
||||
|
||||
//Resets
|
||||
#define PPSMC_MSG_PrepareMp1ForUnload 0x2E
|
||||
#define PPSMC_MSG_Mode1Reset 0x2F
|
||||
|
||||
//Set SystemVirtual DramAddrHigh
|
||||
#define PPSMC_MSG_SetSystemVirtualDramAddrHigh 0x30
|
||||
@@ -119,11 +118,12 @@
|
||||
|
||||
//STB to dram log
|
||||
#define PPSMC_MSG_DumpSTBtoDram 0x3D
|
||||
#define PPSMC_MSG_STBtoDramLogSetDramAddrHigh 0x3E
|
||||
#define PPSMC_MSG_STBtoDramLogSetDramAddrLow 0x3F
|
||||
#define PPSMC_MSG_STBtoDramLogSetDramAddress 0x3E
|
||||
#define PPSMC_MSG_DummyUndefined 0x3F
|
||||
#define PPSMC_MSG_STBtoDramLogSetDramSize 0x40
|
||||
#define PPSMC_MSG_SetOBMTraceBufferLogging 0x41
|
||||
|
||||
#define PPSMC_MSG_UseProfilingMode 0x42
|
||||
#define PPSMC_MSG_AllowGfxDcs 0x43
|
||||
#define PPSMC_MSG_DisallowGfxDcs 0x44
|
||||
#define PPSMC_MSG_EnableAudioStutterWA 0x45
|
||||
@@ -135,6 +135,16 @@
|
||||
#define PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel 0x4B
|
||||
#define PPSMC_MSG_SetPriorityDeltaGain 0x4C
|
||||
#define PPSMC_MSG_AllowIHHostInterrupt 0x4D
|
||||
#define PPSMC_MSG_EnableShadowDpm 0x4E
|
||||
#define PPSMC_MSG_Mode3Reset 0x4F
|
||||
#define PPSMC_Message_Count 0x50
|
||||
#define PPSMC_MSG_SetDriverDramAddr 0x50
|
||||
#define PPSMC_MSG_SetToolsDramAddr 0x51
|
||||
#define PPSMC_MSG_TransferTableSmu2DramWithAddr 0x52
|
||||
#define PPSMC_MSG_TransferTableDram2SmuWithAddr 0x53
|
||||
#define PPSMC_MSG_GetAllRunningSmuFeatures 0x54
|
||||
#define PPSMC_MSG_GetSvi3Voltage 0x55
|
||||
#define PPSMC_MSG_UpdatePolicy 0x56
|
||||
#define PPSMC_MSG_ExtPwrConnSupport 0x57
|
||||
#define PPSMC_MSG_PreloadSwPstateForUclkOverDrive 0x58
|
||||
#define PPSMC_Message_Count 0x59
|
||||
#endif
|
||||
|
||||
@@ -121,6 +121,7 @@ struct mca_ras_info {
|
||||
|
||||
#define P2S_TABLE_ID_A 0x50325341
|
||||
#define P2S_TABLE_ID_X 0x50325358
|
||||
#define P2S_TABLE_ID_3 0x50325303
|
||||
|
||||
// clang-format off
|
||||
static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COUNT] = {
|
||||
@@ -271,14 +272,18 @@ static int smu_v13_0_6_init_microcode(struct smu_context *smu)
|
||||
struct amdgpu_device *adev = smu->adev;
|
||||
uint32_t p2s_table_id = P2S_TABLE_ID_A;
|
||||
int ret = 0, i, p2stable_count;
|
||||
int var = (adev->pdev->device & 0xF);
|
||||
char ucode_prefix[15];
|
||||
|
||||
/* No need to load P2S tables in IOV mode */
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
return 0;
|
||||
|
||||
if (!(adev->flags & AMD_IS_APU))
|
||||
if (!(adev->flags & AMD_IS_APU)) {
|
||||
p2s_table_id = P2S_TABLE_ID_X;
|
||||
if (var == 0x5)
|
||||
p2s_table_id = P2S_TABLE_ID_3;
|
||||
}
|
||||
|
||||
amdgpu_ucode_ip_version_decode(adev, MP1_HWIP, ucode_prefix,
|
||||
sizeof(ucode_prefix));
|
||||
|
||||
@@ -2378,7 +2378,7 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf
|
||||
|
||||
size += sysfs_emit_at(buf, size, " ");
|
||||
for (i = 0; i <= PP_SMC_POWER_PROFILE_WINDOW3D; i++)
|
||||
size += sysfs_emit_at(buf, size, "%-14s%s", amdgpu_pp_profile_name[i],
|
||||
size += sysfs_emit_at(buf, size, "%d %-14s%s", i, amdgpu_pp_profile_name[i],
|
||||
(i == smu->power_profile_mode) ? "* " : " ");
|
||||
|
||||
size += sysfs_emit_at(buf, size, "\n");
|
||||
@@ -2408,7 +2408,7 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf
|
||||
do { \
|
||||
size += sysfs_emit_at(buf, size, "%-30s", #field); \
|
||||
for (j = 0; j <= PP_SMC_POWER_PROFILE_WINDOW3D; j++) \
|
||||
size += sysfs_emit_at(buf, size, "%-16d", activity_monitor_external[j].DpmActivityMonitorCoeffInt.field); \
|
||||
size += sysfs_emit_at(buf, size, "%-18d", activity_monitor_external[j].DpmActivityMonitorCoeffInt.field); \
|
||||
size += sysfs_emit_at(buf, size, "\n"); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ static struct cmn2asic_msg_mapping smu_v14_0_2_message_map[SMU_MSG_MAX_COUNT] =
|
||||
MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0),
|
||||
MSG_MAP(GetPptLimit, PPSMC_MSG_GetPptLimit, 0),
|
||||
MSG_MAP(NotifyPowerSource, PPSMC_MSG_NotifyPowerSource, 0),
|
||||
MSG_MAP(Mode1Reset, PPSMC_MSG_Mode1Reset, 0),
|
||||
MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0),
|
||||
MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0),
|
||||
MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
|
||||
@@ -1824,50 +1823,6 @@ static void smu_v14_0_2_set_smu_mailbox_registers(struct smu_context *smu)
|
||||
smu->debug_resp_reg = SOC15_REG_OFFSET(MP1, 0, regMP1_SMN_C2PMSG_54);
|
||||
}
|
||||
|
||||
static int smu_v14_0_2_smu_send_bad_mem_page_num(struct smu_context *smu,
|
||||
uint32_t size)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/* message SMU to update the bad page number on SMUBUS */
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu,
|
||||
SMU_MSG_SetNumBadMemoryPagesRetired,
|
||||
size, NULL);
|
||||
if (ret)
|
||||
dev_err(smu->adev->dev,
|
||||
"[%s] failed to message SMU to update bad memory pages number\n",
|
||||
__func__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int smu_v14_0_2_send_bad_mem_channel_flag(struct smu_context *smu,
|
||||
uint32_t size)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/* message SMU to update the bad channel info on SMUBUS */
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu,
|
||||
SMU_MSG_SetBadMemoryPagesRetiredFlagsPerChannel,
|
||||
size, NULL);
|
||||
if (ret)
|
||||
dev_err(smu->adev->dev,
|
||||
"[%s] failed to message SMU to update bad memory pages channel info\n",
|
||||
__func__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t smu_v14_0_2_get_ecc_info(struct smu_context *smu,
|
||||
void *table)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
// TODO
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t smu_v14_0_2_get_gpu_metrics(struct smu_context *smu,
|
||||
void **table)
|
||||
{
|
||||
@@ -2015,12 +1970,9 @@ static const struct pptable_funcs smu_v14_0_2_ppt_funcs = {
|
||||
.enable_gfx_features = smu_v14_0_2_enable_gfx_features,
|
||||
.set_mp1_state = smu_v14_0_2_set_mp1_state,
|
||||
.set_df_cstate = smu_v14_0_2_set_df_cstate,
|
||||
.send_hbm_bad_pages_num = smu_v14_0_2_smu_send_bad_mem_page_num,
|
||||
.send_hbm_bad_channel_flag = smu_v14_0_2_send_bad_mem_channel_flag,
|
||||
#if 0
|
||||
.gpo_control = smu_v14_0_gpo_control,
|
||||
#endif
|
||||
.get_ecc_info = smu_v14_0_2_get_ecc_info,
|
||||
};
|
||||
|
||||
void smu_v14_0_2_set_ppt_funcs(struct smu_context *smu)
|
||||
|
||||
@@ -5935,6 +5935,18 @@ intel_dp_detect(struct drm_connector *connector,
|
||||
else
|
||||
status = connector_status_disconnected;
|
||||
|
||||
if (status != connector_status_disconnected &&
|
||||
!intel_dp_mst_verify_dpcd_state(intel_dp))
|
||||
/*
|
||||
* This requires retrying detection for instance to re-enable
|
||||
* the MST mode that got reset via a long HPD pulse. The retry
|
||||
* will happen either via the hotplug handler's retry logic,
|
||||
* ensured by setting the connector here to SST/disconnected,
|
||||
* or via a userspace connector probing in response to the
|
||||
* hotplug uevent sent when removing the MST connectors.
|
||||
*/
|
||||
status = connector_status_disconnected;
|
||||
|
||||
if (status == connector_status_disconnected) {
|
||||
memset(&intel_dp->compliance, 0, sizeof(intel_dp->compliance));
|
||||
memset(intel_connector->dp.dsc_dpcd, 0, sizeof(intel_connector->dp.dsc_dpcd));
|
||||
|
||||
@@ -1998,3 +1998,43 @@ bool intel_dp_mst_crtc_needs_modeset(struct intel_atomic_state *state,
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* intel_dp_mst_verify_dpcd_state - verify the MST SW enabled state wrt. the DPCD
|
||||
* @intel_dp: DP port object
|
||||
*
|
||||
* Verify if @intel_dp's MST enabled SW state matches the corresponding DPCD
|
||||
* state. A long HPD pulse - not long enough to be detected as a disconnected
|
||||
* state - could've reset the DPCD state, which requires tearing
|
||||
* down/recreating the MST topology.
|
||||
*
|
||||
* Returns %true if the SW MST enabled and DPCD states match, %false
|
||||
* otherwise.
|
||||
*/
|
||||
bool intel_dp_mst_verify_dpcd_state(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_connector *connector = intel_dp->attached_connector;
|
||||
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||
struct intel_encoder *encoder = &dig_port->base;
|
||||
int ret;
|
||||
u8 val;
|
||||
|
||||
if (!intel_dp->is_mst)
|
||||
return true;
|
||||
|
||||
ret = drm_dp_dpcd_readb(intel_dp->mst_mgr.aux, DP_MSTM_CTRL, &val);
|
||||
|
||||
/* Adjust the expected register value for SST + SideBand. */
|
||||
if (ret < 0 || val != (DP_MST_EN | DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC)) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"[CONNECTOR:%d:%s][ENCODER:%d:%s] MST mode got reset, removing topology (ret=%d, ctrl=0x%02x)\n",
|
||||
connector->base.base.id, connector->base.name,
|
||||
encoder->base.base.id, encoder->base.name,
|
||||
ret, val);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,5 +27,6 @@ int intel_dp_mst_atomic_check_link(struct intel_atomic_state *state,
|
||||
struct intel_link_bw_limits *limits);
|
||||
bool intel_dp_mst_crtc_needs_modeset(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
bool intel_dp_mst_verify_dpcd_state(struct intel_dp *intel_dp);
|
||||
|
||||
#endif /* __INTEL_DP_MST_H__ */
|
||||
|
||||
@@ -1870,7 +1870,6 @@ static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = {
|
||||
/* Lenovo Yoga Tab 3 Pro YT3-X90F */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
|
||||
},
|
||||
.driver_data = (void *)vlv_dsi_lenovo_yoga_tab3_backlight_fixup,
|
||||
|
||||
@@ -212,6 +212,37 @@ int intel_gsc_fw_get_binary_info(struct intel_uc_fw *gsc_fw, const void *data, s
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARROWLAKE(gt->i915)) {
|
||||
bool too_old = false;
|
||||
|
||||
/*
|
||||
* ARL requires a newer firmware than MTL did (102.0.10.1878) but the
|
||||
* firmware is actually common. So, need to do an explicit version check
|
||||
* here rather than using a separate table entry. And if the older
|
||||
* MTL-only version is found, then just don't use GSC rather than aborting
|
||||
* the driver load.
|
||||
*/
|
||||
if (gsc->release.major < 102) {
|
||||
too_old = true;
|
||||
} else if (gsc->release.major == 102) {
|
||||
if (gsc->release.minor == 0) {
|
||||
if (gsc->release.patch < 10) {
|
||||
too_old = true;
|
||||
} else if (gsc->release.patch == 10) {
|
||||
if (gsc->release.build < 1878)
|
||||
too_old = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (too_old) {
|
||||
gt_info(gt, "GSC firmware too old for ARL, got %d.%d.%d.%d but need at least 102.0.10.1878",
|
||||
gsc->release.major, gsc->release.minor,
|
||||
gsc->release.patch, gsc->release.build);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -698,12 +698,18 @@ static int check_gsc_manifest(struct intel_gt *gt,
|
||||
const struct firmware *fw,
|
||||
struct intel_uc_fw *uc_fw)
|
||||
{
|
||||
int ret;
|
||||
|
||||
switch (uc_fw->type) {
|
||||
case INTEL_UC_FW_TYPE_HUC:
|
||||
intel_huc_fw_get_binary_info(uc_fw, fw->data, fw->size);
|
||||
ret = intel_huc_fw_get_binary_info(uc_fw, fw->data, fw->size);
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
case INTEL_UC_FW_TYPE_GSC:
|
||||
intel_gsc_fw_get_binary_info(uc_fw, fw->data, fw->size);
|
||||
ret = intel_gsc_fw_get_binary_info(uc_fw, fw->data, fw->size);
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
default:
|
||||
MISSING_CASE(uc_fw->type);
|
||||
|
||||
@@ -546,6 +546,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
|
||||
#define IS_LUNARLAKE(i915) (0 && i915)
|
||||
#define IS_BATTLEMAGE(i915) (0 && i915)
|
||||
|
||||
#define IS_ARROWLAKE(i915) \
|
||||
IS_SUBPLATFORM(i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_ARL)
|
||||
#define IS_DG2_G10(i915) \
|
||||
IS_SUBPLATFORM(i915, INTEL_DG2, INTEL_SUBPLATFORM_G10)
|
||||
#define IS_DG2_G11(i915) \
|
||||
|
||||
@@ -203,6 +203,10 @@ static const u16 subplatform_g12_ids[] = {
|
||||
INTEL_DG2_G12_IDS(ID),
|
||||
};
|
||||
|
||||
static const u16 subplatform_arl_ids[] = {
|
||||
INTEL_ARL_IDS(ID),
|
||||
};
|
||||
|
||||
static bool find_devid(u16 id, const u16 *p, unsigned int num)
|
||||
{
|
||||
for (; num; num--, p++) {
|
||||
@@ -260,6 +264,9 @@ static void intel_device_info_subplatform_init(struct drm_i915_private *i915)
|
||||
} else if (find_devid(devid, subplatform_g12_ids,
|
||||
ARRAY_SIZE(subplatform_g12_ids))) {
|
||||
mask = BIT(INTEL_SUBPLATFORM_G12);
|
||||
} else if (find_devid(devid, subplatform_arl_ids,
|
||||
ARRAY_SIZE(subplatform_arl_ids))) {
|
||||
mask = BIT(INTEL_SUBPLATFORM_ARL);
|
||||
}
|
||||
|
||||
GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_MASK);
|
||||
|
||||
@@ -127,6 +127,9 @@ enum intel_platform {
|
||||
#define INTEL_SUBPLATFORM_N 1
|
||||
#define INTEL_SUBPLATFORM_RPLU 2
|
||||
|
||||
/* MTL */
|
||||
#define INTEL_SUBPLATFORM_ARL 0
|
||||
|
||||
enum intel_ppgtt_type {
|
||||
INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
|
||||
INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
|
||||
|
||||
@@ -134,6 +134,8 @@ v3d_job_start_stats(struct v3d_job *job, enum v3d_queue queue)
|
||||
struct v3d_stats *local_stats = &file->stats[queue];
|
||||
u64 now = local_clock();
|
||||
|
||||
preempt_disable();
|
||||
|
||||
write_seqcount_begin(&local_stats->lock);
|
||||
local_stats->start_ns = now;
|
||||
write_seqcount_end(&local_stats->lock);
|
||||
@@ -141,6 +143,8 @@ v3d_job_start_stats(struct v3d_job *job, enum v3d_queue queue)
|
||||
write_seqcount_begin(&global_stats->lock);
|
||||
global_stats->start_ns = now;
|
||||
write_seqcount_end(&global_stats->lock);
|
||||
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -162,8 +166,10 @@ v3d_job_update_stats(struct v3d_job *job, enum v3d_queue queue)
|
||||
struct v3d_stats *local_stats = &file->stats[queue];
|
||||
u64 now = local_clock();
|
||||
|
||||
preempt_disable();
|
||||
v3d_stats_update(local_stats, now);
|
||||
v3d_stats_update(global_stats, now);
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
static struct dma_fence *v3d_bin_job_run(struct drm_sched_job *sched_job)
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "vmwgfx_drv.h"
|
||||
|
||||
#include "vmwgfx_bo.h"
|
||||
#include <linux/highmem.h>
|
||||
|
||||
/*
|
||||
@@ -420,13 +422,105 @@ static int vmw_bo_cpu_blit_line(struct vmw_bo_blit_line_data *d,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *map_external(struct vmw_bo *bo, struct iosys_map *map)
|
||||
{
|
||||
struct vmw_private *vmw =
|
||||
container_of(bo->tbo.bdev, struct vmw_private, bdev);
|
||||
void *ptr = NULL;
|
||||
int ret;
|
||||
|
||||
if (bo->tbo.base.import_attach) {
|
||||
ret = dma_buf_vmap(bo->tbo.base.dma_buf, map);
|
||||
if (ret) {
|
||||
drm_dbg_driver(&vmw->drm,
|
||||
"Wasn't able to map external bo!\n");
|
||||
goto out;
|
||||
}
|
||||
ptr = map->vaddr;
|
||||
} else {
|
||||
ptr = vmw_bo_map_and_cache(bo);
|
||||
}
|
||||
|
||||
out:
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static void unmap_external(struct vmw_bo *bo, struct iosys_map *map)
|
||||
{
|
||||
if (bo->tbo.base.import_attach)
|
||||
dma_buf_vunmap(bo->tbo.base.dma_buf, map);
|
||||
else
|
||||
vmw_bo_unmap(bo);
|
||||
}
|
||||
|
||||
static int vmw_external_bo_copy(struct vmw_bo *dst, u32 dst_offset,
|
||||
u32 dst_stride, struct vmw_bo *src,
|
||||
u32 src_offset, u32 src_stride,
|
||||
u32 width_in_bytes, u32 height,
|
||||
struct vmw_diff_cpy *diff)
|
||||
{
|
||||
struct vmw_private *vmw =
|
||||
container_of(dst->tbo.bdev, struct vmw_private, bdev);
|
||||
size_t dst_size = dst->tbo.resource->size;
|
||||
size_t src_size = src->tbo.resource->size;
|
||||
struct iosys_map dst_map = {0};
|
||||
struct iosys_map src_map = {0};
|
||||
int ret, i;
|
||||
int x_in_bytes;
|
||||
u8 *vsrc;
|
||||
u8 *vdst;
|
||||
|
||||
vsrc = map_external(src, &src_map);
|
||||
if (!vsrc) {
|
||||
drm_dbg_driver(&vmw->drm, "Wasn't able to map src\n");
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
vdst = map_external(dst, &dst_map);
|
||||
if (!vdst) {
|
||||
drm_dbg_driver(&vmw->drm, "Wasn't able to map dst\n");
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
vsrc += src_offset;
|
||||
vdst += dst_offset;
|
||||
if (src_stride == dst_stride) {
|
||||
dst_size -= dst_offset;
|
||||
src_size -= src_offset;
|
||||
memcpy(vdst, vsrc,
|
||||
min(dst_stride * height, min(dst_size, src_size)));
|
||||
} else {
|
||||
WARN_ON(dst_stride < width_in_bytes);
|
||||
for (i = 0; i < height; ++i) {
|
||||
memcpy(vdst, vsrc, width_in_bytes);
|
||||
vsrc += src_stride;
|
||||
vdst += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
x_in_bytes = (dst_offset % dst_stride);
|
||||
diff->rect.x1 = x_in_bytes / diff->cpp;
|
||||
diff->rect.y1 = ((dst_offset - x_in_bytes) / dst_stride);
|
||||
diff->rect.x2 = diff->rect.x1 + width_in_bytes / diff->cpp;
|
||||
diff->rect.y2 = diff->rect.y1 + height;
|
||||
|
||||
ret = 0;
|
||||
out:
|
||||
unmap_external(src, &src_map);
|
||||
unmap_external(dst, &dst_map);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* vmw_bo_cpu_blit - in-kernel cpu blit.
|
||||
*
|
||||
* @dst: Destination buffer object.
|
||||
* @vmw_dst: Destination buffer object.
|
||||
* @dst_offset: Destination offset of blit start in bytes.
|
||||
* @dst_stride: Destination stride in bytes.
|
||||
* @src: Source buffer object.
|
||||
* @vmw_src: Source buffer object.
|
||||
* @src_offset: Source offset of blit start in bytes.
|
||||
* @src_stride: Source stride in bytes.
|
||||
* @w: Width of blit.
|
||||
@@ -444,13 +538,15 @@ static int vmw_bo_cpu_blit_line(struct vmw_bo_blit_line_data *d,
|
||||
* Neither of the buffer objects may be placed in PCI memory
|
||||
* (Fixed memory in TTM terminology) when using this function.
|
||||
*/
|
||||
int vmw_bo_cpu_blit(struct ttm_buffer_object *dst,
|
||||
int vmw_bo_cpu_blit(struct vmw_bo *vmw_dst,
|
||||
u32 dst_offset, u32 dst_stride,
|
||||
struct ttm_buffer_object *src,
|
||||
struct vmw_bo *vmw_src,
|
||||
u32 src_offset, u32 src_stride,
|
||||
u32 w, u32 h,
|
||||
struct vmw_diff_cpy *diff)
|
||||
{
|
||||
struct ttm_buffer_object *src = &vmw_src->tbo;
|
||||
struct ttm_buffer_object *dst = &vmw_dst->tbo;
|
||||
struct ttm_operation_ctx ctx = {
|
||||
.interruptible = false,
|
||||
.no_wait_gpu = false
|
||||
@@ -460,6 +556,11 @@ int vmw_bo_cpu_blit(struct ttm_buffer_object *dst,
|
||||
int ret = 0;
|
||||
struct page **dst_pages = NULL;
|
||||
struct page **src_pages = NULL;
|
||||
bool src_external = (src->ttm->page_flags & TTM_TT_FLAG_EXTERNAL) != 0;
|
||||
bool dst_external = (dst->ttm->page_flags & TTM_TT_FLAG_EXTERNAL) != 0;
|
||||
|
||||
if (WARN_ON(dst == src))
|
||||
return -EINVAL;
|
||||
|
||||
/* Buffer objects need to be either pinned or reserved: */
|
||||
if (!(dst->pin_count))
|
||||
@@ -479,6 +580,11 @@ int vmw_bo_cpu_blit(struct ttm_buffer_object *dst,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (src_external || dst_external)
|
||||
return vmw_external_bo_copy(vmw_dst, dst_offset, dst_stride,
|
||||
vmw_src, src_offset, src_stride,
|
||||
w, h, diff);
|
||||
|
||||
if (!src->ttm->pages && src->ttm->sg) {
|
||||
src_pages = kvmalloc_array(src->ttm->num_pages,
|
||||
sizeof(struct page *), GFP_KERNEL);
|
||||
|
||||
@@ -360,6 +360,8 @@ void *vmw_bo_map_and_cache_size(struct vmw_bo *vbo, size_t size)
|
||||
void *virtual;
|
||||
int ret;
|
||||
|
||||
atomic_inc(&vbo->map_count);
|
||||
|
||||
virtual = ttm_kmap_obj_virtual(&vbo->map, ¬_used);
|
||||
if (virtual)
|
||||
return virtual;
|
||||
@@ -383,11 +385,17 @@ void *vmw_bo_map_and_cache_size(struct vmw_bo *vbo, size_t size)
|
||||
*/
|
||||
void vmw_bo_unmap(struct vmw_bo *vbo)
|
||||
{
|
||||
int map_count;
|
||||
|
||||
if (vbo->map.bo == NULL)
|
||||
return;
|
||||
|
||||
ttm_bo_kunmap(&vbo->map);
|
||||
vbo->map.bo = NULL;
|
||||
map_count = atomic_dec_return(&vbo->map_count);
|
||||
|
||||
if (!map_count) {
|
||||
ttm_bo_kunmap(&vbo->map);
|
||||
vbo->map.bo = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -421,6 +429,7 @@ static int vmw_bo_init(struct vmw_private *dev_priv,
|
||||
vmw_bo->tbo.priority = 3;
|
||||
vmw_bo->res_tree = RB_ROOT;
|
||||
xa_init(&vmw_bo->detached_resources);
|
||||
atomic_set(&vmw_bo->map_count, 0);
|
||||
|
||||
params->size = ALIGN(params->size, PAGE_SIZE);
|
||||
drm_gem_private_object_init(vdev, &vmw_bo->tbo.base, params->size);
|
||||
|
||||
@@ -71,6 +71,8 @@ struct vmw_bo_params {
|
||||
* @map: Kmap object for semi-persistent mappings
|
||||
* @res_tree: RB tree of resources using this buffer object as a backing MOB
|
||||
* @res_prios: Eviction priority counts for attached resources
|
||||
* @map_count: The number of currently active maps. Will differ from the
|
||||
* cpu_writers because it includes kernel maps.
|
||||
* @cpu_writers: Number of synccpu write grabs. Protected by reservation when
|
||||
* increased. May be decreased without reservation.
|
||||
* @dx_query_ctx: DX context if this buffer object is used as a DX query MOB
|
||||
@@ -90,6 +92,7 @@ struct vmw_bo {
|
||||
u32 res_prios[TTM_MAX_BO_PRIORITY];
|
||||
struct xarray detached_resources;
|
||||
|
||||
atomic_t map_count;
|
||||
atomic_t cpu_writers;
|
||||
/* Not ref-counted. Protected by binding_mutex */
|
||||
struct vmw_resource *dx_query_ctx;
|
||||
|
||||
@@ -1353,9 +1353,9 @@ void vmw_diff_memcpy(struct vmw_diff_cpy *diff, u8 *dest, const u8 *src,
|
||||
|
||||
void vmw_memcpy(struct vmw_diff_cpy *diff, u8 *dest, const u8 *src, size_t n);
|
||||
|
||||
int vmw_bo_cpu_blit(struct ttm_buffer_object *dst,
|
||||
int vmw_bo_cpu_blit(struct vmw_bo *dst,
|
||||
u32 dst_offset, u32 dst_stride,
|
||||
struct ttm_buffer_object *src,
|
||||
struct vmw_bo *src,
|
||||
u32 src_offset, u32 src_stride,
|
||||
u32 w, u32 h,
|
||||
struct vmw_diff_cpy *diff);
|
||||
|
||||
@@ -502,7 +502,7 @@ static void vmw_stdu_bo_cpu_commit(struct vmw_kms_dirty *dirty)
|
||||
container_of(dirty->unit, typeof(*stdu), base);
|
||||
s32 width, height;
|
||||
s32 src_pitch, dst_pitch;
|
||||
struct ttm_buffer_object *src_bo, *dst_bo;
|
||||
struct vmw_bo *src_bo, *dst_bo;
|
||||
u32 src_offset, dst_offset;
|
||||
struct vmw_diff_cpy diff = VMW_CPU_BLIT_DIFF_INITIALIZER(stdu->cpp);
|
||||
|
||||
@@ -517,11 +517,11 @@ static void vmw_stdu_bo_cpu_commit(struct vmw_kms_dirty *dirty)
|
||||
|
||||
/* Assume we are blitting from Guest (bo) to Host (display_srf) */
|
||||
src_pitch = stdu->display_srf->metadata.base_size.width * stdu->cpp;
|
||||
src_bo = &stdu->display_srf->res.guest_memory_bo->tbo;
|
||||
src_bo = stdu->display_srf->res.guest_memory_bo;
|
||||
src_offset = ddirty->top * src_pitch + ddirty->left * stdu->cpp;
|
||||
|
||||
dst_pitch = ddirty->pitch;
|
||||
dst_bo = &ddirty->buf->tbo;
|
||||
dst_bo = ddirty->buf;
|
||||
dst_offset = ddirty->fb_top * dst_pitch + ddirty->fb_left * stdu->cpp;
|
||||
|
||||
(void) vmw_bo_cpu_blit(dst_bo, dst_offset, dst_pitch,
|
||||
@@ -1170,7 +1170,7 @@ vmw_stdu_bo_populate_update_cpu(struct vmw_du_update_plane *update, void *cmd,
|
||||
struct vmw_diff_cpy diff = VMW_CPU_BLIT_DIFF_INITIALIZER(0);
|
||||
struct vmw_stdu_update_gb_image *cmd_img = cmd;
|
||||
struct vmw_stdu_update *cmd_update;
|
||||
struct ttm_buffer_object *src_bo, *dst_bo;
|
||||
struct vmw_bo *src_bo, *dst_bo;
|
||||
u32 src_offset, dst_offset;
|
||||
s32 src_pitch, dst_pitch;
|
||||
s32 width, height;
|
||||
@@ -1184,11 +1184,11 @@ vmw_stdu_bo_populate_update_cpu(struct vmw_du_update_plane *update, void *cmd,
|
||||
|
||||
diff.cpp = stdu->cpp;
|
||||
|
||||
dst_bo = &stdu->display_srf->res.guest_memory_bo->tbo;
|
||||
dst_bo = stdu->display_srf->res.guest_memory_bo;
|
||||
dst_pitch = stdu->display_srf->metadata.base_size.width * stdu->cpp;
|
||||
dst_offset = bb->y1 * dst_pitch + bb->x1 * stdu->cpp;
|
||||
|
||||
src_bo = &vfbbo->buffer->tbo;
|
||||
src_bo = vfbbo->buffer;
|
||||
src_pitch = update->vfb->base.pitches[0];
|
||||
src_offset = bo_update->fb_top * src_pitch + bo_update->fb_left *
|
||||
stdu->cpp;
|
||||
|
||||
@@ -2283,9 +2283,11 @@ int vmw_dumb_create(struct drm_file *file_priv,
|
||||
/*
|
||||
* Without mob support we're just going to use raw memory buffer
|
||||
* because we wouldn't be able to support full surface coherency
|
||||
* without mobs
|
||||
* without mobs. There also no reason to support surface coherency
|
||||
* without 3d (i.e. gpu usage on the host) because then all the
|
||||
* contents is going to be rendered guest side.
|
||||
*/
|
||||
if (!dev_priv->has_mob) {
|
||||
if (!dev_priv->has_mob || !vmw_supports_3d(dev_priv)) {
|
||||
int cpp = DIV_ROUND_UP(args->bpp, 8);
|
||||
|
||||
switch (cpp) {
|
||||
|
||||
@@ -450,7 +450,7 @@ static int xe_hwmon_pcode_write_i1(struct xe_gt *gt, u32 uval)
|
||||
{
|
||||
return xe_pcode_write(gt, PCODE_MBOX(PCODE_POWER_SETUP,
|
||||
POWER_SETUP_SUBCOMMAND_WRITE_I1, 0),
|
||||
uval);
|
||||
(uval & POWER_SETUP_I1_DATA_MASK));
|
||||
}
|
||||
|
||||
static int xe_hwmon_power_curr_crit_read(struct xe_hwmon *hwmon, int channel,
|
||||
|
||||
+24
-13
@@ -3341,9 +3341,10 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
|
||||
{
|
||||
struct xe_device *xe = xe_vma_vm(vma)->xe;
|
||||
struct xe_tile *tile;
|
||||
struct xe_gt_tlb_invalidation_fence fence[XE_MAX_TILES_PER_DEVICE];
|
||||
u32 tile_needs_invalidate = 0;
|
||||
struct xe_gt_tlb_invalidation_fence
|
||||
fence[XE_MAX_TILES_PER_DEVICE * XE_MAX_GT_PER_TILE];
|
||||
u8 id;
|
||||
u32 fence_id = 0;
|
||||
int ret = 0;
|
||||
|
||||
xe_assert(xe, !xe_vma_is_null(vma));
|
||||
@@ -3371,27 +3372,37 @@ int xe_vm_invalidate_vma(struct xe_vma *vma)
|
||||
if (xe_pt_zap_ptes(tile, vma)) {
|
||||
xe_device_wmb(xe);
|
||||
xe_gt_tlb_invalidation_fence_init(tile->primary_gt,
|
||||
&fence[id], true);
|
||||
&fence[fence_id],
|
||||
true);
|
||||
|
||||
/*
|
||||
* FIXME: We potentially need to invalidate multiple
|
||||
* GTs within the tile
|
||||
*/
|
||||
ret = xe_gt_tlb_invalidation_vma(tile->primary_gt,
|
||||
&fence[id], vma);
|
||||
&fence[fence_id], vma);
|
||||
if (ret < 0) {
|
||||
xe_gt_tlb_invalidation_fence_fini(&fence[id]);
|
||||
xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]);
|
||||
goto wait;
|
||||
}
|
||||
++fence_id;
|
||||
|
||||
tile_needs_invalidate |= BIT(id);
|
||||
if (!tile->media_gt)
|
||||
continue;
|
||||
|
||||
xe_gt_tlb_invalidation_fence_init(tile->media_gt,
|
||||
&fence[fence_id],
|
||||
true);
|
||||
|
||||
ret = xe_gt_tlb_invalidation_vma(tile->media_gt,
|
||||
&fence[fence_id], vma);
|
||||
if (ret < 0) {
|
||||
xe_gt_tlb_invalidation_fence_fini(&fence[fence_id]);
|
||||
goto wait;
|
||||
}
|
||||
++fence_id;
|
||||
}
|
||||
}
|
||||
|
||||
wait:
|
||||
for_each_tile(tile, xe, id)
|
||||
if (tile_needs_invalidate & BIT(id))
|
||||
xe_gt_tlb_invalidation_fence_wait(&fence[id]);
|
||||
for (id = 0; id < fence_id; ++id)
|
||||
xe_gt_tlb_invalidation_fence_wait(&fence[id]);
|
||||
|
||||
vma->tile_invalidated = vma->tile_mask;
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ static const struct ec_board_info board_info_strix_b550_i_gaming = {
|
||||
|
||||
static const struct ec_board_info board_info_strix_x570_e_gaming = {
|
||||
.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
|
||||
SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
|
||||
SENSOR_TEMP_T_SENSOR |
|
||||
SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
|
||||
SENSOR_IN_CPU_CORE,
|
||||
.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
|
||||
|
||||
@@ -427,7 +427,7 @@ static int pt5161l_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
struct pt5161l_data *data = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
u8 buf[8];
|
||||
long adc_code;
|
||||
u32 adc_code;
|
||||
|
||||
switch (attr) {
|
||||
case hwmon_temp_input:
|
||||
@@ -449,7 +449,7 @@ static int pt5161l_read(struct device *dev, enum hwmon_sensor_types type,
|
||||
|
||||
adc_code = buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
|
||||
if (adc_code == 0 || adc_code >= 0x3ff) {
|
||||
dev_dbg(dev, "Invalid adc_code %lx\n", adc_code);
|
||||
dev_dbg(dev, "Invalid adc_code %x\n", adc_code);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,48 +91,6 @@ static int cypress_ps2_ext_cmd(struct psmouse *psmouse, u8 prefix, u8 nibble)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int cypress_ps2_read_cmd_status(struct psmouse *psmouse,
|
||||
u8 cmd, u8 *param)
|
||||
{
|
||||
struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
enum psmouse_state old_state;
|
||||
int pktsize;
|
||||
int rc;
|
||||
|
||||
ps2_begin_command(ps2dev);
|
||||
|
||||
old_state = psmouse->state;
|
||||
psmouse->state = PSMOUSE_CMD_MODE;
|
||||
psmouse->pktcnt = 0;
|
||||
|
||||
pktsize = (cmd == CYTP_CMD_READ_TP_METRICS) ? 8 : 3;
|
||||
memset(param, 0, pktsize);
|
||||
|
||||
rc = cypress_ps2_sendbyte(psmouse, PSMOUSE_CMD_GETINFO & 0xff);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
if (!wait_event_timeout(ps2dev->wait,
|
||||
psmouse->pktcnt >= pktsize,
|
||||
msecs_to_jiffies(CYTP_CMD_TIMEOUT))) {
|
||||
rc = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memcpy(param, psmouse->packet, pktsize);
|
||||
|
||||
psmouse_dbg(psmouse, "Command 0x%02x response data (0x): %*ph\n",
|
||||
cmd, pktsize, param);
|
||||
|
||||
out:
|
||||
psmouse->state = old_state;
|
||||
psmouse->pktcnt = 0;
|
||||
|
||||
ps2_end_command(ps2dev);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static bool cypress_verify_cmd_state(struct psmouse *psmouse, u8 cmd, u8* param)
|
||||
{
|
||||
bool rate_match = false;
|
||||
@@ -166,6 +124,8 @@ static bool cypress_verify_cmd_state(struct psmouse *psmouse, u8 cmd, u8* param)
|
||||
static int cypress_send_ext_cmd(struct psmouse *psmouse, u8 cmd, u8 *param)
|
||||
{
|
||||
u8 cmd_prefix = PSMOUSE_CMD_SETRES & 0xff;
|
||||
unsigned int resp_size = cmd == CYTP_CMD_READ_TP_METRICS ? 8 : 3;
|
||||
unsigned int ps2_cmd = (PSMOUSE_CMD_GETINFO & 0xff) | (resp_size << 8);
|
||||
int tries = CYTP_PS2_CMD_TRIES;
|
||||
int error;
|
||||
|
||||
@@ -179,10 +139,18 @@ static int cypress_send_ext_cmd(struct psmouse *psmouse, u8 cmd, u8 *param)
|
||||
cypress_ps2_ext_cmd(psmouse, cmd_prefix, DECODE_CMD_BB(cmd));
|
||||
cypress_ps2_ext_cmd(psmouse, cmd_prefix, DECODE_CMD_AA(cmd));
|
||||
|
||||
error = cypress_ps2_read_cmd_status(psmouse, cmd, param);
|
||||
if (!error && cypress_verify_cmd_state(psmouse, cmd, param))
|
||||
return 0;
|
||||
error = ps2_command(&psmouse->ps2dev, param, ps2_cmd);
|
||||
if (error) {
|
||||
psmouse_dbg(psmouse, "Command 0x%02x failed: %d\n",
|
||||
cmd, error);
|
||||
} else {
|
||||
psmouse_dbg(psmouse,
|
||||
"Command 0x%02x response data (0x): %*ph\n",
|
||||
cmd, resp_size, param);
|
||||
|
||||
if (cypress_verify_cmd_state(psmouse, cmd, param))
|
||||
return 0;
|
||||
}
|
||||
} while (--tries > 0);
|
||||
|
||||
return -EIO;
|
||||
|
||||
@@ -1777,7 +1777,7 @@ static int arm_smmu_handle_evt(struct arm_smmu_device *smmu, u64 *evt)
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
iommu_report_device_fault(master->dev, &fault_evt);
|
||||
ret = iommu_report_device_fault(master->dev, &fault_evt);
|
||||
out_unlock:
|
||||
mutex_unlock(&smmu->streams_mutex);
|
||||
return ret;
|
||||
|
||||
@@ -1944,6 +1944,7 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
|
||||
{
|
||||
struct intel_iommu *iommu = info->iommu;
|
||||
struct context_entry *context;
|
||||
u16 did;
|
||||
|
||||
spin_lock(&iommu->lock);
|
||||
context = iommu_context_addr(iommu, bus, devfn, 0);
|
||||
@@ -1952,10 +1953,11 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
|
||||
return;
|
||||
}
|
||||
|
||||
did = context_domain_id(context);
|
||||
context_clear_entry(context);
|
||||
__iommu_flush_cache(iommu, context, sizeof(*context));
|
||||
spin_unlock(&iommu->lock);
|
||||
intel_context_flush_present(info, context, true);
|
||||
intel_context_flush_present(info, context, did, true);
|
||||
}
|
||||
|
||||
static int domain_setup_first_level(struct intel_iommu *iommu,
|
||||
@@ -4249,6 +4251,7 @@ static int context_flip_pri(struct device_domain_info *info, bool enable)
|
||||
struct intel_iommu *iommu = info->iommu;
|
||||
u8 bus = info->bus, devfn = info->devfn;
|
||||
struct context_entry *context;
|
||||
u16 did;
|
||||
|
||||
spin_lock(&iommu->lock);
|
||||
if (context_copied(iommu, bus, devfn)) {
|
||||
@@ -4261,6 +4264,7 @@ static int context_flip_pri(struct device_domain_info *info, bool enable)
|
||||
spin_unlock(&iommu->lock);
|
||||
return -ENODEV;
|
||||
}
|
||||
did = context_domain_id(context);
|
||||
|
||||
if (enable)
|
||||
context_set_sm_pre(context);
|
||||
@@ -4269,7 +4273,7 @@ static int context_flip_pri(struct device_domain_info *info, bool enable)
|
||||
|
||||
if (!ecap_coherent(iommu->ecap))
|
||||
clflush_cache_range(context, sizeof(*context));
|
||||
intel_context_flush_present(info, context, true);
|
||||
intel_context_flush_present(info, context, did, true);
|
||||
spin_unlock(&iommu->lock);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1154,7 +1154,7 @@ void cache_tag_flush_range_np(struct dmar_domain *domain, unsigned long start,
|
||||
|
||||
void intel_context_flush_present(struct device_domain_info *info,
|
||||
struct context_entry *context,
|
||||
bool affect_domains);
|
||||
u16 did, bool affect_domains);
|
||||
|
||||
#ifdef CONFIG_INTEL_IOMMU_SVM
|
||||
void intel_svm_check(struct intel_iommu *iommu);
|
||||
|
||||
@@ -683,6 +683,7 @@ static void device_pasid_table_teardown(struct device *dev, u8 bus, u8 devfn)
|
||||
struct device_domain_info *info = dev_iommu_priv_get(dev);
|
||||
struct intel_iommu *iommu = info->iommu;
|
||||
struct context_entry *context;
|
||||
u16 did;
|
||||
|
||||
spin_lock(&iommu->lock);
|
||||
context = iommu_context_addr(iommu, bus, devfn, false);
|
||||
@@ -691,10 +692,11 @@ static void device_pasid_table_teardown(struct device *dev, u8 bus, u8 devfn)
|
||||
return;
|
||||
}
|
||||
|
||||
did = context_domain_id(context);
|
||||
context_clear_entry(context);
|
||||
__iommu_flush_cache(iommu, context, sizeof(*context));
|
||||
spin_unlock(&iommu->lock);
|
||||
intel_context_flush_present(info, context, false);
|
||||
intel_context_flush_present(info, context, did, false);
|
||||
}
|
||||
|
||||
static int pci_pasid_table_teardown(struct pci_dev *pdev, u16 alias, void *data)
|
||||
@@ -885,10 +887,9 @@ static void __context_flush_dev_iotlb(struct device_domain_info *info)
|
||||
*/
|
||||
void intel_context_flush_present(struct device_domain_info *info,
|
||||
struct context_entry *context,
|
||||
bool flush_domains)
|
||||
u16 did, bool flush_domains)
|
||||
{
|
||||
struct intel_iommu *iommu = info->iommu;
|
||||
u16 did = context_domain_id(context);
|
||||
struct pasid_entry *pte;
|
||||
int i;
|
||||
|
||||
|
||||
+83
-38
@@ -115,6 +115,59 @@ static struct iopf_group *iopf_group_alloc(struct iommu_fault_param *iopf_param,
|
||||
return group;
|
||||
}
|
||||
|
||||
static struct iommu_attach_handle *find_fault_handler(struct device *dev,
|
||||
struct iopf_fault *evt)
|
||||
{
|
||||
struct iommu_fault *fault = &evt->fault;
|
||||
struct iommu_attach_handle *attach_handle;
|
||||
|
||||
if (fault->prm.flags & IOMMU_FAULT_PAGE_REQUEST_PASID_VALID) {
|
||||
attach_handle = iommu_attach_handle_get(dev->iommu_group,
|
||||
fault->prm.pasid, 0);
|
||||
if (IS_ERR(attach_handle)) {
|
||||
const struct iommu_ops *ops = dev_iommu_ops(dev);
|
||||
|
||||
if (!ops->user_pasid_table)
|
||||
return NULL;
|
||||
/*
|
||||
* The iommu driver for this device supports user-
|
||||
* managed PASID table. Therefore page faults for
|
||||
* any PASID should go through the NESTING domain
|
||||
* attached to the device RID.
|
||||
*/
|
||||
attach_handle = iommu_attach_handle_get(
|
||||
dev->iommu_group, IOMMU_NO_PASID,
|
||||
IOMMU_DOMAIN_NESTED);
|
||||
if (IS_ERR(attach_handle))
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
attach_handle = iommu_attach_handle_get(dev->iommu_group,
|
||||
IOMMU_NO_PASID, 0);
|
||||
|
||||
if (IS_ERR(attach_handle))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!attach_handle->domain->iopf_handler)
|
||||
return NULL;
|
||||
|
||||
return attach_handle;
|
||||
}
|
||||
|
||||
static void iopf_error_response(struct device *dev, struct iopf_fault *evt)
|
||||
{
|
||||
const struct iommu_ops *ops = dev_iommu_ops(dev);
|
||||
struct iommu_fault *fault = &evt->fault;
|
||||
struct iommu_page_response resp = {
|
||||
.pasid = fault->prm.pasid,
|
||||
.grpid = fault->prm.grpid,
|
||||
.code = IOMMU_PAGE_RESP_INVALID
|
||||
};
|
||||
|
||||
ops->page_response(dev, evt, &resp);
|
||||
}
|
||||
|
||||
/**
|
||||
* iommu_report_device_fault() - Report fault event to device driver
|
||||
* @dev: the device
|
||||
@@ -153,24 +206,39 @@ static struct iopf_group *iopf_group_alloc(struct iommu_fault_param *iopf_param,
|
||||
* handling framework should guarantee that the iommu domain could only be
|
||||
* freed after the device has stopped generating page faults (or the iommu
|
||||
* hardware has been set to block the page faults) and the pending page faults
|
||||
* have been flushed.
|
||||
* have been flushed. In case no page fault handler is attached or no iopf params
|
||||
* are setup, then the ops->page_response() is called to complete the evt.
|
||||
*
|
||||
* Returns 0 on success, or an error in case of a bad/failed iopf setup.
|
||||
*/
|
||||
void iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
|
||||
int iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
|
||||
{
|
||||
struct iommu_attach_handle *attach_handle;
|
||||
struct iommu_fault *fault = &evt->fault;
|
||||
struct iommu_fault_param *iopf_param;
|
||||
struct iopf_group abort_group = {};
|
||||
struct iopf_group *group;
|
||||
|
||||
attach_handle = find_fault_handler(dev, evt);
|
||||
if (!attach_handle)
|
||||
goto err_bad_iopf;
|
||||
|
||||
/*
|
||||
* Something has gone wrong if a fault capable domain is attached but no
|
||||
* iopf_param is setup
|
||||
*/
|
||||
iopf_param = iopf_get_dev_fault_param(dev);
|
||||
if (WARN_ON(!iopf_param))
|
||||
return;
|
||||
goto err_bad_iopf;
|
||||
|
||||
if (!(fault->prm.flags & IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE)) {
|
||||
report_partial_fault(iopf_param, fault);
|
||||
int ret;
|
||||
|
||||
ret = report_partial_fault(iopf_param, fault);
|
||||
iopf_put_dev_fault_param(iopf_param);
|
||||
/* A request that is not the last does not need to be ack'd */
|
||||
return;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -185,38 +253,7 @@ void iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
|
||||
if (group == &abort_group)
|
||||
goto err_abort;
|
||||
|
||||
if (fault->prm.flags & IOMMU_FAULT_PAGE_REQUEST_PASID_VALID) {
|
||||
group->attach_handle = iommu_attach_handle_get(dev->iommu_group,
|
||||
fault->prm.pasid,
|
||||
0);
|
||||
if (IS_ERR(group->attach_handle)) {
|
||||
const struct iommu_ops *ops = dev_iommu_ops(dev);
|
||||
|
||||
if (!ops->user_pasid_table)
|
||||
goto err_abort;
|
||||
|
||||
/*
|
||||
* The iommu driver for this device supports user-
|
||||
* managed PASID table. Therefore page faults for
|
||||
* any PASID should go through the NESTING domain
|
||||
* attached to the device RID.
|
||||
*/
|
||||
group->attach_handle =
|
||||
iommu_attach_handle_get(dev->iommu_group,
|
||||
IOMMU_NO_PASID,
|
||||
IOMMU_DOMAIN_NESTED);
|
||||
if (IS_ERR(group->attach_handle))
|
||||
goto err_abort;
|
||||
}
|
||||
} else {
|
||||
group->attach_handle =
|
||||
iommu_attach_handle_get(dev->iommu_group, IOMMU_NO_PASID, 0);
|
||||
if (IS_ERR(group->attach_handle))
|
||||
goto err_abort;
|
||||
}
|
||||
|
||||
if (!group->attach_handle->domain->iopf_handler)
|
||||
goto err_abort;
|
||||
group->attach_handle = attach_handle;
|
||||
|
||||
/*
|
||||
* On success iopf_handler must call iopf_group_response() and
|
||||
@@ -225,7 +262,7 @@ void iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
|
||||
if (group->attach_handle->domain->iopf_handler(group))
|
||||
goto err_abort;
|
||||
|
||||
return;
|
||||
return 0;
|
||||
|
||||
err_abort:
|
||||
dev_warn_ratelimited(dev, "iopf with pasid %d aborted\n",
|
||||
@@ -235,6 +272,14 @@ err_abort:
|
||||
__iopf_free_group(group);
|
||||
else
|
||||
iopf_free_group(group);
|
||||
|
||||
return 0;
|
||||
|
||||
err_bad_iopf:
|
||||
if (fault->type == IOMMU_FAULT_PAGE_REQ)
|
||||
iopf_error_response(dev, evt);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iommu_report_device_fault);
|
||||
|
||||
|
||||
@@ -552,9 +552,8 @@ static int arm_v7s_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
|
||||
paddr >= (1ULL << data->iop.cfg.oas)))
|
||||
return -ERANGE;
|
||||
|
||||
/* If no access, then nothing to do */
|
||||
if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
|
||||
while (pgcount--) {
|
||||
ret = __arm_v7s_map(data, iova, paddr, pgsize, prot, 1, data->pgd,
|
||||
|
||||
@@ -515,9 +515,8 @@ static int arm_lpae_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
|
||||
if (WARN_ON(iaext || paddr >> cfg->oas))
|
||||
return -ERANGE;
|
||||
|
||||
/* If no access, then nothing to do */
|
||||
if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE)))
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
|
||||
prot = arm_lpae_prot_to_pte(data, iommu_prot);
|
||||
ret = __arm_lpae_map(data, iova, paddr, pgsize, pgcount, prot, lvl,
|
||||
|
||||
@@ -245,9 +245,8 @@ static int dart_map_pages(struct io_pgtable_ops *ops, unsigned long iova,
|
||||
if (WARN_ON(paddr >> cfg->oas))
|
||||
return -ERANGE;
|
||||
|
||||
/* If no access, then nothing to do */
|
||||
if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE)))
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
|
||||
tbl = dart_get_table(data, iova);
|
||||
|
||||
|
||||
@@ -213,6 +213,10 @@ int iommufd_ioas_map(struct iommufd_ucmd *ucmd)
|
||||
if (cmd->iova >= ULONG_MAX || cmd->length >= ULONG_MAX)
|
||||
return -EOVERFLOW;
|
||||
|
||||
if (!(cmd->flags &
|
||||
(IOMMU_IOAS_MAP_WRITEABLE | IOMMU_IOAS_MAP_READABLE)))
|
||||
return -EINVAL;
|
||||
|
||||
ioas = iommufd_get_ioas(ucmd->ictx, cmd->ioas_id);
|
||||
if (IS_ERR(ioas))
|
||||
return PTR_ERR(ioas);
|
||||
@@ -253,6 +257,10 @@ int iommufd_ioas_copy(struct iommufd_ucmd *ucmd)
|
||||
cmd->dst_iova >= ULONG_MAX)
|
||||
return -EOVERFLOW;
|
||||
|
||||
if (!(cmd->flags &
|
||||
(IOMMU_IOAS_MAP_WRITEABLE | IOMMU_IOAS_MAP_READABLE)))
|
||||
return -EINVAL;
|
||||
|
||||
src_ioas = iommufd_get_ioas(ucmd->ictx, cmd->src_ioas_id);
|
||||
if (IS_ERR(src_ioas))
|
||||
return PTR_ERR(src_ioas);
|
||||
|
||||
+105
-54
@@ -427,6 +427,8 @@ static int bond_ipsec_add_sa(struct xfrm_state *xs,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct net_device *bond_dev = xs->xso.dev;
|
||||
struct net_device *real_dev;
|
||||
netdevice_tracker tracker;
|
||||
struct bond_ipsec *ipsec;
|
||||
struct bonding *bond;
|
||||
struct slave *slave;
|
||||
@@ -438,74 +440,80 @@ static int bond_ipsec_add_sa(struct xfrm_state *xs,
|
||||
rcu_read_lock();
|
||||
bond = netdev_priv(bond_dev);
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (!slave) {
|
||||
rcu_read_unlock();
|
||||
return -ENODEV;
|
||||
real_dev = slave ? slave->dev : NULL;
|
||||
netdev_hold(real_dev, &tracker, GFP_ATOMIC);
|
||||
rcu_read_unlock();
|
||||
if (!real_dev) {
|
||||
err = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!slave->dev->xfrmdev_ops ||
|
||||
!slave->dev->xfrmdev_ops->xdo_dev_state_add ||
|
||||
netif_is_bond_master(slave->dev)) {
|
||||
if (!real_dev->xfrmdev_ops ||
|
||||
!real_dev->xfrmdev_ops->xdo_dev_state_add ||
|
||||
netif_is_bond_master(real_dev)) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "Slave does not support ipsec offload");
|
||||
rcu_read_unlock();
|
||||
return -EINVAL;
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ipsec = kmalloc(sizeof(*ipsec), GFP_ATOMIC);
|
||||
ipsec = kmalloc(sizeof(*ipsec), GFP_KERNEL);
|
||||
if (!ipsec) {
|
||||
rcu_read_unlock();
|
||||
return -ENOMEM;
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
xs->xso.real_dev = slave->dev;
|
||||
|
||||
err = slave->dev->xfrmdev_ops->xdo_dev_state_add(xs, extack);
|
||||
xs->xso.real_dev = real_dev;
|
||||
err = real_dev->xfrmdev_ops->xdo_dev_state_add(xs, extack);
|
||||
if (!err) {
|
||||
ipsec->xs = xs;
|
||||
INIT_LIST_HEAD(&ipsec->list);
|
||||
spin_lock_bh(&bond->ipsec_lock);
|
||||
mutex_lock(&bond->ipsec_lock);
|
||||
list_add(&ipsec->list, &bond->ipsec_list);
|
||||
spin_unlock_bh(&bond->ipsec_lock);
|
||||
mutex_unlock(&bond->ipsec_lock);
|
||||
} else {
|
||||
kfree(ipsec);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
out:
|
||||
netdev_put(real_dev, &tracker);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void bond_ipsec_add_sa_all(struct bonding *bond)
|
||||
{
|
||||
struct net_device *bond_dev = bond->dev;
|
||||
struct net_device *real_dev;
|
||||
struct bond_ipsec *ipsec;
|
||||
struct slave *slave;
|
||||
|
||||
rcu_read_lock();
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (!slave)
|
||||
goto out;
|
||||
slave = rtnl_dereference(bond->curr_active_slave);
|
||||
real_dev = slave ? slave->dev : NULL;
|
||||
if (!real_dev)
|
||||
return;
|
||||
|
||||
if (!slave->dev->xfrmdev_ops ||
|
||||
!slave->dev->xfrmdev_ops->xdo_dev_state_add ||
|
||||
netif_is_bond_master(slave->dev)) {
|
||||
spin_lock_bh(&bond->ipsec_lock);
|
||||
mutex_lock(&bond->ipsec_lock);
|
||||
if (!real_dev->xfrmdev_ops ||
|
||||
!real_dev->xfrmdev_ops->xdo_dev_state_add ||
|
||||
netif_is_bond_master(real_dev)) {
|
||||
if (!list_empty(&bond->ipsec_list))
|
||||
slave_warn(bond_dev, slave->dev,
|
||||
slave_warn(bond_dev, real_dev,
|
||||
"%s: no slave xdo_dev_state_add\n",
|
||||
__func__);
|
||||
spin_unlock_bh(&bond->ipsec_lock);
|
||||
goto out;
|
||||
}
|
||||
|
||||
spin_lock_bh(&bond->ipsec_lock);
|
||||
list_for_each_entry(ipsec, &bond->ipsec_list, list) {
|
||||
ipsec->xs->xso.real_dev = slave->dev;
|
||||
if (slave->dev->xfrmdev_ops->xdo_dev_state_add(ipsec->xs, NULL)) {
|
||||
slave_warn(bond_dev, slave->dev, "%s: failed to add SA\n", __func__);
|
||||
/* If new state is added before ipsec_lock acquired */
|
||||
if (ipsec->xs->xso.real_dev == real_dev)
|
||||
continue;
|
||||
|
||||
ipsec->xs->xso.real_dev = real_dev;
|
||||
if (real_dev->xfrmdev_ops->xdo_dev_state_add(ipsec->xs, NULL)) {
|
||||
slave_warn(bond_dev, real_dev, "%s: failed to add SA\n", __func__);
|
||||
ipsec->xs->xso.real_dev = NULL;
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&bond->ipsec_lock);
|
||||
out:
|
||||
rcu_read_unlock();
|
||||
mutex_unlock(&bond->ipsec_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,6 +523,8 @@ out:
|
||||
static void bond_ipsec_del_sa(struct xfrm_state *xs)
|
||||
{
|
||||
struct net_device *bond_dev = xs->xso.dev;
|
||||
struct net_device *real_dev;
|
||||
netdevice_tracker tracker;
|
||||
struct bond_ipsec *ipsec;
|
||||
struct bonding *bond;
|
||||
struct slave *slave;
|
||||
@@ -525,6 +535,9 @@ static void bond_ipsec_del_sa(struct xfrm_state *xs)
|
||||
rcu_read_lock();
|
||||
bond = netdev_priv(bond_dev);
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
real_dev = slave ? slave->dev : NULL;
|
||||
netdev_hold(real_dev, &tracker, GFP_ATOMIC);
|
||||
rcu_read_unlock();
|
||||
|
||||
if (!slave)
|
||||
goto out;
|
||||
@@ -532,18 +545,19 @@ static void bond_ipsec_del_sa(struct xfrm_state *xs)
|
||||
if (!xs->xso.real_dev)
|
||||
goto out;
|
||||
|
||||
WARN_ON(xs->xso.real_dev != slave->dev);
|
||||
WARN_ON(xs->xso.real_dev != real_dev);
|
||||
|
||||
if (!slave->dev->xfrmdev_ops ||
|
||||
!slave->dev->xfrmdev_ops->xdo_dev_state_delete ||
|
||||
netif_is_bond_master(slave->dev)) {
|
||||
slave_warn(bond_dev, slave->dev, "%s: no slave xdo_dev_state_delete\n", __func__);
|
||||
if (!real_dev->xfrmdev_ops ||
|
||||
!real_dev->xfrmdev_ops->xdo_dev_state_delete ||
|
||||
netif_is_bond_master(real_dev)) {
|
||||
slave_warn(bond_dev, real_dev, "%s: no slave xdo_dev_state_delete\n", __func__);
|
||||
goto out;
|
||||
}
|
||||
|
||||
slave->dev->xfrmdev_ops->xdo_dev_state_delete(xs);
|
||||
real_dev->xfrmdev_ops->xdo_dev_state_delete(xs);
|
||||
out:
|
||||
spin_lock_bh(&bond->ipsec_lock);
|
||||
netdev_put(real_dev, &tracker);
|
||||
mutex_lock(&bond->ipsec_lock);
|
||||
list_for_each_entry(ipsec, &bond->ipsec_list, list) {
|
||||
if (ipsec->xs == xs) {
|
||||
list_del(&ipsec->list);
|
||||
@@ -551,40 +565,72 @@ out:
|
||||
break;
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&bond->ipsec_lock);
|
||||
rcu_read_unlock();
|
||||
mutex_unlock(&bond->ipsec_lock);
|
||||
}
|
||||
|
||||
static void bond_ipsec_del_sa_all(struct bonding *bond)
|
||||
{
|
||||
struct net_device *bond_dev = bond->dev;
|
||||
struct net_device *real_dev;
|
||||
struct bond_ipsec *ipsec;
|
||||
struct slave *slave;
|
||||
|
||||
rcu_read_lock();
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (!slave) {
|
||||
rcu_read_unlock();
|
||||
slave = rtnl_dereference(bond->curr_active_slave);
|
||||
real_dev = slave ? slave->dev : NULL;
|
||||
if (!real_dev)
|
||||
return;
|
||||
}
|
||||
|
||||
spin_lock_bh(&bond->ipsec_lock);
|
||||
mutex_lock(&bond->ipsec_lock);
|
||||
list_for_each_entry(ipsec, &bond->ipsec_list, list) {
|
||||
if (!ipsec->xs->xso.real_dev)
|
||||
continue;
|
||||
|
||||
if (!slave->dev->xfrmdev_ops ||
|
||||
!slave->dev->xfrmdev_ops->xdo_dev_state_delete ||
|
||||
netif_is_bond_master(slave->dev)) {
|
||||
slave_warn(bond_dev, slave->dev,
|
||||
if (!real_dev->xfrmdev_ops ||
|
||||
!real_dev->xfrmdev_ops->xdo_dev_state_delete ||
|
||||
netif_is_bond_master(real_dev)) {
|
||||
slave_warn(bond_dev, real_dev,
|
||||
"%s: no slave xdo_dev_state_delete\n",
|
||||
__func__);
|
||||
} else {
|
||||
slave->dev->xfrmdev_ops->xdo_dev_state_delete(ipsec->xs);
|
||||
real_dev->xfrmdev_ops->xdo_dev_state_delete(ipsec->xs);
|
||||
if (real_dev->xfrmdev_ops->xdo_dev_state_free)
|
||||
real_dev->xfrmdev_ops->xdo_dev_state_free(ipsec->xs);
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&bond->ipsec_lock);
|
||||
mutex_unlock(&bond->ipsec_lock);
|
||||
}
|
||||
|
||||
static void bond_ipsec_free_sa(struct xfrm_state *xs)
|
||||
{
|
||||
struct net_device *bond_dev = xs->xso.dev;
|
||||
struct net_device *real_dev;
|
||||
netdevice_tracker tracker;
|
||||
struct bonding *bond;
|
||||
struct slave *slave;
|
||||
|
||||
if (!bond_dev)
|
||||
return;
|
||||
|
||||
rcu_read_lock();
|
||||
bond = netdev_priv(bond_dev);
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
real_dev = slave ? slave->dev : NULL;
|
||||
netdev_hold(real_dev, &tracker, GFP_ATOMIC);
|
||||
rcu_read_unlock();
|
||||
|
||||
if (!slave)
|
||||
goto out;
|
||||
|
||||
if (!xs->xso.real_dev)
|
||||
goto out;
|
||||
|
||||
WARN_ON(xs->xso.real_dev != real_dev);
|
||||
|
||||
if (real_dev && real_dev->xfrmdev_ops &&
|
||||
real_dev->xfrmdev_ops->xdo_dev_state_free)
|
||||
real_dev->xfrmdev_ops->xdo_dev_state_free(xs);
|
||||
out:
|
||||
netdev_put(real_dev, &tracker);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -627,6 +673,7 @@ out:
|
||||
static const struct xfrmdev_ops bond_xfrmdev_ops = {
|
||||
.xdo_dev_state_add = bond_ipsec_add_sa,
|
||||
.xdo_dev_state_delete = bond_ipsec_del_sa,
|
||||
.xdo_dev_state_free = bond_ipsec_free_sa,
|
||||
.xdo_dev_offload_ok = bond_ipsec_offload_ok,
|
||||
};
|
||||
#endif /* CONFIG_XFRM_OFFLOAD */
|
||||
@@ -5877,7 +5924,7 @@ void bond_setup(struct net_device *bond_dev)
|
||||
/* set up xfrm device ops (only supported in active-backup right now) */
|
||||
bond_dev->xfrmdev_ops = &bond_xfrmdev_ops;
|
||||
INIT_LIST_HEAD(&bond->ipsec_list);
|
||||
spin_lock_init(&bond->ipsec_lock);
|
||||
mutex_init(&bond->ipsec_lock);
|
||||
#endif /* CONFIG_XFRM_OFFLOAD */
|
||||
|
||||
/* don't acquire bond device's netif_tx_lock when transmitting */
|
||||
@@ -5926,6 +5973,10 @@ static void bond_uninit(struct net_device *bond_dev)
|
||||
__bond_release_one(bond_dev, slave->dev, true, true);
|
||||
netdev_info(bond_dev, "Released all slaves\n");
|
||||
|
||||
#ifdef CONFIG_XFRM_OFFLOAD
|
||||
mutex_destroy(&bond->ipsec_lock);
|
||||
#endif /* CONFIG_XFRM_OFFLOAD */
|
||||
|
||||
bond_set_slave_arr(bond, NULL, NULL);
|
||||
|
||||
list_del_rcu(&bond->bond_list);
|
||||
|
||||
@@ -572,7 +572,7 @@ static bool ftgmac100_rx_packet(struct ftgmac100 *priv, int *processed)
|
||||
(*processed)++;
|
||||
return true;
|
||||
|
||||
drop:
|
||||
drop:
|
||||
/* Clean rxdes0 (which resets own bit) */
|
||||
rxdes->rxdes0 = cpu_to_le32(status & priv->rxdes0_edorr_mask);
|
||||
priv->rx_pointer = ftgmac100_next_rx_pointer(priv, pointer);
|
||||
@@ -656,6 +656,11 @@ static bool ftgmac100_tx_complete_packet(struct ftgmac100 *priv)
|
||||
ftgmac100_free_tx_packet(priv, pointer, skb, txdes, ctl_stat);
|
||||
txdes->txdes0 = cpu_to_le32(ctl_stat & priv->txdes0_edotr_mask);
|
||||
|
||||
/* Ensure the descriptor config is visible before setting the tx
|
||||
* pointer.
|
||||
*/
|
||||
smp_wmb();
|
||||
|
||||
priv->tx_clean_pointer = ftgmac100_next_tx_pointer(priv, pointer);
|
||||
|
||||
return true;
|
||||
@@ -809,6 +814,11 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb,
|
||||
dma_wmb();
|
||||
first->txdes0 = cpu_to_le32(f_ctl_stat);
|
||||
|
||||
/* Ensure the descriptor config is visible before setting the tx
|
||||
* pointer.
|
||||
*/
|
||||
smp_wmb();
|
||||
|
||||
/* Update next TX pointer */
|
||||
priv->tx_pointer = pointer;
|
||||
|
||||
@@ -829,7 +839,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb,
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
dma_err:
|
||||
dma_err:
|
||||
if (net_ratelimit())
|
||||
netdev_err(netdev, "map tx fragment failed\n");
|
||||
|
||||
@@ -851,7 +861,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb,
|
||||
* last fragment, so we know ftgmac100_free_tx_packet()
|
||||
* hasn't freed the skb yet.
|
||||
*/
|
||||
drop:
|
||||
drop:
|
||||
/* Drop the packet */
|
||||
dev_kfree_skb_any(skb);
|
||||
netdev->stats.tx_dropped++;
|
||||
@@ -1344,7 +1354,7 @@ static void ftgmac100_reset(struct ftgmac100 *priv)
|
||||
ftgmac100_init_all(priv, true);
|
||||
|
||||
netdev_dbg(netdev, "Reset done !\n");
|
||||
bail:
|
||||
bail:
|
||||
if (priv->mii_bus)
|
||||
mutex_unlock(&priv->mii_bus->mdio_lock);
|
||||
if (netdev->phydev)
|
||||
@@ -1543,15 +1553,15 @@ static int ftgmac100_open(struct net_device *netdev)
|
||||
|
||||
return 0;
|
||||
|
||||
err_ncsi:
|
||||
err_ncsi:
|
||||
napi_disable(&priv->napi);
|
||||
netif_stop_queue(netdev);
|
||||
err_alloc:
|
||||
err_alloc:
|
||||
ftgmac100_free_buffers(priv);
|
||||
free_irq(netdev->irq, netdev);
|
||||
err_irq:
|
||||
err_irq:
|
||||
netif_napi_del(&priv->napi);
|
||||
err_hw:
|
||||
err_hw:
|
||||
iowrite32(0, priv->base + FTGMAC100_OFFSET_IER);
|
||||
ftgmac100_free_rings(priv);
|
||||
return err;
|
||||
|
||||
@@ -52,32 +52,6 @@ static int mana_hwc_verify_resp_msg(const struct hwc_caller_ctx *caller_ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mana_hwc_handle_resp(struct hw_channel_context *hwc, u32 resp_len,
|
||||
const struct gdma_resp_hdr *resp_msg)
|
||||
{
|
||||
struct hwc_caller_ctx *ctx;
|
||||
int err;
|
||||
|
||||
if (!test_bit(resp_msg->response.hwc_msg_id,
|
||||
hwc->inflight_msg_res.map)) {
|
||||
dev_err(hwc->dev, "hwc_rx: invalid msg_id = %u\n",
|
||||
resp_msg->response.hwc_msg_id);
|
||||
return;
|
||||
}
|
||||
|
||||
ctx = hwc->caller_ctx + resp_msg->response.hwc_msg_id;
|
||||
err = mana_hwc_verify_resp_msg(ctx, resp_msg, resp_len);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
ctx->status_code = resp_msg->status;
|
||||
|
||||
memcpy(ctx->output_buf, resp_msg, resp_len);
|
||||
out:
|
||||
ctx->error = err;
|
||||
complete(&ctx->comp_event);
|
||||
}
|
||||
|
||||
static int mana_hwc_post_rx_wqe(const struct hwc_wq *hwc_rxq,
|
||||
struct hwc_work_request *req)
|
||||
{
|
||||
@@ -101,6 +75,40 @@ static int mana_hwc_post_rx_wqe(const struct hwc_wq *hwc_rxq,
|
||||
return err;
|
||||
}
|
||||
|
||||
static void mana_hwc_handle_resp(struct hw_channel_context *hwc, u32 resp_len,
|
||||
struct hwc_work_request *rx_req)
|
||||
{
|
||||
const struct gdma_resp_hdr *resp_msg = rx_req->buf_va;
|
||||
struct hwc_caller_ctx *ctx;
|
||||
int err;
|
||||
|
||||
if (!test_bit(resp_msg->response.hwc_msg_id,
|
||||
hwc->inflight_msg_res.map)) {
|
||||
dev_err(hwc->dev, "hwc_rx: invalid msg_id = %u\n",
|
||||
resp_msg->response.hwc_msg_id);
|
||||
mana_hwc_post_rx_wqe(hwc->rxq, rx_req);
|
||||
return;
|
||||
}
|
||||
|
||||
ctx = hwc->caller_ctx + resp_msg->response.hwc_msg_id;
|
||||
err = mana_hwc_verify_resp_msg(ctx, resp_msg, resp_len);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
ctx->status_code = resp_msg->status;
|
||||
|
||||
memcpy(ctx->output_buf, resp_msg, resp_len);
|
||||
out:
|
||||
ctx->error = err;
|
||||
|
||||
/* Must post rx wqe before complete(), otherwise the next rx may
|
||||
* hit no_wqe error.
|
||||
*/
|
||||
mana_hwc_post_rx_wqe(hwc->rxq, rx_req);
|
||||
|
||||
complete(&ctx->comp_event);
|
||||
}
|
||||
|
||||
static void mana_hwc_init_event_handler(void *ctx, struct gdma_queue *q_self,
|
||||
struct gdma_event *event)
|
||||
{
|
||||
@@ -235,14 +243,12 @@ static void mana_hwc_rx_event_handler(void *ctx, u32 gdma_rxq_id,
|
||||
return;
|
||||
}
|
||||
|
||||
mana_hwc_handle_resp(hwc, rx_oob->tx_oob_data_size, resp);
|
||||
mana_hwc_handle_resp(hwc, rx_oob->tx_oob_data_size, rx_req);
|
||||
|
||||
/* Do no longer use 'resp', because the buffer is posted to the HW
|
||||
* in the below mana_hwc_post_rx_wqe().
|
||||
/* Can no longer use 'resp', because the buffer is posted to the HW
|
||||
* in mana_hwc_handle_resp() above.
|
||||
*/
|
||||
resp = NULL;
|
||||
|
||||
mana_hwc_post_rx_wqe(hwc_rxq, rx_req);
|
||||
}
|
||||
|
||||
static void mana_hwc_tx_event_handler(void *ctx, u32 gdma_txq_id,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user