mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 12:00:22 +09:00
Merge 5.15.143 into android14-5.15-lts
Changes in 5.15.143
vdpa/mlx5: preserve CVQ vringh index
hrtimers: Push pending hrtimers away from outgoing CPU earlier
i2c: designware: Fix corrupted memory seen in the ISR
netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test
tg3: Move the [rt]x_dropped counters to tg3_napi
tg3: Increment tx_dropped in tg3_tso_bug()
kconfig: fix memory leak from range properties
drm/amdgpu: correct chunk_ptr to a pointer to chunk.
platform/x86: asus-wmi: Adjust tablet/lidflip handling to use enum
platform/x86: asus-wmi: Add support for ROG X13 tablet mode
platform/x86: asus-wmi: Simplify tablet-mode-switch probing
platform/x86: asus-wmi: Simplify tablet-mode-switch handling
platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code
of: dynamic: Fix of_reconfig_get_state_change() return value documentation
platform/x86: wmi: Allow duplicate GUIDs for drivers that use struct wmi_driver
platform/x86: wmi: Skip blocks with zero instances
ipv6: fix potential NULL deref in fib6_add()
octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam
octeontx2-af: Check return value of nix_get_nixlf before using nixlf
hv_netvsc: rndis_filter needs to select NLS
r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE
r8152: Add RTL8152_INACCESSIBLE checks to more loops
r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash()
r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1()
r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en()
mlxbf-bootctl: correctly identify secure boot with development keys
platform/mellanox: Add null pointer checks for devm_kasprintf()
platform/mellanox: Check devm_hwmon_device_register_with_groups() return value
arcnet: restoring support for multiple Sohard Arcnet cards
net: stmmac: fix FPE events losing
octeontx2-af: fix a use-after-free in rvu_npa_register_reporters
i40e: Fix unexpected MFS warning message
net: bnxt: fix a potential use-after-free in bnxt_init_tc
ionic: fix snprintf format length warning
ionic: Fix dim work handling in split interrupt mode
ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit()
net: hns: fix fake link up on xge port
octeontx2-af: Update Tx link register range
netfilter: nf_tables: bail out on mismatching dynset and set expressions
netfilter: nf_tables: validate family when identifying table via handle
netfilter: xt_owner: Fix for unsafe access of sk->sk_socket
tcp: do not accept ACK of bytes we never sent
bpf: sockmap, updating the sg structure should also update curr
psample: Require 'CAP_NET_ADMIN' when joining "packets" group
net: add missing kdoc for struct genl_multicast_group::flags
drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group
tee: optee: Fix supplicant based device enumeration
RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm
RDMA/irdma: Do not modify to SQD on error
RDMA/irdma: Add wait for suspend on SQD
arm64: dts: rockchip: Expand reg size of vdec node for RK3399
RDMA/rtrs-srv: Do not unconditionally enable irq
RDMA/rtrs-clt: Start hb after path_up
RDMA/rtrs-srv: Check return values while processing info request
RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true
RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight
RDMA/rtrs-clt: Fix the max_send_wr setting
RDMA/rtrs-clt: Remove the warnings for req in_use check
RDMA/bnxt_re: Correct module description string
hwmon: (acpi_power_meter) Fix 4.29 MW bug
hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe()
ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate
RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz
RDMA/irdma: Avoid free the non-cqp_request scratch
arm64: dts: imx8mq: drop usb3-resume-missing-cas from usb
arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3
ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock
tracing: Fix a warning when allocating buffered events fails
scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle()
ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init
ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt
ARM: dts: imx28-xea: Pass the 'model' property
riscv: fix misaligned access handling of C.SWSP and C.SDSP
md: introduce md_ro_state
md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly()
kprobes: consistent rcu api usage for kretprobe holder
nvme-pci: Add sleep quirk for Kingston drives
io_uring: fix mutex_unlock with unreferenced ctx
ALSA: usb-audio: Add Pioneer DJM-450 mixer controls
ALSA: pcm: fix out-of-bounds in snd_pcm_state_names
ALSA: hda/realtek: Enable headset on Lenovo M90 Gen5
nilfs2: fix missing error check for sb_set_blocksize call
nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage()
checkstack: fix printed address
tracing: Always update snapshot buffer size
tracing: Disable snapshot buffer when stopping instance tracers
tracing: Fix incomplete locking when disabling buffered events
tracing: Fix a possible race when disabling buffered events
packet: Move reference count in packet_sock to atomic_long_t
regmap: fix bogus error on regcache_sync success
platform/surface: aggregator: fix recv_buf() return value
arm64: dts: mediatek: mt7622: fix memory node warning check
arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells properties
arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names
arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory
binder: fix memory leaks of spam and pending work
kallsyms: Make kallsyms_on_each_symbol generally available
coresight: etm4x: Make etm4_remove_dev() return void
coresight: etm4x: Remove bogous __exit annotation for some functions
misc: mei: client.c: return negative error code in mei_cl_write
misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write
ring-buffer: Force absolute timestamp on discard of event
tracing: Set actual size after ring buffer resize
tracing: Stop current tracer when resizing buffer
r8169: fix rtl8125b PAUSE frames blasting when suspended
mm: fix oops when filemap_map_pmd() without prealloc_pte
io_uring/af_unix: disable sending io_uring over sockets
netfilter: nft_set_pipapo: skip inactive elements during set walk
platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting
docs/process/howto: Replace C89 with C11
tools headers UAPI: Sync linux/perf_event.h with the kernel sources
arm64: dts: mediatek: align thermal zone node names with dtschema
arm64: dts: mediatek: mt8183: Move thermal-zones to the root node
arm64: dts: mediatek: add missing space before {
arm64: dts: mt8183: kukui: Fix underscores in node names
perf/core: Add a new read format to get a number of lost samples
perf: Fix perf_event_validate_size()
gpiolib: sysfs: Fix error handling on failed export
drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.c
drm/amdgpu: correct the amdgpu runtime dereference usage count
usb: gadget: f_hid: fix report descriptor allocation
parport: Add support for Brainboxes IX/UC/PX parallel cards
Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1"
usb: typec: class: fix typec_altmode_put_partner to put plugs
ARM: PL011: Fix DMA support
serial: sc16is7xx: address RX timeout interrupt errata
serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit
serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt
serial: 8250_omap: Add earlycon support for the AM654 UART controller
x86/CPU/AMD: Check vendor in the AMD microcode callback
KVM: s390/mm: Properly reset no-dat
KVM: SVM: Update EFER software model on CR0 trap for SEV-ES
MIPS: Loongson64: Reserve vgabios memory on boot
MIPS: Loongson64: Enable DMA noncoherent support
Revert "btrfs: add dmesg output for first mount and last unmount of a filesystem"
cifs: Fix non-availability of dedup breaking generic/304
smb: client: fix potential NULL deref in parse_dfs_referrals()
devcoredump : Serialize devcd_del work
devcoredump: Send uevent once devcd is ready
Linux 5.15.143
Change-Id: Ide3da0c3ba124e0773d9e6c946751fc3124f2d76
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -6,3 +6,12 @@ Description:
|
||||
OP-TEE bus provides reference to registered drivers under this directory. The <uuid>
|
||||
matches Trusted Application (TA) driver and corresponding TA in secure OS. Drivers
|
||||
are free to create needed API under optee-ta-<uuid> directory.
|
||||
|
||||
What: /sys/bus/tee/devices/optee-ta-<uuid>/need_supplicant
|
||||
Date: November 2023
|
||||
KernelVersion: 6.7
|
||||
Contact: op-tee@lists.trustedfirmware.org
|
||||
Description:
|
||||
Allows to distinguish whether an OP-TEE based TA/device requires user-space
|
||||
tee-supplicant to function properly or not. This attribute will be present for
|
||||
devices which depend on tee-supplicant to be running.
|
||||
|
||||
@@ -36,7 +36,7 @@ experience, the following books are good for, if anything, reference:
|
||||
- "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
|
||||
|
||||
The kernel is written using GNU C and the GNU toolchain. While it
|
||||
adheres to the ISO C89 standard, it uses a number of extensions that are
|
||||
adheres to the ISO C11 standard, it uses a number of extensions that are
|
||||
not featured in the standard. The kernel is a freestanding C
|
||||
environment, with no reliance on the standard C library, so some
|
||||
portions of the C standard are not supported. Arbitrary long long
|
||||
|
||||
@@ -44,7 +44,7 @@ altro, utili riferimenti:
|
||||
- "C: A Reference Manual" di Harbison and Steele [Prentice Hall]
|
||||
|
||||
Il kernel è stato scritto usando GNU C e la toolchain GNU.
|
||||
Sebbene si attenga allo standard ISO C89, esso utilizza una serie di
|
||||
Sebbene si attenga allo standard ISO C11, esso utilizza una serie di
|
||||
estensioni che non sono previste in questo standard. Il kernel è un
|
||||
ambiente C indipendente, che non ha alcuna dipendenza dalle librerie
|
||||
C standard, così alcune parti del C standard non sono supportate.
|
||||
|
||||
@@ -65,7 +65,7 @@ Linux カーネル開発のやり方
|
||||
- 『新・詳説 C 言語 H&S リファレンス』 (サミュエル P ハービソン/ガイ L スティール共著 斉藤 信男監訳)[ソフトバンク]
|
||||
|
||||
カーネルは GNU C と GNU ツールチェインを使って書かれています。カーネル
|
||||
は ISO C89 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って
|
||||
は ISO C11 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って
|
||||
います。カーネルは標準 C ライブラリに依存しない、C 言語非依存環境です。
|
||||
そのため、C の標準の中で使えないものもあります。特に任意の long long
|
||||
の除算や浮動小数点は使えません。カーネルがツールチェインや C 言語拡張
|
||||
|
||||
@@ -62,7 +62,7 @@ Documentation/process/howto.rst
|
||||
- "Practical C Programming" by Steve Oualline [O'Reilly]
|
||||
- "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
|
||||
|
||||
커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C89 표준을
|
||||
커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C11 표준을
|
||||
따르는 반면 표준에 있지 않은 많은 확장기능도 가지고 있다. 커널은 표준 C
|
||||
라이브러리와는 관계없이 freestanding C 환경이어서 C 표준의 일부는
|
||||
지원되지 않는다. 임의의 long long 나누기나 floating point는 지원되지 않는다.
|
||||
|
||||
@@ -45,7 +45,7 @@ Linux内核大部分是由C语言写成的,一些体系结构相关的代码
|
||||
- "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
|
||||
《C语言参考手册(原书第5版)》(邱仲潘 等译)[机械工业出版社]
|
||||
|
||||
Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C89标准,但也用到了一些
|
||||
Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C11标准,但也用到了一些
|
||||
标准中没有定义的扩展。内核是自给自足的C环境,不依赖于标准C库的支持,所以
|
||||
并不支持C标准中的部分定义。比如long long类型的大数除法和浮点运算就不允许
|
||||
使用。有时候确实很难弄清楚内核对工具链的要求和它所使用的扩展,不幸的是目
|
||||
|
||||
@@ -48,7 +48,7 @@ Linux內核大部分是由C語言寫成的,一些體系結構相關的代碼
|
||||
- "C: A Reference Manual" by Harbison and Steele [Prentice Hall]
|
||||
《C語言參考手冊(原書第5版)》(邱仲潘 等譯)[機械工業出版社]
|
||||
|
||||
Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C89標準,但也用到了一些
|
||||
Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C11標準,但也用到了一些
|
||||
標準中沒有定義的擴展。內核是自給自足的C環境,不依賴於標準C庫的支持,所以
|
||||
並不支持C標準中的部分定義。比如long long類型的大數除法和浮點運算就不允許
|
||||
使用。有時候確實很難弄清楚內核對工具鏈的要求和它所使用的擴展,不幸的是目
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 15
|
||||
SUBLEVEL = 142
|
||||
SUBLEVEL = 143
|
||||
EXTRAVERSION =
|
||||
NAME = Trick or Treat
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "imx28-lwe.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Liebherr XEA board";
|
||||
compatible = "lwn,imx28-xea", "fsl,imx28";
|
||||
};
|
||||
|
||||
|
||||
@@ -121,6 +121,8 @@
|
||||
max-speed = <100>;
|
||||
interrupt-parent = <&gpio5>;
|
||||
interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
|
||||
clocks = <&clks IMX6UL_CLK_ENET_REF>;
|
||||
clock-names = "rmii-ref";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -438,7 +438,7 @@
|
||||
};
|
||||
|
||||
gpt1: timer@302d0000 {
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt";
|
||||
reg = <0x302d0000 0x10000>;
|
||||
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX7D_GPT1_ROOT_CLK>,
|
||||
@@ -447,7 +447,7 @@
|
||||
};
|
||||
|
||||
gpt2: timer@302e0000 {
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt";
|
||||
reg = <0x302e0000 0x10000>;
|
||||
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX7D_GPT2_ROOT_CLK>,
|
||||
@@ -457,7 +457,7 @@
|
||||
};
|
||||
|
||||
gpt3: timer@302f0000 {
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt";
|
||||
reg = <0x302f0000 0x10000>;
|
||||
interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX7D_GPT3_ROOT_CLK>,
|
||||
@@ -467,7 +467,7 @@
|
||||
};
|
||||
|
||||
gpt4: timer@30300000 {
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
|
||||
compatible = "fsl,imx7d-gpt", "fsl,imx6dl-gpt";
|
||||
reg = <0x30300000 0x10000>;
|
||||
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX7D_GPT4_ROOT_CLK>,
|
||||
|
||||
@@ -502,6 +502,10 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
||||
|
||||
name = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "mmdc%d", ret);
|
||||
if (!name) {
|
||||
ret = -ENOMEM;
|
||||
goto pmu_release_id;
|
||||
}
|
||||
|
||||
pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk;
|
||||
pmu_mmdc->devtype_data = (struct fsl_mmdc_devtype_data *)of_id->data;
|
||||
@@ -524,9 +528,10 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
||||
|
||||
pmu_register_err:
|
||||
pr_warn("MMDC Perf PMU failed (%d), disabled\n", ret);
|
||||
ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
|
||||
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
|
||||
hrtimer_cancel(&pmu_mmdc->hrtimer);
|
||||
pmu_release_id:
|
||||
ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
|
||||
pmu_free:
|
||||
kfree(pmu_mmdc);
|
||||
return ret;
|
||||
|
||||
@@ -913,6 +913,7 @@
|
||||
phys = <&usb3_phy0>, <&usb3_phy0>;
|
||||
phy-names = "usb2-phy", "usb3-phy";
|
||||
snps,gfladj-refclk-lpm-sel-quirk;
|
||||
snps,parkmode-disable-ss-quirk;
|
||||
};
|
||||
|
||||
};
|
||||
@@ -954,6 +955,7 @@
|
||||
phys = <&usb3_phy1>, <&usb3_phy1>;
|
||||
phy-names = "usb2-phy", "usb3-phy";
|
||||
snps,gfladj-refclk-lpm-sel-quirk;
|
||||
snps,parkmode-disable-ss-quirk;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1382,7 +1382,7 @@
|
||||
phys = <&usb3_phy0>, <&usb3_phy0>;
|
||||
phy-names = "usb2-phy", "usb3-phy";
|
||||
power-domains = <&pgc_otg1>;
|
||||
usb3-resume-missing-cas;
|
||||
snps,parkmode-disable-ss-quirk;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -1414,7 +1414,7 @@
|
||||
phys = <&usb3_phy1>, <&usb3_phy1>;
|
||||
phy-names = "usb2-phy", "usb3-phy";
|
||||
power-domains = <&pgc_otg2>;
|
||||
usb3-resume-missing-cas;
|
||||
snps,parkmode-disable-ss-quirk;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
memory {
|
||||
memory@40000000 {
|
||||
reg = <0 0x40000000 0 0x40000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
memory {
|
||||
memory@40000000 {
|
||||
reg = <0 0x40000000 0 0x20000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
id-gpio = <&pio 16 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
usb_p1_vbus: regulator@0 {
|
||||
usb_p1_vbus: regulator-usb-p1 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "usb_vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
@@ -52,7 +52,7 @@
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
usb_p0_vbus: regulator@1 {
|
||||
usb_p0_vbus: regulator-usb-p0 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
cpu_thermal: cpu_thermal {
|
||||
cpu_thermal: cpu-thermal {
|
||||
polling-delay-passive = <1000>; /* milliseconds */
|
||||
polling-delay = <1000>; /* milliseconds */
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
scp_mem_reserved: scp_mem_region {
|
||||
scp_mem_reserved: memory@50000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0 0x50000000 0 0x2900000>;
|
||||
no-map;
|
||||
@@ -131,8 +131,8 @@
|
||||
};
|
||||
|
||||
&pio {
|
||||
i2c_pins_0: i2c0{
|
||||
pins_i2c{
|
||||
i2c_pins_0: i2c0 {
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO82__FUNC_SDA0>,
|
||||
<PINMUX_GPIO83__FUNC_SCL0>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -140,8 +140,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins_1: i2c1{
|
||||
pins_i2c{
|
||||
i2c_pins_1: i2c1 {
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO81__FUNC_SDA1>,
|
||||
<PINMUX_GPIO84__FUNC_SCL1>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -149,8 +149,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins_2: i2c2{
|
||||
pins_i2c{
|
||||
i2c_pins_2: i2c2 {
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO103__FUNC_SCL2>,
|
||||
<PINMUX_GPIO104__FUNC_SDA2>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -158,8 +158,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins_3: i2c3{
|
||||
pins_i2c{
|
||||
i2c_pins_3: i2c3 {
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO50__FUNC_SCL3>,
|
||||
<PINMUX_GPIO51__FUNC_SDA3>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -167,8 +167,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins_4: i2c4{
|
||||
pins_i2c{
|
||||
i2c_pins_4: i2c4 {
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO105__FUNC_SCL4>,
|
||||
<PINMUX_GPIO106__FUNC_SDA4>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -176,8 +176,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
i2c_pins_5: i2c5{
|
||||
pins_i2c{
|
||||
i2c_pins_5: i2c5 {
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO48__FUNC_SCL5>,
|
||||
<PINMUX_GPIO49__FUNC_SDA5>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -185,8 +185,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
spi_pins_0: spi0{
|
||||
pins_spi{
|
||||
spi_pins_0: spi0 {
|
||||
pins_spi {
|
||||
pinmux = <PINMUX_GPIO85__FUNC_SPI0_MI>,
|
||||
<PINMUX_GPIO86__FUNC_SPI0_CSB>,
|
||||
<PINMUX_GPIO87__FUNC_SPI0_MO>,
|
||||
@@ -300,8 +300,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
spi_pins_1: spi1{
|
||||
pins_spi{
|
||||
spi_pins_1: spi1 {
|
||||
pins_spi {
|
||||
pinmux = <PINMUX_GPIO161__FUNC_SPI1_A_MI>,
|
||||
<PINMUX_GPIO162__FUNC_SPI1_A_CSB>,
|
||||
<PINMUX_GPIO163__FUNC_SPI1_A_MO>,
|
||||
@@ -310,8 +310,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
spi_pins_2: spi2{
|
||||
pins_spi{
|
||||
spi_pins_2: spi2 {
|
||||
pins_spi {
|
||||
pinmux = <PINMUX_GPIO0__FUNC_SPI2_CSB>,
|
||||
<PINMUX_GPIO1__FUNC_SPI2_MO>,
|
||||
<PINMUX_GPIO2__FUNC_SPI2_CLK>,
|
||||
@@ -320,8 +320,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
spi_pins_3: spi3{
|
||||
pins_spi{
|
||||
spi_pins_3: spi3 {
|
||||
pins_spi {
|
||||
pinmux = <PINMUX_GPIO21__FUNC_SPI3_MI>,
|
||||
<PINMUX_GPIO22__FUNC_SPI3_CSB>,
|
||||
<PINMUX_GPIO23__FUNC_SPI3_MO>,
|
||||
@@ -330,8 +330,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
spi_pins_4: spi4{
|
||||
pins_spi{
|
||||
spi_pins_4: spi4 {
|
||||
pins_spi {
|
||||
pinmux = <PINMUX_GPIO17__FUNC_SPI4_MI>,
|
||||
<PINMUX_GPIO18__FUNC_SPI4_CSB>,
|
||||
<PINMUX_GPIO19__FUNC_SPI4_MO>,
|
||||
@@ -340,8 +340,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
spi_pins_5: spi5{
|
||||
pins_spi{
|
||||
spi_pins_5: spi5 {
|
||||
pins_spi {
|
||||
pinmux = <PINMUX_GPIO13__FUNC_SPI5_MI>,
|
||||
<PINMUX_GPIO14__FUNC_SPI5_CSB>,
|
||||
<PINMUX_GPIO15__FUNC_SPI5_MO>,
|
||||
|
||||
@@ -102,6 +102,8 @@
|
||||
|
||||
&dsi0 {
|
||||
status = "okay";
|
||||
/delete-property/#size-cells;
|
||||
/delete-property/#address-cells;
|
||||
/delete-node/panel@0;
|
||||
ports {
|
||||
port {
|
||||
@@ -438,20 +440,20 @@
|
||||
};
|
||||
|
||||
touchscreen_pins: touchscreen-pins {
|
||||
touch_int_odl {
|
||||
touch-int-odl {
|
||||
pinmux = <PINMUX_GPIO155__FUNC_GPIO155>;
|
||||
input-enable;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
touch_rst_l {
|
||||
touch-rst-l {
|
||||
pinmux = <PINMUX_GPIO156__FUNC_GPIO156>;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
trackpad_pins: trackpad-pins {
|
||||
trackpad_int {
|
||||
trackpad-int {
|
||||
pinmux = <PINMUX_GPIO7__FUNC_GPIO7>;
|
||||
input-enable;
|
||||
bias-disable; /* pulled externally */
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
scp_mem_reserved: scp_mem_region {
|
||||
scp_mem_reserved: memory@50000000 {
|
||||
compatible = "shared-dma-pool";
|
||||
reg = <0 0x50000000 0 0x2900000>;
|
||||
no-map;
|
||||
@@ -407,13 +407,13 @@
|
||||
|
||||
&pio {
|
||||
bt_pins: bt-pins {
|
||||
pins_bt_en {
|
||||
pins-bt-en {
|
||||
pinmux = <PINMUX_GPIO120__FUNC_GPIO120>;
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
|
||||
ec_ap_int_odl: ec_ap_int_odl {
|
||||
ec_ap_int_odl: ec-ap-int-odl {
|
||||
pins1 {
|
||||
pinmux = <PINMUX_GPIO151__FUNC_GPIO151>;
|
||||
input-enable;
|
||||
@@ -421,7 +421,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
h1_int_od_l: h1_int_od_l {
|
||||
h1_int_od_l: h1-int-od-l {
|
||||
pins1 {
|
||||
pinmux = <PINMUX_GPIO153__FUNC_GPIO153>;
|
||||
input-enable;
|
||||
@@ -429,7 +429,7 @@
|
||||
};
|
||||
|
||||
i2c0_pins: i2c0 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO82__FUNC_SDA0>,
|
||||
<PINMUX_GPIO83__FUNC_SCL0>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -438,7 +438,7 @@
|
||||
};
|
||||
|
||||
i2c1_pins: i2c1 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO81__FUNC_SDA1>,
|
||||
<PINMUX_GPIO84__FUNC_SCL1>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -447,7 +447,7 @@
|
||||
};
|
||||
|
||||
i2c2_pins: i2c2 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO103__FUNC_SCL2>,
|
||||
<PINMUX_GPIO104__FUNC_SDA2>;
|
||||
bias-disable;
|
||||
@@ -456,7 +456,7 @@
|
||||
};
|
||||
|
||||
i2c3_pins: i2c3 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO50__FUNC_SCL3>,
|
||||
<PINMUX_GPIO51__FUNC_SDA3>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -465,7 +465,7 @@
|
||||
};
|
||||
|
||||
i2c4_pins: i2c4 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO105__FUNC_SCL4>,
|
||||
<PINMUX_GPIO106__FUNC_SDA4>;
|
||||
bias-disable;
|
||||
@@ -474,7 +474,7 @@
|
||||
};
|
||||
|
||||
i2c5_pins: i2c5 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO48__FUNC_SCL5>,
|
||||
<PINMUX_GPIO49__FUNC_SDA5>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -483,7 +483,7 @@
|
||||
};
|
||||
|
||||
i2c6_pins: i2c6 {
|
||||
pins_bus {
|
||||
pins-bus {
|
||||
pinmux = <PINMUX_GPIO11__FUNC_SCL6>,
|
||||
<PINMUX_GPIO12__FUNC_SDA6>;
|
||||
bias-disable;
|
||||
@@ -491,7 +491,7 @@
|
||||
};
|
||||
|
||||
mmc0_pins_default: mmc0-pins-default {
|
||||
pins_cmd_dat {
|
||||
pins-cmd-dat {
|
||||
pinmux = <PINMUX_GPIO123__FUNC_MSDC0_DAT0>,
|
||||
<PINMUX_GPIO128__FUNC_MSDC0_DAT1>,
|
||||
<PINMUX_GPIO125__FUNC_MSDC0_DAT2>,
|
||||
@@ -506,13 +506,13 @@
|
||||
mediatek,pull-up-adv = <01>;
|
||||
};
|
||||
|
||||
pins_clk {
|
||||
pins-clk {
|
||||
pinmux = <PINMUX_GPIO124__FUNC_MSDC0_CLK>;
|
||||
drive-strength = <MTK_DRIVE_14mA>;
|
||||
mediatek,pull-down-adv = <10>;
|
||||
};
|
||||
|
||||
pins_rst {
|
||||
pins-rst {
|
||||
pinmux = <PINMUX_GPIO133__FUNC_MSDC0_RSTB>;
|
||||
drive-strength = <MTK_DRIVE_14mA>;
|
||||
mediatek,pull-down-adv = <01>;
|
||||
@@ -520,7 +520,7 @@
|
||||
};
|
||||
|
||||
mmc0_pins_uhs: mmc0-pins-uhs {
|
||||
pins_cmd_dat {
|
||||
pins-cmd-dat {
|
||||
pinmux = <PINMUX_GPIO123__FUNC_MSDC0_DAT0>,
|
||||
<PINMUX_GPIO128__FUNC_MSDC0_DAT1>,
|
||||
<PINMUX_GPIO125__FUNC_MSDC0_DAT2>,
|
||||
@@ -535,19 +535,19 @@
|
||||
mediatek,pull-up-adv = <01>;
|
||||
};
|
||||
|
||||
pins_clk {
|
||||
pins-clk {
|
||||
pinmux = <PINMUX_GPIO124__FUNC_MSDC0_CLK>;
|
||||
drive-strength = <MTK_DRIVE_14mA>;
|
||||
mediatek,pull-down-adv = <10>;
|
||||
};
|
||||
|
||||
pins_ds {
|
||||
pins-ds {
|
||||
pinmux = <PINMUX_GPIO131__FUNC_MSDC0_DSL>;
|
||||
drive-strength = <MTK_DRIVE_14mA>;
|
||||
mediatek,pull-down-adv = <10>;
|
||||
};
|
||||
|
||||
pins_rst {
|
||||
pins-rst {
|
||||
pinmux = <PINMUX_GPIO133__FUNC_MSDC0_RSTB>;
|
||||
drive-strength = <MTK_DRIVE_14mA>;
|
||||
mediatek,pull-up-adv = <01>;
|
||||
@@ -555,7 +555,7 @@
|
||||
};
|
||||
|
||||
mmc1_pins_default: mmc1-pins-default {
|
||||
pins_cmd_dat {
|
||||
pins-cmd-dat {
|
||||
pinmux = <PINMUX_GPIO31__FUNC_MSDC1_CMD>,
|
||||
<PINMUX_GPIO32__FUNC_MSDC1_DAT0>,
|
||||
<PINMUX_GPIO34__FUNC_MSDC1_DAT1>,
|
||||
@@ -565,7 +565,7 @@
|
||||
mediatek,pull-up-adv = <10>;
|
||||
};
|
||||
|
||||
pins_clk {
|
||||
pins-clk {
|
||||
pinmux = <PINMUX_GPIO29__FUNC_MSDC1_CLK>;
|
||||
input-enable;
|
||||
mediatek,pull-down-adv = <10>;
|
||||
@@ -573,7 +573,7 @@
|
||||
};
|
||||
|
||||
mmc1_pins_uhs: mmc1-pins-uhs {
|
||||
pins_cmd_dat {
|
||||
pins-cmd-dat {
|
||||
pinmux = <PINMUX_GPIO31__FUNC_MSDC1_CMD>,
|
||||
<PINMUX_GPIO32__FUNC_MSDC1_DAT0>,
|
||||
<PINMUX_GPIO34__FUNC_MSDC1_DAT1>,
|
||||
@@ -584,7 +584,7 @@
|
||||
mediatek,pull-up-adv = <10>;
|
||||
};
|
||||
|
||||
pins_clk {
|
||||
pins-clk {
|
||||
pinmux = <PINMUX_GPIO29__FUNC_MSDC1_CLK>;
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
mediatek,pull-down-adv = <10>;
|
||||
@@ -592,15 +592,15 @@
|
||||
};
|
||||
};
|
||||
|
||||
panel_pins_default: panel_pins_default {
|
||||
panel_reset {
|
||||
panel_pins_default: panel-pins-default {
|
||||
panel-reset {
|
||||
pinmux = <PINMUX_GPIO45__FUNC_GPIO45>;
|
||||
output-low;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
pwm0_pin_default: pwm0_pin_default {
|
||||
pwm0_pin_default: pwm0-pin-default {
|
||||
pins1 {
|
||||
pinmux = <PINMUX_GPIO176__FUNC_GPIO176>;
|
||||
output-high;
|
||||
@@ -612,14 +612,14 @@
|
||||
};
|
||||
|
||||
scp_pins: scp {
|
||||
pins_scp_uart {
|
||||
pins-scp-uart {
|
||||
pinmux = <PINMUX_GPIO110__FUNC_TP_URXD1_AO>,
|
||||
<PINMUX_GPIO112__FUNC_TP_UTXD1_AO>;
|
||||
};
|
||||
};
|
||||
|
||||
spi0_pins: spi0 {
|
||||
pins_spi{
|
||||
pins-spi {
|
||||
pinmux = <PINMUX_GPIO85__FUNC_SPI0_MI>,
|
||||
<PINMUX_GPIO86__FUNC_GPIO86>,
|
||||
<PINMUX_GPIO87__FUNC_SPI0_MO>,
|
||||
@@ -629,7 +629,7 @@
|
||||
};
|
||||
|
||||
spi1_pins: spi1 {
|
||||
pins_spi{
|
||||
pins-spi {
|
||||
pinmux = <PINMUX_GPIO161__FUNC_SPI1_A_MI>,
|
||||
<PINMUX_GPIO162__FUNC_SPI1_A_CSB>,
|
||||
<PINMUX_GPIO163__FUNC_SPI1_A_MO>,
|
||||
@@ -639,20 +639,20 @@
|
||||
};
|
||||
|
||||
spi2_pins: spi2 {
|
||||
pins_spi{
|
||||
pins-spi {
|
||||
pinmux = <PINMUX_GPIO0__FUNC_SPI2_CSB>,
|
||||
<PINMUX_GPIO1__FUNC_SPI2_MO>,
|
||||
<PINMUX_GPIO2__FUNC_SPI2_CLK>;
|
||||
bias-disable;
|
||||
};
|
||||
pins_spi_mi {
|
||||
pins-spi-mi {
|
||||
pinmux = <PINMUX_GPIO94__FUNC_SPI2_MI>;
|
||||
mediatek,pull-down-adv = <00>;
|
||||
};
|
||||
};
|
||||
|
||||
spi3_pins: spi3 {
|
||||
pins_spi{
|
||||
pins-spi {
|
||||
pinmux = <PINMUX_GPIO21__FUNC_SPI3_MI>,
|
||||
<PINMUX_GPIO22__FUNC_SPI3_CSB>,
|
||||
<PINMUX_GPIO23__FUNC_SPI3_MO>,
|
||||
@@ -662,7 +662,7 @@
|
||||
};
|
||||
|
||||
spi4_pins: spi4 {
|
||||
pins_spi{
|
||||
pins-spi {
|
||||
pinmux = <PINMUX_GPIO17__FUNC_SPI4_MI>,
|
||||
<PINMUX_GPIO18__FUNC_SPI4_CSB>,
|
||||
<PINMUX_GPIO19__FUNC_SPI4_MO>,
|
||||
@@ -672,7 +672,7 @@
|
||||
};
|
||||
|
||||
spi5_pins: spi5 {
|
||||
pins_spi{
|
||||
pins-spi {
|
||||
pinmux = <PINMUX_GPIO13__FUNC_SPI5_MI>,
|
||||
<PINMUX_GPIO14__FUNC_SPI5_CSB>,
|
||||
<PINMUX_GPIO15__FUNC_SPI5_MO>,
|
||||
@@ -682,63 +682,63 @@
|
||||
};
|
||||
|
||||
uart0_pins_default: uart0-pins-default {
|
||||
pins_rx {
|
||||
pins-rx {
|
||||
pinmux = <PINMUX_GPIO95__FUNC_URXD0>;
|
||||
input-enable;
|
||||
bias-pull-up;
|
||||
};
|
||||
pins_tx {
|
||||
pins-tx {
|
||||
pinmux = <PINMUX_GPIO96__FUNC_UTXD0>;
|
||||
};
|
||||
};
|
||||
|
||||
uart1_pins_default: uart1-pins-default {
|
||||
pins_rx {
|
||||
pins-rx {
|
||||
pinmux = <PINMUX_GPIO121__FUNC_URXD1>;
|
||||
input-enable;
|
||||
bias-pull-up;
|
||||
};
|
||||
pins_tx {
|
||||
pins-tx {
|
||||
pinmux = <PINMUX_GPIO115__FUNC_UTXD1>;
|
||||
};
|
||||
pins_rts {
|
||||
pins-rts {
|
||||
pinmux = <PINMUX_GPIO47__FUNC_URTS1>;
|
||||
output-enable;
|
||||
};
|
||||
pins_cts {
|
||||
pins-cts {
|
||||
pinmux = <PINMUX_GPIO46__FUNC_UCTS1>;
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
|
||||
uart1_pins_sleep: uart1-pins-sleep {
|
||||
pins_rx {
|
||||
pins-rx {
|
||||
pinmux = <PINMUX_GPIO121__FUNC_GPIO121>;
|
||||
input-enable;
|
||||
bias-pull-up;
|
||||
};
|
||||
pins_tx {
|
||||
pins-tx {
|
||||
pinmux = <PINMUX_GPIO115__FUNC_UTXD1>;
|
||||
};
|
||||
pins_rts {
|
||||
pins-rts {
|
||||
pinmux = <PINMUX_GPIO47__FUNC_URTS1>;
|
||||
output-enable;
|
||||
};
|
||||
pins_cts {
|
||||
pins-cts {
|
||||
pinmux = <PINMUX_GPIO46__FUNC_UCTS1>;
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
|
||||
wifi_pins_pwrseq: wifi-pins-pwrseq {
|
||||
pins_wifi_enable {
|
||||
pins-wifi-enable {
|
||||
pinmux = <PINMUX_GPIO119__FUNC_GPIO119>;
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
|
||||
wifi_pins_wakeup: wifi-pins-wakeup {
|
||||
pins_wifi_wakeup {
|
||||
pins-wifi-wakeup {
|
||||
pinmux = <PINMUX_GPIO113__FUNC_GPIO113>;
|
||||
input-enable;
|
||||
};
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
|
||||
&pio {
|
||||
i2c_pins_0: i2c0 {
|
||||
pins_i2c{
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO82__FUNC_SDA0>,
|
||||
<PINMUX_GPIO83__FUNC_SCL0>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -174,7 +174,7 @@
|
||||
};
|
||||
|
||||
i2c_pins_1: i2c1 {
|
||||
pins_i2c{
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO81__FUNC_SDA1>,
|
||||
<PINMUX_GPIO84__FUNC_SCL1>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -183,7 +183,7 @@
|
||||
};
|
||||
|
||||
i2c_pins_2: i2c2 {
|
||||
pins_i2c{
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO103__FUNC_SCL2>,
|
||||
<PINMUX_GPIO104__FUNC_SDA2>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -192,7 +192,7 @@
|
||||
};
|
||||
|
||||
i2c_pins_3: i2c3 {
|
||||
pins_i2c{
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO50__FUNC_SCL3>,
|
||||
<PINMUX_GPIO51__FUNC_SDA3>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -201,7 +201,7 @@
|
||||
};
|
||||
|
||||
i2c_pins_4: i2c4 {
|
||||
pins_i2c{
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO105__FUNC_SCL4>,
|
||||
<PINMUX_GPIO106__FUNC_SDA4>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
@@ -210,7 +210,7 @@
|
||||
};
|
||||
|
||||
i2c_pins_5: i2c5 {
|
||||
pins_i2c{
|
||||
pins_i2c {
|
||||
pinmux = <PINMUX_GPIO48__FUNC_SCL5>,
|
||||
<PINMUX_GPIO49__FUNC_SDA5>;
|
||||
mediatek,pull-up-adv = <3>;
|
||||
|
||||
@@ -766,127 +766,6 @@
|
||||
nvmem-cell-names = "calibration-data";
|
||||
};
|
||||
|
||||
thermal_zones: thermal-zones {
|
||||
cpu_thermal: cpu_thermal {
|
||||
polling-delay-passive = <100>;
|
||||
polling-delay = <500>;
|
||||
thermal-sensors = <&thermal 0>;
|
||||
sustainable-power = <5000>;
|
||||
|
||||
trips {
|
||||
threshold: trip-point0 {
|
||||
temperature = <68000>;
|
||||
hysteresis = <2000>;
|
||||
type = "passive";
|
||||
};
|
||||
|
||||
target: trip-point1 {
|
||||
temperature = <80000>;
|
||||
hysteresis = <2000>;
|
||||
type = "passive";
|
||||
};
|
||||
|
||||
cpu_crit: cpu-crit {
|
||||
temperature = <115000>;
|
||||
hysteresis = <2000>;
|
||||
type = "critical";
|
||||
};
|
||||
};
|
||||
|
||||
cooling-maps {
|
||||
map0 {
|
||||
trip = <&target>;
|
||||
cooling-device = <&cpu0
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu1
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu2
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu3
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>;
|
||||
contribution = <3072>;
|
||||
};
|
||||
map1 {
|
||||
trip = <&target>;
|
||||
cooling-device = <&cpu4
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu5
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu6
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu7
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>;
|
||||
contribution = <1024>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* The tzts1 ~ tzts6 don't need to polling */
|
||||
/* The tzts1 ~ tzts6 don't need to thermal throttle */
|
||||
|
||||
tzts1: tzts1 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 1>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts2: tzts2 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 2>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts3: tzts3 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 3>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts4: tzts4 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 4>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts5: tzts5 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 5>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tztsABB: tztsABB {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 6>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
};
|
||||
|
||||
pwm0: pwm@1100e000 {
|
||||
compatible = "mediatek,mt8183-disp-pwm";
|
||||
reg = <0 0x1100e000 0 0x1000>;
|
||||
@@ -1495,4 +1374,125 @@
|
||||
power-domains = <&spm MT8183_POWER_DOMAIN_CAM>;
|
||||
};
|
||||
};
|
||||
|
||||
thermal_zones: thermal-zones {
|
||||
cpu_thermal: cpu-thermal {
|
||||
polling-delay-passive = <100>;
|
||||
polling-delay = <500>;
|
||||
thermal-sensors = <&thermal 0>;
|
||||
sustainable-power = <5000>;
|
||||
|
||||
trips {
|
||||
threshold: trip-point0 {
|
||||
temperature = <68000>;
|
||||
hysteresis = <2000>;
|
||||
type = "passive";
|
||||
};
|
||||
|
||||
target: trip-point1 {
|
||||
temperature = <80000>;
|
||||
hysteresis = <2000>;
|
||||
type = "passive";
|
||||
};
|
||||
|
||||
cpu_crit: cpu-crit {
|
||||
temperature = <115000>;
|
||||
hysteresis = <2000>;
|
||||
type = "critical";
|
||||
};
|
||||
};
|
||||
|
||||
cooling-maps {
|
||||
map0 {
|
||||
trip = <&target>;
|
||||
cooling-device = <&cpu0
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu1
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu2
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu3
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>;
|
||||
contribution = <3072>;
|
||||
};
|
||||
map1 {
|
||||
trip = <&target>;
|
||||
cooling-device = <&cpu4
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu5
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu6
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>,
|
||||
<&cpu7
|
||||
THERMAL_NO_LIMIT
|
||||
THERMAL_NO_LIMIT>;
|
||||
contribution = <1024>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* The tzts1 ~ tzts6 don't need to polling */
|
||||
/* The tzts1 ~ tzts6 don't need to thermal throttle */
|
||||
|
||||
tzts1: tzts1 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 1>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts2: tzts2 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 2>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts3: tzts3 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 3>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts4: tzts4 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 4>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tzts5: tzts5 {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 5>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
|
||||
tztsABB: tztsABB {
|
||||
polling-delay-passive = <0>;
|
||||
polling-delay = <0>;
|
||||
thermal-sensors = <&thermal 6>;
|
||||
sustainable-power = <5000>;
|
||||
trips {};
|
||||
cooling-maps {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -993,7 +993,9 @@
|
||||
power-domain@RK3399_PD_VDU {
|
||||
reg = <RK3399_PD_VDU>;
|
||||
clocks = <&cru ACLK_VDU>,
|
||||
<&cru HCLK_VDU>;
|
||||
<&cru HCLK_VDU>,
|
||||
<&cru SCLK_VDU_CA>,
|
||||
<&cru SCLK_VDU_CORE>;
|
||||
pm_qos = <&qos_video_m1_r>,
|
||||
<&qos_video_m1_w>;
|
||||
#power-domain-cells = <0>;
|
||||
@@ -1260,7 +1262,7 @@
|
||||
|
||||
vdec: video-codec@ff660000 {
|
||||
compatible = "rockchip,rk3399-vdec";
|
||||
reg = <0x0 0xff660000 0x0 0x400>;
|
||||
reg = <0x0 0xff660000 0x0 0x480>;
|
||||
interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
clocks = <&cru ACLK_VDU>, <&cru HCLK_VDU>,
|
||||
<&cru SCLK_VDU_CA>, <&cru SCLK_VDU_CORE>;
|
||||
|
||||
@@ -480,6 +480,7 @@ config MACH_LOONGSON2EF
|
||||
|
||||
config MACH_LOONGSON64
|
||||
bool "Loongson 64-bit family of machines"
|
||||
select ARCH_DMA_DEFAULT_COHERENT
|
||||
select ARCH_SPARSEMEM_ENABLE
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT
|
||||
select ARCH_MIGHT_HAVE_PC_SERIO
|
||||
@@ -1379,6 +1380,7 @@ config CPU_LOONGSON64
|
||||
select CPU_SUPPORTS_MSA
|
||||
select CPU_DIEI_BROKEN if !LOONGSON3_ENHANCEMENT
|
||||
select CPU_MIPSR2_IRQ_VI
|
||||
select DMA_NONCOHERENT
|
||||
select WEAK_ORDERING
|
||||
select WEAK_REORDERING_BEYOND_LLSC
|
||||
select MIPS_ASID_BITS_VARIABLE
|
||||
|
||||
@@ -117,7 +117,8 @@ struct irq_source_routing_table {
|
||||
u64 pci_io_start_addr;
|
||||
u64 pci_io_end_addr;
|
||||
u64 pci_config_addr;
|
||||
u32 dma_mask_bits;
|
||||
u16 dma_mask_bits;
|
||||
u16 dma_noncoherent;
|
||||
} __packed;
|
||||
|
||||
struct interface_info {
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
* Copyright (C) 2009 Lemote Inc.
|
||||
* Author: Wu Zhangjin, wuzhangjin@gmail.com
|
||||
*/
|
||||
|
||||
#include <linux/dma-map-ops.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/pci_ids.h>
|
||||
#include <asm/bootinfo.h>
|
||||
@@ -147,8 +149,14 @@ void __init prom_lefi_init_env(void)
|
||||
|
||||
loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits;
|
||||
if (loongson_sysconf.dma_mask_bits < 32 ||
|
||||
loongson_sysconf.dma_mask_bits > 64)
|
||||
loongson_sysconf.dma_mask_bits > 64) {
|
||||
loongson_sysconf.dma_mask_bits = 32;
|
||||
dma_default_coherent = true;
|
||||
} else {
|
||||
dma_default_coherent = !eirq_source->dma_noncoherent;
|
||||
}
|
||||
|
||||
pr_info("Firmware: Coherent DMA: %s\n", dma_default_coherent ? "on" : "off");
|
||||
|
||||
loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm;
|
||||
loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;
|
||||
|
||||
@@ -86,6 +86,11 @@ void __init szmem(unsigned int node)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reserve vgabios if it comes from firmware */
|
||||
if (loongson_sysconf.vgabios_addr)
|
||||
memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr),
|
||||
SZ_256K);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_NUMA
|
||||
|
||||
@@ -344,16 +344,14 @@ int handle_misaligned_store(struct pt_regs *regs)
|
||||
} else if ((insn & INSN_MASK_C_SD) == INSN_MATCH_C_SD) {
|
||||
len = 8;
|
||||
val.data_ulong = GET_RS2S(insn, regs);
|
||||
} else if ((insn & INSN_MASK_C_SDSP) == INSN_MATCH_C_SDSP &&
|
||||
((insn >> SH_RD) & 0x1f)) {
|
||||
} else if ((insn & INSN_MASK_C_SDSP) == INSN_MATCH_C_SDSP) {
|
||||
len = 8;
|
||||
val.data_ulong = GET_RS2C(insn, regs);
|
||||
#endif
|
||||
} else if ((insn & INSN_MASK_C_SW) == INSN_MATCH_C_SW) {
|
||||
len = 4;
|
||||
val.data_ulong = GET_RS2S(insn, regs);
|
||||
} else if ((insn & INSN_MASK_C_SWSP) == INSN_MATCH_C_SWSP &&
|
||||
((insn >> SH_RD) & 0x1f)) {
|
||||
} else if ((insn & INSN_MASK_C_SWSP) == INSN_MATCH_C_SWSP) {
|
||||
len = 4;
|
||||
val.data_ulong = GET_RS2C(insn, regs);
|
||||
} else {
|
||||
|
||||
@@ -731,7 +731,7 @@ void ptep_zap_unused(struct mm_struct *mm, unsigned long addr,
|
||||
pte_clear(mm, addr, ptep);
|
||||
}
|
||||
if (reset)
|
||||
pgste_val(pgste) &= ~_PGSTE_GPS_USAGE_MASK;
|
||||
pgste_val(pgste) &= ~(_PGSTE_GPS_USAGE_MASK | _PGSTE_GPS_NODAT);
|
||||
pgste_set_unlock(ptep, pgste);
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
@@ -1316,6 +1316,9 @@ static void zenbleed_check_cpu(void *unused)
|
||||
|
||||
void amd_check_microcode(void)
|
||||
{
|
||||
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
|
||||
return;
|
||||
|
||||
on_each_cpu(zenbleed_check_cpu, NULL, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1750,15 +1750,17 @@ void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
|
||||
bool old_paging = is_paging(vcpu);
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
if (vcpu->arch.efer & EFER_LME && !vcpu->arch.guest_state_protected) {
|
||||
if (vcpu->arch.efer & EFER_LME) {
|
||||
if (!is_paging(vcpu) && (cr0 & X86_CR0_PG)) {
|
||||
vcpu->arch.efer |= EFER_LMA;
|
||||
svm->vmcb->save.efer |= EFER_LMA | EFER_LME;
|
||||
if (!vcpu->arch.guest_state_protected)
|
||||
svm->vmcb->save.efer |= EFER_LMA | EFER_LME;
|
||||
}
|
||||
|
||||
if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) {
|
||||
vcpu->arch.efer &= ~EFER_LMA;
|
||||
svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME);
|
||||
if (!vcpu->arch.guest_state_protected)
|
||||
svm->vmcb->save.efer &= ~(EFER_LMA | EFER_LME);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5021,6 +5021,7 @@ static void binder_release_work(struct binder_proc *proc,
|
||||
"undelivered TRANSACTION_ERROR: %u\n",
|
||||
e->cmd);
|
||||
} break;
|
||||
case BINDER_WORK_TRANSACTION_ONEWAY_SPAM_SUSPECT:
|
||||
case BINDER_WORK_TRANSACTION_COMPLETE: {
|
||||
binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
|
||||
"undelivered TRANSACTION_COMPLETE\n");
|
||||
|
||||
@@ -363,6 +363,7 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
||||
devcd->devcd_dev.class = &devcd_class;
|
||||
|
||||
mutex_lock(&devcd->mutex);
|
||||
dev_set_uevent_suppress(&devcd->devcd_dev, true);
|
||||
if (device_add(&devcd->devcd_dev))
|
||||
goto put_device;
|
||||
|
||||
@@ -377,6 +378,8 @@ void dev_coredumpm(struct device *dev, struct module *owner,
|
||||
"devcoredump"))
|
||||
dev_warn(dev, "devcoredump create_link failed\n");
|
||||
|
||||
dev_set_uevent_suppress(&devcd->devcd_dev, false);
|
||||
kobject_uevent(&devcd->devcd_dev.kobj, KOBJ_ADD);
|
||||
INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
|
||||
schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
|
||||
mutex_unlock(&devcd->mutex);
|
||||
|
||||
@@ -404,8 +404,7 @@ out:
|
||||
rb_entry(node, struct regmap_range_node, node);
|
||||
|
||||
/* If there's nothing in the cache there's nothing to sync */
|
||||
ret = regcache_read(map, this->selector_reg, &i);
|
||||
if (ret != 0)
|
||||
if (regcache_read(map, this->selector_reg, &i) != 0)
|
||||
continue;
|
||||
|
||||
ret = _regmap_write(map, this->selector_reg, i);
|
||||
|
||||
@@ -480,14 +480,17 @@ static ssize_t export_store(struct class *class,
|
||||
goto done;
|
||||
|
||||
status = gpiod_set_transitory(desc, false);
|
||||
if (!status) {
|
||||
status = gpiod_export(desc, true);
|
||||
if (status < 0)
|
||||
gpiod_free(desc);
|
||||
else
|
||||
set_bit(FLAG_SYSFS, &desc->flags);
|
||||
if (status) {
|
||||
gpiod_free(desc);
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = gpiod_export(desc, true);
|
||||
if (status < 0)
|
||||
gpiod_free(desc);
|
||||
else
|
||||
set_bit(FLAG_SYSFS, &desc->flags);
|
||||
|
||||
done:
|
||||
if (status)
|
||||
pr_debug("%s: status %d\n", __func__, status);
|
||||
|
||||
@@ -142,7 +142,7 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs
|
||||
}
|
||||
|
||||
for (i = 0; i < p->nchunks; i++) {
|
||||
struct drm_amdgpu_cs_chunk __user **chunk_ptr = NULL;
|
||||
struct drm_amdgpu_cs_chunk __user *chunk_ptr = NULL;
|
||||
struct drm_amdgpu_cs_chunk user_chunk;
|
||||
uint32_t __user *cdata;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ static void amdgpu_display_flip_work_func(struct work_struct *__work)
|
||||
|
||||
struct drm_crtc *crtc = &amdgpu_crtc->base;
|
||||
unsigned long flags;
|
||||
unsigned i;
|
||||
unsigned int i;
|
||||
int vpos, hpos;
|
||||
|
||||
if (amdgpu_display_flip_handle_fence(work, &work->excl))
|
||||
@@ -159,7 +159,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
|
||||
u64 tiling_flags;
|
||||
int i, r;
|
||||
|
||||
work = kzalloc(sizeof *work, GFP_KERNEL);
|
||||
work = kzalloc(sizeof(*work), GFP_KERNEL);
|
||||
if (work == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -290,18 +290,17 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
|
||||
|
||||
adev = drm_to_adev(dev);
|
||||
/* if we have active crtcs and we don't have a power ref,
|
||||
take the current one */
|
||||
* take the current one
|
||||
*/
|
||||
if (active && !adev->have_disp_power_ref) {
|
||||
adev->have_disp_power_ref = true;
|
||||
return ret;
|
||||
}
|
||||
/* if we have no active crtcs, then drop the power ref
|
||||
we got before */
|
||||
if (!active && adev->have_disp_power_ref) {
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
/* if we have no active crtcs, then go to
|
||||
* drop the power ref we got before
|
||||
*/
|
||||
if (!active && adev->have_disp_power_ref)
|
||||
adev->have_disp_power_ref = false;
|
||||
}
|
||||
|
||||
out:
|
||||
/* drop the power reference we got coming in here */
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
@@ -465,11 +464,10 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
|
||||
if (amdgpu_connector->router.ddc_valid)
|
||||
amdgpu_i2c_router_select_ddc_port(amdgpu_connector);
|
||||
|
||||
if (use_aux) {
|
||||
if (use_aux)
|
||||
ret = i2c_transfer(&amdgpu_connector->ddc_bus->aux.ddc, msgs, 2);
|
||||
} else {
|
||||
else
|
||||
ret = i2c_transfer(&amdgpu_connector->ddc_bus->adapter, msgs, 2);
|
||||
}
|
||||
|
||||
if (ret != 2)
|
||||
/* Couldn't find an accessible DDC on this connector */
|
||||
@@ -478,10 +476,12 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
|
||||
* EDID header starts with:
|
||||
* 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00.
|
||||
* Only the first 6 bytes must be valid as
|
||||
* drm_edid_block_valid() can fix the last 2 bytes */
|
||||
* drm_edid_block_valid() can fix the last 2 bytes
|
||||
*/
|
||||
if (drm_edid_header_is_valid(buf) < 6) {
|
||||
/* Couldn't find an accessible EDID on this
|
||||
* connector */
|
||||
* connector
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1189,8 +1189,10 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
|
||||
|
||||
obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
|
||||
if (obj == NULL) {
|
||||
drm_dbg_kms(dev, "No GEM object associated to handle 0x%08X, "
|
||||
"can't create framebuffer\n", mode_cmd->handles[0]);
|
||||
drm_dbg_kms(dev,
|
||||
"No GEM object associated to handle 0x%08X, can't create framebuffer\n",
|
||||
mode_cmd->handles[0]);
|
||||
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
|
||||
@@ -1384,6 +1386,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
|
||||
}
|
||||
if (amdgpu_crtc->rmx_type != RMX_OFF) {
|
||||
fixed20_12 a, b;
|
||||
|
||||
a.full = dfixed_const(src_v);
|
||||
b.full = dfixed_const(dst_v);
|
||||
amdgpu_crtc->vsc.full = dfixed_div(a, b);
|
||||
@@ -1403,7 +1406,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
|
||||
*
|
||||
* \param dev Device to query.
|
||||
* \param pipe Crtc to query.
|
||||
* \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
|
||||
* \param flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
|
||||
* For driver internal use only also supports these flags:
|
||||
*
|
||||
* USE_REAL_VBLANKSTART to use the real start of vblank instead
|
||||
@@ -1479,8 +1482,8 @@ int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev,
|
||||
|
||||
/* Called from driver internal vblank counter query code? */
|
||||
if (flags & GET_DISTANCE_TO_VBLANKSTART) {
|
||||
/* Caller wants distance from real vbl_start in *hpos */
|
||||
*hpos = *vpos - vbl_start;
|
||||
/* Caller wants distance from real vbl_start in *hpos */
|
||||
*hpos = *vpos - vbl_start;
|
||||
}
|
||||
|
||||
/* Fudge vblank to start a few scanlines earlier to handle the
|
||||
@@ -1502,7 +1505,7 @@ int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev,
|
||||
|
||||
/* In vblank? */
|
||||
if (in_vbl)
|
||||
ret |= DRM_SCANOUTPOS_IN_VBLANK;
|
||||
ret |= DRM_SCANOUTPOS_IN_VBLANK;
|
||||
|
||||
/* Called from driver internal vblank counter query code? */
|
||||
if (flags & GET_DISTANCE_TO_VBLANKSTART) {
|
||||
@@ -1593,6 +1596,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
|
||||
|
||||
if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
|
||||
struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
|
||||
|
||||
r = amdgpu_bo_reserve(aobj, true);
|
||||
if (r == 0) {
|
||||
amdgpu_bo_unpin(aobj);
|
||||
@@ -1600,9 +1604,9 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
|
||||
}
|
||||
}
|
||||
|
||||
if (fb == NULL || fb->obj[0] == NULL) {
|
||||
if (!fb || !fb->obj[0])
|
||||
continue;
|
||||
}
|
||||
|
||||
robj = gem_to_amdgpu_bo(fb->obj[0]);
|
||||
/* don't unpin kernel fb objects */
|
||||
if (!amdgpu_fbdev_robj_is_fb(adev, robj)) {
|
||||
@@ -1630,6 +1634,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev)
|
||||
|
||||
if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
|
||||
struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
|
||||
|
||||
r = amdgpu_bo_reserve(aobj, true);
|
||||
if (r == 0) {
|
||||
r = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define POWER_METER_CAN_NOTIFY (1 << 3)
|
||||
#define POWER_METER_IS_BATTERY (1 << 8)
|
||||
#define UNKNOWN_HYSTERESIS 0xFFFFFFFF
|
||||
#define UNKNOWN_POWER 0xFFFFFFFF
|
||||
|
||||
#define METER_NOTIFY_CONFIG 0x80
|
||||
#define METER_NOTIFY_TRIP 0x81
|
||||
@@ -348,6 +349,9 @@ static ssize_t show_power(struct device *dev,
|
||||
update_meter(resource);
|
||||
mutex_unlock(&resource->lock);
|
||||
|
||||
if (resource->power == UNKNOWN_POWER)
|
||||
return -ENODATA;
|
||||
|
||||
return sprintf(buf, "%llu\n", resource->power * 1000);
|
||||
}
|
||||
|
||||
|
||||
@@ -161,13 +161,13 @@ static int kraken2_probe(struct hid_device *hdev,
|
||||
ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW);
|
||||
if (ret) {
|
||||
hid_err(hdev, "hid hw start failed with %d\n", ret);
|
||||
goto fail_and_stop;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = hid_hw_open(hdev);
|
||||
if (ret) {
|
||||
hid_err(hdev, "hid hw open failed with %d\n", ret);
|
||||
goto fail_and_close;
|
||||
goto fail_and_stop;
|
||||
}
|
||||
|
||||
priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2",
|
||||
|
||||
@@ -2091,7 +2091,7 @@ static void clear_etmdrvdata(void *info)
|
||||
etmdrvdata[cpu] = NULL;
|
||||
}
|
||||
|
||||
static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata)
|
||||
static void etm4_remove_dev(struct etmv4_drvdata *drvdata)
|
||||
{
|
||||
etm_perf_symlink(drvdata->csdev, false);
|
||||
/*
|
||||
@@ -2112,11 +2112,9 @@ static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata)
|
||||
|
||||
cscfg_unregister_csdev(drvdata->csdev);
|
||||
coresight_unregister(drvdata->csdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit etm4_remove_amba(struct amba_device *adev)
|
||||
static void etm4_remove_amba(struct amba_device *adev)
|
||||
{
|
||||
struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev);
|
||||
|
||||
@@ -2124,15 +2122,14 @@ static void __exit etm4_remove_amba(struct amba_device *adev)
|
||||
etm4_remove_dev(drvdata);
|
||||
}
|
||||
|
||||
static int __exit etm4_remove_platform_dev(struct platform_device *pdev)
|
||||
static int etm4_remove_platform_dev(struct platform_device *pdev)
|
||||
{
|
||||
int ret = 0;
|
||||
struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
if (drvdata)
|
||||
ret = etm4_remove_dev(drvdata);
|
||||
etm4_remove_dev(drvdata);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct amba_id etm4_ids[] = {
|
||||
|
||||
@@ -63,7 +63,7 @@ static int dw_reg_read(void *context, unsigned int reg, unsigned int *val)
|
||||
{
|
||||
struct dw_i2c_dev *dev = context;
|
||||
|
||||
*val = readl_relaxed(dev->base + reg);
|
||||
*val = readl(dev->base + reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ static int dw_reg_write(void *context, unsigned int reg, unsigned int val)
|
||||
{
|
||||
struct dw_i2c_dev *dev = context;
|
||||
|
||||
writel_relaxed(val, dev->base + reg);
|
||||
writel(val, dev->base + reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ static int dw_reg_read_swab(void *context, unsigned int reg, unsigned int *val)
|
||||
{
|
||||
struct dw_i2c_dev *dev = context;
|
||||
|
||||
*val = swab32(readl_relaxed(dev->base + reg));
|
||||
*val = swab32(readl(dev->base + reg));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ static int dw_reg_write_swab(void *context, unsigned int reg, unsigned int val)
|
||||
{
|
||||
struct dw_i2c_dev *dev = context;
|
||||
|
||||
writel_relaxed(swab32(val), dev->base + reg);
|
||||
writel(swab32(val), dev->base + reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -99,8 +99,8 @@ static int dw_reg_read_word(void *context, unsigned int reg, unsigned int *val)
|
||||
{
|
||||
struct dw_i2c_dev *dev = context;
|
||||
|
||||
*val = readw_relaxed(dev->base + reg) |
|
||||
(readw_relaxed(dev->base + reg + 2) << 16);
|
||||
*val = readw(dev->base + reg) |
|
||||
(readw(dev->base + reg + 2) << 16);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -109,8 +109,8 @@ static int dw_reg_write_word(void *context, unsigned int reg, unsigned int val)
|
||||
{
|
||||
struct dw_i2c_dev *dev = context;
|
||||
|
||||
writew_relaxed(val, dev->base + reg);
|
||||
writew_relaxed(val >> 16, dev->base + reg + 2);
|
||||
writew(val, dev->base + reg);
|
||||
writew(val >> 16, dev->base + reg + 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -96,12 +96,6 @@ unsigned long ib_umem_find_best_pgsz(struct ib_umem *umem,
|
||||
return page_size;
|
||||
}
|
||||
|
||||
/* rdma_for_each_block() has a bug if the page size is smaller than the
|
||||
* page size used to build the umem. For now prevent smaller page sizes
|
||||
* from being returned.
|
||||
*/
|
||||
pgsz_bitmap &= GENMASK(BITS_PER_LONG - 1, PAGE_SHIFT);
|
||||
|
||||
/* The best result is the smallest page size that results in the minimum
|
||||
* number of required pages. Compute the largest page size that could
|
||||
* work based on VA address bits that don't change.
|
||||
|
||||
@@ -70,7 +70,7 @@ static char version[] =
|
||||
BNXT_RE_DESC "\n";
|
||||
|
||||
MODULE_AUTHOR("Eddie Wai <eddie.wai@broadcom.com>");
|
||||
MODULE_DESCRIPTION(BNXT_RE_DESC " Driver");
|
||||
MODULE_DESCRIPTION(BNXT_RE_DESC);
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
||||
/* globals */
|
||||
|
||||
@@ -4586,10 +4586,15 @@ static int check_cong_type(struct ib_qp *ibqp,
|
||||
cong_alg->wnd_mode_sel = WND_LIMIT;
|
||||
break;
|
||||
default:
|
||||
ibdev_err(&hr_dev->ib_dev,
|
||||
"error type(%u) for congestion selection.\n",
|
||||
hr_dev->caps.cong_type);
|
||||
return -EINVAL;
|
||||
ibdev_warn(&hr_dev->ib_dev,
|
||||
"invalid type(%u) for congestion selection.\n",
|
||||
hr_dev->caps.cong_type);
|
||||
hr_dev->caps.cong_type = CONG_TYPE_DCQCN;
|
||||
cong_alg->alg_sel = CONG_DCQCN;
|
||||
cong_alg->alg_sub_sel = UNSUPPORT_CONG_LEVEL;
|
||||
cong_alg->dip_vld = DIP_INVALID;
|
||||
cong_alg->wnd_mode_sel = WND_LIMIT;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -322,7 +322,11 @@ static void irdma_process_aeq(struct irdma_pci_f *rf)
|
||||
break;
|
||||
case IRDMA_AE_QP_SUSPEND_COMPLETE:
|
||||
if (iwqp->iwdev->vsi.tc_change_pending) {
|
||||
atomic_dec(&iwqp->sc_qp.vsi->qp_suspend_reqs);
|
||||
if (!atomic_dec_return(&qp->vsi->qp_suspend_reqs))
|
||||
wake_up(&iwqp->iwdev->suspend_wq);
|
||||
}
|
||||
if (iwqp->suspend_pending) {
|
||||
iwqp->suspend_pending = false;
|
||||
wake_up(&iwqp->iwdev->suspend_wq);
|
||||
}
|
||||
break;
|
||||
@@ -1165,7 +1169,6 @@ static enum irdma_status_code irdma_create_ceq(struct irdma_pci_f *rf,
|
||||
enum irdma_status_code status;
|
||||
struct irdma_ceq_init_info info = {};
|
||||
struct irdma_sc_dev *dev = &rf->sc_dev;
|
||||
u64 scratch;
|
||||
u32 ceq_size;
|
||||
|
||||
info.ceq_id = ceq_id;
|
||||
@@ -1186,14 +1189,13 @@ static enum irdma_status_code irdma_create_ceq(struct irdma_pci_f *rf,
|
||||
iwceq->sc_ceq.ceq_id = ceq_id;
|
||||
info.dev = dev;
|
||||
info.vsi = vsi;
|
||||
scratch = (uintptr_t)&rf->cqp.sc_cqp;
|
||||
status = irdma_sc_ceq_init(&iwceq->sc_ceq, &info);
|
||||
if (!status) {
|
||||
if (dev->ceq_valid)
|
||||
status = irdma_cqp_ceq_cmd(&rf->sc_dev, &iwceq->sc_ceq,
|
||||
IRDMA_OP_CEQ_CREATE);
|
||||
else
|
||||
status = irdma_sc_cceq_create(&iwceq->sc_ceq, scratch);
|
||||
status = irdma_sc_cceq_create(&iwceq->sc_ceq, 0);
|
||||
}
|
||||
|
||||
if (status) {
|
||||
|
||||
@@ -48,7 +48,7 @@ static void irdma_prep_tc_change(struct irdma_device *iwdev)
|
||||
/* Wait for all qp's to suspend */
|
||||
wait_event_timeout(iwdev->suspend_wq,
|
||||
!atomic_read(&iwdev->vsi.qp_suspend_reqs),
|
||||
IRDMA_EVENT_TIMEOUT);
|
||||
msecs_to_jiffies(IRDMA_EVENT_TIMEOUT_MS));
|
||||
irdma_ws_reset(&iwdev->vsi);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ extern struct auxiliary_driver i40iw_auxiliary_drv;
|
||||
|
||||
#define MAX_DPC_ITERATIONS 128
|
||||
|
||||
#define IRDMA_EVENT_TIMEOUT 50000
|
||||
#define IRDMA_EVENT_TIMEOUT_MS 5000
|
||||
#define IRDMA_VCHNL_EVENT_TIMEOUT 100000
|
||||
#define IRDMA_RST_TIMEOUT_HZ 4
|
||||
|
||||
|
||||
@@ -1082,6 +1082,21 @@ static int irdma_query_pkey(struct ib_device *ibdev, u32 port, u16 index,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int irdma_wait_for_suspend(struct irdma_qp *iwqp)
|
||||
{
|
||||
if (!wait_event_timeout(iwqp->iwdev->suspend_wq,
|
||||
!iwqp->suspend_pending,
|
||||
msecs_to_jiffies(IRDMA_EVENT_TIMEOUT_MS))) {
|
||||
iwqp->suspend_pending = false;
|
||||
ibdev_warn(&iwqp->iwdev->ibdev,
|
||||
"modify_qp timed out waiting for suspend. qp_id = %d, last_ae = 0x%x\n",
|
||||
iwqp->ibqp.qp_num, iwqp->last_aeq);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* irdma_modify_qp_roce - modify qp request
|
||||
* @ibqp: qp's pointer for modify
|
||||
@@ -1330,17 +1345,11 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
||||
|
||||
info.next_iwarp_state = IRDMA_QP_STATE_SQD;
|
||||
issue_modify_qp = 1;
|
||||
iwqp->suspend_pending = true;
|
||||
break;
|
||||
case IB_QPS_SQE:
|
||||
case IB_QPS_ERR:
|
||||
case IB_QPS_RESET:
|
||||
if (iwqp->iwarp_state == IRDMA_QP_STATE_RTS) {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
info.next_iwarp_state = IRDMA_QP_STATE_SQD;
|
||||
irdma_hw_modify_qp(iwdev, iwqp, &info, true);
|
||||
spin_lock_irqsave(&iwqp->lock, flags);
|
||||
}
|
||||
|
||||
if (iwqp->iwarp_state == IRDMA_QP_STATE_ERROR) {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
if (udata) {
|
||||
@@ -1377,6 +1386,11 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
||||
ctx_info->rem_endpoint_idx = udp_info->arp_idx;
|
||||
if (irdma_hw_modify_qp(iwdev, iwqp, &info, true))
|
||||
return -EINVAL;
|
||||
if (info.next_iwarp_state == IRDMA_QP_STATE_SQD) {
|
||||
ret = irdma_wait_for_suspend(iwqp);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
spin_lock_irqsave(&iwqp->lock, flags);
|
||||
if (iwqp->iwarp_state == info.curr_iwarp_state) {
|
||||
iwqp->iwarp_state = info.next_iwarp_state;
|
||||
|
||||
@@ -188,6 +188,7 @@ struct irdma_qp {
|
||||
u8 flush_issued : 1;
|
||||
u8 sig_all : 1;
|
||||
u8 pau_mode : 1;
|
||||
u8 suspend_pending : 1;
|
||||
u8 rsvd : 1;
|
||||
u8 iwarp_state;
|
||||
u16 term_sq_flush_code;
|
||||
|
||||
@@ -383,7 +383,7 @@ static void complete_rdma_req(struct rtrs_clt_io_req *req, int errno,
|
||||
struct rtrs_clt_path *clt_path;
|
||||
int err;
|
||||
|
||||
if (WARN_ON(!req->in_use))
|
||||
if (!req->in_use)
|
||||
return;
|
||||
if (WARN_ON(!req->con))
|
||||
return;
|
||||
@@ -1682,7 +1682,7 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)
|
||||
clt_path->s.dev_ref++;
|
||||
max_send_wr = min_t(int, wr_limit,
|
||||
/* QD * (REQ + RSP + FR REGS or INVS) + drain */
|
||||
clt_path->queue_depth * 3 + 1);
|
||||
clt_path->queue_depth * 4 + 1);
|
||||
max_recv_wr = min_t(int, wr_limit,
|
||||
clt_path->queue_depth * 3 + 1);
|
||||
max_send_sge = 2;
|
||||
@@ -2341,8 +2341,6 @@ static int init_conns(struct rtrs_clt_path *clt_path)
|
||||
if (err)
|
||||
goto destroy;
|
||||
|
||||
rtrs_start_hb(&clt_path->s);
|
||||
|
||||
return 0;
|
||||
|
||||
destroy:
|
||||
@@ -2616,6 +2614,7 @@ static int init_path(struct rtrs_clt_path *clt_path)
|
||||
goto out;
|
||||
}
|
||||
rtrs_clt_path_up(clt_path);
|
||||
rtrs_start_hb(&clt_path->s);
|
||||
out:
|
||||
mutex_unlock(&clt_path->init_mutex);
|
||||
|
||||
|
||||
@@ -72,8 +72,9 @@ static bool rtrs_srv_change_state(struct rtrs_srv_path *srv_path,
|
||||
{
|
||||
enum rtrs_srv_state old_state;
|
||||
bool changed = false;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irq(&srv_path->state_lock);
|
||||
spin_lock_irqsave(&srv_path->state_lock, flags);
|
||||
old_state = srv_path->state;
|
||||
switch (new_state) {
|
||||
case RTRS_SRV_CONNECTED:
|
||||
@@ -94,7 +95,7 @@ static bool rtrs_srv_change_state(struct rtrs_srv_path *srv_path,
|
||||
}
|
||||
if (changed)
|
||||
srv_path->state = new_state;
|
||||
spin_unlock_irq(&srv_path->state_lock);
|
||||
spin_unlock_irqrestore(&srv_path->state_lock, flags);
|
||||
|
||||
return changed;
|
||||
}
|
||||
@@ -555,7 +556,10 @@ static void unmap_cont_bufs(struct rtrs_srv_path *srv_path)
|
||||
struct rtrs_srv_mr *srv_mr;
|
||||
|
||||
srv_mr = &srv_path->mrs[i];
|
||||
rtrs_iu_free(srv_mr->iu, srv_path->s.dev->ib_dev, 1);
|
||||
|
||||
if (always_invalidate)
|
||||
rtrs_iu_free(srv_mr->iu, srv_path->s.dev->ib_dev, 1);
|
||||
|
||||
ib_dereg_mr(srv_mr->mr);
|
||||
ib_dma_unmap_sg(srv_path->s.dev->ib_dev, srv_mr->sgt.sgl,
|
||||
srv_mr->sgt.nents, DMA_BIDIRECTIONAL);
|
||||
@@ -721,20 +725,23 @@ static void rtrs_srv_info_rsp_done(struct ib_cq *cq, struct ib_wc *wc)
|
||||
WARN_ON(wc->opcode != IB_WC_SEND);
|
||||
}
|
||||
|
||||
static void rtrs_srv_path_up(struct rtrs_srv_path *srv_path)
|
||||
static int rtrs_srv_path_up(struct rtrs_srv_path *srv_path)
|
||||
{
|
||||
struct rtrs_srv *srv = srv_path->srv;
|
||||
struct rtrs_srv_ctx *ctx = srv->ctx;
|
||||
int up;
|
||||
int up, ret = 0;
|
||||
|
||||
mutex_lock(&srv->paths_ev_mutex);
|
||||
up = ++srv->paths_up;
|
||||
if (up == 1)
|
||||
ctx->ops.link_ev(srv, RTRS_SRV_LINK_EV_CONNECTED, NULL);
|
||||
ret = ctx->ops.link_ev(srv, RTRS_SRV_LINK_EV_CONNECTED, NULL);
|
||||
mutex_unlock(&srv->paths_ev_mutex);
|
||||
|
||||
/* Mark session as established */
|
||||
srv_path->established = true;
|
||||
if (!ret)
|
||||
srv_path->established = true;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void rtrs_srv_path_down(struct rtrs_srv_path *srv_path)
|
||||
@@ -863,7 +870,12 @@ static int process_info_req(struct rtrs_srv_con *con,
|
||||
goto iu_free;
|
||||
kobject_get(&srv_path->kobj);
|
||||
get_device(&srv_path->srv->dev);
|
||||
rtrs_srv_change_state(srv_path, RTRS_SRV_CONNECTED);
|
||||
err = rtrs_srv_change_state(srv_path, RTRS_SRV_CONNECTED);
|
||||
if (!err) {
|
||||
rtrs_err(s, "rtrs_srv_change_state(), err: %d\n", err);
|
||||
goto iu_free;
|
||||
}
|
||||
|
||||
rtrs_srv_start_hb(srv_path);
|
||||
|
||||
/*
|
||||
@@ -872,7 +884,11 @@ static int process_info_req(struct rtrs_srv_con *con,
|
||||
* all connections are successfully established. Thus, simply notify
|
||||
* listener with a proper event if we are the first path.
|
||||
*/
|
||||
rtrs_srv_path_up(srv_path);
|
||||
err = rtrs_srv_path_up(srv_path);
|
||||
if (err) {
|
||||
rtrs_err(s, "rtrs_srv_path_up(), err: %d\n", err);
|
||||
goto iu_free;
|
||||
}
|
||||
|
||||
ib_dma_sync_single_for_device(srv_path->s.dev->ib_dev,
|
||||
tx_iu->dma_addr,
|
||||
@@ -1525,7 +1541,6 @@ static void rtrs_srv_close_work(struct work_struct *work)
|
||||
|
||||
srv_path = container_of(work, typeof(*srv_path), close_work);
|
||||
|
||||
rtrs_srv_destroy_path_files(srv_path);
|
||||
rtrs_srv_stop_hb(srv_path);
|
||||
|
||||
for (i = 0; i < srv_path->s.con_num; i++) {
|
||||
@@ -1545,6 +1560,8 @@ static void rtrs_srv_close_work(struct work_struct *work)
|
||||
/* Wait for all completion */
|
||||
wait_for_completion(&srv_path->complete_done);
|
||||
|
||||
rtrs_srv_destroy_path_files(srv_path);
|
||||
|
||||
/* Notify upper layer if we are the last path */
|
||||
rtrs_srv_path_down(srv_path);
|
||||
|
||||
|
||||
174
drivers/md/md.c
174
drivers/md/md.c
@@ -92,6 +92,18 @@ static int remove_and_add_spares(struct mddev *mddev,
|
||||
struct md_rdev *this);
|
||||
static void mddev_detach(struct mddev *mddev);
|
||||
|
||||
enum md_ro_state {
|
||||
MD_RDWR,
|
||||
MD_RDONLY,
|
||||
MD_AUTO_READ,
|
||||
MD_MAX_STATE
|
||||
};
|
||||
|
||||
static bool md_is_rdwr(struct mddev *mddev)
|
||||
{
|
||||
return (mddev->ro == MD_RDWR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Default number of read corrections we'll attempt on an rdev
|
||||
* before ejecting it from the array. We divide the read error
|
||||
@@ -461,7 +473,7 @@ static blk_qc_t md_submit_bio(struct bio *bio)
|
||||
if (!bio)
|
||||
return BLK_QC_T_NONE;
|
||||
|
||||
if (mddev->ro == 1 && unlikely(rw == WRITE)) {
|
||||
if (mddev->ro == MD_RDONLY && unlikely(rw == WRITE)) {
|
||||
if (bio_sectors(bio) != 0)
|
||||
bio->bi_status = BLK_STS_IOERR;
|
||||
bio_endio(bio);
|
||||
@@ -2680,7 +2692,7 @@ void md_update_sb(struct mddev *mddev, int force_change)
|
||||
int any_badblocks_changed = 0;
|
||||
int ret = -1;
|
||||
|
||||
if (mddev->ro) {
|
||||
if (!md_is_rdwr(mddev)) {
|
||||
if (force_change)
|
||||
set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags);
|
||||
return;
|
||||
@@ -3953,7 +3965,7 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
goto out_unlock;
|
||||
}
|
||||
rv = -EROFS;
|
||||
if (mddev->ro)
|
||||
if (!md_is_rdwr(mddev))
|
||||
goto out_unlock;
|
||||
|
||||
/* request to change the personality. Need to ensure:
|
||||
@@ -4159,7 +4171,7 @@ layout_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
if (mddev->pers) {
|
||||
if (mddev->pers->check_reshape == NULL)
|
||||
err = -EBUSY;
|
||||
else if (mddev->ro)
|
||||
else if (!md_is_rdwr(mddev))
|
||||
err = -EROFS;
|
||||
else {
|
||||
mddev->new_layout = n;
|
||||
@@ -4268,7 +4280,7 @@ chunk_size_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
if (mddev->pers) {
|
||||
if (mddev->pers->check_reshape == NULL)
|
||||
err = -EBUSY;
|
||||
else if (mddev->ro)
|
||||
else if (!md_is_rdwr(mddev))
|
||||
err = -EROFS;
|
||||
else {
|
||||
mddev->new_chunk_sectors = n >> 9;
|
||||
@@ -4391,13 +4403,13 @@ array_state_show(struct mddev *mddev, char *page)
|
||||
|
||||
if (mddev->pers && !test_bit(MD_NOT_READY, &mddev->flags)) {
|
||||
switch(mddev->ro) {
|
||||
case 1:
|
||||
case MD_RDONLY:
|
||||
st = readonly;
|
||||
break;
|
||||
case 2:
|
||||
case MD_AUTO_READ:
|
||||
st = read_auto;
|
||||
break;
|
||||
case 0:
|
||||
case MD_RDWR:
|
||||
spin_lock(&mddev->lock);
|
||||
if (test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags))
|
||||
st = write_pending;
|
||||
@@ -4433,7 +4445,8 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
int err = 0;
|
||||
enum array_state st = match_word(buf, array_states);
|
||||
|
||||
if (mddev->pers && (st == active || st == clean) && mddev->ro != 1) {
|
||||
if (mddev->pers && (st == active || st == clean) &&
|
||||
mddev->ro != MD_RDONLY) {
|
||||
/* don't take reconfig_mutex when toggling between
|
||||
* clean and active
|
||||
*/
|
||||
@@ -4477,23 +4490,23 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
if (mddev->pers)
|
||||
err = md_set_readonly(mddev, NULL);
|
||||
else {
|
||||
mddev->ro = 1;
|
||||
mddev->ro = MD_RDONLY;
|
||||
set_disk_ro(mddev->gendisk, 1);
|
||||
err = do_md_run(mddev);
|
||||
}
|
||||
break;
|
||||
case read_auto:
|
||||
if (mddev->pers) {
|
||||
if (mddev->ro == 0)
|
||||
if (md_is_rdwr(mddev))
|
||||
err = md_set_readonly(mddev, NULL);
|
||||
else if (mddev->ro == 1)
|
||||
else if (mddev->ro == MD_RDONLY)
|
||||
err = restart_array(mddev);
|
||||
if (err == 0) {
|
||||
mddev->ro = 2;
|
||||
mddev->ro = MD_AUTO_READ;
|
||||
set_disk_ro(mddev->gendisk, 0);
|
||||
}
|
||||
} else {
|
||||
mddev->ro = 2;
|
||||
mddev->ro = MD_AUTO_READ;
|
||||
err = do_md_run(mddev);
|
||||
}
|
||||
break;
|
||||
@@ -4518,7 +4531,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
wake_up(&mddev->sb_wait);
|
||||
err = 0;
|
||||
} else {
|
||||
mddev->ro = 0;
|
||||
mddev->ro = MD_RDWR;
|
||||
set_disk_ro(mddev->gendisk, 0);
|
||||
err = do_md_run(mddev);
|
||||
}
|
||||
@@ -4819,7 +4832,7 @@ action_show(struct mddev *mddev, char *page)
|
||||
if (test_bit(MD_RECOVERY_FROZEN, &recovery))
|
||||
type = "frozen";
|
||||
else if (test_bit(MD_RECOVERY_RUNNING, &recovery) ||
|
||||
(!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &recovery))) {
|
||||
(md_is_rdwr(mddev) && test_bit(MD_RECOVERY_NEEDED, &recovery))) {
|
||||
if (test_bit(MD_RECOVERY_RESHAPE, &recovery))
|
||||
type = "reshape";
|
||||
else if (test_bit(MD_RECOVERY_SYNC, &recovery)) {
|
||||
@@ -4892,11 +4905,11 @@ action_store(struct mddev *mddev, const char *page, size_t len)
|
||||
set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
|
||||
set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
|
||||
}
|
||||
if (mddev->ro == 2) {
|
||||
if (mddev->ro == MD_AUTO_READ) {
|
||||
/* A write to sync_action is enough to justify
|
||||
* canceling read-auto mode
|
||||
*/
|
||||
mddev->ro = 0;
|
||||
mddev->ro = MD_RDWR;
|
||||
md_wakeup_thread(mddev->sync_thread);
|
||||
}
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
@@ -5124,8 +5137,7 @@ max_sync_store(struct mddev *mddev, const char *buf, size_t len)
|
||||
goto out_unlock;
|
||||
|
||||
err = -EBUSY;
|
||||
if (max < mddev->resync_max &&
|
||||
mddev->ro == 0 &&
|
||||
if (max < mddev->resync_max && md_is_rdwr(mddev) &&
|
||||
test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))
|
||||
goto out_unlock;
|
||||
|
||||
@@ -5841,8 +5853,8 @@ int md_run(struct mddev *mddev)
|
||||
continue;
|
||||
sync_blockdev(rdev->bdev);
|
||||
invalidate_bdev(rdev->bdev);
|
||||
if (mddev->ro != 1 && rdev_read_only(rdev)) {
|
||||
mddev->ro = 1;
|
||||
if (mddev->ro != MD_RDONLY && rdev_read_only(rdev)) {
|
||||
mddev->ro = MD_RDONLY;
|
||||
if (mddev->gendisk)
|
||||
set_disk_ro(mddev->gendisk, 1);
|
||||
}
|
||||
@@ -5945,8 +5957,8 @@ int md_run(struct mddev *mddev)
|
||||
|
||||
mddev->ok_start_degraded = start_dirty_degraded;
|
||||
|
||||
if (start_readonly && mddev->ro == 0)
|
||||
mddev->ro = 2; /* read-only, but switch on first write */
|
||||
if (start_readonly && md_is_rdwr(mddev))
|
||||
mddev->ro = MD_AUTO_READ; /* read-only, but switch on first write */
|
||||
|
||||
err = pers->run(mddev);
|
||||
if (err)
|
||||
@@ -6021,8 +6033,8 @@ int md_run(struct mddev *mddev)
|
||||
mddev->sysfs_action = sysfs_get_dirent_safe(mddev->kobj.sd, "sync_action");
|
||||
mddev->sysfs_completed = sysfs_get_dirent_safe(mddev->kobj.sd, "sync_completed");
|
||||
mddev->sysfs_degraded = sysfs_get_dirent_safe(mddev->kobj.sd, "degraded");
|
||||
} else if (mddev->ro == 2) /* auto-readonly not meaningful */
|
||||
mddev->ro = 0;
|
||||
} else if (mddev->ro == MD_AUTO_READ)
|
||||
mddev->ro = MD_RDWR;
|
||||
|
||||
atomic_set(&mddev->max_corr_read_errors,
|
||||
MD_DEFAULT_MAX_CORRECTED_READ_ERRORS);
|
||||
@@ -6040,7 +6052,7 @@ int md_run(struct mddev *mddev)
|
||||
if (rdev->raid_disk >= 0)
|
||||
sysfs_link_rdev(mddev, rdev); /* failure here is OK */
|
||||
|
||||
if (mddev->degraded && !mddev->ro)
|
||||
if (mddev->degraded && md_is_rdwr(mddev))
|
||||
/* This ensures that recovering status is reported immediately
|
||||
* via sysfs - until a lack of spares is confirmed.
|
||||
*/
|
||||
@@ -6130,7 +6142,7 @@ static int restart_array(struct mddev *mddev)
|
||||
return -ENXIO;
|
||||
if (!mddev->pers)
|
||||
return -EINVAL;
|
||||
if (!mddev->ro)
|
||||
if (md_is_rdwr(mddev))
|
||||
return -EBUSY;
|
||||
|
||||
rcu_read_lock();
|
||||
@@ -6149,7 +6161,7 @@ static int restart_array(struct mddev *mddev)
|
||||
return -EROFS;
|
||||
|
||||
mddev->safemode = 0;
|
||||
mddev->ro = 0;
|
||||
mddev->ro = MD_RDWR;
|
||||
set_disk_ro(disk, 0);
|
||||
pr_debug("md: %s switched to read-write mode.\n", mdname(mddev));
|
||||
/* Kick recovery or resync if necessary */
|
||||
@@ -6176,7 +6188,7 @@ static void md_clean(struct mddev *mddev)
|
||||
mddev->clevel[0] = 0;
|
||||
mddev->flags = 0;
|
||||
mddev->sb_flags = 0;
|
||||
mddev->ro = 0;
|
||||
mddev->ro = MD_RDWR;
|
||||
mddev->metadata_type[0] = 0;
|
||||
mddev->chunk_sectors = 0;
|
||||
mddev->ctime = mddev->utime = 0;
|
||||
@@ -6227,7 +6239,7 @@ static void __md_stop_writes(struct mddev *mddev)
|
||||
}
|
||||
md_bitmap_flush(mddev);
|
||||
|
||||
if (mddev->ro == 0 &&
|
||||
if (md_is_rdwr(mddev) &&
|
||||
((!mddev->in_sync && !mddev_is_clustered(mddev)) ||
|
||||
mddev->sb_flags)) {
|
||||
/* mark array as shutdown cleanly */
|
||||
@@ -6299,6 +6311,9 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
|
||||
int err = 0;
|
||||
int did_freeze = 0;
|
||||
|
||||
if (mddev->external && test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags))
|
||||
return -EBUSY;
|
||||
|
||||
if (!test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) {
|
||||
did_freeze = 1;
|
||||
set_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
||||
@@ -6311,8 +6326,6 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
|
||||
* which will now never happen */
|
||||
wake_up_process(mddev->sync_thread->tsk);
|
||||
|
||||
if (mddev->external && test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags))
|
||||
return -EBUSY;
|
||||
mddev_unlock(mddev);
|
||||
wait_event(resync_wait, !test_bit(MD_RECOVERY_RUNNING,
|
||||
&mddev->recovery));
|
||||
@@ -6325,29 +6338,30 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
|
||||
mddev->sync_thread ||
|
||||
test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) {
|
||||
pr_warn("md: %s still in use.\n",mdname(mddev));
|
||||
if (did_freeze) {
|
||||
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
md_wakeup_thread(mddev->thread);
|
||||
}
|
||||
err = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (mddev->pers) {
|
||||
__md_stop_writes(mddev);
|
||||
|
||||
err = -ENXIO;
|
||||
if (mddev->ro==1)
|
||||
if (mddev->ro == MD_RDONLY) {
|
||||
err = -ENXIO;
|
||||
goto out;
|
||||
mddev->ro = 1;
|
||||
}
|
||||
|
||||
mddev->ro = MD_RDONLY;
|
||||
set_disk_ro(mddev->gendisk, 1);
|
||||
}
|
||||
|
||||
out:
|
||||
if ((mddev->pers && !err) || did_freeze) {
|
||||
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
md_wakeup_thread(mddev->thread);
|
||||
sysfs_notify_dirent_safe(mddev->sysfs_state);
|
||||
err = 0;
|
||||
}
|
||||
out:
|
||||
|
||||
mutex_unlock(&mddev->open_mutex);
|
||||
return err;
|
||||
}
|
||||
@@ -6396,7 +6410,7 @@ static int do_md_stop(struct mddev *mddev, int mode,
|
||||
return -EBUSY;
|
||||
}
|
||||
if (mddev->pers) {
|
||||
if (mddev->ro)
|
||||
if (!md_is_rdwr(mddev))
|
||||
set_disk_ro(disk, 0);
|
||||
|
||||
__md_stop_writes(mddev);
|
||||
@@ -6413,8 +6427,8 @@ static int do_md_stop(struct mddev *mddev, int mode,
|
||||
mutex_unlock(&mddev->open_mutex);
|
||||
mddev->changed = 1;
|
||||
|
||||
if (mddev->ro)
|
||||
mddev->ro = 0;
|
||||
if (!md_is_rdwr(mddev))
|
||||
mddev->ro = MD_RDWR;
|
||||
} else
|
||||
mutex_unlock(&mddev->open_mutex);
|
||||
/*
|
||||
@@ -7226,7 +7240,7 @@ static int update_size(struct mddev *mddev, sector_t num_sectors)
|
||||
if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) ||
|
||||
mddev->sync_thread)
|
||||
return -EBUSY;
|
||||
if (mddev->ro)
|
||||
if (!md_is_rdwr(mddev))
|
||||
return -EROFS;
|
||||
|
||||
rdev_for_each(rdev, mddev) {
|
||||
@@ -7256,7 +7270,7 @@ static int update_raid_disks(struct mddev *mddev, int raid_disks)
|
||||
/* change the number of raid disks */
|
||||
if (mddev->pers->check_reshape == NULL)
|
||||
return -EINVAL;
|
||||
if (mddev->ro)
|
||||
if (!md_is_rdwr(mddev))
|
||||
return -EROFS;
|
||||
if (raid_disks <= 0 ||
|
||||
(mddev->max_disks && raid_disks >= mddev->max_disks))
|
||||
@@ -7680,26 +7694,25 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
* The remaining ioctls are changing the state of the
|
||||
* superblock, so we do not allow them on read-only arrays.
|
||||
*/
|
||||
if (mddev->ro && mddev->pers) {
|
||||
if (mddev->ro == 2) {
|
||||
mddev->ro = 0;
|
||||
sysfs_notify_dirent_safe(mddev->sysfs_state);
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
/* mddev_unlock will wake thread */
|
||||
/* If a device failed while we were read-only, we
|
||||
* need to make sure the metadata is updated now.
|
||||
*/
|
||||
if (test_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags)) {
|
||||
mddev_unlock(mddev);
|
||||
wait_event(mddev->sb_wait,
|
||||
!test_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags) &&
|
||||
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags));
|
||||
mddev_lock_nointr(mddev);
|
||||
}
|
||||
} else {
|
||||
if (!md_is_rdwr(mddev) && mddev->pers) {
|
||||
if (mddev->ro != MD_AUTO_READ) {
|
||||
err = -EROFS;
|
||||
goto unlock;
|
||||
}
|
||||
mddev->ro = MD_RDWR;
|
||||
sysfs_notify_dirent_safe(mddev->sysfs_state);
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
/* mddev_unlock will wake thread */
|
||||
/* If a device failed while we were read-only, we
|
||||
* need to make sure the metadata is updated now.
|
||||
*/
|
||||
if (test_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags)) {
|
||||
mddev_unlock(mddev);
|
||||
wait_event(mddev->sb_wait,
|
||||
!test_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags) &&
|
||||
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags));
|
||||
mddev_lock_nointr(mddev);
|
||||
}
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
@@ -7785,11 +7798,11 @@ static int md_set_read_only(struct block_device *bdev, bool ro)
|
||||
* Transitioning to read-auto need only happen for arrays that call
|
||||
* md_write_start and which are not ready for writes yet.
|
||||
*/
|
||||
if (!ro && mddev->ro == 1 && mddev->pers) {
|
||||
if (!ro && mddev->ro == MD_RDONLY && mddev->pers) {
|
||||
err = restart_array(mddev);
|
||||
if (err)
|
||||
goto out_unlock;
|
||||
mddev->ro = 2;
|
||||
mddev->ro = MD_AUTO_READ;
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
@@ -8247,9 +8260,9 @@ static int md_seq_show(struct seq_file *seq, void *v)
|
||||
seq_printf(seq, "%s : %sactive", mdname(mddev),
|
||||
mddev->pers ? "" : "in");
|
||||
if (mddev->pers) {
|
||||
if (mddev->ro==1)
|
||||
if (mddev->ro == MD_RDONLY)
|
||||
seq_printf(seq, " (read-only)");
|
||||
if (mddev->ro==2)
|
||||
if (mddev->ro == MD_AUTO_READ)
|
||||
seq_printf(seq, " (auto-read-only)");
|
||||
seq_printf(seq, " %s", mddev->pers->name);
|
||||
}
|
||||
@@ -8509,10 +8522,10 @@ bool md_write_start(struct mddev *mddev, struct bio *bi)
|
||||
if (bio_data_dir(bi) != WRITE)
|
||||
return true;
|
||||
|
||||
BUG_ON(mddev->ro == 1);
|
||||
if (mddev->ro == 2) {
|
||||
BUG_ON(mddev->ro == MD_RDONLY);
|
||||
if (mddev->ro == MD_AUTO_READ) {
|
||||
/* need to switch to read/write */
|
||||
mddev->ro = 0;
|
||||
mddev->ro = MD_RDWR;
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
md_wakeup_thread(mddev->thread);
|
||||
md_wakeup_thread(mddev->sync_thread);
|
||||
@@ -8563,7 +8576,7 @@ void md_write_inc(struct mddev *mddev, struct bio *bi)
|
||||
{
|
||||
if (bio_data_dir(bi) != WRITE)
|
||||
return;
|
||||
WARN_ON_ONCE(mddev->in_sync || mddev->ro);
|
||||
WARN_ON_ONCE(mddev->in_sync || !md_is_rdwr(mddev));
|
||||
percpu_ref_get(&mddev->writes_pending);
|
||||
}
|
||||
EXPORT_SYMBOL(md_write_inc);
|
||||
@@ -8668,7 +8681,7 @@ void md_allow_write(struct mddev *mddev)
|
||||
{
|
||||
if (!mddev->pers)
|
||||
return;
|
||||
if (mddev->ro)
|
||||
if (!md_is_rdwr(mddev))
|
||||
return;
|
||||
if (!mddev->pers->sync_request)
|
||||
return;
|
||||
@@ -8717,7 +8730,7 @@ void md_do_sync(struct md_thread *thread)
|
||||
if (test_bit(MD_RECOVERY_DONE, &mddev->recovery) ||
|
||||
test_bit(MD_RECOVERY_WAIT, &mddev->recovery))
|
||||
return;
|
||||
if (mddev->ro) {/* never try to sync a read-only array */
|
||||
if (!md_is_rdwr(mddev)) {/* never try to sync a read-only array */
|
||||
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
|
||||
return;
|
||||
}
|
||||
@@ -9185,9 +9198,9 @@ static int remove_and_add_spares(struct mddev *mddev,
|
||||
if (test_bit(Faulty, &rdev->flags))
|
||||
continue;
|
||||
if (!test_bit(Journal, &rdev->flags)) {
|
||||
if (mddev->ro &&
|
||||
! (rdev->saved_raid_disk >= 0 &&
|
||||
!test_bit(Bitmap_sync, &rdev->flags)))
|
||||
if (!md_is_rdwr(mddev) &&
|
||||
!(rdev->saved_raid_disk >= 0 &&
|
||||
!test_bit(Bitmap_sync, &rdev->flags)))
|
||||
continue;
|
||||
|
||||
rdev->recovery_offset = 0;
|
||||
@@ -9285,7 +9298,8 @@ void md_check_recovery(struct mddev *mddev)
|
||||
flush_signals(current);
|
||||
}
|
||||
|
||||
if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
|
||||
if (!md_is_rdwr(mddev) &&
|
||||
!test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
|
||||
return;
|
||||
if ( ! (
|
||||
(mddev->sb_flags & ~ (1<<MD_SB_CHANGE_PENDING)) ||
|
||||
@@ -9304,7 +9318,7 @@ void md_check_recovery(struct mddev *mddev)
|
||||
if (!mddev->external && mddev->safemode == 1)
|
||||
mddev->safemode = 0;
|
||||
|
||||
if (mddev->ro) {
|
||||
if (!md_is_rdwr(mddev)) {
|
||||
struct md_rdev *rdev;
|
||||
if (!mddev->external && mddev->in_sync)
|
||||
/* 'Blocked' flag not needed as failed devices
|
||||
|
||||
@@ -1975,7 +1975,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb)
|
||||
|
||||
mei_hdr = mei_msg_hdr_init(cb);
|
||||
if (IS_ERR(mei_hdr)) {
|
||||
rets = -PTR_ERR(mei_hdr);
|
||||
rets = PTR_ERR(mei_hdr);
|
||||
mei_hdr = NULL;
|
||||
goto err;
|
||||
}
|
||||
@@ -1999,7 +1999,7 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb)
|
||||
|
||||
hbuf_slots = mei_hbuf_empty_slots(dev);
|
||||
if (hbuf_slots < 0) {
|
||||
rets = -EOVERFLOW;
|
||||
buf_len = -EOVERFLOW;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +186,8 @@ do { \
|
||||
#define ARC_IS_5MBIT 1 /* card default speed is 5MBit */
|
||||
#define ARC_CAN_10MBIT 2 /* card uses COM20022, supporting 10MBit,
|
||||
but default is 2.5MBit. */
|
||||
#define ARC_HAS_LED 4 /* card has software controlled LEDs */
|
||||
#define ARC_HAS_ROTARY 8 /* card has rotary encoder */
|
||||
|
||||
/* information needed to define an encapsulation driver */
|
||||
struct ArcProto {
|
||||
|
||||
@@ -213,12 +213,13 @@ static int com20020pci_probe(struct pci_dev *pdev,
|
||||
if (!strncmp(ci->name, "EAE PLX-PCI FB2", 15))
|
||||
lp->backplane = 1;
|
||||
|
||||
/* Get the dev_id from the PLX rotary coder */
|
||||
if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15))
|
||||
dev_id_mask = 0x3;
|
||||
dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask;
|
||||
|
||||
snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
|
||||
if (ci->flags & ARC_HAS_ROTARY) {
|
||||
/* Get the dev_id from the PLX rotary coder */
|
||||
if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15))
|
||||
dev_id_mask = 0x3;
|
||||
dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask;
|
||||
snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
|
||||
}
|
||||
|
||||
if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) {
|
||||
pr_err("IO address %Xh is empty!\n", ioaddr);
|
||||
@@ -230,6 +231,10 @@ static int com20020pci_probe(struct pci_dev *pdev,
|
||||
goto err_free_arcdev;
|
||||
}
|
||||
|
||||
ret = com20020_found(dev, IRQF_SHARED);
|
||||
if (ret)
|
||||
goto err_free_arcdev;
|
||||
|
||||
card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev),
|
||||
GFP_KERNEL);
|
||||
if (!card) {
|
||||
@@ -239,41 +244,39 @@ static int com20020pci_probe(struct pci_dev *pdev,
|
||||
|
||||
card->index = i;
|
||||
card->pci_priv = priv;
|
||||
card->tx_led.brightness_set = led_tx_set;
|
||||
card->tx_led.default_trigger = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "arc%d-%d-tx",
|
||||
dev->dev_id, i);
|
||||
card->tx_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
||||
"pci:green:tx:%d-%d",
|
||||
dev->dev_id, i);
|
||||
|
||||
card->tx_led.dev = &dev->dev;
|
||||
card->recon_led.brightness_set = led_recon_set;
|
||||
card->recon_led.default_trigger = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "arc%d-%d-recon",
|
||||
dev->dev_id, i);
|
||||
card->recon_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
||||
"pci:red:recon:%d-%d",
|
||||
dev->dev_id, i);
|
||||
card->recon_led.dev = &dev->dev;
|
||||
if (ci->flags & ARC_HAS_LED) {
|
||||
card->tx_led.brightness_set = led_tx_set;
|
||||
card->tx_led.default_trigger = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "arc%d-%d-tx",
|
||||
dev->dev_id, i);
|
||||
card->tx_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
||||
"pci:green:tx:%d-%d",
|
||||
dev->dev_id, i);
|
||||
|
||||
card->tx_led.dev = &dev->dev;
|
||||
card->recon_led.brightness_set = led_recon_set;
|
||||
card->recon_led.default_trigger = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "arc%d-%d-recon",
|
||||
dev->dev_id, i);
|
||||
card->recon_led.name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
|
||||
"pci:red:recon:%d-%d",
|
||||
dev->dev_id, i);
|
||||
card->recon_led.dev = &dev->dev;
|
||||
|
||||
ret = devm_led_classdev_register(&pdev->dev, &card->tx_led);
|
||||
if (ret)
|
||||
goto err_free_arcdev;
|
||||
|
||||
ret = devm_led_classdev_register(&pdev->dev, &card->recon_led);
|
||||
if (ret)
|
||||
goto err_free_arcdev;
|
||||
|
||||
dev_set_drvdata(&dev->dev, card);
|
||||
devm_arcnet_led_init(dev, dev->dev_id, i);
|
||||
}
|
||||
|
||||
card->dev = dev;
|
||||
|
||||
ret = devm_led_classdev_register(&pdev->dev, &card->tx_led);
|
||||
if (ret)
|
||||
goto err_free_arcdev;
|
||||
|
||||
ret = devm_led_classdev_register(&pdev->dev, &card->recon_led);
|
||||
if (ret)
|
||||
goto err_free_arcdev;
|
||||
|
||||
dev_set_drvdata(&dev->dev, card);
|
||||
|
||||
ret = com20020_found(dev, IRQF_SHARED);
|
||||
if (ret)
|
||||
goto err_free_arcdev;
|
||||
|
||||
devm_arcnet_led_init(dev, dev->dev_id, i);
|
||||
|
||||
list_add(&card->list, &priv->list_dev);
|
||||
continue;
|
||||
|
||||
@@ -329,7 +332,7 @@ static struct com20020_pci_card_info card_info_5mbit = {
|
||||
};
|
||||
|
||||
static struct com20020_pci_card_info card_info_sohard = {
|
||||
.name = "PLX-PCI",
|
||||
.name = "SOHARD SH ARC-PCI",
|
||||
.devcount = 1,
|
||||
/* SOHARD needs PCI base addr 4 */
|
||||
.chan_map_tbl = {
|
||||
@@ -364,7 +367,7 @@ static struct com20020_pci_card_info card_info_eae_arc1 = {
|
||||
},
|
||||
},
|
||||
.rotary = 0x0,
|
||||
.flags = ARC_CAN_10MBIT,
|
||||
.flags = ARC_HAS_ROTARY | ARC_HAS_LED | ARC_CAN_10MBIT,
|
||||
};
|
||||
|
||||
static struct com20020_pci_card_info card_info_eae_ma1 = {
|
||||
@@ -396,7 +399,7 @@ static struct com20020_pci_card_info card_info_eae_ma1 = {
|
||||
},
|
||||
},
|
||||
.rotary = 0x0,
|
||||
.flags = ARC_CAN_10MBIT,
|
||||
.flags = ARC_HAS_ROTARY | ARC_HAS_LED | ARC_CAN_10MBIT,
|
||||
};
|
||||
|
||||
static struct com20020_pci_card_info card_info_eae_fb2 = {
|
||||
@@ -421,7 +424,7 @@ static struct com20020_pci_card_info card_info_eae_fb2 = {
|
||||
},
|
||||
},
|
||||
.rotary = 0x0,
|
||||
.flags = ARC_CAN_10MBIT,
|
||||
.flags = ARC_HAS_ROTARY | ARC_HAS_LED | ARC_CAN_10MBIT,
|
||||
};
|
||||
|
||||
static const struct pci_device_id com20020pci_id_table[] = {
|
||||
|
||||
@@ -2075,6 +2075,7 @@ destroy_flow_table:
|
||||
rhashtable_destroy(&tc_info->flow_table);
|
||||
free_tc_info:
|
||||
kfree(tc_info);
|
||||
bp->tc_info = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -6854,7 +6854,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
|
||||
desc_idx, *post_ptr);
|
||||
drop_it_no_recycle:
|
||||
/* Other statistics kept track of by card. */
|
||||
tp->rx_dropped++;
|
||||
tnapi->rx_dropped++;
|
||||
goto next_pkt;
|
||||
}
|
||||
|
||||
@@ -7880,8 +7880,10 @@ static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
|
||||
|
||||
segs = skb_gso_segment(skb, tp->dev->features &
|
||||
~(NETIF_F_TSO | NETIF_F_TSO6));
|
||||
if (IS_ERR(segs) || !segs)
|
||||
if (IS_ERR(segs) || !segs) {
|
||||
tnapi->tx_dropped++;
|
||||
goto tg3_tso_bug_end;
|
||||
}
|
||||
|
||||
skb_list_walk_safe(segs, seg, next) {
|
||||
skb_mark_not_on_list(seg);
|
||||
@@ -8152,7 +8154,7 @@ dma_error:
|
||||
drop:
|
||||
dev_kfree_skb_any(skb);
|
||||
drop_nofree:
|
||||
tp->tx_dropped++;
|
||||
tnapi->tx_dropped++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
@@ -9331,7 +9333,7 @@ static void __tg3_set_rx_mode(struct net_device *);
|
||||
/* tp->lock is held. */
|
||||
static int tg3_halt(struct tg3 *tp, int kind, bool silent)
|
||||
{
|
||||
int err;
|
||||
int err, i;
|
||||
|
||||
tg3_stop_fw(tp);
|
||||
|
||||
@@ -9352,6 +9354,13 @@ static int tg3_halt(struct tg3 *tp, int kind, bool silent)
|
||||
|
||||
/* And make sure the next sample is new data */
|
||||
memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats));
|
||||
|
||||
for (i = 0; i < TG3_IRQ_MAX_VECS; ++i) {
|
||||
struct tg3_napi *tnapi = &tp->napi[i];
|
||||
|
||||
tnapi->rx_dropped = 0;
|
||||
tnapi->tx_dropped = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
@@ -11906,6 +11915,9 @@ static void tg3_get_nstats(struct tg3 *tp, struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct rtnl_link_stats64 *old_stats = &tp->net_stats_prev;
|
||||
struct tg3_hw_stats *hw_stats = tp->hw_stats;
|
||||
unsigned long rx_dropped;
|
||||
unsigned long tx_dropped;
|
||||
int i;
|
||||
|
||||
stats->rx_packets = old_stats->rx_packets +
|
||||
get_stat64(&hw_stats->rx_ucast_packets) +
|
||||
@@ -11952,8 +11964,26 @@ static void tg3_get_nstats(struct tg3 *tp, struct rtnl_link_stats64 *stats)
|
||||
stats->rx_missed_errors = old_stats->rx_missed_errors +
|
||||
get_stat64(&hw_stats->rx_discards);
|
||||
|
||||
stats->rx_dropped = tp->rx_dropped;
|
||||
stats->tx_dropped = tp->tx_dropped;
|
||||
/* Aggregate per-queue counters. The per-queue counters are updated
|
||||
* by a single writer, race-free. The result computed by this loop
|
||||
* might not be 100% accurate (counters can be updated in the middle of
|
||||
* the loop) but the next tg3_get_nstats() will recompute the current
|
||||
* value so it is acceptable.
|
||||
*
|
||||
* Note that these counters wrap around at 4G on 32bit machines.
|
||||
*/
|
||||
rx_dropped = (unsigned long)(old_stats->rx_dropped);
|
||||
tx_dropped = (unsigned long)(old_stats->tx_dropped);
|
||||
|
||||
for (i = 0; i < tp->irq_cnt; i++) {
|
||||
struct tg3_napi *tnapi = &tp->napi[i];
|
||||
|
||||
rx_dropped += tnapi->rx_dropped;
|
||||
tx_dropped += tnapi->tx_dropped;
|
||||
}
|
||||
|
||||
stats->rx_dropped = rx_dropped;
|
||||
stats->tx_dropped = tx_dropped;
|
||||
}
|
||||
|
||||
static int tg3_get_regs_len(struct net_device *dev)
|
||||
|
||||
@@ -3018,6 +3018,7 @@ struct tg3_napi {
|
||||
u16 *rx_rcb_prod_idx;
|
||||
struct tg3_rx_prodring_set prodring;
|
||||
struct tg3_rx_buffer_desc *rx_rcb;
|
||||
unsigned long rx_dropped;
|
||||
|
||||
u32 tx_prod ____cacheline_aligned;
|
||||
u32 tx_cons;
|
||||
@@ -3026,6 +3027,7 @@ struct tg3_napi {
|
||||
u32 prodmbox;
|
||||
struct tg3_tx_buffer_desc *tx_ring;
|
||||
struct tg3_tx_ring_info *tx_buffers;
|
||||
unsigned long tx_dropped;
|
||||
|
||||
dma_addr_t status_mapping;
|
||||
dma_addr_t rx_rcb_mapping;
|
||||
@@ -3219,8 +3221,6 @@ struct tg3 {
|
||||
|
||||
|
||||
/* begin "everything else" cacheline(s) section */
|
||||
unsigned long rx_dropped;
|
||||
unsigned long tx_dropped;
|
||||
struct rtnl_link_stats64 net_stats_prev;
|
||||
struct tg3_ethtool_stats estats_prev;
|
||||
|
||||
|
||||
@@ -66,6 +66,27 @@ static enum mac_mode hns_get_enet_interface(const struct hns_mac_cb *mac_cb)
|
||||
}
|
||||
}
|
||||
|
||||
static u32 hns_mac_link_anti_shake(struct mac_driver *mac_ctrl_drv)
|
||||
{
|
||||
#define HNS_MAC_LINK_WAIT_TIME 5
|
||||
#define HNS_MAC_LINK_WAIT_CNT 40
|
||||
|
||||
u32 link_status = 0;
|
||||
int i;
|
||||
|
||||
if (!mac_ctrl_drv->get_link_status)
|
||||
return link_status;
|
||||
|
||||
for (i = 0; i < HNS_MAC_LINK_WAIT_CNT; i++) {
|
||||
msleep(HNS_MAC_LINK_WAIT_TIME);
|
||||
mac_ctrl_drv->get_link_status(mac_ctrl_drv, &link_status);
|
||||
if (!link_status)
|
||||
break;
|
||||
}
|
||||
|
||||
return link_status;
|
||||
}
|
||||
|
||||
void hns_mac_get_link_status(struct hns_mac_cb *mac_cb, u32 *link_status)
|
||||
{
|
||||
struct mac_driver *mac_ctrl_drv;
|
||||
@@ -83,6 +104,14 @@ void hns_mac_get_link_status(struct hns_mac_cb *mac_cb, u32 *link_status)
|
||||
&sfp_prsnt);
|
||||
if (!ret)
|
||||
*link_status = *link_status && sfp_prsnt;
|
||||
|
||||
/* for FIBER port, it may have a fake link up.
|
||||
* when the link status changes from down to up, we need to do
|
||||
* anti-shake. the anti-shake time is base on tests.
|
||||
* only FIBER port need to do this.
|
||||
*/
|
||||
if (*link_status && !mac_cb->link)
|
||||
*link_status = hns_mac_link_anti_shake(mac_ctrl_drv);
|
||||
}
|
||||
|
||||
mac_cb->link = *link_status;
|
||||
|
||||
@@ -16132,7 +16132,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
I40E_PRTGL_SAH_MFS_MASK) >> I40E_PRTGL_SAH_MFS_SHIFT;
|
||||
if (val < MAX_FRAME_SIZE_DEFAULT)
|
||||
dev_warn(&pdev->dev, "MFS for port %x has been set below the default: %x\n",
|
||||
i, val);
|
||||
pf->hw.port, val);
|
||||
|
||||
/* Add a filter to drop all Flow control frames from any VSI from being
|
||||
* transmitted. By doing so we stop a malicious VF from sending out
|
||||
|
||||
@@ -1284,7 +1284,7 @@ static int rvu_npa_register_reporters(struct rvu_devlink *rvu_dl)
|
||||
|
||||
rvu_dl->devlink_wq = create_workqueue("rvu_devlink_wq");
|
||||
if (!rvu_dl->devlink_wq)
|
||||
goto err;
|
||||
return -ENOMEM;
|
||||
|
||||
INIT_WORK(&rvu_reporters->intr_work, rvu_npa_intr_work);
|
||||
INIT_WORK(&rvu_reporters->err_work, rvu_npa_err_work);
|
||||
@@ -1292,9 +1292,6 @@ static int rvu_npa_register_reporters(struct rvu_devlink *rvu_dl)
|
||||
INIT_WORK(&rvu_reporters->ras_work, rvu_npa_ras_work);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
rvu_npa_health_reporters_destroy(rvu_dl);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static int rvu_npa_health_reporters_create(struct rvu_devlink *rvu_dl)
|
||||
|
||||
@@ -388,7 +388,13 @@ static u64 npc_get_default_entry_action(struct rvu *rvu, struct npc_mcam *mcam,
|
||||
int bank, nixlf, index;
|
||||
|
||||
/* get ucast entry rule entry index */
|
||||
nix_get_nixlf(rvu, pf_func, &nixlf, NULL);
|
||||
if (nix_get_nixlf(rvu, pf_func, &nixlf, NULL)) {
|
||||
dev_err(rvu->dev, "%s: nixlf not attached to pcifunc:0x%x\n",
|
||||
__func__, pf_func);
|
||||
/* Action 0 is drop */
|
||||
return 0;
|
||||
}
|
||||
|
||||
index = npc_get_nixlf_mcam_index(mcam, pf_func, nixlf,
|
||||
NIXLF_UCAST_ENTRY);
|
||||
bank = npc_get_bank(mcam, index);
|
||||
|
||||
@@ -31,8 +31,8 @@ static struct hw_reg_map txsch_reg_map[NIX_TXSCH_LVL_CNT] = {
|
||||
{NIX_TXSCH_LVL_TL4, 3, 0xFFFF, {{0x0B00, 0x0B08}, {0x0B10, 0x0B18},
|
||||
{0x1200, 0x12E0} } },
|
||||
{NIX_TXSCH_LVL_TL3, 4, 0xFFFF, {{0x1000, 0x10E0}, {0x1600, 0x1608},
|
||||
{0x1610, 0x1618}, {0x1700, 0x17B0} } },
|
||||
{NIX_TXSCH_LVL_TL2, 2, 0xFFFF, {{0x0E00, 0x0EE0}, {0x1700, 0x17B0} } },
|
||||
{0x1610, 0x1618}, {0x1700, 0x17C8} } },
|
||||
{NIX_TXSCH_LVL_TL2, 2, 0xFFFF, {{0x0E00, 0x0EE0}, {0x1700, 0x17C8} } },
|
||||
{NIX_TXSCH_LVL_TL1, 1, 0xFFFF, {{0x0C00, 0x0D98} } },
|
||||
};
|
||||
|
||||
|
||||
@@ -316,9 +316,12 @@ static void otx2_get_pauseparam(struct net_device *netdev,
|
||||
if (is_otx2_lbkvf(pfvf->pdev))
|
||||
return;
|
||||
|
||||
mutex_lock(&pfvf->mbox.lock);
|
||||
req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
|
||||
if (!req)
|
||||
if (!req) {
|
||||
mutex_unlock(&pfvf->mbox.lock);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
|
||||
rsp = (struct cgx_pause_frm_cfg *)
|
||||
@@ -326,6 +329,7 @@ static void otx2_get_pauseparam(struct net_device *netdev,
|
||||
pause->rx_pause = rsp->rx_pause;
|
||||
pause->tx_pause = rsp->tx_pause;
|
||||
}
|
||||
mutex_unlock(&pfvf->mbox.lock);
|
||||
}
|
||||
|
||||
static int otx2_set_pauseparam(struct net_device *netdev,
|
||||
|
||||
@@ -208,7 +208,7 @@ struct ionic_desc_info {
|
||||
void *cb_arg;
|
||||
};
|
||||
|
||||
#define IONIC_QUEUE_NAME_MAX_SZ 32
|
||||
#define IONIC_QUEUE_NAME_MAX_SZ 16
|
||||
|
||||
struct ionic_queue {
|
||||
struct device *dev;
|
||||
|
||||
@@ -44,24 +44,24 @@ static void ionic_lif_queue_identify(struct ionic_lif *lif);
|
||||
static void ionic_dim_work(struct work_struct *work)
|
||||
{
|
||||
struct dim *dim = container_of(work, struct dim, work);
|
||||
struct ionic_intr_info *intr;
|
||||
struct dim_cq_moder cur_moder;
|
||||
struct ionic_qcq *qcq;
|
||||
struct ionic_lif *lif;
|
||||
u32 new_coal;
|
||||
|
||||
cur_moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix);
|
||||
qcq = container_of(dim, struct ionic_qcq, dim);
|
||||
new_coal = ionic_coal_usec_to_hw(qcq->q.lif->ionic, cur_moder.usec);
|
||||
lif = qcq->q.lif;
|
||||
new_coal = ionic_coal_usec_to_hw(lif->ionic, cur_moder.usec);
|
||||
new_coal = new_coal ? new_coal : 1;
|
||||
|
||||
if (qcq->intr.dim_coal_hw != new_coal) {
|
||||
unsigned int qi = qcq->cq.bound_q->index;
|
||||
struct ionic_lif *lif = qcq->q.lif;
|
||||
|
||||
qcq->intr.dim_coal_hw = new_coal;
|
||||
intr = &qcq->intr;
|
||||
if (intr->dim_coal_hw != new_coal) {
|
||||
intr->dim_coal_hw = new_coal;
|
||||
|
||||
ionic_intr_coal_init(lif->ionic->idev.intr_ctrl,
|
||||
lif->rxqcqs[qi]->intr.index,
|
||||
qcq->intr.dim_coal_hw);
|
||||
intr->index, intr->dim_coal_hw);
|
||||
}
|
||||
|
||||
dim->state = DIM_START_MEASURE;
|
||||
|
||||
@@ -205,6 +205,7 @@ enum rtl_registers {
|
||||
/* No threshold before first PCI xfer */
|
||||
#define RX_FIFO_THRESH (7 << RXCFG_FIFO_SHIFT)
|
||||
#define RX_EARLY_OFF (1 << 11)
|
||||
#define RX_PAUSE_SLOT_ON (1 << 11) /* 8125b and later */
|
||||
#define RXCFG_DMA_SHIFT 8
|
||||
/* Unlimited maximum PCI burst. */
|
||||
#define RX_DMA_BURST (7 << RXCFG_DMA_SHIFT)
|
||||
@@ -2268,9 +2269,13 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
|
||||
case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_53:
|
||||
RTL_W32(tp, RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF);
|
||||
break;
|
||||
case RTL_GIGA_MAC_VER_60 ... RTL_GIGA_MAC_VER_63:
|
||||
case RTL_GIGA_MAC_VER_61:
|
||||
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
|
||||
break;
|
||||
case RTL_GIGA_MAC_VER_63:
|
||||
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
|
||||
RX_PAUSE_SLOT_ON);
|
||||
break;
|
||||
default:
|
||||
RTL_W32(tp, RxConfig, RX128_INT_EN | RX_DMA_BURST);
|
||||
break;
|
||||
|
||||
@@ -710,28 +710,22 @@ void dwmac5_est_irq_status(void __iomem *ioaddr, struct net_device *dev,
|
||||
}
|
||||
}
|
||||
|
||||
void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq,
|
||||
void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg,
|
||||
u32 num_txq, u32 num_rxq,
|
||||
bool enable)
|
||||
{
|
||||
u32 value;
|
||||
|
||||
if (!enable) {
|
||||
value = readl(ioaddr + MAC_FPE_CTRL_STS);
|
||||
|
||||
value &= ~EFPE;
|
||||
|
||||
writel(value, ioaddr + MAC_FPE_CTRL_STS);
|
||||
return;
|
||||
if (enable) {
|
||||
cfg->fpe_csr = EFPE;
|
||||
value = readl(ioaddr + GMAC_RXQ_CTRL1);
|
||||
value &= ~GMAC_RXQCTRL_FPRQ;
|
||||
value |= (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT;
|
||||
writel(value, ioaddr + GMAC_RXQ_CTRL1);
|
||||
} else {
|
||||
cfg->fpe_csr = 0;
|
||||
}
|
||||
|
||||
value = readl(ioaddr + GMAC_RXQ_CTRL1);
|
||||
value &= ~GMAC_RXQCTRL_FPRQ;
|
||||
value |= (num_rxq - 1) << GMAC_RXQCTRL_FPRQ_SHIFT;
|
||||
writel(value, ioaddr + GMAC_RXQ_CTRL1);
|
||||
|
||||
value = readl(ioaddr + MAC_FPE_CTRL_STS);
|
||||
value |= EFPE;
|
||||
writel(value, ioaddr + MAC_FPE_CTRL_STS);
|
||||
writel(cfg->fpe_csr, ioaddr + MAC_FPE_CTRL_STS);
|
||||
}
|
||||
|
||||
int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev)
|
||||
@@ -741,6 +735,9 @@ int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev)
|
||||
|
||||
status = FPE_EVENT_UNKNOWN;
|
||||
|
||||
/* Reads from the MAC_FPE_CTRL_STS register should only be performed
|
||||
* here, since the status flags of MAC_FPE_CTRL_STS are "clear on read"
|
||||
*/
|
||||
value = readl(ioaddr + MAC_FPE_CTRL_STS);
|
||||
|
||||
if (value & TRSP) {
|
||||
@@ -766,19 +763,15 @@ int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev)
|
||||
return status;
|
||||
}
|
||||
|
||||
void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, enum stmmac_mpacket_type type)
|
||||
void dwmac5_fpe_send_mpacket(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg,
|
||||
enum stmmac_mpacket_type type)
|
||||
{
|
||||
u32 value;
|
||||
u32 value = cfg->fpe_csr;
|
||||
|
||||
value = readl(ioaddr + MAC_FPE_CTRL_STS);
|
||||
|
||||
if (type == MPACKET_VERIFY) {
|
||||
value &= ~SRSP;
|
||||
if (type == MPACKET_VERIFY)
|
||||
value |= SVER;
|
||||
} else {
|
||||
value &= ~SVER;
|
||||
else if (type == MPACKET_RESPONSE)
|
||||
value |= SRSP;
|
||||
}
|
||||
|
||||
writel(value, ioaddr + MAC_FPE_CTRL_STS);
|
||||
}
|
||||
|
||||
@@ -153,9 +153,11 @@ int dwmac5_est_configure(void __iomem *ioaddr, struct stmmac_est *cfg,
|
||||
unsigned int ptp_rate);
|
||||
void dwmac5_est_irq_status(void __iomem *ioaddr, struct net_device *dev,
|
||||
struct stmmac_extra_stats *x, u32 txqcnt);
|
||||
void dwmac5_fpe_configure(void __iomem *ioaddr, u32 num_txq, u32 num_rxq,
|
||||
void dwmac5_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg,
|
||||
u32 num_txq, u32 num_rxq,
|
||||
bool enable);
|
||||
void dwmac5_fpe_send_mpacket(void __iomem *ioaddr,
|
||||
struct stmmac_fpe_cfg *cfg,
|
||||
enum stmmac_mpacket_type type);
|
||||
int dwmac5_fpe_irq_status(void __iomem *ioaddr, struct net_device *dev);
|
||||
|
||||
|
||||
@@ -1440,7 +1440,8 @@ static int dwxgmac3_est_configure(void __iomem *ioaddr, struct stmmac_est *cfg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dwxgmac3_fpe_configure(void __iomem *ioaddr, u32 num_txq,
|
||||
static void dwxgmac3_fpe_configure(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg,
|
||||
u32 num_txq,
|
||||
u32 num_rxq, bool enable)
|
||||
{
|
||||
u32 value;
|
||||
|
||||
@@ -395,9 +395,11 @@ struct stmmac_ops {
|
||||
unsigned int ptp_rate);
|
||||
void (*est_irq_status)(void __iomem *ioaddr, struct net_device *dev,
|
||||
struct stmmac_extra_stats *x, u32 txqcnt);
|
||||
void (*fpe_configure)(void __iomem *ioaddr, u32 num_txq, u32 num_rxq,
|
||||
void (*fpe_configure)(void __iomem *ioaddr, struct stmmac_fpe_cfg *cfg,
|
||||
u32 num_txq, u32 num_rxq,
|
||||
bool enable);
|
||||
void (*fpe_send_mpacket)(void __iomem *ioaddr,
|
||||
struct stmmac_fpe_cfg *cfg,
|
||||
enum stmmac_mpacket_type type);
|
||||
int (*fpe_irq_status)(void __iomem *ioaddr, struct net_device *dev);
|
||||
};
|
||||
|
||||
@@ -1054,7 +1054,8 @@ static void stmmac_fpe_link_state_handle(struct stmmac_priv *priv, bool is_up)
|
||||
bool *hs_enable = &fpe_cfg->hs_enable;
|
||||
|
||||
if (is_up && *hs_enable) {
|
||||
stmmac_fpe_send_mpacket(priv, priv->ioaddr, MPACKET_VERIFY);
|
||||
stmmac_fpe_send_mpacket(priv, priv->ioaddr, fpe_cfg,
|
||||
MPACKET_VERIFY);
|
||||
} else {
|
||||
*lo_state = FPE_STATE_OFF;
|
||||
*lp_state = FPE_STATE_OFF;
|
||||
@@ -5621,6 +5622,7 @@ static void stmmac_fpe_event_status(struct stmmac_priv *priv, int status)
|
||||
/* If user has requested FPE enable, quickly response */
|
||||
if (*hs_enable)
|
||||
stmmac_fpe_send_mpacket(priv, priv->ioaddr,
|
||||
fpe_cfg,
|
||||
MPACKET_RESPONSE);
|
||||
}
|
||||
|
||||
@@ -6958,6 +6960,7 @@ static void stmmac_fpe_lp_task(struct work_struct *work)
|
||||
if (*lo_state == FPE_STATE_ENTERING_ON &&
|
||||
*lp_state == FPE_STATE_ENTERING_ON) {
|
||||
stmmac_fpe_configure(priv, priv->ioaddr,
|
||||
fpe_cfg,
|
||||
priv->plat->tx_queues_to_use,
|
||||
priv->plat->rx_queues_to_use,
|
||||
*enable);
|
||||
@@ -6976,6 +6979,7 @@ static void stmmac_fpe_lp_task(struct work_struct *work)
|
||||
netdev_info(priv->dev, SEND_VERIFY_MPAKCET_FMT,
|
||||
*lo_state, *lp_state);
|
||||
stmmac_fpe_send_mpacket(priv, priv->ioaddr,
|
||||
fpe_cfg,
|
||||
MPACKET_VERIFY);
|
||||
}
|
||||
/* Sleep then retry */
|
||||
@@ -6990,6 +6994,7 @@ void stmmac_fpe_handshake(struct stmmac_priv *priv, bool enable)
|
||||
if (priv->plat->fpe_cfg->hs_enable != enable) {
|
||||
if (enable) {
|
||||
stmmac_fpe_send_mpacket(priv, priv->ioaddr,
|
||||
priv->plat->fpe_cfg,
|
||||
MPACKET_VERIFY);
|
||||
} else {
|
||||
priv->plat->fpe_cfg->lo_fpe_state = FPE_STATE_OFF;
|
||||
@@ -7399,6 +7404,7 @@ int stmmac_suspend(struct device *dev)
|
||||
if (priv->dma_cap.fpesel) {
|
||||
/* Disable FPE */
|
||||
stmmac_fpe_configure(priv, priv->ioaddr,
|
||||
priv->plat->fpe_cfg,
|
||||
priv->plat->tx_queues_to_use,
|
||||
priv->plat->rx_queues_to_use, false);
|
||||
|
||||
|
||||
@@ -952,6 +952,7 @@ disable:
|
||||
|
||||
priv->plat->fpe_cfg->enable = false;
|
||||
stmmac_fpe_configure(priv, priv->ioaddr,
|
||||
priv->plat->fpe_cfg,
|
||||
priv->plat->tx_queues_to_use,
|
||||
priv->plat->rx_queues_to_use,
|
||||
false);
|
||||
|
||||
@@ -3,5 +3,6 @@ config HYPERV_NET
|
||||
tristate "Microsoft Hyper-V virtual network driver"
|
||||
depends on HYPERV
|
||||
select UCS2_STRING
|
||||
select NLS
|
||||
help
|
||||
Select this option to enable the Hyper-V virtual network driver.
|
||||
|
||||
@@ -763,7 +763,7 @@ enum rtl_register_content {
|
||||
|
||||
/* rtl8152 flags */
|
||||
enum rtl8152_flags {
|
||||
RTL8152_UNPLUG = 0,
|
||||
RTL8152_INACCESSIBLE = 0,
|
||||
RTL8152_SET_RX_MODE,
|
||||
WORK_ENABLE,
|
||||
RTL8152_LINK_CHG,
|
||||
@@ -1241,7 +1241,7 @@ int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
|
||||
static void rtl_set_unplug(struct r8152 *tp)
|
||||
{
|
||||
if (tp->udev->state == USB_STATE_NOTATTACHED) {
|
||||
set_bit(RTL8152_UNPLUG, &tp->flags);
|
||||
set_bit(RTL8152_INACCESSIBLE, &tp->flags);
|
||||
smp_mb__after_atomic();
|
||||
}
|
||||
}
|
||||
@@ -1252,7 +1252,7 @@ static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
|
||||
u16 limit = 64;
|
||||
int ret = 0;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
/* both size and indix must be 4 bytes align */
|
||||
@@ -1296,7 +1296,7 @@ static int generic_ocp_write(struct r8152 *tp, u16 index, u16 byteen,
|
||||
u16 byteen_start, byteen_end, byen;
|
||||
u16 limit = 512;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
/* both size and indix must be 4 bytes align */
|
||||
@@ -1526,7 +1526,7 @@ static int read_mii_word(struct net_device *netdev, int phy_id, int reg)
|
||||
struct r8152 *tp = netdev_priv(netdev);
|
||||
int ret;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
if (phy_id != R8152_PHY_ID)
|
||||
@@ -1542,7 +1542,7 @@ void write_mii_word(struct net_device *netdev, int phy_id, int reg, int val)
|
||||
{
|
||||
struct r8152 *tp = netdev_priv(netdev);
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (phy_id != R8152_PHY_ID)
|
||||
@@ -1747,7 +1747,7 @@ static void read_bulk_callback(struct urb *urb)
|
||||
if (!tp)
|
||||
return;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
||||
@@ -1839,7 +1839,7 @@ static void write_bulk_callback(struct urb *urb)
|
||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (!skb_queue_empty(&tp->tx_queue))
|
||||
@@ -1860,7 +1860,7 @@ static void intr_callback(struct urb *urb)
|
||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
switch (status) {
|
||||
@@ -2604,7 +2604,7 @@ static void bottom_half(struct tasklet_struct *t)
|
||||
{
|
||||
struct r8152 *tp = from_tasklet(tp, t, tx_tl);
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (!test_bit(WORK_ENABLE, &tp->flags))
|
||||
@@ -2647,7 +2647,7 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
|
||||
int ret;
|
||||
|
||||
/* The rx would be stopped, so skip submitting */
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags) ||
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) ||
|
||||
!test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev))
|
||||
return 0;
|
||||
|
||||
@@ -2850,6 +2850,8 @@ static void rtl8152_nic_reset(struct r8152 *tp)
|
||||
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, CR_RST);
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
if (!(ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR) & CR_RST))
|
||||
break;
|
||||
usleep_range(100, 400);
|
||||
@@ -3043,7 +3045,7 @@ static int rtl_enable(struct r8152 *tp)
|
||||
|
||||
static int rtl8152_enable(struct r8152 *tp)
|
||||
{
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
set_tx_qlen(tp);
|
||||
@@ -3130,7 +3132,7 @@ static int rtl8153_enable(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
set_tx_qlen(tp);
|
||||
@@ -3162,7 +3164,7 @@ static void rtl_disable(struct r8152 *tp)
|
||||
u32 ocp_data;
|
||||
int i;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
||||
rtl_drop_queued_tx(tp);
|
||||
return;
|
||||
}
|
||||
@@ -3179,6 +3181,8 @@ static void rtl_disable(struct r8152 *tp)
|
||||
rxdy_gated_en(tp, true);
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
|
||||
if ((ocp_data & FIFO_EMPTY) == FIFO_EMPTY)
|
||||
break;
|
||||
@@ -3186,6 +3190,8 @@ static void rtl_disable(struct r8152 *tp)
|
||||
}
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0) & TCR0_TX_EMPTY)
|
||||
break;
|
||||
usleep_range(1000, 2000);
|
||||
@@ -3616,7 +3622,7 @@ static u16 r8153_phy_status(struct r8152 *tp, u16 desired)
|
||||
}
|
||||
|
||||
msleep(20);
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3648,7 +3654,7 @@ static void r8153b_ups_en(struct r8152 *tp, bool enable)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 500; i++) {
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
|
||||
AUTOLOAD_DONE)
|
||||
@@ -3690,7 +3696,7 @@ static void r8153c_ups_en(struct r8152 *tp, bool enable)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 500; i++) {
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
|
||||
AUTOLOAD_DONE)
|
||||
@@ -4055,8 +4061,8 @@ static int rtl_phy_patch_request(struct r8152 *tp, bool request, bool wait)
|
||||
for (i = 0; wait && i < 5000; i++) {
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
break;
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
usleep_range(1000, 2000);
|
||||
ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT);
|
||||
@@ -5374,6 +5380,8 @@ static void wait_oob_link_list_ready(struct r8152 *tp)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
|
||||
if (ocp_data & LINK_LIST_READY)
|
||||
break;
|
||||
@@ -5388,6 +5396,8 @@ static void r8156b_wait_loading_flash(struct r8152 *tp)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 100; i++) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
if (ocp_read_word(tp, MCU_TYPE_USB, USB_GPHY_CTRL) & GPHY_PATCH_DONE)
|
||||
break;
|
||||
usleep_range(1000, 2000);
|
||||
@@ -5510,6 +5520,8 @@ static int r8153_pre_firmware_1(struct r8152 *tp)
|
||||
for (i = 0; i < 104; i++) {
|
||||
u32 ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_WDT1_CTRL);
|
||||
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
if (!(ocp_data & WTD1_EN))
|
||||
break;
|
||||
usleep_range(1000, 2000);
|
||||
@@ -5666,6 +5678,8 @@ static void r8153_aldps_en(struct r8152 *tp, bool enable)
|
||||
data &= ~EN_ALDPS;
|
||||
ocp_reg_write(tp, OCP_POWER_CFG, data);
|
||||
for (i = 0; i < 20; i++) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
usleep_range(1000, 2000);
|
||||
if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100)
|
||||
break;
|
||||
@@ -6019,7 +6033,7 @@ static int rtl8156_enable(struct r8152 *tp)
|
||||
u32 ocp_data;
|
||||
u16 speed;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
r8156_fc_parameter(tp);
|
||||
@@ -6077,7 +6091,7 @@ static int rtl8156b_enable(struct r8152 *tp)
|
||||
u32 ocp_data;
|
||||
u16 speed;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
set_tx_qlen(tp);
|
||||
@@ -6263,7 +6277,7 @@ out:
|
||||
|
||||
static void rtl8152_up(struct r8152 *tp)
|
||||
{
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8152_aldps_en(tp, false);
|
||||
@@ -6273,7 +6287,7 @@ static void rtl8152_up(struct r8152 *tp)
|
||||
|
||||
static void rtl8152_down(struct r8152 *tp)
|
||||
{
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
||||
rtl_drop_queued_tx(tp);
|
||||
return;
|
||||
}
|
||||
@@ -6288,7 +6302,7 @@ static void rtl8153_up(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153_u1u2en(tp, false);
|
||||
@@ -6328,7 +6342,7 @@ static void rtl8153_down(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
||||
rtl_drop_queued_tx(tp);
|
||||
return;
|
||||
}
|
||||
@@ -6349,7 +6363,7 @@ static void rtl8153b_up(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153b_u1u2en(tp, false);
|
||||
@@ -6373,7 +6387,7 @@ static void rtl8153b_down(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
||||
rtl_drop_queued_tx(tp);
|
||||
return;
|
||||
}
|
||||
@@ -6410,7 +6424,7 @@ static void rtl8153c_up(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153b_u1u2en(tp, false);
|
||||
@@ -6491,7 +6505,7 @@ static void rtl8156_up(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153b_u1u2en(tp, false);
|
||||
@@ -6564,7 +6578,7 @@ static void rtl8156_down(struct r8152 *tp)
|
||||
{
|
||||
u32 ocp_data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
||||
rtl_drop_queued_tx(tp);
|
||||
return;
|
||||
}
|
||||
@@ -6702,7 +6716,7 @@ static void rtl_work_func_t(struct work_struct *work)
|
||||
/* If the device is unplugged or !netif_running(), the workqueue
|
||||
* doesn't need to wake the device, and could return directly.
|
||||
*/
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev))
|
||||
return;
|
||||
|
||||
if (usb_autopm_get_interface(tp->intf) < 0)
|
||||
@@ -6741,7 +6755,7 @@ static void rtl_hw_phy_work_func_t(struct work_struct *work)
|
||||
{
|
||||
struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work);
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (usb_autopm_get_interface(tp->intf) < 0)
|
||||
@@ -6868,7 +6882,7 @@ static int rtl8152_close(struct net_device *netdev)
|
||||
netif_stop_queue(netdev);
|
||||
|
||||
res = usb_autopm_get_interface(tp->intf);
|
||||
if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) {
|
||||
if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) {
|
||||
rtl_drop_queued_tx(tp);
|
||||
rtl_stop_rx(tp);
|
||||
} else {
|
||||
@@ -6901,7 +6915,7 @@ static void r8152b_init(struct r8152 *tp)
|
||||
u32 ocp_data;
|
||||
u16 data;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
data = r8152_mdio_read(tp, MII_BMCR);
|
||||
@@ -6945,7 +6959,7 @@ static void r8153_init(struct r8152 *tp)
|
||||
u16 data;
|
||||
int i;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153_u1u2en(tp, false);
|
||||
@@ -6956,7 +6970,7 @@ static void r8153_init(struct r8152 *tp)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7085,7 +7099,7 @@ static void r8153b_init(struct r8152 *tp)
|
||||
u16 data;
|
||||
int i;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153b_u1u2en(tp, false);
|
||||
@@ -7096,7 +7110,7 @@ static void r8153b_init(struct r8152 *tp)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7167,7 +7181,7 @@ static void r8153c_init(struct r8152 *tp)
|
||||
u16 data;
|
||||
int i;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153b_u1u2en(tp, false);
|
||||
@@ -7187,7 +7201,7 @@ static void r8153c_init(struct r8152 *tp)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8016,7 +8030,7 @@ static void r8156_init(struct r8152 *tp)
|
||||
u16 data;
|
||||
int i;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP);
|
||||
@@ -8037,7 +8051,7 @@ static void r8156_init(struct r8152 *tp)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8112,7 +8126,7 @@ static void r8156b_init(struct r8152 *tp)
|
||||
u16 data;
|
||||
int i;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP);
|
||||
@@ -8146,7 +8160,7 @@ static void r8156b_init(struct r8152 *tp)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9208,7 +9222,7 @@ static int rtl8152_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
|
||||
struct mii_ioctl_data *data = if_mii(rq);
|
||||
int res;
|
||||
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return -ENODEV;
|
||||
|
||||
res = usb_autopm_get_interface(tp->intf);
|
||||
@@ -9310,7 +9324,7 @@ static const struct net_device_ops rtl8152_netdev_ops = {
|
||||
|
||||
static void rtl8152_unload(struct r8152 *tp)
|
||||
{
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
if (tp->version != RTL_VER_01)
|
||||
@@ -9319,7 +9333,7 @@ static void rtl8152_unload(struct r8152 *tp)
|
||||
|
||||
static void rtl8153_unload(struct r8152 *tp)
|
||||
{
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153_power_cut_en(tp, false);
|
||||
@@ -9327,7 +9341,7 @@ static void rtl8153_unload(struct r8152 *tp)
|
||||
|
||||
static void rtl8153b_unload(struct r8152 *tp)
|
||||
{
|
||||
if (test_bit(RTL8152_UNPLUG, &tp->flags))
|
||||
if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
|
||||
return;
|
||||
|
||||
r8153b_power_cut_en(tp, false);
|
||||
|
||||
@@ -154,6 +154,11 @@ enum nvme_quirks {
|
||||
* No temperature thresholds for channels other than 0 (Composite).
|
||||
*/
|
||||
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19),
|
||||
|
||||
/*
|
||||
* Disables simple suspend/resume path.
|
||||
*/
|
||||
NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND = (1 << 20),
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -2953,6 +2953,18 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
|
||||
if ((dmi_match(DMI_BOARD_VENDOR, "LENOVO")) &&
|
||||
dmi_match(DMI_BOARD_NAME, "LNVNB161216"))
|
||||
return NVME_QUIRK_SIMPLE_SUSPEND;
|
||||
} else if (pdev->vendor == 0x2646 && (pdev->device == 0x2263 ||
|
||||
pdev->device == 0x500f)) {
|
||||
/*
|
||||
* Exclude some Kingston NV1 and A2000 devices from
|
||||
* NVME_QUIRK_SIMPLE_SUSPEND. Do a full suspend to save a
|
||||
* lot fo energy with s2idle sleep on some TUXEDO platforms.
|
||||
*/
|
||||
if (dmi_match(DMI_BOARD_NAME, "NS5X_NS7XAU") ||
|
||||
dmi_match(DMI_BOARD_NAME, "NS5x_7xAU") ||
|
||||
dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") ||
|
||||
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"))
|
||||
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2993,7 +3005,9 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
|
||||
dev->dev = get_device(&pdev->dev);
|
||||
|
||||
quirks |= check_vendor_combination_bug(pdev);
|
||||
if (!noacpi && acpi_storage_d3(&pdev->dev)) {
|
||||
if (!noacpi &&
|
||||
!(quirks & NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND) &&
|
||||
acpi_storage_d3(&pdev->dev)) {
|
||||
/*
|
||||
* Some systems use a bios work around to ask for D3 on
|
||||
* platforms that support kernel managed suspend.
|
||||
|
||||
@@ -104,8 +104,9 @@ int of_reconfig_notify(unsigned long action, struct of_reconfig_data *p)
|
||||
*
|
||||
* Returns the new state of a device based on the notifier used.
|
||||
*
|
||||
* Return: 0 on device going from enabled to disabled, 1 on device
|
||||
* going from disabled to enabled and -1 on no change.
|
||||
* Return: OF_RECONFIG_CHANGE_REMOVE on device going from enabled to
|
||||
* disabled, OF_RECONFIG_CHANGE_ADD on device going from disabled to
|
||||
* enabled and OF_RECONFIG_NO_CHANGE on no change.
|
||||
*/
|
||||
int of_reconfig_get_state_change(unsigned long action, struct of_reconfig_data *pr)
|
||||
{
|
||||
|
||||
@@ -2613,6 +2613,8 @@ enum parport_pc_pci_cards {
|
||||
netmos_9865,
|
||||
quatech_sppxp100,
|
||||
wch_ch382l,
|
||||
brainboxes_uc146,
|
||||
brainboxes_px203,
|
||||
};
|
||||
|
||||
|
||||
@@ -2676,6 +2678,8 @@ static struct parport_pc_pci {
|
||||
/* netmos_9865 */ { 1, { { 0, -1 }, } },
|
||||
/* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
|
||||
/* wch_ch382l */ { 1, { { 2, -1 }, } },
|
||||
/* brainboxes_uc146 */ { 1, { { 3, -1 }, } },
|
||||
/* brainboxes_px203 */ { 1, { { 0, -1 }, } },
|
||||
};
|
||||
|
||||
static const struct pci_device_id parport_pc_pci_tbl[] = {
|
||||
@@ -2767,6 +2771,23 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
|
||||
/* WCH CH382L PCI-E single parallel port card */
|
||||
{ 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l },
|
||||
/* Brainboxes IX-500/550 */
|
||||
{ PCI_VENDOR_ID_INTASHIELD, 0x402a,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport },
|
||||
/* Brainboxes UC-146/UC-157 */
|
||||
{ PCI_VENDOR_ID_INTASHIELD, 0x0be1,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc146 },
|
||||
{ PCI_VENDOR_ID_INTASHIELD, 0x0be2,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc146 },
|
||||
/* Brainboxes PX-146/PX-257 */
|
||||
{ PCI_VENDOR_ID_INTASHIELD, 0x401c,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport },
|
||||
/* Brainboxes PX-203 */
|
||||
{ PCI_VENDOR_ID_INTASHIELD, 0x4007,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_px203 },
|
||||
/* Brainboxes PX-475 */
|
||||
{ PCI_VENDOR_ID_INTASHIELD, 0x401f,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport },
|
||||
{ 0, } /* terminate list */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#define MLXBF_BOOTCTL_SB_SECURE_MASK 0x03
|
||||
#define MLXBF_BOOTCTL_SB_TEST_MASK 0x0c
|
||||
#define MLXBF_BOOTCTL_SB_DEV_MASK BIT(4)
|
||||
|
||||
#define MLXBF_SB_KEY_NUM 4
|
||||
|
||||
@@ -37,11 +38,18 @@ static struct mlxbf_bootctl_name boot_names[] = {
|
||||
{ MLXBF_BOOTCTL_NONE, "none" },
|
||||
};
|
||||
|
||||
enum {
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION = 0,
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE = 1,
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE = 2,
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_RMA = 3
|
||||
};
|
||||
|
||||
static const char * const mlxbf_bootctl_lifecycle_states[] = {
|
||||
[0] = "Production",
|
||||
[1] = "GA Secured",
|
||||
[2] = "GA Non-Secured",
|
||||
[3] = "RMA",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION] = "Production",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE] = "GA Secured",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_RMA] = "RMA",
|
||||
};
|
||||
|
||||
/* ARM SMC call which is atomic and no need for lock. */
|
||||
@@ -165,25 +173,30 @@ static ssize_t second_reset_action_store(struct device *dev,
|
||||
static ssize_t lifecycle_state_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
int status_bits;
|
||||
int use_dev_key;
|
||||
int test_state;
|
||||
int lc_state;
|
||||
|
||||
lc_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS,
|
||||
MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE);
|
||||
if (lc_state < 0)
|
||||
return lc_state;
|
||||
status_bits = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS,
|
||||
MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE);
|
||||
if (status_bits < 0)
|
||||
return status_bits;
|
||||
|
||||
lc_state &=
|
||||
MLXBF_BOOTCTL_SB_TEST_MASK | MLXBF_BOOTCTL_SB_SECURE_MASK;
|
||||
use_dev_key = status_bits & MLXBF_BOOTCTL_SB_DEV_MASK;
|
||||
test_state = status_bits & MLXBF_BOOTCTL_SB_TEST_MASK;
|
||||
lc_state = status_bits & MLXBF_BOOTCTL_SB_SECURE_MASK;
|
||||
|
||||
/*
|
||||
* If the test bits are set, we specify that the current state may be
|
||||
* due to using the test bits.
|
||||
*/
|
||||
if (lc_state & MLXBF_BOOTCTL_SB_TEST_MASK) {
|
||||
lc_state &= MLXBF_BOOTCTL_SB_SECURE_MASK;
|
||||
|
||||
if (test_state) {
|
||||
return sprintf(buf, "%s(test)\n",
|
||||
mlxbf_bootctl_lifecycle_states[lc_state]);
|
||||
} else if (use_dev_key &&
|
||||
(lc_state == MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE)) {
|
||||
return sprintf(buf, "Secured (development)\n");
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s\n", mlxbf_bootctl_lifecycle_states[lc_state]);
|
||||
|
||||
@@ -1202,6 +1202,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->dev_attr.show = mlxbf_pmc_event_list_show;
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list");
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
|
||||
@@ -1214,6 +1216,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"enable");
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
}
|
||||
@@ -1240,6 +1244,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"counter%d", j);
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
|
||||
@@ -1251,6 +1257,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"event%d", j);
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
}
|
||||
@@ -1283,6 +1291,8 @@ static int mlxbf_pmc_init_perftype_reg(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
events[j].evt_name);
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
i++;
|
||||
@@ -1311,6 +1321,8 @@ static int mlxbf_pmc_create_groups(struct device *dev, int blk_num)
|
||||
pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr;
|
||||
pmc->block[blk_num].block_attr_grp.name = devm_kasprintf(
|
||||
dev, GFP_KERNEL, pmc->block_name[blk_num]);
|
||||
if (!pmc->block[blk_num].block_attr_grp.name)
|
||||
return -ENOMEM;
|
||||
pmc->groups[blk_num] = &pmc->block[blk_num].block_attr_grp;
|
||||
|
||||
return 0;
|
||||
@@ -1442,6 +1454,8 @@ static int mlxbf_pmc_probe(struct platform_device *pdev)
|
||||
|
||||
pmc->hwmon_dev = devm_hwmon_device_register_with_groups(
|
||||
dev, "bfperf", pmc, pmc->groups);
|
||||
if (IS_ERR(pmc->hwmon_dev))
|
||||
return PTR_ERR(pmc->hwmon_dev);
|
||||
platform_set_drvdata(pdev, pmc);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -230,9 +230,12 @@ static int ssam_receive_buf(struct serdev_device *dev, const unsigned char *buf,
|
||||
size_t n)
|
||||
{
|
||||
struct ssam_controller *ctrl;
|
||||
int ret;
|
||||
|
||||
ctrl = serdev_device_get_drvdata(dev);
|
||||
return ssam_controller_receive_buf(ctrl, buf, n);
|
||||
ret = ssam_controller_receive_buf(ctrl, buf, n);
|
||||
|
||||
return ret < 0 ? 0 : ret;
|
||||
}
|
||||
|
||||
static void ssam_write_wakeup(struct serdev_device *dev)
|
||||
|
||||
@@ -257,6 +257,7 @@ config ASUS_WMI
|
||||
depends on RFKILL || RFKILL = n
|
||||
depends on HOTPLUG_PCI
|
||||
depends on ACPI_VIDEO || ACPI_VIDEO = n
|
||||
depends on SERIO_I8042 || SERIO_I8042 = n
|
||||
select INPUT_SPARSEKMAP
|
||||
select LEDS_CLASS
|
||||
select NEW_LEDS
|
||||
@@ -271,7 +272,6 @@ config ASUS_WMI
|
||||
config ASUS_NB_WMI
|
||||
tristate "Asus Notebook WMI Driver"
|
||||
depends on ASUS_WMI
|
||||
depends on SERIO_I8042 || SERIO_I8042 = n
|
||||
help
|
||||
This is a driver for newer Asus notebooks. It adds extra features
|
||||
like wireless radio and bluetooth control, leds, hotkeys, backlight...
|
||||
|
||||
@@ -115,12 +115,17 @@ static struct quirk_entry quirk_asus_forceals = {
|
||||
};
|
||||
|
||||
static struct quirk_entry quirk_asus_use_kbd_dock_devid = {
|
||||
.use_kbd_dock_devid = true,
|
||||
.tablet_switch_mode = asus_wmi_kbd_dock_devid,
|
||||
};
|
||||
|
||||
static struct quirk_entry quirk_asus_use_lid_flip_devid = {
|
||||
.wmi_backlight_set_devstate = true,
|
||||
.use_lid_flip_devid = true,
|
||||
.tablet_switch_mode = asus_wmi_lid_flip_devid,
|
||||
};
|
||||
|
||||
static struct quirk_entry quirk_asus_tablet_mode = {
|
||||
.wmi_backlight_set_devstate = true,
|
||||
.tablet_switch_mode = asus_wmi_lid_flip_rog_devid,
|
||||
};
|
||||
|
||||
static int dmi_matched(const struct dmi_system_id *dmi)
|
||||
@@ -471,13 +476,20 @@ static const struct dmi_system_id asus_quirks[] = {
|
||||
},
|
||||
.driver_data = &quirk_asus_use_lid_flip_devid,
|
||||
},
|
||||
{
|
||||
.callback = dmi_matched,
|
||||
.ident = "ASUS ROG FLOW X13",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "GV301Q"),
|
||||
},
|
||||
.driver_data = &quirk_asus_tablet_mode,
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
|
||||
{
|
||||
int ret;
|
||||
|
||||
quirks = &quirk_asus_unknown;
|
||||
dmi_check_system(asus_quirks);
|
||||
|
||||
@@ -490,29 +502,8 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
|
||||
else
|
||||
wapf = quirks->wapf;
|
||||
|
||||
switch (tablet_mode_sw) {
|
||||
case 0:
|
||||
quirks->use_kbd_dock_devid = false;
|
||||
quirks->use_lid_flip_devid = false;
|
||||
break;
|
||||
case 1:
|
||||
quirks->use_kbd_dock_devid = true;
|
||||
quirks->use_lid_flip_devid = false;
|
||||
break;
|
||||
case 2:
|
||||
quirks->use_kbd_dock_devid = false;
|
||||
quirks->use_lid_flip_devid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (quirks->i8042_filter) {
|
||||
ret = i8042_install_filter(quirks->i8042_filter);
|
||||
if (ret) {
|
||||
pr_warn("Unable to install key filter\n");
|
||||
return;
|
||||
}
|
||||
pr_info("Using i8042 filter function for receiving events\n");
|
||||
}
|
||||
if (tablet_mode_sw != -1)
|
||||
quirks->tablet_switch_mode = tablet_mode_sw;
|
||||
}
|
||||
|
||||
static const struct key_entry asus_nb_wmi_keymap[] = {
|
||||
@@ -584,6 +575,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
|
||||
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
|
||||
{ KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */
|
||||
{ KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
|
||||
{ KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow laptops */
|
||||
{ KE_END, 0},
|
||||
};
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ module_param(fnlock_default, bool, 0444);
|
||||
#define NOTIFY_KBD_FBM 0x99
|
||||
#define NOTIFY_KBD_TTP 0xae
|
||||
#define NOTIFY_LID_FLIP 0xfa
|
||||
#define NOTIFY_LID_FLIP_ROG 0xbd
|
||||
|
||||
#define ASUS_WMI_FNLOCK_BIOS_DISABLED BIT(0)
|
||||
|
||||
@@ -203,6 +204,10 @@ struct asus_wmi {
|
||||
struct asus_rfkill gps;
|
||||
struct asus_rfkill uwb;
|
||||
|
||||
int tablet_switch_event_code;
|
||||
u32 tablet_switch_dev_id;
|
||||
bool tablet_switch_inverted;
|
||||
|
||||
enum fan_type fan_type;
|
||||
int fan_pwm_mode;
|
||||
int agfn_pwm;
|
||||
@@ -363,10 +368,35 @@ static bool asus_wmi_dev_is_present(struct asus_wmi *asus, u32 dev_id)
|
||||
}
|
||||
|
||||
/* Input **********************************************************************/
|
||||
static void asus_wmi_tablet_sw_report(struct asus_wmi *asus, bool value)
|
||||
{
|
||||
input_report_switch(asus->inputdev, SW_TABLET_MODE,
|
||||
asus->tablet_switch_inverted ? !value : value);
|
||||
input_sync(asus->inputdev);
|
||||
}
|
||||
|
||||
static void asus_wmi_tablet_sw_init(struct asus_wmi *asus, u32 dev_id, int event_code)
|
||||
{
|
||||
struct device *dev = &asus->platform_device->dev;
|
||||
int result;
|
||||
|
||||
result = asus_wmi_get_devstate_simple(asus, dev_id);
|
||||
if (result >= 0) {
|
||||
input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE);
|
||||
asus_wmi_tablet_sw_report(asus, result);
|
||||
asus->tablet_switch_dev_id = dev_id;
|
||||
asus->tablet_switch_event_code = event_code;
|
||||
} else if (result == -ENODEV) {
|
||||
dev_err(dev, "This device has tablet-mode-switch quirk but got ENODEV checking it. This is a bug.");
|
||||
} else {
|
||||
dev_err(dev, "Error checking for tablet-mode-switch: %d\n", result);
|
||||
}
|
||||
}
|
||||
|
||||
static int asus_wmi_input_init(struct asus_wmi *asus)
|
||||
{
|
||||
int err, result;
|
||||
struct device *dev = &asus->platform_device->dev;
|
||||
int err;
|
||||
|
||||
asus->inputdev = input_allocate_device();
|
||||
if (!asus->inputdev)
|
||||
@@ -375,35 +405,26 @@ static int asus_wmi_input_init(struct asus_wmi *asus)
|
||||
asus->inputdev->name = asus->driver->input_name;
|
||||
asus->inputdev->phys = asus->driver->input_phys;
|
||||
asus->inputdev->id.bustype = BUS_HOST;
|
||||
asus->inputdev->dev.parent = &asus->platform_device->dev;
|
||||
asus->inputdev->dev.parent = dev;
|
||||
set_bit(EV_REP, asus->inputdev->evbit);
|
||||
|
||||
err = sparse_keymap_setup(asus->inputdev, asus->driver->keymap, NULL);
|
||||
if (err)
|
||||
goto err_free_dev;
|
||||
|
||||
if (asus->driver->quirks->use_kbd_dock_devid) {
|
||||
result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_KBD_DOCK);
|
||||
if (result >= 0) {
|
||||
input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE);
|
||||
input_report_switch(asus->inputdev, SW_TABLET_MODE, !result);
|
||||
} else if (result != -ENODEV) {
|
||||
pr_err("Error checking for keyboard-dock: %d\n", result);
|
||||
}
|
||||
}
|
||||
|
||||
if (asus->driver->quirks->use_lid_flip_devid) {
|
||||
result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_LID_FLIP);
|
||||
if (result < 0)
|
||||
asus->driver->quirks->use_lid_flip_devid = 0;
|
||||
if (result >= 0) {
|
||||
input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE);
|
||||
input_report_switch(asus->inputdev, SW_TABLET_MODE, result);
|
||||
} else if (result == -ENODEV) {
|
||||
pr_err("This device has lid_flip quirk but got ENODEV checking it. This is a bug.");
|
||||
} else {
|
||||
pr_err("Error checking for lid-flip: %d\n", result);
|
||||
}
|
||||
switch (asus->driver->quirks->tablet_switch_mode) {
|
||||
case asus_wmi_no_tablet_switch:
|
||||
break;
|
||||
case asus_wmi_kbd_dock_devid:
|
||||
asus->tablet_switch_inverted = true;
|
||||
asus_wmi_tablet_sw_init(asus, ASUS_WMI_DEVID_KBD_DOCK, NOTIFY_KBD_DOCK_CHANGE);
|
||||
break;
|
||||
case asus_wmi_lid_flip_devid:
|
||||
asus_wmi_tablet_sw_init(asus, ASUS_WMI_DEVID_LID_FLIP, NOTIFY_LID_FLIP);
|
||||
break;
|
||||
case asus_wmi_lid_flip_rog_devid:
|
||||
asus_wmi_tablet_sw_init(asus, ASUS_WMI_DEVID_LID_FLIP_ROG, NOTIFY_LID_FLIP_ROG);
|
||||
break;
|
||||
}
|
||||
|
||||
err = input_register_device(asus->inputdev);
|
||||
@@ -427,14 +448,16 @@ static void asus_wmi_input_exit(struct asus_wmi *asus)
|
||||
|
||||
/* Tablet mode ****************************************************************/
|
||||
|
||||
static void lid_flip_tablet_mode_get_state(struct asus_wmi *asus)
|
||||
static void asus_wmi_tablet_mode_get_state(struct asus_wmi *asus)
|
||||
{
|
||||
int result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_LID_FLIP);
|
||||
int result;
|
||||
|
||||
if (result >= 0) {
|
||||
input_report_switch(asus->inputdev, SW_TABLET_MODE, result);
|
||||
input_sync(asus->inputdev);
|
||||
}
|
||||
if (!asus->tablet_switch_dev_id)
|
||||
return;
|
||||
|
||||
result = asus_wmi_get_devstate_simple(asus, asus->tablet_switch_dev_id);
|
||||
if (result >= 0)
|
||||
asus_wmi_tablet_sw_report(asus, result);
|
||||
}
|
||||
|
||||
/* dGPU ********************************************************************/
|
||||
@@ -2486,9 +2509,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
|
||||
{
|
||||
unsigned int key_value = 1;
|
||||
bool autorelease = 1;
|
||||
int result, orig_code;
|
||||
|
||||
orig_code = code;
|
||||
int orig_code = code;
|
||||
|
||||
if (asus->driver->key_filter) {
|
||||
asus->driver->key_filter(asus->driver, &code, &key_value,
|
||||
@@ -2531,19 +2552,8 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
|
||||
return;
|
||||
}
|
||||
|
||||
if (asus->driver->quirks->use_kbd_dock_devid && code == NOTIFY_KBD_DOCK_CHANGE) {
|
||||
result = asus_wmi_get_devstate_simple(asus,
|
||||
ASUS_WMI_DEVID_KBD_DOCK);
|
||||
if (result >= 0) {
|
||||
input_report_switch(asus->inputdev, SW_TABLET_MODE,
|
||||
!result);
|
||||
input_sync(asus->inputdev);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (asus->driver->quirks->use_lid_flip_devid && code == NOTIFY_LID_FLIP) {
|
||||
lid_flip_tablet_mode_get_state(asus);
|
||||
if (code == asus->tablet_switch_event_code) {
|
||||
asus_wmi_tablet_mode_get_state(asus);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3089,6 +3099,12 @@ static int asus_wmi_add(struct platform_device *pdev)
|
||||
goto fail_wmi_handler;
|
||||
}
|
||||
|
||||
if (asus->driver->quirks->i8042_filter) {
|
||||
err = i8042_install_filter(asus->driver->quirks->i8042_filter);
|
||||
if (err)
|
||||
pr_warn("Unable to install key filter - %d\n", err);
|
||||
}
|
||||
|
||||
asus_wmi_battery_init(asus);
|
||||
|
||||
asus_wmi_debugfs_init(asus);
|
||||
@@ -3125,6 +3141,8 @@ static int asus_wmi_remove(struct platform_device *device)
|
||||
struct asus_wmi *asus;
|
||||
|
||||
asus = platform_get_drvdata(device);
|
||||
if (asus->driver->quirks->i8042_filter)
|
||||
i8042_remove_filter(asus->driver->quirks->i8042_filter);
|
||||
wmi_remove_notify_handler(asus->driver->event_guid);
|
||||
asus_wmi_backlight_exit(asus);
|
||||
asus_wmi_input_exit(asus);
|
||||
@@ -3173,9 +3191,7 @@ static int asus_hotk_resume(struct device *device)
|
||||
if (asus_wmi_has_fnlock_key(asus))
|
||||
asus_wmi_fnlock_update(asus);
|
||||
|
||||
if (asus->driver->quirks->use_lid_flip_devid)
|
||||
lid_flip_tablet_mode_get_state(asus);
|
||||
|
||||
asus_wmi_tablet_mode_get_state(asus);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3215,9 +3231,7 @@ static int asus_hotk_restore(struct device *device)
|
||||
if (asus_wmi_has_fnlock_key(asus))
|
||||
asus_wmi_fnlock_update(asus);
|
||||
|
||||
if (asus->driver->quirks->use_lid_flip_devid)
|
||||
lid_flip_tablet_mode_get_state(asus);
|
||||
|
||||
asus_wmi_tablet_mode_get_state(asus);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,13 @@ struct module;
|
||||
struct key_entry;
|
||||
struct asus_wmi;
|
||||
|
||||
enum asus_wmi_tablet_switch_mode {
|
||||
asus_wmi_no_tablet_switch,
|
||||
asus_wmi_kbd_dock_devid,
|
||||
asus_wmi_lid_flip_devid,
|
||||
asus_wmi_lid_flip_rog_devid,
|
||||
};
|
||||
|
||||
struct quirk_entry {
|
||||
bool hotplug_wireless;
|
||||
bool scalar_panel_brightness;
|
||||
@@ -33,8 +40,7 @@ struct quirk_entry {
|
||||
bool wmi_backlight_native;
|
||||
bool wmi_backlight_set_devstate;
|
||||
bool wmi_force_als_set;
|
||||
bool use_kbd_dock_devid;
|
||||
bool use_lid_flip_devid;
|
||||
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
|
||||
int wapf;
|
||||
/*
|
||||
* For machines with AMD graphic chips, it will send out WMI event
|
||||
|
||||
@@ -99,6 +99,12 @@ static const struct acpi_device_id wmi_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, wmi_device_ids);
|
||||
|
||||
/* allow duplicate GUIDs as these device drivers use struct wmi_driver */
|
||||
static const char * const allow_duplicates[] = {
|
||||
"05901221-D566-11D1-B2F0-00A0C9062910", /* wmi-bmof */
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct platform_driver acpi_wmi_driver = {
|
||||
.driver = {
|
||||
.name = "acpi-wmi",
|
||||
@@ -1039,6 +1045,23 @@ static const struct device_type wmi_type_data = {
|
||||
.release = wmi_dev_release,
|
||||
};
|
||||
|
||||
/*
|
||||
* _WDG is a static list that is only parsed at startup,
|
||||
* so it's safe to count entries without extra protection.
|
||||
*/
|
||||
static int guid_count(const guid_t *guid)
|
||||
{
|
||||
struct wmi_block *wblock;
|
||||
int count = 0;
|
||||
|
||||
list_for_each_entry(wblock, &wmi_block_list, list) {
|
||||
if (guid_equal(&wblock->gblock.guid, guid))
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static int wmi_create_device(struct device *wmi_bus_dev,
|
||||
struct wmi_block *wblock,
|
||||
struct acpi_device *device)
|
||||
@@ -1046,6 +1069,7 @@ static int wmi_create_device(struct device *wmi_bus_dev,
|
||||
struct acpi_device_info *info;
|
||||
char method[5];
|
||||
int result;
|
||||
uint count;
|
||||
|
||||
if (wblock->gblock.flags & ACPI_WMI_EVENT) {
|
||||
wblock->dev.dev.type = &wmi_type_event;
|
||||
@@ -1102,7 +1126,11 @@ static int wmi_create_device(struct device *wmi_bus_dev,
|
||||
wblock->dev.dev.bus = &wmi_bus_type;
|
||||
wblock->dev.dev.parent = wmi_bus_dev;
|
||||
|
||||
dev_set_name(&wblock->dev.dev, "%pUL", &wblock->gblock.guid);
|
||||
count = guid_count(&wblock->gblock.guid);
|
||||
if (count)
|
||||
dev_set_name(&wblock->dev.dev, "%pUL-%d", &wblock->gblock.guid, count);
|
||||
else
|
||||
dev_set_name(&wblock->dev.dev, "%pUL", &wblock->gblock.guid);
|
||||
|
||||
device_initialize(&wblock->dev.dev);
|
||||
|
||||
@@ -1122,11 +1150,22 @@ static void wmi_free_devices(struct acpi_device *device)
|
||||
}
|
||||
}
|
||||
|
||||
static bool guid_already_parsed(struct acpi_device *device, const guid_t *guid)
|
||||
static bool guid_already_parsed_for_legacy(struct acpi_device *device, const guid_t *guid)
|
||||
{
|
||||
struct wmi_block *wblock;
|
||||
|
||||
list_for_each_entry(wblock, &wmi_block_list, list) {
|
||||
int i;
|
||||
|
||||
/* skip warning and register if we know the driver will use struct wmi_driver */
|
||||
for (i = 0; allow_duplicates[i] != NULL; i++) {
|
||||
guid_t tmp;
|
||||
|
||||
if (guid_parse(allow_duplicates[i], &tmp))
|
||||
continue;
|
||||
if (guid_equal(&tmp, guid))
|
||||
return false;
|
||||
}
|
||||
if (guid_equal(&wblock->gblock.guid, guid)) {
|
||||
/*
|
||||
* Because we historically didn't track the relationship
|
||||
@@ -1176,13 +1215,12 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
|
||||
if (debug_dump_wdg)
|
||||
wmi_dump_wdg(&gblock[i]);
|
||||
|
||||
/*
|
||||
* Some WMI devices, like those for nVidia hooks, have a
|
||||
* duplicate GUID. It's not clear what we should do in this
|
||||
* case yet, so for now, we'll just ignore the duplicate
|
||||
* for device creation.
|
||||
*/
|
||||
if (guid_already_parsed(device, &gblock[i].guid))
|
||||
if (!gblock[i].instance_count) {
|
||||
dev_info(wmi_bus_dev, FW_INFO "%pUL has zero instances\n", &gblock[i].guid);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (guid_already_parsed_for_legacy(device, &gblock[i].guid))
|
||||
continue;
|
||||
|
||||
wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
|
||||
|
||||
@@ -2691,6 +2691,7 @@ init_wrb_hndl_failed:
|
||||
kfree(pwrb_context->pwrb_handle_base);
|
||||
kfree(pwrb_context->pwrb_handle_basestd);
|
||||
}
|
||||
kfree(phwi_ctxt->be_wrbq);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,16 @@ static void optee_release_device(struct device *dev)
|
||||
kfree(optee_device);
|
||||
}
|
||||
|
||||
static int optee_register_device(const uuid_t *device_uuid)
|
||||
static ssize_t need_supplicant_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RO(need_supplicant);
|
||||
|
||||
static int optee_register_device(const uuid_t *device_uuid, u32 func)
|
||||
{
|
||||
struct tee_client_device *optee_device = NULL;
|
||||
int rc;
|
||||
@@ -83,6 +92,10 @@ static int optee_register_device(const uuid_t *device_uuid)
|
||||
put_device(&optee_device->dev);
|
||||
}
|
||||
|
||||
if (func == PTA_CMD_GET_DEVICES_SUPP)
|
||||
device_create_file(&optee_device->dev,
|
||||
&dev_attr_need_supplicant);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -143,7 +156,7 @@ static int __optee_enumerate_devices(u32 func)
|
||||
num_devices = shm_size / sizeof(uuid_t);
|
||||
|
||||
for (idx = 0; idx < num_devices; idx++) {
|
||||
rc = optee_register_device(&device_uuid[idx]);
|
||||
rc = optee_register_device(&device_uuid[idx], func);
|
||||
if (rc)
|
||||
goto out_shm;
|
||||
}
|
||||
|
||||
@@ -199,6 +199,7 @@ static int __init early_omap8250_setup(struct earlycon_device *device,
|
||||
OF_EARLYCON_DECLARE(omap8250, "ti,omap2-uart", early_omap8250_setup);
|
||||
OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup);
|
||||
OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup);
|
||||
OF_EARLYCON_DECLARE(omap8250, "ti,am654-uart", early_omap8250_setup);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -839,7 +839,7 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
|
||||
if (priv->habit & UART_HAS_RHR_IT_DIS) {
|
||||
reg = serial_in(p, UART_OMAP_IER2);
|
||||
reg &= ~UART_OMAP_IER2_RHR_IT_DIS;
|
||||
serial_out(p, UART_OMAP_IER2, UART_OMAP_IER2_RHR_IT_DIS);
|
||||
serial_out(p, UART_OMAP_IER2, reg);
|
||||
}
|
||||
|
||||
dmaengine_tx_status(rxchan, cookie, &state);
|
||||
@@ -981,7 +981,7 @@ static int omap_8250_rx_dma(struct uart_8250_port *p)
|
||||
if (priv->habit & UART_HAS_RHR_IT_DIS) {
|
||||
reg = serial_in(p, UART_OMAP_IER2);
|
||||
reg |= UART_OMAP_IER2_RHR_IT_DIS;
|
||||
serial_out(p, UART_OMAP_IER2, UART_OMAP_IER2_RHR_IT_DIS);
|
||||
serial_out(p, UART_OMAP_IER2, reg);
|
||||
}
|
||||
|
||||
dma_async_issue_pending(dma->rxchan);
|
||||
@@ -1203,10 +1203,12 @@ static int omap_8250_dma_handle_irq(struct uart_port *port)
|
||||
|
||||
status = serial_port_in(port, UART_LSR);
|
||||
|
||||
if (priv->habit & UART_HAS_EFR2)
|
||||
am654_8250_handle_rx_dma(up, iir, status);
|
||||
else
|
||||
status = omap_8250_handle_rx_dma(up, iir, status);
|
||||
if ((iir & 0x3f) != UART_IIR_THRI) {
|
||||
if (priv->habit & UART_HAS_EFR2)
|
||||
am654_8250_handle_rx_dma(up, iir, status);
|
||||
else
|
||||
status = omap_8250_handle_rx_dma(up, iir, status);
|
||||
}
|
||||
|
||||
serial8250_modem_status(up);
|
||||
if (status & UART_LSR_THRE && up->dma->tx_err) {
|
||||
|
||||
@@ -222,17 +222,18 @@ static struct vendor_data vendor_zte = {
|
||||
|
||||
/* Deals with DMA transactions */
|
||||
|
||||
struct pl011_sgbuf {
|
||||
struct scatterlist sg;
|
||||
char *buf;
|
||||
struct pl011_dmabuf {
|
||||
dma_addr_t dma;
|
||||
size_t len;
|
||||
char *buf;
|
||||
};
|
||||
|
||||
struct pl011_dmarx_data {
|
||||
struct dma_chan *chan;
|
||||
struct completion complete;
|
||||
bool use_buf_b;
|
||||
struct pl011_sgbuf sgbuf_a;
|
||||
struct pl011_sgbuf sgbuf_b;
|
||||
struct pl011_dmabuf dbuf_a;
|
||||
struct pl011_dmabuf dbuf_b;
|
||||
dma_cookie_t cookie;
|
||||
bool running;
|
||||
struct timer_list timer;
|
||||
@@ -245,7 +246,8 @@ struct pl011_dmarx_data {
|
||||
|
||||
struct pl011_dmatx_data {
|
||||
struct dma_chan *chan;
|
||||
struct scatterlist sg;
|
||||
dma_addr_t dma;
|
||||
size_t len;
|
||||
char *buf;
|
||||
bool queued;
|
||||
};
|
||||
@@ -370,32 +372,24 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap)
|
||||
|
||||
#define PL011_DMA_BUFFER_SIZE PAGE_SIZE
|
||||
|
||||
static int pl011_sgbuf_init(struct dma_chan *chan, struct pl011_sgbuf *sg,
|
||||
static int pl011_dmabuf_init(struct dma_chan *chan, struct pl011_dmabuf *db,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
dma_addr_t dma_addr;
|
||||
|
||||
sg->buf = dma_alloc_coherent(chan->device->dev,
|
||||
PL011_DMA_BUFFER_SIZE, &dma_addr, GFP_KERNEL);
|
||||
if (!sg->buf)
|
||||
db->buf = dma_alloc_coherent(chan->device->dev, PL011_DMA_BUFFER_SIZE,
|
||||
&db->dma, GFP_KERNEL);
|
||||
if (!db->buf)
|
||||
return -ENOMEM;
|
||||
|
||||
sg_init_table(&sg->sg, 1);
|
||||
sg_set_page(&sg->sg, phys_to_page(dma_addr),
|
||||
PL011_DMA_BUFFER_SIZE, offset_in_page(dma_addr));
|
||||
sg_dma_address(&sg->sg) = dma_addr;
|
||||
sg_dma_len(&sg->sg) = PL011_DMA_BUFFER_SIZE;
|
||||
db->len = PL011_DMA_BUFFER_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg,
|
||||
static void pl011_dmabuf_free(struct dma_chan *chan, struct pl011_dmabuf *db,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
if (sg->buf) {
|
||||
if (db->buf) {
|
||||
dma_free_coherent(chan->device->dev,
|
||||
PL011_DMA_BUFFER_SIZE, sg->buf,
|
||||
sg_dma_address(&sg->sg));
|
||||
PL011_DMA_BUFFER_SIZE, db->buf, db->dma);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,8 +550,8 @@ static void pl011_dma_tx_callback(void *data)
|
||||
|
||||
spin_lock_irqsave(&uap->port.lock, flags);
|
||||
if (uap->dmatx.queued)
|
||||
dma_unmap_sg(dmatx->chan->device->dev, &dmatx->sg, 1,
|
||||
DMA_TO_DEVICE);
|
||||
dma_unmap_single(dmatx->chan->device->dev, dmatx->dma,
|
||||
dmatx->len, DMA_TO_DEVICE);
|
||||
|
||||
dmacr = uap->dmacr;
|
||||
uap->dmacr = dmacr & ~UART011_TXDMAE;
|
||||
@@ -643,18 +637,19 @@ static int pl011_dma_tx_refill(struct uart_amba_port *uap)
|
||||
memcpy(&dmatx->buf[first], &xmit->buf[0], second);
|
||||
}
|
||||
|
||||
dmatx->sg.length = count;
|
||||
|
||||
if (dma_map_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE) != 1) {
|
||||
dmatx->len = count;
|
||||
dmatx->dma = dma_map_single(dma_dev->dev, dmatx->buf, count,
|
||||
DMA_TO_DEVICE);
|
||||
if (dmatx->dma == DMA_MAPPING_ERROR) {
|
||||
uap->dmatx.queued = false;
|
||||
dev_dbg(uap->port.dev, "unable to map TX DMA\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
desc = dmaengine_prep_slave_sg(chan, &dmatx->sg, 1, DMA_MEM_TO_DEV,
|
||||
desc = dmaengine_prep_slave_single(chan, dmatx->dma, dmatx->len, DMA_MEM_TO_DEV,
|
||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||
if (!desc) {
|
||||
dma_unmap_sg(dma_dev->dev, &dmatx->sg, 1, DMA_TO_DEVICE);
|
||||
dma_unmap_single(dma_dev->dev, dmatx->dma, dmatx->len, DMA_TO_DEVICE);
|
||||
uap->dmatx.queued = false;
|
||||
/*
|
||||
* If DMA cannot be used right now, we complete this
|
||||
@@ -818,8 +813,8 @@ __acquires(&uap->port.lock)
|
||||
dmaengine_terminate_async(uap->dmatx.chan);
|
||||
|
||||
if (uap->dmatx.queued) {
|
||||
dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1,
|
||||
DMA_TO_DEVICE);
|
||||
dma_unmap_single(uap->dmatx.chan->device->dev, uap->dmatx.dma,
|
||||
uap->dmatx.len, DMA_TO_DEVICE);
|
||||
uap->dmatx.queued = false;
|
||||
uap->dmacr &= ~UART011_TXDMAE;
|
||||
pl011_write(uap->dmacr, uap, REG_DMACR);
|
||||
@@ -833,15 +828,15 @@ static int pl011_dma_rx_trigger_dma(struct uart_amba_port *uap)
|
||||
struct dma_chan *rxchan = uap->dmarx.chan;
|
||||
struct pl011_dmarx_data *dmarx = &uap->dmarx;
|
||||
struct dma_async_tx_descriptor *desc;
|
||||
struct pl011_sgbuf *sgbuf;
|
||||
struct pl011_dmabuf *dbuf;
|
||||
|
||||
if (!rxchan)
|
||||
return -EIO;
|
||||
|
||||
/* Start the RX DMA job */
|
||||
sgbuf = uap->dmarx.use_buf_b ?
|
||||
&uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
|
||||
desc = dmaengine_prep_slave_sg(rxchan, &sgbuf->sg, 1,
|
||||
dbuf = uap->dmarx.use_buf_b ?
|
||||
&uap->dmarx.dbuf_b : &uap->dmarx.dbuf_a;
|
||||
desc = dmaengine_prep_slave_single(rxchan, dbuf->dma, dbuf->len,
|
||||
DMA_DEV_TO_MEM,
|
||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||
/*
|
||||
@@ -881,8 +876,8 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
|
||||
bool readfifo)
|
||||
{
|
||||
struct tty_port *port = &uap->port.state->port;
|
||||
struct pl011_sgbuf *sgbuf = use_buf_b ?
|
||||
&uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
|
||||
struct pl011_dmabuf *dbuf = use_buf_b ?
|
||||
&uap->dmarx.dbuf_b : &uap->dmarx.dbuf_a;
|
||||
int dma_count = 0;
|
||||
u32 fifotaken = 0; /* only used for vdbg() */
|
||||
|
||||
@@ -891,7 +886,7 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
|
||||
|
||||
if (uap->dmarx.poll_rate) {
|
||||
/* The data can be taken by polling */
|
||||
dmataken = sgbuf->sg.length - dmarx->last_residue;
|
||||
dmataken = dbuf->len - dmarx->last_residue;
|
||||
/* Recalculate the pending size */
|
||||
if (pending >= dmataken)
|
||||
pending -= dmataken;
|
||||
@@ -905,7 +900,7 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
|
||||
* Note that tty_insert_flip_buf() tries to take as many chars
|
||||
* as it can.
|
||||
*/
|
||||
dma_count = tty_insert_flip_string(port, sgbuf->buf + dmataken,
|
||||
dma_count = tty_insert_flip_string(port, dbuf->buf + dmataken,
|
||||
pending);
|
||||
|
||||
uap->port.icount.rx += dma_count;
|
||||
@@ -916,7 +911,7 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
|
||||
|
||||
/* Reset the last_residue for Rx DMA poll */
|
||||
if (uap->dmarx.poll_rate)
|
||||
dmarx->last_residue = sgbuf->sg.length;
|
||||
dmarx->last_residue = dbuf->len;
|
||||
|
||||
/*
|
||||
* Only continue with trying to read the FIFO if all DMA chars have
|
||||
@@ -951,8 +946,8 @@ static void pl011_dma_rx_irq(struct uart_amba_port *uap)
|
||||
{
|
||||
struct pl011_dmarx_data *dmarx = &uap->dmarx;
|
||||
struct dma_chan *rxchan = dmarx->chan;
|
||||
struct pl011_sgbuf *sgbuf = dmarx->use_buf_b ?
|
||||
&dmarx->sgbuf_b : &dmarx->sgbuf_a;
|
||||
struct pl011_dmabuf *dbuf = dmarx->use_buf_b ?
|
||||
&dmarx->dbuf_b : &dmarx->dbuf_a;
|
||||
size_t pending;
|
||||
struct dma_tx_state state;
|
||||
enum dma_status dmastat;
|
||||
@@ -974,7 +969,7 @@ static void pl011_dma_rx_irq(struct uart_amba_port *uap)
|
||||
pl011_write(uap->dmacr, uap, REG_DMACR);
|
||||
uap->dmarx.running = false;
|
||||
|
||||
pending = sgbuf->sg.length - state.residue;
|
||||
pending = dbuf->len - state.residue;
|
||||
BUG_ON(pending > PL011_DMA_BUFFER_SIZE);
|
||||
/* Then we terminate the transfer - we now know our residue */
|
||||
dmaengine_terminate_all(rxchan);
|
||||
@@ -1001,8 +996,8 @@ static void pl011_dma_rx_callback(void *data)
|
||||
struct pl011_dmarx_data *dmarx = &uap->dmarx;
|
||||
struct dma_chan *rxchan = dmarx->chan;
|
||||
bool lastbuf = dmarx->use_buf_b;
|
||||
struct pl011_sgbuf *sgbuf = dmarx->use_buf_b ?
|
||||
&dmarx->sgbuf_b : &dmarx->sgbuf_a;
|
||||
struct pl011_dmabuf *dbuf = dmarx->use_buf_b ?
|
||||
&dmarx->dbuf_b : &dmarx->dbuf_a;
|
||||
size_t pending;
|
||||
struct dma_tx_state state;
|
||||
int ret;
|
||||
@@ -1020,7 +1015,7 @@ static void pl011_dma_rx_callback(void *data)
|
||||
* the DMA irq handler. So we check the residue here.
|
||||
*/
|
||||
rxchan->device->device_tx_status(rxchan, dmarx->cookie, &state);
|
||||
pending = sgbuf->sg.length - state.residue;
|
||||
pending = dbuf->len - state.residue;
|
||||
BUG_ON(pending > PL011_DMA_BUFFER_SIZE);
|
||||
/* Then we terminate the transfer - we now know our residue */
|
||||
dmaengine_terminate_all(rxchan);
|
||||
@@ -1072,16 +1067,16 @@ static void pl011_dma_rx_poll(struct timer_list *t)
|
||||
unsigned long flags;
|
||||
unsigned int dmataken = 0;
|
||||
unsigned int size = 0;
|
||||
struct pl011_sgbuf *sgbuf;
|
||||
struct pl011_dmabuf *dbuf;
|
||||
int dma_count;
|
||||
struct dma_tx_state state;
|
||||
|
||||
sgbuf = dmarx->use_buf_b ? &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
|
||||
dbuf = dmarx->use_buf_b ? &uap->dmarx.dbuf_b : &uap->dmarx.dbuf_a;
|
||||
rxchan->device->device_tx_status(rxchan, dmarx->cookie, &state);
|
||||
if (likely(state.residue < dmarx->last_residue)) {
|
||||
dmataken = sgbuf->sg.length - dmarx->last_residue;
|
||||
dmataken = dbuf->len - dmarx->last_residue;
|
||||
size = dmarx->last_residue - state.residue;
|
||||
dma_count = tty_insert_flip_string(port, sgbuf->buf + dmataken,
|
||||
dma_count = tty_insert_flip_string(port, dbuf->buf + dmataken,
|
||||
size);
|
||||
if (dma_count == size)
|
||||
dmarx->last_residue = state.residue;
|
||||
@@ -1128,7 +1123,7 @@ static void pl011_dma_startup(struct uart_amba_port *uap)
|
||||
return;
|
||||
}
|
||||
|
||||
sg_init_one(&uap->dmatx.sg, uap->dmatx.buf, PL011_DMA_BUFFER_SIZE);
|
||||
uap->dmatx.len = PL011_DMA_BUFFER_SIZE;
|
||||
|
||||
/* The DMA buffer is now the FIFO the TTY subsystem can use */
|
||||
uap->port.fifosize = PL011_DMA_BUFFER_SIZE;
|
||||
@@ -1138,7 +1133,7 @@ static void pl011_dma_startup(struct uart_amba_port *uap)
|
||||
goto skip_rx;
|
||||
|
||||
/* Allocate and map DMA RX buffers */
|
||||
ret = pl011_sgbuf_init(uap->dmarx.chan, &uap->dmarx.sgbuf_a,
|
||||
ret = pl011_dmabuf_init(uap->dmarx.chan, &uap->dmarx.dbuf_a,
|
||||
DMA_FROM_DEVICE);
|
||||
if (ret) {
|
||||
dev_err(uap->port.dev, "failed to init DMA %s: %d\n",
|
||||
@@ -1146,12 +1141,12 @@ static void pl011_dma_startup(struct uart_amba_port *uap)
|
||||
goto skip_rx;
|
||||
}
|
||||
|
||||
ret = pl011_sgbuf_init(uap->dmarx.chan, &uap->dmarx.sgbuf_b,
|
||||
ret = pl011_dmabuf_init(uap->dmarx.chan, &uap->dmarx.dbuf_b,
|
||||
DMA_FROM_DEVICE);
|
||||
if (ret) {
|
||||
dev_err(uap->port.dev, "failed to init DMA %s: %d\n",
|
||||
"RX buffer B", ret);
|
||||
pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_a,
|
||||
pl011_dmabuf_free(uap->dmarx.chan, &uap->dmarx.dbuf_a,
|
||||
DMA_FROM_DEVICE);
|
||||
goto skip_rx;
|
||||
}
|
||||
@@ -1205,8 +1200,9 @@ static void pl011_dma_shutdown(struct uart_amba_port *uap)
|
||||
/* In theory, this should already be done by pl011_dma_flush_buffer */
|
||||
dmaengine_terminate_all(uap->dmatx.chan);
|
||||
if (uap->dmatx.queued) {
|
||||
dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1,
|
||||
DMA_TO_DEVICE);
|
||||
dma_unmap_single(uap->dmatx.chan->device->dev,
|
||||
uap->dmatx.dma, uap->dmatx.len,
|
||||
DMA_TO_DEVICE);
|
||||
uap->dmatx.queued = false;
|
||||
}
|
||||
|
||||
@@ -1217,8 +1213,8 @@ static void pl011_dma_shutdown(struct uart_amba_port *uap)
|
||||
if (uap->using_rx_dma) {
|
||||
dmaengine_terminate_all(uap->dmarx.chan);
|
||||
/* Clean up the RX DMA */
|
||||
pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_a, DMA_FROM_DEVICE);
|
||||
pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_b, DMA_FROM_DEVICE);
|
||||
pl011_dmabuf_free(uap->dmarx.chan, &uap->dmarx.dbuf_a, DMA_FROM_DEVICE);
|
||||
pl011_dmabuf_free(uap->dmarx.chan, &uap->dmarx.dbuf_b, DMA_FROM_DEVICE);
|
||||
if (uap->dmarx.poll_rate)
|
||||
del_timer_sync(&uap->dmarx.timer);
|
||||
uap->using_rx_dma = false;
|
||||
|
||||
@@ -694,6 +694,18 @@ static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
|
||||
case SC16IS7XX_IIR_RTOI_SRC:
|
||||
case SC16IS7XX_IIR_XOFFI_SRC:
|
||||
rxlen = sc16is7xx_port_read(port, SC16IS7XX_RXLVL_REG);
|
||||
|
||||
/*
|
||||
* There is a silicon bug that makes the chip report a
|
||||
* time-out interrupt but no data in the FIFO. This is
|
||||
* described in errata section 18.1.4.
|
||||
*
|
||||
* When this happens, read one byte from the FIFO to
|
||||
* clear the interrupt.
|
||||
*/
|
||||
if (iir == SC16IS7XX_IIR_RTOI_SRC && !rxlen)
|
||||
rxlen = 1;
|
||||
|
||||
if (rxlen)
|
||||
sc16is7xx_handle_rx(port, rxlen, iir);
|
||||
break;
|
||||
|
||||
@@ -88,6 +88,7 @@ static void hidg_release(struct device *dev)
|
||||
{
|
||||
struct f_hidg *hidg = container_of(dev, struct f_hidg, dev);
|
||||
|
||||
kfree(hidg->report_desc);
|
||||
kfree(hidg->set_report_buf);
|
||||
kfree(hidg);
|
||||
}
|
||||
@@ -1287,9 +1288,9 @@ static struct usb_function *hidg_alloc(struct usb_function_instance *fi)
|
||||
hidg->report_length = opts->report_length;
|
||||
hidg->report_desc_length = opts->report_desc_length;
|
||||
if (opts->report_desc) {
|
||||
hidg->report_desc = devm_kmemdup(&hidg->dev, opts->report_desc,
|
||||
opts->report_desc_length,
|
||||
GFP_KERNEL);
|
||||
hidg->report_desc = kmemdup(opts->report_desc,
|
||||
opts->report_desc_length,
|
||||
GFP_KERNEL);
|
||||
if (!hidg->report_desc) {
|
||||
put_device(&hidg->dev);
|
||||
--opts->refcnt;
|
||||
|
||||
@@ -349,8 +349,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
||||
/* xHC spec requires PCI devices to support D3hot and D3cold */
|
||||
if (xhci->hci_version >= 0x120)
|
||||
xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
|
||||
else if (pdev->vendor == PCI_VENDOR_ID_AMD && xhci->hci_version >= 0x110)
|
||||
xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
|
||||
|
||||
if (xhci->quirks & XHCI_RESET_ON_RESUME)
|
||||
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
|
||||
|
||||
@@ -265,7 +265,7 @@ static void typec_altmode_put_partner(struct altmode *altmode)
|
||||
if (!partner)
|
||||
return;
|
||||
|
||||
adev = &partner->adev;
|
||||
adev = &altmode->adev;
|
||||
|
||||
if (is_typec_plug(adev->dev.parent)) {
|
||||
struct typec_plug *plug = to_typec_plug(adev->dev.parent);
|
||||
@@ -495,7 +495,8 @@ static void typec_altmode_release(struct device *dev)
|
||||
{
|
||||
struct altmode *alt = to_altmode(to_typec_altmode(dev));
|
||||
|
||||
typec_altmode_put_partner(alt);
|
||||
if (!is_typec_port(dev->parent))
|
||||
typec_altmode_put_partner(alt);
|
||||
|
||||
altmode_id_remove(alt->adev.dev.parent, alt->id);
|
||||
kfree(alt);
|
||||
|
||||
@@ -2178,13 +2178,18 @@ static int setup_cvq_vring(struct mlx5_vdpa_dev *mvdev)
|
||||
struct mlx5_control_vq *cvq = &mvdev->cvq;
|
||||
int err = 0;
|
||||
|
||||
if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ))
|
||||
if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)) {
|
||||
u16 idx = cvq->vring.last_avail_idx;
|
||||
|
||||
err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features,
|
||||
MLX5_CVQ_MAX_ENT, false,
|
||||
(struct vring_desc *)(uintptr_t)cvq->desc_addr,
|
||||
(struct vring_avail *)(uintptr_t)cvq->driver_addr,
|
||||
(struct vring_used *)(uintptr_t)cvq->device_addr);
|
||||
|
||||
if (!err)
|
||||
cvq->vring.last_avail_idx = cvq->vring.last_used_idx = idx;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -3204,7 +3204,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
|
||||
goto fail_alloc;
|
||||
}
|
||||
|
||||
btrfs_info(fs_info, "first mount of filesystem %pU", disk_super->fsid);
|
||||
/*
|
||||
* Verify the type first, if that or the checksum value are
|
||||
* corrupted, we'll find out
|
||||
|
||||
@@ -337,10 +337,7 @@ void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
|
||||
|
||||
static void btrfs_put_super(struct super_block *sb)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = btrfs_sb(sb);
|
||||
|
||||
btrfs_info(fs_info, "last unmount of filesystem %pU", fs_info->fs_devices->fsid);
|
||||
close_ctree(fs_info);
|
||||
close_ctree(btrfs_sb(sb));
|
||||
}
|
||||
|
||||
enum {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user