Linux 6.4-rc2

-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmRhO8weHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGscUH/3T3ofuhSxphqi0F
 kBsfuZ2mFD9G0JrYZmN6jcAv5+NFPe10+oZsayPlVqdY+CbTqLvkBTxQWm3VnjDT
 wJ2spqhQuVb7gNYqKO+AYlNdjpC5ckFJLc0xHMcFioTocob3E4sVPMZ7ff1n9+LX
 0L+V+T3Dwn7XzT9h5RLhPHQKtTEOfuu2uOSUxYeoS1ChSsbh7Ok8RfdNDW+LHVck
 B0QuuOmxf1nsob8AOU26A3ZBdeFxCzr6fa9NblYTu3ul5kzpJs4Fv3LzFCd80mH6
 lq4d4LlMnCdAPIqgZfb1k+V9CgILE8JQH6ajfrMcpveD67T5/2qZIEFoMRCcsuca
 f/vIcfM=
 =os13
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmRm7cATHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0CMdB/wPtzv9SU+fO61GWdqPaDa4f53qEiM4
 jWLuhPgxON4glIAqm4RJqPwb2FzF28V1UzlmDRD5dQczCSBgWsFpaxOpC9APhxNW
 TRaKmJzNPqpCIvHShQ6UWbMOqvp+GPJRu+tXBl/rZaUYums4u1Sp5GJLxvlHP//B
 /9gfiiqoaqgXrNbLTpzOumBcZLFUO3hNQH5SAVr9Y0BbmNK2okV1ZyWO0AUREvn8
 tUNjDNLzPwWGgZyrmgQHSBiNREevM1WM9/uNbX6PcyZapTPLGeIKclJfNj7sSFpH
 Ua6vZSsqUhBbeFyuZ8nGqPYawuO3AJvlnfdy1xZIgO4eA8772DhMw38+
 =iaNV
 -----END PGP SIGNATURE-----

Merge tag 'v6.4-rc2' into asoc-6.5 to get fixes for CI

Linux 6.4-rc2
This commit is contained in:
Mark Brown 2023-05-19 12:32:04 +09:00
commit af53b00fa3
192 changed files with 2883 additions and 2008 deletions

View File

@ -18,7 +18,6 @@ Block
kyber-iosched kyber-iosched
null_blk null_blk
pr pr
request
stat stat
switching-sched switching-sched
writeback_cache_control writeback_cache_control

View File

@ -1,99 +0,0 @@
============================
struct request documentation
============================
Jens Axboe <jens.axboe@oracle.com> 27/05/02
.. FIXME:
No idea about what does mean - seems just some noise, so comment it
1.0
Index
2.0 Struct request members classification
2.1 struct request members explanation
3.0
2.0
Short explanation of request members
====================================
Classification flags:
= ====================
D driver member
B block layer member
I I/O scheduler member
= ====================
Unless an entry contains a D classification, a device driver must not access
this member. Some members may contain D classifications, but should only be
access through certain macros or functions (eg ->flags).
<linux/blkdev.h>
=============================== ======= =======================================
Member Flag Comment
=============================== ======= =======================================
struct list_head queuelist BI Organization on various internal
queues
``void *elevator_private`` I I/O scheduler private data
unsigned char cmd[16] D Driver can use this for setting up
a cdb before execution, see
blk_queue_prep_rq
unsigned long flags DBI Contains info about data direction,
request type, etc.
int rq_status D Request status bits
kdev_t rq_dev DBI Target device
int errors DB Error counts
sector_t sector DBI Target location
unsigned long hard_nr_sectors B Used to keep sector sane
unsigned long nr_sectors DBI Total number of sectors in request
unsigned long hard_nr_sectors B Used to keep nr_sectors sane
unsigned short nr_phys_segments DB Number of physical scatter gather
segments in a request
unsigned short nr_hw_segments DB Number of hardware scatter gather
segments in a request
unsigned int current_nr_sectors DB Number of sectors in first segment
of request
unsigned int hard_cur_sectors B Used to keep current_nr_sectors sane
int tag DB TCQ tag, if assigned
``void *special`` D Free to be used by driver
``char *buffer`` D Map of first segment, also see
section on bouncing SECTION
``struct completion *waiting`` D Can be used by driver to get signalled
on request completion
``struct bio *bio`` DBI First bio in request
``struct bio *biotail`` DBI Last bio in request
``struct request_queue *q`` DB Request queue this request belongs to
``struct request_list *rl`` B Request list this request came from
=============================== ======= =======================================

View File

@ -49,6 +49,7 @@ properties:
properties: properties:
data-lanes: data-lanes:
minItems: 1
maxItems: 2 maxItems: 2
required: required:

View File

@ -17,20 +17,11 @@ description:
properties: properties:
clocks: clocks:
minItems: 3 minItems: 3
items: maxItems: 4
- description: PCIe bridge clock.
- description: PCIe bus clock.
- description: PCIe PHY clock.
- description: Additional required clock entry for imx6sx-pcie,
imx6sx-pcie-ep, imx8mq-pcie, imx8mq-pcie-ep.
clock-names: clock-names:
minItems: 3 minItems: 3
items: maxItems: 4
- const: pcie
- const: pcie_bus
- enum: [ pcie_phy, pcie_aux ]
- enum: [ pcie_inbound_axi, pcie_aux ]
num-lanes: num-lanes:
const: 1 const: 1

View File

@ -31,6 +31,19 @@ properties:
- const: dbi - const: dbi
- const: addr_space - const: addr_space
clocks:
minItems: 3
items:
- description: PCIe bridge clock.
- description: PCIe bus clock.
- description: PCIe PHY clock.
- description: Additional required clock entry for imx6sx-pcie,
imx6sx-pcie-ep, imx8mq-pcie, imx8mq-pcie-ep.
clock-names:
minItems: 3
maxItems: 4
interrupts: interrupts:
items: items:
- description: builtin eDMA interrupter. - description: builtin eDMA interrupter.
@ -49,6 +62,31 @@ required:
allOf: allOf:
- $ref: /schemas/pci/snps,dw-pcie-ep.yaml# - $ref: /schemas/pci/snps,dw-pcie-ep.yaml#
- $ref: /schemas/pci/fsl,imx6q-pcie-common.yaml# - $ref: /schemas/pci/fsl,imx6q-pcie-common.yaml#
- if:
properties:
compatible:
enum:
- fsl,imx8mq-pcie-ep
then:
properties:
clocks:
minItems: 4
clock-names:
items:
- const: pcie
- const: pcie_bus
- const: pcie_phy
- const: pcie_aux
else:
properties:
clocks:
maxItems: 3
clock-names:
items:
- const: pcie
- const: pcie_bus
- const: pcie_aux
unevaluatedProperties: false unevaluatedProperties: false

View File

@ -40,6 +40,19 @@ properties:
- const: dbi - const: dbi
- const: config - const: config
clocks:
minItems: 3
items:
- description: PCIe bridge clock.
- description: PCIe bus clock.
- description: PCIe PHY clock.
- description: Additional required clock entry for imx6sx-pcie,
imx6sx-pcie-ep, imx8mq-pcie, imx8mq-pcie-ep.
clock-names:
minItems: 3
maxItems: 4
interrupts: interrupts:
items: items:
- description: builtin MSI controller. - description: builtin MSI controller.
@ -77,6 +90,70 @@ required:
allOf: allOf:
- $ref: /schemas/pci/snps,dw-pcie.yaml# - $ref: /schemas/pci/snps,dw-pcie.yaml#
- $ref: /schemas/pci/fsl,imx6q-pcie-common.yaml# - $ref: /schemas/pci/fsl,imx6q-pcie-common.yaml#
- if:
properties:
compatible:
enum:
- fsl,imx6sx-pcie
then:
properties:
clocks:
minItems: 4
clock-names:
items:
- const: pcie
- const: pcie_bus
- const: pcie_phy
- const: pcie_inbound_axi
- if:
properties:
compatible:
enum:
- fsl,imx8mq-pcie
then:
properties:
clocks:
minItems: 4
clock-names:
items:
- const: pcie
- const: pcie_bus
- const: pcie_phy
- const: pcie_aux
- if:
properties:
compatible:
enum:
- fsl,imx6q-pcie
- fsl,imx6qp-pcie
- fsl,imx7d-pcie
then:
properties:
clocks:
maxItems: 3
clock-names:
items:
- const: pcie
- const: pcie_bus
- const: pcie_phy
- if:
properties:
compatible:
enum:
- fsl,imx8mm-pcie
- fsl,imx8mp-pcie
then:
properties:
clocks:
maxItems: 3
clock-names:
items:
- const: pcie
- const: pcie_bus
- const: pcie_aux
unevaluatedProperties: false unevaluatedProperties: false

View File

@ -776,10 +776,11 @@ peer_notif_delay
Specify the delay, in milliseconds, between each peer Specify the delay, in milliseconds, between each peer
notification (gratuitous ARP and unsolicited IPv6 Neighbor notification (gratuitous ARP and unsolicited IPv6 Neighbor
Advertisement) when they are issued after a failover event. Advertisement) when they are issued after a failover event.
This delay should be a multiple of the link monitor interval This delay should be a multiple of the MII link monitor interval
(arp_interval or miimon, whichever is active). The default (miimon).
value is 0 which means to match the value of the link monitor
interval. The valid range is 0 - 300000. The default value is 0, which means
to match the value of the MII link monitor interval.
prio prio
Slave priority. A higher number means higher priority. Slave priority. A higher number means higher priority.

View File

@ -116,8 +116,8 @@ Contents:
udplite udplite
vrf vrf
vxlan vxlan
x25-iface
x25 x25
x25-iface
xfrm_device xfrm_device
xfrm_proc xfrm_proc
xfrm_sync xfrm_sync

View File

@ -1,8 +1,7 @@
.. SPDX-License-Identifier: GPL-2.0 .. SPDX-License-Identifier: GPL-2.0
============================-
X.25 Device Driver Interface X.25 Device Driver Interface
============================- ============================
Version 1.1 Version 1.1

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
VERSION = 6 VERSION = 6
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc1 EXTRAVERSION = -rc2
NAME = Hurr durr I'ma ninja sloth NAME = Hurr durr I'ma ninja sloth
# *DOCUMENTATION* # *DOCUMENTATION*

View File

@ -308,6 +308,29 @@ static int unwind_exec_pop_subset_r0_to_r3(struct unwind_ctrl_block *ctrl,
return URC_OK; return URC_OK;
} }
static unsigned long unwind_decode_uleb128(struct unwind_ctrl_block *ctrl)
{
unsigned long bytes = 0;
unsigned long insn;
unsigned long result = 0;
/*
* unwind_get_byte() will advance `ctrl` one instruction at a time, so
* loop until we get an instruction byte where bit 7 is not set.
*
* Note: This decodes a maximum of 4 bytes to output 28 bits data where
* max is 0xfffffff: that will cover a vsp increment of 1073742336, hence
* it is sufficient for unwinding the stack.
*/
do {
insn = unwind_get_byte(ctrl);
result |= (insn & 0x7f) << (bytes * 7);
bytes++;
} while (!!(insn & 0x80) && (bytes != sizeof(result)));
return result;
}
/* /*
* Execute the current unwind instruction. * Execute the current unwind instruction.
*/ */
@ -361,7 +384,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
if (ret) if (ret)
goto error; goto error;
} else if (insn == 0xb2) { } else if (insn == 0xb2) {
unsigned long uleb128 = unwind_get_byte(ctrl); unsigned long uleb128 = unwind_decode_uleb128(ctrl);
ctrl->vrs[SP] += 0x204 + (uleb128 << 2); ctrl->vrs[SP] += 0x204 + (uleb128 << 2);
} else { } else {

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/** /*
* arch/arm/mac-sa1100/jornada720_ssp.c * arch/arm/mac-sa1100/jornada720_ssp.c
* *
* Copyright (C) 2006/2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com> * Copyright (C) 2006/2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
@ -26,6 +26,7 @@ static unsigned long jornada_ssp_flags;
/** /**
* jornada_ssp_reverse - reverses input byte * jornada_ssp_reverse - reverses input byte
* @byte: input byte to reverse
* *
* we need to reverse all data we receive from the mcu due to its physical location * we need to reverse all data we receive from the mcu due to its physical location
* returns : 01110111 -> 11101110 * returns : 01110111 -> 11101110
@ -46,6 +47,7 @@ EXPORT_SYMBOL(jornada_ssp_reverse);
/** /**
* jornada_ssp_byte - waits for ready ssp bus and sends byte * jornada_ssp_byte - waits for ready ssp bus and sends byte
* @byte: input byte to transmit
* *
* waits for fifo buffer to clear and then transmits, if it doesn't then we will * waits for fifo buffer to clear and then transmits, if it doesn't then we will
* timeout after <timeout> rounds. Needs mcu running before its called. * timeout after <timeout> rounds. Needs mcu running before its called.
@ -77,6 +79,7 @@ EXPORT_SYMBOL(jornada_ssp_byte);
/** /**
* jornada_ssp_inout - decide if input is command or trading byte * jornada_ssp_inout - decide if input is command or trading byte
* @byte: input byte to send (may be %TXDUMMY)
* *
* returns : (jornada_ssp_byte(byte)) on success * returns : (jornada_ssp_byte(byte)) on success
* : %-ETIMEDOUT on timeout failure * : %-ETIMEDOUT on timeout failure

View File

@ -23,6 +23,9 @@
@ @
ENTRY(do_vfp) ENTRY(do_vfp)
mov r1, r10 mov r1, r10
mov r3, r9 str lr, [sp, #-8]!
b vfp_entry add r3, sp, #4
str r9, [r3]
bl vfp_entry
ldr pc, [sp], #8
ENDPROC(do_vfp) ENDPROC(do_vfp)

View File

@ -172,13 +172,14 @@ vfp_hw_state_valid:
@ out before setting an FPEXC that @ out before setting an FPEXC that
@ stops us reading stuff @ stops us reading stuff
VFPFMXR FPEXC, r1 @ Restore FPEXC last VFPFMXR FPEXC, r1 @ Restore FPEXC last
mov sp, r3 @ we think we have handled things
pop {lr}
sub r2, r2, #4 @ Retry current instruction - if Thumb sub r2, r2, #4 @ Retry current instruction - if Thumb
str r2, [sp, #S_PC] @ mode it's two 16-bit instructions, str r2, [sp, #S_PC] @ mode it's two 16-bit instructions,
@ else it's one 32-bit instruction, so @ else it's one 32-bit instruction, so
@ always subtract 4 from the following @ always subtract 4 from the following
@ instruction address. @ instruction address.
mov lr, r3 @ we think we have handled things
local_bh_enable_and_ret: local_bh_enable_and_ret:
adr r0, . adr r0, .
mov r1, #SOFTIRQ_DISABLE_OFFSET mov r1, #SOFTIRQ_DISABLE_OFFSET
@ -209,8 +210,9 @@ skip:
process_exception: process_exception:
DBGSTR "bounce" DBGSTR "bounce"
mov sp, r3 @ setup for a return to the user code.
pop {lr}
mov r2, sp @ nothing stacked - regdump is at TOS mov r2, sp @ nothing stacked - regdump is at TOS
mov lr, r3 @ setup for a return to the user code.
@ Now call the C code to package up the bounce to the support code @ Now call the C code to package up the bounce to the support code
@ r0 holds the trigger instruction @ r0 holds the trigger instruction

View File

@ -413,12 +413,12 @@ extern void paging_init (void);
* For the 64bit version, the offset is extended by 32bit. * For the 64bit version, the offset is extended by 32bit.
*/ */
#define __swp_type(x) ((x).val & 0x1f) #define __swp_type(x) ((x).val & 0x1f)
#define __swp_offset(x) ( (((x).val >> 6) & 0x7) | \ #define __swp_offset(x) ( (((x).val >> 5) & 0x7) | \
(((x).val >> 8) & ~0x7) ) (((x).val >> 10) << 3) )
#define __swp_entry(type, offset) ((swp_entry_t) { \ #define __swp_entry(type, offset) ((swp_entry_t) { \
((type) & 0x1f) | \ ((type) & 0x1f) | \
((offset & 0x7) << 6) | \ ((offset & 0x7) << 5) | \
((offset & ~0x7) << 8) }) ((offset >> 3) << 10) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val })

