Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. Conflicts: drivers/net/ethernet/broadcom/bnxt/bnxt.c e009b2efb7a8 ("bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters()") 0f2b21477988 ("bnxt_en: Fix compile error without CONFIG_RFS_ACCEL") https://lore.kernel.org/all/20240105115509.225aa8a2@canb.auug.org.au/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
e63c1822ac
1
.mailmap
1
.mailmap
@ -436,6 +436,7 @@ Muna Sinada <quic_msinada@quicinc.com> <msinada@codeaurora.org>
|
||||
Murali Nalajala <quic_mnalajal@quicinc.com> <mnalajal@codeaurora.org>
|
||||
Mythri P K <mythripk@ti.com>
|
||||
Nadia Yvette Chambers <nyc@holomorphy.com> William Lee Irwin III <wli@holomorphy.com>
|
||||
Naoya Horiguchi <naoya.horiguchi@nec.com> <n-horiguchi@ah.jp.nec.com>
|
||||
Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com>
|
||||
Neeraj Upadhyay <quic_neeraju@quicinc.com> <neeraju@codeaurora.org>
|
||||
Neil Armstrong <neil.armstrong@linaro.org> <narmstrong@baylibre.com>
|
||||
|
4
CREDITS
4
CREDITS
@ -1855,6 +1855,10 @@ D: Fedora kernel maintenance (2003-2014).
|
||||
D: 'Trinity' and similar fuzz testing work.
|
||||
D: Misc/Other.
|
||||
|
||||
N: Tom Joseph
|
||||
E: tjoseph@cadence.com
|
||||
D: Cadence PCIe driver
|
||||
|
||||
N: Martin Josfsson
|
||||
E: gandalf@wlug.westbo.se
|
||||
P: 1024D/F6B6D3B1 7610 7CED 5C34 4AA6 DBA2 8BE1 5A6D AF95 F6B6 D3B1
|
||||
|
@ -15,9 +15,11 @@ allOf:
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- fsl,imx23-ocotp
|
||||
- fsl,imx28-ocotp
|
||||
items:
|
||||
- enum:
|
||||
- fsl,imx23-ocotp
|
||||
- fsl,imx28-ocotp
|
||||
- const: fsl,ocotp
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
@ -35,7 +37,7 @@ unevaluatedProperties: false
|
||||
examples:
|
||||
- |
|
||||
ocotp: efuse@8002c000 {
|
||||
compatible = "fsl,imx28-ocotp";
|
||||
compatible = "fsl,imx28-ocotp", "fsl,ocotp";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0x8002c000 0x2000>;
|
||||
|
@ -2511,7 +2511,7 @@ temp_valid_lft - INTEGER
|
||||
temp_prefered_lft - INTEGER
|
||||
Preferred lifetime (in seconds) for temporary addresses. If
|
||||
temp_prefered_lft is less than the minimum required lifetime (typically
|
||||
5 seconds), the preferred lifetime is the minimum required. If
|
||||
5 seconds), temporary addresses will not be created. If
|
||||
temp_prefered_lft is greater than temp_valid_lft, the preferred lifetime
|
||||
is temp_valid_lft.
|
||||
|
||||
|
26
MAINTAINERS
26
MAINTAINERS
@ -4127,7 +4127,6 @@ M: Franky Lin <franky.lin@broadcom.com>
|
||||
M: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
L: brcm80211-dev-list.pdl@broadcom.com
|
||||
L: SHA-cyfmac-dev-list@infineon.com
|
||||
S: Supported
|
||||
F: drivers/net/wireless/broadcom/brcm80211/
|
||||
|
||||
@ -9008,12 +9007,9 @@ K: (devm_)?gpio_regmap_(un)?register
|
||||
GPIO SUBSYSTEM
|
||||
M: Linus Walleij <linus.walleij@linaro.org>
|
||||
M: Bartosz Golaszewski <brgl@bgdev.pl>
|
||||
R: Andy Shevchenko <andy@kernel.org>
|
||||
L: linux-gpio@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
|
||||
F: Documentation/ABI/obsolete/sysfs-gpio
|
||||
F: Documentation/ABI/testing/gpio-cdev
|
||||
F: Documentation/admin-guide/gpio/
|
||||
F: Documentation/devicetree/bindings/gpio/
|
||||
F: Documentation/driver-api/gpio/
|
||||
@ -9022,6 +9018,16 @@ F: include/dt-bindings/gpio/
|
||||
F: include/linux/gpio.h
|
||||
F: include/linux/gpio/
|
||||
F: include/linux/of_gpio.h
|
||||
|
||||
GPIO UAPI
|
||||
M: Bartosz Golaszewski <brgl@bgdev.pl>
|
||||
R: Kent Gibson <warthog618@gmail.com>
|
||||
L: linux-gpio@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
|
||||
F: Documentation/ABI/obsolete/sysfs-gpio
|
||||
F: Documentation/ABI/testing/gpio-cdev
|
||||
F: drivers/gpio/gpiolib-cdev.c
|
||||
F: include/uapi/linux/gpio.h
|
||||
F: tools/gpio/
|
||||
|
||||
@ -10642,6 +10648,7 @@ F: drivers/gpio/gpio-pch.c
|
||||
F: drivers/gpio/gpio-sch.c
|
||||
F: drivers/gpio/gpio-sodaville.c
|
||||
F: drivers/gpio/gpio-tangier.c
|
||||
F: drivers/gpio/gpio-tangier.h
|
||||
|
||||
INTEL GVT-g DRIVERS (Intel GPU Virtualization)
|
||||
M: Zhenyu Wang <zhenyuw@linux.intel.com>
|
||||
@ -11473,6 +11480,7 @@ F: scripts/*vmlinux*
|
||||
F: scripts/Kbuild*
|
||||
F: scripts/Makefile*
|
||||
F: scripts/basic/
|
||||
F: scripts/clang-tools/
|
||||
F: scripts/dummy-tools/
|
||||
F: scripts/mk*
|
||||
F: scripts/mod/
|
||||
@ -12828,7 +12836,7 @@ S: Maintained
|
||||
F: drivers/net/ethernet/marvell/mvneta.*
|
||||
|
||||
MARVELL MVPP2 ETHERNET DRIVER
|
||||
M: Marcin Wojtas <mw@semihalf.com>
|
||||
M: Marcin Wojtas <marcin.s.wojtas@gmail.com>
|
||||
M: Russell King <linux@armlinux.org.uk>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
@ -15093,6 +15101,7 @@ K: \bmdo_
|
||||
NETWORKING [MPTCP]
|
||||
M: Matthieu Baerts <matttbe@kernel.org>
|
||||
M: Mat Martineau <martineau@kernel.org>
|
||||
R: Geliang Tang <geliang.tang@linux.dev>
|
||||
L: netdev@vger.kernel.org
|
||||
L: mptcp@lists.linux.dev
|
||||
S: Maintained
|
||||
@ -15441,7 +15450,7 @@ F: Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml
|
||||
F: drivers/bluetooth/btnxpuart.c
|
||||
|
||||
NXP C45 TJA11XX PHY DRIVER
|
||||
M: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
|
||||
M: Andrei Botila <andrei.botila@oss.nxp.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/phy/nxp-c45-tja11xx*
|
||||
@ -16458,11 +16467,10 @@ F: Documentation/devicetree/bindings/pci/pci-armada8k.txt
|
||||
F: drivers/pci/controller/dwc/pcie-armada8k.c
|
||||
|
||||
PCI DRIVER FOR CADENCE PCIE IP
|
||||
M: Tom Joseph <tjoseph@cadence.com>
|
||||
L: linux-pci@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
F: Documentation/devicetree/bindings/pci/cdns,*
|
||||
F: drivers/pci/controller/cadence/
|
||||
F: drivers/pci/controller/cadence/*cadence*
|
||||
|
||||
PCI DRIVER FOR FREESCALE LAYERSCAPE
|
||||
M: Minghuan Lian <minghuan.Lian@nxp.com>
|
||||
|
2
Makefile
2
Makefile
@ -2,7 +2,7 @@
|
||||
VERSION = 6
|
||||
PATCHLEVEL = 7
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION = -rc6
|
||||
EXTRAVERSION = -rc8
|
||||
NAME = Hurr durr I'ma ninja sloth
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -410,7 +410,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
|
||||
kvm_mmu_free_memory_cache(&vcpu->arch.mmu_page_cache);
|
||||
kvm_timer_vcpu_terminate(vcpu);
|
||||
kvm_pmu_vcpu_destroy(vcpu);
|
||||
|
||||
kvm_vgic_vcpu_destroy(vcpu);
|
||||
kvm_arm_vcpu_destroy(vcpu);
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ static void kvm_vgic_dist_destroy(struct kvm *kvm)
|
||||
vgic_v4_teardown(kvm);
|
||||
}
|
||||
|
||||
void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
|
||||
static void __kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
|
||||
|
||||
@ -379,29 +379,39 @@ void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
|
||||
vgic_flush_pending_lpis(vcpu);
|
||||
|
||||
INIT_LIST_HEAD(&vgic_cpu->ap_list_head);
|
||||
vgic_cpu->rd_iodev.base_addr = VGIC_ADDR_UNDEF;
|
||||
if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
|
||||
vgic_unregister_redist_iodev(vcpu);
|
||||
vgic_cpu->rd_iodev.base_addr = VGIC_ADDR_UNDEF;
|
||||
}
|
||||
}
|
||||
|
||||
static void __kvm_vgic_destroy(struct kvm *kvm)
|
||||
void kvm_vgic_vcpu_destroy(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_vcpu *vcpu;
|
||||
unsigned long i;
|
||||
struct kvm *kvm = vcpu->kvm;
|
||||
|
||||
lockdep_assert_held(&kvm->arch.config_lock);
|
||||
|
||||
vgic_debug_destroy(kvm);
|
||||
|
||||
kvm_for_each_vcpu(i, vcpu, kvm)
|
||||
kvm_vgic_vcpu_destroy(vcpu);
|
||||
|
||||
kvm_vgic_dist_destroy(kvm);
|
||||
mutex_lock(&kvm->slots_lock);
|
||||
__kvm_vgic_vcpu_destroy(vcpu);
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
}
|
||||
|
||||
void kvm_vgic_destroy(struct kvm *kvm)
|
||||
{
|
||||
struct kvm_vcpu *vcpu;
|
||||
unsigned long i;
|
||||
|
||||
mutex_lock(&kvm->slots_lock);
|
||||
|
||||
vgic_debug_destroy(kvm);
|
||||
|
||||
kvm_for_each_vcpu(i, vcpu, kvm)
|
||||
__kvm_vgic_vcpu_destroy(vcpu);
|
||||
|
||||
mutex_lock(&kvm->arch.config_lock);
|
||||
__kvm_vgic_destroy(kvm);
|
||||
|
||||
kvm_vgic_dist_destroy(kvm);
|
||||
|
||||
mutex_unlock(&kvm->arch.config_lock);
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -469,25 +479,26 @@ int kvm_vgic_map_resources(struct kvm *kvm)
|
||||
type = VGIC_V3;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
__kvm_vgic_destroy(kvm);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
||||
dist->ready = true;
|
||||
dist_base = dist->vgic_dist_base;
|
||||
mutex_unlock(&kvm->arch.config_lock);
|
||||
|
||||
ret = vgic_register_dist_iodev(kvm, dist_base, type);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
kvm_err("Unable to register VGIC dist MMIO regions\n");
|
||||
kvm_vgic_destroy(kvm);
|
||||
}
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
return ret;
|
||||
|
||||
goto out_slots;
|
||||
out:
|
||||
mutex_unlock(&kvm->arch.config_lock);
|
||||
out_slots:
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
|
||||
if (ret)
|
||||
kvm_vgic_destroy(kvm);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ out_unlock:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void vgic_unregister_redist_iodev(struct kvm_vcpu *vcpu)
|
||||
void vgic_unregister_redist_iodev(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct vgic_io_device *rd_dev = &vcpu->arch.vgic_cpu.rd_iodev;
|
||||
|
||||
@ -833,6 +833,8 @@ static int vgic_register_all_redist_iodevs(struct kvm *kvm)
|
||||
unsigned long c;
|
||||
int ret = 0;
|
||||
|
||||
lockdep_assert_held(&kvm->slots_lock);
|
||||
|
||||
kvm_for_each_vcpu(c, vcpu, kvm) {
|
||||
ret = vgic_register_redist_iodev(vcpu);
|
||||
if (ret)
|
||||
|
@ -241,6 +241,7 @@ int vgic_v3_lpi_sync_pending_status(struct kvm *kvm, struct vgic_irq *irq);
|
||||
int vgic_v3_save_pending_tables(struct kvm *kvm);
|
||||
int vgic_v3_set_redist_base(struct kvm *kvm, u32 index, u64 addr, u32 count);
|
||||
int vgic_register_redist_iodev(struct kvm_vcpu *vcpu);
|
||||
void vgic_unregister_redist_iodev(struct kvm_vcpu *vcpu);
|
||||
bool vgic_v3_check_base(struct kvm *kvm);
|
||||
|
||||
void vgic_v3_load(struct kvm_vcpu *vcpu);
|
||||
|
@ -608,10 +608,10 @@ config ARCH_SUPPORTS_KEXEC
|
||||
def_bool PPC_BOOK3S || PPC_E500 || (44x && !SMP)
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_FILE
|
||||
def_bool PPC64 && CRYPTO=y && CRYPTO_SHA256=y
|
||||
def_bool PPC64
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_PURGATORY
|
||||
def_bool KEXEC_FILE
|
||||
def_bool y
|
||||
|
||||
config ARCH_SELECTS_KEXEC_FILE
|
||||
def_bool y
|
||||
|
@ -702,9 +702,7 @@ config ARCH_SELECTS_KEXEC_FILE
|
||||
select KEXEC_ELF
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_PURGATORY
|
||||
def_bool KEXEC_FILE
|
||||
depends on CRYPTO=y
|
||||
depends on CRYPTO_SHA256=y
|
||||
def_bool ARCH_SUPPORTS_KEXEC_FILE
|
||||
|
||||
config ARCH_SUPPORTS_CRASH_DUMP
|
||||
def_bool y
|
||||
|
@ -55,6 +55,7 @@ struct imsic {
|
||||
/* IMSIC SW-file */
|
||||
struct imsic_mrif *swfile;
|
||||
phys_addr_t swfile_pa;
|
||||
spinlock_t swfile_extirq_lock;
|
||||
};
|
||||
|
||||
#define imsic_vs_csr_read(__c) \
|
||||
@ -613,12 +614,23 @@ static void imsic_swfile_extirq_update(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct imsic *imsic = vcpu->arch.aia_context.imsic_state;
|
||||
struct imsic_mrif *mrif = imsic->swfile;
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
* The critical section is necessary during external interrupt
|
||||
* updates to avoid the risk of losing interrupts due to potential
|
||||
* interruptions between reading topei and updating pending status.
|
||||
*/
|
||||
|
||||
spin_lock_irqsave(&imsic->swfile_extirq_lock, flags);
|
||||
|
||||
if (imsic_mrif_atomic_read(mrif, &mrif->eidelivery) &&
|
||||
imsic_mrif_topei(mrif, imsic->nr_eix, imsic->nr_msis))
|
||||
kvm_riscv_vcpu_set_interrupt(vcpu, IRQ_VS_EXT);
|
||||
else
|
||||
kvm_riscv_vcpu_unset_interrupt(vcpu, IRQ_VS_EXT);
|
||||
|
||||
spin_unlock_irqrestore(&imsic->swfile_extirq_lock, flags);
|
||||
}
|
||||
|
||||
static void imsic_swfile_read(struct kvm_vcpu *vcpu, bool clear,
|
||||
@ -1039,6 +1051,7 @@ int kvm_riscv_vcpu_aia_imsic_init(struct kvm_vcpu *vcpu)
|
||||
}
|
||||
imsic->swfile = page_to_virt(swfile_page);
|
||||
imsic->swfile_pa = page_to_phys(swfile_page);
|
||||
spin_lock_init(&imsic->swfile_extirq_lock);
|
||||
|
||||
/* Setup IO device */
|
||||
kvm_iodevice_init(&imsic->iodev, &imsic_iodoev_ops);
|
||||
|
@ -254,13 +254,13 @@ config ARCH_SUPPORTS_KEXEC
|
||||
def_bool y
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_FILE
|
||||
def_bool CRYPTO && CRYPTO_SHA256 && CRYPTO_SHA256_S390
|
||||
def_bool y
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_SIG
|
||||
def_bool MODULE_SIG_FORMAT
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_PURGATORY
|
||||
def_bool KEXEC_FILE
|
||||
def_bool y
|
||||
|
||||
config ARCH_SUPPORTS_CRASH_DUMP
|
||||
def_bool y
|
||||
|
@ -2072,7 +2072,7 @@ config ARCH_SUPPORTS_KEXEC
|
||||
def_bool y
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_FILE
|
||||
def_bool X86_64 && CRYPTO && CRYPTO_SHA256
|
||||
def_bool X86_64
|
||||
|
||||
config ARCH_SELECTS_KEXEC_FILE
|
||||
def_bool y
|
||||
@ -2080,7 +2080,7 @@ config ARCH_SELECTS_KEXEC_FILE
|
||||
select HAVE_IMA_KEXEC if IMA
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_PURGATORY
|
||||
def_bool KEXEC_FILE
|
||||
def_bool y
|
||||
|
||||
config ARCH_SUPPORTS_KEXEC_SIG
|
||||
def_bool y
|
||||
|
@ -293,6 +293,7 @@ acpi_parse_lapic(union acpi_subtable_headers * header, const unsigned long end)
|
||||
processor->processor_id, /* ACPI ID */
|
||||
processor->lapic_flags & ACPI_MADT_ENABLED);
|
||||
|
||||
has_lapic_cpus = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1134,7 +1135,6 @@ static int __init acpi_parse_madt_lapic_entries(void)
|
||||
if (!count) {
|
||||
count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC,
|
||||
acpi_parse_lapic, MAX_LOCAL_APIC);
|
||||
has_lapic_cpus = count > 0;
|
||||
x2count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_X2APIC,
|
||||
acpi_parse_x2apic, MAX_LOCAL_APIC);
|
||||
}
|
||||
|
@ -256,6 +256,16 @@ static void __init_or_module noinline optimize_nops(u8 *instr, size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
static void __init_or_module noinline optimize_nops_inplace(u8 *instr, size_t len)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
optimize_nops(instr, len);
|
||||
sync_core();
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* In this context, "source" is where the instructions are placed in the
|
||||
* section .altinstr_replacement, for example during kernel build by the
|
||||
@ -439,7 +449,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start,
|
||||
* patch if feature is *NOT* present.
|
||||
*/
|
||||
if (!boot_cpu_has(a->cpuid) == !(a->flags & ALT_FLAG_NOT)) {
|
||||
optimize_nops(instr, a->instrlen);
|
||||
optimize_nops_inplace(instr, a->instrlen);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1756,8 +1766,8 @@ void __init_or_module text_poke_early(void *addr, const void *opcode,
|
||||
} else {
|
||||
local_irq_save(flags);
|
||||
memcpy(addr, opcode, len);
|
||||
local_irq_restore(flags);
|
||||
sync_core();
|
||||
local_irq_restore(flags);
|
||||
|
||||
/*
|
||||
* Could also do a CLFLUSH here to speed up CPU recovery; but
|
||||
|
@ -255,6 +255,22 @@ SYM_INNER_LABEL(secondary_startup_64_no_verify, SYM_L_GLOBAL)
|
||||
testl $X2APIC_ENABLE, %eax
|
||||
jnz .Lread_apicid_msr
|
||||
|
||||
#ifdef CONFIG_X86_X2APIC
|
||||
/*
|
||||
* If system is in X2APIC mode then MMIO base might not be
|
||||
* mapped causing the MMIO read below to fault. Faults can't
|
||||
* be handled at that point.
|
||||
*/
|
||||
cmpl $0, x2apic_mode(%rip)
|
||||
jz .Lread_apicid_mmio
|
||||
|
||||
/* Force the AP into X2APIC mode. */
|
||||
orl $X2APIC_ENABLE, %eax
|
||||
wrmsr
|
||||
jmp .Lread_apicid_msr
|
||||
#endif
|
||||
|
||||
.Lread_apicid_mmio:
|
||||
/* Read the APIC ID from the fix-mapped MMIO space. */
|
||||
movq apic_mmio_base(%rip), %rcx
|
||||
addq $APIC_ID, %rcx
|
||||
|
@ -2972,6 +2972,25 @@ static void sev_es_vcpu_after_set_cpuid(struct vcpu_svm *svm)
|
||||
|
||||
set_msr_interception(vcpu, svm->msrpm, MSR_TSC_AUX, v_tsc_aux, v_tsc_aux);
|
||||
}
|
||||
|
||||
/*
|
||||
* For SEV-ES, accesses to MSR_IA32_XSS should not be intercepted if
|
||||
* the host/guest supports its use.
|
||||
*
|
||||
* guest_can_use() checks a number of requirements on the host/guest to
|
||||
* ensure that MSR_IA32_XSS is available, but it might report true even
|
||||
* if X86_FEATURE_XSAVES isn't configured in the guest to ensure host
|
||||
* MSR_IA32_XSS is always properly restored. For SEV-ES, it is better
|
||||
* to further check that the guest CPUID actually supports
|
||||
* X86_FEATURE_XSAVES so that accesses to MSR_IA32_XSS by misbehaved
|
||||
* guests will still get intercepted and caught in the normal
|
||||
* kvm_emulate_rdmsr()/kvm_emulated_wrmsr() paths.
|
||||
*/
|
||||
if (guest_can_use(vcpu, X86_FEATURE_XSAVES) &&
|
||||
guest_cpuid_has(vcpu, X86_FEATURE_XSAVES))
|
||||
set_msr_interception(vcpu, svm->msrpm, MSR_IA32_XSS, 1, 1);
|
||||
else
|
||||
set_msr_interception(vcpu, svm->msrpm, MSR_IA32_XSS, 0, 0);
|
||||
}
|
||||
|
||||
void sev_vcpu_after_set_cpuid(struct vcpu_svm *svm)
|
||||
|
@ -103,6 +103,7 @@ static const struct svm_direct_access_msrs {
|
||||
{ .index = MSR_IA32_LASTBRANCHTOIP, .always = false },
|
||||
{ .index = MSR_IA32_LASTINTFROMIP, .always = false },
|
||||
{ .index = MSR_IA32_LASTINTTOIP, .always = false },
|
||||
{ .index = MSR_IA32_XSS, .always = false },
|
||||
{ .index = MSR_EFER, .always = false },
|
||||
{ .index = MSR_IA32_CR_PAT, .always = false },
|
||||
{ .index = MSR_AMD64_SEV_ES_GHCB, .always = true },
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define IOPM_SIZE PAGE_SIZE * 3
|
||||
#define MSRPM_SIZE PAGE_SIZE * 2
|
||||
|
||||
#define MAX_DIRECT_ACCESS_MSRS 46
|
||||
#define MAX_DIRECT_ACCESS_MSRS 47
|
||||
#define MSRPM_OFFSETS 32
|
||||
extern u32 msrpm_offsets[MSRPM_OFFSETS] __read_mostly;
|
||||
extern bool npt_enabled;
|
||||
|
@ -11,26 +11,23 @@
|
||||
#include <asm/checksum.h>
|
||||
#include <asm/word-at-a-time.h>
|
||||
|
||||
static inline unsigned short from32to16(unsigned a)
|
||||
static inline __wsum csum_finalize_sum(u64 temp64)
|
||||
{
|
||||
unsigned short b = a >> 16;
|
||||
asm("addw %w2,%w0\n\t"
|
||||
"adcw $0,%w0\n"
|
||||
: "=r" (b)
|
||||
: "0" (b), "r" (a));
|
||||
return b;
|
||||
return (__force __wsum)((temp64 + ror64(temp64, 32)) >> 32);
|
||||
}
|
||||
|
||||
static inline __wsum csum_tail(u64 temp64, int odd)
|
||||
static inline unsigned long update_csum_40b(unsigned long sum, const unsigned long m[5])
|
||||
{
|
||||
unsigned int result;
|
||||
|
||||
result = add32_with_carry(temp64 >> 32, temp64 & 0xffffffff);
|
||||
if (unlikely(odd)) {
|
||||
result = from32to16(result);
|
||||
result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
|
||||
}
|
||||
return (__force __wsum)result;
|
||||
asm("addq %1,%0\n\t"
|
||||
"adcq %2,%0\n\t"
|
||||
"adcq %3,%0\n\t"
|
||||
"adcq %4,%0\n\t"
|
||||
"adcq %5,%0\n\t"
|
||||
"adcq $0,%0"
|
||||
:"+r" (sum)
|
||||
:"m" (m[0]), "m" (m[1]), "m" (m[2]),
|
||||
"m" (m[3]), "m" (m[4]));
|
||||
return sum;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -47,64 +44,32 @@ static inline __wsum csum_tail(u64 temp64, int odd)
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum)
|
||||
{
|
||||
u64 temp64 = (__force u64)sum;
|
||||
unsigned odd;
|
||||
|
||||
odd = 1 & (unsigned long) buff;
|
||||
if (unlikely(odd)) {
|
||||
if (unlikely(len == 0))
|
||||
return sum;
|
||||
temp64 = ror32((__force u32)sum, 8);
|
||||
temp64 += (*(unsigned char *)buff << 8);
|
||||
len--;
|
||||
buff++;
|
||||
/* Do two 40-byte chunks in parallel to get better ILP */
|
||||
if (likely(len >= 80)) {
|
||||
u64 temp64_2 = 0;
|
||||
do {
|
||||
temp64 = update_csum_40b(temp64, buff);
|
||||
temp64_2 = update_csum_40b(temp64_2, buff + 40);
|
||||
buff += 80;
|
||||
len -= 80;
|
||||
} while (len >= 80);
|
||||
|
||||
asm("addq %1,%0\n\t"
|
||||
"adcq $0,%0"
|
||||
:"+r" (temp64): "r" (temp64_2));
|
||||
}
|
||||
|
||||
/*
|
||||
* len == 40 is the hot case due to IPv6 headers, but annotating it likely()
|
||||
* has noticeable negative affect on codegen for all other cases with
|
||||
* minimal performance benefit here.
|
||||
* len == 40 is the hot case due to IPv6 headers, so return
|
||||
* early for that exact case without checking the tail bytes.
|
||||
*/
|
||||
if (len == 40) {
|
||||
asm("addq 0*8(%[src]),%[res]\n\t"
|
||||
"adcq 1*8(%[src]),%[res]\n\t"
|
||||
"adcq 2*8(%[src]),%[res]\n\t"
|
||||
"adcq 3*8(%[src]),%[res]\n\t"
|
||||
"adcq 4*8(%[src]),%[res]\n\t"
|
||||
"adcq $0,%[res]"
|
||||
: [res] "+r"(temp64)
|
||||
: [src] "r"(buff), "m"(*(const char(*)[40])buff));
|
||||
return csum_tail(temp64, odd);
|
||||
}
|
||||
if (unlikely(len >= 64)) {
|
||||
/*
|
||||
* Extra accumulators for better ILP in the loop.
|
||||
*/
|
||||
u64 tmp_accum, tmp_carries;
|
||||
|
||||
asm("xorl %k[tmp_accum],%k[tmp_accum]\n\t"
|
||||
"xorl %k[tmp_carries],%k[tmp_carries]\n\t"
|
||||
"subl $64, %[len]\n\t"
|
||||
"1:\n\t"
|
||||
"addq 0*8(%[src]),%[res]\n\t"
|
||||
"adcq 1*8(%[src]),%[res]\n\t"
|
||||
"adcq 2*8(%[src]),%[res]\n\t"
|
||||
"adcq 3*8(%[src]),%[res]\n\t"
|
||||
"adcl $0,%k[tmp_carries]\n\t"
|
||||
"addq 4*8(%[src]),%[tmp_accum]\n\t"
|
||||
"adcq 5*8(%[src]),%[tmp_accum]\n\t"
|
||||
"adcq 6*8(%[src]),%[tmp_accum]\n\t"
|
||||
"adcq 7*8(%[src]),%[tmp_accum]\n\t"
|
||||
"adcl $0,%k[tmp_carries]\n\t"
|
||||
"addq $64, %[src]\n\t"
|
||||
"subl $64, %[len]\n\t"
|
||||
"jge 1b\n\t"
|
||||
"addq %[tmp_accum],%[res]\n\t"
|
||||
"adcq %[tmp_carries],%[res]\n\t"
|
||||
"adcq $0,%[res]"
|
||||
: [tmp_accum] "=&r"(tmp_accum),
|
||||
[tmp_carries] "=&r"(tmp_carries), [res] "+r"(temp64),
|
||||
[len] "+r"(len), [src] "+r"(buff)
|
||||
: "m"(*(const char *)buff));
|
||||
if (len >= 40) {
|
||||
temp64 = update_csum_40b(temp64, buff);
|
||||
len -= 40;
|
||||
if (!len)
|
||||
return csum_finalize_sum(temp64);
|
||||
buff += 40;
|
||||
}
|
||||
|
||||
if (len & 32) {
|
||||
@ -143,7 +108,7 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
|
||||
: [res] "+r"(temp64)
|
||||
: [trail] "r"(trail));
|
||||
}
|
||||
return csum_tail(temp64, odd);
|
||||
return csum_finalize_sum(temp64);
|
||||
}
|
||||
EXPORT_SYMBOL(csum_partial);
|
||||
|
||||
|
@ -9,6 +9,7 @@ config XEN
|
||||
select PARAVIRT_CLOCK
|
||||
select X86_HV_CALLBACK_VECTOR
|
||||
depends on X86_64 || (X86_32 && X86_PAE)
|
||||
depends on X86_64 || (X86_GENERIC || MPENTIUM4 || MCORE2 || MATOM || MK8)
|
||||
depends on X86_LOCAL_APIC && X86_TSC
|
||||
help
|
||||
This is the Linux Xen port. Enabling this will allow the
|
||||
|
@ -1312,12 +1312,14 @@ re_check:
|
||||
prev = prev_badblocks(bb, &bad, hint);
|
||||
|
||||
/* start after all badblocks */
|
||||
if ((prev + 1) >= bb->count && !overlap_front(bb, prev, &bad)) {
|
||||
if ((prev >= 0) &&
|
||||
((prev + 1) >= bb->count) && !overlap_front(bb, prev, &bad)) {
|
||||
len = sectors;
|
||||
goto update_sectors;
|
||||
}
|
||||
|
||||
if (overlap_front(bb, prev, &bad)) {
|
||||
/* Overlapped with front badblocks record */
|
||||
if ((prev >= 0) && overlap_front(bb, prev, &bad)) {
|
||||
if (BB_ACK(p[prev]))
|
||||
acked_badblocks++;
|
||||
else
|
||||
|
@ -404,8 +404,21 @@ static struct mhi_controller_config aic100_config = {
|
||||
|
||||
static int mhi_read_reg(struct mhi_controller *mhi_cntrl, void __iomem *addr, u32 *out)
|
||||
{
|
||||
u32 tmp = readl_relaxed(addr);
|
||||
u32 tmp;
|
||||
|
||||
/*
|
||||
* SOC_HW_VERSION quirk
|
||||
* The SOC_HW_VERSION register (offset 0x224) is not reliable and
|
||||
* may contain uninitialized values, including 0xFFFFFFFF. This could
|
||||
* cause a false positive link down error. Instead, intercept any
|
||||
* reads and provide the correct value of the register.
|
||||
*/
|
||||
if (addr - mhi_cntrl->regs == 0x224) {
|
||||
*out = 0x60110200;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tmp = readl_relaxed(addr);
|
||||
if (tmp == U32_MAX)
|
||||
return -EIO;
|
||||
|
||||
|
@ -777,7 +777,6 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_
|
||||
struct dma_buf_attachment *attach;
|
||||
struct drm_gem_object *obj;
|
||||
struct qaic_bo *bo;
|
||||
size_t size;
|
||||
int ret;
|
||||
|
||||
bo = qaic_alloc_init_bo();
|
||||
@ -795,13 +794,12 @@ struct drm_gem_object *qaic_gem_prime_import(struct drm_device *dev, struct dma_
|
||||
goto attach_fail;
|
||||
}
|
||||
|
||||
size = PAGE_ALIGN(attach->dmabuf->size);
|
||||
if (size == 0) {
|
||||
if (!attach->dmabuf->size) {
|
||||
ret = -EINVAL;
|
||||
goto size_align_fail;
|
||||
}
|
||||
|
||||
drm_gem_private_object_init(dev, obj, size);
|
||||
drm_gem_private_object_init(dev, obj, attach->dmabuf->size);
|
||||
/*
|
||||
* skipping dma_buf_map_attachment() as we do not know the direction
|
||||
* just yet. Once the direction is known in the subsequent IOCTL to
|
||||
|
@ -1019,12 +1019,12 @@ static void virtblk_config_changed(struct virtio_device *vdev)
|
||||
static int init_vq(struct virtio_blk *vblk)
|
||||
{
|
||||
int err;
|
||||
int i;
|
||||
unsigned short i;
|
||||
vq_callback_t **callbacks;
|
||||
const char **names;
|
||||
struct virtqueue **vqs;
|
||||
unsigned short num_vqs;
|
||||
unsigned int num_poll_vqs;
|
||||
unsigned short num_poll_vqs;
|
||||
struct virtio_device *vdev = vblk->vdev;
|
||||
struct irq_affinity desc = { 0, };
|
||||
|
||||
@ -1068,13 +1068,13 @@ static int init_vq(struct virtio_blk *vblk)
|
||||
|
||||
for (i = 0; i < num_vqs - num_poll_vqs; i++) {
|
||||
callbacks[i] = virtblk_done;
|
||||
snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req.%d", i);
|
||||
snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req.%u", i);
|
||||
names[i] = vblk->vqs[i].name;
|
||||
}
|
||||
|
||||
for (; i < num_vqs; i++) {
|
||||
callbacks[i] = NULL;
|
||||
snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i);
|
||||
snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%u", i);
|
||||
names[i] = vblk->vqs[i].name;
|
||||
}
|
||||
|
||||
|
@ -108,8 +108,9 @@ static inline void send_msg(struct cn_msg *msg)
|
||||
filter_data[1] = 0;
|
||||
}
|
||||
|
||||
cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
|
||||
cn_filter, (void *)filter_data);
|
||||
if (cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
|
||||
cn_filter, (void *)filter_data) == -ESRCH)
|
||||
atomic_set(&proc_event_num_listeners, 0);
|
||||
|
||||
local_unlock(&local_event.lock);
|
||||
}
|
||||
|
@ -787,6 +787,8 @@ static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry)
|
||||
efi_debug("AMI firmware v2.0 or older detected - disabling physical KASLR\n");
|
||||
seed[0] = 0;
|
||||
}
|
||||
|
||||
boot_params_ptr->hdr.loadflags |= KASLR_FLAG;
|
||||
}
|
||||
|
||||
status = efi_random_alloc(alloc_size, CONFIG_PHYSICAL_ALIGN, &addr,
|
||||
|
@ -282,13 +282,15 @@ static void dwapb_irq_enable(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct dwapb_gpio *gpio = to_dwapb_gpio(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
unsigned long flags;
|
||||
u32 val;
|
||||
|
||||
raw_spin_lock_irqsave(&gc->bgpio_lock, flags);
|
||||
val = dwapb_read(gpio, GPIO_INTEN);
|
||||
val |= BIT(irqd_to_hwirq(d));
|
||||
val = dwapb_read(gpio, GPIO_INTEN) | BIT(hwirq);
|
||||
dwapb_write(gpio, GPIO_INTEN, val);
|
||||
val = dwapb_read(gpio, GPIO_INTMASK) & ~BIT(hwirq);
|
||||
dwapb_write(gpio, GPIO_INTMASK, val);
|
||||
raw_spin_unlock_irqrestore(&gc->bgpio_lock, flags);
|
||||
}
|
||||
|
||||
@ -296,12 +298,14 @@ static void dwapb_irq_disable(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct dwapb_gpio *gpio = to_dwapb_gpio(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
unsigned long flags;
|
||||
u32 val;
|
||||
|
||||
raw_spin_lock_irqsave(&gc->bgpio_lock, flags);
|
||||
val = dwapb_read(gpio, GPIO_INTEN);
|
||||
val &= ~BIT(irqd_to_hwirq(d));
|
||||
val = dwapb_read(gpio, GPIO_INTMASK) | BIT(hwirq);
|
||||
dwapb_write(gpio, GPIO_INTMASK, val);
|
||||
val = dwapb_read(gpio, GPIO_INTEN) & ~BIT(hwirq);
|
||||
dwapb_write(gpio, GPIO_INTEN, val);
|
||||
raw_spin_unlock_irqrestore(&gc->bgpio_lock, flags);
|
||||
}
|
||||
|
@ -2481,10 +2481,7 @@ static int lineinfo_unwatch(struct gpio_chardev_data *cdev, void __user *ip)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gpio_ioctl() - ioctl handler for the GPIO chardev
|
||||
*/
|
||||
static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
static long gpio_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct gpio_chardev_data *cdev = file->private_data;
|
||||
struct gpio_device *gdev = cdev->gdev;
|
||||
@ -2521,6 +2518,17 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gpio_ioctl() - ioctl handler for the GPIO chardev
|
||||
*/
|
||||
static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct gpio_chardev_data *cdev = file->private_data;
|
||||
|
||||
return call_ioctl_locked(file, cmd, arg, cdev->gdev,
|
||||
gpio_ioctl_unlocked);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
static long gpio_ioctl_compat(struct file *file, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
|
@ -285,6 +285,7 @@ static void amdgpu_vm_bo_reset_state_machine(struct amdgpu_vm *vm)
|
||||
list_for_each_entry_safe(vm_bo, tmp, &vm->idle, vm_status) {
|
||||
struct amdgpu_bo *bo = vm_bo->bo;
|
||||
|
||||
vm_bo->moved = true;
|
||||
if (!bo || bo->tbo.type != ttm_bo_type_kernel)
|
||||
list_move(&vm_bo->vm_status, &vm_bo->vm->moved);
|
||||
else if (bo->parent)
|
||||
|
@ -1653,18 +1653,24 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
|
||||
if (test_bit(gpuidx, prange->bitmap_access))
|
||||
bitmap_set(ctx->bitmap, gpuidx, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If prange is already mapped or with always mapped flag,
|
||||
* update mapping on GPUs with ACCESS attribute
|
||||
*/
|
||||
if (bitmap_empty(ctx->bitmap, MAX_GPU_INSTANCE)) {
|
||||
if (prange->mapped_to_gpu ||
|
||||
prange->flags & KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED)
|
||||
bitmap_copy(ctx->bitmap, prange->bitmap_access, MAX_GPU_INSTANCE);
|
||||
}
|
||||
} else {
|
||||
bitmap_or(ctx->bitmap, prange->bitmap_access,
|
||||
prange->bitmap_aip, MAX_GPU_INSTANCE);
|
||||
}
|
||||
|
||||
if (bitmap_empty(ctx->bitmap, MAX_GPU_INSTANCE)) {
|
||||
bitmap_copy(ctx->bitmap, prange->bitmap_access, MAX_GPU_INSTANCE);
|
||||
if (!prange->mapped_to_gpu ||
|
||||
bitmap_empty(ctx->bitmap, MAX_GPU_INSTANCE)) {
|
||||
r = 0;
|
||||
goto free_ctx;
|
||||
}
|
||||
r = 0;
|
||||
goto free_ctx;
|
||||
}
|
||||
|
||||
if (prange->actual_loc && !prange->ttm_res) {
|
||||
|
@ -1014,13 +1014,20 @@ static enum bp_result get_ss_info_v4_5(
|
||||
DC_LOG_BIOS("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n", ss_info->spread_spectrum_percentage);
|
||||
break;
|
||||
case AS_SIGNAL_TYPE_DISPLAY_PORT:
|
||||
ss_info->spread_spectrum_percentage =
|
||||
if (bp->base.integrated_info) {
|
||||
DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", bp->base.integrated_info->gpuclk_ss_percentage);
|
||||
ss_info->spread_spectrum_percentage =
|
||||
bp->base.integrated_info->gpuclk_ss_percentage;
|
||||
ss_info->type.CENTER_MODE =
|
||||
bp->base.integrated_info->gpuclk_ss_type;
|
||||
} else {
|
||||
ss_info->spread_spectrum_percentage =
|
||||
disp_cntl_tbl->dp_ss_percentage;
|
||||
ss_info->spread_spectrum_range =
|
||||
ss_info->spread_spectrum_range =
|
||||
disp_cntl_tbl->dp_ss_rate_10hz * 10;
|
||||
if (disp_cntl_tbl->dp_ss_mode & ATOM_SS_CENTRE_SPREAD_MODE)
|
||||
ss_info->type.CENTER_MODE = true;
|
||||
|
||||
if (disp_cntl_tbl->dp_ss_mode & ATOM_SS_CENTRE_SPREAD_MODE)
|
||||
ss_info->type.CENTER_MODE = true;
|
||||
}
|
||||
DC_LOG_BIOS("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n", ss_info->spread_spectrum_percentage);
|
||||
break;
|
||||
case AS_SIGNAL_TYPE_GPU_PLL:
|
||||
@ -2386,13 +2393,7 @@ static enum bp_result get_vram_info_v30(
|
||||
return BP_RESULT_BADBIOSTABLE;
|
||||
|
||||
info->num_chans = info_v30->channel_num;
|
||||
/* As suggested by VBIOS we should always use
|
||||
* dram_channel_width_bytes = 2 when using VRAM
|
||||
* table version 3.0. This is because the channel_width
|
||||
* param in the VRAM info table is changed in 7000 series and
|
||||
* no longer represents the memory channel width.
|
||||
*/
|
||||
info->dram_channel_width_bytes = 2;
|
||||
info->dram_channel_width_bytes = (1 << info_v30->channel_width) / 8;
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -2820,6 +2821,8 @@ static enum bp_result get_integrated_info_v2_2(
|
||||
info->ma_channel_number = info_v2_2->umachannelnumber;
|
||||
info->dp_ss_control =
|
||||
le16_to_cpu(info_v2_2->reserved1);
|
||||
info->gpuclk_ss_percentage = info_v2_2->gpuclk_ss_percentage;
|
||||
info->gpuclk_ss_type = info_v2_2->gpuclk_ss_type;
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UCHAR_FOR_GUID; ++i) {
|
||||
info->ext_disp_conn_info.gu_id[i] =
|
||||
|
@ -5095,18 +5095,28 @@ void dc_mclk_switch_using_fw_based_vblank_stretch_shut_down(struct dc *dc)
|
||||
*/
|
||||
bool dc_is_dmub_outbox_supported(struct dc *dc)
|
||||
{
|
||||
/* DCN31 B0 USB4 DPIA needs dmub notifications for interrupts */
|
||||
if (dc->ctx->asic_id.chip_family == FAMILY_YELLOW_CARP &&
|
||||
dc->ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0 &&
|
||||
!dc->debug.dpia_debug.bits.disable_dpia)
|
||||
return true;
|
||||
switch (dc->ctx->asic_id.chip_family) {
|
||||
|
||||
if (dc->ctx->asic_id.chip_family == AMDGPU_FAMILY_GC_11_0_1 &&
|
||||
!dc->debug.dpia_debug.bits.disable_dpia)
|
||||
return true;
|
||||
case FAMILY_YELLOW_CARP:
|
||||
/* DCN31 B0 USB4 DPIA needs dmub notifications for interrupts */
|
||||
if (dc->ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0 &&
|
||||
!dc->debug.dpia_debug.bits.disable_dpia)
|
||||
return true;
|
||||
break;
|
||||
|
||||
case AMDGPU_FAMILY_GC_11_0_1:
|
||||
case AMDGPU_FAMILY_GC_11_5_0:
|
||||
if (!dc->debug.dpia_debug.bits.disable_dpia)
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* dmub aux needs dmub notifications to be enabled */
|
||||
return dc->debug.enable_dmub_aux_for_legacy_ddc;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5420,7 +5420,7 @@ static void CalculateOutputLink(
|
||||
*OutBpp = TruncToValidBPP((1 - Downspreading / 100) * 13500, OutputLinkDPLanes, HTotal, HActive, PixelClockBackEnd, ForcedOutputLinkBPP, LinkDSCEnable, Output,
|
||||
OutputFormat, DSCInputBitPerComponent, NumberOfDSCSlices, (dml_uint_t)AudioSampleRate, AudioSampleLayout, ODMModeNoDSC, ODMModeDSC, RequiredSlots);
|
||||
|
||||
if (OutBpp == 0 && PHYCLKD32PerState < 20000 / 32 && DSCEnable == dml_dsc_enable_if_necessary && ForcedOutputLinkBPP == 0) {
|
||||
if (*OutBpp == 0 && PHYCLKD32PerState < 20000 / 32 && DSCEnable == dml_dsc_enable_if_necessary && ForcedOutputLinkBPP == 0) {
|
||||
*RequiresDSC = true;
|
||||
LinkDSCEnable = true;
|
||||
*OutBpp = TruncToValidBPP((1 - Downspreading / 100) * 13500, OutputLinkDPLanes, HTotal, HActive, PixelClockBackEnd, ForcedOutputLinkBPP, LinkDSCEnable, Output,
|
||||
|
@ -960,6 +960,12 @@ void dcn32_init_hw(struct dc *dc)
|
||||
dc->caps.dmub_caps.subvp_psr = dc->ctx->dmub_srv->dmub->feature_caps.subvp_psr_support;
|
||||
dc->caps.dmub_caps.gecc_enable = dc->ctx->dmub_srv->dmub->feature_caps.gecc_enable;
|
||||
dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch;
|
||||
|
||||
if (dc->ctx->dmub_srv->dmub->fw_version <
|
||||
DMUB_FW_VERSION(7, 0, 35)) {
|
||||
dc->debug.force_disable_subvp = true;
|
||||
dc->debug.disable_fpo_optimizations = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -417,6 +417,8 @@ struct integrated_info {
|
||||
/* V2.1 */
|
||||
struct edp_info edp1_info;
|
||||
struct edp_info edp2_info;
|
||||
uint32_t gpuclk_ss_percentage;
|
||||
uint32_t gpuclk_ss_type;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -210,7 +210,7 @@ static ssize_t ps8640_aux_transfer_msg(struct drm_dp_aux *aux,
|
||||
struct ps8640 *ps_bridge = aux_to_ps8640(aux);
|
||||
struct regmap *map = ps_bridge->regmap[PAGE0_DP_CNTL];
|
||||
struct device *dev = &ps_bridge->page[PAGE0_DP_CNTL]->dev;
|
||||
unsigned int len = msg->size;
|
||||
size_t len = msg->size;
|
||||
unsigned int data;
|
||||
unsigned int base;
|
||||
int ret;
|
||||
@ -330,11 +330,12 @@ static ssize_t ps8640_aux_transfer_msg(struct drm_dp_aux *aux,
|
||||
return ret;
|
||||
}
|
||||
|
||||
buf[i] = data;
|
||||
if (i < msg->size)
|
||||
buf[i] = data;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
return min(len, msg->size);
|
||||
}
|
||||
|
||||
static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux,
|
||||
|
@ -527,6 +527,7 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux,
|
||||
u32 request_val = AUX_CMD_REQ(msg->request);
|
||||
u8 *buf = msg->buffer;
|
||||
unsigned int len = msg->size;
|
||||
unsigned int short_len;
|
||||
unsigned int val;
|
||||
int ret;
|
||||
u8 addr_len[SN_AUX_LENGTH_REG + 1 - SN_AUX_ADDR_19_16_REG];
|
||||
@ -600,7 +601,8 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux,
|
||||
}
|
||||
|
||||
if (val & AUX_IRQ_STATUS_AUX_SHORT) {
|
||||
ret = regmap_read(pdata->regmap, SN_AUX_LENGTH_REG, &len);
|
||||
ret = regmap_read(pdata->regmap, SN_AUX_LENGTH_REG, &short_len);
|
||||
len = min(len, short_len);
|
||||
if (ret)
|
||||
goto exit;
|
||||
} else if (val & AUX_IRQ_STATUS_NAT_I2C_FAIL) {
|
||||
|
@ -2465,7 +2465,8 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,
|
||||
|
||||
val |= XELPDP_FORWARD_CLOCK_UNGATE;
|
||||
|
||||
if (is_hdmi_frl(crtc_state->port_clock))
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) &&
|
||||
is_hdmi_frl(crtc_state->port_clock))
|
||||
val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_DIV18CLK);
|
||||
else
|
||||
val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_MAXPCLK);
|
||||
|
@ -3747,8 +3747,8 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
|
||||
if (!active)
|
||||
goto out;
|
||||
|
||||
intel_dsc_get_config(pipe_config);
|
||||
intel_bigjoiner_get_config(pipe_config);
|
||||
intel_dsc_get_config(pipe_config);
|
||||
|
||||
if (!transcoder_is_dsi(pipe_config->cpu_transcoder) ||
|
||||
DISPLAY_VER(dev_priv) >= 11)
|
||||
@ -6033,6 +6033,17 @@ static int intel_async_flip_check_uapi(struct intel_atomic_state *state,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: Bigjoiner+async flip is busted currently.
|
||||
* Remove this check once the issues are fixed.
|
||||
*/
|
||||
if (new_crtc_state->bigjoiner_pipes) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
"[CRTC:%d:%s] async flip disallowed with bigjoiner\n",
|
||||
crtc->base.base.id, crtc->base.name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
|
||||
new_plane_state, i) {
|
||||
if (plane->pipe != crtc->pipe)
|
||||
|
@ -389,7 +389,7 @@ disable_all_flip_queue_events(struct drm_i915_private *i915)
|
||||
enum intel_dmc_id dmc_id;
|
||||
|
||||
/* TODO: check if the following applies to all D13+ platforms. */
|
||||
if (!IS_DG2(i915) && !IS_TIGERLAKE(i915))
|
||||
if (!IS_TIGERLAKE(i915))
|
||||
return;
|
||||
|
||||
for_each_dmc_id(dmc_id) {
|
||||
@ -493,6 +493,45 @@ void intel_dmc_disable_pipe(struct drm_i915_private *i915, enum pipe pipe)
|
||||
intel_de_rmw(i915, PIPEDMC_CONTROL(pipe), PIPEDMC_ENABLE, 0);
|
||||
}
|
||||
|
||||
static bool is_dmc_evt_ctl_reg(struct drm_i915_private *i915,
|
||||
enum intel_dmc_id dmc_id, i915_reg_t reg)
|
||||
{
|
||||
u32 offset = i915_mmio_reg_offset(reg);
|
||||
u32 start = i915_mmio_reg_offset(DMC_EVT_CTL(i915, dmc_id, 0));
|
||||
u32 end = i915_mmio_reg_offset(DMC_EVT_CTL(i915, dmc_id, DMC_EVENT_HANDLER_COUNT_GEN12));
|
||||
|
||||
return offset >= start && offset < end;
|
||||
}
|
||||
|
||||
static bool disable_dmc_evt(struct drm_i915_private *i915,
|
||||
enum intel_dmc_id dmc_id,
|
||||
i915_reg_t reg, u32 data)
|
||||
{
|
||||
if (!is_dmc_evt_ctl_reg(i915, dmc_id, reg))
|
||||
return false;
|
||||
|
||||
/* keep all pipe DMC events disabled by default */
|
||||
if (dmc_id != DMC_FW_MAIN)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static u32 dmc_mmiodata(struct drm_i915_private *i915,
|
||||
struct intel_dmc *dmc,
|
||||
enum intel_dmc_id dmc_id, int i)
|
||||
{
|
||||
if (disable_dmc_evt(i915, dmc_id,
|
||||
dmc->dmc_info[dmc_id].mmioaddr[i],
|
||||
dmc->dmc_info[dmc_id].mmiodata[i]))
|
||||
return REG_FIELD_PREP(DMC_EVT_CTL_TYPE_MASK,
|
||||
DMC_EVT_CTL_TYPE_EDGE_0_1) |
|
||||
REG_FIELD_PREP(DMC_EVT_CTL_EVENT_ID_MASK,
|
||||
DMC_EVT_CTL_EVENT_ID_FALSE);
|
||||
else
|
||||
return dmc->dmc_info[dmc_id].mmiodata[i];
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_dmc_load_program() - write the firmware from memory to register.
|
||||
* @i915: i915 drm device.
|
||||
@ -532,7 +571,7 @@ void intel_dmc_load_program(struct drm_i915_private *i915)
|
||||
for_each_dmc_id(dmc_id) {
|
||||
for (i = 0; i < dmc->dmc_info[dmc_id].mmio_count; i++) {
|
||||
intel_de_write(i915, dmc->dmc_info[dmc_id].mmioaddr[i],
|
||||
dmc->dmc_info[dmc_id].mmiodata[i]);
|
||||
dmc_mmiodata(i915, dmc, dmc_id, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4496,7 +4496,7 @@ static void intel_dp_process_phy_request(struct intel_dp *intel_dp,
|
||||
intel_dp->train_set, crtc_state->lane_count);
|
||||
|
||||
drm_dp_set_phy_test_pattern(&intel_dp->aux, data,
|
||||
link_status[DP_DPCD_REV]);
|
||||
intel_dp->dpcd[DP_DPCD_REV]);
|
||||
}
|
||||
|
||||
static u8 intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp)
|
||||
|
@ -175,7 +175,7 @@ hwm_power1_max_interval_show(struct device *dev, struct device_attribute *attr,
|
||||
* tau4 = (4 | x) << y
|
||||
* but add 2 when doing the final right shift to account for units
|
||||
*/
|
||||
tau4 = ((1 << x_w) | x) << y;
|
||||
tau4 = (u64)((1 << x_w) | x) << y;
|
||||
/* val in hwmon interface units (millisec) */
|
||||
out = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w);
|
||||
|
||||
@ -211,7 +211,7 @@ hwm_power1_max_interval_store(struct device *dev,
|
||||
r = FIELD_PREP(PKG_MAX_WIN, PKG_MAX_WIN_DEFAULT);
|
||||
x = REG_FIELD_GET(PKG_MAX_WIN_X, r);
|
||||
y = REG_FIELD_GET(PKG_MAX_WIN_Y, r);
|
||||
tau4 = ((1 << x_w) | x) << y;
|
||||
tau4 = (u64)((1 << x_w) | x) << y;
|
||||
max_win = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w);
|
||||
|
||||
if (val > max_win)
|
||||
|
@ -772,10 +772,6 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream,
|
||||
* The reason field includes flags identifying what
|
||||
* triggered this specific report (mostly timer
|
||||
* triggered or e.g. due to a context switch).
|
||||
*
|
||||
* In MMIO triggered reports, some platforms do not set the
|
||||
* reason bit in this field and it is valid to have a reason
|
||||
* field of zero.
|
||||
*/
|
||||
reason = oa_report_reason(stream, report);
|
||||
ctx_id = oa_context_id(stream, report32);
|
||||
@ -787,8 +783,41 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream,
|
||||
*
|
||||
* Note: that we don't clear the valid_ctx_bit so userspace can
|
||||
* understand that the ID has been squashed by the kernel.
|
||||
*
|
||||
* Update:
|
||||
*
|
||||
* On XEHP platforms the behavior of context id valid bit has
|
||||
* changed compared to prior platforms. To describe this, we
|
||||
* define a few terms:
|
||||
*
|
||||
* context-switch-report: This is a report with the reason type
|
||||
* being context-switch. It is generated when a context switches
|
||||
* out.
|
||||
*
|
||||
* context-valid-bit: A bit that is set in the report ID field
|
||||
* to indicate that a valid context has been loaded.
|
||||
*
|
||||
* gpu-idle: A condition characterized by a
|
||||
* context-switch-report with context-valid-bit set to 0.
|
||||
*
|
||||
* On prior platforms, context-id-valid bit is set to 0 only
|
||||
* when GPU goes idle. In all other reports, it is set to 1.
|
||||
*
|
||||
* On XEHP platforms, context-valid-bit is set to 1 in a context
|
||||
* switch report if a new context switched in. For all other
|
||||
* reports it is set to 0.
|
||||
*
|
||||
* This change in behavior causes an issue with MMIO triggered
|
||||
* reports. MMIO triggered reports have the markers in the
|
||||
* context ID field and the context-valid-bit is 0. The logic
|
||||
* below to squash the context ID would render the report
|
||||
* useless since the user will not be able to find it in the OA
|
||||
* buffer. Since MMIO triggered reports exist only on XEHP,
|
||||
* we should avoid squashing these for XEHP platforms.
|
||||
*/
|
||||
if (oa_report_ctx_invalid(stream, report)) {
|
||||
|
||||
if (oa_report_ctx_invalid(stream, report) &&
|
||||
GRAPHICS_VER_FULL(stream->engine->i915) < IP_VER(12, 50)) {
|
||||
ctx_id = INVALID_CTX_ID;
|
||||
oa_context_id_squash(stream, report32);
|
||||
}
|
||||
|
@ -392,6 +392,11 @@ void mgag200_primary_plane_helper_atomic_disable(struct drm_plane *plane,
|
||||
.destroy = drm_plane_cleanup, \
|
||||
DRM_GEM_SHADOW_PLANE_FUNCS
|
||||
|
||||
void mgag200_crtc_set_gamma_linear(struct mga_device *mdev, const struct drm_format_info *format);
|
||||
void mgag200_crtc_set_gamma(struct mga_device *mdev,
|
||||
const struct drm_format_info *format,
|
||||
struct drm_color_lut *lut);
|
||||
|
||||
enum drm_mode_status mgag200_crtc_helper_mode_valid(struct drm_crtc *crtc,
|
||||
const struct drm_display_mode *mode);
|
||||
int mgag200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *new_state);
|
||||
|
@ -202,6 +202,11 @@ static void mgag200_g200er_crtc_helper_atomic_enable(struct drm_crtc *crtc,
|
||||
|
||||
mgag200_g200er_reset_tagfifo(mdev);
|
||||
|
||||
if (crtc_state->gamma_lut)
|
||||
mgag200_crtc_set_gamma(mdev, format, crtc_state->gamma_lut->data);
|
||||
else
|
||||
mgag200_crtc_set_gamma_linear(mdev, format);
|
||||
|
||||
mgag200_enable_display(mdev);
|
||||
|
||||
if (funcs->enable_vidrst)
|
||||
|
@ -203,6 +203,11 @@ static void mgag200_g200ev_crtc_helper_atomic_enable(struct drm_crtc *crtc,
|
||||
|
||||
mgag200_g200ev_set_hiprilvl(mdev);
|
||||
|
||||
if (crtc_state->gamma_lut)
|
||||
mgag200_crtc_set_gamma(mdev, format, crtc_state->gamma_lut->data);
|
||||
else
|
||||
mgag200_crtc_set_gamma_linear(mdev, format);
|
||||
|
||||
mgag200_enable_display(mdev);
|
||||
|
||||
if (funcs->enable_vidrst)
|
||||
|
@ -334,6 +334,11 @@ static void mgag200_g200se_crtc_helper_atomic_enable(struct drm_crtc *crtc,
|
||||
|
||||
mgag200_g200se_set_hiprilvl(mdev, adjusted_mode, format);
|
||||
|
||||
if (crtc_state->gamma_lut)
|
||||
mgag200_crtc_set_gamma(mdev, format, crtc_state->gamma_lut->data);
|
||||
else
|
||||
mgag200_crtc_set_gamma_linear(mdev, format);
|
||||
|
||||
mgag200_enable_display(mdev);
|
||||
|
||||
if (funcs->enable_vidrst)
|
||||
|
@ -28,8 +28,8 @@
|
||||
* This file contains setup code for the CRTC.
|
||||
*/
|
||||
|
||||
static void mgag200_crtc_set_gamma_linear(struct mga_device *mdev,
|
||||
const struct drm_format_info *format)
|
||||
void mgag200_crtc_set_gamma_linear(struct mga_device *mdev,
|
||||
const struct drm_format_info *format)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -65,9 +65,9 @@ static void mgag200_crtc_set_gamma_linear(struct mga_device *mdev,
|
||||
}
|
||||
}
|
||||
|
||||
static void mgag200_crtc_set_gamma(struct mga_device *mdev,
|
||||
const struct drm_format_info *format,
|
||||
struct drm_color_lut *lut)
|
||||
void mgag200_crtc_set_gamma(struct mga_device *mdev,
|
||||
const struct drm_format_info *format,
|
||||
struct drm_color_lut *lut)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -249,18 +249,46 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
|
||||
if (!slave)
|
||||
return 0;
|
||||
|
||||
command = readl(bus->base + ASPEED_I2C_CMD_REG);
|
||||
/*
|
||||
* Handle stop conditions early, prior to SLAVE_MATCH. Some masters may drive
|
||||
* transfers with low enough latency between the nak/stop phase of the current
|
||||
* command and the start/address phase of the following command that the
|
||||
* interrupts are coalesced by the time we process them.
|
||||
*/
|
||||
if (irq_status & ASPEED_I2CD_INTR_NORMAL_STOP) {
|
||||
irq_handled |= ASPEED_I2CD_INTR_NORMAL_STOP;
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_STOP;
|
||||
}
|
||||
|
||||
/* Slave was requested, restart state machine. */
|
||||
if (irq_status & ASPEED_I2CD_INTR_TX_NAK &&
|
||||
bus->slave_state == ASPEED_I2C_SLAVE_READ_PROCESSED) {
|
||||
irq_handled |= ASPEED_I2CD_INTR_TX_NAK;
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_STOP;
|
||||
}
|
||||
|
||||
/* Propagate any stop conditions to the slave implementation. */
|
||||
if (bus->slave_state == ASPEED_I2C_SLAVE_STOP) {
|
||||
i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we've dealt with any potentially coalesced stop conditions,
|
||||
* address any start conditions.
|
||||
*/
|
||||
if (irq_status & ASPEED_I2CD_INTR_SLAVE_MATCH) {
|
||||
irq_handled |= ASPEED_I2CD_INTR_SLAVE_MATCH;
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_START;
|
||||
}
|
||||
|
||||
/* Slave is not currently active, irq was for someone else. */
|
||||
/*
|
||||
* If the slave has been stopped and not started then slave interrupt
|
||||
* handling is complete.
|
||||
*/
|
||||
if (bus->slave_state == ASPEED_I2C_SLAVE_INACTIVE)
|
||||
return irq_handled;
|
||||
|
||||
command = readl(bus->base + ASPEED_I2C_CMD_REG);
|
||||
dev_dbg(bus->dev, "slave irq status 0x%08x, cmd 0x%08x\n",
|
||||
irq_status, command);
|
||||
|
||||
@ -279,17 +307,6 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
|
||||
irq_handled |= ASPEED_I2CD_INTR_RX_DONE;
|
||||
}
|
||||
|
||||
/* Slave was asked to stop. */
|
||||
if (irq_status & ASPEED_I2CD_INTR_NORMAL_STOP) {
|
||||
irq_handled |= ASPEED_I2CD_INTR_NORMAL_STOP;
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_STOP;
|
||||
}
|
||||
if (irq_status & ASPEED_I2CD_INTR_TX_NAK &&
|
||||
bus->slave_state == ASPEED_I2C_SLAVE_READ_PROCESSED) {
|
||||
irq_handled |= ASPEED_I2CD_INTR_TX_NAK;
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_STOP;
|
||||
}
|
||||
|
||||
switch (bus->slave_state) {
|
||||
case ASPEED_I2C_SLAVE_READ_REQUESTED:
|
||||
if (unlikely(irq_status & ASPEED_I2CD_INTR_TX_ACK))
|
||||
@ -324,8 +341,7 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
|
||||
i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value);
|
||||
break;
|
||||
case ASPEED_I2C_SLAVE_STOP:
|
||||
i2c_slave_event(slave, I2C_SLAVE_STOP, &value);
|
||||
bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE;
|
||||
/* Stop event handling is done early. Unreachable. */
|
||||
break;
|
||||
case ASPEED_I2C_SLAVE_START:
|
||||
/* Slave was just started. Waiting for the next event. */;
|
||||
|
@ -858,6 +858,7 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
||||
ret = geni_se_resources_on(&gi2c->se);
|
||||
if (ret) {
|
||||
dev_err(dev, "Error turning on resources %d\n", ret);
|
||||
clk_disable_unprepare(gi2c->core_clk);
|
||||
return ret;
|
||||
}
|
||||
proto = geni_se_read_proto(&gi2c->se);
|
||||
@ -877,8 +878,11 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
||||
/* FIFO is disabled, so we can only use GPI DMA */
|
||||
gi2c->gpi_mode = true;
|
||||
ret = setup_gpi_dma(gi2c);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
geni_se_resources_off(&gi2c->se);
|
||||
clk_disable_unprepare(gi2c->core_clk);
|
||||
return dev_err_probe(dev, ret, "Failed to setup GPI DMA mode\n");
|
||||
}
|
||||
|
||||
dev_dbg(dev, "Using GPI DMA mode for I2C\n");
|
||||
} else {
|
||||
@ -891,6 +895,8 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
||||
|
||||
if (!tx_depth) {
|
||||
dev_err(dev, "Invalid TX FIFO depth\n");
|
||||
geni_se_resources_off(&gi2c->se);
|
||||
clk_disable_unprepare(gi2c->core_clk);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -178,6 +178,7 @@ struct rk3x_i2c_soc_data {
|
||||
* @clk: function clk for rk3399 or function & Bus clks for others
|
||||
* @pclk: Bus clk for rk3399
|
||||
* @clk_rate_nb: i2c clk rate change notify
|
||||
* @irq: irq number
|
||||
* @t: I2C known timing information
|
||||
* @lock: spinlock for the i2c bus
|
||||
* @wait: the waitqueue to wait for i2c transfer
|
||||
@ -200,6 +201,7 @@ struct rk3x_i2c {
|
||||
struct clk *clk;
|
||||
struct clk *pclk;
|
||||
struct notifier_block clk_rate_nb;
|
||||
int irq;
|
||||
|
||||
/* Settings */
|
||||
struct i2c_timings t;
|
||||
@ -1087,13 +1089,18 @@ static int rk3x_i2c_xfer_common(struct i2c_adapter *adap,
|
||||
|
||||
spin_unlock_irqrestore(&i2c->lock, flags);
|
||||
|
||||
rk3x_i2c_start(i2c);
|
||||
|
||||
if (!polling) {
|
||||
rk3x_i2c_start(i2c);
|
||||
|
||||
timeout = wait_event_timeout(i2c->wait, !i2c->busy,
|
||||
msecs_to_jiffies(WAIT_TIMEOUT));
|
||||
} else {
|
||||
disable_irq(i2c->irq);
|
||||
rk3x_i2c_start(i2c);
|
||||
|
||||
timeout = rk3x_i2c_wait_xfer_poll(i2c);
|
||||
|
||||
enable_irq(i2c->irq);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&i2c->lock, flags);
|
||||
@ -1310,6 +1317,8 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
i2c->irq = irq;
|
||||
|
||||
platform_set_drvdata(pdev, i2c);
|
||||
|
||||
if (i2c->soc_data->calc_timings == rk3x_i2c_v0_calc_timings) {
|
||||
|
@ -393,17 +393,17 @@ static const unsigned int kx022a_odrs[] = {
|
||||
* (range / 2^bits) * g = (range / 2^bits) * 9.80665 m/s^2
|
||||
* => KX022A uses 16 bit (HiRes mode - assume the low 8 bits are zeroed
|
||||
* in low-power mode(?) )
|
||||
* => +/-2G => 4 / 2^16 * 9,80665 * 10^6 (to scale to micro)
|
||||
* => +/-2G - 598.550415
|
||||
* +/-4G - 1197.10083
|
||||
* +/-8G - 2394.20166
|
||||
* +/-16G - 4788.40332
|
||||
* => +/-2G => 4 / 2^16 * 9,80665
|
||||
* => +/-2G - 0.000598550415
|
||||
* +/-4G - 0.00119710083
|
||||
* +/-8G - 0.00239420166
|
||||
* +/-16G - 0.00478840332
|
||||
*/
|
||||
static const int kx022a_scale_table[][2] = {
|
||||
{ 598, 550415 },
|
||||
{ 1197, 100830 },
|
||||
{ 2394, 201660 },
|
||||
{ 4788, 403320 },
|
||||
{ 0, 598550 },
|
||||
{ 0, 1197101 },
|
||||
{ 0, 2394202 },
|
||||
{ 0, 4788403 },
|
||||
};
|
||||
|
||||
static int kx022a_read_avail(struct iio_dev *indio_dev,
|
||||
@ -422,7 +422,7 @@ static int kx022a_read_avail(struct iio_dev *indio_dev,
|
||||
*vals = (const int *)kx022a_scale_table;
|
||||
*length = ARRAY_SIZE(kx022a_scale_table) *
|
||||
ARRAY_SIZE(kx022a_scale_table[0]);
|
||||
*type = IIO_VAL_INT_PLUS_MICRO;
|
||||
*type = IIO_VAL_INT_PLUS_NANO;
|
||||
return IIO_AVAIL_LIST;
|
||||
default:
|
||||
return -EINVAL;
|
||||
@ -485,6 +485,20 @@ static int kx022a_turn_on_unlock(struct kx022a_data *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int kx022a_write_raw_get_fmt(struct iio_dev *idev,
|
||||
struct iio_chan_spec const *chan,
|
||||
long mask)
|
||||
{
|
||||
switch (mask) {
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
return IIO_VAL_INT_PLUS_NANO;
|
||||
case IIO_CHAN_INFO_SAMP_FREQ:
|
||||
return IIO_VAL_INT_PLUS_MICRO;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int kx022a_write_raw(struct iio_dev *idev,
|
||||
struct iio_chan_spec const *chan,
|
||||
int val, int val2, long mask)
|
||||
@ -629,7 +643,7 @@ static int kx022a_read_raw(struct iio_dev *idev,
|
||||
|
||||
kx022a_reg2scale(regval, val, val2);
|
||||
|
||||
return IIO_VAL_INT_PLUS_MICRO;
|
||||
return IIO_VAL_INT_PLUS_NANO;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
@ -856,6 +870,7 @@ static int kx022a_fifo_flush(struct iio_dev *idev, unsigned int samples)
|
||||
static const struct iio_info kx022a_info = {
|
||||
.read_raw = &kx022a_read_raw,
|
||||
.write_raw = &kx022a_write_raw,
|
||||
.write_raw_get_fmt = &kx022a_write_raw_get_fmt,
|
||||
.read_avail = &kx022a_read_avail,
|
||||
|
||||
.validate_trigger = iio_validate_own_trigger,
|
||||
|
@ -93,6 +93,10 @@ static const struct iio_chan_spec imx93_adc_iio_channels[] = {
|
||||
IMX93_ADC_CHAN(1),
|
||||
IMX93_ADC_CHAN(2),
|
||||
IMX93_ADC_CHAN(3),
|
||||
IMX93_ADC_CHAN(4),
|
||||
IMX93_ADC_CHAN(5),
|
||||
IMX93_ADC_CHAN(6),
|
||||
IMX93_ADC_CHAN(7),
|
||||
};
|
||||
|
||||
static void imx93_adc_power_down(struct imx93_adc *adc)
|
||||
|
@ -918,7 +918,7 @@ static int mcp3564_write_raw(struct iio_dev *indio_dev,
|
||||
mutex_unlock(&adc->lock);
|
||||
return ret;
|
||||
case IIO_CHAN_INFO_CALIBBIAS:
|
||||
if (val < mcp3564_calib_bias[0] && val > mcp3564_calib_bias[2])
|
||||
if (val < mcp3564_calib_bias[0] || val > mcp3564_calib_bias[2])
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&adc->lock);
|
||||
@ -928,7 +928,7 @@ static int mcp3564_write_raw(struct iio_dev *indio_dev,
|
||||
mutex_unlock(&adc->lock);
|
||||
return ret;
|
||||
case IIO_CHAN_INFO_CALIBSCALE:
|
||||
if (val < mcp3564_calib_scale[0] && val > mcp3564_calib_scale[2])
|
||||
if (val < mcp3564_calib_scale[0] || val > mcp3564_calib_scale[2])
|
||||
return -EINVAL;
|
||||
|
||||
if (adc->calib_scale == val)
|
||||
@ -1122,7 +1122,7 @@ static int mcp3564_config(struct iio_dev *indio_dev)
|
||||
enum mcp3564_ids ids;
|
||||
int ret = 0;
|
||||
unsigned int tmp = 0x01;
|
||||
bool err = true;
|
||||
bool err = false;
|
||||
|
||||
/*
|
||||
* The address is set on a per-device basis by fuses in the factory,
|
||||
@ -1509,5 +1509,5 @@ static struct spi_driver mcp3564_driver = {
|
||||
module_spi_driver(mcp3564_driver);
|
||||
|
||||
MODULE_AUTHOR("Marius Cristea <marius.cristea@microchip.com>");
|
||||
MODULE_DESCRIPTION("Microchip MCP346x/MCP346xR and MCP356x/MCP346xR ADCs");
|
||||
MODULE_DESCRIPTION("Microchip MCP346x/MCP346xR and MCP356x/MCP356xR ADCs");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
@ -1241,6 +1241,20 @@ static const struct meson_sar_adc_param meson_sar_adc_gxl_param = {
|
||||
.cmv_select = 1,
|
||||
};
|
||||
|
||||
static const struct meson_sar_adc_param meson_sar_adc_axg_param = {
|
||||
.has_bl30_integration = true,
|
||||
.clock_rate = 1200000,
|
||||
.bandgap_reg = MESON_SAR_ADC_REG11,
|
||||
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
|
||||
.resolution = 12,
|
||||
.disable_ring_counter = 1,
|
||||
.has_reg11 = true,
|
||||
.vref_volatge = 1,
|
||||
.has_vref_select = true,
|
||||
.vref_select = VREF_VDDA,
|
||||
.cmv_select = 1,
|
||||
};
|
||||
|
||||
static const struct meson_sar_adc_param meson_sar_adc_g12a_param = {
|
||||
.has_bl30_integration = false,
|
||||
.clock_rate = 1200000,
|
||||
@ -1285,7 +1299,7 @@ static const struct meson_sar_adc_data meson_sar_adc_gxm_data = {
|
||||
};
|
||||
|
||||
static const struct meson_sar_adc_data meson_sar_adc_axg_data = {
|
||||
.param = &meson_sar_adc_gxl_param,
|
||||
.param = &meson_sar_adc_axg_param,
|
||||
.name = "meson-axg-saradc",
|
||||
};
|
||||
|
||||
|
@ -670,8 +670,10 @@ static int tiadc_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, indio_dev);
|
||||
|
||||
err = tiadc_request_dma(pdev, adc_dev);
|
||||
if (err && err == -EPROBE_DEFER)
|
||||
if (err && err != -ENODEV) {
|
||||
dev_err_probe(&pdev->dev, err, "DMA request failed\n");
|
||||
goto err_dma;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -46,6 +46,16 @@ int iio_triggered_buffer_setup_ext(struct iio_dev *indio_dev,
|
||||
struct iio_buffer *buffer;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* iio_triggered_buffer_cleanup() assumes that the buffer allocated here
|
||||
* is assigned to indio_dev->buffer but this is only the case if this
|
||||
* function is the first caller to iio_device_attach_buffer(). If
|
||||
* indio_dev->buffer is already set then we can't proceed otherwise the
|
||||
* cleanup function will try to free a buffer that was not allocated here.
|
||||
*/
|
||||
if (indio_dev->buffer)
|
||||
return -EADDRINUSE;
|
||||
|
||||
buffer = iio_kfifo_allocate();
|
||||
if (!buffer) {
|
||||
ret = -ENOMEM;
|
||||
|
@ -15,8 +15,8 @@
|
||||
/* Conversion times in us */
|
||||
static const u16 ms_sensors_ht_t_conversion_time[] = { 50000, 25000,
|
||||
13000, 7000 };
|
||||
static const u16 ms_sensors_ht_h_conversion_time[] = { 16000, 3000,
|
||||
5000, 8000 };
|
||||
static const u16 ms_sensors_ht_h_conversion_time[] = { 16000, 5000,
|
||||
3000, 8000 };
|
||||
static const u16 ms_sensors_tp_conversion_time[] = { 500, 1100, 2100,
|
||||
4100, 8220, 16440 };
|
||||
|
||||
|
@ -70,8 +70,8 @@
|
||||
#define ADIS16475_MAX_SCAN_DATA 20
|
||||
/* spi max speed in brust mode */
|
||||
#define ADIS16475_BURST_MAX_SPEED 1000000
|
||||
#define ADIS16475_LSB_DEC_MASK BIT(0)
|
||||
#define ADIS16475_LSB_FIR_MASK BIT(1)
|
||||
#define ADIS16475_LSB_DEC_MASK 0
|
||||
#define ADIS16475_LSB_FIR_MASK 1
|
||||
#define ADIS16500_BURST_DATA_SEL_0_CHN_MASK GENMASK(5, 0)
|
||||
#define ADIS16500_BURST_DATA_SEL_1_CHN_MASK GENMASK(12, 7)
|
||||
|
||||
@ -1406,6 +1406,59 @@ static int adis16475_config_irq_pin(struct adis16475 *st)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int adis16475_probe(struct spi_device *spi)
|
||||
{
|
||||
struct iio_dev *indio_dev;
|
||||
struct adis16475 *st;
|
||||
int ret;
|
||||
|
||||
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
|
||||
if (!indio_dev)
|
||||
return -ENOMEM;
|
||||
|
||||
st = iio_priv(indio_dev);
|
||||
|
||||
st->info = spi_get_device_match_data(spi);
|
||||
if (!st->info)
|
||||
return -EINVAL;
|
||||
|
||||
ret = adis_init(&st->adis, indio_dev, spi, &st->info->adis_data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
indio_dev->name = st->info->name;
|
||||
indio_dev->channels = st->info->channels;
|
||||
indio_dev->num_channels = st->info->num_channels;
|
||||
indio_dev->info = &adis16475_info;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
|
||||
ret = __adis_initial_startup(&st->adis);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = adis16475_config_irq_pin(st);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = adis16475_config_sync_mode(st);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev,
|
||||
adis16475_trigger_handler);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_iio_device_register(&spi->dev, indio_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
adis16475_debugfs_init(indio_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id adis16475_of_match[] = {
|
||||
{ .compatible = "adi,adis16470",
|
||||
.data = &adis16475_chip_info[ADIS16470] },
|
||||
@ -1451,57 +1504,30 @@ static const struct of_device_id adis16475_of_match[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, adis16475_of_match);
|
||||
|
||||
static int adis16475_probe(struct spi_device *spi)
|
||||
{
|
||||
struct iio_dev *indio_dev;
|
||||
struct adis16475 *st;
|
||||
int ret;
|
||||
|
||||
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
|
||||
if (!indio_dev)
|
||||
return -ENOMEM;
|
||||
|
||||
st = iio_priv(indio_dev);
|
||||
|
||||
st->info = device_get_match_data(&spi->dev);
|
||||
if (!st->info)
|
||||
return -EINVAL;
|
||||
|
||||
ret = adis_init(&st->adis, indio_dev, spi, &st->info->adis_data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
indio_dev->name = st->info->name;
|
||||
indio_dev->channels = st->info->channels;
|
||||
indio_dev->num_channels = st->info->num_channels;
|
||||
indio_dev->info = &adis16475_info;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
|
||||
ret = __adis_initial_startup(&st->adis);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = adis16475_config_irq_pin(st);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = adis16475_config_sync_mode(st);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev,
|
||||
adis16475_trigger_handler);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_iio_device_register(&spi->dev, indio_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
adis16475_debugfs_init(indio_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static const struct spi_device_id adis16475_ids[] = {
|
||||
{ "adis16470", (kernel_ulong_t)&adis16475_chip_info[ADIS16470] },
|
||||
{ "adis16475-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16475_1] },
|
||||
{ "adis16475-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16475_2] },
|
||||
{ "adis16475-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16475_3] },
|
||||
{ "adis16477-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16477_1] },
|
||||
{ "adis16477-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16477_2] },
|
||||
{ "adis16477-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16477_3] },
|
||||
{ "adis16465-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16465_1] },
|
||||
{ "adis16465-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16465_2] },
|
||||
{ "adis16465-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16465_3] },
|
||||
{ "adis16467-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16467_1] },
|
||||
{ "adis16467-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16467_2] },
|
||||
{ "adis16467-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16467_3] },
|
||||
{ "adis16500", (kernel_ulong_t)&adis16475_chip_info[ADIS16500] },
|
||||
{ "adis16505-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16505_1] },
|
||||
{ "adis16505-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16505_2] },
|
||||
{ "adis16505-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16505_3] },
|
||||
{ "adis16507-1", (kernel_ulong_t)&adis16475_chip_info[ADIS16507_1] },
|
||||
{ "adis16507-2", (kernel_ulong_t)&adis16475_chip_info[ADIS16507_2] },
|
||||
{ "adis16507-3", (kernel_ulong_t)&adis16475_chip_info[ADIS16507_3] },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, adis16475_ids);
|
||||
|
||||
static struct spi_driver adis16475_driver = {
|
||||
.driver = {
|
||||
@ -1509,6 +1535,7 @@ static struct spi_driver adis16475_driver = {
|
||||
.of_match_table = adis16475_of_match,
|
||||
},
|
||||
.probe = adis16475_probe,
|
||||
.id_table = adis16475_ids,
|
||||
};
|
||||
module_spi_driver(adis16475_driver);
|
||||
|
||||
|
@ -750,13 +750,13 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev,
|
||||
ret = inv_mpu6050_sensor_show(st, st->reg->gyro_offset,
|
||||
chan->channel2, val);
|
||||
mutex_unlock(&st->lock);
|
||||
return IIO_VAL_INT;
|
||||
return ret;
|
||||
case IIO_ACCEL:
|
||||
mutex_lock(&st->lock);
|
||||
ret = inv_mpu6050_sensor_show(st, st->reg->accl_offset,
|
||||
chan->channel2, val);
|
||||
mutex_unlock(&st->lock);
|
||||
return IIO_VAL_INT;
|
||||
return ret;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
@ -14,11 +14,8 @@
|
||||
#include "../common/hid-sensors/hid-sensor-trigger.h"
|
||||
|
||||
enum {
|
||||
CHANNEL_SCAN_INDEX_INTENSITY,
|
||||
CHANNEL_SCAN_INDEX_ILLUM,
|
||||
CHANNEL_SCAN_INDEX_COLOR_TEMP,
|
||||
CHANNEL_SCAN_INDEX_CHROMATICITY_X,
|
||||
CHANNEL_SCAN_INDEX_CHROMATICITY_Y,
|
||||
CHANNEL_SCAN_INDEX_INTENSITY = 0,
|
||||
CHANNEL_SCAN_INDEX_ILLUM = 1,
|
||||
CHANNEL_SCAN_INDEX_MAX
|
||||
};
|
||||
|
||||
@ -68,40 +65,6 @@ static const struct iio_chan_spec als_channels[] = {
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
|
||||
.scan_index = CHANNEL_SCAN_INDEX_ILLUM,
|
||||
},
|
||||
{
|
||||
.type = IIO_COLORTEMP,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
|
||||
BIT(IIO_CHAN_INFO_SCALE) |
|
||||
BIT(IIO_CHAN_INFO_SAMP_FREQ) |
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS) |
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
|
||||
.scan_index = CHANNEL_SCAN_INDEX_COLOR_TEMP,
|
||||
},
|
||||
{
|
||||
.type = IIO_CHROMATICITY,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
|
||||
BIT(IIO_CHAN_INFO_SCALE) |
|
||||
BIT(IIO_CHAN_INFO_SAMP_FREQ) |
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS) |
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
|
||||
.scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X,
|
||||
},
|
||||
{
|
||||
.type = IIO_CHROMATICITY,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
|
||||
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
|
||||
BIT(IIO_CHAN_INFO_SCALE) |
|
||||
BIT(IIO_CHAN_INFO_SAMP_FREQ) |
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS) |
|
||||
BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
|
||||
.scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_Y,
|
||||
},
|
||||
IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP)
|
||||
};
|
||||
|
||||
@ -140,21 +103,6 @@ static int als_read_raw(struct iio_dev *indio_dev,
|
||||
min = als_state->als[chan->scan_index].logical_minimum;
|
||||
address = HID_USAGE_SENSOR_LIGHT_ILLUM;
|
||||
break;
|
||||
case CHANNEL_SCAN_INDEX_COLOR_TEMP:
|
||||
report_id = als_state->als[chan->scan_index].report_id;
|
||||
min = als_state->als[chan->scan_index].logical_minimum;
|
||||
address = HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE;
|
||||
break;
|
||||
case CHANNEL_SCAN_INDEX_CHROMATICITY_X:
|
||||
report_id = als_state->als[chan->scan_index].report_id;
|
||||
min = als_state->als[chan->scan_index].logical_minimum;
|
||||
address = HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X;
|
||||
break;
|
||||
case CHANNEL_SCAN_INDEX_CHROMATICITY_Y:
|
||||
report_id = als_state->als[chan->scan_index].report_id;
|
||||
min = als_state->als[chan->scan_index].logical_minimum;
|
||||
address = HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y;
|
||||
break;
|
||||
default:
|
||||
report_id = -1;
|
||||
break;
|
||||
@ -275,18 +223,6 @@ static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
|
||||
als_state->scan.illum[CHANNEL_SCAN_INDEX_ILLUM] = sample_data;
|
||||
ret = 0;
|
||||
break;
|
||||
case HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE:
|
||||
als_state->scan.illum[CHANNEL_SCAN_INDEX_COLOR_TEMP] = sample_data;
|
||||
ret = 0;
|
||||
break;
|
||||
case HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X:
|
||||
als_state->scan.illum[CHANNEL_SCAN_INDEX_CHROMATICITY_X] = sample_data;
|
||||
ret = 0;
|
||||
break;
|
||||
case HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y:
|
||||
als_state->scan.illum[CHANNEL_SCAN_INDEX_CHROMATICITY_Y] = sample_data;
|
||||
ret = 0;
|
||||
break;
|
||||
case HID_USAGE_SENSOR_TIME_TIMESTAMP:
|
||||
als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes,
|
||||
*(s64 *)raw_data);
|
||||
@ -322,38 +258,6 @@ static int als_parse_report(struct platform_device *pdev,
|
||||
st->als[i].report_id);
|
||||
}
|
||||
|
||||
ret = sensor_hub_input_get_attribute_info(hsdev, HID_INPUT_REPORT,
|
||||
usage_id,
|
||||
HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE,
|
||||
&st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
als_adjust_channel_bit_mask(channels, CHANNEL_SCAN_INDEX_COLOR_TEMP,
|
||||
st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].size);
|
||||
|
||||
dev_dbg(&pdev->dev, "als %x:%x\n",
|
||||
st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].index,
|
||||
st->als[CHANNEL_SCAN_INDEX_COLOR_TEMP].report_id);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
int next_scan_index = CHANNEL_SCAN_INDEX_CHROMATICITY_X + i;
|
||||
|
||||
ret = sensor_hub_input_get_attribute_info(hsdev,
|
||||
HID_INPUT_REPORT, usage_id,
|
||||
HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X + i,
|
||||
&st->als[next_scan_index]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
als_adjust_channel_bit_mask(channels,
|
||||
CHANNEL_SCAN_INDEX_CHROMATICITY_X + i,
|
||||
st->als[next_scan_index].size);
|
||||
|
||||
dev_dbg(&pdev->dev, "als %x:%x\n",
|
||||
st->als[next_scan_index].index,
|
||||
st->als[next_scan_index].report_id);
|
||||
}
|
||||
|
||||
st->scale_precision = hid_sensor_format_scale(usage_id,
|
||||
&st->als[CHANNEL_SCAN_INDEX_INTENSITY],
|
||||
&st->scale_pre_decml, &st->scale_post_decml);
|
||||
|
@ -356,7 +356,7 @@ static int tmag5273_read_raw(struct iio_dev *indio_dev,
|
||||
case IIO_CHAN_INFO_OFFSET:
|
||||
switch (chan->type) {
|
||||
case IIO_TEMP:
|
||||
*val = -266314;
|
||||
*val = -16005;
|
||||
return IIO_VAL_INT;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
@ -286,6 +286,7 @@ static const struct xpad_device {
|
||||
{ 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
|
||||
{ 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE },
|
||||
{ 0x1532, 0x0a29, "Razer Wolverine V2", 0, XTYPE_XBOXONE },
|
||||
{ 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
|
||||
{ 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
|
||||
|
@ -765,6 +765,44 @@ static void atkbd_deactivate(struct atkbd *atkbd)
|
||||
ps2dev->serio->phys);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
static bool atkbd_is_portable_device(void)
|
||||
{
|
||||
static const char * const chassis_types[] = {
|
||||
"8", /* Portable */
|
||||
"9", /* Laptop */
|
||||
"10", /* Notebook */
|
||||
"14", /* Sub-Notebook */
|
||||
"31", /* Convertible */
|
||||
"32", /* Detachable */
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(chassis_types); i++)
|
||||
if (dmi_match(DMI_CHASSIS_TYPE, chassis_types[i]))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* On many modern laptops ATKBD_CMD_GETID may cause problems, on these laptops
|
||||
* the controller is always in translated mode. In this mode mice/touchpads will
|
||||
* not work. So in this case simply assume a keyboard is connected to avoid
|
||||
* confusing some laptop keyboards.
|
||||
*
|
||||
* Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is
|
||||
* ok in translated mode, only atkbd_select_set() checks atkbd->id and in
|
||||
* translated mode that is a no-op.
|
||||
*/
|
||||
static bool atkbd_skip_getid(struct atkbd *atkbd)
|
||||
{
|
||||
return atkbd->translated && atkbd_is_portable_device();
|
||||
}
|
||||
#else
|
||||
static inline bool atkbd_skip_getid(struct atkbd *atkbd) { return false; }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* atkbd_probe() probes for an AT keyboard on a serio port.
|
||||
*/
|
||||
@ -794,12 +832,12 @@ static int atkbd_probe(struct atkbd *atkbd)
|
||||
*/
|
||||
|
||||
param[0] = param[1] = 0xa5; /* initialize with invalid values */
|
||||
if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
|
||||
if (atkbd_skip_getid(atkbd) || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
|
||||
|
||||
/*
|
||||
* If the get ID command failed, we check if we can at least set the LEDs on
|
||||
* the keyboard. This should work on every keyboard out there. It also turns
|
||||
* the LEDs off, which we want anyway.
|
||||
* If the get ID command was skipped or failed, we check if we can at least set
|
||||
* the LEDs on the keyboard. This should work on every keyboard out there.
|
||||
* It also turns the LEDs off, which we want anyway.
|
||||
*/
|
||||
param[0] = 0;
|
||||
if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
|
||||
|
@ -105,6 +105,9 @@ static int micro_key_probe(struct platform_device *pdev)
|
||||
keys->codes = devm_kmemdup(&pdev->dev, micro_keycodes,
|
||||
keys->input->keycodesize * keys->input->keycodemax,
|
||||
GFP_KERNEL);
|
||||
if (!keys->codes)
|
||||
return -ENOMEM;
|
||||
|
||||
keys->input->keycode = keys->codes;
|
||||
|
||||
__set_bit(EV_KEY, keys->input->evbit);
|
||||
|
@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev,
|
||||
info->name = "power";
|
||||
info->event_code = KEY_POWER;
|
||||
info->wakeup = true;
|
||||
} else if (upage == 0x01 && usage == 0xc6) {
|
||||
info->name = "airplane mode switch";
|
||||
info->event_type = EV_SW;
|
||||
info->event_code = SW_RFKILL_ALL;
|
||||
info->active_low = false;
|
||||
} else if (upage == 0x01 && usage == 0xca) {
|
||||
info->name = "rotation lock switch";
|
||||
info->event_type = EV_SW;
|
||||
|
@ -125,16 +125,15 @@ static int __init amimouse_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __exit amimouse_remove(struct platform_device *pdev)
|
||||
static void __exit amimouse_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct input_dev *dev = platform_get_drvdata(pdev);
|
||||
|
||||
input_unregister_device(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver amimouse_driver = {
|
||||
.remove = __exit_p(amimouse_remove),
|
||||
.remove_new = __exit_p(amimouse_remove),
|
||||
.driver = {
|
||||
.name = "amiga-mouse",
|
||||
},
|
||||
|
@ -183,6 +183,7 @@ static const char * const smbus_pnp_ids[] = {
|
||||
"LEN009b", /* T580 */
|
||||
"LEN0402", /* X1 Extreme Gen 2 / P1 Gen 2 */
|
||||
"LEN040f", /* P1 Gen 3 */
|
||||
"LEN0411", /* L14 Gen 1 */
|
||||
"LEN200f", /* T450s */
|
||||
"LEN2044", /* L470 */
|
||||
"LEN2054", /* E480 */
|
||||
|
@ -360,6 +360,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_DRITEK)
|
||||
},
|
||||
{
|
||||
/* Acer TravelMate P459-G2-M */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX)
|
||||
},
|
||||
{
|
||||
/* Amoi M636/A737 */
|
||||
.matches = {
|
||||
|
@ -395,6 +395,9 @@ struct icc_node_data *of_icc_get_from_provider(struct of_phandle_args *spec)
|
||||
}
|
||||
mutex_unlock(&icc_lock);
|
||||
|
||||
if (!node)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (IS_ERR(node))
|
||||
return ERR_CAST(node);
|
||||
|
||||
|
@ -307,7 +307,7 @@ static u64 qcom_icc_calc_rate(struct qcom_icc_provider *qp, struct qcom_icc_node
|
||||
|
||||
if (qn->ib_coeff) {
|
||||
agg_peak_rate = qn->max_peak[ctx] * 100;
|
||||
agg_peak_rate = div_u64(qn->max_peak[ctx], qn->ib_coeff);
|
||||
agg_peak_rate = div_u64(agg_peak_rate, qn->ib_coeff);
|
||||
} else {
|
||||
agg_peak_rate = qn->max_peak[ctx];
|
||||
}
|
||||
|
@ -1995,6 +1995,7 @@ static struct platform_driver qnoc_driver = {
|
||||
.driver = {
|
||||
.name = "qnoc-sm8250",
|
||||
.of_match_table = qnoc_of_match,
|
||||
.sync_state = icc_sync_state,
|
||||
},
|
||||
};
|
||||
module_platform_driver(qnoc_driver);
|
||||
|
@ -13024,6 +13024,8 @@ static void bnxt_sp_task(struct work_struct *work)
|
||||
bnxt_cfg_ntp_filters(bp);
|
||||
if (test_and_clear_bit(BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT, &bp->sp_event))
|
||||
bnxt_hwrm_exec_fwd_req(bp);
|
||||
if (test_and_clear_bit(BNXT_HWRM_PF_UNLOAD_SP_EVENT, &bp->sp_event))
|
||||
netdev_info(bp->dev, "Receive PF driver unload event!\n");
|
||||
if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event)) {
|
||||
bnxt_hwrm_port_qstats(bp, 0);
|
||||
bnxt_hwrm_port_qstats_ext(bp, 0);
|
||||
@ -14095,8 +14097,6 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
|
||||
bnxt_del_ntp_filter(bp, fltr);
|
||||
}
|
||||
}
|
||||
if (test_and_clear_bit(BNXT_HWRM_PF_UNLOAD_SP_EVENT, &bp->sp_event))
|
||||
netdev_info(bp->dev, "Receive PF driver unload event!\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2132,8 +2132,10 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
/* Note: if we ever change from DMA_TX_APPEND_CRC below we
|
||||
* will need to restore software padding of "runt" packets
|
||||
*/
|
||||
len_stat |= DMA_TX_APPEND_CRC;
|
||||
|
||||
if (!i) {
|
||||
len_stat |= DMA_TX_APPEND_CRC | DMA_SOP;
|
||||
len_stat |= DMA_SOP;
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
len_stat |= DMA_TX_DO_CSUM;
|
||||
}
|
||||
|
@ -107,12 +107,18 @@ static struct workqueue_struct *i40e_wq;
|
||||
static void netdev_hw_addr_refcnt(struct i40e_mac_filter *f,
|
||||
struct net_device *netdev, int delta)
|
||||
{
|
||||
struct netdev_hw_addr_list *ha_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
if (!f || !netdev)
|
||||
return;
|
||||
|
||||
netdev_for_each_mc_addr(ha, netdev) {
|
||||
if (is_unicast_ether_addr(f->macaddr) || is_link_local_ether_addr(f->macaddr))
|
||||
ha_list = &netdev->uc;
|
||||
else
|
||||
ha_list = &netdev->mc;
|
||||
|
||||
netdev_hw_addr_list_for_each(ha, ha_list) {
|
||||
if (ether_addr_equal(ha->addr, f->macaddr)) {
|
||||
ha->refcount += delta;
|
||||
if (ha->refcount <= 0)
|
||||
@ -16449,6 +16455,9 @@ static void i40e_pci_error_reset_done(struct pci_dev *pdev)
|
||||
return;
|
||||
|
||||
i40e_reset_and_rebuild(pf, false, false);
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
i40e_restore_all_vfs_msi_state(pdev);
|
||||
#endif /* CONFIG_PCI_IOV */
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,6 +154,32 @@ void i40e_vc_notify_reset(struct i40e_pf *pf)
|
||||
(u8 *)&pfe, sizeof(struct virtchnl_pf_event));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
void i40e_restore_all_vfs_msi_state(struct pci_dev *pdev)
|
||||
{
|
||||
u16 vf_id;
|
||||
u16 pos;
|
||||
|
||||
/* Continue only if this is a PF */
|
||||
if (!pdev->is_physfn)
|
||||
return;
|
||||
|
||||
if (!pci_num_vf(pdev))
|
||||
return;
|
||||
|
||||
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
|
||||
if (pos) {
|
||||
struct pci_dev *vf_dev = NULL;
|
||||
|
||||
pci_read_config_word(pdev, pos + PCI_SRIOV_VF_DID, &vf_id);
|
||||
while ((vf_dev = pci_get_device(pdev->vendor, vf_id, vf_dev))) {
|
||||
if (vf_dev->is_virtfn && vf_dev->physfn == pdev)
|
||||
pci_restore_msi_state(vf_dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_PCI_IOV */
|
||||
|
||||
/**
|
||||
* i40e_vc_notify_vf_reset
|
||||
* @vf: pointer to the VF structure
|
||||
@ -3527,16 +3553,16 @@ static int i40e_validate_cloud_filter(struct i40e_vf *vf,
|
||||
bool found = false;
|
||||
int bkt;
|
||||
|
||||
if (!tc_filter->action) {
|
||||
if (tc_filter->action != VIRTCHNL_ACTION_TC_REDIRECT) {
|
||||
dev_info(&pf->pdev->dev,
|
||||
"VF %d: Currently ADq doesn't support Drop Action\n",
|
||||
vf->vf_id);
|
||||
"VF %d: ADQ doesn't support this action (%d)\n",
|
||||
vf->vf_id, tc_filter->action);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* action_meta is TC number here to which the filter is applied */
|
||||
if (!tc_filter->action_meta ||
|
||||
tc_filter->action_meta > I40E_MAX_VF_VSI) {
|
||||
tc_filter->action_meta > vf->num_tc) {
|
||||
dev_info(&pf->pdev->dev, "VF %d: Invalid TC number %u\n",
|
||||
vf->vf_id, tc_filter->action_meta);
|
||||
goto err;
|
||||
|
@ -138,6 +138,9 @@ int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable);
|
||||
|
||||
void i40e_vc_notify_link_state(struct i40e_pf *pf);
|
||||
void i40e_vc_notify_reset(struct i40e_pf *pf);
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
void i40e_restore_all_vfs_msi_state(struct pci_dev *pdev);
|
||||
#endif /* CONFIG_PCI_IOV */
|
||||
int i40e_get_vf_stats(struct net_device *netdev, int vf_id,
|
||||
struct ifla_vf_stats *vf_stats);
|
||||
|
||||
|
@ -1360,8 +1360,9 @@ struct ice_aqc_get_link_status_data {
|
||||
u8 lp_flowcontrol;
|
||||
#define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0)
|
||||
#define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1)
|
||||
u8 reserved5[5];
|
||||
#define ICE_AQC_LS_DATA_SIZE_V2 \
|
||||
offsetofend(struct ice_aqc_get_link_status_data, lp_flowcontrol)
|
||||
offsetofend(struct ice_aqc_get_link_status_data, reserved5)
|
||||
} __packed;
|
||||
|
||||
/* Set event mask command (direct 0x0613) */
|
||||
|
@ -5141,7 +5141,6 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state,
|
||||
u8 *eec_mode)
|
||||
{
|
||||
struct ice_aqc_get_cgu_dpll_status *cmd;
|
||||
const s64 nsec_per_psec = 1000LL;
|
||||
struct ice_aq_desc desc;
|
||||
int status;
|
||||
|
||||
@ -5157,8 +5156,7 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state,
|
||||
*phase_offset = le32_to_cpu(cmd->phase_offset_h);
|
||||
*phase_offset <<= 32;
|
||||
*phase_offset += le32_to_cpu(cmd->phase_offset_l);
|
||||
*phase_offset = div64_s64(sign_extend64(*phase_offset, 47),
|
||||
nsec_per_psec);
|
||||
*phase_offset = sign_extend64(*phase_offset, 47);
|
||||
*eec_mode = cmd->eec_mode;
|
||||
}
|
||||
|
||||
|
@ -2161,7 +2161,7 @@ static int ice_configure_phy(struct ice_vsi *vsi)
|
||||
|
||||
/* Ensure we have media as we cannot configure a medialess port */
|
||||
if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE))
|
||||
return -EPERM;
|
||||
return -ENOMEDIUM;
|
||||
|
||||
ice_print_topo_conflict(vsi);
|
||||
|
||||
@ -9398,8 +9398,14 @@ int ice_stop(struct net_device *netdev)
|
||||
int link_err = ice_force_phys_link_state(vsi, false);
|
||||
|
||||
if (link_err) {
|
||||
netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n",
|
||||
vsi->vsi_num, link_err);
|
||||
if (link_err == -ENOMEDIUM)
|
||||
netdev_info(vsi->netdev, "Skipping link reconfig - no media attached, VSI %d\n",
|
||||
vsi->vsi_num);
|
||||
else
|
||||
netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n",
|
||||
vsi->vsi_num, link_err);
|
||||
|
||||
ice_vsi_close(vsi);
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
@ -1043,7 +1043,6 @@ static int idpf_rx_singleq_clean(struct idpf_queue *rx_q, int budget)
|
||||
}
|
||||
|
||||
idpf_rx_sync_for_cpu(rx_buf, fields.size);
|
||||
skb = rx_q->skb;
|
||||
if (skb)
|
||||
idpf_rx_add_frag(rx_buf, skb, fields.size);
|
||||
else
|
||||
|
@ -396,7 +396,7 @@ static void idpf_rx_desc_rel(struct idpf_queue *rxq, bool bufq, s32 q_model)
|
||||
if (!rxq)
|
||||
return;
|
||||
|
||||
if (!bufq && idpf_is_queue_model_split(q_model) && rxq->skb) {
|
||||
if (rxq->skb) {
|
||||
dev_kfree_skb_any(rxq->skb);
|
||||
rxq->skb = NULL;
|
||||
}
|
||||
|
@ -1104,9 +1104,9 @@ struct virtchnl2_rss_key {
|
||||
__le32 vport_id;
|
||||
__le16 key_len;
|
||||
u8 pad;
|
||||
__DECLARE_FLEX_ARRAY(u8, key_flex);
|
||||
};
|
||||
VIRTCHNL2_CHECK_STRUCT_LEN(8, virtchnl2_rss_key);
|
||||
u8 key_flex[];
|
||||
} __packed;
|
||||
VIRTCHNL2_CHECK_STRUCT_LEN(7, virtchnl2_rss_key);
|
||||
|
||||
/**
|
||||
* struct virtchnl2_queue_chunk - chunk of contiguous queues
|
||||
|
@ -587,6 +587,7 @@ struct igc_nfc_filter {
|
||||
u16 etype;
|
||||
__be16 vlan_etype;
|
||||
u16 vlan_tci;
|
||||
u16 vlan_tci_mask;
|
||||
u8 src_addr[ETH_ALEN];
|
||||
u8 dst_addr[ETH_ALEN];
|
||||
u8 user_data[8];
|
||||
|
@ -956,6 +956,7 @@ static int igc_ethtool_set_coalesce(struct net_device *netdev,
|
||||
}
|
||||
|
||||
#define ETHER_TYPE_FULL_MASK ((__force __be16)~0)
|
||||
#define VLAN_TCI_FULL_MASK ((__force __be16)~0)
|
||||
static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter,
|
||||
struct ethtool_rxnfc *cmd)
|
||||
{
|
||||
@ -978,10 +979,16 @@ static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter,
|
||||
fsp->m_u.ether_spec.h_proto = ETHER_TYPE_FULL_MASK;
|
||||
}
|
||||
|
||||
if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) {
|
||||
fsp->flow_type |= FLOW_EXT;
|
||||
fsp->h_ext.vlan_etype = rule->filter.vlan_etype;
|
||||
fsp->m_ext.vlan_etype = ETHER_TYPE_FULL_MASK;
|
||||
}
|
||||
|
||||
if (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {
|
||||
fsp->flow_type |= FLOW_EXT;
|
||||
fsp->h_ext.vlan_tci = htons(rule->filter.vlan_tci);
|
||||
fsp->m_ext.vlan_tci = htons(VLAN_PRIO_MASK);
|
||||
fsp->m_ext.vlan_tci = htons(rule->filter.vlan_tci_mask);
|
||||
}
|
||||
|
||||
if (rule->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR) {
|
||||
@ -1216,6 +1223,7 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule,
|
||||
|
||||
if ((fsp->flow_type & FLOW_EXT) && fsp->m_ext.vlan_tci) {
|
||||
rule->filter.vlan_tci = ntohs(fsp->h_ext.vlan_tci);
|
||||
rule->filter.vlan_tci_mask = ntohs(fsp->m_ext.vlan_tci);
|
||||
rule->filter.match_flags |= IGC_FILTER_FLAG_VLAN_TCI;
|
||||
}
|
||||
|
||||
@ -1253,11 +1261,19 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule,
|
||||
memcpy(rule->filter.user_mask, fsp->m_ext.data, sizeof(fsp->m_ext.data));
|
||||
}
|
||||
|
||||
/* When multiple filter options or user data or vlan etype is set, use a
|
||||
* flex filter.
|
||||
/* The i225/i226 has various different filters. Flex filters provide a
|
||||
* way to match up to the first 128 bytes of a packet. Use them for:
|
||||
* a) For specific user data
|
||||
* b) For VLAN EtherType
|
||||
* c) For full TCI match
|
||||
* d) Or in case multiple filter criteria are set
|
||||
*
|
||||
* Otherwise, use the simple MAC, VLAN PRIO or EtherType filters.
|
||||
*/
|
||||
if ((rule->filter.match_flags & IGC_FILTER_FLAG_USER_DATA) ||
|
||||
(rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_ETYPE) ||
|
||||
((rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) &&
|
||||
rule->filter.vlan_tci_mask == ntohs(VLAN_TCI_FULL_MASK)) ||
|
||||
(rule->filter.match_flags & (rule->filter.match_flags - 1)))
|
||||
rule->flex = true;
|
||||
else
|
||||
@ -1327,6 +1343,26 @@ static int igc_ethtool_add_nfc_rule(struct igc_adapter *adapter,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* There are two ways to match the VLAN TCI:
|
||||
* 1. Match on PCP field and use vlan prio filter for it
|
||||
* 2. Match on complete TCI field and use flex filter for it
|
||||
*/
|
||||
if ((fsp->flow_type & FLOW_EXT) &&
|
||||
fsp->m_ext.vlan_tci &&
|
||||
fsp->m_ext.vlan_tci != htons(VLAN_PRIO_MASK) &&
|
||||
fsp->m_ext.vlan_tci != VLAN_TCI_FULL_MASK) {
|
||||
netdev_dbg(netdev, "VLAN mask not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* VLAN EtherType can only be matched by full mask. */
|
||||
if ((fsp->flow_type & FLOW_EXT) &&
|
||||
fsp->m_ext.vlan_etype &&
|
||||
fsp->m_ext.vlan_etype != ETHER_TYPE_FULL_MASK) {
|
||||
netdev_dbg(netdev, "VLAN EtherType mask not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if (fsp->location >= IGC_MAX_RXNFC_RULES) {
|
||||
netdev_dbg(netdev, "Invalid location\n");
|
||||
return -EINVAL;
|
||||
|
@ -227,7 +227,7 @@ static int igc_tsn_enable_offload(struct igc_adapter *adapter)
|
||||
wr32(IGC_TQAVCC(i), tqavcc);
|
||||
|
||||
wr32(IGC_TQAVHC(i),
|
||||
0x80000000 + ring->hicredit * 0x7735);
|
||||
0x80000000 + ring->hicredit * 0x7736);
|
||||
} else {
|
||||
/* Disable any CBS for the queue */
|
||||
txqctl &= ~(IGC_TXQCTL_QAV_SEL_MASK);
|
||||
|
@ -530,7 +530,7 @@ struct npc_lt_def {
|
||||
u8 ltype_mask;
|
||||
u8 ltype_match;
|
||||
u8 lid;
|
||||
};
|
||||
} __packed;
|
||||
|
||||
struct npc_lt_def_ipsec {
|
||||
u8 ltype_mask;
|
||||
@ -538,7 +538,7 @@ struct npc_lt_def_ipsec {
|
||||
u8 lid;
|
||||
u8 spi_offset;
|
||||
u8 spi_nz;
|
||||
};
|
||||
} __packed;
|
||||
|
||||
struct npc_lt_def_apad {
|
||||
u8 ltype_mask;
|
||||
|
@ -934,6 +934,7 @@ u32 rvu_cgx_get_fifolen(struct rvu *rvu);
|
||||
void *rvu_first_cgx_pdata(struct rvu *rvu);
|
||||
int cgxlmac_to_pf(struct rvu *rvu, int cgx_id, int lmac_id);
|
||||
int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable);
|
||||
int rvu_cgx_tx_enable(struct rvu *rvu, u16 pcifunc, bool enable);
|
||||
int rvu_cgx_prio_flow_ctrl_cfg(struct rvu *rvu, u16 pcifunc, u8 tx_pause, u8 rx_pause,
|
||||
u16 pfc_en);
|
||||
int rvu_cgx_cfg_pause_frm(struct rvu *rvu, u16 pcifunc, u8 tx_pause, u8 rx_pause);
|
||||
|
@ -465,6 +465,23 @@ int rvu_cgx_config_rxtx(struct rvu *rvu, u16 pcifunc, bool start)
|
||||
return mac_ops->mac_rx_tx_enable(cgxd, lmac_id, start);
|
||||
}
|
||||
|
||||
int rvu_cgx_tx_enable(struct rvu *rvu, u16 pcifunc, bool enable)
|
||||
{
|
||||
int pf = rvu_get_pf(pcifunc);
|
||||
struct mac_ops *mac_ops;
|
||||
u8 cgx_id, lmac_id;
|
||||
void *cgxd;
|
||||
|
||||
if (!is_cgx_config_permitted(rvu, pcifunc))
|
||||
return LMAC_AF_ERR_PERM_DENIED;
|
||||
|
||||
rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
|
||||
cgxd = rvu_cgx_pdata(cgx_id, rvu);
|
||||
mac_ops = get_mac_ops(cgxd);
|
||||
|
||||
return mac_ops->mac_tx_enable(cgxd, lmac_id, enable);
|
||||
}
|
||||
|
||||
int rvu_cgx_config_tx(void *cgxd, int lmac_id, bool enable)
|
||||
{
|
||||
struct mac_ops *mac_ops;
|
||||
|
@ -4399,90 +4399,18 @@ static void nix_find_link_frs(struct rvu *rvu,
|
||||
req->minlen = minlen;
|
||||
}
|
||||
|
||||
static int
|
||||
nix_config_link_credits(struct rvu *rvu, int blkaddr, int link,
|
||||
u16 pcifunc, u64 tx_credits)
|
||||
{
|
||||
struct rvu_hwinfo *hw = rvu->hw;
|
||||
int pf = rvu_get_pf(pcifunc);
|
||||
u8 cgx_id = 0, lmac_id = 0;
|
||||
unsigned long poll_tmo;
|
||||
bool restore_tx_en = 0;
|
||||
struct nix_hw *nix_hw;
|
||||
u64 cfg, sw_xoff = 0;
|
||||
u32 schq = 0;
|
||||
u32 credits;
|
||||
int rc;
|
||||
|
||||
nix_hw = get_nix_hw(rvu->hw, blkaddr);
|
||||
if (!nix_hw)
|
||||
return NIX_AF_ERR_INVALID_NIXBLK;
|
||||
|
||||
if (tx_credits == nix_hw->tx_credits[link])
|
||||
return 0;
|
||||
|
||||
/* Enable cgx tx if disabled for credits to be back */
|
||||
if (is_pf_cgxmapped(rvu, pf)) {
|
||||
rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
|
||||
restore_tx_en = !rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu),
|
||||
lmac_id, true);
|
||||
}
|
||||
|
||||
mutex_lock(&rvu->rsrc_lock);
|
||||
/* Disable new traffic to link */
|
||||
if (hw->cap.nix_shaping) {
|
||||
schq = nix_get_tx_link(rvu, pcifunc);
|
||||
sw_xoff = rvu_read64(rvu, blkaddr, NIX_AF_TL1X_SW_XOFF(schq));
|
||||
rvu_write64(rvu, blkaddr,
|
||||
NIX_AF_TL1X_SW_XOFF(schq), BIT_ULL(0));
|
||||
}
|
||||
|
||||
rc = NIX_AF_ERR_LINK_CREDITS;
|
||||
poll_tmo = jiffies + usecs_to_jiffies(200000);
|
||||
/* Wait for credits to return */
|
||||
do {
|
||||
if (time_after(jiffies, poll_tmo))
|
||||
goto exit;
|
||||
usleep_range(100, 200);
|
||||
|
||||
cfg = rvu_read64(rvu, blkaddr,
|
||||
NIX_AF_TX_LINKX_NORM_CREDIT(link));
|
||||
credits = (cfg >> 12) & 0xFFFFFULL;
|
||||
} while (credits != nix_hw->tx_credits[link]);
|
||||
|
||||
cfg &= ~(0xFFFFFULL << 12);
|
||||
cfg |= (tx_credits << 12);
|
||||
rvu_write64(rvu, blkaddr, NIX_AF_TX_LINKX_NORM_CREDIT(link), cfg);
|
||||
rc = 0;
|
||||
|
||||
nix_hw->tx_credits[link] = tx_credits;
|
||||
|
||||
exit:
|
||||
/* Enable traffic back */
|
||||
if (hw->cap.nix_shaping && !sw_xoff)
|
||||
rvu_write64(rvu, blkaddr, NIX_AF_TL1X_SW_XOFF(schq), 0);
|
||||
|
||||
/* Restore state of cgx tx */
|
||||
if (restore_tx_en)
|
||||
rvu_cgx_config_tx(rvu_cgx_pdata(cgx_id, rvu), lmac_id, false);
|
||||
|
||||
mutex_unlock(&rvu->rsrc_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int rvu_mbox_handler_nix_set_hw_frs(struct rvu *rvu, struct nix_frs_cfg *req,
|
||||
struct msg_rsp *rsp)
|
||||
{
|
||||
struct rvu_hwinfo *hw = rvu->hw;
|
||||
u16 pcifunc = req->hdr.pcifunc;
|
||||
int pf = rvu_get_pf(pcifunc);
|
||||
int blkaddr, schq, link = -1;
|
||||
struct nix_txsch *txsch;
|
||||
u64 cfg, lmac_fifo_len;
|
||||
int blkaddr, link = -1;
|
||||
struct nix_hw *nix_hw;
|
||||
struct rvu_pfvf *pfvf;
|
||||
u8 cgx = 0, lmac = 0;
|
||||
u16 max_mtu;
|
||||
u64 cfg;
|
||||
|
||||
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, pcifunc);
|
||||
if (blkaddr < 0)
|
||||
@ -4503,25 +4431,6 @@ int rvu_mbox_handler_nix_set_hw_frs(struct rvu *rvu, struct nix_frs_cfg *req,
|
||||
if (req->update_minlen && req->minlen < NIC_HW_MIN_FRS)
|
||||
return NIX_AF_ERR_FRS_INVALID;
|
||||
|
||||
/* Check if requester wants to update SMQ's */
|
||||
if (!req->update_smq)
|
||||
goto rx_frscfg;
|
||||
|
||||
/* Update min/maxlen in each of the SMQ attached to this PF/VF */
|
||||
txsch = &nix_hw->txsch[NIX_TXSCH_LVL_SMQ];
|
||||
mutex_lock(&rvu->rsrc_lock);
|
||||
for (schq = 0; schq < txsch->schq.max; schq++) {
|
||||
if (TXSCH_MAP_FUNC(txsch->pfvf_map[schq]) != pcifunc)
|
||||
continue;
|
||||
cfg = rvu_read64(rvu, blkaddr, NIX_AF_SMQX_CFG(schq));
|
||||
cfg = (cfg & ~(0xFFFFULL << 8)) | ((u64)req->maxlen << 8);
|
||||
if (req->update_minlen)
|
||||
cfg = (cfg & ~0x7FULL) | ((u64)req->minlen & 0x7F);
|
||||
rvu_write64(rvu, blkaddr, NIX_AF_SMQX_CFG(schq), cfg);
|
||||
}
|
||||
mutex_unlock(&rvu->rsrc_lock);
|
||||
|
||||
rx_frscfg:
|
||||
/* Check if config is for SDP link */
|
||||
if (req->sdp_link) {
|
||||
if (!hw->sdp_links)
|
||||
@ -4544,7 +4453,6 @@ rx_frscfg:
|
||||
if (link < 0)
|
||||
return NIX_AF_ERR_RX_LINK_INVALID;
|
||||
|
||||
|
||||
linkcfg:
|
||||
nix_find_link_frs(rvu, req, pcifunc);
|
||||
|
||||
@ -4554,19 +4462,7 @@ linkcfg:
|
||||
cfg = (cfg & ~0xFFFFULL) | req->minlen;
|
||||
rvu_write64(rvu, blkaddr, NIX_AF_RX_LINKX_CFG(link), cfg);
|
||||
|
||||
if (req->sdp_link || pf == 0)
|
||||
return 0;
|
||||
|
||||
/* Update transmit credits for CGX links */
|
||||
lmac_fifo_len = rvu_cgx_get_lmac_fifolen(rvu, cgx, lmac);
|
||||
if (!lmac_fifo_len) {
|
||||
dev_err(rvu->dev,
|
||||
"%s: Failed to get CGX/RPM%d:LMAC%d FIFO size\n",
|
||||
__func__, cgx, lmac);
|
||||
return 0;
|
||||
}
|
||||
return nix_config_link_credits(rvu, blkaddr, link, pcifunc,
|
||||
(lmac_fifo_len - req->maxlen) / 16);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rvu_mbox_handler_nix_set_rx_cfg(struct rvu *rvu, struct nix_rx_cfg *req,
|
||||
@ -5171,7 +5067,13 @@ int rvu_mbox_handler_nix_lf_stop_rx(struct rvu *rvu, struct msg_req *req,
|
||||
pfvf = rvu_get_pfvf(rvu, pcifunc);
|
||||
clear_bit(NIXLF_INITIALIZED, &pfvf->flags);
|
||||
|
||||
return rvu_cgx_start_stop_io(rvu, pcifunc, false);
|
||||
err = rvu_cgx_start_stop_io(rvu, pcifunc, false);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
rvu_cgx_tx_enable(rvu, pcifunc, true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define RX_SA_BASE GENMASK_ULL(52, 7)
|
||||
|
@ -267,6 +267,13 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts)
|
||||
priv->stats.rx_truncate_errors++;
|
||||
}
|
||||
|
||||
/* Read receive consumer index before replenish so that this routine
|
||||
* returns accurate return value even if packet is received into
|
||||
* just-replenished buffer prior to exiting this routine.
|
||||
*/
|
||||
rx_ci = readq(priv->base + MLXBF_GIGE_RX_CQE_PACKET_CI);
|
||||
rx_ci_rem = rx_ci % priv->rx_q_entries;
|
||||
|
||||
/* Let hardware know we've replenished one buffer */
|
||||
rx_pi++;
|
||||
|
||||
@ -279,8 +286,6 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts)
|
||||
rx_pi_rem = rx_pi % priv->rx_q_entries;
|
||||
if (rx_pi_rem == 0)
|
||||
priv->valid_polarity ^= 1;
|
||||
rx_ci = readq(priv->base + MLXBF_GIGE_RX_CQE_PACKET_CI);
|
||||
rx_ci_rem = rx_ci % priv->rx_q_entries;
|
||||
|
||||
if (skb)
|
||||
netif_receive_skb(skb);
|
||||
|
@ -2591,6 +2591,7 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev)
|
||||
|
||||
if (qdev->lrg_buf_q_alloc_virt_addr == NULL) {
|
||||
netdev_err(qdev->ndev, "lBufQ failed\n");
|
||||
kfree(qdev->lrg_buf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
qdev->lrg_buf_q_virt_addr = qdev->lrg_buf_q_alloc_virt_addr;
|
||||
@ -2615,6 +2616,7 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev)
|
||||
qdev->lrg_buf_q_alloc_size,
|
||||
qdev->lrg_buf_q_alloc_virt_addr,
|
||||
qdev->lrg_buf_q_alloc_phy_addr);
|
||||
kfree(qdev->lrg_buf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -1265,7 +1265,7 @@ static void rtl8168ep_driver_start(struct rtl8169_private *tp)
|
||||
{
|
||||
r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_START);
|
||||
r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01);
|
||||
rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 10);
|
||||
rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 30);
|
||||
}
|
||||
|
||||
static void rtl8168_driver_start(struct rtl8169_private *tp)
|
||||
|
@ -66,16 +66,27 @@ int ravb_wait(struct net_device *ndev, enum ravb_reg reg, u32 mask, u32 value)
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
static int ravb_config(struct net_device *ndev)
|
||||
static int ravb_set_opmode(struct net_device *ndev, u32 opmode)
|
||||
{
|
||||
u32 csr_ops = 1U << (opmode & CCC_OPC);
|
||||
u32 ccc_mask = CCC_OPC;
|
||||
int error;
|
||||
|
||||
/* Set config mode */
|
||||
ravb_modify(ndev, CCC, CCC_OPC, CCC_OPC_CONFIG);
|
||||
/* Check if the operating mode is changed to the config mode */
|
||||
error = ravb_wait(ndev, CSR, CSR_OPS, CSR_OPS_CONFIG);
|
||||
if (error)
|
||||
netdev_err(ndev, "failed to switch device to config mode\n");
|
||||
/* If gPTP active in config mode is supported it needs to be configured
|
||||
* along with CSEL and operating mode in the same access. This is a
|
||||
* hardware limitation.
|
||||
*/
|
||||
if (opmode & CCC_GAC)
|
||||
ccc_mask |= CCC_GAC | CCC_CSEL;
|
||||
|
||||
/* Set operating mode */
|
||||
ravb_modify(ndev, CCC, ccc_mask, opmode);
|
||||
/* Check if the operating mode is changed to the requested one */
|
||||
error = ravb_wait(ndev, CSR, CSR_OPS, csr_ops);
|
||||
if (error) {
|
||||
netdev_err(ndev, "failed to switch device to requested mode (%u)\n",
|
||||
opmode & CCC_OPC);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
@ -673,7 +684,7 @@ static int ravb_dmac_init(struct net_device *ndev)
|
||||
int error;
|
||||
|
||||
/* Set CONFIG mode */
|
||||
error = ravb_config(ndev);
|
||||
error = ravb_set_opmode(ndev, CCC_OPC_CONFIG);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@ -682,9 +693,7 @@ static int ravb_dmac_init(struct net_device *ndev)
|
||||
return error;
|
||||
|
||||
/* Setting the control will start the AVB-DMAC process. */
|
||||
ravb_modify(ndev, CCC, CCC_OPC, CCC_OPC_OPERATION);
|
||||
|
||||
return 0;
|
||||
return ravb_set_opmode(ndev, CCC_OPC_OPERATION);
|
||||
}
|
||||
|
||||
static void ravb_get_tx_tstamp(struct net_device *ndev)
|
||||
@ -1046,7 +1055,7 @@ static int ravb_stop_dma(struct net_device *ndev)
|
||||
return error;
|
||||
|
||||
/* Stop AVB-DMAC process */
|
||||
return ravb_config(ndev);
|
||||
return ravb_set_opmode(ndev, CCC_OPC_CONFIG);
|
||||
}
|
||||
|
||||
/* E-MAC interrupt handler */
|
||||
@ -2560,21 +2569,25 @@ static int ravb_set_gti(struct net_device *ndev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ravb_set_config_mode(struct net_device *ndev)
|
||||
static int ravb_set_config_mode(struct net_device *ndev)
|
||||
{
|
||||
struct ravb_private *priv = netdev_priv(ndev);
|
||||
const struct ravb_hw_info *info = priv->info;
|
||||
int error;
|
||||
|
||||
if (info->gptp) {
|
||||
ravb_modify(ndev, CCC, CCC_OPC, CCC_OPC_CONFIG);
|
||||
error = ravb_set_opmode(ndev, CCC_OPC_CONFIG);
|
||||
if (error)
|
||||
return error;
|
||||
/* Set CSEL value */
|
||||
ravb_modify(ndev, CCC, CCC_CSEL, CCC_CSEL_HPB);
|
||||
} else if (info->ccc_gac) {
|
||||
ravb_modify(ndev, CCC, CCC_OPC, CCC_OPC_CONFIG |
|
||||
CCC_GAC | CCC_CSEL_HPB);
|
||||
error = ravb_set_opmode(ndev, CCC_OPC_CONFIG | CCC_GAC | CCC_CSEL_HPB);
|
||||
} else {
|
||||
ravb_modify(ndev, CCC, CCC_OPC, CCC_OPC_CONFIG);
|
||||
error = ravb_set_opmode(ndev, CCC_OPC_CONFIG);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Set tx and rx clock internal delay modes */
|
||||
@ -2794,7 +2807,9 @@ static int ravb_probe(struct platform_device *pdev)
|
||||
ndev->ethtool_ops = &ravb_ethtool_ops;
|
||||
|
||||
/* Set AVB config mode */
|
||||
ravb_set_config_mode(ndev);
|
||||
error = ravb_set_config_mode(ndev);
|
||||
if (error)
|
||||
goto out_disable_gptp_clk;
|
||||
|
||||
if (info->gptp || info->ccc_gac) {
|
||||
/* Set GTI value */
|
||||
@ -2917,8 +2932,7 @@ static void ravb_remove(struct platform_device *pdev)
|
||||
dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,
|
||||
priv->desc_bat_dma);
|
||||
|
||||
/* Set reset mode */
|
||||
ravb_write(ndev, CCC_OPC_RESET, CCC);
|
||||
ravb_set_opmode(ndev, CCC_OPC_RESET);
|
||||
|
||||
clk_disable_unprepare(priv->gptp_clk);
|
||||
clk_disable_unprepare(priv->refclk);
|
||||
@ -3000,8 +3014,11 @@ static int __maybe_unused ravb_resume(struct device *dev)
|
||||
int ret = 0;
|
||||
|
||||
/* If WoL is enabled set reset mode to rearm the WoL logic */
|
||||
if (priv->wol_enabled)
|
||||
ravb_write(ndev, CCC_OPC_RESET, CCC);
|
||||
if (priv->wol_enabled) {
|
||||
ret = ravb_set_opmode(ndev, CCC_OPC_RESET);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* All register have been reset to default values.
|
||||
* Restore all registers which where setup at probe time and
|
||||
@ -3009,7 +3026,9 @@ static int __maybe_unused ravb_resume(struct device *dev)
|
||||
*/
|
||||
|
||||
/* Set AVB config mode */
|
||||
ravb_set_config_mode(ndev);
|
||||
ret = ravb_set_config_mode(ndev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (info->gptp || info->ccc_gac) {
|
||||
/* Set GTI value */
|
||||
|
@ -823,8 +823,10 @@ int efx_probe_filters(struct efx_nic *efx)
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
efx_for_each_channel(channel, efx)
|
||||
efx_for_each_channel(channel, efx) {
|
||||
kfree(channel->rps_flow_id);
|
||||
channel->rps_flow_id = NULL;
|
||||
}
|
||||
efx->type->filter_table_remove(efx);
|
||||
rc = -ENOMEM;
|
||||
goto out_unlock;
|
||||
|
@ -161,7 +161,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
u8 buf[ETH_ALEN];
|
||||
struct ax88172a_private *priv;
|
||||
|
||||
usbnet_get_endpoints(dev, intf);
|
||||
ret = usbnet_get_endpoints(dev, intf);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
|
@ -173,6 +173,7 @@ struct ax88179_data {
|
||||
u8 in_pm;
|
||||
u32 wol_supported;
|
||||
u32 wolopts;
|
||||
u8 disconnecting;
|
||||
};
|
||||
|
||||
struct ax88179_int_data {
|
||||
@ -208,6 +209,7 @@ static int __ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
|
||||
{
|
||||
int ret;
|
||||
int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
|
||||
struct ax88179_data *ax179_data = dev->driver_priv;
|
||||
|
||||
BUG_ON(!dev);
|
||||
|
||||
@ -219,7 +221,7 @@ static int __ax88179_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
|
||||
ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
value, index, data, size);
|
||||
|
||||
if (unlikely(ret < 0))
|
||||
if (unlikely((ret < 0) && !(ret == -ENODEV && ax179_data->disconnecting)))
|
||||
netdev_warn(dev->net, "Failed to read reg index 0x%04x: %d\n",
|
||||
index, ret);
|
||||
|
||||
@ -231,6 +233,7 @@ static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
|
||||
{
|
||||
int ret;
|
||||
int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
|
||||
struct ax88179_data *ax179_data = dev->driver_priv;
|
||||
|
||||
BUG_ON(!dev);
|
||||
|
||||
@ -242,7 +245,7 @@ static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
|
||||
ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
value, index, data, size);
|
||||
|
||||
if (unlikely(ret < 0))
|
||||
if (unlikely((ret < 0) && !(ret == -ENODEV && ax179_data->disconnecting)))
|
||||
netdev_warn(dev->net, "Failed to write reg index 0x%04x: %d\n",
|
||||
index, ret);
|
||||
|
||||
@ -492,6 +495,20 @@ static int ax88179_resume(struct usb_interface *intf)
|
||||
return usbnet_resume(intf);
|
||||
}
|
||||
|
||||
static void ax88179_disconnect(struct usb_interface *intf)
|
||||
{
|
||||
struct usbnet *dev = usb_get_intfdata(intf);
|
||||
struct ax88179_data *ax179_data;
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
ax179_data = dev->driver_priv;
|
||||
ax179_data->disconnecting = 1;
|
||||
|
||||
usbnet_disconnect(intf);
|
||||
}
|
||||
|
||||
static void
|
||||
ax88179_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
|
||||
{
|
||||
@ -1904,7 +1921,7 @@ static struct usb_driver ax88179_178a_driver = {
|
||||
.suspend = ax88179_suspend,
|
||||
.resume = ax88179_resume,
|
||||
.reset_resume = ax88179_resume,
|
||||
.disconnect = usbnet_disconnect,
|
||||
.disconnect = ax88179_disconnect,
|
||||
.supports_autosuspend = 1,
|
||||
.disable_hub_initiated_lpm = 1,
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user