Merge 6.12.10 into android16-6.12
GKI (arm64) relevant 50 out of 186 changes, affecting 60 files +397/-20556c4353ce4jbd2: increase IO priority for writing revoke records [1 file, +1/-1]a5bc868610jbd2: flush filesystem device before updating tail sequence [1 file, +2/-2]7adf7df4bbiomap: pass byte granular end position to iomap_add_to_ioend [1 file, +12/-9]82c59a86a2iomap: fix zero padding data issue in concurrent append writes [2 files, +46/-1]88ecdfea1bnetfs: Fix enomem handling in buffered reads [1 file, +16/-12]2c3348864anetfs: Fix missing barriers by using clear_and_wake_up_bit() [2 files, +4/-8]43b8d3249bnetfs: Fix ceph copy to cache on write-begin [1 file, +4/-2]ba37bdfe59netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled [1 file, +4/-0]6f153055banetfs: Fix is-caching check in read-retry [2 files, +1/-2]d9ea94f5cdexfat: fix the infinite loop in exfat_readdir() [1 file, +2/-1]942c6f91abexfat: fix the new buffer was not zeroed before writing [1 file, +6/-0]0bebeb6672exfat: fix the infinite loop in __exfat_free_cluster() [1 file, +10/-0]c0f613f214fuse: respect FOPEN_KEEP_CACHE on opendir [1 file, +2/-0]668d8dea2covl: pass realinode to ovl_encode_real_fh() instead of realdentry [4 files, +12/-10]3c7c90274aovl: support encoding fid from inode with no alias [1 file, +25/-21]a3a9630d4dnet: 802: LLC+SNAP OID:PID lookup on start of skb data [1 file, +2/-2]e4a92f0d51tcp/dccp: allow a connection when sk_max_ack_backlog is zero [1 file, +1/-1]6fde663f73net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute [1 file, +2/-1]61b437faf2net: don't dump Tx and uninitialized NAPIs [1 file, +3/-2]52a24538d5ipvlan: Fix use-after-free in ipvlan_get_iflink(). [1 file, +7/-3]ccc1ef1884Bluetooth: hci_sync: Fix not setting Random Address when required [1 file, +6/-5]1f88b53135Bluetooth: MGMT: Fix Add Device to responding before completing [1 file, +36/-2]8b800ea3f3tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset [1 file, +1/-1]f559357d03netfilter: conntrack: clamp maximum hashtable size to INT_MAX [1 file, +4/-1]9f3a265836netfs: Fix kernel async DIO [1 file, +6/-1]3f545392e9netfs: Fix read-retry for fs with no ->prepare_read() [1 file, +2/-1]adcde2872ffs: relax assertions on failure to encode file handles [2 files, +3/-6]8790d511d4fs: fix is_mnt_ns_file() [1 file, +8/-2]fc89438866dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2) [1 file, +26/-14]dc63fd2e47cgroup/cpuset: Prevent leakage of isolated CPUs into sched domains [2 files, +28/-15]5b80f2fe8athermal: of: fix OF node leak in of_thermal_zone_find() [1 file, +1/-0]11cb1d643acgroup/cpuset: remove kernfs active break [1 file, +0/-25]2b30bffd9aio_uring/timeout: fix multishot updates [1 file, +3/-1]aa7496d668io_uring/sqpoll: zero sqd->thread on tctx errors [1 file, +5/-1]360596e7fetopology: Keep the cpumask unchanged when printing cpumap [1 file, +20/-4]07f09383b1tty: serial: 8250: Fix another runtime PM usage counter underflow [1 file, +3/-0]8e122d780ausb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null [1 file, +4/-4]e982fcb440USB: core: Disable LPM only for non-suspended ports [1 file, +4/-3]4fb62dea06usb: fix reference leak in usb_new_device() [1 file, +4/-2]8586d6ea62usb: typec: tcpci: fix NULL pointer issue on shared irq case [1 file, +15/-10]4bb6450bfdusb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints [1 file, +1/-0]a8b6a18b9busb: gadget: f_fs: Remove WARN_ON in functionfs_bind [1 file, +1/-1]62aa896683usb: gadget: configfs: Ignore trailing LF for user strings to cdev [1 file, +5/-1]a25f1e6f60usb: host: xhci-plat: set skip_phy_initialization if software node has XHCI_SKIP_PHY_INIT property [1 file, +2/-1]b44c99621diio: inkern: call iio_device_put() only on mapped devices [1 file, +1/-1]a7085c3ae4io_uring/eventfd: ensure io_eventfd_signal() defers another RCU period [1 file, +1/-1]bc2aeb35ffblock, bfq: fix waker_bfqq UAF after bfq_split_bfqq() [1 file, +10/-2]810aad1d7ffirewall: remove misplaced semicolon from stm32_firewall_get_firewall [1 file, +1/-1]476e4c4a1aio_uring: don't touch sqd->thread off tw add [1 file, +1/-4]b683ba0df1netdev: prevent accessing NAPI instances from another namespace [3 files, +33/-17] Changes in 6.12.10 jbd2: increase IO priority for writing revoke records jbd2: flush filesystem device before updating tail sequence fs/writeback: convert wbc_account_cgroup_owner to take a folio iomap: pass byte granular end position to iomap_add_to_ioend iomap: fix zero padding data issue in concurrent append writes dm array: fix releasing a faulty array block twice in dm_array_cursor_end dm array: fix unreleased btree blocks on closing a faulty array cursor dm array: fix cursor index when skipping across block boundaries netfs: Fix enomem handling in buffered reads nfs: Fix oops in nfs_netfs_init_request() when copying to cache netfs: Fix missing barriers by using clear_and_wake_up_bit() netfs: Fix ceph copy to cache on write-begin netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled netfs: Fix is-caching check in read-retry exfat: fix the infinite loop in exfat_readdir() exfat: fix the new buffer was not zeroed before writing exfat: fix the infinite loop in __exfat_free_cluster() fuse: respect FOPEN_KEEP_CACHE on opendir ovl: pass realinode to ovl_encode_real_fh() instead of realdentry ovl: support encoding fid from inode with no alias ASoC: rt722: add delay time to wait for the calibration procedure ASoC: mediatek: disable buffer pre-allocation selftests/alsa: Fix circular dependency involving global-timer ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe() net: 802: LLC+SNAP OID:PID lookup on start of skb data tcp/dccp: allow a connection when sk_max_ack_backlog is zero net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute net: libwx: fix firmware mailbox abnormal return btrfs: avoid NULL pointer dereference if no valid extent tree pds_core: limit loop over fw name list bnxt_en: Fix possible memory leak when hwrm_req_replace fails bnxt_en: Fix DIM shutdown cxgb4: Avoid removal of uninserted tid net: don't dump Tx and uninitialized NAPIs ice: fix max values for dpll pin phase adjust ice: fix incorrect PHY settings for 100 GB/s igc: return early when failing to read EECD register tls: Fix tls_sw_sendmsg error handling ipvlan: Fix use-after-free in ipvlan_get_iflink(). eth: gve: use appropriate helper to set xdp_features Bluetooth: hci_sync: Fix not setting Random Address when required Bluetooth: MGMT: Fix Add Device to responding before completing Bluetooth: btnxpuart: Fix driver sending truncated data Bluetooth: btmtk: Fix failed to send func ctrl for MediaTek devices. tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset net: hns3: fixed reset failure issues caused by the incorrect reset type net: hns3: fix missing features due to dev->features configuration too early net: hns3: Resolved the issue that the debugfs query result is inconsistent. net: hns3: don't auto enable misc vector net: hns3: initialize reset_timer before hclgevf_misc_irq_init() net: hns3: fixed hclge_fetch_pf_reg accesses bar space out of bounds issue net: hns3: fix kernel crash when 1588 is sent on HIP08 devices mctp i3c: fix MCTP I3C driver multi-thread issue netfilter: nf_tables: imbalance in flowtable binding netfilter: conntrack: clamp maximum hashtable size to INT_MAX sched: sch_cake: add bounds checks to host bulk flow fairness counts net: stmmac: dwmac-tegra: Read iommu stream id from device tree rtase: Fix a check for error in rtase_alloc_msix() net/mlx5: Fix variable not being completed when function returns drm/mediatek: Set private->all_drm_private[i]->drm to NULL if mtk_drm_bind returns err drm/mediatek: Move mtk_crtc_finish_page_flip() to ddp_cmdq_cb() drm/mediatek: Add support for 180-degree rotation in the display driver drm/mediatek: stop selecting foreign drivers drm/mediatek: Fix YCbCr422 color format issue for DP drm/mediatek: Fix mode valid issue for dp drm/mediatek: mtk_dsi: Add registers to pdata to fix MT8186/MT8188 gpio: virtuser: fix missing lookup table cleanups gpio: virtuser: fix handling of multiple conn_ids in lookup table drm/mediatek: Add return value check when reading DPCD ksmbd: fix a missing return value check bug afs: Fix the maximum cell name length platform/x86/amd/pmc: Only disable IRQ1 wakeup where i8042 actually enabled it platform/x86: intel/pmc: Fix ioremap() of bad address ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked riscv: module: remove relocation_head rel_entry member allocation cpuidle: riscv-sbi: fix device node release in early exit of for_each_possible_cpu riscv: mm: Fix the out of bound issue of vmemmap address riscv: stacktrace: fix backtracing through exceptions riscv: use local label names instead of global ones in assembly drm/xe: Fix tlb invalidation when wedging netfs: Fix kernel async DIO netfs: Fix read-retry for fs with no ->prepare_read() drivers/perf: riscv: Fix Platform firmware event data drivers/perf: riscv: Return error for default case dm thin: make get_first_thin use rcu-safe list first function scsi: ufs: qcom: Power off the PHY if it was already powered on in ufs_qcom_power_up_sequence() vfio/pci: Fallback huge faults for unaligned pfn fs: relax assertions on failure to encode file handles fs: fix is_mnt_ns_file() dm-ebs: don't set the flag DM_TARGET_PASSES_INTEGRITY dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2) mptcp: sysctl: avail sched: remove write access mptcp: sysctl: sched: avoid using current->nsproxy mptcp: sysctl: blackhole timeout: avoid using current->nsproxy sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy sctp: sysctl: rto_min/max: avoid using current->nsproxy sctp: sysctl: auth_enable: avoid using current->nsproxy sctp: sysctl: udp_port: avoid using current->nsproxy sctp: sysctl: plpmtud_probe_interval: avoid using current->nsproxy rds: sysctl: rds_tcp_{rcv,snd}buf: avoid using current->nsproxy ksmbd: Implement new SMB3 POSIX type btrfs: zlib: fix avail_in bytes for s390 zlib HW compression path Revert "drm/mediatek: dsi: Correct calculation formula of PHY Timing" drm/amd/display: Remove unnecessary amdgpu_irq_get/put drm/amd/display: Add check for granularity in dml ceil/floor helpers cgroup/cpuset: Prevent leakage of isolated CPUs into sched domains thermal: of: fix OF node leak in of_thermal_zone_find() sched_ext: Replace rq_lock() to raw_spin_rq_lock() in scx_ops_bypass() sched_ext: switch class when preempted by higher priority scheduler cgroup/cpuset: remove kernfs active break sched_ext: idle: Refresh idle masks during idle-to-idle transitions arm64: dts: qcom: x1e80100: Fix up BAR space size for PCIe6a arm64: dts: qcom: sa8775p: Fix the size of 'addr_space' regions smb: client: sync the root session and superblock context passwords before automounting fs: kill MNT_ONRB riscv: Fix sleeping in invalid context in die() riscv: kprobes: Fix incorrect address calculation gpio: loongson: Fix Loongson-2K2000 ACPI GPIO register offset ACPI: resource: Add TongFang GM5HG0A to irq1_edge_low_force_override[] ACPI: resource: Add Asus Vivobook X1504VAP to irq1_level_low_skip_override[] drm/amdgpu: Add a lock when accessing the buddy trim function drm/amd/pm: fix BUG: scheduling while atomic drm/amdkfd: fixed page fault when enable MES shader debugger drm/amdkfd: wq_release signals dma_fence only when available drm/amd/display: fix divide error in DM plane scale calcs drm/amd/display: fix page fault due to max surface definition mismatch drm/amd/display: increase MAX_SURFACES to the value supported by hw io_uring/timeout: fix multishot updates io_uring/sqpoll: zero sqd->thread on tctx errors USB: serial: option: add MeiG Smart SRM815 USB: serial: option: add Neoway N723-EA support staging: iio: ad9834: Correct phase range check staging: iio: ad9832: Correct phase range check usb-storage: Add max sectors quirk for Nokia 208 USB: serial: cp210x: add Phoenix Contact UPS Device usb: dwc3: gadget: fix writing NYET threshold topology: Keep the cpumask unchanged when printing cpumap misc: microchip: pci1xxxx: Resolve kernel panic during GPIO IRQ handling misc: microchip: pci1xxxx: Resolve return code mismatch during GPIO set config tty: serial: 8250: Fix another runtime PM usage counter underflow serial: stm32: use port lock wrappers for break control usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null x86/fpu: Ensure shadow stack is active before "getting" registers usb: dwc3-am62: Disable autosuspend during remove USB: usblp: return error when setting unsupported protocol USB: core: Disable LPM only for non-suspended ports usb: fix reference leak in usb_new_device() usb: gadget: midi2: Reverse-select at the right place usb: chipidea: ci_hdrc_imx: decrement device's refcount in .remove() and in the error path of .probe() usb: typec: tcpci: fix NULL pointer issue on shared irq case usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints usb: typec: tcpm/tcpci_maxim: fix error code in max_contaminant_read_resistance_kohm() usb: gadget: f_fs: Remove WARN_ON in functionfs_bind usb: gadget: configfs: Ignore trailing LF for user strings to cdev usb: host: xhci-plat: set skip_phy_initialization if software node has XHCI_SKIP_PHY_INIT property usb: typec: fix pm usage counter imbalance in ucsi_ccg_sync_control() iio: pressure: zpa2326: fix information leak in triggered buffer iio: dummy: iio_simply_dummy_buffer: fix information leak in triggered buffer iio: light: vcnl4035: fix information leak in triggered buffer iio: light: bh1745: fix information leak in triggered buffer iio: imu: kmx61: fix information leak in triggered buffer iio: adc: rockchip_saradc: fix information leak in triggered buffer iio: adc: ti-ads8688: fix information leak in triggered buffer iio: adc: ti-ads1119: fix information leak in triggered buffer iio: adc: ti-ads1119: fix sample size in scan struct for triggered buffer iio: gyro: fxas21002c: Fix missing data update in trigger handler iio: adc: ti-ads1298: Add NULL check in ads1298_init iio: imu: inv_icm42600: fix timestamps after suspend if sensor is on iio: adc: ti-ads124s08: Use gpiod_set_value_cansleep() iio: adc: at91: call input_free_device() on allocated iio_dev iio: inkern: call iio_device_put() only on mapped devices iio: adc: ad7173: fix using shared static info struct iio: adc: ad7124: Disable all channels at probe time io_uring/eventfd: ensure io_eventfd_signal() defers another RCU period arm64: dts: imx95: correct the address length of netcmix_blk_ctrl ARM: dts: imxrt1050: Fix clocks for mmc arm64: dts: qcom: sa8775p: fix the secure device bootup issue hwmon: (drivetemp) Fix driver producing garbage data when SCSI errors occur block, bfq: fix waker_bfqq UAF after bfq_split_bfqq() arm64: dts: rockchip: add hevc power domain clock to rk3328 firewall: remove misplaced semicolon from stm32_firewall_get_firewall drm/mediatek: Only touch DISP_REG_OVL_PITCH_MSB if AFBC is supported io_uring: don't touch sqd->thread off tw add iio: imu: inv_icm42600: fix spi burst write not supported netdev: prevent accessing NAPI instances from another namespace Linux 6.12.10 Change-Id: Ie2f94fe090d61be2389c21427b56a19ec5f88bd6 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -2954,7 +2954,7 @@ following two functions.
|
||||
a queue (device) has been associated with the bio and
|
||||
before submission.
|
||||
|
||||
wbc_account_cgroup_owner(@wbc, @page, @bytes)
|
||||
wbc_account_cgroup_owner(@wbc, @folio, @bytes)
|
||||
Should be called for each data segment being written out.
|
||||
While this function doesn't care exactly when it's called
|
||||
during the writeback session, it's the easiest and most
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 6
|
||||
PATCHLEVEL = 12
|
||||
SUBLEVEL = 9
|
||||
SUBLEVEL = 10
|
||||
EXTRAVERSION =
|
||||
NAME = Baby Opossum Posse
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
reg = <0x402c0000 0x4000>;
|
||||
interrupts = <110>;
|
||||
clocks = <&clks IMXRT1050_CLK_IPG_PDOF>,
|
||||
<&clks IMXRT1050_CLK_OSC>,
|
||||
<&clks IMXRT1050_CLK_AHB_PODF>,
|
||||
<&clks IMXRT1050_CLK_USDHC1>;
|
||||
clock-names = "ipg", "ahb", "per";
|
||||
bus-width = <4>;
|
||||
|
||||
@@ -1609,7 +1609,7 @@
|
||||
|
||||
netcmix_blk_ctrl: syscon@4c810000 {
|
||||
compatible = "nxp,imx95-netcmix-blk-ctrl", "syscon";
|
||||
reg = <0x0 0x4c810000 0x0 0x10000>;
|
||||
reg = <0x0 0x4c810000 0x0 0x8>;
|
||||
#clock-cells = <1>;
|
||||
clocks = <&scmi_clk IMX95_CLK_BUSNETCMIX>;
|
||||
assigned-clocks = <&scmi_clk IMX95_CLK_BUSNETCMIX>;
|
||||
|
||||
@@ -1940,6 +1940,7 @@
|
||||
|
||||
qcom,cmb-element-bits = <32>;
|
||||
qcom,cmb-msrs-num = <32>;
|
||||
status = "disabled";
|
||||
|
||||
out-ports {
|
||||
port {
|
||||
@@ -5587,7 +5588,7 @@
|
||||
<0x0 0x40000000 0x0 0xf20>,
|
||||
<0x0 0x40000f20 0x0 0xa8>,
|
||||
<0x0 0x40001000 0x0 0x4000>,
|
||||
<0x0 0x40200000 0x0 0x100000>,
|
||||
<0x0 0x40200000 0x0 0x1fe00000>,
|
||||
<0x0 0x01c03000 0x0 0x1000>,
|
||||
<0x0 0x40005000 0x0 0x2000>;
|
||||
reg-names = "parf", "dbi", "elbi", "atu", "addr_space",
|
||||
@@ -5744,7 +5745,7 @@
|
||||
<0x0 0x60000000 0x0 0xf20>,
|
||||
<0x0 0x60000f20 0x0 0xa8>,
|
||||
<0x0 0x60001000 0x0 0x4000>,
|
||||
<0x0 0x60200000 0x0 0x100000>,
|
||||
<0x0 0x60200000 0x0 0x1fe00000>,
|
||||
<0x0 0x01c13000 0x0 0x1000>,
|
||||
<0x0 0x60005000 0x0 0x2000>;
|
||||
reg-names = "parf", "dbi", "elbi", "atu", "addr_space",
|
||||
|
||||
@@ -2925,7 +2925,7 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x0 0x70200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x70300000 0x0 0x70300000 0x0 0x1d00000>;
|
||||
<0x02000000 0x0 0x70300000 0x0 0x70300000 0x0 0x3d00000>;
|
||||
bus-range = <0x00 0xff>;
|
||||
|
||||
dma-coherent;
|
||||
|
||||
@@ -333,6 +333,7 @@
|
||||
|
||||
power-domain@RK3328_PD_HEVC {
|
||||
reg = <RK3328_PD_HEVC>;
|
||||
clocks = <&cru SCLK_VENC_CORE>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@RK3328_PD_VIDEO {
|
||||
|
||||
@@ -124,6 +124,7 @@ struct kernel_mapping {
|
||||
|
||||
extern struct kernel_mapping kernel_map;
|
||||
extern phys_addr_t phys_ram_base;
|
||||
extern unsigned long vmemmap_start_pfn;
|
||||
|
||||
#define is_kernel_mapping(x) \
|
||||
((x) >= kernel_map.virt_addr && (x) < (kernel_map.virt_addr + kernel_map.size))
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
* Define vmemmap for pfn_to_page & page_to_pfn calls. Needed if kernel
|
||||
* is configured with CONFIG_SPARSEMEM_VMEMMAP enabled.
|
||||
*/
|
||||
#define vmemmap ((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT))
|
||||
#define vmemmap ((struct page *)VMEMMAP_START - vmemmap_start_pfn)
|
||||
|
||||
#define PCI_IO_SIZE SZ_16M
|
||||
#define PCI_IO_END VMEMMAP_START
|
||||
|
||||
@@ -158,6 +158,7 @@ struct riscv_pmu_snapshot_data {
|
||||
};
|
||||
|
||||
#define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(47, 0)
|
||||
#define RISCV_PMU_PLAT_FW_EVENT_MASK GENMASK_ULL(61, 0)
|
||||
#define RISCV_PMU_RAW_EVENT_IDX 0x20000
|
||||
#define RISCV_PLAT_FW_EVENT 0xFFFF
|
||||
|
||||
|
||||
+11
-10
@@ -23,21 +23,21 @@
|
||||
REG_S a0, TASK_TI_A0(tp)
|
||||
csrr a0, CSR_CAUSE
|
||||
/* Exclude IRQs */
|
||||
blt a0, zero, _new_vmalloc_restore_context_a0
|
||||
blt a0, zero, .Lnew_vmalloc_restore_context_a0
|
||||
|
||||
REG_S a1, TASK_TI_A1(tp)
|
||||
/* Only check new_vmalloc if we are in page/protection fault */
|
||||
li a1, EXC_LOAD_PAGE_FAULT
|
||||
beq a0, a1, _new_vmalloc_kernel_address
|
||||
beq a0, a1, .Lnew_vmalloc_kernel_address
|
||||
li a1, EXC_STORE_PAGE_FAULT
|
||||
beq a0, a1, _new_vmalloc_kernel_address
|
||||
beq a0, a1, .Lnew_vmalloc_kernel_address
|
||||
li a1, EXC_INST_PAGE_FAULT
|
||||
bne a0, a1, _new_vmalloc_restore_context_a1
|
||||
bne a0, a1, .Lnew_vmalloc_restore_context_a1
|
||||
|
||||
_new_vmalloc_kernel_address:
|
||||
.Lnew_vmalloc_kernel_address:
|
||||
/* Is it a kernel address? */
|
||||
csrr a0, CSR_TVAL
|
||||
bge a0, zero, _new_vmalloc_restore_context_a1
|
||||
bge a0, zero, .Lnew_vmalloc_restore_context_a1
|
||||
|
||||
/* Check if a new vmalloc mapping appeared that could explain the trap */
|
||||
REG_S a2, TASK_TI_A2(tp)
|
||||
@@ -69,7 +69,7 @@ _new_vmalloc_kernel_address:
|
||||
/* Check the value of new_vmalloc for this cpu */
|
||||
REG_L a2, 0(a0)
|
||||
and a2, a2, a1
|
||||
beq a2, zero, _new_vmalloc_restore_context
|
||||
beq a2, zero, .Lnew_vmalloc_restore_context
|
||||
|
||||
/* Atomically reset the current cpu bit in new_vmalloc */
|
||||
amoxor.d a0, a1, (a0)
|
||||
@@ -83,11 +83,11 @@ _new_vmalloc_kernel_address:
|
||||
csrw CSR_SCRATCH, x0
|
||||
sret
|
||||
|
||||
_new_vmalloc_restore_context:
|
||||
.Lnew_vmalloc_restore_context:
|
||||
REG_L a2, TASK_TI_A2(tp)
|
||||
_new_vmalloc_restore_context_a1:
|
||||
.Lnew_vmalloc_restore_context_a1:
|
||||
REG_L a1, TASK_TI_A1(tp)
|
||||
_new_vmalloc_restore_context_a0:
|
||||
.Lnew_vmalloc_restore_context_a0:
|
||||
REG_L a0, TASK_TI_A0(tp)
|
||||
.endm
|
||||
|
||||
@@ -278,6 +278,7 @@ SYM_CODE_START_NOALIGN(ret_from_exception)
|
||||
#else
|
||||
sret
|
||||
#endif
|
||||
SYM_INNER_LABEL(ret_from_exception_end, SYM_L_GLOBAL)
|
||||
SYM_CODE_END(ret_from_exception)
|
||||
ASM_NOKPROBE(ret_from_exception)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ struct used_bucket {
|
||||
|
||||
struct relocation_head {
|
||||
struct hlist_node node;
|
||||
struct list_head *rel_entry;
|
||||
struct list_head rel_entry;
|
||||
void *location;
|
||||
};
|
||||
|
||||
@@ -634,7 +634,7 @@ process_accumulated_relocations(struct module *me,
|
||||
location = rel_head_iter->location;
|
||||
list_for_each_entry_safe(rel_entry_iter,
|
||||
rel_entry_iter_tmp,
|
||||
rel_head_iter->rel_entry,
|
||||
&rel_head_iter->rel_entry,
|
||||
head) {
|
||||
curr_type = rel_entry_iter->type;
|
||||
reloc_handlers[curr_type].reloc_handler(
|
||||
@@ -704,16 +704,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rel_head->rel_entry =
|
||||
kmalloc(sizeof(struct list_head), GFP_KERNEL);
|
||||
|
||||
if (!rel_head->rel_entry) {
|
||||
kfree(entry);
|
||||
kfree(rel_head);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(rel_head->rel_entry);
|
||||
INIT_LIST_HEAD(&rel_head->rel_entry);
|
||||
rel_head->location = location;
|
||||
INIT_HLIST_NODE(&rel_head->node);
|
||||
if (!current_head->first) {
|
||||
@@ -722,7 +713,6 @@ static int add_relocation_to_accumulate(struct module *me, int type,
|
||||
|
||||
if (!bucket) {
|
||||
kfree(entry);
|
||||
kfree(rel_head->rel_entry);
|
||||
kfree(rel_head);
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -735,7 +725,7 @@ static int add_relocation_to_accumulate(struct module *me, int type,
|
||||
}
|
||||
|
||||
/* Add relocation to head of discovered rel_head */
|
||||
list_add_tail(&entry->head, rel_head->rel_entry);
|
||||
list_add_tail(&entry->head, &rel_head->rel_entry);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ static void __kprobes arch_prepare_ss_slot(struct kprobe *p)
|
||||
p->ainsn.api.restore = (unsigned long)p->addr + len;
|
||||
|
||||
patch_text_nosync(p->ainsn.api.insn, &p->opcode, len);
|
||||
patch_text_nosync(p->ainsn.api.insn + len, &insn, GET_INSN_LENGTH(insn));
|
||||
patch_text_nosync((void *)p->ainsn.api.insn + len, &insn, GET_INSN_LENGTH(insn));
|
||||
}
|
||||
|
||||
static void __kprobes arch_prepare_simulate(struct kprobe *p)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifdef CONFIG_FRAME_POINTER
|
||||
|
||||
extern asmlinkage void handle_exception(void);
|
||||
extern unsigned long ret_from_exception_end;
|
||||
|
||||
static inline int fp_is_valid(unsigned long fp, unsigned long sp)
|
||||
{
|
||||
@@ -71,7 +72,8 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
||||
fp = frame->fp;
|
||||
pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra,
|
||||
&frame->ra);
|
||||
if (pc == (unsigned long)handle_exception) {
|
||||
if (pc >= (unsigned long)handle_exception &&
|
||||
pc < (unsigned long)&ret_from_exception_end) {
|
||||
if (unlikely(!__kernel_text_address(pc) || !fn(arg, pc)))
|
||||
break;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
int show_unhandled_signals = 1;
|
||||
|
||||
static DEFINE_SPINLOCK(die_lock);
|
||||
static DEFINE_RAW_SPINLOCK(die_lock);
|
||||
|
||||
static int copy_code(struct pt_regs *regs, u16 *val, const u16 *insns)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ void die(struct pt_regs *regs, const char *str)
|
||||
|
||||
oops_enter();
|
||||
|
||||
spin_lock_irqsave(&die_lock, flags);
|
||||
raw_spin_lock_irqsave(&die_lock, flags);
|
||||
console_verbose();
|
||||
bust_spinlocks(1);
|
||||
|
||||
@@ -100,7 +100,7 @@ void die(struct pt_regs *regs, const char *str)
|
||||
|
||||
bust_spinlocks(0);
|
||||
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
|
||||
spin_unlock_irqrestore(&die_lock, flags);
|
||||
raw_spin_unlock_irqrestore(&die_lock, flags);
|
||||
oops_exit();
|
||||
|
||||
if (in_interrupt())
|
||||
|
||||
+16
-1
@@ -33,6 +33,7 @@
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/soc.h>
|
||||
#include <asm/sparsemem.h>
|
||||
#include <asm/tlbflush.h>
|
||||
|
||||
#include "../kernel/head.h"
|
||||
@@ -62,6 +63,13 @@ EXPORT_SYMBOL(pgtable_l5_enabled);
|
||||
phys_addr_t phys_ram_base __ro_after_init;
|
||||
EXPORT_SYMBOL(phys_ram_base);
|
||||
|
||||
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
||||
#define VMEMMAP_ADDR_ALIGN (1ULL << SECTION_SIZE_BITS)
|
||||
|
||||
unsigned long vmemmap_start_pfn __ro_after_init;
|
||||
EXPORT_SYMBOL(vmemmap_start_pfn);
|
||||
#endif
|
||||
|
||||
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]
|
||||
__page_aligned_bss;
|
||||
EXPORT_SYMBOL(empty_zero_page);
|
||||
@@ -240,8 +248,12 @@ static void __init setup_bootmem(void)
|
||||
* Make sure we align the start of the memory on a PMD boundary so that
|
||||
* at worst, we map the linear mapping with PMD mappings.
|
||||
*/
|
||||
if (!IS_ENABLED(CONFIG_XIP_KERNEL))
|
||||
if (!IS_ENABLED(CONFIG_XIP_KERNEL)) {
|
||||
phys_ram_base = memblock_start_of_DRAM() & PMD_MASK;
|
||||
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
||||
vmemmap_start_pfn = round_down(phys_ram_base, VMEMMAP_ADDR_ALIGN) >> PAGE_SHIFT;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* In 64-bit, any use of __va/__pa before this point is wrong as we
|
||||
@@ -1101,6 +1113,9 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
|
||||
kernel_map.xiprom_sz = (uintptr_t)(&_exiprom) - (uintptr_t)(&_xiprom);
|
||||
|
||||
phys_ram_base = CONFIG_PHYS_RAM_BASE;
|
||||
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
||||
vmemmap_start_pfn = round_down(phys_ram_base, VMEMMAP_ADDR_ALIGN) >> PAGE_SHIFT;
|
||||
#endif
|
||||
kernel_map.phys_addr = (uintptr_t)CONFIG_PHYS_RAM_BASE;
|
||||
kernel_map.size = (uintptr_t)(&_end) - (uintptr_t)(&_start);
|
||||
|
||||
|
||||
@@ -190,7 +190,8 @@ int ssp_get(struct task_struct *target, const struct user_regset *regset,
|
||||
struct fpu *fpu = &target->thread.fpu;
|
||||
struct cet_user_state *cetregs;
|
||||
|
||||
if (!cpu_feature_enabled(X86_FEATURE_USER_SHSTK))
|
||||
if (!cpu_feature_enabled(X86_FEATURE_USER_SHSTK) ||
|
||||
!ssp_active(target, regset))
|
||||
return -ENODEV;
|
||||
|
||||
sync_fpstate(fpu);
|
||||
|
||||
+10
-2
@@ -6844,16 +6844,24 @@ static struct bfq_queue *bfq_waker_bfqq(struct bfq_queue *bfqq)
|
||||
if (new_bfqq == waker_bfqq) {
|
||||
/*
|
||||
* If waker_bfqq is in the merge chain, and current
|
||||
* is the only procress.
|
||||
* is the only process, waker_bfqq can be freed.
|
||||
*/
|
||||
if (bfqq_process_refs(waker_bfqq) == 1)
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
return waker_bfqq;
|
||||
}
|
||||
|
||||
new_bfqq = new_bfqq->new_bfqq;
|
||||
}
|
||||
|
||||
/*
|
||||
* If waker_bfqq is not in the merge chain, and it's procress reference
|
||||
* is 0, waker_bfqq can be freed.
|
||||
*/
|
||||
if (bfqq_process_refs(waker_bfqq) == 0)
|
||||
return NULL;
|
||||
|
||||
return waker_bfqq;
|
||||
}
|
||||
|
||||
|
||||
@@ -440,6 +440,13 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Asus Vivobook X1504VAP */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "X1504VAP"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Asus Vivobook X1704VAP */
|
||||
.matches = {
|
||||
@@ -646,6 +653,17 @@ static const struct dmi_system_id irq1_edge_low_force_override[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* TongFang GM5HG0A in case of the SKIKK Vanaheim relabel the
|
||||
* board-name is changed, so check OEM strings instead. Note
|
||||
* OEM string matches are always exact matches.
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=219614
|
||||
*/
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_OEM_STRING, "GM5HG0A"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
+20
-4
@@ -27,9 +27,17 @@ static ssize_t name##_read(struct file *file, struct kobject *kobj, \
|
||||
loff_t off, size_t count) \
|
||||
{ \
|
||||
struct device *dev = kobj_to_dev(kobj); \
|
||||
cpumask_var_t mask; \
|
||||
ssize_t n; \
|
||||
\
|
||||
return cpumap_print_bitmask_to_buf(buf, topology_##mask(dev->id), \
|
||||
off, count); \
|
||||
if (!alloc_cpumask_var(&mask, GFP_KERNEL)) \
|
||||
return -ENOMEM; \
|
||||
\
|
||||
cpumask_copy(mask, topology_##mask(dev->id)); \
|
||||
n = cpumap_print_bitmask_to_buf(buf, mask, off, count); \
|
||||
free_cpumask_var(mask); \
|
||||
\
|
||||
return n; \
|
||||
} \
|
||||
\
|
||||
static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \
|
||||
@@ -37,9 +45,17 @@ static ssize_t name##_list_read(struct file *file, struct kobject *kobj, \
|
||||
loff_t off, size_t count) \
|
||||
{ \
|
||||
struct device *dev = kobj_to_dev(kobj); \
|
||||
cpumask_var_t mask; \
|
||||
ssize_t n; \
|
||||
\
|
||||
return cpumap_print_list_to_buf(buf, topology_##mask(dev->id), \
|
||||
off, count); \
|
||||
if (!alloc_cpumask_var(&mask, GFP_KERNEL)) \
|
||||
return -ENOMEM; \
|
||||
\
|
||||
cpumask_copy(mask, topology_##mask(dev->id)); \
|
||||
n = cpumap_print_list_to_buf(buf, mask, off, count); \
|
||||
free_cpumask_var(mask); \
|
||||
\
|
||||
return n; \
|
||||
}
|
||||
|
||||
define_id_show_func(physical_package_id, "%d");
|
||||
|
||||
@@ -1472,10 +1472,15 @@ EXPORT_SYMBOL_GPL(btmtk_usb_setup);
|
||||
|
||||
int btmtk_usb_shutdown(struct hci_dev *hdev)
|
||||
{
|
||||
struct btmtk_data *data = hci_get_priv(hdev);
|
||||
struct btmtk_hci_wmt_params wmt_params;
|
||||
u8 param = 0;
|
||||
int err;
|
||||
|
||||
err = usb_autopm_get_interface(data->intf);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
/* Disable the device */
|
||||
wmt_params.op = BTMTK_WMT_FUNC_CTRL;
|
||||
wmt_params.flag = 0;
|
||||
@@ -1486,9 +1491,11 @@ int btmtk_usb_shutdown(struct hci_dev *hdev)
|
||||
err = btmtk_usb_hci_wmt_sync(hdev, &wmt_params);
|
||||
if (err < 0) {
|
||||
bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
|
||||
usb_autopm_put_interface(data->intf);
|
||||
return err;
|
||||
}
|
||||
|
||||
usb_autopm_put_interface(data->intf);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(btmtk_usb_shutdown);
|
||||
|
||||
@@ -1336,6 +1336,7 @@ static void btnxpuart_tx_work(struct work_struct *work)
|
||||
|
||||
while ((skb = nxp_dequeue(nxpdev))) {
|
||||
len = serdev_device_write_buf(serdev, skb->data, skb->len);
|
||||
serdev_device_wait_until_sent(serdev, 0);
|
||||
hdev->stat.byte_tx += len;
|
||||
|
||||
skb_pull(skb, len);
|
||||
|
||||
@@ -500,12 +500,12 @@ static int sbi_cpuidle_probe(struct platform_device *pdev)
|
||||
int cpu, ret;
|
||||
struct cpuidle_driver *drv;
|
||||
struct cpuidle_device *dev;
|
||||
struct device_node *np, *pds_node;
|
||||
struct device_node *pds_node;
|
||||
|
||||
/* Detect OSI support based on CPU DT nodes */
|
||||
sbi_cpuidle_use_osi = true;
|
||||
for_each_possible_cpu(cpu) {
|
||||
np = of_cpu_device_node_get(cpu);
|
||||
struct device_node *np __free(device_node) = of_cpu_device_node_get(cpu);
|
||||
if (np &&
|
||||
of_property_present(np, "power-domains") &&
|
||||
of_property_present(np, "power-domain-names")) {
|
||||
|
||||
@@ -237,9 +237,9 @@ static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data1 = {
|
||||
static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data2 = {
|
||||
.label = "ls2k2000_gpio",
|
||||
.mode = BIT_CTRL_MODE,
|
||||
.conf_offset = 0x84,
|
||||
.in_offset = 0x88,
|
||||
.out_offset = 0x80,
|
||||
.conf_offset = 0x4,
|
||||
.in_offset = 0x8,
|
||||
.out_offset = 0x0,
|
||||
};
|
||||
|
||||
static const struct loongson_gpio_chip_data loongson_gpio_ls3a5000_data = {
|
||||
|
||||
@@ -1410,7 +1410,7 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
|
||||
size_t num_entries = gpio_virtuser_get_lookup_count(dev);
|
||||
struct gpio_virtuser_lookup_entry *entry;
|
||||
struct gpio_virtuser_lookup *lookup;
|
||||
unsigned int i = 0;
|
||||
unsigned int i = 0, idx;
|
||||
|
||||
lockdep_assert_held(&dev->lock);
|
||||
|
||||
@@ -1424,12 +1424,12 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
|
||||
return -ENOMEM;
|
||||
|
||||
list_for_each_entry(lookup, &dev->lookup_list, siblings) {
|
||||
idx = 0;
|
||||
list_for_each_entry(entry, &lookup->entry_list, siblings) {
|
||||
table->table[i] =
|
||||
table->table[i++] =
|
||||
GPIO_LOOKUP_IDX(entry->key,
|
||||
entry->offset < 0 ? U16_MAX : entry->offset,
|
||||
lookup->con_id, i, entry->flags);
|
||||
i++;
|
||||
lookup->con_id, idx++, entry->flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1439,6 +1439,15 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gpio_virtuser_remove_lookup_table(struct gpio_virtuser_device *dev)
|
||||
{
|
||||
gpiod_remove_lookup_table(dev->lookup_table);
|
||||
kfree(dev->lookup_table->dev_id);
|
||||
kfree(dev->lookup_table);
|
||||
dev->lookup_table = NULL;
|
||||
}
|
||||
|
||||
static struct fwnode_handle *
|
||||
gpio_virtuser_make_device_swnode(struct gpio_virtuser_device *dev)
|
||||
{
|
||||
@@ -1487,10 +1496,8 @@ gpio_virtuser_device_activate(struct gpio_virtuser_device *dev)
|
||||
pdevinfo.fwnode = swnode;
|
||||
|
||||
ret = gpio_virtuser_make_lookup_table(dev);
|
||||
if (ret) {
|
||||
fwnode_remove_software_node(swnode);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto err_remove_swnode;
|
||||
|
||||
reinit_completion(&dev->probe_completion);
|
||||
dev->driver_bound = false;
|
||||
@@ -1498,23 +1505,31 @@ gpio_virtuser_device_activate(struct gpio_virtuser_device *dev)
|
||||
|
||||
pdev = platform_device_register_full(&pdevinfo);
|
||||
if (IS_ERR(pdev)) {
|
||||
ret = PTR_ERR(pdev);
|
||||
bus_unregister_notifier(&platform_bus_type, &dev->bus_notifier);
|
||||
fwnode_remove_software_node(swnode);
|
||||
return PTR_ERR(pdev);
|
||||
goto err_remove_lookup_table;
|
||||
}
|
||||
|
||||
wait_for_completion(&dev->probe_completion);
|
||||
bus_unregister_notifier(&platform_bus_type, &dev->bus_notifier);
|
||||
|
||||
if (!dev->driver_bound) {
|
||||
platform_device_unregister(pdev);
|
||||
fwnode_remove_software_node(swnode);
|
||||
return -ENXIO;
|
||||
ret = -ENXIO;
|
||||
goto err_unregister_pdev;
|
||||
}
|
||||
|
||||
dev->pdev = pdev;
|
||||
|
||||
return 0;
|
||||
|
||||
err_unregister_pdev:
|
||||
platform_device_unregister(pdev);
|
||||
err_remove_lookup_table:
|
||||
gpio_virtuser_remove_lookup_table(dev);
|
||||
err_remove_swnode:
|
||||
fwnode_remove_software_node(swnode);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1526,10 +1541,9 @@ gpio_virtuser_device_deactivate(struct gpio_virtuser_device *dev)
|
||||
|
||||
swnode = dev_fwnode(&dev->pdev->dev);
|
||||
platform_device_unregister(dev->pdev);
|
||||
gpio_virtuser_remove_lookup_table(dev);
|
||||
fwnode_remove_software_node(swnode);
|
||||
dev->pdev = NULL;
|
||||
gpiod_remove_lookup_table(dev->lookup_table);
|
||||
kfree(dev->lookup_table);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
||||
@@ -567,7 +567,6 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
|
||||
else
|
||||
remaining_size -= size;
|
||||
}
|
||||
mutex_unlock(&mgr->lock);
|
||||
|
||||
if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS && adjust_dcc_size) {
|
||||
struct drm_buddy_block *dcc_block;
|
||||
@@ -584,6 +583,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
|
||||
(u64)vres->base.size,
|
||||
&vres->blocks);
|
||||
}
|
||||
mutex_unlock(&mgr->lock);
|
||||
|
||||
vres->base.start = 0;
|
||||
size = max_t(u64, amdgpu_vram_mgr_blocks_size(&vres->blocks),
|
||||
|
||||
@@ -350,10 +350,27 @@ int kfd_dbg_set_mes_debug_mode(struct kfd_process_device *pdd, bool sq_trap_en)
|
||||
{
|
||||
uint32_t spi_dbg_cntl = pdd->spi_dbg_override | pdd->spi_dbg_launch_mode;
|
||||
uint32_t flags = pdd->process->dbg_flags;
|
||||
struct amdgpu_device *adev = pdd->dev->adev;
|
||||
int r;
|
||||
|
||||
if (!kfd_dbg_is_per_vmid_supported(pdd->dev))
|
||||
return 0;
|
||||
|
||||
if (!pdd->proc_ctx_cpu_ptr) {
|
||||
r = amdgpu_amdkfd_alloc_gtt_mem(adev,
|
||||
AMDGPU_MES_PROC_CTX_SIZE,
|
||||
&pdd->proc_ctx_bo,
|
||||
&pdd->proc_ctx_gpu_addr,
|
||||
&pdd->proc_ctx_cpu_ptr,
|
||||
false);
|
||||
if (r) {
|
||||
dev_err(adev->dev,
|
||||
"failed to allocate process context bo\n");
|
||||
return r;
|
||||
}
|
||||
memset(pdd->proc_ctx_cpu_ptr, 0, AMDGPU_MES_PROC_CTX_SIZE);
|
||||
}
|
||||
|
||||
return amdgpu_mes_set_shader_debugger(pdd->dev->adev, pdd->proc_ctx_gpu_addr, spi_dbg_cntl,
|
||||
pdd->watch_points, flags, sq_trap_en);
|
||||
}
|
||||
|
||||
@@ -1160,7 +1160,8 @@ static void kfd_process_wq_release(struct work_struct *work)
|
||||
*/
|
||||
synchronize_rcu();
|
||||
ef = rcu_access_pointer(p->ef);
|
||||
dma_fence_signal(ef);
|
||||
if (ef)
|
||||
dma_fence_signal(ef);
|
||||
|
||||
kfd_process_remove_sysfs(p);
|
||||
|
||||
|
||||
@@ -8393,16 +8393,6 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
|
||||
struct amdgpu_crtc *acrtc,
|
||||
struct dm_crtc_state *acrtc_state)
|
||||
{
|
||||
/*
|
||||
* We have no guarantee that the frontend index maps to the same
|
||||
* backend index - some even map to more than one.
|
||||
*
|
||||
* TODO: Use a different interrupt or check DC itself for the mapping.
|
||||
*/
|
||||
int irq_type =
|
||||
amdgpu_display_crtc_idx_to_irq_type(
|
||||
adev,
|
||||
acrtc->crtc_id);
|
||||
struct drm_vblank_crtc_config config = {0};
|
||||
struct dc_crtc_timing *timing;
|
||||
int offdelay;
|
||||
@@ -8428,28 +8418,7 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
|
||||
|
||||
drm_crtc_vblank_on_config(&acrtc->base,
|
||||
&config);
|
||||
|
||||
amdgpu_irq_get(
|
||||
adev,
|
||||
&adev->pageflip_irq,
|
||||
irq_type);
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
amdgpu_irq_get(
|
||||
adev,
|
||||
&adev->vline0_irq,
|
||||
irq_type);
|
||||
#endif
|
||||
} else {
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
amdgpu_irq_put(
|
||||
adev,
|
||||
&adev->vline0_irq,
|
||||
irq_type);
|
||||
#endif
|
||||
amdgpu_irq_put(
|
||||
adev,
|
||||
&adev->pageflip_irq,
|
||||
irq_type);
|
||||
drm_crtc_vblank_off(&acrtc->base);
|
||||
}
|
||||
}
|
||||
@@ -11146,8 +11115,8 @@ dm_get_plane_scale(struct drm_plane_state *plane_state,
|
||||
int plane_src_w, plane_src_h;
|
||||
|
||||
dm_get_oriented_plane_size(plane_state, &plane_src_w, &plane_src_h);
|
||||
*out_plane_scale_w = plane_state->crtc_w * 1000 / plane_src_w;
|
||||
*out_plane_scale_h = plane_state->crtc_h * 1000 / plane_src_h;
|
||||
*out_plane_scale_w = plane_src_w ? plane_state->crtc_w * 1000 / plane_src_w : 0;
|
||||
*out_plane_scale_h = plane_src_h ? plane_state->crtc_h * 1000 / plane_src_h : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -4421,7 +4421,7 @@ static bool commit_minimal_transition_based_on_current_context(struct dc *dc,
|
||||
struct pipe_split_policy_backup policy;
|
||||
struct dc_state *intermediate_context;
|
||||
struct dc_state *old_current_state = dc->current_state;
|
||||
struct dc_surface_update srf_updates[MAX_SURFACE_NUM] = {0};
|
||||
struct dc_surface_update srf_updates[MAX_SURFACES] = {0};
|
||||
int surface_count;
|
||||
|
||||
/*
|
||||
|
||||
@@ -483,9 +483,9 @@ bool dc_state_add_plane(
|
||||
if (stream_status == NULL) {
|
||||
dm_error("Existing stream not found; failed to attach surface!\n");
|
||||
goto out;
|
||||
} else if (stream_status->plane_count == MAX_SURFACE_NUM) {
|
||||
} else if (stream_status->plane_count == MAX_SURFACES) {
|
||||
dm_error("Surface: can not attach plane_state %p! Maximum is: %d\n",
|
||||
plane_state, MAX_SURFACE_NUM);
|
||||
plane_state, MAX_SURFACES);
|
||||
goto out;
|
||||
} else if (!otg_master_pipe) {
|
||||
goto out;
|
||||
@@ -600,7 +600,7 @@ bool dc_state_rem_all_planes_for_stream(
|
||||
{
|
||||
int i, old_plane_count;
|
||||
struct dc_stream_status *stream_status = NULL;
|
||||
struct dc_plane_state *del_planes[MAX_SURFACE_NUM] = { 0 };
|
||||
struct dc_plane_state *del_planes[MAX_SURFACES] = { 0 };
|
||||
|
||||
for (i = 0; i < state->stream_count; i++)
|
||||
if (state->streams[i] == stream) {
|
||||
@@ -875,7 +875,7 @@ bool dc_state_rem_all_phantom_planes_for_stream(
|
||||
{
|
||||
int i, old_plane_count;
|
||||
struct dc_stream_status *stream_status = NULL;
|
||||
struct dc_plane_state *del_planes[MAX_SURFACE_NUM] = { 0 };
|
||||
struct dc_plane_state *del_planes[MAX_SURFACES] = { 0 };
|
||||
|
||||
for (i = 0; i < state->stream_count; i++)
|
||||
if (state->streams[i] == phantom_stream) {
|
||||
|
||||
@@ -57,7 +57,7 @@ struct dmub_notification;
|
||||
|
||||
#define DC_VER "3.2.301"
|
||||
|
||||
#define MAX_SURFACES 3
|
||||
#define MAX_SURFACES 4
|
||||
#define MAX_PLANES 6
|
||||
#define MAX_STREAMS 6
|
||||
#define MIN_VIEWPORT_SIZE 12
|
||||
@@ -1390,7 +1390,7 @@ struct dc_scratch_space {
|
||||
* store current value in plane states so we can still recover
|
||||
* a valid current state during dc update.
|
||||
*/
|
||||
struct dc_plane_state plane_states[MAX_SURFACE_NUM];
|
||||
struct dc_plane_state plane_states[MAX_SURFACES];
|
||||
|
||||
struct dc_stream_state stream_state;
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ struct dc_stream_status {
|
||||
int plane_count;
|
||||
int audio_inst;
|
||||
struct timing_sync_info timing_sync_info;
|
||||
struct dc_plane_state *plane_states[MAX_SURFACE_NUM];
|
||||
struct dc_plane_state *plane_states[MAX_SURFACES];
|
||||
bool is_abm_supported;
|
||||
struct mall_stream_config mall_stream_config;
|
||||
bool fpo_in_use;
|
||||
|
||||
@@ -76,7 +76,6 @@ struct dc_perf_trace {
|
||||
unsigned long last_entry_write;
|
||||
};
|
||||
|
||||
#define MAX_SURFACE_NUM 6
|
||||
#define NUM_PIXEL_FORMATS 10
|
||||
|
||||
enum tiling_mode {
|
||||
|
||||
@@ -66,11 +66,15 @@ static inline double dml_max5(double a, double b, double c, double d, double e)
|
||||
|
||||
static inline double dml_ceil(double a, double granularity)
|
||||
{
|
||||
if (granularity == 0)
|
||||
return 0;
|
||||
return (double) dcn_bw_ceil2(a, granularity);
|
||||
}
|
||||
|
||||
static inline double dml_floor(double a, double granularity)
|
||||
{
|
||||
if (granularity == 0)
|
||||
return 0;
|
||||
return (double) dcn_bw_floor2(a, granularity);
|
||||
}
|
||||
|
||||
@@ -114,11 +118,15 @@ static inline double dml_ceil_2(double f)
|
||||
|
||||
static inline double dml_ceil_ex(double x, double granularity)
|
||||
{
|
||||
if (granularity == 0)
|
||||
return 0;
|
||||
return (double) dcn_bw_ceil2(x, granularity);
|
||||
}
|
||||
|
||||
static inline double dml_floor_ex(double x, double granularity)
|
||||
{
|
||||
if (granularity == 0)
|
||||
return 0;
|
||||
return (double) dcn_bw_floor2(x, granularity);
|
||||
}
|
||||
|
||||
|
||||
@@ -813,7 +813,7 @@ static bool remove_all_phantom_planes_for_stream(struct dml2_context *ctx, struc
|
||||
{
|
||||
int i, old_plane_count;
|
||||
struct dc_stream_status *stream_status = NULL;
|
||||
struct dc_plane_state *del_planes[MAX_SURFACE_NUM] = { 0 };
|
||||
struct dc_plane_state *del_planes[MAX_SURFACES] = { 0 };
|
||||
|
||||
for (i = 0; i < context->stream_count; i++)
|
||||
if (context->streams[i] == stream) {
|
||||
|
||||
@@ -302,5 +302,7 @@ int smu_v13_0_set_wbrf_exclusion_ranges(struct smu_context *smu,
|
||||
int smu_v13_0_get_boot_freq_by_index(struct smu_context *smu,
|
||||
enum smu_clk_type clk_type,
|
||||
uint32_t *value);
|
||||
|
||||
void smu_v13_0_interrupt_work(struct smu_context *smu);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1320,11 +1320,11 @@ static int smu_v13_0_set_irq_state(struct amdgpu_device *adev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smu_v13_0_ack_ac_dc_interrupt(struct smu_context *smu)
|
||||
void smu_v13_0_interrupt_work(struct smu_context *smu)
|
||||
{
|
||||
return smu_cmn_send_smc_msg(smu,
|
||||
SMU_MSG_ReenableAcDcInterrupt,
|
||||
NULL);
|
||||
smu_cmn_send_smc_msg(smu,
|
||||
SMU_MSG_ReenableAcDcInterrupt,
|
||||
NULL);
|
||||
}
|
||||
|
||||
#define THM_11_0__SRCID__THM_DIG_THERM_L2H 0 /* ASIC_TEMP > CG_THERMAL_INT.DIG_THERM_INTH */
|
||||
@@ -1377,12 +1377,12 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,
|
||||
switch (ctxid) {
|
||||
case SMU_IH_INTERRUPT_CONTEXT_ID_AC:
|
||||
dev_dbg(adev->dev, "Switched to AC mode!\n");
|
||||
smu_v13_0_ack_ac_dc_interrupt(smu);
|
||||
schedule_work(&smu->interrupt_work);
|
||||
adev->pm.ac_power = true;
|
||||
break;
|
||||
case SMU_IH_INTERRUPT_CONTEXT_ID_DC:
|
||||
dev_dbg(adev->dev, "Switched to DC mode!\n");
|
||||
smu_v13_0_ack_ac_dc_interrupt(smu);
|
||||
schedule_work(&smu->interrupt_work);
|
||||
adev->pm.ac_power = false;
|
||||
break;
|
||||
case SMU_IH_INTERRUPT_CONTEXT_ID_THERMAL_THROTTLING:
|
||||
|
||||
@@ -3126,6 +3126,7 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
|
||||
.is_asic_wbrf_supported = smu_v13_0_0_wbrf_support_check,
|
||||
.enable_uclk_shadow = smu_v13_0_enable_uclk_shadow,
|
||||
.set_wbrf_exclusion_ranges = smu_v13_0_set_wbrf_exclusion_ranges,
|
||||
.interrupt_work = smu_v13_0_interrupt_work,
|
||||
};
|
||||
|
||||
void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu)
|
||||
|
||||
@@ -2704,6 +2704,7 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
|
||||
.is_asic_wbrf_supported = smu_v13_0_7_wbrf_support_check,
|
||||
.enable_uclk_shadow = smu_v13_0_enable_uclk_shadow,
|
||||
.set_wbrf_exclusion_ranges = smu_v13_0_set_wbrf_exclusion_ranges,
|
||||
.interrupt_work = smu_v13_0_interrupt_work,
|
||||
};
|
||||
|
||||
void smu_v13_0_7_set_ppt_funcs(struct smu_context *smu)
|
||||
|
||||
@@ -13,9 +13,6 @@ config DRM_MEDIATEK
|
||||
select DRM_BRIDGE_CONNECTOR
|
||||
select DRM_MIPI_DSI
|
||||
select DRM_PANEL
|
||||
select MEMORY
|
||||
select MTK_SMI
|
||||
select PHY_MTK_MIPI_DSI
|
||||
select VIDEOMODE_HELPERS
|
||||
help
|
||||
Choose this option if you have a Mediatek SoCs.
|
||||
@@ -26,7 +23,6 @@ config DRM_MEDIATEK
|
||||
config DRM_MEDIATEK_DP
|
||||
tristate "DRM DPTX Support for MediaTek SoCs"
|
||||
depends on DRM_MEDIATEK
|
||||
select PHY_MTK_DP
|
||||
select DRM_DISPLAY_HELPER
|
||||
select DRM_DISPLAY_DP_HELPER
|
||||
select DRM_DISPLAY_DP_AUX_BUS
|
||||
@@ -37,6 +33,5 @@ config DRM_MEDIATEK_HDMI
|
||||
tristate "DRM HDMI Support for Mediatek SoCs"
|
||||
depends on DRM_MEDIATEK
|
||||
select SND_SOC_HDMI_CODEC if SND_SOC
|
||||
select PHY_MTK_HDMI
|
||||
help
|
||||
DRM/KMS HDMI driver for Mediatek SoCs
|
||||
|
||||
@@ -112,6 +112,11 @@ static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
|
||||
|
||||
drm_crtc_handle_vblank(&mtk_crtc->base);
|
||||
|
||||
#if IS_REACHABLE(CONFIG_MTK_CMDQ)
|
||||
if (mtk_crtc->cmdq_client.chan)
|
||||
return;
|
||||
#endif
|
||||
|
||||
spin_lock_irqsave(&mtk_crtc->config_lock, flags);
|
||||
if (!mtk_crtc->config_updating && mtk_crtc->pending_needs_vblank) {
|
||||
mtk_crtc_finish_page_flip(mtk_crtc);
|
||||
@@ -284,10 +289,8 @@ static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg)
|
||||
state = to_mtk_crtc_state(mtk_crtc->base.state);
|
||||
|
||||
spin_lock_irqsave(&mtk_crtc->config_lock, flags);
|
||||
if (mtk_crtc->config_updating) {
|
||||
spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
|
||||
if (mtk_crtc->config_updating)
|
||||
goto ddp_cmdq_cb_out;
|
||||
}
|
||||
|
||||
state->pending_config = false;
|
||||
|
||||
@@ -315,10 +318,15 @@ static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg)
|
||||
mtk_crtc->pending_async_planes = false;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
|
||||
|
||||
ddp_cmdq_cb_out:
|
||||
|
||||
if (mtk_crtc->pending_needs_vblank) {
|
||||
mtk_crtc_finish_page_flip(mtk_crtc);
|
||||
mtk_crtc->pending_needs_vblank = false;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
|
||||
|
||||
mtk_crtc->cmdq_vblank_cnt = 0;
|
||||
wake_up(&mtk_crtc->cb_blocking_queue);
|
||||
}
|
||||
@@ -606,13 +614,18 @@ static void mtk_crtc_update_config(struct mtk_crtc *mtk_crtc, bool needs_vblank)
|
||||
*/
|
||||
mtk_crtc->cmdq_vblank_cnt = 3;
|
||||
|
||||
spin_lock_irqsave(&mtk_crtc->config_lock, flags);
|
||||
mtk_crtc->config_updating = false;
|
||||
spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
|
||||
|
||||
mbox_send_message(mtk_crtc->cmdq_client.chan, cmdq_handle);
|
||||
mbox_client_txdone(mtk_crtc->cmdq_client.chan, 0);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
spin_lock_irqsave(&mtk_crtc->config_lock, flags);
|
||||
mtk_crtc->config_updating = false;
|
||||
spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
|
||||
#endif
|
||||
|
||||
mutex_unlock(&mtk_crtc->hw_lock);
|
||||
}
|
||||
|
||||
@@ -460,6 +460,29 @@ static unsigned int mtk_ovl_fmt_convert(struct mtk_disp_ovl *ovl,
|
||||
}
|
||||
}
|
||||
|
||||
static void mtk_ovl_afbc_layer_config(struct mtk_disp_ovl *ovl,
|
||||
unsigned int idx,
|
||||
struct mtk_plane_pending_state *pending,
|
||||
struct cmdq_pkt *cmdq_pkt)
|
||||
{
|
||||
unsigned int pitch_msb = pending->pitch >> 16;
|
||||
unsigned int hdr_pitch = pending->hdr_pitch;
|
||||
unsigned int hdr_addr = pending->hdr_addr;
|
||||
|
||||
if (pending->modifier != DRM_FORMAT_MOD_LINEAR) {
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, hdr_addr, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_HDR_ADDR(ovl, idx));
|
||||
mtk_ddp_write_relaxed(cmdq_pkt,
|
||||
OVL_PITCH_MSB_2ND_SUBBUF | pitch_msb,
|
||||
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, hdr_pitch, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_HDR_PITCH(ovl, idx));
|
||||
} else {
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, pitch_msb,
|
||||
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
|
||||
}
|
||||
}
|
||||
|
||||
void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
|
||||
struct mtk_plane_state *state,
|
||||
struct cmdq_pkt *cmdq_pkt)
|
||||
@@ -467,25 +490,14 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
|
||||
struct mtk_disp_ovl *ovl = dev_get_drvdata(dev);
|
||||
struct mtk_plane_pending_state *pending = &state->pending;
|
||||
unsigned int addr = pending->addr;
|
||||
unsigned int hdr_addr = pending->hdr_addr;
|
||||
unsigned int pitch = pending->pitch;
|
||||
unsigned int hdr_pitch = pending->hdr_pitch;
|
||||
unsigned int pitch_lsb = pending->pitch & GENMASK(15, 0);
|
||||
unsigned int fmt = pending->format;
|
||||
unsigned int rotation = pending->rotation;
|
||||
unsigned int offset = (pending->y << 16) | pending->x;
|
||||
unsigned int src_size = (pending->height << 16) | pending->width;
|
||||
unsigned int blend_mode = state->base.pixel_blend_mode;
|
||||
unsigned int ignore_pixel_alpha = 0;
|
||||
unsigned int con;
|
||||
bool is_afbc = pending->modifier != DRM_FORMAT_MOD_LINEAR;
|
||||
union overlay_pitch {
|
||||
struct split_pitch {
|
||||
u16 lsb;
|
||||
u16 msb;
|
||||
} split_pitch;
|
||||
u32 pitch;
|
||||
} overlay_pitch;
|
||||
|
||||
overlay_pitch.pitch = pitch;
|
||||
|
||||
if (!pending->enable) {
|
||||
mtk_ovl_layer_off(dev, idx, cmdq_pkt);
|
||||
@@ -513,22 +525,30 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
|
||||
ignore_pixel_alpha = OVL_CONST_BLEND;
|
||||
}
|
||||
|
||||
if (pending->rotation & DRM_MODE_REFLECT_Y) {
|
||||
/*
|
||||
* Treat rotate 180 as flip x + flip y, and XOR the original rotation value
|
||||
* to flip x + flip y to support both in the same time.
|
||||
*/
|
||||
if (rotation & DRM_MODE_ROTATE_180)
|
||||
rotation ^= DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y;
|
||||
|
||||
if (rotation & DRM_MODE_REFLECT_Y) {
|
||||
con |= OVL_CON_VIRT_FLIP;
|
||||
addr += (pending->height - 1) * pending->pitch;
|
||||
}
|
||||
|
||||
if (pending->rotation & DRM_MODE_REFLECT_X) {
|
||||
if (rotation & DRM_MODE_REFLECT_X) {
|
||||
con |= OVL_CON_HORZ_FLIP;
|
||||
addr += pending->pitch - 1;
|
||||
}
|
||||
|
||||
if (ovl->data->supports_afbc)
|
||||
mtk_ovl_set_afbc(ovl, cmdq_pkt, idx, is_afbc);
|
||||
mtk_ovl_set_afbc(ovl, cmdq_pkt, idx,
|
||||
pending->modifier != DRM_FORMAT_MOD_LINEAR);
|
||||
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, con, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_CON(idx));
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, overlay_pitch.split_pitch.lsb | ignore_pixel_alpha,
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, pitch_lsb | ignore_pixel_alpha,
|
||||
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH(idx));
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, src_size, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_SRC_SIZE(idx));
|
||||
@@ -537,19 +557,8 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx,
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, addr, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_ADDR(ovl, idx));
|
||||
|
||||
if (is_afbc) {
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, hdr_addr, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_HDR_ADDR(ovl, idx));
|
||||
mtk_ddp_write_relaxed(cmdq_pkt,
|
||||
OVL_PITCH_MSB_2ND_SUBBUF | overlay_pitch.split_pitch.msb,
|
||||
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
|
||||
mtk_ddp_write_relaxed(cmdq_pkt, hdr_pitch, &ovl->cmdq_reg, ovl->regs,
|
||||
DISP_REG_OVL_HDR_PITCH(ovl, idx));
|
||||
} else {
|
||||
mtk_ddp_write_relaxed(cmdq_pkt,
|
||||
overlay_pitch.split_pitch.msb,
|
||||
&ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));
|
||||
}
|
||||
if (ovl->data->supports_afbc)
|
||||
mtk_ovl_afbc_layer_config(ovl, idx, pending, cmdq_pkt);
|
||||
|
||||
mtk_ovl_set_bit_depth(dev, idx, fmt, cmdq_pkt);
|
||||
mtk_ovl_layer_on(dev, idx, cmdq_pkt);
|
||||
|
||||
@@ -543,18 +543,16 @@ static int mtk_dp_set_color_format(struct mtk_dp *mtk_dp,
|
||||
enum dp_pixelformat color_format)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
/* update MISC0 */
|
||||
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3034,
|
||||
color_format << DP_TEST_COLOR_FORMAT_SHIFT,
|
||||
DP_TEST_COLOR_FORMAT_MASK);
|
||||
u32 misc0_color;
|
||||
|
||||
switch (color_format) {
|
||||
case DP_PIXELFORMAT_YUV422:
|
||||
val = PIXEL_ENCODE_FORMAT_DP_ENC0_P0_YCBCR422;
|
||||
misc0_color = DP_COLOR_FORMAT_YCbCr422;
|
||||
break;
|
||||
case DP_PIXELFORMAT_RGB:
|
||||
val = PIXEL_ENCODE_FORMAT_DP_ENC0_P0_RGB;
|
||||
misc0_color = DP_COLOR_FORMAT_RGB;
|
||||
break;
|
||||
default:
|
||||
drm_warn(mtk_dp->drm_dev, "Unsupported color format: %d\n",
|
||||
@@ -562,6 +560,11 @@ static int mtk_dp_set_color_format(struct mtk_dp *mtk_dp,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* update MISC0 */
|
||||
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3034,
|
||||
misc0_color,
|
||||
DP_TEST_COLOR_FORMAT_MASK);
|
||||
|
||||
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_303C,
|
||||
val, PIXEL_ENCODE_FORMAT_DP_ENC0_P0_MASK);
|
||||
return 0;
|
||||
@@ -2100,7 +2103,6 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
|
||||
struct mtk_dp *mtk_dp = mtk_dp_from_bridge(bridge);
|
||||
enum drm_connector_status ret = connector_status_disconnected;
|
||||
bool enabled = mtk_dp->enabled;
|
||||
u8 sink_count = 0;
|
||||
|
||||
if (!mtk_dp->train_info.cable_plugged_in)
|
||||
return ret;
|
||||
@@ -2115,8 +2117,8 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
|
||||
* function, we just need to check the HPD connection to check
|
||||
* whether we connect to a sink device.
|
||||
*/
|
||||
drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
|
||||
if (DP_GET_SINK_COUNT(sink_count))
|
||||
|
||||
if (drm_dp_read_sink_count(&mtk_dp->aux) > 0)
|
||||
ret = connector_status_connected;
|
||||
|
||||
if (!enabled)
|
||||
@@ -2408,12 +2410,19 @@ mtk_dp_bridge_mode_valid(struct drm_bridge *bridge,
|
||||
{
|
||||
struct mtk_dp *mtk_dp = mtk_dp_from_bridge(bridge);
|
||||
u32 bpp = info->color_formats & DRM_COLOR_FORMAT_YCBCR422 ? 16 : 24;
|
||||
u32 rate = min_t(u32, drm_dp_max_link_rate(mtk_dp->rx_cap) *
|
||||
drm_dp_max_lane_count(mtk_dp->rx_cap),
|
||||
drm_dp_bw_code_to_link_rate(mtk_dp->max_linkrate) *
|
||||
mtk_dp->max_lanes);
|
||||
u32 lane_count_min = mtk_dp->train_info.lane_count;
|
||||
u32 rate = drm_dp_bw_code_to_link_rate(mtk_dp->train_info.link_rate) *
|
||||
lane_count_min;
|
||||
|
||||
if (rate < mode->clock * bpp / 8)
|
||||
/*
|
||||
*FEC overhead is approximately 2.4% from DP 1.4a spec 2.2.1.4.2.
|
||||
*The down-spread amplitude shall either be disabled (0.0%) or up
|
||||
*to 0.5% from 1.4a 3.5.2.6. Add up to approximately 3% total overhead.
|
||||
*
|
||||
*Because rate is already divided by 10,
|
||||
*mode->clock does not need to be multiplied by 10
|
||||
*/
|
||||
if ((rate * 97 / 100) < (mode->clock * bpp / 8))
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
return MODE_OK;
|
||||
@@ -2454,10 +2463,9 @@ static u32 *mtk_dp_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
|
||||
struct drm_display_mode *mode = &crtc_state->adjusted_mode;
|
||||
struct drm_display_info *display_info =
|
||||
&conn_state->connector->display_info;
|
||||
u32 rate = min_t(u32, drm_dp_max_link_rate(mtk_dp->rx_cap) *
|
||||
drm_dp_max_lane_count(mtk_dp->rx_cap),
|
||||
drm_dp_bw_code_to_link_rate(mtk_dp->max_linkrate) *
|
||||
mtk_dp->max_lanes);
|
||||
u32 lane_count_min = mtk_dp->train_info.lane_count;
|
||||
u32 rate = drm_dp_bw_code_to_link_rate(mtk_dp->train_info.link_rate) *
|
||||
lane_count_min;
|
||||
|
||||
*num_input_fmts = 0;
|
||||
|
||||
@@ -2466,8 +2474,8 @@ static u32 *mtk_dp_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
|
||||
* datarate of YUV422 and sink device supports YUV422, we output YUV422
|
||||
* format. Use this condition, we can support more resolution.
|
||||
*/
|
||||
if ((rate < (mode->clock * 24 / 8)) &&
|
||||
(rate > (mode->clock * 16 / 8)) &&
|
||||
if (((rate * 97 / 100) < (mode->clock * 24 / 8)) &&
|
||||
((rate * 97 / 100) > (mode->clock * 16 / 8)) &&
|
||||
(display_info->color_formats & DRM_COLOR_FORMAT_YCBCR422)) {
|
||||
input_fmts = kcalloc(1, sizeof(*input_fmts), GFP_KERNEL);
|
||||
if (!input_fmts)
|
||||
|
||||
@@ -673,6 +673,8 @@ err_deinit:
|
||||
err_free:
|
||||
private->drm = NULL;
|
||||
drm_dev_put(drm);
|
||||
for (i = 0; i < private->data->mmsys_dev_num; i++)
|
||||
private->all_drm_private[i]->drm = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,11 +139,11 @@
|
||||
#define CLK_HS_POST GENMASK(15, 8)
|
||||
#define CLK_HS_EXIT GENMASK(23, 16)
|
||||
|
||||
#define DSI_VM_CMD_CON 0x130
|
||||
/* DSI_VM_CMD_CON */
|
||||
#define VM_CMD_EN BIT(0)
|
||||
#define TS_VFP_EN BIT(5)
|
||||
|
||||
#define DSI_SHADOW_DEBUG 0x190U
|
||||
/* DSI_SHADOW_DEBUG */
|
||||
#define FORCE_COMMIT BIT(0)
|
||||
#define BYPASS_SHADOW BIT(1)
|
||||
|
||||
@@ -187,6 +187,8 @@ struct phy;
|
||||
|
||||
struct mtk_dsi_driver_data {
|
||||
const u32 reg_cmdq_off;
|
||||
const u32 reg_vm_cmd_off;
|
||||
const u32 reg_shadow_dbg_off;
|
||||
bool has_shadow_ctl;
|
||||
bool has_size_ctl;
|
||||
bool cmdq_long_packet_ctl;
|
||||
@@ -246,23 +248,22 @@ static void mtk_dsi_phy_timconfig(struct mtk_dsi *dsi)
|
||||
u32 data_rate_mhz = DIV_ROUND_UP(dsi->data_rate, HZ_PER_MHZ);
|
||||
struct mtk_phy_timing *timing = &dsi->phy_timing;
|
||||
|
||||
timing->lpx = (80 * data_rate_mhz / (8 * 1000)) + 1;
|
||||
timing->da_hs_prepare = (59 * data_rate_mhz + 4 * 1000) / 8000 + 1;
|
||||
timing->da_hs_zero = (163 * data_rate_mhz + 11 * 1000) / 8000 + 1 -
|
||||
timing->lpx = (60 * data_rate_mhz / (8 * 1000)) + 1;
|
||||
timing->da_hs_prepare = (80 * data_rate_mhz + 4 * 1000) / 8000;
|
||||
timing->da_hs_zero = (170 * data_rate_mhz + 10 * 1000) / 8000 + 1 -
|
||||
timing->da_hs_prepare;
|
||||
timing->da_hs_trail = (78 * data_rate_mhz + 7 * 1000) / 8000 + 1;
|
||||
timing->da_hs_trail = timing->da_hs_prepare + 1;
|
||||
|
||||
timing->ta_go = 4 * timing->lpx;
|
||||
timing->ta_sure = 3 * timing->lpx / 2;
|
||||
timing->ta_get = 5 * timing->lpx;
|
||||
timing->da_hs_exit = (118 * data_rate_mhz / (8 * 1000)) + 1;
|
||||
timing->ta_go = 4 * timing->lpx - 2;
|
||||
timing->ta_sure = timing->lpx + 2;
|
||||
timing->ta_get = 4 * timing->lpx;
|
||||
timing->da_hs_exit = 2 * timing->lpx + 1;
|
||||
|
||||
timing->clk_hs_prepare = (57 * data_rate_mhz / (8 * 1000)) + 1;
|
||||
timing->clk_hs_post = (65 * data_rate_mhz + 53 * 1000) / 8000 + 1;
|
||||
timing->clk_hs_trail = (78 * data_rate_mhz + 7 * 1000) / 8000 + 1;
|
||||
timing->clk_hs_zero = (330 * data_rate_mhz / (8 * 1000)) + 1 -
|
||||
timing->clk_hs_prepare;
|
||||
timing->clk_hs_exit = (118 * data_rate_mhz / (8 * 1000)) + 1;
|
||||
timing->clk_hs_prepare = 70 * data_rate_mhz / (8 * 1000);
|
||||
timing->clk_hs_post = timing->clk_hs_prepare + 8;
|
||||
timing->clk_hs_trail = timing->clk_hs_prepare;
|
||||
timing->clk_hs_zero = timing->clk_hs_trail * 4;
|
||||
timing->clk_hs_exit = 2 * timing->clk_hs_trail;
|
||||
|
||||
timcon0 = FIELD_PREP(LPX, timing->lpx) |
|
||||
FIELD_PREP(HS_PREP, timing->da_hs_prepare) |
|
||||
@@ -367,8 +368,8 @@ static void mtk_dsi_set_mode(struct mtk_dsi *dsi)
|
||||
|
||||
static void mtk_dsi_set_vm_cmd(struct mtk_dsi *dsi)
|
||||
{
|
||||
mtk_dsi_mask(dsi, DSI_VM_CMD_CON, VM_CMD_EN, VM_CMD_EN);
|
||||
mtk_dsi_mask(dsi, DSI_VM_CMD_CON, TS_VFP_EN, TS_VFP_EN);
|
||||
mtk_dsi_mask(dsi, dsi->driver_data->reg_vm_cmd_off, VM_CMD_EN, VM_CMD_EN);
|
||||
mtk_dsi_mask(dsi, dsi->driver_data->reg_vm_cmd_off, TS_VFP_EN, TS_VFP_EN);
|
||||
}
|
||||
|
||||
static void mtk_dsi_rxtx_control(struct mtk_dsi *dsi)
|
||||
@@ -714,7 +715,7 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
|
||||
|
||||
if (dsi->driver_data->has_shadow_ctl)
|
||||
writel(FORCE_COMMIT | BYPASS_SHADOW,
|
||||
dsi->regs + DSI_SHADOW_DEBUG);
|
||||
dsi->regs + dsi->driver_data->reg_shadow_dbg_off);
|
||||
|
||||
mtk_dsi_reset_engine(dsi);
|
||||
mtk_dsi_phy_timconfig(dsi);
|
||||
@@ -1255,26 +1256,36 @@ static void mtk_dsi_remove(struct platform_device *pdev)
|
||||
|
||||
static const struct mtk_dsi_driver_data mt8173_dsi_driver_data = {
|
||||
.reg_cmdq_off = 0x200,
|
||||
.reg_vm_cmd_off = 0x130,
|
||||
.reg_shadow_dbg_off = 0x190
|
||||
};
|
||||
|
||||
static const struct mtk_dsi_driver_data mt2701_dsi_driver_data = {
|
||||
.reg_cmdq_off = 0x180,
|
||||
.reg_vm_cmd_off = 0x130,
|
||||
.reg_shadow_dbg_off = 0x190
|
||||
};
|
||||
|
||||
static const struct mtk_dsi_driver_data mt8183_dsi_driver_data = {
|
||||
.reg_cmdq_off = 0x200,
|
||||
.reg_vm_cmd_off = 0x130,
|
||||
.reg_shadow_dbg_off = 0x190,
|
||||
.has_shadow_ctl = true,
|
||||
.has_size_ctl = true,
|
||||
};
|
||||
|
||||
static const struct mtk_dsi_driver_data mt8186_dsi_driver_data = {
|
||||
.reg_cmdq_off = 0xd00,
|
||||
.reg_vm_cmd_off = 0x200,
|
||||
.reg_shadow_dbg_off = 0xc00,
|
||||
.has_shadow_ctl = true,
|
||||
.has_size_ctl = true,
|
||||
};
|
||||
|
||||
static const struct mtk_dsi_driver_data mt8188_dsi_driver_data = {
|
||||
.reg_cmdq_off = 0xd00,
|
||||
.reg_vm_cmd_off = 0x200,
|
||||
.reg_shadow_dbg_off = 0xc00,
|
||||
.has_shadow_ctl = true,
|
||||
.has_size_ctl = true,
|
||||
.cmdq_long_packet_ctl = true,
|
||||
|
||||
@@ -386,6 +386,10 @@ int xe_gt_init_early(struct xe_gt *gt)
|
||||
xe_force_wake_init_gt(gt, gt_to_fw(gt));
|
||||
spin_lock_init(>->global_invl_lock);
|
||||
|
||||
err = xe_gt_tlb_invalidation_init_early(gt);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -585,10 +589,6 @@ int xe_gt_init(struct xe_gt *gt)
|
||||
xe_hw_fence_irq_init(>->fence_irq[i]);
|
||||
}
|
||||
|
||||
err = xe_gt_tlb_invalidation_init(gt);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = xe_gt_pagefault_init(gt);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -106,7 +106,7 @@ static void xe_gt_tlb_fence_timeout(struct work_struct *work)
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_gt_tlb_invalidation_init - Initialize GT TLB invalidation state
|
||||
* xe_gt_tlb_invalidation_init_early - Initialize GT TLB invalidation state
|
||||
* @gt: graphics tile
|
||||
*
|
||||
* Initialize GT TLB invalidation state, purely software initialization, should
|
||||
@@ -114,7 +114,7 @@ static void xe_gt_tlb_fence_timeout(struct work_struct *work)
|
||||
*
|
||||
* Return: 0 on success, negative error code on error.
|
||||
*/
|
||||
int xe_gt_tlb_invalidation_init(struct xe_gt *gt)
|
||||
int xe_gt_tlb_invalidation_init_early(struct xe_gt *gt)
|
||||
{
|
||||
gt->tlb_invalidation.seqno = 1;
|
||||
INIT_LIST_HEAD(>->tlb_invalidation.pending_fences);
|
||||
|
||||
@@ -14,7 +14,8 @@ struct xe_gt;
|
||||
struct xe_guc;
|
||||
struct xe_vma;
|
||||
|
||||
int xe_gt_tlb_invalidation_init(struct xe_gt *gt);
|
||||
int xe_gt_tlb_invalidation_init_early(struct xe_gt *gt);
|
||||
|
||||
void xe_gt_tlb_invalidation_reset(struct xe_gt *gt);
|
||||
int xe_gt_tlb_invalidation_ggtt(struct xe_gt *gt);
|
||||
int xe_gt_tlb_invalidation_vma(struct xe_gt *gt,
|
||||
|
||||
@@ -165,6 +165,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,
|
||||
{
|
||||
u8 scsi_cmd[MAX_COMMAND_SIZE];
|
||||
enum req_op op;
|
||||
int err;
|
||||
|
||||
memset(scsi_cmd, 0, sizeof(scsi_cmd));
|
||||
scsi_cmd[0] = ATA_16;
|
||||
@@ -192,8 +193,11 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,
|
||||
scsi_cmd[12] = lba_high;
|
||||
scsi_cmd[14] = ata_command;
|
||||
|
||||
return scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata,
|
||||
ATA_SECT_SIZE, HZ, 5, NULL);
|
||||
err = scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata,
|
||||
ATA_SECT_SIZE, HZ, 5, NULL);
|
||||
if (err > 0)
|
||||
err = -EIO;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature,
|
||||
|
||||
@@ -917,6 +917,9 @@ static int ad7124_setup(struct ad7124_state *st)
|
||||
* set all channels to this default value.
|
||||
*/
|
||||
ad7124_set_channel_odr(st, i, 10);
|
||||
|
||||
/* Disable all channels to prevent unintended conversions. */
|
||||
ad_sd_write_reg(&st->sd, AD7124_CHANNEL(i), 2, 0);
|
||||
}
|
||||
|
||||
ret = ad_sd_write_reg(&st->sd, AD7124_ADC_CONTROL, 2, st->adc_control);
|
||||
|
||||
@@ -198,6 +198,7 @@ struct ad7173_channel {
|
||||
|
||||
struct ad7173_state {
|
||||
struct ad_sigma_delta sd;
|
||||
struct ad_sigma_delta_info sigma_delta_info;
|
||||
const struct ad7173_device_info *info;
|
||||
struct ad7173_channel *channels;
|
||||
struct regulator_bulk_data regulators[3];
|
||||
@@ -733,7 +734,7 @@ static int ad7173_disable_one(struct ad_sigma_delta *sd, unsigned int chan)
|
||||
return ad_sd_write_reg(sd, AD7173_REG_CH(chan), 2, 0);
|
||||
}
|
||||
|
||||
static struct ad_sigma_delta_info ad7173_sigma_delta_info = {
|
||||
static const struct ad_sigma_delta_info ad7173_sigma_delta_info = {
|
||||
.set_channel = ad7173_set_channel,
|
||||
.append_status = ad7173_append_status,
|
||||
.disable_all = ad7173_disable_all,
|
||||
@@ -1371,7 +1372,7 @@ static int ad7173_fw_parse_device_config(struct iio_dev *indio_dev)
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "Interrupt 'rdy' is required\n");
|
||||
|
||||
ad7173_sigma_delta_info.irq_line = ret;
|
||||
st->sigma_delta_info.irq_line = ret;
|
||||
|
||||
return ad7173_fw_parse_channel_config(indio_dev);
|
||||
}
|
||||
@@ -1404,8 +1405,9 @@ static int ad7173_probe(struct spi_device *spi)
|
||||
spi->mode = SPI_MODE_3;
|
||||
spi_setup(spi);
|
||||
|
||||
ad7173_sigma_delta_info.num_slots = st->info->num_configs;
|
||||
ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7173_sigma_delta_info);
|
||||
st->sigma_delta_info = ad7173_sigma_delta_info;
|
||||
st->sigma_delta_info.num_slots = st->info->num_configs;
|
||||
ret = ad_sd_init(&st->sd, indio_dev, spi, &st->sigma_delta_info);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -979,7 +979,7 @@ static int at91_ts_register(struct iio_dev *idev,
|
||||
return ret;
|
||||
|
||||
err:
|
||||
input_free_device(st->ts_input);
|
||||
input_free_device(input);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -368,6 +368,8 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
|
||||
int ret;
|
||||
int i, j = 0;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
mutex_lock(&info->lock);
|
||||
|
||||
iio_for_each_active_channel(i_dev, i) {
|
||||
|
||||
@@ -500,12 +500,14 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private)
|
||||
struct iio_dev *indio_dev = pf->indio_dev;
|
||||
struct ads1119_state *st = iio_priv(indio_dev);
|
||||
struct {
|
||||
unsigned int sample;
|
||||
s16 sample;
|
||||
s64 timestamp __aligned(8);
|
||||
} scan;
|
||||
unsigned int index;
|
||||
int ret;
|
||||
|
||||
memset(&scan, 0, sizeof(scan));
|
||||
|
||||
if (!iio_trigger_using_own(indio_dev)) {
|
||||
index = find_first_bit(indio_dev->active_scan_mask,
|
||||
iio_get_masklength(indio_dev));
|
||||
|
||||
@@ -183,9 +183,9 @@ static int ads124s_reset(struct iio_dev *indio_dev)
|
||||
struct ads124s_private *priv = iio_priv(indio_dev);
|
||||
|
||||
if (priv->reset_gpio) {
|
||||
gpiod_set_value(priv->reset_gpio, 0);
|
||||
gpiod_set_value_cansleep(priv->reset_gpio, 0);
|
||||
udelay(200);
|
||||
gpiod_set_value(priv->reset_gpio, 1);
|
||||
gpiod_set_value_cansleep(priv->reset_gpio, 1);
|
||||
} else {
|
||||
return ads124s_write_cmd(indio_dev, ADS124S08_CMD_RESET);
|
||||
}
|
||||
|
||||
@@ -613,6 +613,8 @@ static int ads1298_init(struct iio_dev *indio_dev)
|
||||
}
|
||||
indio_dev->name = devm_kasprintf(dev, GFP_KERNEL, "ads129%u%s",
|
||||
indio_dev->num_channels, suffix);
|
||||
if (!indio_dev->name)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Enable internal test signal, double amplitude, double frequency */
|
||||
ret = regmap_write(priv->regmap, ADS1298_REG_CONFIG2,
|
||||
|
||||
@@ -381,7 +381,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
|
||||
struct iio_poll_func *pf = p;
|
||||
struct iio_dev *indio_dev = pf->indio_dev;
|
||||
/* Ensure naturally aligned timestamp */
|
||||
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8);
|
||||
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8) = { };
|
||||
int i, j = 0;
|
||||
|
||||
iio_for_each_active_channel(indio_dev, i) {
|
||||
|
||||
@@ -48,7 +48,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
|
||||
int i = 0, j;
|
||||
u16 *data;
|
||||
|
||||
data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);
|
||||
data = kzalloc(indio_dev->scan_bytes, GFP_KERNEL);
|
||||
if (!data)
|
||||
goto done;
|
||||
|
||||
|
||||
@@ -730,14 +730,21 @@ static irqreturn_t fxas21002c_trigger_handler(int irq, void *p)
|
||||
int ret;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
ret = regmap_bulk_read(data->regmap, FXAS21002C_REG_OUT_X_MSB,
|
||||
data->buffer, CHANNEL_SCAN_MAX * sizeof(s16));
|
||||
ret = fxas21002c_pm_get(data);
|
||||
if (ret < 0)
|
||||
goto out_unlock;
|
||||
|
||||
ret = regmap_bulk_read(data->regmap, FXAS21002C_REG_OUT_X_MSB,
|
||||
data->buffer, CHANNEL_SCAN_MAX * sizeof(s16));
|
||||
if (ret < 0)
|
||||
goto out_pm_put;
|
||||
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
|
||||
data->timestamp);
|
||||
|
||||
out_pm_put:
|
||||
fxas21002c_pm_put(data);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
|
||||
@@ -403,6 +403,7 @@ struct inv_icm42600_sensor_state {
|
||||
typedef int (*inv_icm42600_bus_setup)(struct inv_icm42600_state *);
|
||||
|
||||
extern const struct regmap_config inv_icm42600_regmap_config;
|
||||
extern const struct regmap_config inv_icm42600_spi_regmap_config;
|
||||
extern const struct dev_pm_ops inv_icm42600_pm_ops;
|
||||
|
||||
const struct iio_mount_matrix *
|
||||
|
||||
@@ -87,6 +87,21 @@ const struct regmap_config inv_icm42600_regmap_config = {
|
||||
};
|
||||
EXPORT_SYMBOL_NS_GPL(inv_icm42600_regmap_config, IIO_ICM42600);
|
||||
|
||||
/* define specific regmap for SPI not supporting burst write */
|
||||
const struct regmap_config inv_icm42600_spi_regmap_config = {
|
||||
.name = "inv_icm42600",
|
||||
.reg_bits = 8,
|
||||
.val_bits = 8,
|
||||
.max_register = 0x4FFF,
|
||||
.ranges = inv_icm42600_regmap_ranges,
|
||||
.num_ranges = ARRAY_SIZE(inv_icm42600_regmap_ranges),
|
||||
.volatile_table = inv_icm42600_regmap_volatile_accesses,
|
||||
.rd_noinc_table = inv_icm42600_regmap_rd_noinc_accesses,
|
||||
.cache_type = REGCACHE_RBTREE,
|
||||
.use_single_write = true,
|
||||
};
|
||||
EXPORT_SYMBOL_NS_GPL(inv_icm42600_spi_regmap_config, IIO_ICM42600);
|
||||
|
||||
struct inv_icm42600_hw {
|
||||
uint8_t whoami;
|
||||
const char *name;
|
||||
@@ -822,6 +837,8 @@ out_unlock:
|
||||
static int inv_icm42600_resume(struct device *dev)
|
||||
{
|
||||
struct inv_icm42600_state *st = dev_get_drvdata(dev);
|
||||
struct inv_icm42600_sensor_state *gyro_st = iio_priv(st->indio_gyro);
|
||||
struct inv_icm42600_sensor_state *accel_st = iio_priv(st->indio_accel);
|
||||
int ret;
|
||||
|
||||
mutex_lock(&st->lock);
|
||||
@@ -842,9 +859,12 @@ static int inv_icm42600_resume(struct device *dev)
|
||||
goto out_unlock;
|
||||
|
||||
/* restore FIFO data streaming */
|
||||
if (st->fifo.on)
|
||||
if (st->fifo.on) {
|
||||
inv_sensors_timestamp_reset(&gyro_st->ts);
|
||||
inv_sensors_timestamp_reset(&accel_st->ts);
|
||||
ret = regmap_write(st->map, INV_ICM42600_REG_FIFO_CONFIG,
|
||||
INV_ICM42600_FIFO_CONFIG_STREAM);
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&st->lock);
|
||||
|
||||
@@ -59,7 +59,8 @@ static int inv_icm42600_probe(struct spi_device *spi)
|
||||
return -EINVAL;
|
||||
chip = (uintptr_t)match;
|
||||
|
||||
regmap = devm_regmap_init_spi(spi, &inv_icm42600_regmap_config);
|
||||
/* use SPI specific regmap */
|
||||
regmap = devm_regmap_init_spi(spi, &inv_icm42600_spi_regmap_config);
|
||||
if (IS_ERR(regmap))
|
||||
return PTR_ERR(regmap);
|
||||
|
||||
|
||||
@@ -1192,7 +1192,7 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p)
|
||||
struct kmx61_data *data = kmx61_get_data(indio_dev);
|
||||
int bit, ret, i = 0;
|
||||
u8 base;
|
||||
s16 buffer[8];
|
||||
s16 buffer[8] = { };
|
||||
|
||||
if (indio_dev == data->acc_indio_dev)
|
||||
base = KMX61_ACC_XOUT_L;
|
||||
|
||||
@@ -499,7 +499,7 @@ struct iio_channel *iio_channel_get_all(struct device *dev)
|
||||
return_ptr(chans);
|
||||
|
||||
error_free_chans:
|
||||
for (i = 0; i < nummaps; i++)
|
||||
for (i = 0; i < mapind; i++)
|
||||
iio_device_put(chans[i].indio_dev);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
@@ -750,6 +750,8 @@ static irqreturn_t bh1745_trigger_handler(int interrupt, void *p)
|
||||
int i;
|
||||
int j = 0;
|
||||
|
||||
memset(&scan, 0, sizeof(scan));
|
||||
|
||||
iio_for_each_active_channel(indio_dev, i) {
|
||||
ret = regmap_bulk_read(data->regmap, BH1745_RED_LSB + 2 * i,
|
||||
&value, 2);
|
||||
|
||||
@@ -105,7 +105,7 @@ static irqreturn_t vcnl4035_trigger_consumer_handler(int irq, void *p)
|
||||
struct iio_dev *indio_dev = pf->indio_dev;
|
||||
struct vcnl4035_data *data = iio_priv(indio_dev);
|
||||
/* Ensure naturally aligned timestamp */
|
||||
u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8);
|
||||
u8 buffer[ALIGN(sizeof(u16), sizeof(s64)) + sizeof(s64)] __aligned(8) = { };
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(data->regmap, VCNL4035_ALS_DATA, (int *)buffer);
|
||||
|
||||
@@ -586,6 +586,8 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
|
||||
} sample;
|
||||
int err;
|
||||
|
||||
memset(&sample, 0, sizeof(sample));
|
||||
|
||||
if (test_bit(0, indio_dev->active_scan_mask)) {
|
||||
/* Get current pressure from hardware FIFO. */
|
||||
err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);
|
||||
|
||||
@@ -442,7 +442,7 @@ static int ebs_iterate_devices(struct dm_target *ti,
|
||||
static struct target_type ebs_target = {
|
||||
.name = "ebs",
|
||||
.version = {1, 0, 1},
|
||||
.features = DM_TARGET_PASSES_INTEGRITY,
|
||||
.features = 0,
|
||||
.module = THIS_MODULE,
|
||||
.ctr = ebs_ctr,
|
||||
.dtr = ebs_dtr,
|
||||
|
||||
@@ -2332,10 +2332,9 @@ static struct thin_c *get_first_thin(struct pool *pool)
|
||||
struct thin_c *tc = NULL;
|
||||
|
||||
rcu_read_lock();
|
||||
if (!list_empty(&pool->active_thins)) {
|
||||
tc = list_entry_rcu(pool->active_thins.next, struct thin_c, list);
|
||||
tc = list_first_or_null_rcu(&pool->active_thins, struct thin_c, list);
|
||||
if (tc)
|
||||
thin_get(tc);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
return tc;
|
||||
|
||||
+26
-14
@@ -60,15 +60,19 @@ static int fec_decode_rs8(struct dm_verity *v, struct dm_verity_fec_io *fio,
|
||||
* to the data block. Caller is responsible for releasing buf.
|
||||
*/
|
||||
static u8 *fec_read_parity(struct dm_verity *v, u64 rsb, int index,
|
||||
unsigned int *offset, struct dm_buffer **buf,
|
||||
unsigned short ioprio)
|
||||
unsigned int *offset, unsigned int par_buf_offset,
|
||||
struct dm_buffer **buf, unsigned short ioprio)
|
||||
{
|
||||
u64 position, block, rem;
|
||||
u8 *res;
|
||||
|
||||
/* We have already part of parity bytes read, skip to the next block */
|
||||
if (par_buf_offset)
|
||||
index++;
|
||||
|
||||
position = (index + rsb) * v->fec->roots;
|
||||
block = div64_u64_rem(position, v->fec->io_size, &rem);
|
||||
*offset = (unsigned int)rem;
|
||||
*offset = par_buf_offset ? 0 : (unsigned int)rem;
|
||||
|
||||
res = dm_bufio_read_with_ioprio(v->fec->bufio, block, buf, ioprio);
|
||||
if (IS_ERR(res)) {
|
||||
@@ -128,11 +132,12 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_io *io,
|
||||
{
|
||||
int r, corrected = 0, res;
|
||||
struct dm_buffer *buf;
|
||||
unsigned int n, i, offset;
|
||||
u8 *par, *block;
|
||||
unsigned int n, i, offset, par_buf_offset = 0;
|
||||
u8 *par, *block, par_buf[DM_VERITY_FEC_RSM - DM_VERITY_FEC_MIN_RSN];
|
||||
struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_io_data_size);
|
||||
|
||||
par = fec_read_parity(v, rsb, block_offset, &offset, &buf, bio_prio(bio));
|
||||
par = fec_read_parity(v, rsb, block_offset, &offset,
|
||||
par_buf_offset, &buf, bio_prio(bio));
|
||||
if (IS_ERR(par))
|
||||
return PTR_ERR(par);
|
||||
|
||||
@@ -142,7 +147,8 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_io *io,
|
||||
*/
|
||||
fec_for_each_buffer_rs_block(fio, n, i) {
|
||||
block = fec_buffer_rs_block(v, fio, n, i);
|
||||
res = fec_decode_rs8(v, fio, block, &par[offset], neras);
|
||||
memcpy(&par_buf[par_buf_offset], &par[offset], v->fec->roots - par_buf_offset);
|
||||
res = fec_decode_rs8(v, fio, block, par_buf, neras);
|
||||
if (res < 0) {
|
||||
r = res;
|
||||
goto error;
|
||||
@@ -155,12 +161,21 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_io *io,
|
||||
if (block_offset >= 1 << v->data_dev_block_bits)
|
||||
goto done;
|
||||
|
||||
/* read the next block when we run out of parity bytes */
|
||||
offset += v->fec->roots;
|
||||
/* Read the next block when we run out of parity bytes */
|
||||
offset += (v->fec->roots - par_buf_offset);
|
||||
/* Check if parity bytes are split between blocks */
|
||||
if (offset < v->fec->io_size && (offset + v->fec->roots) > v->fec->io_size) {
|
||||
par_buf_offset = v->fec->io_size - offset;
|
||||
memcpy(par_buf, &par[offset], par_buf_offset);
|
||||
offset += par_buf_offset;
|
||||
} else
|
||||
par_buf_offset = 0;
|
||||
|
||||
if (offset >= v->fec->io_size) {
|
||||
dm_bufio_release(buf);
|
||||
|
||||
par = fec_read_parity(v, rsb, block_offset, &offset, &buf, bio_prio(bio));
|
||||
par = fec_read_parity(v, rsb, block_offset, &offset,
|
||||
par_buf_offset, &buf, bio_prio(bio));
|
||||
if (IS_ERR(par))
|
||||
return PTR_ERR(par);
|
||||
}
|
||||
@@ -723,10 +738,7 @@ int verity_fec_ctr(struct dm_verity *v)
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
if ((f->roots << SECTOR_SHIFT) & ((1 << v->data_dev_block_bits) - 1))
|
||||
f->io_size = 1 << v->data_dev_block_bits;
|
||||
else
|
||||
f->io_size = v->fec->roots << SECTOR_SHIFT;
|
||||
f->io_size = 1 << v->data_dev_block_bits;
|
||||
|
||||
f->bufio = dm_bufio_client_create(f->dev->bdev,
|
||||
f->io_size,
|
||||
|
||||
@@ -917,23 +917,27 @@ static int load_ablock(struct dm_array_cursor *c)
|
||||
if (c->block)
|
||||
unlock_ablock(c->info, c->block);
|
||||
|
||||
c->block = NULL;
|
||||
c->ab = NULL;
|
||||
c->index = 0;
|
||||
|
||||
r = dm_btree_cursor_get_value(&c->cursor, &key, &value_le);
|
||||
if (r) {
|
||||
DMERR("dm_btree_cursor_get_value failed");
|
||||
dm_btree_cursor_end(&c->cursor);
|
||||
goto out;
|
||||
|
||||
} else {
|
||||
r = get_ablock(c->info, le64_to_cpu(value_le), &c->block, &c->ab);
|
||||
if (r) {
|
||||
DMERR("get_ablock failed");
|
||||
dm_btree_cursor_end(&c->cursor);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
dm_btree_cursor_end(&c->cursor);
|
||||
c->block = NULL;
|
||||
c->ab = NULL;
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -956,10 +960,10 @@ EXPORT_SYMBOL_GPL(dm_array_cursor_begin);
|
||||
|
||||
void dm_array_cursor_end(struct dm_array_cursor *c)
|
||||
{
|
||||
if (c->block) {
|
||||
if (c->block)
|
||||
unlock_ablock(c->info, c->block);
|
||||
dm_btree_cursor_end(&c->cursor);
|
||||
}
|
||||
|
||||
dm_btree_cursor_end(&c->cursor);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dm_array_cursor_end);
|
||||
|
||||
@@ -999,6 +1003,7 @@ int dm_array_cursor_skip(struct dm_array_cursor *c, uint32_t count)
|
||||
}
|
||||
|
||||
count -= remaining;
|
||||
c->index += (remaining - 1);
|
||||
r = dm_array_cursor_next(c);
|
||||
|
||||
} while (!r);
|
||||
|
||||
@@ -148,7 +148,7 @@ static int pci1xxxx_gpio_set_config(struct gpio_chip *gpio, unsigned int offset,
|
||||
pci1xxx_assign_bit(priv->reg_base, OPENDRAIN_OFFSET(offset), (offset % 32), true);
|
||||
break;
|
||||
default:
|
||||
ret = -EOPNOTSUPP;
|
||||
ret = -ENOTSUPP;
|
||||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
@@ -277,7 +277,7 @@ static irqreturn_t pci1xxxx_gpio_irq_handler(int irq, void *dev_id)
|
||||
writel(BIT(bit), priv->reg_base + INTR_STATUS_OFFSET(gpiobank));
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
irq = irq_find_mapping(gc->irq.domain, (bit + (gpiobank * 32)));
|
||||
generic_handle_irq(irq);
|
||||
handle_nested_irq(irq);
|
||||
}
|
||||
}
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
|
||||
@@ -118,7 +118,7 @@ int pdsc_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
|
||||
if (err && err != -EIO)
|
||||
return err;
|
||||
|
||||
listlen = fw_list.num_fw_slots;
|
||||
listlen = min(fw_list.num_fw_slots, ARRAY_SIZE(fw_list.fw_names));
|
||||
for (i = 0; i < listlen; i++) {
|
||||
if (i < ARRAY_SIZE(fw_slotnames))
|
||||
strscpy(buf, fw_slotnames[i], sizeof(buf));
|
||||
|
||||
@@ -2826,6 +2826,13 @@ static int bnxt_hwrm_handler(struct bnxt *bp, struct tx_cmp *txcmp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool bnxt_vnic_is_active(struct bnxt *bp)
|
||||
{
|
||||
struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
|
||||
|
||||
return vnic->fw_vnic_id != INVALID_HW_RING_ID && vnic->mru > 0;
|
||||
}
|
||||
|
||||
static irqreturn_t bnxt_msix(int irq, void *dev_instance)
|
||||
{
|
||||
struct bnxt_napi *bnapi = dev_instance;
|
||||
@@ -3093,7 +3100,7 @@ static int bnxt_poll(struct napi_struct *napi, int budget)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bp->flags & BNXT_FLAG_DIM) {
|
||||
if ((bp->flags & BNXT_FLAG_DIM) && bnxt_vnic_is_active(bp)) {
|
||||
struct dim_sample dim_sample = {};
|
||||
|
||||
dim_update_sample(cpr->event_ctr,
|
||||
@@ -3224,7 +3231,7 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget)
|
||||
poll_done:
|
||||
cpr_rx = &cpr->cp_ring_arr[0];
|
||||
if (cpr_rx->cp_ring_type == BNXT_NQ_HDL_TYPE_RX &&
|
||||
(bp->flags & BNXT_FLAG_DIM)) {
|
||||
(bp->flags & BNXT_FLAG_DIM) && bnxt_vnic_is_active(bp)) {
|
||||
struct dim_sample dim_sample = {};
|
||||
|
||||
dim_update_sample(cpr->event_ctr,
|
||||
@@ -7116,6 +7123,26 @@ err_out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void bnxt_cancel_dim(struct bnxt *bp)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* DIM work is initialized in bnxt_enable_napi(). Proceed only
|
||||
* if NAPI is enabled.
|
||||
*/
|
||||
if (!bp->bnapi || test_bit(BNXT_STATE_NAPI_DISABLED, &bp->state))
|
||||
return;
|
||||
|
||||
/* Make sure NAPI sees that the VNIC is disabled */
|
||||
synchronize_net();
|
||||
for (i = 0; i < bp->rx_nr_rings; i++) {
|
||||
struct bnxt_rx_ring_info *rxr = &bp->rx_ring[i];
|
||||
struct bnxt_napi *bnapi = rxr->bnapi;
|
||||
|
||||
cancel_work_sync(&bnapi->cp_ring.dim.work);
|
||||
}
|
||||
}
|
||||
|
||||
static int hwrm_ring_free_send_msg(struct bnxt *bp,
|
||||
struct bnxt_ring_struct *ring,
|
||||
u32 ring_type, int cmpl_ring_id)
|
||||
@@ -7216,6 +7243,7 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
|
||||
}
|
||||
}
|
||||
|
||||
bnxt_cancel_dim(bp);
|
||||
for (i = 0; i < bp->rx_nr_rings; i++) {
|
||||
bnxt_hwrm_rx_ring_free(bp, &bp->rx_ring[i], close_path);
|
||||
bnxt_hwrm_rx_agg_ring_free(bp, &bp->rx_ring[i], close_path);
|
||||
@@ -11012,8 +11040,6 @@ static void bnxt_disable_napi(struct bnxt *bp)
|
||||
if (bnapi->in_reset)
|
||||
cpr->sw_stats->rx.rx_resets++;
|
||||
napi_disable(&bnapi->napi);
|
||||
if (bnapi->rx_ring)
|
||||
cancel_work_sync(&cpr->dim.work);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15269,8 +15295,10 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
|
||||
bnxt_hwrm_vnic_update(bp, vnic,
|
||||
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
|
||||
}
|
||||
|
||||
/* Make sure NAPI sees that the VNIC is disabled */
|
||||
synchronize_net();
|
||||
rxr = &bp->rx_ring[idx];
|
||||
cancel_work_sync(&rxr->bnapi->cp_ring.dim.work);
|
||||
bnxt_hwrm_rx_ring_free(bp, rxr, false);
|
||||
bnxt_hwrm_rx_agg_ring_free(bp, rxr, false);
|
||||
rxr->rx_next_cons = 0;
|
||||
|
||||
@@ -208,7 +208,7 @@ int bnxt_send_msg(struct bnxt_en_dev *edev,
|
||||
|
||||
rc = hwrm_req_replace(bp, req, fw_msg->msg, fw_msg->msg_len);
|
||||
if (rc)
|
||||
return rc;
|
||||
goto drop_req;
|
||||
|
||||
hwrm_req_timeout(bp, req, fw_msg->timeout);
|
||||
resp = hwrm_req_hold(bp, req);
|
||||
@@ -220,6 +220,7 @@ int bnxt_send_msg(struct bnxt_en_dev *edev,
|
||||
|
||||
memcpy(fw_msg->resp, resp, resp_len);
|
||||
}
|
||||
drop_req:
|
||||
hwrm_req_drop(bp, req);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1799,7 +1799,10 @@ void cxgb4_remove_tid(struct tid_info *t, unsigned int chan, unsigned int tid,
|
||||
struct adapter *adap = container_of(t, struct adapter, tids);
|
||||
struct sk_buff *skb;
|
||||
|
||||
WARN_ON(tid_out_of_range(&adap->tids, tid));
|
||||
if (tid_out_of_range(&adap->tids, tid)) {
|
||||
dev_err(adap->pdev_dev, "tid %d out of range\n", tid);
|
||||
return;
|
||||
}
|
||||
|
||||
if (t->tid_tab[tid - adap->tids.tid_base]) {
|
||||
t->tid_tab[tid - adap->tids.tid_base] = NULL;
|
||||
|
||||
@@ -2224,14 +2224,18 @@ static void gve_service_task(struct work_struct *work)
|
||||
|
||||
static void gve_set_netdev_xdp_features(struct gve_priv *priv)
|
||||
{
|
||||
xdp_features_t xdp_features;
|
||||
|
||||
if (priv->queue_format == GVE_GQI_QPL_FORMAT) {
|
||||
priv->dev->xdp_features = NETDEV_XDP_ACT_BASIC;
|
||||
priv->dev->xdp_features |= NETDEV_XDP_ACT_REDIRECT;
|
||||
priv->dev->xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
|
||||
priv->dev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
|
||||
xdp_features = NETDEV_XDP_ACT_BASIC;
|
||||
xdp_features |= NETDEV_XDP_ACT_REDIRECT;
|
||||
xdp_features |= NETDEV_XDP_ACT_NDO_XMIT;
|
||||
xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY;
|
||||
} else {
|
||||
priv->dev->xdp_features = 0;
|
||||
xdp_features = 0;
|
||||
}
|
||||
|
||||
xdp_set_features_flag(priv->dev, xdp_features);
|
||||
}
|
||||
|
||||
static int gve_init_priv(struct gve_priv *priv, bool skip_describe_device)
|
||||
|
||||
@@ -916,9 +916,6 @@ struct hnae3_handle {
|
||||
|
||||
u8 netdev_flags;
|
||||
struct dentry *hnae3_dbgfs;
|
||||
/* protects concurrent contention between debugfs commands */
|
||||
struct mutex dbgfs_lock;
|
||||
char **dbgfs_buf;
|
||||
|
||||
/* Network interface message level enabled bits */
|
||||
u32 msg_enable;
|
||||
|
||||
@@ -1260,69 +1260,55 @@ static int hns3_dbg_read_cmd(struct hns3_dbg_data *dbg_data,
|
||||
static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct hns3_dbg_data *dbg_data = filp->private_data;
|
||||
char *buf = filp->private_data;
|
||||
|
||||
return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
|
||||
}
|
||||
|
||||
static int hns3_dbg_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct hns3_dbg_data *dbg_data = inode->i_private;
|
||||
struct hnae3_handle *handle = dbg_data->handle;
|
||||
struct hns3_nic_priv *priv = handle->priv;
|
||||
ssize_t size = 0;
|
||||
char **save_buf;
|
||||
char *read_buf;
|
||||
u32 index;
|
||||
char *buf;
|
||||
int ret;
|
||||
|
||||
if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
|
||||
test_bit(HNS3_NIC_STATE_RESETTING, &priv->state))
|
||||
return -EBUSY;
|
||||
|
||||
ret = hns3_dbg_get_cmd_index(dbg_data, &index);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
mutex_lock(&handle->dbgfs_lock);
|
||||
save_buf = &handle->dbgfs_buf[index];
|
||||
buf = kvzalloc(hns3_dbg_cmd[index].buf_len, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
|
||||
test_bit(HNS3_NIC_STATE_RESETTING, &priv->state)) {
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd,
|
||||
buf, hns3_dbg_cmd[index].buf_len);
|
||||
if (ret) {
|
||||
kvfree(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (*save_buf) {
|
||||
read_buf = *save_buf;
|
||||
} else {
|
||||
read_buf = kvzalloc(hns3_dbg_cmd[index].buf_len, GFP_KERNEL);
|
||||
if (!read_buf) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
filp->private_data = buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* save the buffer addr until the last read operation */
|
||||
*save_buf = read_buf;
|
||||
|
||||
/* get data ready for the first time to read */
|
||||
ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd,
|
||||
read_buf, hns3_dbg_cmd[index].buf_len);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
||||
size = simple_read_from_buffer(buffer, count, ppos, read_buf,
|
||||
strlen(read_buf));
|
||||
if (size > 0) {
|
||||
mutex_unlock(&handle->dbgfs_lock);
|
||||
return size;
|
||||
}
|
||||
|
||||
out:
|
||||
/* free the buffer for the last read operation */
|
||||
if (*save_buf) {
|
||||
kvfree(*save_buf);
|
||||
*save_buf = NULL;
|
||||
}
|
||||
|
||||
mutex_unlock(&handle->dbgfs_lock);
|
||||
return ret;
|
||||
static int hns3_dbg_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
kvfree(filp->private_data);
|
||||
filp->private_data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct file_operations hns3_dbg_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = simple_open,
|
||||
.open = hns3_dbg_open,
|
||||
.read = hns3_dbg_read,
|
||||
.release = hns3_dbg_release,
|
||||
};
|
||||
|
||||
static int hns3_dbg_bd_file_init(struct hnae3_handle *handle, u32 cmd)
|
||||
@@ -1379,13 +1365,6 @@ int hns3_dbg_init(struct hnae3_handle *handle)
|
||||
int ret;
|
||||
u32 i;
|
||||
|
||||
handle->dbgfs_buf = devm_kcalloc(&handle->pdev->dev,
|
||||
ARRAY_SIZE(hns3_dbg_cmd),
|
||||
sizeof(*handle->dbgfs_buf),
|
||||
GFP_KERNEL);
|
||||
if (!handle->dbgfs_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
hns3_dbg_dentry[HNS3_DBG_DENTRY_COMMON].dentry =
|
||||
debugfs_create_dir(name, hns3_dbgfs_root);
|
||||
handle->hnae3_dbgfs = hns3_dbg_dentry[HNS3_DBG_DENTRY_COMMON].dentry;
|
||||
@@ -1395,8 +1374,6 @@ int hns3_dbg_init(struct hnae3_handle *handle)
|
||||
debugfs_create_dir(hns3_dbg_dentry[i].name,
|
||||
handle->hnae3_dbgfs);
|
||||
|
||||
mutex_init(&handle->dbgfs_lock);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++) {
|
||||
if ((hns3_dbg_cmd[i].cmd == HNAE3_DBG_CMD_TM_NODES &&
|
||||
ae_dev->dev_version <= HNAE3_DEVICE_VERSION_V2) ||
|
||||
@@ -1425,24 +1402,13 @@ int hns3_dbg_init(struct hnae3_handle *handle)
|
||||
out:
|
||||
debugfs_remove_recursive(handle->hnae3_dbgfs);
|
||||
handle->hnae3_dbgfs = NULL;
|
||||
mutex_destroy(&handle->dbgfs_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void hns3_dbg_uninit(struct hnae3_handle *handle)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
debugfs_remove_recursive(handle->hnae3_dbgfs);
|
||||
handle->hnae3_dbgfs = NULL;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++)
|
||||
if (handle->dbgfs_buf[i]) {
|
||||
kvfree(handle->dbgfs_buf[i]);
|
||||
handle->dbgfs_buf[i] = NULL;
|
||||
}
|
||||
|
||||
mutex_destroy(&handle->dbgfs_lock);
|
||||
}
|
||||
|
||||
void hns3_dbg_register_debugfs(const char *debugfs_dir_name)
|
||||
|
||||
@@ -2452,7 +2452,6 @@ static int hns3_nic_set_features(struct net_device *netdev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
netdev->features = features;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/netdevice.h>
|
||||
@@ -3584,6 +3585,17 @@ static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void hclge_set_reset_pending(struct hclge_dev *hdev,
|
||||
enum hnae3_reset_type reset_type)
|
||||
{
|
||||
/* When an incorrect reset type is executed, the get_reset_level
|
||||
* function generates the HNAE3_NONE_RESET flag. As a result, this
|
||||
* type do not need to pending.
|
||||
*/
|
||||
if (reset_type != HNAE3_NONE_RESET)
|
||||
set_bit(reset_type, &hdev->reset_pending);
|
||||
}
|
||||
|
||||
static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
|
||||
{
|
||||
u32 cmdq_src_reg, msix_src_reg, hw_err_src_reg;
|
||||
@@ -3604,7 +3616,7 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
|
||||
*/
|
||||
if (BIT(HCLGE_VECTOR0_IMPRESET_INT_B) & msix_src_reg) {
|
||||
dev_info(&hdev->pdev->dev, "IMP reset interrupt\n");
|
||||
set_bit(HNAE3_IMP_RESET, &hdev->reset_pending);
|
||||
hclge_set_reset_pending(hdev, HNAE3_IMP_RESET);
|
||||
set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state);
|
||||
*clearval = BIT(HCLGE_VECTOR0_IMPRESET_INT_B);
|
||||
hdev->rst_stats.imp_rst_cnt++;
|
||||
@@ -3614,7 +3626,7 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
|
||||
if (BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B) & msix_src_reg) {
|
||||
dev_info(&hdev->pdev->dev, "global reset interrupt\n");
|
||||
set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state);
|
||||
set_bit(HNAE3_GLOBAL_RESET, &hdev->reset_pending);
|
||||
hclge_set_reset_pending(hdev, HNAE3_GLOBAL_RESET);
|
||||
*clearval = BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B);
|
||||
hdev->rst_stats.global_rst_cnt++;
|
||||
return HCLGE_VECTOR0_EVENT_RST;
|
||||
@@ -3769,7 +3781,7 @@ static int hclge_misc_irq_init(struct hclge_dev *hdev)
|
||||
snprintf(hdev->misc_vector.name, HNAE3_INT_NAME_LEN, "%s-misc-%s",
|
||||
HCLGE_NAME, pci_name(hdev->pdev));
|
||||
ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle,
|
||||
0, hdev->misc_vector.name, hdev);
|
||||
IRQF_NO_AUTOEN, hdev->misc_vector.name, hdev);
|
||||
if (ret) {
|
||||
hclge_free_vector(hdev, 0);
|
||||
dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n",
|
||||
@@ -4062,7 +4074,7 @@ static void hclge_do_reset(struct hclge_dev *hdev)
|
||||
case HNAE3_FUNC_RESET:
|
||||
dev_info(&pdev->dev, "PF reset requested\n");
|
||||
/* schedule again to check later */
|
||||
set_bit(HNAE3_FUNC_RESET, &hdev->reset_pending);
|
||||
hclge_set_reset_pending(hdev, HNAE3_FUNC_RESET);
|
||||
hclge_reset_task_schedule(hdev);
|
||||
break;
|
||||
default:
|
||||
@@ -4096,6 +4108,8 @@ static enum hnae3_reset_type hclge_get_reset_level(struct hnae3_ae_dev *ae_dev,
|
||||
clear_bit(HNAE3_FLR_RESET, addr);
|
||||
}
|
||||
|
||||
clear_bit(HNAE3_NONE_RESET, addr);
|
||||
|
||||
if (hdev->reset_type != HNAE3_NONE_RESET &&
|
||||
rst_level < hdev->reset_type)
|
||||
return HNAE3_NONE_RESET;
|
||||
@@ -4237,7 +4251,7 @@ static bool hclge_reset_err_handle(struct hclge_dev *hdev)
|
||||
return false;
|
||||
} else if (hdev->rst_stats.reset_fail_cnt < MAX_RESET_FAIL_CNT) {
|
||||
hdev->rst_stats.reset_fail_cnt++;
|
||||
set_bit(hdev->reset_type, &hdev->reset_pending);
|
||||
hclge_set_reset_pending(hdev, hdev->reset_type);
|
||||
dev_info(&hdev->pdev->dev,
|
||||
"re-schedule reset task(%u)\n",
|
||||
hdev->rst_stats.reset_fail_cnt);
|
||||
@@ -4480,8 +4494,20 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
|
||||
static void hclge_set_def_reset_request(struct hnae3_ae_dev *ae_dev,
|
||||
enum hnae3_reset_type rst_type)
|
||||
{
|
||||
#define HCLGE_SUPPORT_RESET_TYPE \
|
||||
(BIT(HNAE3_FLR_RESET) | BIT(HNAE3_FUNC_RESET) | \
|
||||
BIT(HNAE3_GLOBAL_RESET) | BIT(HNAE3_IMP_RESET))
|
||||
|
||||
struct hclge_dev *hdev = ae_dev->priv;
|
||||
|
||||
if (!(BIT(rst_type) & HCLGE_SUPPORT_RESET_TYPE)) {
|
||||
/* To prevent reset triggered by hclge_reset_event */
|
||||
set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request);
|
||||
dev_warn(&hdev->pdev->dev, "unsupported reset type %d\n",
|
||||
rst_type);
|
||||
return;
|
||||
}
|
||||
|
||||
set_bit(rst_type, &hdev->default_reset_request);
|
||||
}
|
||||
|
||||
@@ -11891,9 +11917,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
|
||||
|
||||
hclge_init_rxd_adv_layout(hdev);
|
||||
|
||||
/* Enable MISC vector(vector0) */
|
||||
hclge_enable_vector(&hdev->misc_vector, true);
|
||||
|
||||
ret = hclge_init_wol(hdev);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev,
|
||||
@@ -11906,6 +11929,10 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
|
||||
hclge_state_init(hdev);
|
||||
hdev->last_reset_time = jiffies;
|
||||
|
||||
/* Enable MISC vector(vector0) */
|
||||
enable_irq(hdev->misc_vector.vector_irq);
|
||||
hclge_enable_vector(&hdev->misc_vector, true);
|
||||
|
||||
dev_info(&hdev->pdev->dev, "%s driver initialization finished.\n",
|
||||
HCLGE_DRIVER_NAME);
|
||||
|
||||
@@ -12311,7 +12338,7 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
|
||||
|
||||
/* Disable MISC vector(vector0) */
|
||||
hclge_enable_vector(&hdev->misc_vector, false);
|
||||
synchronize_irq(hdev->misc_vector.vector_irq);
|
||||
disable_irq(hdev->misc_vector.vector_irq);
|
||||
|
||||
/* Disable all hw interrupts */
|
||||
hclge_config_mac_tnl_int(hdev, false);
|
||||
|
||||
@@ -58,6 +58,9 @@ bool hclge_ptp_set_tx_info(struct hnae3_handle *handle, struct sk_buff *skb)
|
||||
struct hclge_dev *hdev = vport->back;
|
||||
struct hclge_ptp *ptp = hdev->ptp;
|
||||
|
||||
if (!ptp)
|
||||
return false;
|
||||
|
||||
if (!test_bit(HCLGE_PTP_FLAG_TX_EN, &ptp->flags) ||
|
||||
test_and_set_bit(HCLGE_STATE_PTP_TX_HANDLING, &hdev->state)) {
|
||||
ptp->tx_skipped++;
|
||||
|
||||
@@ -510,9 +510,9 @@ out:
|
||||
static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data,
|
||||
struct hnae3_knic_private_info *kinfo)
|
||||
{
|
||||
#define HCLGE_RING_REG_OFFSET 0x200
|
||||
#define HCLGE_RING_INT_REG_OFFSET 0x4
|
||||
|
||||
struct hnae3_queue *tqp;
|
||||
int i, j, reg_num;
|
||||
int data_num_sum;
|
||||
u32 *reg = data;
|
||||
@@ -533,10 +533,11 @@ static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data,
|
||||
reg_num = ARRAY_SIZE(ring_reg_addr_list);
|
||||
for (j = 0; j < kinfo->num_tqps; j++) {
|
||||
reg += hclge_reg_get_tlv(HCLGE_REG_TAG_RING, reg_num, reg);
|
||||
tqp = kinfo->tqp[j];
|
||||
for (i = 0; i < reg_num; i++)
|
||||
*reg++ = hclge_read_dev(&hdev->hw,
|
||||
ring_reg_addr_list[i] +
|
||||
HCLGE_RING_REG_OFFSET * j);
|
||||
*reg++ = readl_relaxed(tqp->io_base -
|
||||
HCLGE_TQP_REG_OFFSET +
|
||||
ring_reg_addr_list[i]);
|
||||
}
|
||||
data_num_sum += (reg_num + HCLGE_REG_TLV_SPACE) * kinfo->num_tqps;
|
||||
|
||||
|
||||
@@ -1395,6 +1395,17 @@ static int hclgevf_notify_roce_client(struct hclgevf_dev *hdev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void hclgevf_set_reset_pending(struct hclgevf_dev *hdev,
|
||||
enum hnae3_reset_type reset_type)
|
||||
{
|
||||
/* When an incorrect reset type is executed, the get_reset_level
|
||||
* function generates the HNAE3_NONE_RESET flag. As a result, this
|
||||
* type do not need to pending.
|
||||
*/
|
||||
if (reset_type != HNAE3_NONE_RESET)
|
||||
set_bit(reset_type, &hdev->reset_pending);
|
||||
}
|
||||
|
||||
static int hclgevf_reset_wait(struct hclgevf_dev *hdev)
|
||||
{
|
||||
#define HCLGEVF_RESET_WAIT_US 20000
|
||||
@@ -1544,7 +1555,7 @@ static void hclgevf_reset_err_handle(struct hclgevf_dev *hdev)
|
||||
hdev->rst_stats.rst_fail_cnt);
|
||||
|
||||
if (hdev->rst_stats.rst_fail_cnt < HCLGEVF_RESET_MAX_FAIL_CNT)
|
||||
set_bit(hdev->reset_type, &hdev->reset_pending);
|
||||
hclgevf_set_reset_pending(hdev, hdev->reset_type);
|
||||
|
||||
if (hclgevf_is_reset_pending(hdev)) {
|
||||
set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
|
||||
@@ -1664,6 +1675,8 @@ static enum hnae3_reset_type hclgevf_get_reset_level(unsigned long *addr)
|
||||
clear_bit(HNAE3_FLR_RESET, addr);
|
||||
}
|
||||
|
||||
clear_bit(HNAE3_NONE_RESET, addr);
|
||||
|
||||
return rst_level;
|
||||
}
|
||||
|
||||
@@ -1673,14 +1686,15 @@ static void hclgevf_reset_event(struct pci_dev *pdev,
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev);
|
||||
struct hclgevf_dev *hdev = ae_dev->priv;
|
||||
|
||||
dev_info(&hdev->pdev->dev, "received reset request from VF enet\n");
|
||||
|
||||
if (hdev->default_reset_request)
|
||||
hdev->reset_level =
|
||||
hclgevf_get_reset_level(&hdev->default_reset_request);
|
||||
else
|
||||
hdev->reset_level = HNAE3_VF_FUNC_RESET;
|
||||
|
||||
dev_info(&hdev->pdev->dev, "received reset request from VF enet, reset level is %d\n",
|
||||
hdev->reset_level);
|
||||
|
||||
/* reset of this VF requested */
|
||||
set_bit(HCLGEVF_RESET_REQUESTED, &hdev->reset_state);
|
||||
hclgevf_reset_task_schedule(hdev);
|
||||
@@ -1691,8 +1705,20 @@ static void hclgevf_reset_event(struct pci_dev *pdev,
|
||||
static void hclgevf_set_def_reset_request(struct hnae3_ae_dev *ae_dev,
|
||||
enum hnae3_reset_type rst_type)
|
||||
{
|
||||
#define HCLGEVF_SUPPORT_RESET_TYPE \
|
||||
(BIT(HNAE3_VF_RESET) | BIT(HNAE3_VF_FUNC_RESET) | \
|
||||
BIT(HNAE3_VF_PF_FUNC_RESET) | BIT(HNAE3_VF_FULL_RESET) | \
|
||||
BIT(HNAE3_FLR_RESET) | BIT(HNAE3_VF_EXP_RESET))
|
||||
|
||||
struct hclgevf_dev *hdev = ae_dev->priv;
|
||||
|
||||
if (!(BIT(rst_type) & HCLGEVF_SUPPORT_RESET_TYPE)) {
|
||||
/* To prevent reset triggered by hclge_reset_event */
|
||||
set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request);
|
||||
dev_info(&hdev->pdev->dev, "unsupported reset type %d\n",
|
||||
rst_type);
|
||||
return;
|
||||
}
|
||||
set_bit(rst_type, &hdev->default_reset_request);
|
||||
}
|
||||
|
||||
@@ -1849,14 +1875,14 @@ static void hclgevf_reset_service_task(struct hclgevf_dev *hdev)
|
||||
*/
|
||||
if (hdev->reset_attempts > HCLGEVF_MAX_RESET_ATTEMPTS_CNT) {
|
||||
/* prepare for full reset of stack + pcie interface */
|
||||
set_bit(HNAE3_VF_FULL_RESET, &hdev->reset_pending);
|
||||
hclgevf_set_reset_pending(hdev, HNAE3_VF_FULL_RESET);
|
||||
|
||||
/* "defer" schedule the reset task again */
|
||||
set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
|
||||
} else {
|
||||
hdev->reset_attempts++;
|
||||
|
||||
set_bit(hdev->reset_level, &hdev->reset_pending);
|
||||
hclgevf_set_reset_pending(hdev, hdev->reset_level);
|
||||
set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
|
||||
}
|
||||
hclgevf_reset_task_schedule(hdev);
|
||||
@@ -1979,7 +2005,7 @@ static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev,
|
||||
rst_ing_reg = hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING);
|
||||
dev_info(&hdev->pdev->dev,
|
||||
"receive reset interrupt 0x%x!\n", rst_ing_reg);
|
||||
set_bit(HNAE3_VF_RESET, &hdev->reset_pending);
|
||||
hclgevf_set_reset_pending(hdev, HNAE3_VF_RESET);
|
||||
set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
|
||||
set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state);
|
||||
*clearval = ~(1U << HCLGEVF_VECTOR0_RST_INT_B);
|
||||
@@ -2289,6 +2315,8 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev)
|
||||
clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
|
||||
|
||||
INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
|
||||
/* timer needs to be initialized before misc irq */
|
||||
timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
|
||||
|
||||
mutex_init(&hdev->mbx_resp.mbx_mutex);
|
||||
sema_init(&hdev->reset_sem, 1);
|
||||
@@ -2988,7 +3016,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
|
||||
HCLGEVF_DRIVER_NAME);
|
||||
|
||||
hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
|
||||
timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -123,10 +123,10 @@ int hclgevf_get_regs_len(struct hnae3_handle *handle)
|
||||
void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version,
|
||||
void *data)
|
||||
{
|
||||
#define HCLGEVF_RING_REG_OFFSET 0x200
|
||||
#define HCLGEVF_RING_INT_REG_OFFSET 0x4
|
||||
|
||||
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
|
||||
struct hnae3_queue *tqp;
|
||||
int i, j, reg_um;
|
||||
u32 *reg = data;
|
||||
|
||||
@@ -147,10 +147,11 @@ void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version,
|
||||
reg_um = ARRAY_SIZE(ring_reg_addr_list);
|
||||
for (j = 0; j < hdev->num_tqps; j++) {
|
||||
reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_um, reg);
|
||||
tqp = &hdev->htqp[j].q;
|
||||
for (i = 0; i < reg_um; i++)
|
||||
*reg++ = hclgevf_read_dev(&hdev->hw,
|
||||
ring_reg_addr_list[i] +
|
||||
HCLGEVF_RING_REG_OFFSET * j);
|
||||
*reg++ = readl_relaxed(tqp->io_base -
|
||||
HCLGEVF_TQP_REG_OFFSET +
|
||||
ring_reg_addr_list[i]);
|
||||
}
|
||||
|
||||
reg_um = ARRAY_SIZE(tqp_intr_reg_addr_list);
|
||||
|
||||
@@ -2238,6 +2238,8 @@ struct ice_aqc_get_pkg_info_resp {
|
||||
struct ice_aqc_get_pkg_info pkg_info[];
|
||||
};
|
||||
|
||||
#define ICE_AQC_GET_CGU_MAX_PHASE_ADJ GENMASK(30, 0)
|
||||
|
||||
/* Get CGU abilities command response data structure (indirect 0x0C61) */
|
||||
struct ice_aqc_get_cgu_abilities {
|
||||
u8 num_inputs;
|
||||
|
||||
@@ -2064,6 +2064,18 @@ static int ice_dpll_init_worker(struct ice_pf *pf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_dpll_phase_range_set - initialize phase adjust range helper
|
||||
* @range: pointer to phase adjust range struct to be initialized
|
||||
* @phase_adj: a value to be used as min(-)/max(+) boundary
|
||||
*/
|
||||
static void ice_dpll_phase_range_set(struct dpll_pin_phase_adjust_range *range,
|
||||
u32 phase_adj)
|
||||
{
|
||||
range->min = -phase_adj;
|
||||
range->max = phase_adj;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_dpll_init_info_pins_generic - initializes generic pins info
|
||||
* @pf: board private structure
|
||||
@@ -2105,8 +2117,8 @@ static int ice_dpll_init_info_pins_generic(struct ice_pf *pf, bool input)
|
||||
for (i = 0; i < pin_num; i++) {
|
||||
pins[i].idx = i;
|
||||
pins[i].prop.board_label = labels[i];
|
||||
pins[i].prop.phase_range.min = phase_adj_max;
|
||||
pins[i].prop.phase_range.max = -phase_adj_max;
|
||||
ice_dpll_phase_range_set(&pins[i].prop.phase_range,
|
||||
phase_adj_max);
|
||||
pins[i].prop.capabilities = cap;
|
||||
pins[i].pf = pf;
|
||||
ret = ice_dpll_pin_state_update(pf, &pins[i], pin_type, NULL);
|
||||
@@ -2152,6 +2164,7 @@ ice_dpll_init_info_direct_pins(struct ice_pf *pf,
|
||||
struct ice_hw *hw = &pf->hw;
|
||||
struct ice_dpll_pin *pins;
|
||||
unsigned long caps;
|
||||
u32 phase_adj_max;
|
||||
u8 freq_supp_num;
|
||||
bool input;
|
||||
|
||||
@@ -2159,11 +2172,13 @@ ice_dpll_init_info_direct_pins(struct ice_pf *pf,
|
||||
case ICE_DPLL_PIN_TYPE_INPUT:
|
||||
pins = pf->dplls.inputs;
|
||||
num_pins = pf->dplls.num_inputs;
|
||||
phase_adj_max = pf->dplls.input_phase_adj_max;
|
||||
input = true;
|
||||
break;
|
||||
case ICE_DPLL_PIN_TYPE_OUTPUT:
|
||||
pins = pf->dplls.outputs;
|
||||
num_pins = pf->dplls.num_outputs;
|
||||
phase_adj_max = pf->dplls.output_phase_adj_max;
|
||||
input = false;
|
||||
break;
|
||||
default:
|
||||
@@ -2188,19 +2203,13 @@ ice_dpll_init_info_direct_pins(struct ice_pf *pf,
|
||||
return ret;
|
||||
caps |= (DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE |
|
||||
DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE);
|
||||
pins[i].prop.phase_range.min =
|
||||
pf->dplls.input_phase_adj_max;
|
||||
pins[i].prop.phase_range.max =
|
||||
-pf->dplls.input_phase_adj_max;
|
||||
} else {
|
||||
pins[i].prop.phase_range.min =
|
||||
pf->dplls.output_phase_adj_max;
|
||||
pins[i].prop.phase_range.max =
|
||||
-pf->dplls.output_phase_adj_max;
|
||||
ret = ice_cgu_get_output_pin_state_caps(hw, i, &caps);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
ice_dpll_phase_range_set(&pins[i].prop.phase_range,
|
||||
phase_adj_max);
|
||||
pins[i].prop.capabilities = caps;
|
||||
ret = ice_dpll_pin_state_update(pf, &pins[i], pin_type, NULL);
|
||||
if (ret)
|
||||
@@ -2308,8 +2317,10 @@ static int ice_dpll_init_info(struct ice_pf *pf, bool cgu)
|
||||
dp->dpll_idx = abilities.pps_dpll_idx;
|
||||
d->num_inputs = abilities.num_inputs;
|
||||
d->num_outputs = abilities.num_outputs;
|
||||
d->input_phase_adj_max = le32_to_cpu(abilities.max_in_phase_adj);
|
||||
d->output_phase_adj_max = le32_to_cpu(abilities.max_out_phase_adj);
|
||||
d->input_phase_adj_max = le32_to_cpu(abilities.max_in_phase_adj) &
|
||||
ICE_AQC_GET_CGU_MAX_PHASE_ADJ;
|
||||
d->output_phase_adj_max = le32_to_cpu(abilities.max_out_phase_adj) &
|
||||
ICE_AQC_GET_CGU_MAX_PHASE_ADJ;
|
||||
|
||||
alloc_size = sizeof(*d->inputs) * d->num_inputs;
|
||||
d->inputs = kzalloc(alloc_size, GFP_KERNEL);
|
||||
|
||||
@@ -761,9 +761,9 @@ const struct ice_vernier_info_e82x e822_vernier[NUM_ICE_PTP_LNK_SPD] = {
|
||||
/* rx_desk_rsgb_par */
|
||||
644531250, /* 644.53125 MHz Reed Solomon gearbox */
|
||||
/* tx_desk_rsgb_pcs */
|
||||
644531250, /* 644.53125 MHz Reed Solomon gearbox */
|
||||
390625000, /* 390.625 MHz Reed Solomon gearbox */
|
||||
/* rx_desk_rsgb_pcs */
|
||||
644531250, /* 644.53125 MHz Reed Solomon gearbox */
|
||||
390625000, /* 390.625 MHz Reed Solomon gearbox */
|
||||
/* tx_fixed_delay */
|
||||
1620,
|
||||
/* pmd_adj_divisor */
|
||||
|
||||
@@ -68,6 +68,10 @@ static s32 igc_init_nvm_params_base(struct igc_hw *hw)
|
||||
u32 eecd = rd32(IGC_EECD);
|
||||
u16 size;
|
||||
|
||||
/* failed to read reg and got all F's */
|
||||
if (!(~eecd))
|
||||
return -ENXIO;
|
||||
|
||||
size = FIELD_GET(IGC_EECD_SIZE_EX_MASK, eecd);
|
||||
|
||||
/* Added to a constant, "size" becomes the left-shift value
|
||||
@@ -221,6 +225,8 @@ static s32 igc_get_invariants_base(struct igc_hw *hw)
|
||||
|
||||
/* NVM initialization */
|
||||
ret_val = igc_init_nvm_params_base(hw);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
switch (hw->mac.type) {
|
||||
case igc_i225:
|
||||
ret_val = igc_init_nvm_params_i225(hw);
|
||||
|
||||
@@ -1013,6 +1013,7 @@ static void cmd_work_handler(struct work_struct *work)
|
||||
complete(&ent->done);
|
||||
}
|
||||
up(&cmd->vars.sem);
|
||||
complete(&ent->slotted);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1827,7 +1827,7 @@ static int rtase_alloc_msix(struct pci_dev *pdev, struct rtase_private *tp)
|
||||
|
||||
for (i = 0; i < tp->int_nums; i++) {
|
||||
irq = pci_irq_vector(pdev, i);
|
||||
if (!irq) {
|
||||
if (irq < 0) {
|
||||
pci_disable_msix(pdev);
|
||||
return irq;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <linux/iommu.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/module.h>
|
||||
@@ -19,6 +20,8 @@ struct tegra_mgbe {
|
||||
struct reset_control *rst_mac;
|
||||
struct reset_control *rst_pcs;
|
||||
|
||||
u32 iommu_sid;
|
||||
|
||||
void __iomem *hv;
|
||||
void __iomem *regs;
|
||||
void __iomem *xpcs;
|
||||
@@ -50,7 +53,6 @@ struct tegra_mgbe {
|
||||
#define MGBE_WRAP_COMMON_INTR_ENABLE 0x8704
|
||||
#define MAC_SBD_INTR BIT(2)
|
||||
#define MGBE_WRAP_AXI_ASID0_CTRL 0x8400
|
||||
#define MGBE_SID 0x6
|
||||
|
||||
static int __maybe_unused tegra_mgbe_suspend(struct device *dev)
|
||||
{
|
||||
@@ -84,7 +86,7 @@ static int __maybe_unused tegra_mgbe_resume(struct device *dev)
|
||||
writel(MAC_SBD_INTR, mgbe->regs + MGBE_WRAP_COMMON_INTR_ENABLE);
|
||||
|
||||
/* Program SID */
|
||||
writel(MGBE_SID, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL);
|
||||
writel(mgbe->iommu_sid, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL);
|
||||
|
||||
value = readl(mgbe->xpcs + XPCS_WRAP_UPHY_STATUS);
|
||||
if ((value & XPCS_WRAP_UPHY_STATUS_TX_P_UP) == 0) {
|
||||
@@ -241,6 +243,12 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(mgbe->xpcs))
|
||||
return PTR_ERR(mgbe->xpcs);
|
||||
|
||||
/* get controller's stream id from iommu property in device tree */
|
||||
if (!tegra_dev_iommu_get_stream_id(mgbe->dev, &mgbe->iommu_sid)) {
|
||||
dev_err(mgbe->dev, "failed to get iommu stream id\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
res.addr = mgbe->regs;
|
||||
res.irq = irq;
|
||||
|
||||
@@ -346,7 +354,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
|
||||
writel(MAC_SBD_INTR, mgbe->regs + MGBE_WRAP_COMMON_INTR_ENABLE);
|
||||
|
||||
/* Program SID */
|
||||
writel(MGBE_SID, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL);
|
||||
writel(mgbe->iommu_sid, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL);
|
||||
|
||||
plat->flags |= STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP;
|
||||
|
||||
|
||||
@@ -334,27 +334,25 @@ int wx_host_interface_command(struct wx *wx, u32 *buffer,
|
||||
status = read_poll_timeout(rd32, hicr, hicr & WX_MNG_MBOX_CTL_FWRDY, 1000,
|
||||
timeout * 1000, false, wx, WX_MNG_MBOX_CTL);
|
||||
|
||||
buf[0] = rd32(wx, WX_MNG_MBOX);
|
||||
if ((buf[0] & 0xff0000) >> 16 == 0x80) {
|
||||
wx_err(wx, "Unknown FW command: 0x%x\n", buffer[0] & 0xff);
|
||||
status = -EINVAL;
|
||||
goto rel_out;
|
||||
}
|
||||
|
||||
/* Check command completion */
|
||||
if (status) {
|
||||
wx_dbg(wx, "Command has failed with no status valid.\n");
|
||||
|
||||
buf[0] = rd32(wx, WX_MNG_MBOX);
|
||||
if ((buffer[0] & 0xff) != (~buf[0] >> 24)) {
|
||||
status = -EINVAL;
|
||||
goto rel_out;
|
||||
}
|
||||
if ((buf[0] & 0xff0000) >> 16 == 0x80) {
|
||||
wx_dbg(wx, "It's unknown cmd.\n");
|
||||
status = -EINVAL;
|
||||
goto rel_out;
|
||||
}
|
||||
|
||||
wx_err(wx, "Command has failed with no status valid.\n");
|
||||
wx_dbg(wx, "write value:\n");
|
||||
for (i = 0; i < dword_len; i++)
|
||||
wx_dbg(wx, "%x ", buffer[i]);
|
||||
wx_dbg(wx, "read value:\n");
|
||||
for (i = 0; i < dword_len; i++)
|
||||
wx_dbg(wx, "%x ", buf[i]);
|
||||
wx_dbg(wx, "\ncheck: %x %x\n", buffer[0] & 0xff, ~buf[0] >> 24);
|
||||
|
||||
goto rel_out;
|
||||
}
|
||||
|
||||
if (!return_data)
|
||||
|
||||
@@ -3072,7 +3072,11 @@ static int ca8210_probe(struct spi_device *spi_device)
|
||||
spi_set_drvdata(priv->spi, priv);
|
||||
if (IS_ENABLED(CONFIG_IEEE802154_CA8210_DEBUGFS)) {
|
||||
cascoda_api_upstream = ca8210_test_int_driver_write;
|
||||
ca8210_test_interface_init(priv);
|
||||
ret = ca8210_test_interface_init(priv);
|
||||
if (ret) {
|
||||
dev_crit(&spi_device->dev, "ca8210_test_interface_init failed\n");
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
cascoda_api_upstream = NULL;
|
||||
}
|
||||
|
||||
@@ -125,6 +125,8 @@ static int mctp_i3c_read(struct mctp_i3c_device *mi)
|
||||
|
||||
xfer.data.in = skb_put(skb, mi->mrl);
|
||||
|
||||
/* Make sure netif_rx() is read in the same order as i3c. */
|
||||
mutex_lock(&mi->lock);
|
||||
rc = i3c_device_do_priv_xfers(mi->i3c, &xfer, 1);
|
||||
if (rc < 0)
|
||||
goto err;
|
||||
@@ -166,8 +168,10 @@ static int mctp_i3c_read(struct mctp_i3c_device *mi)
|
||||
stats->rx_dropped++;
|
||||
}
|
||||
|
||||
mutex_unlock(&mi->lock);
|
||||
return 0;
|
||||
err:
|
||||
mutex_unlock(&mi->lock);
|
||||
kfree_skb(skb);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -507,8 +507,7 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig)
|
||||
{
|
||||
u32 type = event->attr.type;
|
||||
u64 config = event->attr.config;
|
||||
u64 raw_config_val;
|
||||
int ret;
|
||||
int ret = -ENOENT;
|
||||
|
||||
/*
|
||||
* Ensure we are finished checking standard hardware events for
|
||||
@@ -528,21 +527,20 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig)
|
||||
case PERF_TYPE_RAW:
|
||||
/*
|
||||
* As per SBI specification, the upper 16 bits must be unused
|
||||
* for a raw event.
|
||||
* for a hardware raw event.
|
||||
* Bits 63:62 are used to distinguish between raw events
|
||||
* 00 - Hardware raw event
|
||||
* 10 - SBI firmware events
|
||||
* 11 - Risc-V platform specific firmware event
|
||||
*/
|
||||
raw_config_val = config & RISCV_PMU_RAW_EVENT_MASK;
|
||||
|
||||
switch (config >> 62) {
|
||||
case 0:
|
||||
ret = RISCV_PMU_RAW_EVENT_IDX;
|
||||
*econfig = raw_config_val;
|
||||
*econfig = config & RISCV_PMU_RAW_EVENT_MASK;
|
||||
break;
|
||||
case 2:
|
||||
ret = (raw_config_val & 0xFFFF) |
|
||||
(SBI_PMU_EVENT_TYPE_FW << 16);
|
||||
ret = (config & 0xFFFF) | (SBI_PMU_EVENT_TYPE_FW << 16);
|
||||
break;
|
||||
case 3:
|
||||
/*
|
||||
@@ -551,12 +549,13 @@ static int pmu_sbi_event_map(struct perf_event *event, u64 *econfig)
|
||||
* Event data - raw event encoding
|
||||
*/
|
||||
ret = SBI_PMU_EVENT_TYPE_FW << 16 | RISCV_PLAT_FW_EVENT;
|
||||
*econfig = raw_config_val;
|
||||
*econfig = config & RISCV_PMU_PLAT_FW_EVENT_MASK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = -ENOENT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -947,6 +947,10 @@ static int amd_pmc_suspend_handler(struct device *dev)
|
||||
{
|
||||
struct amd_pmc_dev *pdev = dev_get_drvdata(dev);
|
||||
|
||||
/*
|
||||
* Must be called only from the same set of dev_pm_ops handlers
|
||||
* as i8042_pm_suspend() is called: currently just from .suspend.
|
||||
*/
|
||||
if (pdev->disable_8042_wakeup && !disable_workarounds) {
|
||||
int rc = amd_pmc_wa_irq1(pdev);
|
||||
|
||||
@@ -959,7 +963,9 @@ static int amd_pmc_suspend_handler(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL);
|
||||
static const struct dev_pm_ops amd_pmc_pm = {
|
||||
.suspend = amd_pmc_suspend_handler,
|
||||
};
|
||||
|
||||
static const struct pci_device_id pmc_pci_ids[] = {
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PS) },
|
||||
|
||||
@@ -269,8 +269,12 @@ pmc_core_ssram_get_pmc(struct pmc_dev *pmcdev, int pmc_idx, u32 offset)
|
||||
/*
|
||||
* The secondary PMC BARS (which are behind hidden PCI devices)
|
||||
* are read from fixed offsets in MMIO of the primary PMC BAR.
|
||||
* If a device is not present, the value will be 0.
|
||||
*/
|
||||
ssram_base = get_base(tmp_ssram, offset);
|
||||
if (!ssram_base)
|
||||
return 0;
|
||||
|
||||
ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);
|
||||
if (!ssram)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -158,7 +158,7 @@ static int ad9832_write_frequency(struct ad9832_state *st,
|
||||
static int ad9832_write_phase(struct ad9832_state *st,
|
||||
unsigned long addr, unsigned long phase)
|
||||
{
|
||||
if (phase > BIT(AD9832_PHASE_BITS))
|
||||
if (phase >= BIT(AD9832_PHASE_BITS))
|
||||
return -EINVAL;
|
||||
|
||||
st->phase_data[0] = cpu_to_be16((AD9832_CMD_PHA8BITSW << CMD_SHIFT) |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user