View File

@ -4,6 +4,8 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/kexec.h> #include <linux/kexec.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/reboot.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/sections.h> #include <asm/sections.h>

View File

@ -22,7 +22,7 @@ KCOV_INSTRUMENT := n
$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \ $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
--remove-section=.note.gnu.property \ --remove-section=.note.gnu.property \
--prefix-alloc-sections=.init --prefix-alloc-sections=.init.pi
$(obj)/%.pi.o: $(obj)/%.o FORCE $(obj)/%.pi.o: $(obj)/%.o FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)

View File

@ -84,11 +84,8 @@ SECTIONS
__init_data_begin = .; __init_data_begin = .;
INIT_DATA_SECTION(16) INIT_DATA_SECTION(16)
/* Those sections result from the compilation of kernel/pi/string.c */ .init.pi : {
.init.pidata : { *(.init.pi*)
*(.init.srodata.cst8*)
*(.init__bug_table*)
*(.init.sdata*)
} }
.init.bss : { .init.bss : {

View File

@ -1703,10 +1703,8 @@ int x86_pmu_handle_irq(struct pt_regs *regs)
perf_sample_data_init(&data, 0, event->hw.last_period); perf_sample_data_init(&data, 0, event->hw.last_period);
if (has_branch_stack(event)) { if (has_branch_stack(event))
data.br_stack = &cpuc->lbr_stack; perf_sample_save_brstack(&data, event, &cpuc->lbr_stack);
data.sample_flags |= PERF_SAMPLE_BRANCH_STACK;
}
if (perf_event_overflow(event, &data, regs)) if (perf_event_overflow(event, &data, regs))
x86_pmu_stop(event, 0); x86_pmu_stop(event, 0);

View File

@ -1229,12 +1229,14 @@ pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc,
struct perf_event *event, bool add) struct perf_event *event, bool add)
{ {
struct pmu *pmu = event->pmu; struct pmu *pmu = event->pmu;
/* /*
* Make sure we get updated with the first PEBS * Make sure we get updated with the first PEBS
* event. It will trigger also during removal, but * event. It will trigger also during removal, but
* that does not hurt: * that does not hurt:
*/ */
bool update = cpuc->n_pebs == 1; if (cpuc->n_pebs == 1)
cpuc->pebs_data_cfg = PEBS_UPDATE_DS_SW;
if (needed_cb != pebs_needs_sched_cb(cpuc)) { if (needed_cb != pebs_needs_sched_cb(cpuc)) {
if (!needed_cb) if (!needed_cb)
@ -1242,7 +1244,7 @@ pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc,
else else
perf_sched_cb_dec(pmu); perf_sched_cb_dec(pmu);
update = true; cpuc->pebs_data_cfg |= PEBS_UPDATE_DS_SW;
} }
/* /*
@ -1252,24 +1254,13 @@ pebs_update_state(bool needed_cb, struct cpu_hw_events *cpuc,
if (x86_pmu.intel_cap.pebs_baseline && add) { if (x86_pmu.intel_cap.pebs_baseline && add) {
u64 pebs_data_cfg; u64 pebs_data_cfg;
/* Clear pebs_data_cfg and pebs_record_size for first PEBS. */
if (cpuc->n_pebs == 1) {
cpuc->pebs_data_cfg = 0;
cpuc->pebs_record_size = sizeof(struct pebs_basic);
}
pebs_data_cfg = pebs_update_adaptive_cfg(event); pebs_data_cfg = pebs_update_adaptive_cfg(event);
/*
/* Update pebs_record_size if new event requires more data. */ * Be sure to update the thresholds when we change the record.
if (pebs_data_cfg & ~cpuc->pebs_data_cfg) { */
cpuc->pebs_data_cfg |= pebs_data_cfg; if (pebs_data_cfg & ~cpuc->pebs_data_cfg)
adaptive_pebs_record_size_update(); cpuc->pebs_data_cfg |= pebs_data_cfg | PEBS_UPDATE_DS_SW;
update = true;
} }
}
if (update)
pebs_update_threshold(cpuc);
} }
void intel_pmu_pebs_add(struct perf_event *event) void intel_pmu_pebs_add(struct perf_event *event)
@ -1326,9 +1317,17 @@ static void intel_pmu_pebs_via_pt_enable(struct perf_event *event)
wrmsrl(base + idx, value); wrmsrl(base + idx, value);
} }
static inline void intel_pmu_drain_large_pebs(struct cpu_hw_events *cpuc)
{
if (cpuc->n_pebs == cpuc->n_large_pebs &&
cpuc->n_pebs != cpuc->n_pebs_via_pt)
intel_pmu_drain_pebs_buffer();
}
void intel_pmu_pebs_enable(struct perf_event *event) void intel_pmu_pebs_enable(struct perf_event *event)
{ {
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
u64 pebs_data_cfg = cpuc->pebs_data_cfg & ~PEBS_UPDATE_DS_SW;
struct hw_perf_event *hwc = &event->hw; struct hw_perf_event *hwc = &event->hw;
struct debug_store *ds = cpuc->ds; struct debug_store *ds = cpuc->ds;
unsigned int idx = hwc->idx; unsigned int idx = hwc->idx;
@ -1344,11 +1343,22 @@ void intel_pmu_pebs_enable(struct perf_event *event)
if (x86_pmu.intel_cap.pebs_baseline) { if (x86_pmu.intel_cap.pebs_baseline) {
hwc->config |= ICL_EVENTSEL_ADAPTIVE; hwc->config |= ICL_EVENTSEL_ADAPTIVE;
if (cpuc->pebs_data_cfg != cpuc->active_pebs_data_cfg) { if (pebs_data_cfg != cpuc->active_pebs_data_cfg) {
wrmsrl(MSR_PEBS_DATA_CFG, cpuc->pebs_data_cfg); /*
cpuc->active_pebs_data_cfg = cpuc->pebs_data_cfg; * drain_pebs() assumes uniform record size;
* hence we need to drain when changing said
* size.
*/
intel_pmu_drain_large_pebs(cpuc);
adaptive_pebs_record_size_update();
wrmsrl(MSR_PEBS_DATA_CFG, pebs_data_cfg);
cpuc->active_pebs_data_cfg = pebs_data_cfg;
} }
} }
if (cpuc->pebs_data_cfg & PEBS_UPDATE_DS_SW) {
cpuc->pebs_data_cfg = pebs_data_cfg;
pebs_update_threshold(cpuc);
}
if (idx >= INTEL_PMC_IDX_FIXED) { if (idx >= INTEL_PMC_IDX_FIXED) {
if (x86_pmu.intel_cap.pebs_format < 5) if (x86_pmu.intel_cap.pebs_format < 5)
@ -1391,9 +1401,7 @@ void intel_pmu_pebs_disable(struct perf_event *event)
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct hw_perf_event *hwc = &event->hw; struct hw_perf_event *hwc = &event->hw;
if (cpuc->n_pebs == cpuc->n_large_pebs && intel_pmu_drain_large_pebs(cpuc);
cpuc->n_pebs != cpuc->n_pebs_via_pt)
intel_pmu_drain_pebs_buffer();
cpuc->pebs_enabled &= ~(1ULL << hwc->idx); cpuc->pebs_enabled &= ~(1ULL << hwc->idx);

View File

@ -121,6 +121,9 @@
#define PEBS_DATACFG_LBRS BIT_ULL(3) #define PEBS_DATACFG_LBRS BIT_ULL(3)
#define PEBS_DATACFG_LBR_SHIFT 24 #define PEBS_DATACFG_LBR_SHIFT 24
/* Steal the highest bit of pebs_data_cfg for SW usage */
#define PEBS_UPDATE_DS_SW BIT_ULL(63)
/* /*
* Intel "Architectural Performance Monitoring" CPUID * Intel "Architectural Performance Monitoring" CPUID
* detection/enumeration details: * detection/enumeration details:

View File

@ -36,6 +36,7 @@
#define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e #define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e
#define PCI_DEVICE_ID_AMD_19H_M60H_DF_F4 0x14e4 #define PCI_DEVICE_ID_AMD_19H_M60H_DF_F4 0x14e4
#define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4 #define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4
#define PCI_DEVICE_ID_AMD_19H_M78H_DF_F4 0x12fc
/* Protect the PCI config register pairs used for SMN. */ /* Protect the PCI config register pairs used for SMN. */
static DEFINE_MUTEX(smn_mutex); static DEFINE_MUTEX(smn_mutex);
@ -79,6 +80,7 @@ static const struct pci_device_id amd_nb_misc_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F3) },
{} {}
}; };

View File

@ -144,8 +144,8 @@ SYM_CODE_END(__x86_indirect_jump_thunk_array)
*/ */
.align 64 .align 64
.skip 63, 0xcc .skip 63, 0xcc
SYM_FUNC_START_NOALIGN(zen_untrain_ret); SYM_START(zen_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
ANNOTATE_NOENDBR
/* /*
* As executed from zen_untrain_ret, this is: * As executed from zen_untrain_ret, this is:
* *

View File

@ -1666,7 +1666,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd)
return -EIO; return -EIO;
dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir); dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir);
if (!dir) { if (IS_ERR(dir)) {
dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n", dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n",
nbd_name(nbd)); nbd_name(nbd));
return -EIO; return -EIO;
@ -1692,7 +1692,7 @@ static int nbd_dbg_init(void)
struct dentry *dbg_dir; struct dentry *dbg_dir;
dbg_dir = debugfs_create_dir("nbd", NULL); dbg_dir = debugfs_create_dir("nbd", NULL);
if (!dbg_dir) if (IS_ERR(dbg_dir))
return -EIO; return -EIO;
nbd_dbg_dir = dbg_dir; nbd_dbg_dir = dbg_dir;

View File

@ -241,7 +241,7 @@ static inline blk_opf_t rnbd_to_bio_flags(u32 rnbd_opf)
bio_opf = REQ_OP_WRITE; bio_opf = REQ_OP_WRITE;
break; break;
case RNBD_OP_FLUSH: case RNBD_OP_FLUSH:
bio_opf = REQ_OP_FLUSH | REQ_PREFLUSH; bio_opf = REQ_OP_WRITE | REQ_PREFLUSH;
break; break;
case RNBD_OP_DISCARD: case RNBD_OP_DISCARD:
bio_opf = REQ_OP_DISCARD; bio_opf = REQ_OP_DISCARD;

View File

@ -1281,7 +1281,7 @@ static inline int ublk_check_cmd_op(u32 cmd_op)
{ {
u32 ioc_type = _IOC_TYPE(cmd_op); u32 ioc_type = _IOC_TYPE(cmd_op);
if (IS_ENABLED(CONFIG_BLKDEV_UBLK_LEGACY_OPCODES) && ioc_type != 'u') if (!IS_ENABLED(CONFIG_BLKDEV_UBLK_LEGACY_OPCODES) && ioc_type != 'u')
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (ioc_type != 'u' && ioc_type != 0) if (ioc_type != 'u' && ioc_type != 0)

View File

@ -571,6 +571,7 @@ void read_cdat_data(struct cxl_port *port)
/* Don't leave table data allocated on error */ /* Don't leave table data allocated on error */
devm_kfree(dev, cdat_table); devm_kfree(dev, cdat_table);
dev_err(dev, "CDAT data read error\n"); dev_err(dev, "CDAT data read error\n");
return;
} }
port->cdat.table = cdat_table + sizeof(__le32); port->cdat.table = cdat_table + sizeof(__le32);

View File

@ -706,21 +706,22 @@ static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r,
int rcode; int rcode;
if (destination == IEEE1394_ALL_NODES) { if (destination == IEEE1394_ALL_NODES) {
kfree(r); // Although the response to the broadcast packet is not necessarily required, the
// fw_send_response() function should still be called to maintain the reference
return; // counting of the object. In the case, the call of function just releases the
} // object as a result to decrease the reference counting.
rcode = RCODE_COMPLETE;
if (offset != dev->handler.offset) } else if (offset != dev->handler.offset) {
rcode = RCODE_ADDRESS_ERROR; rcode = RCODE_ADDRESS_ERROR;
else if (tcode != TCODE_WRITE_BLOCK_REQUEST) } else if (tcode != TCODE_WRITE_BLOCK_REQUEST) {
rcode = RCODE_TYPE_ERROR; rcode = RCODE_TYPE_ERROR;
else if (fwnet_incoming_packet(dev, payload, length, } else if (fwnet_incoming_packet(dev, payload, length,
source, generation, false) != 0) { source, generation, false) != 0) {
dev_err(&dev->netdev->dev, "incoming packet failure\n"); dev_err(&dev->netdev->dev, "incoming packet failure\n");
rcode = RCODE_CONFLICT_ERROR; rcode = RCODE_CONFLICT_ERROR;
} else } else {
rcode = RCODE_COMPLETE; rcode = RCODE_COMPLETE;
}
fw_send_response(card, r, rcode); fw_send_response(card, r, rcode);
} }

View File

@ -51,7 +51,8 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
* *
* It's not easily possible to fix this in struct screen_info, * It's not easily possible to fix this in struct screen_info,
* as this could break UAPI. The best solution is to compute * as this could break UAPI. The best solution is to compute
* bits_per_pixel here and ignore lfb_depth. In the loop below, * bits_per_pixel from the color bits, reserved bits and
* reported lfb_depth, whichever is highest. In the loop below,
* ignore simplefb formats with alpha bits, as EFI and VESA * ignore simplefb formats with alpha bits, as EFI and VESA
* don't specify alpha channels. * don't specify alpha channels.
*/ */
@ -60,6 +61,7 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
si->green_size + si->green_pos, si->green_size + si->green_pos,
si->blue_size + si->blue_pos), si->blue_size + si->blue_pos),
si->rsvd_size + si->rsvd_pos); si->rsvd_size + si->rsvd_pos);
bits_per_pixel = max_t(u32, bits_per_pixel, si->lfb_depth);
} else { } else {
bits_per_pixel = si->lfb_depth; bits_per_pixel = si->lfb_depth;
} }

View File

@ -3757,6 +3757,12 @@ int amdgpu_device_init(struct amdgpu_device *adev,
adev->have_atomics_support = ((struct amd_sriov_msg_pf2vf_info *) adev->have_atomics_support = ((struct amd_sriov_msg_pf2vf_info *)
adev->virt.fw_reserve.p_pf2vf)->pcie_atomic_ops_support_flags == adev->virt.fw_reserve.p_pf2vf)->pcie_atomic_ops_support_flags ==
(PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64); (PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64);
/* APUs w/ gfx9 onwards doesn't reply on PCIe atomics, rather it is a
* internal path natively support atomics, set have_atomics_support to true.
*/
else if ((adev->flags & AMD_IS_APU) &&
(adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0)))
adev->have_atomics_support = true;
else else
adev->have_atomics_support = adev->have_atomics_support =
!pci_enable_atomic_ops_to_root(adev->pdev, !pci_enable_atomic_ops_to_root(adev->pdev,
@ -4506,7 +4512,11 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
dev_info(adev->dev, "recover vram bo from shadow start\n"); dev_info(adev->dev, "recover vram bo from shadow start\n");
mutex_lock(&adev->shadow_list_lock); mutex_lock(&adev->shadow_list_lock);
list_for_each_entry(vmbo, &adev->shadow_list, shadow_list) { list_for_each_entry(vmbo, &adev->shadow_list, shadow_list) {
shadow = &vmbo->bo; /* If vm is compute context or adev is APU, shadow will be NULL */
if (!vmbo->shadow)
continue;
shadow = vmbo->shadow;
/* No need to recover an evicted BO */ /* No need to recover an evicted BO */
if (shadow->tbo.resource->mem_type != TTM_PL_TT || if (shadow->tbo.resource->mem_type != TTM_PL_TT ||
shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET || shadow->tbo.resource->start == AMDGPU_BO_INVALID_OFFSET ||

View File

@ -687,9 +687,11 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *r
if (r) if (r)
return r; return r;
if (adev->gfx.cp_ecc_error_irq.funcs) {
r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0); r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
if (r) if (r)
goto late_fini; goto late_fini;
}
} else { } else {
amdgpu_ras_feature_enable_on_boot(adev, ras_block, 0); amdgpu_ras_feature_enable_on_boot(adev, ras_block, 0);
} }

View File

@ -1315,13 +1315,6 @@ static int gfx_v11_0_sw_init(void *handle)
if (r) if (r)
return r; return r;
/* ECC error */
r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP,
GFX_11_0_0__SRCID__CP_ECC_ERROR,
&adev->gfx.cp_ecc_error_irq);
if (r)
return r;
/* FED error */ /* FED error */
r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GFX, r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GFX,
GFX_11_0_0__SRCID__RLC_GC_FED_INTERRUPT, GFX_11_0_0__SRCID__RLC_GC_FED_INTERRUPT,
@ -4444,7 +4437,6 @@ static int gfx_v11_0_hw_fini(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
int r; int r;
amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0);
amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0); amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0);
amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0); amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0);
@ -5897,36 +5889,6 @@ static void gfx_v11_0_set_compute_eop_interrupt_state(struct amdgpu_device *adev
} }
} }
#define CP_ME1_PIPE_INST_ADDR_INTERVAL 0x1
#define SET_ECC_ME_PIPE_STATE(reg_addr, state) \
do { \
uint32_t tmp = RREG32_SOC15_IP(GC, reg_addr); \
tmp = REG_SET_FIELD(tmp, CP_ME1_PIPE0_INT_CNTL, CP_ECC_ERROR_INT_ENABLE, state); \
WREG32_SOC15_IP(GC, reg_addr, tmp); \
} while (0)
static int gfx_v11_0_set_cp_ecc_error_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
unsigned type,
enum amdgpu_interrupt_state state)
{
uint32_t ecc_irq_state = 0;
uint32_t pipe0_int_cntl_addr = 0;
int i = 0;
ecc_irq_state = (state == AMDGPU_IRQ_STATE_ENABLE) ? 1 : 0;
pipe0_int_cntl_addr = SOC15_REG_OFFSET(GC, 0, regCP_ME1_PIPE0_INT_CNTL);
WREG32_FIELD15_PREREG(GC, 0, CP_INT_CNTL_RING0, CP_ECC_ERROR_INT_ENABLE, ecc_irq_state);
for (i = 0; i < adev->gfx.mec.num_pipe_per_mec; i++)
SET_ECC_ME_PIPE_STATE(pipe0_int_cntl_addr + i * CP_ME1_PIPE_INST_ADDR_INTERVAL,
ecc_irq_state);
return 0;
}
static int gfx_v11_0_set_eop_interrupt_state(struct amdgpu_device *adev, static int gfx_v11_0_set_eop_interrupt_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *src, struct amdgpu_irq_src *src,
unsigned type, unsigned type,
@ -6341,11 +6303,6 @@ static const struct amdgpu_irq_src_funcs gfx_v11_0_priv_inst_irq_funcs = {
.process = gfx_v11_0_priv_inst_irq, .process = gfx_v11_0_priv_inst_irq,
}; };
static const struct amdgpu_irq_src_funcs gfx_v11_0_cp_ecc_error_irq_funcs = {
.set = gfx_v11_0_set_cp_ecc_error_state,
.process = amdgpu_gfx_cp_ecc_error_irq,
};
static const struct amdgpu_irq_src_funcs gfx_v11_0_rlc_gc_fed_irq_funcs = { static const struct amdgpu_irq_src_funcs gfx_v11_0_rlc_gc_fed_irq_funcs = {
.process = gfx_v11_0_rlc_gc_fed_irq, .process = gfx_v11_0_rlc_gc_fed_irq,
}; };
@ -6361,9 +6318,6 @@ static void gfx_v11_0_set_irq_funcs(struct amdgpu_device *adev)
adev->gfx.priv_inst_irq.num_types = 1; adev->gfx.priv_inst_irq.num_types = 1;
adev->gfx.priv_inst_irq.funcs = &gfx_v11_0_priv_inst_irq_funcs; adev->gfx.priv_inst_irq.funcs = &gfx_v11_0_priv_inst_irq_funcs;
adev->gfx.cp_ecc_error_irq.num_types = 1; /* CP ECC error */
adev->gfx.cp_ecc_error_irq.funcs = &gfx_v11_0_cp_ecc_error_irq_funcs;
adev->gfx.rlc_gc_fed_irq.num_types = 1; /* 0x80 FED error */ adev->gfx.rlc_gc_fed_irq.num_types = 1; /* 0x80 FED error */
adev->gfx.rlc_gc_fed_irq.funcs = &gfx_v11_0_rlc_gc_fed_irq_funcs; adev->gfx.rlc_gc_fed_irq.funcs = &gfx_v11_0_rlc_gc_fed_irq_funcs;

View File

@ -3764,6 +3764,7 @@ static int gfx_v9_0_hw_fini(void *handle)
{ {
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX))
amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0); amdgpu_irq_put(adev, &adev->gfx.cp_ecc_error_irq, 0);
amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0); amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0);
amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0); amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0);

View File

@ -54,6 +54,7 @@ static int jpeg_v3_0_early_init(void *handle)
switch (adev->ip_versions[UVD_HWIP][0]) { switch (adev->ip_versions[UVD_HWIP][0]) {
case IP_VERSION(3, 1, 1): case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 1, 2):
break; break;
default: default:
harvest = RREG32_SOC15(JPEG, 0, mmCC_UVD_HARVESTING); harvest = RREG32_SOC15(JPEG, 0, mmCC_UVD_HARVESTING);

View File

@ -98,6 +98,16 @@ static const struct amdgpu_video_codecs nv_video_codecs_decode =
}; };
/* Sienna Cichlid */ /* Sienna Cichlid */
static const struct amdgpu_video_codec_info sc_video_codecs_encode_array[] = {
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2160, 0)},
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 7680, 4352, 0)},
};
static const struct amdgpu_video_codecs sc_video_codecs_encode = {
.codec_count = ARRAY_SIZE(sc_video_codecs_encode_array),
.codec_array = sc_video_codecs_encode_array,
};
static const struct amdgpu_video_codec_info sc_video_codecs_decode_array_vcn0[] = static const struct amdgpu_video_codec_info sc_video_codecs_decode_array_vcn0[] =
{ {
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2, 4096, 4096, 3)},
@ -136,8 +146,8 @@ static const struct amdgpu_video_codecs sc_video_codecs_decode_vcn1 =
/* SRIOV Sienna Cichlid, not const since data is controlled by host */ /* SRIOV Sienna Cichlid, not const since data is controlled by host */
static struct amdgpu_video_codec_info sriov_sc_video_codecs_encode_array[] = static struct amdgpu_video_codec_info sriov_sc_video_codecs_encode_array[] =
{ {
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2304, 0)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2160, 0)},
{codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 4096, 2304, 0)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 7680, 4352, 0)},
}; };
static struct amdgpu_video_codec_info sriov_sc_video_codecs_decode_array_vcn0[] = static struct amdgpu_video_codec_info sriov_sc_video_codecs_decode_array_vcn0[] =
@ -237,12 +247,12 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
} else { } else {
if (adev->vcn.harvest_config & AMDGPU_VCN_HARVEST_VCN0) { if (adev->vcn.harvest_config & AMDGPU_VCN_HARVEST_VCN0) {
if (encode) if (encode)
*codecs = &nv_video_codecs_encode; *codecs = &sc_video_codecs_encode;
else else
*codecs = &sc_video_codecs_decode_vcn1; *codecs = &sc_video_codecs_decode_vcn1;
} else { } else {
if (encode) if (encode)
*codecs = &nv_video_codecs_encode; *codecs = &sc_video_codecs_encode;
else else
*codecs = &sc_video_codecs_decode_vcn0; *codecs = &sc_video_codecs_decode_vcn0;
} }
@ -251,14 +261,14 @@ static int nv_query_video_codecs(struct amdgpu_device *adev, bool encode,
case IP_VERSION(3, 0, 16): case IP_VERSION(3, 0, 16):
case IP_VERSION(3, 0, 2): case IP_VERSION(3, 0, 2):
if (encode) if (encode)
*codecs = &nv_video_codecs_encode; *codecs = &sc_video_codecs_encode;
else else
*codecs = &sc_video_codecs_decode_vcn0; *codecs = &sc_video_codecs_decode_vcn0;
return 0; return 0;
case IP_VERSION(3, 1, 1): case IP_VERSION(3, 1, 1):
case IP_VERSION(3, 1, 2): case IP_VERSION(3, 1, 2):
if (encode) if (encode)
*codecs = &nv_video_codecs_encode; *codecs = &sc_video_codecs_encode;
else else
*codecs = &yc_video_codecs_decode; *codecs = &yc_video_codecs_decode;
return 0; return 0;

View File

@ -1917,10 +1917,12 @@ static int sdma_v4_0_hw_fini(void *handle)
return 0; return 0;
} }
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA)) {
for (i = 0; i < adev->sdma.num_instances; i++) { for (i = 0; i < adev->sdma.num_instances; i++) {
amdgpu_irq_put(adev, &adev->sdma.ecc_irq, amdgpu_irq_put(adev, &adev->sdma.ecc_irq,
AMDGPU_SDMA_IRQ_INSTANCE0 + i); AMDGPU_SDMA_IRQ_INSTANCE0 + i);
} }
}
sdma_v4_0_ctx_switch_enable(adev, false); sdma_v4_0_ctx_switch_enable(adev, false);
sdma_v4_0_enable(adev, false); sdma_v4_0_enable(adev, false);

View File

@ -711,7 +711,7 @@ static int soc21_common_early_init(void *handle)
AMD_PG_SUPPORT_VCN_DPG | AMD_PG_SUPPORT_VCN_DPG |
AMD_PG_SUPPORT_GFX_PG | AMD_PG_SUPPORT_GFX_PG |
AMD_PG_SUPPORT_JPEG; AMD_PG_SUPPORT_JPEG;
adev->external_rev_id = adev->rev_id + 0x1; adev->external_rev_id = adev->rev_id + 0x80;
break; break;
default: default:

View File

@ -423,3 +423,68 @@ void dcn314_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool
PERF_TRACE(); PERF_TRACE();
} }
static void apply_symclk_on_tx_off_wa(struct dc_link *link)
{
/* There are use cases where SYMCLK is referenced by OTG. For instance
* for TMDS signal, OTG relies SYMCLK even if TX video output is off.
* However current link interface will power off PHY when disabling link
* output. This will turn off SYMCLK generated by PHY. The workaround is
* to identify such case where SYMCLK is still in use by OTG when we
* power off PHY. When this is detected, we will temporarily power PHY
* back on and move PHY's SYMCLK state to SYMCLK_ON_TX_OFF by calling
* program_pix_clk interface. When OTG is disabled, we will then power
* off PHY by calling disable link output again.
*
* In future dcn generations, we plan to rework transmitter control
* interface so that we could have an option to set SYMCLK ON TX OFF
* state in one step without this workaround
*/
struct dc *dc = link->ctx->dc;
struct pipe_ctx *pipe_ctx = NULL;
uint8_t i;
if (link->phy_state.symclk_ref_cnts.otg > 0) {
for (i = 0; i < MAX_PIPES; i++) {
pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream && pipe_ctx->stream->link == link && pipe_ctx->top_pipe == NULL) {
pipe_ctx->clock_source->funcs->program_pix_clk(
pipe_ctx->clock_source,
&pipe_ctx->stream_res.pix_clk_params,
dc->link_srv->dp_get_encoding_format(
&pipe_ctx->link_config.dp_link_settings),
&pipe_ctx->pll_settings);
link->phy_state.symclk_state = SYMCLK_ON_TX_OFF;
break;
}
}
}
}
void dcn314_disable_link_output(struct dc_link *link,
const struct link_resource *link_res,
enum signal_type signal)
{
struct dc *dc = link->ctx->dc;
const struct link_hwss *link_hwss = get_link_hwss(link, link_res);
struct dmcu *dmcu = dc->res_pool->dmcu;
if (signal == SIGNAL_TYPE_EDP &&
link->dc->hwss.edp_backlight_control)
link->dc->hwss.edp_backlight_control(link, false);
else if (dmcu != NULL && dmcu->funcs->lock_phy)
dmcu->funcs->lock_phy(dmcu);
link_hwss->disable_link_output(link, link_res, signal);
link->phy_state.symclk_state = SYMCLK_OFF_TX_OFF;
/*
* Add the logic to extract BOTH power up and power down sequences
* from enable/disable link output and only call edp panel control
* in enable_link_dp and disable_link_dp once.
*/
if (dmcu != NULL && dmcu->funcs->lock_phy)
dmcu->funcs->unlock_phy(dmcu);
dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY);
apply_symclk_on_tx_off_wa(link);
}

View File

@ -45,4 +45,6 @@ void dcn314_hubp_pg_control(struct dce_hwseq *hws, unsigned int hubp_inst, bool
void dcn314_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on); void dcn314_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst, bool clock_on);
void dcn314_disable_link_output(struct dc_link *link, const struct link_resource *link_res, enum signal_type signal);
#endif /* __DC_HWSS_DCN314_H__ */ #endif /* __DC_HWSS_DCN314_H__ */

View File

@ -105,7 +105,7 @@ static const struct hw_sequencer_funcs dcn314_funcs = {
.enable_lvds_link_output = dce110_enable_lvds_link_output, .enable_lvds_link_output = dce110_enable_lvds_link_output,
.enable_tmds_link_output = dce110_enable_tmds_link_output, .enable_tmds_link_output = dce110_enable_tmds_link_output,
.enable_dp_link_output = dce110_enable_dp_link_output, .enable_dp_link_output = dce110_enable_dp_link_output,
.disable_link_output = dce110_disable_link_output, .disable_link_output = dcn314_disable_link_output,
.z10_restore = dcn31_z10_restore, .z10_restore = dcn31_z10_restore,
.z10_save_init = dcn31_z10_save_init, .z10_save_init = dcn31_z10_save_init,
.set_disp_pattern_generator = dcn30_set_disp_pattern_generator, .set_disp_pattern_generator = dcn30_set_disp_pattern_generator,

View File

@ -810,7 +810,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
v->SwathHeightY[k], v->SwathHeightY[k],
v->SwathHeightC[k], v->SwathHeightC[k],
TWait, TWait,
v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ? (v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ||
v->DCFCLKPerState[mode_lib->vba.VoltageLevel] <= MIN_DCFCLK_FREQ_MHZ) ?
mode_lib->vba.ip.min_prefetch_in_strobe_us : 0, mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
/* Output */ /* Output */
&v->DSTXAfterScaler[k], &v->DSTXAfterScaler[k],
@ -3310,7 +3311,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
v->swath_width_chroma_ub_this_state[k], v->swath_width_chroma_ub_this_state[k],
v->SwathHeightYThisState[k], v->SwathHeightYThisState[k],
v->SwathHeightCThisState[k], v->TWait, v->SwathHeightCThisState[k], v->TWait,
v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ ? (v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ || v->DCFCLKState[i][j] <= MIN_DCFCLK_FREQ_MHZ) ?
mode_lib->vba.ip.min_prefetch_in_strobe_us : 0, mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
/* Output */ /* Output */

View File

@ -53,6 +53,7 @@
#define BPP_BLENDED_PIPE 0xffffffff #define BPP_BLENDED_PIPE 0xffffffff
#define MEM_STROBE_FREQ_MHZ 1600 #define MEM_STROBE_FREQ_MHZ 1600
#define MIN_DCFCLK_FREQ_MHZ 200
#define MEM_STROBE_MAX_DELIVERY_TIME_US 60.0 #define MEM_STROBE_MAX_DELIVERY_TIME_US 60.0
struct display_mode_lib; struct display_mode_lib;

View File

@ -36,6 +36,8 @@
#define amdgpu_dpm_enable_bapm(adev, e) \ #define amdgpu_dpm_enable_bapm(adev, e) \
((adev)->powerplay.pp_funcs->enable_bapm((adev)->powerplay.pp_handle, (e))) ((adev)->powerplay.pp_funcs->enable_bapm((adev)->powerplay.pp_handle, (e)))
#define amdgpu_dpm_is_legacy_dpm(adev) ((adev)->powerplay.pp_handle == (adev))
int amdgpu_dpm_get_sclk(struct amdgpu_device *adev, bool low) int amdgpu_dpm_get_sclk(struct amdgpu_device *adev, bool low)
{ {
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs; const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
@ -1460,15 +1462,24 @@ int amdgpu_dpm_get_smu_prv_buf_details(struct amdgpu_device *adev,
int amdgpu_dpm_is_overdrive_supported(struct amdgpu_device *adev) int amdgpu_dpm_is_overdrive_supported(struct amdgpu_device *adev)
{ {
struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle; if (is_support_sw_smu(adev)) {
struct smu_context *smu = adev->powerplay.pp_handle; struct smu_context *smu = adev->powerplay.pp_handle;
if ((is_support_sw_smu(adev) && smu->od_enabled) || return (smu->od_enabled || smu->is_apu);
(is_support_sw_smu(adev) && smu->is_apu) || } else {
(!is_support_sw_smu(adev) && hwmgr->od_enabled)) struct pp_hwmgr *hwmgr;
return true;
/*
* dpm on some legacy asics don't carry od_enabled member
* as its pp_handle is casted directly from adev.
*/
if (amdgpu_dpm_is_legacy_dpm(adev))
return false; return false;
hwmgr = (struct pp_hwmgr *)adev->powerplay.pp_handle;
return hwmgr->od_enabled;
}
} }
int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev, int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev,

View File

@ -425,11 +425,12 @@ struct ast_device *ast_device_create(const struct drm_driver *drv,
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
/* /*
* If we don't have IO space at all, use MMIO now and * After AST2500, MMIO is enabled by default, and it should be adopted
* assume the chip has MMIO enabled by default (rev 0x20 * to be compatible with Arm.
* and higher).
*/ */
if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) { if (pdev->revision >= 0x40) {
ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
} else if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
drm_info(dev, "platform has no IO space, trying MMIO\n"); drm_info(dev, "platform has no IO space, trying MMIO\n");
ast->ioregs = ast->regs + AST_IO_MM_OFFSET; ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
} }

View File

@ -641,19 +641,27 @@ static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, size_t len, static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off, size_t len,
struct drm_rect *clip) struct drm_rect *clip)
{ {
u32 line_length = info->fix.line_length;
u32 fb_height = info->var.yres;
off_t end = off + len; off_t end = off + len;
u32 x1 = 0; u32 x1 = 0;
u32 y1 = off / info->fix.line_length; u32 y1 = off / line_length;
u32 x2 = info->var.xres; u32 x2 = info->var.xres;
u32 y2 = DIV_ROUND_UP(end, info->fix.line_length); u32 y2 = DIV_ROUND_UP(end, line_length);
/* Don't allow any of them beyond the bottom bound of display area */
if (y1 > fb_height)
y1 = fb_height;
if (y2 > fb_height)
y2 = fb_height;
if ((y2 - y1) == 1) { if ((y2 - y1) == 1) {
/* /*
* We've only written to a single scanline. Try to reduce * We've only written to a single scanline. Try to reduce
* the number of horizontal pixels that need an update. * the number of horizontal pixels that need an update.
*/ */
off_t bit_off = (off % info->fix.line_length) * 8; off_t bit_off = (off % line_length) * 8;
off_t bit_end = (end % info->fix.line_length) * 8; off_t bit_end = (end % line_length) * 8;
x1 = bit_off / info->var.bits_per_pixel; x1 = bit_off / info->var.bits_per_pixel;
x2 = DIV_ROUND_UP(bit_end, info->var.bits_per_pixel); x2 = DIV_ROUND_UP(bit_end, info->var.bits_per_pixel);

View File

@ -221,7 +221,7 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *host,
return dsi; return dsi;
} }
dsi->dev.of_node = info->node; device_set_node(&dsi->dev, of_fwnode_handle(info->node));
dsi->channel = info->channel; dsi->channel = info->channel;
strlcpy(dsi->name, info->type, sizeof(dsi->name)); strlcpy(dsi->name, info->type, sizeof(dsi->name));

View File

@ -62,10 +62,11 @@ config DRM_I915_FORCE_PROBE
This is the default value for the i915.force_probe module This is the default value for the i915.force_probe module
parameter. Using the module parameter overrides this option. parameter. Using the module parameter overrides this option.
Force probe the i915 for Intel graphics devices that are Force probe the i915 driver for Intel graphics devices that are
recognized but not properly supported by this kernel version. It is recognized but not properly supported by this kernel version. Force
recommended to upgrade to a kernel version with proper support as soon probing an unsupported device taints the kernel. It is recommended to
as it is available. upgrade to a kernel version with proper support as soon as it is
available.
It can also be used to block the probe of recognized and fully It can also be used to block the probe of recognized and fully
supported devices. supported devices.
@ -75,7 +76,8 @@ config DRM_I915_FORCE_PROBE
Use "<pci-id>[,<pci-id>,...]" to force probe the i915 for listed Use "<pci-id>[,<pci-id>,...]" to force probe the i915 for listed
devices. For example, "4500" or "4500,4571". devices. For example, "4500" or "4500,4571".
Use "*" to force probe the driver for all known devices. Use "*" to force probe the driver for all known devices. Not
recommended.
Use "!" right before the ID to block the probe of the device. For Use "!" right before the ID to block the probe of the device. For
example, "4500,!4571" forces the probe of 4500 and blocks the probe of example, "4500,!4571" forces the probe of 4500 and blocks the probe of

View File

@ -1028,7 +1028,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
int ret; int ret;
if (old_obj) { if (old_obj) {
const struct intel_crtc_state *crtc_state = const struct intel_crtc_state *new_crtc_state =
intel_atomic_get_new_crtc_state(state, intel_atomic_get_new_crtc_state(state,
to_intel_crtc(old_plane_state->hw.crtc)); to_intel_crtc(old_plane_state->hw.crtc));
@ -1043,7 +1043,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
* This should only fail upon a hung GPU, in which case we * This should only fail upon a hung GPU, in which case we
* can safely continue. * can safely continue.
*/ */
if (intel_crtc_needs_modeset(crtc_state)) { if (new_crtc_state && intel_crtc_needs_modeset(new_crtc_state)) {
ret = i915_sw_fence_await_reservation(&state->commit_ready, ret = i915_sw_fence_await_reservation(&state->commit_ready,
old_obj->base.resv, old_obj->base.resv,
false, 0, false, 0,

View File

@ -1601,6 +1601,11 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
pipe_config->dsc.slice_count = pipe_config->dsc.slice_count =
drm_dp_dsc_sink_max_slice_count(intel_dp->dsc_dpcd, drm_dp_dsc_sink_max_slice_count(intel_dp->dsc_dpcd,
true); true);
if (!pipe_config->dsc.slice_count) {
drm_dbg_kms(&dev_priv->drm, "Unsupported Slice Count %d\n",
pipe_config->dsc.slice_count);
return -EINVAL;
}
} else { } else {
u16 dsc_max_output_bpp = 0; u16 dsc_max_output_bpp = 0;
u8 dsc_dp_slice_count; u8 dsc_dp_slice_count;

View File

@ -31,12 +31,14 @@
{ FORCEWAKE_MT, 0, 0, "FORCEWAKE" } { FORCEWAKE_MT, 0, 0, "FORCEWAKE" }
#define COMMON_GEN9BASE_GLOBAL \ #define COMMON_GEN9BASE_GLOBAL \
{ GEN8_FAULT_TLB_DATA0, 0, 0, "GEN8_FAULT_TLB_DATA0" }, \
{ GEN8_FAULT_TLB_DATA1, 0, 0, "GEN8_FAULT_TLB_DATA1" }, \
{ ERROR_GEN6, 0, 0, "ERROR_GEN6" }, \ { ERROR_GEN6, 0, 0, "ERROR_GEN6" }, \
{ DONE_REG, 0, 0, "DONE_REG" }, \ { DONE_REG, 0, 0, "DONE_REG" }, \
{ HSW_GTT_CACHE_EN, 0, 0, "HSW_GTT_CACHE_EN" } { HSW_GTT_CACHE_EN, 0, 0, "HSW_GTT_CACHE_EN" }
#define GEN9_GLOBAL \
{ GEN8_FAULT_TLB_DATA0, 0, 0, "GEN8_FAULT_TLB_DATA0" }, \
{ GEN8_FAULT_TLB_DATA1, 0, 0, "GEN8_FAULT_TLB_DATA1" }
#define COMMON_GEN12BASE_GLOBAL \ #define COMMON_GEN12BASE_GLOBAL \
{ GEN12_FAULT_TLB_DATA0, 0, 0, "GEN12_FAULT_TLB_DATA0" }, \ { GEN12_FAULT_TLB_DATA0, 0, 0, "GEN12_FAULT_TLB_DATA0" }, \
{ GEN12_FAULT_TLB_DATA1, 0, 0, "GEN12_FAULT_TLB_DATA1" }, \ { GEN12_FAULT_TLB_DATA1, 0, 0, "GEN12_FAULT_TLB_DATA1" }, \
@ -142,6 +144,7 @@ static const struct __guc_mmio_reg_descr xe_lpd_gsc_inst_regs[] = {
static const struct __guc_mmio_reg_descr default_global_regs[] = { static const struct __guc_mmio_reg_descr default_global_regs[] = {
COMMON_BASE_GLOBAL, COMMON_BASE_GLOBAL,
COMMON_GEN9BASE_GLOBAL, COMMON_GEN9BASE_GLOBAL,
GEN9_GLOBAL,
}; };
static const struct __guc_mmio_reg_descr default_rc_class_regs[] = { static const struct __guc_mmio_reg_descr default_rc_class_regs[] = {

View File

@ -1344,6 +1344,12 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return -ENODEV; return -ENODEV;
} }
if (intel_info->require_force_probe) {
dev_info(&pdev->dev, "Force probing unsupported Device ID %04x, tainting kernel\n",
pdev->device);
add_taint(TAINT_USER, LOCKDEP_STILL_OK);
}
/* Only bind to function 0 of the device. Early generations /* Only bind to function 0 of the device. Early generations
* used function 1 as a placeholder for multi-head. This causes * used function 1 as a placeholder for multi-head. This causes
* us confusion instead, especially on the systems where both * us confusion instead, especially on the systems where both

View File

@ -2,6 +2,8 @@
#ifndef __NVIF_IF0012_H__ #ifndef __NVIF_IF0012_H__
#define __NVIF_IF0012_H__ #define __NVIF_IF0012_H__
#include <drm/display/drm_dp.h>
union nvif_outp_args { union nvif_outp_args {
struct nvif_outp_v0 { struct nvif_outp_v0 {
__u8 version; __u8 version;
@ -63,7 +65,7 @@ union nvif_outp_acquire_args {
__u8 hda; __u8 hda;
__u8 mst; __u8 mst;
__u8 pad04[4]; __u8 pad04[4];
__u8 dpcd[16]; __u8 dpcd[DP_RECEIVER_CAP_SIZE];
} dp; } dp;
}; };
} v0; } v0;

View File

@ -3,6 +3,7 @@
#define __NVKM_DISP_OUTP_H__ #define __NVKM_DISP_OUTP_H__
#include "priv.h" #include "priv.h"
#include <drm/display/drm_dp.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/dcb.h> #include <subdev/bios/dcb.h>
#include <subdev/bios/dp.h> #include <subdev/bios/dp.h>
@ -42,7 +43,7 @@ struct nvkm_outp {
bool aux_pwr_pu; bool aux_pwr_pu;
u8 lttpr[6]; u8 lttpr[6];
u8 lttprs; u8 lttprs;
u8 dpcd[16]; u8 dpcd[DP_RECEIVER_CAP_SIZE];
struct { struct {
int dpcd; /* -1, or index into SUPPORTED_LINK_RATES table */ int dpcd; /* -1, or index into SUPPORTED_LINK_RATES table */

View File

@ -146,7 +146,7 @@ nvkm_uoutp_mthd_release(struct nvkm_outp *outp, void *argv, u32 argc)
} }
static int static int
nvkm_uoutp_mthd_acquire_dp(struct nvkm_outp *outp, u8 dpcd[16], nvkm_uoutp_mthd_acquire_dp(struct nvkm_outp *outp, u8 dpcd[DP_RECEIVER_CAP_SIZE],
u8 link_nr, u8 link_bw, bool hda, bool mst) u8 link_nr, u8 link_bw, bool hda, bool mst)
{ {
int ret; int ret;

View File

@ -309,7 +309,7 @@ static void drm_sched_start_timeout(struct drm_gpu_scheduler *sched)
*/ */
void drm_sched_fault(struct drm_gpu_scheduler *sched) void drm_sched_fault(struct drm_gpu_scheduler *sched)
{ {
if (sched->ready) if (sched->timeout_wq)
mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0); mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0);
} }
EXPORT_SYMBOL(drm_sched_fault); EXPORT_SYMBOL(drm_sched_fault);

View File

@ -507,6 +507,7 @@ static const struct pci_device_id k10temp_id_table[] = {
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F3) },
{ PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) }, { PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
{} {}
}; };

View File

@ -1035,7 +1035,6 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
{ {
struct device *dev = &mdp->pdev->dev; struct device *dev = &mdp->pdev->dev;
struct device_node *node, *parent; struct device_node *node, *parent;
const struct mtk_mdp_driver_data *data = mdp->mdp_data;
parent = dev->of_node->parent; parent = dev->of_node->parent;
@ -1045,7 +1044,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
int id, alias_id; int id, alias_id;
struct mdp_comp *comp; struct mdp_comp *comp;
of_id = of_match_node(data->mdp_sub_comp_dt_ids, node); of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node);
if (!of_id) if (!of_id)
continue; continue;
if (!of_device_is_available(node)) { if (!of_device_is_available(node)) {

View File

@ -378,8 +378,8 @@ static int mxc_isi_runtime_resume(struct device *dev)
} }
static const struct dev_pm_ops mxc_isi_pm_ops = { static const struct dev_pm_ops mxc_isi_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume) SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume)
SET_RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL) RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL)
}; };
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
@ -528,7 +528,7 @@ static struct platform_driver mxc_isi_driver = {
.driver = { .driver = {
.of_match_table = mxc_isi_of_match, .of_match_table = mxc_isi_of_match,
.name = MXC_ISI_DRIVER_NAME, .name = MXC_ISI_DRIVER_NAME,
.pm = &mxc_isi_pm_ops, .pm = pm_ptr(&mxc_isi_pm_ops),
} }
}; };
module_platform_driver(mxc_isi_driver); module_platform_driver(mxc_isi_driver);

View File

@ -29,11 +29,10 @@ static inline void mxc_isi_write(struct mxc_isi_pipe *pipe, u32 reg, u32 val)
void mxc_isi_channel_set_inbuf(struct mxc_isi_pipe *pipe, dma_addr_t dma_addr) void mxc_isi_channel_set_inbuf(struct mxc_isi_pipe *pipe, dma_addr_t dma_addr)
{ {
mxc_isi_write(pipe, CHNL_IN_BUF_ADDR, dma_addr); mxc_isi_write(pipe, CHNL_IN_BUF_ADDR, lower_32_bits(dma_addr));
#if CONFIG_ARCH_DMA_ADDR_T_64BIT
if (pipe->isi->pdata->has_36bit_dma) if (pipe->isi->pdata->has_36bit_dma)
mxc_isi_write(pipe, CHNL_IN_BUF_XTND_ADDR, dma_addr >> 32); mxc_isi_write(pipe, CHNL_IN_BUF_XTND_ADDR,
#endif upper_32_bits(dma_addr));
} }
void mxc_isi_channel_set_outbuf(struct mxc_isi_pipe *pipe, void mxc_isi_channel_set_outbuf(struct mxc_isi_pipe *pipe,
@ -45,34 +44,36 @@ void mxc_isi_channel_set_outbuf(struct mxc_isi_pipe *pipe,
val = mxc_isi_read(pipe, CHNL_OUT_BUF_CTRL); val = mxc_isi_read(pipe, CHNL_OUT_BUF_CTRL);
if (buf_id == MXC_ISI_BUF1) { if (buf_id == MXC_ISI_BUF1) {
mxc_isi_write(pipe, CHNL_OUT_BUF1_ADDR_Y, dma_addrs[0]); mxc_isi_write(pipe, CHNL_OUT_BUF1_ADDR_Y,
mxc_isi_write(pipe, CHNL_OUT_BUF1_ADDR_U, dma_addrs[1]); lower_32_bits(dma_addrs[0]));
mxc_isi_write(pipe, CHNL_OUT_BUF1_ADDR_V, dma_addrs[2]); mxc_isi_write(pipe, CHNL_OUT_BUF1_ADDR_U,
#if CONFIG_ARCH_DMA_ADDR_T_64BIT lower_32_bits(dma_addrs[1]));
mxc_isi_write(pipe, CHNL_OUT_BUF1_ADDR_V,
lower_32_bits(dma_addrs[2]));
if (pipe->isi->pdata->has_36bit_dma) { if (pipe->isi->pdata->has_36bit_dma) {
mxc_isi_write(pipe, CHNL_Y_BUF1_XTND_ADDR, mxc_isi_write(pipe, CHNL_Y_BUF1_XTND_ADDR,
dma_addrs[0] >> 32); upper_32_bits(dma_addrs[0]));
mxc_isi_write(pipe, CHNL_U_BUF1_XTND_ADDR, mxc_isi_write(pipe, CHNL_U_BUF1_XTND_ADDR,
dma_addrs[1] >> 32); upper_32_bits(dma_addrs[1]));
mxc_isi_write(pipe, CHNL_V_BUF1_XTND_ADDR, mxc_isi_write(pipe, CHNL_V_BUF1_XTND_ADDR,
dma_addrs[2] >> 32); upper_32_bits(dma_addrs[2]));
} }
#endif
val ^= CHNL_OUT_BUF_CTRL_LOAD_BUF1_ADDR; val ^= CHNL_OUT_BUF_CTRL_LOAD_BUF1_ADDR;
} else { } else {
mxc_isi_write(pipe, CHNL_OUT_BUF2_ADDR_Y, dma_addrs[0]); mxc_isi_write(pipe, CHNL_OUT_BUF2_ADDR_Y,
mxc_isi_write(pipe, CHNL_OUT_BUF2_ADDR_U, dma_addrs[1]); lower_32_bits(dma_addrs[0]));
mxc_isi_write(pipe, CHNL_OUT_BUF2_ADDR_V, dma_addrs[2]); mxc_isi_write(pipe, CHNL_OUT_BUF2_ADDR_U,
#if CONFIG_ARCH_DMA_ADDR_T_64BIT lower_32_bits(dma_addrs[1]));
mxc_isi_write(pipe, CHNL_OUT_BUF2_ADDR_V,
lower_32_bits(dma_addrs[2]));
if (pipe->isi->pdata->has_36bit_dma) { if (pipe->isi->pdata->has_36bit_dma) {
mxc_isi_write(pipe, CHNL_Y_BUF2_XTND_ADDR, mxc_isi_write(pipe, CHNL_Y_BUF2_XTND_ADDR,
dma_addrs[0] >> 32); upper_32_bits(dma_addrs[0]));
mxc_isi_write(pipe, CHNL_U_BUF2_XTND_ADDR, mxc_isi_write(pipe, CHNL_U_BUF2_XTND_ADDR,
dma_addrs[1] >> 32); upper_32_bits(dma_addrs[1]));
mxc_isi_write(pipe, CHNL_V_BUF2_XTND_ADDR, mxc_isi_write(pipe, CHNL_V_BUF2_XTND_ADDR,
dma_addrs[2] >> 32); upper_32_bits(dma_addrs[2]));
} }
#endif
val ^= CHNL_OUT_BUF_CTRL_LOAD_BUF2_ADDR; val ^= CHNL_OUT_BUF_CTRL_LOAD_BUF2_ADDR;
} }

View File

@ -728,11 +728,9 @@ static int rvin_setup(struct rvin_dev *vin)
case V4L2_FIELD_SEQ_TB: case V4L2_FIELD_SEQ_TB:
case V4L2_FIELD_SEQ_BT: case V4L2_FIELD_SEQ_BT:
case V4L2_FIELD_NONE: case V4L2_FIELD_NONE:
vnmc = VNMC_IM_ODD_EVEN;
progressive = true;
break;
case V4L2_FIELD_ALTERNATE: case V4L2_FIELD_ALTERNATE:
vnmc = VNMC_IM_ODD_EVEN; vnmc = VNMC_IM_ODD_EVEN;
progressive = true;
break; break;
default: default:
vnmc = VNMC_IM_ODD; vnmc = VNMC_IM_ODD;
@ -1312,13 +1310,24 @@ static int rvin_mc_validate_format(struct rvin_dev *vin, struct v4l2_subdev *sd,
} }
if (rvin_scaler_needed(vin)) { if (rvin_scaler_needed(vin)) {
/* Gen3 can't scale NV12 */
if (vin->info->model == RCAR_GEN3 &&
vin->format.pixelformat == V4L2_PIX_FMT_NV12)
return -EPIPE;
if (!vin->scaler) if (!vin->scaler)
return -EPIPE; return -EPIPE;
} else {
if (vin->format.pixelformat == V4L2_PIX_FMT_NV12) {
if (ALIGN(fmt.format.width, 32) != vin->format.width ||
ALIGN(fmt.format.height, 32) != vin->format.height)
return -EPIPE;
} else { } else {
if (fmt.format.width != vin->format.width || if (fmt.format.width != vin->format.width ||
fmt.format.height != vin->format.height) fmt.format.height != vin->format.height)
return -EPIPE; return -EPIPE;
} }
}
if (fmt.format.code != vin->mbus_code) if (fmt.format.code != vin->mbus_code)
return -EPIPE; return -EPIPE;

View File

@ -84,6 +84,11 @@ nla_put_failure:
return -EMSGSIZE; return -EMSGSIZE;
} }
/* Limit the max delay range to 300s */
static struct netlink_range_validation delay_range = {
.max = 300000,
};
static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = { static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
[IFLA_BOND_MODE] = { .type = NLA_U8 }, [IFLA_BOND_MODE] = { .type = NLA_U8 },
[IFLA_BOND_ACTIVE_SLAVE] = { .type = NLA_U32 }, [IFLA_BOND_ACTIVE_SLAVE] = { .type = NLA_U32 },
@ -114,7 +119,7 @@ static const struct nla_policy bond_policy[IFLA_BOND_MAX + 1] = {
[IFLA_BOND_AD_ACTOR_SYSTEM] = { .type = NLA_BINARY, [IFLA_BOND_AD_ACTOR_SYSTEM] = { .type = NLA_BINARY,
.len = ETH_ALEN }, .len = ETH_ALEN },
[IFLA_BOND_TLB_DYNAMIC_LB] = { .type = NLA_U8 }, [IFLA_BOND_TLB_DYNAMIC_LB] = { .type = NLA_U8 },
[IFLA_BOND_PEER_NOTIF_DELAY] = { .type = NLA_U32 }, [IFLA_BOND_PEER_NOTIF_DELAY] = NLA_POLICY_FULL_RANGE(NLA_U32, &delay_range),
[IFLA_BOND_MISSED_MAX] = { .type = NLA_U8 }, [IFLA_BOND_MISSED_MAX] = { .type = NLA_U8 },
[IFLA_BOND_NS_IP6_TARGET] = { .type = NLA_NESTED }, [IFLA_BOND_NS_IP6_TARGET] = { .type = NLA_NESTED },
}; };

View File

@ -169,6 +169,12 @@ static const struct bond_opt_value bond_num_peer_notif_tbl[] = {
{ NULL, -1, 0} { NULL, -1, 0}
}; };
static const struct bond_opt_value bond_peer_notif_delay_tbl[] = {
{ "off", 0, 0},
{ "maxval", 300000, BOND_VALFLAG_MAX},
{ NULL, -1, 0}
};
static const struct bond_opt_value bond_primary_reselect_tbl[] = { static const struct bond_opt_value bond_primary_reselect_tbl[] = {
{ "always", BOND_PRI_RESELECT_ALWAYS, BOND_VALFLAG_DEFAULT}, { "always", BOND_PRI_RESELECT_ALWAYS, BOND_VALFLAG_DEFAULT},
{ "better", BOND_PRI_RESELECT_BETTER, 0}, { "better", BOND_PRI_RESELECT_BETTER, 0},
@ -488,7 +494,7 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
.id = BOND_OPT_PEER_NOTIF_DELAY, .id = BOND_OPT_PEER_NOTIF_DELAY,
.name = "peer_notif_delay", .name = "peer_notif_delay",
.desc = "Delay between each peer notification on failover event, in milliseconds", .desc = "Delay between each peer notification on failover event, in milliseconds",
.values = bond_intmax_tbl, .values = bond_peer_notif_delay_tbl,
.set = bond_option_peer_notif_delay_set .set = bond_option_peer_notif_delay_set
} }
}; };

View File

@ -294,19 +294,6 @@ static int gve_napi_poll_dqo(struct napi_struct *napi, int budget)
bool reschedule = false; bool reschedule = false;
int work_done = 0; int work_done = 0;
/* Clear PCI MSI-X Pending Bit Array (PBA)
*
* This bit is set if an interrupt event occurs while the vector is
* masked. If this bit is set and we reenable the interrupt, it will
* fire again. Since we're just about to poll the queue state, we don't
* need it to fire again.
*
* Under high softirq load, it's possible that the interrupt condition
* is triggered twice before we got the chance to process it.
*/
gve_write_irq_doorbell_dqo(priv, block,
GVE_ITR_NO_UPDATE_DQO | GVE_ITR_CLEAR_PBA_BIT_DQO);
if (block->tx) if (block->tx)
reschedule |= gve_tx_poll_dqo(block, /*do_clean=*/true); reschedule |= gve_tx_poll_dqo(block, /*do_clean=*/true);

View File

@ -654,7 +654,7 @@ __mtk_wed_detach(struct mtk_wed_device *dev)
BIT(hw->index), BIT(hw->index)); BIT(hw->index), BIT(hw->index));
} }
if (!hw_list[!hw->index]->wed_dev && if ((!hw_list[!hw->index] || !hw_list[!hw->index]->wed_dev) &&
hw->eth->dma_dev != hw->eth->dev) hw->eth->dma_dev != hw->eth->dev)
mtk_eth_set_dma_device(hw->eth, hw->eth->dev); mtk_eth_set_dma_device(hw->eth, hw->eth->dev);

View File

@ -307,15 +307,15 @@ static const u32 vsc7514_sys_regmap[] = {
REG(SYS_COUNT_DROP_YELLOW_PRIO_4, 0x000218), REG(SYS_COUNT_DROP_YELLOW_PRIO_4, 0x000218),
REG(SYS_COUNT_DROP_YELLOW_PRIO_5, 0x00021c), REG(SYS_COUNT_DROP_YELLOW_PRIO_5, 0x00021c),
REG(SYS_COUNT_DROP_YELLOW_PRIO_6, 0x000220), REG(SYS_COUNT_DROP_YELLOW_PRIO_6, 0x000220),
REG(SYS_COUNT_DROP_YELLOW_PRIO_7, 0x000214), REG(SYS_COUNT_DROP_YELLOW_PRIO_7, 0x000224),
REG(SYS_COUNT_DROP_GREEN_PRIO_0, 0x000218), REG(SYS_COUNT_DROP_GREEN_PRIO_0, 0x000228),
REG(SYS_COUNT_DROP_GREEN_PRIO_1, 0x00021c), REG(SYS_COUNT_DROP_GREEN_PRIO_1, 0x00022c),
REG(SYS_COUNT_DROP_GREEN_PRIO_2, 0x000220), REG(SYS_COUNT_DROP_GREEN_PRIO_2, 0x000230),
REG(SYS_COUNT_DROP_GREEN_PRIO_3, 0x000224), REG(SYS_COUNT_DROP_GREEN_PRIO_3, 0x000234),
REG(SYS_COUNT_DROP_GREEN_PRIO_4, 0x000228), REG(SYS_COUNT_DROP_GREEN_PRIO_4, 0x000238),
REG(SYS_COUNT_DROP_GREEN_PRIO_5, 0x00022c), REG(SYS_COUNT_DROP_GREEN_PRIO_5, 0x00023c),
REG(SYS_COUNT_DROP_GREEN_PRIO_6, 0x000230), REG(SYS_COUNT_DROP_GREEN_PRIO_6, 0x000240),
REG(SYS_COUNT_DROP_GREEN_PRIO_7, 0x000234), REG(SYS_COUNT_DROP_GREEN_PRIO_7, 0x000244),
REG(SYS_RESET_CFG, 0x000508), REG(SYS_RESET_CFG, 0x000508),
REG(SYS_CMID, 0x00050c), REG(SYS_CMID, 0x00050c),
REG(SYS_VLAN_ETYPE_CFG, 0x000510), REG(SYS_VLAN_ETYPE_CFG, 0x000510),

View File

@ -181,6 +181,7 @@ enum power_event {
#define GMAC4_LPI_CTRL_STATUS 0xd0 #define GMAC4_LPI_CTRL_STATUS 0xd0
#define GMAC4_LPI_TIMER_CTRL 0xd4 #define GMAC4_LPI_TIMER_CTRL 0xd4
#define GMAC4_LPI_ENTRY_TIMER 0xd8 #define GMAC4_LPI_ENTRY_TIMER 0xd8
#define GMAC4_MAC_ONEUS_TIC_COUNTER 0xdc
/* LPI control and status defines */ /* LPI control and status defines */
#define GMAC4_LPI_CTRL_STATUS_LPITCSE BIT(21) /* LPI Tx Clock Stop Enable */ #define GMAC4_LPI_CTRL_STATUS_LPITCSE BIT(21) /* LPI Tx Clock Stop Enable */

View File

@ -25,6 +25,7 @@ static void dwmac4_core_init(struct mac_device_info *hw,
struct stmmac_priv *priv = netdev_priv(dev); struct stmmac_priv *priv = netdev_priv(dev);
void __iomem *ioaddr = hw->pcsr; void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_CONFIG); u32 value = readl(ioaddr + GMAC_CONFIG);
u32 clk_rate;
value |= GMAC_CORE_INIT; value |= GMAC_CORE_INIT;
@ -47,6 +48,10 @@ static void dwmac4_core_init(struct mac_device_info *hw,
writel(value, ioaddr + GMAC_CONFIG); writel(value, ioaddr + GMAC_CONFIG);
/* Configure LPI 1us counter to number of CSR clock ticks in 1us - 1 */
clk_rate = clk_get_rate(priv->plat->stmmac_clk);
writel((clk_rate / 1000000) - 1, ioaddr + GMAC4_MAC_ONEUS_TIC_COUNTER);
/* Enable GMAC interrupts */ /* Enable GMAC interrupts */
value = GMAC_INT_DEFAULT_ENABLE; value = GMAC_INT_DEFAULT_ENABLE;

View File

@ -436,6 +436,9 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
goto err; goto err;
} }
skb_dst_set(skb, &rt->dst); skb_dst_set(skb, &rt->dst);
memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
err = ip_local_out(net, skb->sk, skb); err = ip_local_out(net, skb->sk, skb);
if (unlikely(net_xmit_eval(err))) if (unlikely(net_xmit_eval(err)))
dev->stats.tx_errors++; dev->stats.tx_errors++;
@ -474,6 +477,9 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
goto err; goto err;
} }
skb_dst_set(skb, dst); skb_dst_set(skb, dst);
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
err = ip6_local_out(net, skb->sk, skb); err = ip6_local_out(net, skb->sk, skb);
if (unlikely(net_xmit_eval(err))) if (unlikely(net_xmit_eval(err)))
dev->stats.tx_errors++; dev->stats.tx_errors++;

View File

@ -67,6 +67,7 @@ static int mvusb_mdio_probe(struct usb_interface *interface,
struct device *dev = &interface->dev; struct device *dev = &interface->dev;
struct mvusb_mdio *mvusb; struct mvusb_mdio *mvusb;
struct mii_bus *mdio; struct mii_bus *mdio;
int ret;
mdio = devm_mdiobus_alloc_size(dev, sizeof(*mvusb)); mdio = devm_mdiobus_alloc_size(dev, sizeof(*mvusb));
if (!mdio) if (!mdio)
@ -87,7 +88,15 @@ static int mvusb_mdio_probe(struct usb_interface *interface,
mdio->write = mvusb_mdio_write; mdio->write = mvusb_mdio_write;
usb_set_intfdata(interface, mvusb); usb_set_intfdata(interface, mvusb);
return of_mdiobus_register(mdio, dev->of_node); ret = of_mdiobus_register(mdio, dev->of_node);
if (ret)
goto put_dev;
return 0;
put_dev:
usb_put_dev(mvusb->udev);
return ret;
} }
static void mvusb_mdio_disconnect(struct usb_interface *interface) static void mvusb_mdio_disconnect(struct usb_interface *interface)

View File

@ -1203,7 +1203,7 @@ static const struct xpcs_compat synopsys_xpcs_compat[DW_XPCS_INTERFACE_MAX] = {
[DW_XPCS_2500BASEX] = { [DW_XPCS_2500BASEX] = {
.supported = xpcs_2500basex_features, .supported = xpcs_2500basex_features,
.interface = xpcs_2500basex_interfaces, .interface = xpcs_2500basex_interfaces,
.num_interfaces = ARRAY_SIZE(xpcs_2500basex_features), .num_interfaces = ARRAY_SIZE(xpcs_2500basex_interfaces),
.an_mode = DW_2500BASEX, .an_mode = DW_2500BASEX,
}, },
}; };

View File

@ -40,6 +40,11 @@ static inline int bcm_phy_write_exp_sel(struct phy_device *phydev,
return bcm_phy_write_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER, val); return bcm_phy_write_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER, val);
} }
static inline int bcm_phy_read_exp_sel(struct phy_device *phydev, u16 reg)
{
return bcm_phy_read_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER);
}
int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val); int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum); int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);

View File

@ -486,7 +486,7 @@ static int bcm7xxx_16nm_ephy_afe_config(struct phy_device *phydev)
bcm_phy_write_misc(phydev, 0x0038, 0x0002, 0xede0); bcm_phy_write_misc(phydev, 0x0038, 0x0002, 0xede0);
/* Read CORE_EXPA9 */ /* Read CORE_EXPA9 */
tmp = bcm_phy_read_exp(phydev, 0x00a9); tmp = bcm_phy_read_exp_sel(phydev, 0x00a9);
/* CORE_EXPA9[6:1] is rcalcode[5:0] */ /* CORE_EXPA9[6:1] is rcalcode[5:0] */
rcalcode = (tmp & 0x7e) / 2; rcalcode = (tmp & 0x7e) / 2;
/* Correct RCAL code + 1 is -1% rprogr, LP: +16 */ /* Correct RCAL code + 1 is -1% rprogr, LP: +16 */

View File

@ -742,7 +742,7 @@ static ssize_t tap_get_user(struct tap_queue *q, void *msg_control,
/* Move network header to the right position for VLAN tagged packets */ /* Move network header to the right position for VLAN tagged packets */
if (eth_type_vlan(skb->protocol) && if (eth_type_vlan(skb->protocol) &&
__vlan_get_protocol(skb, skb->protocol, &depth) != 0) vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)
skb_set_network_header(skb, depth); skb_set_network_header(skb, depth);
/* copy skb_ubuf_info for callback when skb has no error */ /* copy skb_ubuf_info for callback when skb has no error */
@ -1197,7 +1197,7 @@ static int tap_get_user_xdp(struct tap_queue *q, struct xdp_buff *xdp)
/* Move network header to the right position for VLAN tagged packets */ /* Move network header to the right position for VLAN tagged packets */
if (eth_type_vlan(skb->protocol) && if (eth_type_vlan(skb->protocol) &&
__vlan_get_protocol(skb, skb->protocol, &depth) != 0) vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)
skb_set_network_header(skb, depth); skb_set_network_header(skb, depth);
rcu_read_lock(); rcu_read_lock();

View File

@ -784,7 +784,7 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx)
fifo = vring->fifo; fifo = vring->fifo;
/* Return if vdev is not ready. */ /* Return if vdev is not ready. */
if (!fifo->vdev[devid]) if (!fifo || !fifo->vdev[devid])
return; return;
/* Return if another vring is running. */ /* Return if another vring is running. */
@ -980,9 +980,13 @@ static int mlxbf_tmfifo_virtio_find_vqs(struct virtio_device *vdev,
vq->num_max = vring->num; vq->num_max = vring->num;
vq->priv = vring;
/* Make vq update visible before using it. */
virtio_mb(false);
vqs[i] = vq; vqs[i] = vq;
vring->vq = vq; vring->vq = vq;
vq->priv = vring;
} }
return 0; return 0;
@ -1302,6 +1306,9 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev)
mod_timer(&fifo->timer, jiffies + MLXBF_TMFIFO_TIMER_INTERVAL); mod_timer(&fifo->timer, jiffies + MLXBF_TMFIFO_TIMER_INTERVAL);
/* Make all updates visible before setting the 'is_ready' flag. */
virtio_mb(false);
fifo->is_ready = true; fifo->is_ready = true;
return 0; return 0;

View File

@ -211,6 +211,7 @@ struct bios_rfkill2_state {
static const struct key_entry hp_wmi_keymap[] = { static const struct key_entry hp_wmi_keymap[] = {
{ KE_KEY, 0x02, { KEY_BRIGHTNESSUP } }, { KE_KEY, 0x02, { KEY_BRIGHTNESSUP } },
{ KE_KEY, 0x03, { KEY_BRIGHTNESSDOWN } }, { KE_KEY, 0x03, { KEY_BRIGHTNESSDOWN } },
{ KE_KEY, 0x270, { KEY_MICMUTE } },
{ KE_KEY, 0x20e6, { KEY_PROG1 } }, { KE_KEY, 0x20e6, { KEY_PROG1 } },
{ KE_KEY, 0x20e8, { KEY_MEDIA } }, { KE_KEY, 0x20e8, { KEY_MEDIA } },
{ KE_KEY, 0x2142, { KEY_MEDIA } }, { KE_KEY, 0x2142, { KEY_MEDIA } },

View File

@ -44,14 +44,18 @@ static ssize_t store_min_max_freq_khz(struct uncore_data *data,
int min_max) int min_max)
{ {
unsigned int input; unsigned int input;
int ret;
if (kstrtouint(buf, 10, &input)) if (kstrtouint(buf, 10, &input))
return -EINVAL; return -EINVAL;
mutex_lock(&uncore_lock); mutex_lock(&uncore_lock);
uncore_write(data, input, min_max); ret = uncore_write(data, input, min_max);
mutex_unlock(&uncore_lock); mutex_unlock(&uncore_lock);
if (ret)
return ret;
return count; return count;
} }

View File

@ -34,6 +34,7 @@ static int intel_scu_pci_probe(struct pci_dev *pdev,
static const struct pci_device_id pci_ids[] = { static const struct pci_device_id pci_ids[] = {
{ PCI_VDEVICE(INTEL, 0x080e) }, { PCI_VDEVICE(INTEL, 0x080e) },
{ PCI_VDEVICE(INTEL, 0x082a) },
{ PCI_VDEVICE(INTEL, 0x08ea) }, { PCI_VDEVICE(INTEL, 0x08ea) },
{ PCI_VDEVICE(INTEL, 0x0a94) }, { PCI_VDEVICE(INTEL, 0x0a94) },
{ PCI_VDEVICE(INTEL, 0x11a0) }, { PCI_VDEVICE(INTEL, 0x11a0) },

View File

@ -10318,6 +10318,7 @@ static atomic_t dytc_ignore_event = ATOMIC_INIT(0);
static DEFINE_MUTEX(dytc_mutex); static DEFINE_MUTEX(dytc_mutex);
static int dytc_capabilities; static int dytc_capabilities;
static bool dytc_mmc_get_available; static bool dytc_mmc_get_available;
static int profile_force;
static int convert_dytc_to_profile(int funcmode, int dytcmode, static int convert_dytc_to_profile(int funcmode, int dytcmode,
enum platform_profile_option *profile) enum platform_profile_option *profile)
@ -10580,6 +10581,21 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
if (err) if (err)
return err; return err;
/* Check if user wants to override the profile selection */
if (profile_force) {
switch (profile_force) {
case -1:
dytc_capabilities = 0;
break;
case 1:
dytc_capabilities = BIT(DYTC_FC_MMC);
break;
case 2:
dytc_capabilities = BIT(DYTC_FC_PSC);
break;
}
pr_debug("Profile selection forced: 0x%x\n", dytc_capabilities);
}
if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */ if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */
pr_debug("MMC is supported\n"); pr_debug("MMC is supported\n");
/* /*
@ -10593,11 +10609,6 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
dytc_mmc_get_available = true; dytc_mmc_get_available = true;
} }
} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */ } else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */
/* Support for this only works on AMD platforms */
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
return -ENODEV;
}
pr_debug("PSC is supported\n"); pr_debug("PSC is supported\n");
} else { } else {
dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n"); dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
@ -11646,6 +11657,9 @@ MODULE_PARM_DESC(uwb_state,
"Initial state of the emulated UWB switch"); "Initial state of the emulated UWB switch");
#endif #endif
module_param(profile_force, int, 0444);
MODULE_PARM_DESC(profile_force, "Force profile mode. -1=off, 1=MMC, 2=PSC");
static void thinkpad_acpi_module_exit(void) static void thinkpad_acpi_module_exit(void)
{ {
struct ibm_struct *ibm, *itmp; struct ibm_struct *ibm, *itmp;

View File

@ -336,6 +336,22 @@ static const struct ts_dmi_data dexp_ursus_7w_data = {
.properties = dexp_ursus_7w_props, .properties = dexp_ursus_7w_props,
}; };
static const struct property_entry dexp_ursus_kx210i_props[] = {
PROPERTY_ENTRY_U32("touchscreen-min-x", 5),
PROPERTY_ENTRY_U32("touchscreen-min-y", 2),
PROPERTY_ENTRY_U32("touchscreen-size-x", 1720),
PROPERTY_ENTRY_U32("touchscreen-size-y", 1137),
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-dexp-ursus-kx210i.fw"),
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
PROPERTY_ENTRY_BOOL("silead,home-button"),
{ }
};
static const struct ts_dmi_data dexp_ursus_kx210i_data = {
.acpi_name = "MSSL1680:00",
.properties = dexp_ursus_kx210i_props,
};
static const struct property_entry digma_citi_e200_props[] = { static const struct property_entry digma_citi_e200_props[] = {
PROPERTY_ENTRY_U32("touchscreen-size-x", 1980), PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
PROPERTY_ENTRY_U32("touchscreen-size-y", 1500), PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
@ -378,6 +394,11 @@ static const struct ts_dmi_data gdix1001_01_upside_down_data = {
.properties = gdix1001_upside_down_props, .properties = gdix1001_upside_down_props,
}; };
static const struct ts_dmi_data gdix1002_00_upside_down_data = {
.acpi_name = "GDIX1002:00",
.properties = gdix1001_upside_down_props,
};
static const struct property_entry gp_electronic_t701_props[] = { static const struct property_entry gp_electronic_t701_props[] = {
PROPERTY_ENTRY_U32("touchscreen-size-x", 960), PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
PROPERTY_ENTRY_U32("touchscreen-size-y", 640), PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
@ -1185,6 +1206,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "7W"), DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
}, },
}, },
{
/* DEXP Ursus KX210i */
.driver_data = (void *)&dexp_ursus_kx210i_data,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "INSYDE Corp."),
DMI_MATCH(DMI_PRODUCT_NAME, "S107I"),
},
},
{ {
/* Digma Citi E200 */ /* Digma Citi E200 */
.driver_data = (void *)&digma_citi_e200_data, .driver_data = (void *)&digma_citi_e200_data,
@ -1295,6 +1324,18 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"), DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
}, },
}, },
{
/* Juno Tablet */
.driver_data = (void *)&gdix1002_00_upside_down_data,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
/* Both product- and board-name being "Default string" is somewhat rare */
DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
DMI_MATCH(DMI_BOARD_NAME, "Default string"),
/* Above matches are too generic, add partial bios-version match */
DMI_MATCH(DMI_BIOS_VERSION, "JP2V1."),
},
},
{ {
/* Mediacom WinPad 7.0 W700 (same hw as Wintron surftab 7") */ /* Mediacom WinPad 7.0 W700 (same hw as Wintron surftab 7") */
.driver_data = (void *)&trekstor_surftab_wintron70_data, .driver_data = (void *)&trekstor_surftab_wintron70_data,

View File

@ -9459,8 +9459,16 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
* that performance might be impacted. * that performance might be impacted.
*/ */
ret = ufshcd_urgent_bkops(hba); ret = ufshcd_urgent_bkops(hba);
if (ret) if (ret) {
/*
* If return err in suspend flow, IO will hang.
* Trigger error handler and break suspend for
* error recovery.
*/
ufshcd_force_error_recovery(hba);
ret = -EBUSY;
goto enable_scaling; goto enable_scaling;
}
} else { } else {
/* make sure that auto bkops is disabled */ /* make sure that auto bkops is disabled */
ufshcd_disable_auto_bkops(hba); ufshcd_disable_auto_bkops(hba);

View File

@ -523,7 +523,7 @@ static int arcfb_probe(struct platform_device *dev)
info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev); info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
if (!info) if (!info)
goto err; goto err_fb_alloc;
info->screen_base = (char __iomem *)videomemory; info->screen_base = (char __iomem *)videomemory;
info->fbops = &arcfb_ops; info->fbops = &arcfb_ops;
@ -535,7 +535,7 @@ static int arcfb_probe(struct platform_device *dev)
if (!dio_addr || !cio_addr || !c2io_addr) { if (!dio_addr || !cio_addr || !c2io_addr) {
printk(KERN_WARNING "no IO addresses supplied\n"); printk(KERN_WARNING "no IO addresses supplied\n");
goto err1; goto err_addr;
} }
par->dio_addr = dio_addr; par->dio_addr = dio_addr;
par->cio_addr = cio_addr; par->cio_addr = cio_addr;
@ -551,12 +551,12 @@ static int arcfb_probe(struct platform_device *dev)
printk(KERN_INFO printk(KERN_INFO
"arcfb: Failed req IRQ %d\n", par->irq); "arcfb: Failed req IRQ %d\n", par->irq);
retval = -EBUSY; retval = -EBUSY;
goto err1; goto err_addr;
} }
} }
retval = register_framebuffer(info); retval = register_framebuffer(info);
if (retval < 0) if (retval < 0)
goto err1; goto err_register_fb;
platform_set_drvdata(dev, info); platform_set_drvdata(dev, info);
fb_info(info, "Arc frame buffer device, using %dK of video memory\n", fb_info(info, "Arc frame buffer device, using %dK of video memory\n",
videomemorysize >> 10); videomemorysize >> 10);
@ -580,9 +580,12 @@ static int arcfb_probe(struct platform_device *dev)
} }
return 0; return 0;
err1:
err_register_fb:
free_irq(par->irq, info);
err_addr:
framebuffer_release(info); framebuffer_release(info);
err: err_fb_alloc:
vfree(videomemory); vfree(videomemory);
return retval; return retval;
} }

View File

@ -257,6 +257,11 @@ static const struct fb_videomode modedb[] = {
{ NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0, { NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, 0,
FB_VMODE_DOUBLE }, FB_VMODE_DOUBLE },
/* 1920x1080 @ 60 Hz, 67.3 kHz hsync */
{ NULL, 60, 1920, 1080, 6734, 148, 88, 36, 4, 44, 5, 0,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED },
/* 1920x1200 @ 60 Hz, 74.5 Khz hsync */ /* 1920x1200 @ 60 Hz, 74.5 Khz hsync */
{ NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3, { NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,

View File

@ -1347,7 +1347,7 @@ static const struct fb_ops imsttfb_ops = {
.fb_ioctl = imsttfb_ioctl, .fb_ioctl = imsttfb_ioctl,
}; };
static void init_imstt(struct fb_info *info) static int init_imstt(struct fb_info *info)
{ {
struct imstt_par *par = info->par; struct imstt_par *par = info->par;
__u32 i, tmp, *ip, *end; __u32 i, tmp, *ip, *end;
@ -1420,7 +1420,7 @@ static void init_imstt(struct fb_info *info)
|| !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) { || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) {
printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel);
framebuffer_release(info); framebuffer_release(info);
return; return -ENODEV;
} }
sprintf(info->fix.id, "IMS TT (%s)", par->ramdac == IBM ? "IBM" : "TVP"); sprintf(info->fix.id, "IMS TT (%s)", par->ramdac == IBM ? "IBM" : "TVP");
@ -1456,12 +1456,13 @@ static void init_imstt(struct fb_info *info)
if (register_framebuffer(info) < 0) { if (register_framebuffer(info) < 0) {
framebuffer_release(info); framebuffer_release(info);
return; return -ENODEV;
} }
tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8; tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8;
fb_info(info, "%s frame buffer; %uMB vram; chip version %u\n", fb_info(info, "%s frame buffer; %uMB vram; chip version %u\n",
info->fix.id, info->fix.smem_len >> 20, tmp); info->fix.id, info->fix.smem_len >> 20, tmp);
return 0;
} }
static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@ -1529,10 +1530,10 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (!par->cmap_regs) if (!par->cmap_regs)
goto error; goto error;
info->pseudo_palette = par->palette; info->pseudo_palette = par->palette;
init_imstt(info); ret = init_imstt(info);
if (!ret)
pci_set_drvdata(pdev, info); pci_set_drvdata(pdev, info);
return 0; return ret;
error: error:
if (par->dc_regs) if (par->dc_regs)

View File

@ -1413,6 +1413,7 @@ out_err1:
iounmap(info->screen_base); iounmap(info->screen_base);
out_err0: out_err0:
kfree(fb); kfree(fb);
sti->info = NULL;
return -ENXIO; return -ENXIO;
} }

View File

@ -45,7 +45,8 @@ static int check_extent_in_eb(struct btrfs_backref_walk_ctx *ctx,
int root_count; int root_count;
bool cached; bool cached;
if (!btrfs_file_extent_compression(eb, fi) && if (!ctx->ignore_extent_item_pos &&
!btrfs_file_extent_compression(eb, fi) &&
!btrfs_file_extent_encryption(eb, fi) && !btrfs_file_extent_encryption(eb, fi) &&
!btrfs_file_extent_other_encoding(eb, fi)) { !btrfs_file_extent_other_encoding(eb, fi)) {
u64 data_offset; u64 data_offset;
@ -552,7 +553,7 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx,
count++; count++;
else else
goto next; goto next;
if (!ctx->ignore_extent_item_pos) { if (!ctx->skip_inode_ref_list) {
ret = check_extent_in_eb(ctx, &key, eb, fi, &eie); ret = check_extent_in_eb(ctx, &key, eb, fi, &eie);
if (ret == BTRFS_ITERATE_EXTENT_INODES_STOP || if (ret == BTRFS_ITERATE_EXTENT_INODES_STOP ||
ret < 0) ret < 0)
@ -564,7 +565,7 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx,
eie, (void **)&old, GFP_NOFS); eie, (void **)&old, GFP_NOFS);
if (ret < 0) if (ret < 0)
break; break;
if (!ret && !ctx->ignore_extent_item_pos) { if (!ret && !ctx->skip_inode_ref_list) {
while (old->next) while (old->next)
old = old->next; old = old->next;
old->next = eie; old->next = eie;
@ -1606,7 +1607,7 @@ again:
goto out; goto out;
} }
if (ref->count && ref->parent) { if (ref->count && ref->parent) {
if (!ctx->ignore_extent_item_pos && !ref->inode_list && if (!ctx->skip_inode_ref_list && !ref->inode_list &&
ref->level == 0) { ref->level == 0) {
struct btrfs_tree_parent_check check = { 0 }; struct btrfs_tree_parent_check check = { 0 };
struct extent_buffer *eb; struct extent_buffer *eb;
@ -1647,7 +1648,7 @@ again:
(void **)&eie, GFP_NOFS); (void **)&eie, GFP_NOFS);
if (ret < 0) if (ret < 0)
goto out; goto out;
if (!ret && !ctx->ignore_extent_item_pos) { if (!ret && !ctx->skip_inode_ref_list) {
/* /*
* We've recorded that parent, so we must extend * We've recorded that parent, so we must extend
* its inode list here. * its inode list here.
@ -1743,7 +1744,7 @@ int btrfs_find_all_leafs(struct btrfs_backref_walk_ctx *ctx)
static int btrfs_find_all_roots_safe(struct btrfs_backref_walk_ctx *ctx) static int btrfs_find_all_roots_safe(struct btrfs_backref_walk_ctx *ctx)
{ {
const u64 orig_bytenr = ctx->bytenr; const u64 orig_bytenr = ctx->bytenr;
const bool orig_ignore_extent_item_pos = ctx->ignore_extent_item_pos; const bool orig_skip_inode_ref_list = ctx->skip_inode_ref_list;
bool roots_ulist_allocated = false; bool roots_ulist_allocated = false;
struct ulist_iterator uiter; struct ulist_iterator uiter;
int ret = 0; int ret = 0;
@ -1764,7 +1765,7 @@ static int btrfs_find_all_roots_safe(struct btrfs_backref_walk_ctx *ctx)
roots_ulist_allocated = true; roots_ulist_allocated = true;
} }
ctx->ignore_extent_item_pos = true; ctx->skip_inode_ref_list = true;
ULIST_ITER_INIT(&uiter); ULIST_ITER_INIT(&uiter);
while (1) { while (1) {
@ -1789,7 +1790,7 @@ static int btrfs_find_all_roots_safe(struct btrfs_backref_walk_ctx *ctx)
ulist_free(ctx->refs); ulist_free(ctx->refs);
ctx->refs = NULL; ctx->refs = NULL;
ctx->bytenr = orig_bytenr; ctx->bytenr = orig_bytenr;
ctx->ignore_extent_item_pos = orig_ignore_extent_item_pos; ctx->skip_inode_ref_list = orig_skip_inode_ref_list;
return ret; return ret;
} }
@ -1912,7 +1913,7 @@ int btrfs_is_data_extent_shared(struct btrfs_inode *inode, u64 bytenr,
goto out_trans; goto out_trans;
} }
walk_ctx.ignore_extent_item_pos = true; walk_ctx.skip_inode_ref_list = true;
walk_ctx.trans = trans; walk_ctx.trans = trans;
walk_ctx.fs_info = fs_info; walk_ctx.fs_info = fs_info;
walk_ctx.refs = &ctx->refs; walk_ctx.refs = &ctx->refs;

View File

@ -60,6 +60,12 @@ struct btrfs_backref_walk_ctx {
* @extent_item_pos is ignored. * @extent_item_pos is ignored.
*/ */
bool ignore_extent_item_pos; bool ignore_extent_item_pos;
/*
* If true and bytenr corresponds to a data extent, then the inode list
* (each member describing inode number, file offset and root) is not
* added to each reference added to the @refs ulist.
*/
bool skip_inode_ref_list;
/* A valid transaction handle or NULL. */ /* A valid transaction handle or NULL. */
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
/* /*

View File

@ -124,7 +124,8 @@ static u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
} else { } else {
num_bytes = 0; num_bytes = 0;
} }
if (block_rsv->qgroup_rsv_reserved >= block_rsv->qgroup_rsv_size) { if (qgroup_to_release_ret &&
block_rsv->qgroup_rsv_reserved >= block_rsv->qgroup_rsv_size) {
qgroup_to_release = block_rsv->qgroup_rsv_reserved - qgroup_to_release = block_rsv->qgroup_rsv_reserved -
block_rsv->qgroup_rsv_size; block_rsv->qgroup_rsv_size;
block_rsv->qgroup_rsv_reserved = block_rsv->qgroup_rsv_size; block_rsv->qgroup_rsv_reserved = block_rsv->qgroup_rsv_size;

View File

@ -2627,6 +2627,10 @@ static bool check_sibling_keys(struct extent_buffer *left,
} }
if (btrfs_comp_cpu_keys(&left_last, &right_first) >= 0) { if (btrfs_comp_cpu_keys(&left_last, &right_first) >= 0) {
btrfs_crit(left->fs_info, "left extent buffer:");
btrfs_print_tree(left, false);
btrfs_crit(left->fs_info, "right extent buffer:");
btrfs_print_tree(right, false);
btrfs_crit(left->fs_info, btrfs_crit(left->fs_info,
"bad key order, sibling blocks, left last (%llu %u %llu) right first (%llu %u %llu)", "bad key order, sibling blocks, left last (%llu %u %llu) right first (%llu %u %llu)",
left_last.objectid, left_last.type, left_last.objectid, left_last.type,
@ -3215,6 +3219,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
if (check_sibling_keys(left, right)) { if (check_sibling_keys(left, right)) {
ret = -EUCLEAN; ret = -EUCLEAN;
btrfs_abort_transaction(trans, ret);
btrfs_tree_unlock(right); btrfs_tree_unlock(right);
free_extent_buffer(right); free_extent_buffer(right);
return ret; return ret;
@ -3433,6 +3438,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
if (check_sibling_keys(left, right)) { if (check_sibling_keys(left, right)) {
ret = -EUCLEAN; ret = -EUCLEAN;
btrfs_abort_transaction(trans, ret);
goto out; goto out;
} }
return __push_leaf_left(trans, path, min_data_size, empty, left, return __push_leaf_left(trans, path, min_data_size, empty, left,
@ -4478,10 +4484,12 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
{ {
struct btrfs_key key; struct btrfs_key key;
struct btrfs_key orig_key;
struct btrfs_disk_key found_key; struct btrfs_disk_key found_key;
int ret; int ret;
btrfs_item_key_to_cpu(path->nodes[0], &key, 0); btrfs_item_key_to_cpu(path->nodes[0], &key, 0);
orig_key = key;
if (key.offset > 0) { if (key.offset > 0) {
key.offset--; key.offset--;
@ -4498,8 +4506,36 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
btrfs_release_path(path); btrfs_release_path(path);
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0) if (ret <= 0)
return ret; return ret;
/*
* Previous key not found. Even if we were at slot 0 of the leaf we had
* before releasing the path and calling btrfs_search_slot(), we now may
* be in a slot pointing to the same original key - this can happen if
* after we released the path, one of more items were moved from a
* sibling leaf into the front of the leaf we had due to an insertion
* (see push_leaf_right()).
* If we hit this case and our slot is > 0 and just decrement the slot
* so that the caller does not process the same key again, which may or
* may not break the caller, depending on its logic.
*/
if (path->slots[0] < btrfs_header_nritems(path->nodes[0])) {
btrfs_item_key(path->nodes[0], &found_key, path->slots[0]);
ret = comp_keys(&found_key, &orig_key);
if (ret == 0) {
if (path->slots[0] > 0) {
path->slots[0]--;
return 0;
}
/*
* At slot 0, same key as before, it means orig_key is
* the lowest, leftmost, key in the tree. We're done.
*/
return 1;
}
}
btrfs_item_key(path->nodes[0], &found_key, 0); btrfs_item_key(path->nodes[0], &found_key, 0);
ret = comp_keys(&found_key, &key); ret = comp_keys(&found_key, &key);
/* /*

View File

@ -3121,23 +3121,34 @@ int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info)
{ {
int ret; int ret;
const bool cache_opt = btrfs_test_opt(fs_info, SPACE_CACHE); const bool cache_opt = btrfs_test_opt(fs_info, SPACE_CACHE);
bool clear_free_space_tree = false; bool rebuild_free_space_tree = false;
if (btrfs_test_opt(fs_info, CLEAR_CACHE) && if (btrfs_test_opt(fs_info, CLEAR_CACHE) &&
btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) { btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
clear_free_space_tree = true; rebuild_free_space_tree = true;
} else if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) && } else if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) &&
!btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID)) { !btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID)) {
btrfs_warn(fs_info, "free space tree is invalid"); btrfs_warn(fs_info, "free space tree is invalid");
clear_free_space_tree = true; rebuild_free_space_tree = true;
} }
if (clear_free_space_tree) { if (rebuild_free_space_tree) {
btrfs_info(fs_info, "clearing free space tree"); btrfs_info(fs_info, "rebuilding free space tree");
ret = btrfs_clear_free_space_tree(fs_info); ret = btrfs_rebuild_free_space_tree(fs_info);
if (ret) { if (ret) {
btrfs_warn(fs_info, btrfs_warn(fs_info,
"failed to clear free space tree: %d", ret); "failed to rebuild free space tree: %d", ret);
goto out;
}
}
if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) &&
!btrfs_test_opt(fs_info, FREE_SPACE_TREE)) {
btrfs_info(fs_info, "disabling free space tree");
ret = btrfs_delete_free_space_tree(fs_info);
if (ret) {
btrfs_warn(fs_info,
"failed to disable free space tree: %d", ret);
goto out; goto out;
} }
} }

View File

@ -52,13 +52,13 @@ void btrfs_inode_safe_disk_i_size_write(struct btrfs_inode *inode, u64 new_i_siz
u64 start, end, i_size; u64 start, end, i_size;
int ret; int ret;
spin_lock(&inode->lock);
i_size = new_i_size ?: i_size_read(&inode->vfs_inode); i_size = new_i_size ?: i_size_read(&inode->vfs_inode);
if (btrfs_fs_incompat(fs_info, NO_HOLES)) { if (btrfs_fs_incompat(fs_info, NO_HOLES)) {
inode->disk_i_size = i_size; inode->disk_i_size = i_size;
return; goto out_unlock;
} }
spin_lock(&inode->lock);
ret = find_contiguous_extent_bit(&inode->file_extent_tree, 0, &start, ret = find_contiguous_extent_bit(&inode->file_extent_tree, 0, &start,
&end, EXTENT_DIRTY); &end, EXTENT_DIRTY);
if (!ret && start == 0) if (!ret && start == 0)
@ -66,6 +66,7 @@ void btrfs_inode_safe_disk_i_size_write(struct btrfs_inode *inode, u64 new_i_siz
else else
i_size = 0; i_size = 0;
inode->disk_i_size = i_size; inode->disk_i_size = i_size;
out_unlock:
spin_unlock(&inode->lock); spin_unlock(&inode->lock);
} }

View File

@ -870,15 +870,16 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
} }
spin_lock(&ctl->tree_lock); spin_lock(&ctl->tree_lock);
ret = link_free_space(ctl, e); ret = link_free_space(ctl, e);
ctl->total_bitmaps++;
recalculate_thresholds(ctl);
spin_unlock(&ctl->tree_lock);
if (ret) { if (ret) {
spin_unlock(&ctl->tree_lock);
btrfs_err(fs_info, btrfs_err(fs_info,
"Duplicate entries in free space cache, dumping"); "Duplicate entries in free space cache, dumping");
kmem_cache_free(btrfs_free_space_cachep, e); kmem_cache_free(btrfs_free_space_cachep, e);
goto free_cache; goto free_cache;
} }
ctl->total_bitmaps++;
recalculate_thresholds(ctl);
spin_unlock(&ctl->tree_lock);
list_add_tail(&e->list, &bitmaps); list_add_tail(&e->list, &bitmaps);
} }

View File

@ -1252,7 +1252,7 @@ out:
return ret; return ret;
} }
int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info) int btrfs_delete_free_space_tree(struct btrfs_fs_info *fs_info)
{ {
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
struct btrfs_root *tree_root = fs_info->tree_root; struct btrfs_root *tree_root = fs_info->tree_root;
@ -1298,6 +1298,54 @@ abort:
return ret; return ret;
} }
int btrfs_rebuild_free_space_tree(struct btrfs_fs_info *fs_info)
{
struct btrfs_trans_handle *trans;
struct btrfs_key key = {
.objectid = BTRFS_FREE_SPACE_TREE_OBJECTID,
.type = BTRFS_ROOT_ITEM_KEY,
.offset = 0,
};
struct btrfs_root *free_space_root = btrfs_global_root(fs_info, &key);
struct rb_node *node;
int ret;
trans = btrfs_start_transaction(free_space_root, 1);
if (IS_ERR(trans))
return PTR_ERR(trans);
set_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags);
set_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags);
ret = clear_free_space_tree(trans, free_space_root);
if (ret)
goto abort;
node = rb_first_cached(&fs_info->block_group_cache_tree);
while (node) {
struct btrfs_block_group *block_group;
block_group = rb_entry(node, struct btrfs_block_group,
cache_node);
ret = populate_free_space_tree(trans, block_group);
if (ret)
goto abort;
node = rb_next(node);
}
btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE);
btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID);
clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags);
ret = btrfs_commit_transaction(trans);
clear_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags);
return ret;
abort:
btrfs_abort_transaction(trans, ret);
btrfs_end_transaction(trans);
return ret;
}
static int __add_block_group_free_space(struct btrfs_trans_handle *trans, static int __add_block_group_free_space(struct btrfs_trans_handle *trans,
struct btrfs_block_group *block_group, struct btrfs_block_group *block_group,
struct btrfs_path *path) struct btrfs_path *path)

View File

@ -18,7 +18,8 @@ struct btrfs_caching_control;
void set_free_space_tree_thresholds(struct btrfs_block_group *block_group); void set_free_space_tree_thresholds(struct btrfs_block_group *block_group);
int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info); int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info);
int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info); int btrfs_delete_free_space_tree(struct btrfs_fs_info *fs_info);
int btrfs_rebuild_free_space_tree(struct btrfs_fs_info *fs_info);
int load_free_space_tree(struct btrfs_caching_control *caching_ctl); int load_free_space_tree(struct btrfs_caching_control *caching_ctl);
int add_block_group_free_space(struct btrfs_trans_handle *trans, int add_block_group_free_space(struct btrfs_trans_handle *trans,
struct btrfs_block_group *block_group); struct btrfs_block_group *block_group);

View File

@ -3108,6 +3108,9 @@ int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
btrfs_rewrite_logical_zoned(ordered_extent); btrfs_rewrite_logical_zoned(ordered_extent);
btrfs_zone_finish_endio(fs_info, ordered_extent->disk_bytenr, btrfs_zone_finish_endio(fs_info, ordered_extent->disk_bytenr,
ordered_extent->disk_num_bytes); ordered_extent->disk_num_bytes);
} else if (btrfs_is_data_reloc_root(inode->root)) {
btrfs_zone_finish_endio(fs_info, ordered_extent->disk_bytenr,
ordered_extent->disk_num_bytes);
} }
if (test_bit(BTRFS_ORDERED_TRUNCATED, &ordered_extent->flags)) { if (test_bit(BTRFS_ORDERED_TRUNCATED, &ordered_extent->flags)) {

View File

@ -454,7 +454,9 @@ void btrfs_exclop_balance(struct btrfs_fs_info *fs_info,
case BTRFS_EXCLOP_BALANCE_PAUSED: case BTRFS_EXCLOP_BALANCE_PAUSED:
spin_lock(&fs_info->super_lock); spin_lock(&fs_info->super_lock);
ASSERT(fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE || ASSERT(fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE ||
fs_info->exclusive_operation == BTRFS_EXCLOP_DEV_ADD); fs_info->exclusive_operation == BTRFS_EXCLOP_DEV_ADD ||
fs_info->exclusive_operation == BTRFS_EXCLOP_NONE ||
fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE_PAUSED);
fs_info->exclusive_operation = BTRFS_EXCLOP_BALANCE_PAUSED; fs_info->exclusive_operation = BTRFS_EXCLOP_BALANCE_PAUSED;
spin_unlock(&fs_info->super_lock); spin_unlock(&fs_info->super_lock);
break; break;

View File

@ -151,10 +151,10 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
pr_cont("shared data backref parent %llu count %u\n", pr_cont("shared data backref parent %llu count %u\n",
offset, btrfs_shared_data_ref_count(eb, sref)); offset, btrfs_shared_data_ref_count(eb, sref));
/* /*
* offset is supposed to be a tree block which * Offset is supposed to be a tree block which must be
* must be aligned to nodesize. * aligned to sectorsize.
*/ */
if (!IS_ALIGNED(offset, eb->fs_info->nodesize)) if (!IS_ALIGNED(offset, eb->fs_info->sectorsize))
pr_info( pr_info(
"\t\t\t(parent %llu not aligned to sectorsize %u)\n", "\t\t\t(parent %llu not aligned to sectorsize %u)\n",
offset, eb->fs_info->sectorsize); offset, eb->fs_info->sectorsize);

View File

@ -3422,7 +3422,7 @@ int add_data_references(struct reloc_control *rc,
btrfs_release_path(path); btrfs_release_path(path);
ctx.bytenr = extent_key->objectid; ctx.bytenr = extent_key->objectid;
ctx.ignore_extent_item_pos = true; ctx.skip_inode_ref_list = true;
ctx.fs_info = rc->extent_root->fs_info; ctx.fs_info = rc->extent_root->fs_info;
ret = btrfs_find_all_leafs(&ctx); ret = btrfs_find_all_leafs(&ctx);

View File

@ -826,7 +826,11 @@ out:
!btrfs_test_opt(info, CLEAR_CACHE)) { !btrfs_test_opt(info, CLEAR_CACHE)) {
btrfs_err(info, "cannot disable free space tree"); btrfs_err(info, "cannot disable free space tree");
ret = -EINVAL; ret = -EINVAL;
}
if (btrfs_fs_compat_ro(info, BLOCK_GROUP_TREE) &&
!btrfs_test_opt(info, FREE_SPACE_TREE)) {
btrfs_err(info, "cannot disable free space tree with block-group-tree feature");
ret = -EINVAL;
} }
if (!ret) if (!ret)
ret = btrfs_check_mountopts_zoned(info); ret = btrfs_check_mountopts_zoned(info);

View File

@ -395,6 +395,7 @@ void btrfs_free_device(struct btrfs_device *device)
{ {
WARN_ON(!list_empty(&device->post_commit_list)); WARN_ON(!list_empty(&device->post_commit_list));
rcu_string_free(device->name); rcu_string_free(device->name);
extent_io_tree_release(&device->alloc_state);
btrfs_destroy_dev_zone_info(device); btrfs_destroy_dev_zone_info(device);
kfree(device); kfree(device);
} }

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