Merge 5.10.199 into android12-5.10-lts
Changes in 5.10.199 RDMA/srp: Make struct scsi_cmnd and struct srp_request adjacent RDMA/srp: Do not call scsi_done() from srp_abort() RDMA/cxgb4: Check skb value for failure to allocate perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 lib/test_meminit: fix off-by-one error in test_pages() HID: logitech-hidpp: Fix kernel crash on receiver USB disconnect quota: Fix slow quotaoff net: prevent address rewrite in kernel_bind() drm/msm/dp: do not reinitialize phy unless retry during link training drm/msm/dsi: skip the wait for video mode done if not applicable drm/msm/dpu: change _dpu_plane_calc_bw() to use u64 to avoid overflow ravb: Fix up dma_free_coherent() call in ravb_remove() ieee802154: ca8210: Fix a potential UAF in ca8210_probe mlxsw: fix mlxsw_sp2_nve_vxlan_learning_set() return type xen-netback: use default TX queue size for vifs riscv, bpf: Factor out emit_call for kernel and bpf context riscv, bpf: Sign-extend return values drm/vmwgfx: fix typo of sizeof argument net: macsec: indicate next pn update when offloading net: phy: mscc: macsec: reject PN update requests ixgbe: fix crash with empty VF macvlan list net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn() pinctrl: renesas: rzn1: Enable missing PINMUX nfc: nci: assert requested protocol is valid workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask() Revert "spi: zynqmp-gqspi: fix clock imbalance on probe failure" Revert "spi: spi-zynqmp-gqspi: Fix runtime PM imbalance in zynqmp_qspi_probe" net: add sysctl accept_ra_min_rtr_lft net: change accept_ra_min_rtr_lft to affect all RA lifetimes net: release reference to inet6_dev pointer media: mtk-jpeg: Fix use after free bug due to uncanceled work dmaengine: stm32-mdma: abort resume if no ongoing transfer usb: xhci: xhci-ring: Use sysdev for mapping bounce buffer net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read usb: dwc3: Soft reset phy on probe for host usb: musb: Get the musb_qh poniter after musb_giveback usb: musb: Modify the "HWVers" register address iio: pressure: bmp280: Fix NULL pointer exception iio: pressure: dps310: Adjust Timeout Settings iio: pressure: ms5611: ms5611_prom_is_valid false negative bug x86/cpu: Fix AMD erratum #1485 on Zen4-based CPUs mcb: remove is_added flag from mcb_device struct thunderbolt: Check that lane 1 is in CL0 before enabling lane bonding libceph: use kernel_connect() ceph: fix incorrect revoked caps assert in ceph_fill_file_size() ceph: fix type promotion bug on 32bit systems Input: powermate - fix use-after-free in powermate_config_complete Input: psmouse - fix fast_reconnect function for PS/2 mode Input: xpad - add PXN V900 support Input: i8042 - add Fujitsu Lifebook E5411 to i8042 quirk table Input: goodix - ensure int GPIO is in input for gpio_count == 1 && gpio_int_idx == 0 case tee: amdtee: fix use-after-free vulnerability in amdtee_close_session cgroup: Remove duplicates in cgroup v1 tasks file pinctrl: avoid unsafe code pattern in find_pinctrl() counter: microchip-tcb-capture: Fix the use of internal GCLK logic usb: gadget: udc-xilinx: replace memcpy with memcpy_toio usb: gadget: ncm: Handle decoding of multiple NTB's in unwrap call dmaengine: mediatek: Fix deadlock caused by synchronize_irq() powerpc/8xx: Fix pte_access_permitted() for PAGE_NONE powerpc/64e: Fix wrong test in __ptep_test_and_clear_young() x86/alternatives: Disable KASAN in apply_alternatives() arm64: report EL1 UNDEFs better arm64: die(): pass 'err' as long arm64: consistently pass ESR_ELx to die() arm64: rework FPAC exception handling arm64: rework BTI exception handling arm64: allow kprobes on EL0 handlers arm64: split EL0/EL1 UNDEF handlers arm64: factor out EL1 SSBS emulation hook arm64: factor insn read out of call_undef_hook() arm64: rework EL0 MRS emulation arm64: armv8_deprecated: fold ops into insn_emulation arm64: armv8_deprecated move emulation functions arm64: armv8_deprecated: move aarch32 helper earlier arm64: armv8_deprecated: rework deprected instruction handling arm64: armv8_deprecated: fix unused-function error RDMA/srp: Set scmnd->result only when scmnd is not NULL RDMA/srp: Fix srp_abort() ravb: Fix use-after-free issue in ravb_tx_timeout_work() dev_forward_skb: do not scrub skb mark within the same name space lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default mm/memory_hotplug: rate limit page migration warnings Documentation: sysctl: align cells in second content column usb: hub: Guard against accesses to uninitialized BOS descriptors Bluetooth: hci_event: Ignore NULL link key Bluetooth: Reject connection with the device which has same BD_ADDR Bluetooth: Fix a refcnt underflow problem for hci_conn Bluetooth: vhci: Fix race when opening vhci device Bluetooth: hci_event: Fix coding style Bluetooth: avoid memcmp() out of bounds warning ice: fix over-shifted variable ice: reset first in crash dump kernels nfc: nci: fix possible NULL pointer dereference in send_acknowledge() regmap: fix NULL deref on lookup KVM: x86: Mask LVTPC when handling a PMI x86/sev: Disable MMIO emulation from user mode x86/sev: Check IOBM for IOIO exceptions from user-space x86/sev: Check for user-space IOIO pointing to kernel space tcp: check mptcp-level constraints for backlog coalescing netfilter: nft_payload: fix wrong mac header matching nvmet-tcp: Fix a possible UAF in queue intialization setup drm/i915: Retry gtt fault when out of fence registers qed: fix LL2 RX buffer allocation xfrm: fix a data-race in xfrm_gen_index() xfrm: interface: use DEV_STATS_INC() net: ipv4: fix return value check in esp_remove_trailer net: ipv6: fix return value check in esp_remove_trailer net: rfkill: gpio: prevent value glitch during probe tcp: fix excessive TLP and RACK timeouts from HZ rounding tcp: tsq: relax tcp_small_queue_check() when rtx queue contains a single skb tun: prevent negative ifindex ipv4: fib: annotate races around nh->nh_saddr_genid and nh->nh_saddr net: usb: smsc95xx: Fix an error code in smsc95xx_reset() i40e: prevent crash on probe if hw registers have invalid values net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section netfilter: nft_set_rbtree: .deactivate fails if element has expired net: pktgen: Fix interface flags printing thunderbolt: Workaround an IOMMU fault on certain systems with Intel Maple Ridge resource: Add irqresource_disabled() ACPI: Drop acpi_dev_irqresource_disabled() ACPI: resources: Add DMI-based legacy IRQ override quirk ACPI: resource: Skip IRQ override on Asus Vivobook K3402ZA/K3502ZA ACPI: resource: Add ASUS model S5402ZA to quirks ACPI: resource: Skip IRQ override on Asus Vivobook S5602ZA ACPI: resource: Add Asus ExpertBook B2502 to Asus quirks ACPI: resource: Skip IRQ override on Asus Expertbook B2402CBA ACPI: resource: Skip IRQ override on ASUS ExpertBook B1502CBA ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CBA selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting selftests/mm: fix awk usage in charge_reserved_hugetlb.sh and hugetlb_reparenting_test.sh that may cause error usb: core: Track SuperSpeed Plus GenXxY xhci: cleanup xhci_hub_control port references xhci: move port specific items such as state completions to port structure xhci: rename resume_done to resume_timestamp xhci: clear usb2 resume related variables in one place. xhci: decouple usb2 port resume and get_port_status request handling xhci: track port suspend state correctly in unsuccessful resume cases serial: 8250: omap: Fix imprecise external abort for omap_8250_pm() serial: 8250_omap: Fix errors with no_console_suspend drm/amd/display: only check available pipe to disable vbios mode. drm/amd/display: Don't set dpms_off for seamless boot drm/connector: Give connector sysfs devices there own device_type drm/connector: Add a fwnode pointer to drm_connector and register with ACPI (v2) drm/connector: Add drm_connector_find_by_fwnode() function (v3) drm/connector: Add support for out-of-band hotplug notification (v3) usb: typec: altmodes/displayport: Notify drm subsys of hotplug events usb: typec: altmodes/displayport: Signal hpd low when exiting mode ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 btrfs: initialize start_slot in btrfs_log_prealloc_extents i2c: mux: Avoid potential false error message in i2c_mux_add_adapter overlayfs: set ctime when setting mtime and atime gpio: timberdale: Fix potential deadlock on &tgpio->lock ata: libata-eh: Fix compilation warning in ata_eh_link_report() tracing: relax trace_event_eval_update() execution with cond_resched() HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event Bluetooth: Avoid redundant authentication Bluetooth: hci_core: Fix build warnings wifi: cfg80211: Fix 6GHz scan configuration wifi: mac80211: allow transmitting EAPOL frames with tainted key wifi: cfg80211: avoid leaking stack data into trace regulator/core: Revert "fix kobject release warning and memory leak in regulator_register()" sky2: Make sure there is at least one frag_addr available ipv4/fib: send notify when delete source address routes drm: panel-orientation-quirks: Add quirk for One Mix 2S btrfs: fix some -Wmaybe-uninitialized warnings in ioctl.c HID: multitouch: Add required quirk for Synaptics 0xcd7e device platform/x86: touchscreen_dmi: Add info for the Positivo C4128B net/mlx5: Handle fw tracer change ownership event based on MTRC Bluetooth: hci_event: Fix using memcmp when comparing keys mtd: rawnand: qcom: Unmap the right resource upon probe failure mtd: rawnand: marvell: Ensure program page operations are successful mtd: rawnand: arasan: Ensure program page operations are successful mtd: spinand: micron: correct bitmask for ecc status mtd: physmap-core: Restore map_rom fallback mmc: core: sdio: hold retuning if sdio in 1-bit mode mmc: core: Capture correct oemid-bits for eMMC cards Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()" pNFS: Fix a hang in nfs4_evict_inode() ACPI: irq: Fix incorrect return value in acpi_register_gsi() nvme-pci: add BOGUS_NID for Intel 0a54 device nvme-rdma: do not try to stop unallocated queues USB: serial: option: add Telit LE910C4-WWX 0x1035 composition USB: serial: option: add entry for Sierra EM9191 with new firmware USB: serial: option: add Fibocom to DELL custom modem FM101R-GL perf: Disallow mis-matched inherited group reads s390/pci: fix iommu bitmap allocation platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events gpio: vf610: set value before the direction to avoid a glitch ASoC: pxa: fix a memory leak in probe() phy: mapphone-mdm6600: Fix runtime disable on probe phy: mapphone-mdm6600: Fix runtime PM for remove phy: mapphone-mdm6600: Fix pinctrl_pm handling for sleep pins Bluetooth: hci_sock: fix slab oob read in create_monitor_event Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name xfrm6: fix inet6_dev refcount underflow problem Linux 5.10.199 NOTE, this reverts the following commits in order to apply things cleanly and avoid ABI breakage. Due to the complexity involved, individual reverts would not work properly:fc778e9d79
xhci: track port suspend state correctly in unsuccessful resume cases1c034c6e22
xhci: decouple usb2 port resume and get_port_status request handling92088dd886
xhci: clear usb2 resume related variables in one place.e7abc4b18d
xhci: rename resume_done to resume_timestampd44c9285ce
xhci: move port specific items such as state completions to port structuree2b4de13e5
xhci: cleanup xhci_hub_control port references489818719a
arm64: armv8_deprecated: fix unused-function errorda7603cedb
arm64: armv8_deprecated: rework deprected instruction handling45a26d2a53
arm64: armv8_deprecated: move aarch32 helper earlier0b6a7a9f6d
arm64: armv8_deprecated move emulation functions2202536144
arm64: armv8_deprecated: fold ops into insn_emulation5aa232345e
arm64: rework EL0 MRS emulation15e964971f
arm64: factor insn read out of call_undef_hook()0edde7fd1c
arm64: factor out EL1 SSBS emulation hook7a76df1ae1
arm64: split EL0/EL1 UNDEF handlers8a8d4cc303
arm64: allow kprobes on EL0 handlers793ed958b6
arm64: rework BTI exception handling9113333d7c
arm64: rework FPAC exception handlinga8d7c8484f
arm64: consistently pass ESR_ELx to die()004bdab6ed
arm64: die(): pass 'err' as long835cb1f78d
arm64: report EL1 UNDEFs better Change-Id: I54f6d79ae4886b808d6e3c017343f1f25c5254c3 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -31,18 +31,18 @@ see only some of them, depending on your kernel's configuration.
|
||||
|
||||
Table : Subdirectories in /proc/sys/net
|
||||
|
||||
========= =================== = ========== ==================
|
||||
========= =================== = ========== ===================
|
||||
Directory Content Directory Content
|
||||
========= =================== = ========== ==================
|
||||
802 E802 protocol mptcp Multipath TCP
|
||||
appletalk Appletalk protocol netfilter Network Filter
|
||||
========= =================== = ========== ===================
|
||||
802 E802 protocol mptcp Multipath TCP
|
||||
appletalk Appletalk protocol netfilter Network Filter
|
||||
ax25 AX25 netrom NET/ROM
|
||||
bridge Bridging rose X.25 PLP layer
|
||||
core General parameter tipc TIPC
|
||||
ethernet Ethernet protocol unix Unix domain sockets
|
||||
ipv4 IP version 4 x25 X.25 protocol
|
||||
bridge Bridging rose X.25 PLP layer
|
||||
core General parameter tipc TIPC
|
||||
ethernet Ethernet protocol unix Unix domain sockets
|
||||
ipv4 IP version 4 x25 X.25 protocol
|
||||
ipv6 IP version 6
|
||||
========= =================== = ========== ==================
|
||||
========= =================== = ========== ===================
|
||||
|
||||
1. /proc/sys/net/core - Network core options
|
||||
============================================
|
||||
|
@@ -1902,6 +1902,14 @@ accept_ra_min_hop_limit - INTEGER
|
||||
|
||||
Default: 1
|
||||
|
||||
accept_ra_min_lft - INTEGER
|
||||
Minimum acceptable lifetime value in Router Advertisement.
|
||||
|
||||
RA sections with a lifetime less than this value shall be
|
||||
ignored. Zero lifetimes stay unaffected.
|
||||
|
||||
Default: 0
|
||||
|
||||
accept_ra_pinfo - BOOLEAN
|
||||
Learn Prefix Information in Router Advertisement.
|
||||
|
||||
|
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 198
|
||||
SUBLEVEL = 199
|
||||
EXTRAVERSION =
|
||||
NAME = Dare mighty things
|
||||
|
||||
|
@@ -765,6 +765,7 @@
|
||||
&uart3 {
|
||||
interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH
|
||||
&omap4_pmx_core 0x17c>;
|
||||
overrun-throttle-ms = <500>;
|
||||
};
|
||||
|
||||
&uart4 {
|
||||
|
@@ -94,6 +94,13 @@ static inline pte_t pte_wrprotect(pte_t pte)
|
||||
|
||||
#define pte_wrprotect pte_wrprotect
|
||||
|
||||
static inline int pte_read(pte_t pte)
|
||||
{
|
||||
return (pte_val(pte) & _PAGE_RO) != _PAGE_NA;
|
||||
}
|
||||
|
||||
#define pte_read pte_read
|
||||
|
||||
static inline int pte_write(pte_t pte)
|
||||
{
|
||||
return !(pte_val(pte) & _PAGE_RO);
|
||||
|
@@ -216,7 +216,7 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
|
||||
{
|
||||
unsigned long old;
|
||||
|
||||
if (pte_young(*ptep))
|
||||
if (!pte_young(*ptep))
|
||||
return 0;
|
||||
old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0);
|
||||
return (old & _PAGE_ACCESSED) != 0;
|
||||
|
@@ -45,7 +45,9 @@ static inline int pte_write(pte_t pte)
|
||||
return pte_val(pte) & _PAGE_RW;
|
||||
}
|
||||
#endif
|
||||
#ifndef pte_read
|
||||
static inline int pte_read(pte_t pte) { return 1; }
|
||||
#endif
|
||||
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
|
||||
static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
|
||||
static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK) == 0; }
|
||||
|
@@ -201,7 +201,7 @@ static void __build_epilogue(bool is_tail_call, struct rv_jit_context *ctx)
|
||||
emit_addi(RV_REG_SP, RV_REG_SP, stack_adjust, ctx);
|
||||
/* Set return value. */
|
||||
if (!is_tail_call)
|
||||
emit_mv(RV_REG_A0, RV_REG_A5, ctx);
|
||||
emit_addiw(RV_REG_A0, RV_REG_A5, 0, ctx);
|
||||
emit_jalr(RV_REG_ZERO, is_tail_call ? RV_REG_T3 : RV_REG_RA,
|
||||
is_tail_call ? 4 : 0, /* skip TCC init */
|
||||
ctx);
|
||||
@@ -394,12 +394,12 @@ static void emit_sext_32_rd(u8 *rd, struct rv_jit_context *ctx)
|
||||
*rd = RV_REG_T2;
|
||||
}
|
||||
|
||||
static int emit_jump_and_link(u8 rd, s64 rvoff, bool force_jalr,
|
||||
static int emit_jump_and_link(u8 rd, s64 rvoff, bool fixed_addr,
|
||||
struct rv_jit_context *ctx)
|
||||
{
|
||||
s64 upper, lower;
|
||||
|
||||
if (rvoff && is_21b_int(rvoff) && !force_jalr) {
|
||||
if (rvoff && fixed_addr && is_21b_int(rvoff)) {
|
||||
emit(rv_jal(rd, rvoff >> 1), ctx);
|
||||
return 0;
|
||||
} else if (in_auipc_jalr_range(rvoff)) {
|
||||
@@ -420,24 +420,17 @@ static bool is_signed_bpf_cond(u8 cond)
|
||||
cond == BPF_JSGE || cond == BPF_JSLE;
|
||||
}
|
||||
|
||||
static int emit_call(bool fixed, u64 addr, struct rv_jit_context *ctx)
|
||||
static int emit_call(u64 addr, bool fixed_addr, struct rv_jit_context *ctx)
|
||||
{
|
||||
s64 off = 0;
|
||||
u64 ip;
|
||||
u8 rd;
|
||||
int ret;
|
||||
|
||||
if (addr && ctx->insns) {
|
||||
ip = (u64)(long)(ctx->insns + ctx->ninsns);
|
||||
off = addr - ip;
|
||||
}
|
||||
|
||||
ret = emit_jump_and_link(RV_REG_RA, off, !fixed, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
rd = bpf_to_rv_reg(BPF_REG_0, ctx);
|
||||
emit_mv(rd, RV_REG_A0, ctx);
|
||||
return 0;
|
||||
return emit_jump_and_link(RV_REG_RA, off, fixed_addr, ctx);
|
||||
}
|
||||
|
||||
int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,
|
||||
@@ -731,7 +724,7 @@ out_be:
|
||||
/* JUMP off */
|
||||
case BPF_JMP | BPF_JA:
|
||||
rvoff = rv_offset(i, off, ctx);
|
||||
ret = emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
|
||||
ret = emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
@@ -850,17 +843,21 @@ out_be:
|
||||
/* function call */
|
||||
case BPF_JMP | BPF_CALL:
|
||||
{
|
||||
bool fixed;
|
||||
bool fixed_addr;
|
||||
u64 addr;
|
||||
|
||||
mark_call(ctx);
|
||||
ret = bpf_jit_get_func_addr(ctx->prog, insn, extra_pass, &addr,
|
||||
&fixed);
|
||||
ret = bpf_jit_get_func_addr(ctx->prog, insn, extra_pass,
|
||||
&addr, &fixed_addr);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = emit_call(fixed, addr, ctx);
|
||||
|
||||
ret = emit_call(addr, fixed_addr, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (insn->src_reg != BPF_PSEUDO_CALL)
|
||||
emit_mv(bpf_to_rv_reg(BPF_REG_0, ctx), RV_REG_A0, ctx);
|
||||
break;
|
||||
}
|
||||
/* tail call */
|
||||
@@ -875,7 +872,7 @@ out_be:
|
||||
break;
|
||||
|
||||
rvoff = epilogue_offset(ctx);
|
||||
ret = emit_jump_and_link(RV_REG_ZERO, rvoff, false, ctx);
|
||||
ret = emit_jump_and_link(RV_REG_ZERO, rvoff, true, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
|
@@ -542,6 +542,17 @@ static void s390_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned long *bitmap_vzalloc(size_t bits, gfp_t flags)
|
||||
{
|
||||
size_t n = BITS_TO_LONGS(bits);
|
||||
size_t bytes;
|
||||
|
||||
if (unlikely(check_mul_overflow(n, sizeof(unsigned long), &bytes)))
|
||||
return NULL;
|
||||
|
||||
return vzalloc(bytes);
|
||||
}
|
||||
|
||||
int zpci_dma_init_device(struct zpci_dev *zdev)
|
||||
{
|
||||
int rc;
|
||||
@@ -577,13 +588,13 @@ int zpci_dma_init_device(struct zpci_dev *zdev)
|
||||
zdev->end_dma - zdev->start_dma + 1);
|
||||
zdev->end_dma = zdev->start_dma + zdev->iommu_size - 1;
|
||||
zdev->iommu_pages = zdev->iommu_size >> PAGE_SHIFT;
|
||||
zdev->iommu_bitmap = vzalloc(zdev->iommu_pages / 8);
|
||||
zdev->iommu_bitmap = bitmap_vzalloc(zdev->iommu_pages, GFP_KERNEL);
|
||||
if (!zdev->iommu_bitmap) {
|
||||
rc = -ENOMEM;
|
||||
goto free_dma_table;
|
||||
}
|
||||
if (!s390_iommu_strict) {
|
||||
zdev->lazy_bitmap = vzalloc(zdev->iommu_pages / 8);
|
||||
zdev->lazy_bitmap = bitmap_vzalloc(zdev->iommu_pages, GFP_KERNEL);
|
||||
if (!zdev->lazy_bitmap) {
|
||||
rc = -ENOMEM;
|
||||
goto free_bitmap;
|
||||
|
@@ -106,6 +106,16 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt,
|
||||
return ES_OK;
|
||||
}
|
||||
|
||||
static enum es_result vc_ioio_check(struct es_em_ctxt *ctxt, u16 port, size_t size)
|
||||
{
|
||||
return ES_OK;
|
||||
}
|
||||
|
||||
static bool fault_in_kernel_space(unsigned long address)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#undef __init
|
||||
#undef __pa
|
||||
#define __init
|
||||
|
@@ -541,12 +541,17 @@
|
||||
|
||||
#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f
|
||||
|
||||
/* Fam 17h MSRs */
|
||||
#define MSR_F17H_IRPERF 0xc00000e9
|
||||
/* Zen4 */
|
||||
#define MSR_ZEN4_BP_CFG 0xc001102e
|
||||
#define MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT 5
|
||||
|
||||
/* Zen 2 */
|
||||
#define MSR_ZEN2_SPECTRAL_CHICKEN 0xc00110e3
|
||||
#define MSR_ZEN2_SPECTRAL_CHICKEN_BIT BIT_ULL(1)
|
||||
|
||||
/* Fam 17h MSRs */
|
||||
#define MSR_F17H_IRPERF 0xc00000e9
|
||||
|
||||
/* Fam 16h MSRs */
|
||||
#define MSR_F16H_L2I_PERF_CTL 0xc0010230
|
||||
#define MSR_F16H_L2I_PERF_CTR 0xc0010231
|
||||
|
@@ -424,6 +424,17 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start,
|
||||
u8 insn_buff[MAX_PATCH_LEN];
|
||||
|
||||
DPRINTK("alt table %px, -> %px", start, end);
|
||||
|
||||
/*
|
||||
* In the case CONFIG_X86_5LEVEL=y, KASAN_SHADOW_START is defined using
|
||||
* cpu_feature_enabled(X86_FEATURE_LA57) and is therefore patched here.
|
||||
* During the process, KASAN becomes confused seeing partial LA57
|
||||
* conversion and triggers a false-positive out-of-bound report.
|
||||
*
|
||||
* Disable KASAN until the patching is complete.
|
||||
*/
|
||||
kasan_disable_current();
|
||||
|
||||
/*
|
||||
* The scan order should be from start to end. A later scanned
|
||||
* alternative code can overwrite previously scanned alternative code.
|
||||
@@ -491,6 +502,8 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start,
|
||||
next:
|
||||
optimize_nops(instr, a->instrlen);
|
||||
}
|
||||
|
||||
kasan_enable_current();
|
||||
}
|
||||
|
||||
#if defined(CONFIG_RETPOLINE) && defined(CONFIG_STACK_VALIDATION)
|
||||
|
@@ -81,6 +81,10 @@ static const int amd_div0[] =
|
||||
AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0x00, 0x0, 0x2f, 0xf),
|
||||
AMD_MODEL_RANGE(0x17, 0x50, 0x0, 0x5f, 0xf));
|
||||
|
||||
static const int amd_erratum_1485[] =
|
||||
AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x19, 0x10, 0x0, 0x1f, 0xf),
|
||||
AMD_MODEL_RANGE(0x19, 0x60, 0x0, 0xaf, 0xf));
|
||||
|
||||
static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)
|
||||
{
|
||||
int osvw_id = *erratum++;
|
||||
@@ -1178,6 +1182,10 @@ static void init_amd(struct cpuinfo_x86 *c)
|
||||
pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protection.\n");
|
||||
setup_force_cpu_bug(X86_BUG_DIV0);
|
||||
}
|
||||
|
||||
if (!cpu_has(c, X86_FEATURE_HYPERVISOR) &&
|
||||
cpu_has_amd_erratum(c, amd_erratum_1485))
|
||||
msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
|
@@ -217,6 +217,23 @@ fail:
|
||||
asm volatile("hlt\n");
|
||||
}
|
||||
|
||||
static enum es_result vc_insn_string_check(struct es_em_ctxt *ctxt,
|
||||
unsigned long address,
|
||||
bool write)
|
||||
{
|
||||
if (user_mode(ctxt->regs) && fault_in_kernel_space(address)) {
|
||||
ctxt->fi.vector = X86_TRAP_PF;
|
||||
ctxt->fi.error_code = X86_PF_USER;
|
||||
ctxt->fi.cr2 = address;
|
||||
if (write)
|
||||
ctxt->fi.error_code |= X86_PF_WRITE;
|
||||
|
||||
return ES_EXCEPTION;
|
||||
}
|
||||
|
||||
return ES_OK;
|
||||
}
|
||||
|
||||
static enum es_result vc_insn_string_read(struct es_em_ctxt *ctxt,
|
||||
void *src, char *buf,
|
||||
unsigned int data_size,
|
||||
@@ -224,7 +241,12 @@ static enum es_result vc_insn_string_read(struct es_em_ctxt *ctxt,
|
||||
bool backwards)
|
||||
{
|
||||
int i, b = backwards ? -1 : 1;
|
||||
enum es_result ret = ES_OK;
|
||||
unsigned long address = (unsigned long)src;
|
||||
enum es_result ret;
|
||||
|
||||
ret = vc_insn_string_check(ctxt, address, false);
|
||||
if (ret != ES_OK)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
void *s = src + (i * data_size * b);
|
||||
@@ -245,7 +267,12 @@ static enum es_result vc_insn_string_write(struct es_em_ctxt *ctxt,
|
||||
bool backwards)
|
||||
{
|
||||
int i, s = backwards ? -1 : 1;
|
||||
enum es_result ret = ES_OK;
|
||||
unsigned long address = (unsigned long)dst;
|
||||
enum es_result ret;
|
||||
|
||||
ret = vc_insn_string_check(ctxt, address, true);
|
||||
if (ret != ES_OK)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
void *d = dst + (i * data_size * s);
|
||||
@@ -281,6 +308,9 @@ static enum es_result vc_insn_string_write(struct es_em_ctxt *ctxt,
|
||||
static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
|
||||
{
|
||||
struct insn *insn = &ctxt->insn;
|
||||
size_t size;
|
||||
u64 port;
|
||||
|
||||
*exitinfo = 0;
|
||||
|
||||
switch (insn->opcode.bytes[0]) {
|
||||
@@ -289,7 +319,7 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
|
||||
case 0x6d:
|
||||
*exitinfo |= IOIO_TYPE_INS;
|
||||
*exitinfo |= IOIO_SEG_ES;
|
||||
*exitinfo |= (ctxt->regs->dx & 0xffff) << 16;
|
||||
port = ctxt->regs->dx & 0xffff;
|
||||
break;
|
||||
|
||||
/* OUTS opcodes */
|
||||
@@ -297,41 +327,43 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
|
||||
case 0x6f:
|
||||
*exitinfo |= IOIO_TYPE_OUTS;
|
||||
*exitinfo |= IOIO_SEG_DS;
|
||||
*exitinfo |= (ctxt->regs->dx & 0xffff) << 16;
|
||||
port = ctxt->regs->dx & 0xffff;
|
||||
break;
|
||||
|
||||
/* IN immediate opcodes */
|
||||
case 0xe4:
|
||||
case 0xe5:
|
||||
*exitinfo |= IOIO_TYPE_IN;
|
||||
*exitinfo |= (u8)insn->immediate.value << 16;
|
||||
port = (u8)insn->immediate.value & 0xffff;
|
||||
break;
|
||||
|
||||
/* OUT immediate opcodes */
|
||||
case 0xe6:
|
||||
case 0xe7:
|
||||
*exitinfo |= IOIO_TYPE_OUT;
|
||||
*exitinfo |= (u8)insn->immediate.value << 16;
|
||||
port = (u8)insn->immediate.value & 0xffff;
|
||||
break;
|
||||
|
||||
/* IN register opcodes */
|
||||
case 0xec:
|
||||
case 0xed:
|
||||
*exitinfo |= IOIO_TYPE_IN;
|
||||
*exitinfo |= (ctxt->regs->dx & 0xffff) << 16;
|
||||
port = ctxt->regs->dx & 0xffff;
|
||||
break;
|
||||
|
||||
/* OUT register opcodes */
|
||||
case 0xee:
|
||||
case 0xef:
|
||||
*exitinfo |= IOIO_TYPE_OUT;
|
||||
*exitinfo |= (ctxt->regs->dx & 0xffff) << 16;
|
||||
port = ctxt->regs->dx & 0xffff;
|
||||
break;
|
||||
|
||||
default:
|
||||
return ES_DECODE_FAILED;
|
||||
}
|
||||
|
||||
*exitinfo |= port << 16;
|
||||
|
||||
switch (insn->opcode.bytes[0]) {
|
||||
case 0x6c:
|
||||
case 0x6e:
|
||||
@@ -341,12 +373,15 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
|
||||
case 0xee:
|
||||
/* Single byte opcodes */
|
||||
*exitinfo |= IOIO_DATA_8;
|
||||
size = 1;
|
||||
break;
|
||||
default:
|
||||
/* Length determined by instruction parsing */
|
||||
*exitinfo |= (insn->opnd_bytes == 2) ? IOIO_DATA_16
|
||||
: IOIO_DATA_32;
|
||||
size = (insn->opnd_bytes == 2) ? 2 : 4;
|
||||
}
|
||||
|
||||
switch (insn->addr_bytes) {
|
||||
case 2:
|
||||
*exitinfo |= IOIO_ADDR_16;
|
||||
@@ -362,7 +397,7 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo)
|
||||
if (insn_has_rep_prefix(insn))
|
||||
*exitinfo |= IOIO_REP;
|
||||
|
||||
return ES_OK;
|
||||
return vc_ioio_check(ctxt, (u16)port, size);
|
||||
}
|
||||
|
||||
static enum es_result vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
|
||||
|
@@ -448,6 +448,33 @@ static enum es_result vc_slow_virt_to_phys(struct ghcb *ghcb, struct es_em_ctxt
|
||||
return ES_OK;
|
||||
}
|
||||
|
||||
static enum es_result vc_ioio_check(struct es_em_ctxt *ctxt, u16 port, size_t size)
|
||||
{
|
||||
BUG_ON(size > 4);
|
||||
|
||||
if (user_mode(ctxt->regs)) {
|
||||
struct thread_struct *t = ¤t->thread;
|
||||
struct io_bitmap *iobm = t->io_bitmap;
|
||||
size_t idx;
|
||||
|
||||
if (!iobm)
|
||||
goto fault;
|
||||
|
||||
for (idx = port; idx < port + size; ++idx) {
|
||||
if (test_bit(idx, iobm->bitmap))
|
||||
goto fault;
|
||||
}
|
||||
}
|
||||
|
||||
return ES_OK;
|
||||
|
||||
fault:
|
||||
ctxt->fi.vector = X86_TRAP_GP;
|
||||
ctxt->fi.error_code = 0;
|
||||
|
||||
return ES_EXCEPTION;
|
||||
}
|
||||
|
||||
/* Include code shared with pre-decompression boot stage */
|
||||
#include "sev-es-shared.c"
|
||||
|
||||
@@ -970,6 +997,9 @@ static enum es_result vc_handle_mmio(struct ghcb *ghcb,
|
||||
enum es_result ret;
|
||||
long *reg_data;
|
||||
|
||||
if (user_mode(ctxt->regs))
|
||||
return ES_UNSUPPORTED;
|
||||
|
||||
switch (insn->opcode.bytes[0]) {
|
||||
/* MMIO Write */
|
||||
case 0x88:
|
||||
|
@@ -2397,13 +2397,17 @@ int kvm_apic_local_deliver(struct kvm_lapic *apic, int lvt_type)
|
||||
{
|
||||
u32 reg = kvm_lapic_get_reg(apic, lvt_type);
|
||||
int vector, mode, trig_mode;
|
||||
int r;
|
||||
|
||||
if (kvm_apic_hw_enabled(apic) && !(reg & APIC_LVT_MASKED)) {
|
||||
vector = reg & APIC_VECTOR_MASK;
|
||||
mode = reg & APIC_MODE_MASK;
|
||||
trig_mode = reg & APIC_LVT_LEVEL_TRIGGER;
|
||||
return __apic_accept_irq(apic, mode, vector, 1, trig_mode,
|
||||
NULL);
|
||||
|
||||
r = __apic_accept_irq(apic, mode, vector, 1, trig_mode, NULL);
|
||||
if (r && lvt_type == APIC_LVTPC)
|
||||
kvm_lapic_set_reg(apic, APIC_LVTPC, reg | APIC_LVT_MASKED);
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -52,6 +52,7 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
|
||||
int polarity)
|
||||
{
|
||||
struct irq_fwspec fwspec;
|
||||
unsigned int irq;
|
||||
|
||||
if (WARN_ON(!acpi_gsi_domain_id)) {
|
||||
pr_warn("GSI: No registered irqchip, giving up\n");
|
||||
@@ -63,7 +64,11 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
|
||||
fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity);
|
||||
fwspec.param_count = 2;
|
||||
|
||||
return irq_create_fwspec_mapping(&fwspec);
|
||||
irq = irq_create_fwspec_mapping(&fwspec);
|
||||
if (!irq)
|
||||
return -EINVAL;
|
||||
|
||||
return irq;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_register_gsi);
|
||||
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/dmi.h>
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
#define valid_IRQ(i) (((i) != 0) && ((i) != 2))
|
||||
@@ -380,21 +381,117 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_dev_get_irq_type);
|
||||
|
||||
static void acpi_dev_irqresource_disabled(struct resource *res, u32 gsi)
|
||||
static const struct dmi_system_id medion_laptop[] = {
|
||||
{
|
||||
.ident = "MEDION P15651",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "M15T"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct dmi_system_id asus_laptop[] = {
|
||||
{
|
||||
.ident = "Asus Vivobook K3402ZA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "K3402ZA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus Vivobook K3502ZA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "K3502ZA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus Vivobook S5402ZA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "S5402ZA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus Vivobook S5602ZA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus ExpertBook B1402CBA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "B1402CBA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus ExpertBook B1502CBA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "B1502CBA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus ExpertBook B2402CBA",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "Asus ExpertBook B2502",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
struct irq_override_cmp {
|
||||
const struct dmi_system_id *system;
|
||||
unsigned char irq;
|
||||
unsigned char triggering;
|
||||
unsigned char polarity;
|
||||
unsigned char shareable;
|
||||
};
|
||||
|
||||
static const struct irq_override_cmp skip_override_table[] = {
|
||||
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
|
||||
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0 },
|
||||
};
|
||||
|
||||
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
|
||||
u8 shareable)
|
||||
{
|
||||
res->start = gsi;
|
||||
res->end = gsi;
|
||||
res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
|
||||
const struct irq_override_cmp *entry = &skip_override_table[i];
|
||||
|
||||
if (dmi_check_system(entry->system) &&
|
||||
entry->irq == gsi &&
|
||||
entry->triggering == triggering &&
|
||||
entry->polarity == polarity &&
|
||||
entry->shareable == shareable)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
|
||||
u8 triggering, u8 polarity, u8 shareable,
|
||||
bool legacy)
|
||||
bool check_override)
|
||||
{
|
||||
int irq, p, t;
|
||||
|
||||
if (!valid_IRQ(gsi)) {
|
||||
acpi_dev_irqresource_disabled(res, gsi);
|
||||
irqresource_disabled(res, gsi);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -408,7 +505,9 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
|
||||
* using extended IRQ descriptors we take the IRQ configuration
|
||||
* from _CRS directly.
|
||||
*/
|
||||
if (legacy && !acpi_get_override_irq(gsi, &t, &p)) {
|
||||
if (check_override &&
|
||||
acpi_dev_irq_override(gsi, triggering, polarity, shareable) &&
|
||||
!acpi_get_override_irq(gsi, &t, &p)) {
|
||||
u8 trig = t ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
|
||||
u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
|
||||
|
||||
@@ -426,7 +525,7 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
|
||||
res->start = irq;
|
||||
res->end = irq;
|
||||
} else {
|
||||
acpi_dev_irqresource_disabled(res, gsi);
|
||||
irqresource_disabled(res, gsi);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,7 +562,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
|
||||
*/
|
||||
irq = &ares->data.irq;
|
||||
if (index >= irq->interrupt_count) {
|
||||
acpi_dev_irqresource_disabled(res, 0);
|
||||
irqresource_disabled(res, 0);
|
||||
return false;
|
||||
}
|
||||
acpi_dev_get_irqresource(res, irq->interrupts[index],
|
||||
@@ -473,7 +572,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
|
||||
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
||||
ext_irq = &ares->data.extended_irq;
|
||||
if (index >= ext_irq->interrupt_count) {
|
||||
acpi_dev_irqresource_disabled(res, 0);
|
||||
irqresource_disabled(res, 0);
|
||||
return false;
|
||||
}
|
||||
if (is_gsi(ext_irq))
|
||||
@@ -481,7 +580,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
|
||||
ext_irq->triggering, ext_irq->polarity,
|
||||
ext_irq->shareable, false);
|
||||
else
|
||||
acpi_dev_irqresource_disabled(res, 0);
|
||||
irqresource_disabled(res, 0);
|
||||
break;
|
||||
default:
|
||||
res->flags = 0;
|
||||
|
@@ -2224,7 +2224,7 @@ static void ata_eh_link_report(struct ata_link *link)
|
||||
struct ata_eh_context *ehc = &link->eh_context;
|
||||
struct ata_queued_cmd *qc;
|
||||
const char *frozen, *desc;
|
||||
char tries_buf[6] = "";
|
||||
char tries_buf[16] = "";
|
||||
int tag, nr_failed = 0;
|
||||
|
||||
if (ehc->i.flags & ATA_EHI_QUIET)
|
||||
|
@@ -1511,7 +1511,7 @@ static int dev_get_regmap_match(struct device *dev, void *res, void *data)
|
||||
|
||||
/* If the user didn't specify a name match any */
|
||||
if (data)
|
||||
return !strcmp((*r)->name, data);
|
||||
return (*r)->name && !strcmp((*r)->name, data);
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
@@ -67,7 +67,10 @@ static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
struct vhci_data *data = hci_get_drvdata(hdev);
|
||||
|
||||
memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);
|
||||
|
||||
mutex_lock(&data->open_mutex);
|
||||
skb_queue_tail(&data->readq, skb);
|
||||
mutex_unlock(&data->open_mutex);
|
||||
|
||||
wake_up_interruptible(&data->read_wait);
|
||||
return 0;
|
||||
|
@@ -111,7 +111,7 @@ static int mchp_tc_count_function_set(struct counter_device *counter,
|
||||
priv->qdec_mode = 0;
|
||||
/* Set highest rate based on whether soc has gclk or not */
|
||||
bmr &= ~(ATMEL_TC_QDEN | ATMEL_TC_POSEN);
|
||||
if (priv->tc_cfg->has_gclk)
|
||||
if (!priv->tc_cfg->has_gclk)
|
||||
cmr |= ATMEL_TC_TIMER_CLOCK2;
|
||||
else
|
||||
cmr |= ATMEL_TC_TIMER_CLOCK1;
|
||||
|
@@ -451,9 +451,8 @@ static int mtk_uart_apdma_device_pause(struct dma_chan *chan)
|
||||
mtk_uart_apdma_write(c, VFF_EN, VFF_EN_CLR_B);
|
||||
mtk_uart_apdma_write(c, VFF_INT_EN, VFF_INT_EN_CLR_B);
|
||||
|
||||
synchronize_irq(c->irq);
|
||||
|
||||
spin_unlock_irqrestore(&c->vc.lock, flags);
|
||||
synchronize_irq(c->irq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1206,6 +1206,10 @@ static int stm32_mdma_resume(struct dma_chan *c)
|
||||
unsigned long flags;
|
||||
u32 status, reg;
|
||||
|
||||
/* Transfer can be terminated */
|
||||
if (!chan->desc || (stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & STM32_MDMA_CCR_EN))
|
||||
return -EPERM;
|
||||
|
||||
hwdesc = chan->desc->node[chan->curr_hwdesc].hwdesc;
|
||||
|
||||
spin_lock_irqsave(&chan->vchan.lock, flags);
|
||||
|
@@ -43,9 +43,10 @@ static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index,
|
||||
unsigned offset, bool enabled)
|
||||
{
|
||||
struct timbgpio *tgpio = gpiochip_get_data(gpio);
|
||||
unsigned long flags;
|
||||
u32 reg;
|
||||
|
||||
spin_lock(&tgpio->lock);
|
||||
spin_lock_irqsave(&tgpio->lock, flags);
|
||||
reg = ioread32(tgpio->membase + offset);
|
||||
|
||||
if (enabled)
|
||||
@@ -54,7 +55,7 @@ static int timbgpio_update_bit(struct gpio_chip *gpio, unsigned index,
|
||||
reg &= ~(1 << index);
|
||||
|
||||
iowrite32(reg, tgpio->membase + offset);
|
||||
spin_unlock(&tgpio->lock);
|
||||
spin_unlock_irqrestore(&tgpio->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -127,14 +127,14 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
|
||||
unsigned long mask = BIT(gpio);
|
||||
u32 val;
|
||||
|
||||
vf610_gpio_set(chip, gpio, value);
|
||||
|
||||
if (port->sdata && port->sdata->have_paddr) {
|
||||
val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
|
||||
val |= mask;
|
||||
vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
|
||||
}
|
||||
|
||||
vf610_gpio_set(chip, gpio, value);
|
||||
|
||||
return pinctrl_gpio_direction_output(chip->base + gpio);
|
||||
}
|
||||
|
||||
|
@@ -862,12 +862,19 @@ static void disable_vbios_mode_if_required(
|
||||
if (stream == NULL)
|
||||
continue;
|
||||
|
||||
if (stream->apply_seamless_boot_optimization)
|
||||
continue;
|
||||
|
||||
// only looking for first odm pipe
|
||||
if (pipe->prev_odm_pipe)
|
||||
continue;
|
||||
|
||||
if (stream->link->local_sink &&
|
||||
stream->link->local_sink->sink_signal == SIGNAL_TYPE_EDP) {
|
||||
link = stream->link;
|
||||
}
|
||||
|
||||
if (link != NULL) {
|
||||
if (link != NULL && link->link_enc->funcs->is_dig_enabled(link->link_enc)) {
|
||||
unsigned int enc_inst, tg_inst = 0;
|
||||
unsigned int pix_clk_100hz;
|
||||
|
||||
|
@@ -64,6 +64,14 @@
|
||||
* support can instead use e.g. drm_helper_hpd_irq_event().
|
||||
*/
|
||||
|
||||
/*
|
||||
* Global connector list for drm_connector_find_by_fwnode().
|
||||
* Note drm_connector_[un]register() first take connector->lock and then
|
||||
* take the connector_list_lock.
|
||||
*/
|
||||
static DEFINE_MUTEX(connector_list_lock);
|
||||
static LIST_HEAD(connector_list);
|
||||
|
||||
struct drm_conn_prop_enum_list {
|
||||
int type;
|
||||
const char *name;
|
||||
@@ -265,6 +273,7 @@ int drm_connector_init(struct drm_device *dev,
|
||||
goto out_put_type_id;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&connector->global_connector_list_entry);
|
||||
INIT_LIST_HEAD(&connector->probed_modes);
|
||||
INIT_LIST_HEAD(&connector->modes);
|
||||
mutex_init(&connector->mutex);
|
||||
@@ -471,6 +480,8 @@ void drm_connector_cleanup(struct drm_connector *connector)
|
||||
drm_mode_object_unregister(dev, &connector->base);
|
||||
kfree(connector->name);
|
||||
connector->name = NULL;
|
||||
fwnode_handle_put(connector->fwnode);
|
||||
connector->fwnode = NULL;
|
||||
spin_lock_irq(&dev->mode_config.connector_list_lock);
|
||||
list_del(&connector->head);
|
||||
dev->mode_config.num_connector--;
|
||||
@@ -532,6 +543,9 @@ int drm_connector_register(struct drm_connector *connector)
|
||||
/* Let userspace know we have a new connector */
|
||||
drm_sysfs_hotplug_event(connector->dev);
|
||||
|
||||
mutex_lock(&connector_list_lock);
|
||||
list_add_tail(&connector->global_connector_list_entry, &connector_list);
|
||||
mutex_unlock(&connector_list_lock);
|
||||
goto unlock;
|
||||
|
||||
err_debugfs:
|
||||
@@ -560,6 +574,10 @@ void drm_connector_unregister(struct drm_connector *connector)
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&connector_list_lock);
|
||||
list_del_init(&connector->global_connector_list_entry);
|
||||
mutex_unlock(&connector_list_lock);
|
||||
|
||||
if (connector->funcs->early_unregister)
|
||||
connector->funcs->early_unregister(connector);
|
||||
|
||||
@@ -2462,6 +2480,67 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_connector_find_by_fwnode - Find a connector based on the associated fwnode
|
||||
* @fwnode: fwnode for which to find the matching drm_connector
|
||||
*
|
||||
* This functions looks up a drm_connector based on its associated fwnode. When
|
||||
* a connector is found a reference to the connector is returned. The caller must
|
||||
* call drm_connector_put() to release this reference when it is done with the
|
||||
* connector.
|
||||
*
|
||||
* Returns: A reference to the found connector or an ERR_PTR().
|
||||
*/
|
||||
struct drm_connector *drm_connector_find_by_fwnode(struct fwnode_handle *fwnode)
|
||||
{
|
||||
struct drm_connector *connector, *found = ERR_PTR(-ENODEV);
|
||||
|
||||
if (!fwnode)
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
mutex_lock(&connector_list_lock);
|
||||
|
||||
list_for_each_entry(connector, &connector_list, global_connector_list_entry) {
|
||||
if (connector->fwnode == fwnode ||
|
||||
(connector->fwnode && connector->fwnode->secondary == fwnode)) {
|
||||
drm_connector_get(connector);
|
||||
found = connector;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&connector_list_lock);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
|
||||
* @connector: connector to report the event on
|
||||
*
|
||||
* On some hardware a hotplug event notification may come from outside the display
|
||||
* driver / device. An example of this is some USB Type-C setups where the hardware
|
||||
* muxes the DisplayPort data and aux-lines but does not pass the altmode HPD
|
||||
* status bit to the GPU's DP HPD pin.
|
||||
*
|
||||
* This function can be used to report these out-of-band events after obtaining
|
||||
* a drm_connector reference through calling drm_connector_find_by_fwnode().
|
||||
*/
|
||||
void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode)
|
||||
{
|
||||
struct drm_connector *connector;
|
||||
|
||||
connector = drm_connector_find_by_fwnode(connector_fwnode);
|
||||
if (IS_ERR(connector))
|
||||
return;
|
||||
|
||||
if (connector->funcs->oob_hotplug_event)
|
||||
connector->funcs->oob_hotplug_event(connector);
|
||||
|
||||
drm_connector_put(connector);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_connector_oob_hotplug_event);
|
||||
|
||||
|
||||
/**
|
||||
* DOC: Tile group
|
||||
|
@@ -57,6 +57,7 @@ struct drm_property;
|
||||
struct edid;
|
||||
struct kref;
|
||||
struct work_struct;
|
||||
struct fwnode_handle;
|
||||
|
||||
/* drm_crtc.c */
|
||||
int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
|
||||
@@ -182,6 +183,7 @@ int drm_connector_set_obj_prop(struct drm_mode_object *obj,
|
||||
int drm_connector_create_standard_properties(struct drm_device *dev);
|
||||
const char *drm_get_connector_force_name(enum drm_connector_force force);
|
||||
void drm_connector_free_work_fn(struct work_struct *work);
|
||||
struct drm_connector *drm_connector_find_by_fwnode(struct fwnode_handle *fwnode);
|
||||
|
||||
/* IOCTL */
|
||||
int drm_connector_property_set_ioctl(struct drm_device *dev,
|
||||
|
@@ -44,6 +44,14 @@ static const struct drm_dmi_panel_orientation_data gpd_micropc = {
|
||||
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
|
||||
};
|
||||
|
||||
static const struct drm_dmi_panel_orientation_data gpd_onemix2s = {
|
||||
.width = 1200,
|
||||
.height = 1920,
|
||||
.bios_dates = (const char * const []){ "05/21/2018", "10/26/2018",
|
||||
"03/04/2019", NULL },
|
||||
.orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
|
||||
};
|
||||
|
||||
static const struct drm_dmi_panel_orientation_data gpd_pocket = {
|
||||
.width = 1200,
|
||||
.height = 1920,
|
||||
@@ -329,6 +337,14 @@ static const struct dmi_system_id orientation_data[] = {
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"),
|
||||
},
|
||||
.driver_data = (void *)&lcd800x1280_rightside_up,
|
||||
}, { /* One Mix 2S (generic strings, also match on bios date) */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
|
||||
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"),
|
||||
DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
|
||||
},
|
||||
.driver_data = (void *)&gpd_onemix2s,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
@@ -10,6 +10,7 @@
|
||||
* Copyright (c) 2003-2004 IBM Corp.
|
||||
*/
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/export.h>
|
||||
@@ -50,8 +51,45 @@ static struct device_type drm_sysfs_device_minor = {
|
||||
.name = "drm_minor"
|
||||
};
|
||||
|
||||
static struct device_type drm_sysfs_device_connector = {
|
||||
.name = "drm_connector",
|
||||
};
|
||||
|
||||
struct class *drm_class;
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static bool drm_connector_acpi_bus_match(struct device *dev)
|
||||
{
|
||||
return dev->type == &drm_sysfs_device_connector;
|
||||
}
|
||||
|
||||
static struct acpi_device *drm_connector_acpi_find_companion(struct device *dev)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(dev);
|
||||
|
||||
return to_acpi_device_node(connector->fwnode);
|
||||
}
|
||||
|
||||
static struct acpi_bus_type drm_connector_acpi_bus = {
|
||||
.name = "drm_connector",
|
||||
.match = drm_connector_acpi_bus_match,
|
||||
.find_companion = drm_connector_acpi_find_companion,
|
||||
};
|
||||
|
||||
static void drm_sysfs_acpi_register(void)
|
||||
{
|
||||
register_acpi_bus_type(&drm_connector_acpi_bus);
|
||||
}
|
||||
|
||||
static void drm_sysfs_acpi_unregister(void)
|
||||
{
|
||||
unregister_acpi_bus_type(&drm_connector_acpi_bus);
|
||||
}
|
||||
#else
|
||||
static void drm_sysfs_acpi_register(void) { }
|
||||
static void drm_sysfs_acpi_unregister(void) { }
|
||||
#endif
|
||||
|
||||
static char *drm_devnode(struct device *dev, umode_t *mode)
|
||||
{
|
||||
return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev));
|
||||
@@ -85,6 +123,8 @@ int drm_sysfs_init(void)
|
||||
}
|
||||
|
||||
drm_class->devnode = drm_devnode;
|
||||
|
||||
drm_sysfs_acpi_register();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -97,11 +137,17 @@ void drm_sysfs_destroy(void)
|
||||
{
|
||||
if (IS_ERR_OR_NULL(drm_class))
|
||||
return;
|
||||
drm_sysfs_acpi_unregister();
|
||||
class_remove_file(drm_class, &class_attr_version.attr);
|
||||
class_destroy(drm_class);
|
||||
drm_class = NULL;
|
||||
}
|
||||
|
||||
static void drm_sysfs_release(struct device *dev)
|
||||
{
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
* Connector properties
|
||||
*/
|
||||
@@ -274,27 +320,47 @@ static const struct attribute_group *connector_dev_groups[] = {
|
||||
int drm_sysfs_connector_add(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct device *kdev;
|
||||
int r;
|
||||
|
||||
if (connector->kdev)
|
||||
return 0;
|
||||
|
||||
connector->kdev =
|
||||
device_create_with_groups(drm_class, dev->primary->kdev, 0,
|
||||
connector, connector_dev_groups,
|
||||
"card%d-%s", dev->primary->index,
|
||||
connector->name);
|
||||
kdev = kzalloc(sizeof(*kdev), GFP_KERNEL);
|
||||
if (!kdev)
|
||||
return -ENOMEM;
|
||||
|
||||
device_initialize(kdev);
|
||||
kdev->class = drm_class;
|
||||
kdev->type = &drm_sysfs_device_connector;
|
||||
kdev->parent = dev->primary->kdev;
|
||||
kdev->groups = connector_dev_groups;
|
||||
kdev->release = drm_sysfs_release;
|
||||
dev_set_drvdata(kdev, connector);
|
||||
|
||||
r = dev_set_name(kdev, "card%d-%s", dev->primary->index, connector->name);
|
||||
if (r)
|
||||
goto err_free;
|
||||
|
||||
DRM_DEBUG("adding \"%s\" to sysfs\n",
|
||||
connector->name);
|
||||
|
||||
if (IS_ERR(connector->kdev)) {
|
||||
DRM_ERROR("failed to register connector device: %ld\n", PTR_ERR(connector->kdev));
|
||||
return PTR_ERR(connector->kdev);
|
||||
r = device_add(kdev);
|
||||
if (r) {
|
||||
drm_err(dev, "failed to register connector device: %d\n", r);
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
connector->kdev = kdev;
|
||||
|
||||
if (connector->ddc)
|
||||
return sysfs_create_link(&connector->kdev->kobj,
|
||||
&connector->ddc->dev.kobj, "ddc");
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
put_device(kdev);
|
||||
return r;
|
||||
}
|
||||
|
||||
void drm_sysfs_connector_remove(struct drm_connector *connector)
|
||||
@@ -375,11 +441,6 @@ void drm_sysfs_connector_status_event(struct drm_connector *connector,
|
||||
}
|
||||
EXPORT_SYMBOL(drm_sysfs_connector_status_event);
|
||||
|
||||
static void drm_sysfs_release(struct device *dev)
|
||||
{
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
struct device *drm_sysfs_minor_alloc(struct drm_minor *minor)
|
||||
{
|
||||
const char *minor_str;
|
||||
|
@@ -222,6 +222,7 @@ static vm_fault_t i915_error_to_vmf_fault(int err)
|
||||
case 0:
|
||||
case -EAGAIN:
|
||||
case -ENOSPC: /* transient failure to evict? */
|
||||
case -ENOBUFS: /* temporarily out of fences? */
|
||||
case -ERESTARTSYS:
|
||||
case -EINTR:
|
||||
case -EBUSY:
|
||||
|
@@ -147,6 +147,7 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane,
|
||||
const struct dpu_format *fmt = NULL;
|
||||
struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
|
||||
int src_width, src_height, dst_height, fps;
|
||||
u64 plane_pixel_rate, plane_bit_rate;
|
||||
u64 plane_prefill_bw;
|
||||
u64 plane_bw;
|
||||
u32 hw_latency_lines;
|
||||
@@ -168,13 +169,12 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane,
|
||||
scale_factor = src_height > dst_height ?
|
||||
mult_frac(src_height, 1, dst_height) : 1;
|
||||
|
||||
plane_bw =
|
||||
src_width * mode->vtotal * fps * fmt->bpp *
|
||||
scale_factor;
|
||||
plane_pixel_rate = src_width * mode->vtotal * fps;
|
||||
plane_bit_rate = plane_pixel_rate * fmt->bpp;
|
||||
|
||||
plane_prefill_bw =
|
||||
src_width * hw_latency_lines * fps * fmt->bpp *
|
||||
scale_factor * mode->vtotal;
|
||||
plane_bw = plane_bit_rate * scale_factor;
|
||||
|
||||
plane_prefill_bw = plane_bw * hw_latency_lines;
|
||||
|
||||
do_div(plane_prefill_bw, (vbp+vpw));
|
||||
|
||||
|
@@ -1665,13 +1665,6 @@ int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl)
|
||||
return rc;
|
||||
|
||||
while (--link_train_max_retries) {
|
||||
rc = dp_ctrl_reinitialize_mainlink(ctrl);
|
||||
if (rc) {
|
||||
DRM_ERROR("Failed to reinitialize mainlink. rc=%d\n",
|
||||
rc);
|
||||
break;
|
||||
}
|
||||
|
||||
training_step = DP_TRAINING_NONE;
|
||||
rc = dp_ctrl_setup_main_link(ctrl, &cr, &training_step);
|
||||
if (rc == 0) {
|
||||
@@ -1712,6 +1705,12 @@ int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl)
|
||||
break; /* lane == 1 already */
|
||||
}
|
||||
}
|
||||
|
||||
rc = dp_ctrl_reinitialize_mainlink(ctrl);
|
||||
if (rc) {
|
||||
DRM_ERROR("Failed to reinitialize mainlink. rc=%d\n", rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN)
|
||||
|
@@ -1075,9 +1075,21 @@ static void dsi_wait4video_done(struct msm_dsi_host *msm_host)
|
||||
|
||||
static void dsi_wait4video_eng_busy(struct msm_dsi_host *msm_host)
|
||||
{
|
||||
u32 data;
|
||||
|
||||
if (!(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO))
|
||||
return;
|
||||
|
||||
data = dsi_read(msm_host, REG_DSI_STATUS0);
|
||||
|
||||
/* if video mode engine is not busy, its because
|
||||
* either timing engine was not turned on or the
|
||||
* DSI controller has finished transmitting the video
|
||||
* data already, so no need to wait in those cases
|
||||
*/
|
||||
if (!(data & DSI_STATUS0_VIDEO_MODE_ENGINE_BUSY))
|
||||
return;
|
||||
|
||||
if (msm_host->power_on && msm_host->enabled) {
|
||||
dsi_wait4video_done(msm_host);
|
||||
/* delay 4 ms to skip BLLP */
|
||||
|
@@ -1627,7 +1627,7 @@ static int vmw_cmd_tex_state(struct vmw_private *dev_priv,
|
||||
{
|
||||
VMW_DECLARE_CMD_VAR(*cmd, SVGA3dCmdSetTextureState);
|
||||
SVGA3dTextureState *last_state = (SVGA3dTextureState *)
|
||||
((unsigned long) header + header->size + sizeof(header));
|
||||
((unsigned long) header + header->size + sizeof(*header));
|
||||
SVGA3dTextureState *cur_state = (SVGA3dTextureState *)
|
||||
((unsigned long) header + sizeof(*cmd));
|
||||
struct vmw_resource *ctx;
|
||||
|
@@ -130,6 +130,10 @@ static int holtek_kbd_input_event(struct input_dev *dev, unsigned int type,
|
||||
return -ENODEV;
|
||||
|
||||
boot_hid = usb_get_intfdata(boot_interface);
|
||||
if (list_empty(&boot_hid->inputs)) {
|
||||
hid_err(hid, "no inputs found\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
boot_hid_input = list_first_entry(&boot_hid->inputs,
|
||||
struct hid_input, list);
|
||||
|
||||
|
@@ -3936,7 +3936,8 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||
goto hid_hw_init_fail;
|
||||
}
|
||||
|
||||
hidpp_connect_event(hidpp);
|
||||
schedule_work(&hidpp->work);
|
||||
flush_work(&hidpp->work);
|
||||
|
||||
if (will_restart) {
|
||||
/* Reset the HID node state */
|
||||
|
@@ -2058,6 +2058,10 @@ static const struct hid_device_id mt_devices[] = {
|
||||
USB_DEVICE_ID_MTP_STM)},
|
||||
|
||||
/* Synaptics devices */
|
||||
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
|
||||
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
|
||||
USB_VENDOR_ID_SYNAPTICS, 0xcd7e) },
|
||||
|
||||
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
|
||||
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
|
||||
USB_VENDOR_ID_SYNAPTICS, 0xce08) },
|
||||
|
@@ -340,7 +340,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
|
||||
priv->adap.lock_ops = &i2c_parent_lock_ops;
|
||||
|
||||
/* Sanity check on class */
|
||||
if (i2c_mux_parent_classes(parent) & class)
|
||||
if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED)
|
||||
dev_err(&parent->dev,
|
||||
"Segment %d behind mux can't share classes with ancestors\n",
|
||||
chan_id);
|
||||
|
@@ -1112,7 +1112,7 @@ int bmp280_common_probe(struct device *dev,
|
||||
* however as it happens, the BMP085 shares the chip ID of BMP180
|
||||
* so we look for an IRQ if we have that.
|
||||
*/
|
||||
if (irq > 0 || (chip_id == BMP180_CHIP_ID)) {
|
||||
if (irq > 0 && (chip_id == BMP180_CHIP_ID)) {
|
||||
ret = bmp085_fetch_eoc_irq(dev, name, irq, data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@@ -57,8 +57,8 @@
|
||||
#define DPS310_RESET_MAGIC 0x09
|
||||
#define DPS310_COEF_BASE 0x10
|
||||
|
||||
/* Make sure sleep time is <= 20ms for usleep_range */
|
||||
#define DPS310_POLL_SLEEP_US(t) min(20000, (t) / 8)
|
||||
/* Make sure sleep time is <= 30ms for usleep_range */
|
||||
#define DPS310_POLL_SLEEP_US(t) min(30000, (t) / 8)
|
||||
/* Silently handle error in rate value here */
|
||||
#define DPS310_POLL_TIMEOUT_US(rc) ((rc) <= 0 ? 1000000 : 1000000 / (rc))
|
||||
|
||||
@@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/* Wait for device chip access: 2.5ms in specification */
|
||||
usleep_range(2500, 12000);
|
||||
/* Wait for device chip access: 15ms in specification */
|
||||
usleep_range(15000, 55000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -76,7 +76,7 @@ static bool ms5611_prom_is_valid(u16 *prom, size_t len)
|
||||
|
||||
crc = (crc >> 12) & 0x000F;
|
||||
|
||||
return crc_orig != 0x0000 && crc == crc_orig;
|
||||
return crc == crc_orig;
|
||||
}
|
||||
|
||||
static int ms5611_read_prom(struct iio_dev *indio_dev)
|
||||
|
@@ -1965,6 +1965,9 @@ static int send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid)
|
||||
int win;
|
||||
|
||||
skb = get_skb(NULL, sizeof(*req), GFP_KERNEL);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
req = __skb_put_zero(skb, sizeof(*req));
|
||||
req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR));
|
||||
req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
|
||||
|
@@ -965,67 +965,52 @@ static void srp_disconnect_target(struct srp_target_port *target)
|
||||
}
|
||||
}
|
||||
|
||||
static void srp_free_req_data(struct srp_target_port *target,
|
||||
struct srp_rdma_ch *ch)
|
||||
static int srp_exit_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
|
||||
{
|
||||
struct srp_target_port *target = host_to_target(shost);
|
||||
struct srp_device *dev = target->srp_host->srp_dev;
|
||||
struct ib_device *ibdev = dev->dev;
|
||||
struct srp_request *req;
|
||||
int i;
|
||||
struct srp_request *req = scsi_cmd_priv(cmd);
|
||||
|
||||
if (!ch->req_ring)
|
||||
return;
|
||||
|
||||
for (i = 0; i < target->req_ring_size; ++i) {
|
||||
req = &ch->req_ring[i];
|
||||
if (dev->use_fast_reg)
|
||||
kfree(req->fr_list);
|
||||
if (req->indirect_dma_addr) {
|
||||
ib_dma_unmap_single(ibdev, req->indirect_dma_addr,
|
||||
target->indirect_size,
|
||||
DMA_TO_DEVICE);
|
||||
}
|
||||
kfree(req->indirect_desc);
|
||||
kfree(req->fr_list);
|
||||
if (req->indirect_dma_addr) {
|
||||
ib_dma_unmap_single(ibdev, req->indirect_dma_addr,
|
||||
target->indirect_size,
|
||||
DMA_TO_DEVICE);
|
||||
}
|
||||
kfree(req->indirect_desc);
|
||||
|
||||
kfree(ch->req_ring);
|
||||
ch->req_ring = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int srp_alloc_req_data(struct srp_rdma_ch *ch)
|
||||
static int srp_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
|
||||
{
|
||||
struct srp_target_port *target = ch->target;
|
||||
struct srp_target_port *target = host_to_target(shost);
|
||||
struct srp_device *srp_dev = target->srp_host->srp_dev;
|
||||
struct ib_device *ibdev = srp_dev->dev;
|
||||
struct srp_request *req;
|
||||
struct srp_request *req = scsi_cmd_priv(cmd);
|
||||
dma_addr_t dma_addr;
|
||||
int i, ret = -ENOMEM;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
ch->req_ring = kcalloc(target->req_ring_size, sizeof(*ch->req_ring),
|
||||
GFP_KERNEL);
|
||||
if (!ch->req_ring)
|
||||
if (srp_dev->use_fast_reg) {
|
||||
req->fr_list = kmalloc_array(target->mr_per_cmd, sizeof(void *),
|
||||
GFP_KERNEL);
|
||||
if (!req->fr_list)
|
||||
goto out;
|
||||
}
|
||||
req->indirect_desc = kmalloc(target->indirect_size, GFP_KERNEL);
|
||||
if (!req->indirect_desc)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < target->req_ring_size; ++i) {
|
||||
req = &ch->req_ring[i];
|
||||
if (srp_dev->use_fast_reg) {
|
||||
req->fr_list = kmalloc_array(target->mr_per_cmd,
|
||||
sizeof(void *), GFP_KERNEL);
|
||||
if (!req->fr_list)
|
||||
goto out;
|
||||
}
|
||||
req->indirect_desc = kmalloc(target->indirect_size, GFP_KERNEL);
|
||||
if (!req->indirect_desc)
|
||||
goto out;
|
||||
|
||||
dma_addr = ib_dma_map_single(ibdev, req->indirect_desc,
|
||||
target->indirect_size,
|
||||
DMA_TO_DEVICE);
|
||||
if (ib_dma_mapping_error(ibdev, dma_addr))
|
||||
goto out;
|
||||
|
||||
req->indirect_dma_addr = dma_addr;
|
||||
dma_addr = ib_dma_map_single(ibdev, req->indirect_desc,
|
||||
target->indirect_size,
|
||||
DMA_TO_DEVICE);
|
||||
if (ib_dma_mapping_error(ibdev, dma_addr)) {
|
||||
srp_exit_cmd_priv(shost, cmd);
|
||||
goto out;
|
||||
}
|
||||
|
||||
req->indirect_dma_addr = dma_addr;
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
@@ -1067,10 +1052,6 @@ static void srp_remove_target(struct srp_target_port *target)
|
||||
}
|
||||
cancel_work_sync(&target->tl_err_work);
|
||||
srp_rport_put(target->rport);
|
||||
for (i = 0; i < target->ch_count; i++) {
|
||||
ch = &target->ch[i];
|
||||
srp_free_req_data(target, ch);
|
||||
}
|
||||
kfree(target->ch);
|
||||
target->ch = NULL;
|
||||
|
||||
@@ -1289,22 +1270,32 @@ static void srp_finish_req(struct srp_rdma_ch *ch, struct srp_request *req,
|
||||
}
|
||||
}
|
||||
|
||||
struct srp_terminate_context {
|
||||
struct srp_target_port *srp_target;
|
||||
int scsi_result;
|
||||
};
|
||||
|
||||
static bool srp_terminate_cmd(struct scsi_cmnd *scmnd, void *context_ptr,
|
||||
bool reserved)
|
||||
{
|
||||
struct srp_terminate_context *context = context_ptr;
|
||||
struct srp_target_port *target = context->srp_target;
|
||||
u32 tag = blk_mq_unique_tag(scmnd->request);
|
||||
struct srp_rdma_ch *ch = &target->ch[blk_mq_unique_tag_to_hwq(tag)];
|
||||
struct srp_request *req = scsi_cmd_priv(scmnd);
|
||||
|
||||
srp_finish_req(ch, req, NULL, context->scsi_result);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void srp_terminate_io(struct srp_rport *rport)
|
||||
{
|
||||
struct srp_target_port *target = rport->lld_data;
|
||||
struct srp_rdma_ch *ch;
|
||||
int i, j;
|
||||
struct srp_terminate_context context = { .srp_target = target,
|
||||
.scsi_result = DID_TRANSPORT_FAILFAST << 16 };
|
||||
|
||||
for (i = 0; i < target->ch_count; i++) {
|
||||
ch = &target->ch[i];
|
||||
|
||||
for (j = 0; j < target->req_ring_size; ++j) {
|
||||
struct srp_request *req = &ch->req_ring[j];
|
||||
|
||||
srp_finish_req(ch, req, NULL,
|
||||
DID_TRANSPORT_FAILFAST << 16);
|
||||
}
|
||||
}
|
||||
scsi_host_busy_iter(target->scsi_host, srp_terminate_cmd, &context);
|
||||
}
|
||||
|
||||
/* Calculate maximum initiator to target information unit length. */
|
||||
@@ -1360,13 +1351,12 @@ static int srp_rport_reconnect(struct srp_rport *rport)
|
||||
ch = &target->ch[i];
|
||||
ret += srp_new_cm_id(ch);
|
||||
}
|
||||
for (i = 0; i < target->ch_count; i++) {
|
||||
ch = &target->ch[i];
|
||||
for (j = 0; j < target->req_ring_size; ++j) {
|
||||
struct srp_request *req = &ch->req_ring[j];
|
||||
{
|
||||
struct srp_terminate_context context = {
|
||||
.srp_target = target, .scsi_result = DID_RESET << 16};
|
||||
|
||||
srp_finish_req(ch, req, NULL, DID_RESET << 16);
|
||||
}
|
||||
scsi_host_busy_iter(target->scsi_host, srp_terminate_cmd,
|
||||
&context);
|
||||
}
|
||||
for (i = 0; i < target->ch_count; i++) {
|
||||
ch = &target->ch[i];
|
||||
@@ -1962,11 +1952,9 @@ static void srp_process_rsp(struct srp_rdma_ch *ch, struct srp_rsp *rsp)
|
||||
spin_unlock_irqrestore(&ch->lock, flags);
|
||||
} else {
|
||||
scmnd = scsi_host_find_tag(target->scsi_host, rsp->tag);
|
||||
if (scmnd && scmnd->host_scribble) {
|
||||
req = (void *)scmnd->host_scribble;
|
||||
if (scmnd) {
|
||||
req = scsi_cmd_priv(scmnd);
|
||||
scmnd = srp_claim_req(ch, req, NULL, scmnd);
|
||||
} else {
|
||||
scmnd = NULL;
|
||||
}
|
||||
if (!scmnd) {
|
||||
shost_printk(KERN_ERR, target->scsi_host,
|
||||
@@ -1996,7 +1984,6 @@ static void srp_process_rsp(struct srp_rdma_ch *ch, struct srp_rsp *rsp)
|
||||
srp_free_req(ch, req, scmnd,
|
||||
be32_to_cpu(rsp->req_lim_delta));
|
||||
|
||||
scmnd->host_scribble = NULL;
|
||||
scmnd->scsi_done(scmnd);
|
||||
}
|
||||
}
|
||||
@@ -2164,13 +2151,12 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
|
||||
{
|
||||
struct srp_target_port *target = host_to_target(shost);
|
||||
struct srp_rdma_ch *ch;
|
||||
struct srp_request *req;
|
||||
struct srp_request *req = scsi_cmd_priv(scmnd);
|
||||
struct srp_iu *iu;
|
||||
struct srp_cmd *cmd;
|
||||
struct ib_device *dev;
|
||||
unsigned long flags;
|
||||
u32 tag;
|
||||
u16 idx;
|
||||
int len, ret;
|
||||
|
||||
scmnd->result = srp_chkready(target->rport);
|
||||
@@ -2180,10 +2166,6 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
|
||||
WARN_ON_ONCE(scmnd->request->tag < 0);
|
||||
tag = blk_mq_unique_tag(scmnd->request);
|
||||
ch = &target->ch[blk_mq_unique_tag_to_hwq(tag)];
|
||||
idx = blk_mq_unique_tag_to_tag(tag);
|
||||
WARN_ONCE(idx >= target->req_ring_size, "%s: tag %#x: idx %d >= %d\n",
|
||||
dev_name(&shost->shost_gendev), tag, idx,
|
||||
target->req_ring_size);
|
||||
|
||||
spin_lock_irqsave(&ch->lock, flags);
|
||||
iu = __srp_get_tx_iu(ch, SRP_IU_CMD);
|
||||
@@ -2192,13 +2174,10 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
|
||||
if (!iu)
|
||||
goto err;
|
||||
|
||||
req = &ch->req_ring[idx];
|
||||
dev = target->srp_host->srp_dev->dev;
|
||||
ib_dma_sync_single_for_cpu(dev, iu->dma, ch->max_it_iu_len,
|
||||
DMA_TO_DEVICE);
|
||||
|
||||
scmnd->host_scribble = (void *) req;
|
||||
|
||||
cmd = iu->buf;
|
||||
memset(cmd, 0, sizeof *cmd);
|
||||
|
||||
@@ -2799,16 +2778,13 @@ static int srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag, u64 lun,
|
||||
static int srp_abort(struct scsi_cmnd *scmnd)
|
||||
{
|
||||
struct srp_target_port *target = host_to_target(scmnd->device->host);
|
||||
struct srp_request *req = (struct srp_request *) scmnd->host_scribble;
|
||||
struct srp_request *req = scsi_cmd_priv(scmnd);
|
||||
u32 tag;
|
||||
u16 ch_idx;
|
||||
struct srp_rdma_ch *ch;
|
||||
int ret;
|
||||
|
||||
shost_printk(KERN_ERR, target->scsi_host, "SRP abort called\n");
|
||||
|
||||
if (!req)
|
||||
return SUCCESS;
|
||||
tag = blk_mq_unique_tag(scmnd->request);
|
||||
ch_idx = blk_mq_unique_tag_to_hwq(tag);
|
||||
if (WARN_ON_ONCE(ch_idx >= target->ch_count))
|
||||
@@ -2819,19 +2795,14 @@ static int srp_abort(struct scsi_cmnd *scmnd)
|
||||
shost_printk(KERN_ERR, target->scsi_host,
|
||||
"Sending SRP abort for tag %#x\n", tag);
|
||||
if (srp_send_tsk_mgmt(ch, tag, scmnd->device->lun,
|
||||
SRP_TSK_ABORT_TASK, NULL) == 0)
|
||||
ret = SUCCESS;
|
||||
else if (target->rport->state == SRP_RPORT_LOST)
|
||||
ret = FAST_IO_FAIL;
|
||||
else
|
||||
ret = FAILED;
|
||||
if (ret == SUCCESS) {
|
||||
SRP_TSK_ABORT_TASK, NULL) == 0) {
|
||||
srp_free_req(ch, req, scmnd, 0);
|
||||
scmnd->result = DID_ABORT << 16;
|
||||
scmnd->scsi_done(scmnd);
|
||||
return SUCCESS;
|
||||
}
|
||||
if (target->rport->state == SRP_RPORT_LOST)
|
||||
return FAST_IO_FAIL;
|
||||
|
||||
return ret;
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
static int srp_reset_device(struct scsi_cmnd *scmnd)
|
||||
@@ -3075,6 +3046,8 @@ static struct scsi_host_template srp_template = {
|
||||
.target_alloc = srp_target_alloc,
|
||||
.slave_configure = srp_slave_configure,
|
||||
.info = srp_target_info,
|
||||
.init_cmd_priv = srp_init_cmd_priv,
|
||||
.exit_cmd_priv = srp_exit_cmd_priv,
|
||||
.queuecommand = srp_queuecommand,
|
||||
.change_queue_depth = srp_change_queue_depth,
|
||||
.eh_timed_out = srp_timed_out,
|
||||
@@ -3088,6 +3061,7 @@ static struct scsi_host_template srp_template = {
|
||||
.cmd_per_lun = SRP_DEFAULT_CMD_SQ_SIZE,
|
||||
.shost_attrs = srp_host_attrs,
|
||||
.track_queue_depth = 1,
|
||||
.cmd_size = sizeof(struct srp_request),
|
||||
};
|
||||
|
||||
static int srp_sdev_count(struct Scsi_Host *host)
|
||||
@@ -3735,8 +3709,6 @@ static ssize_t srp_create_target(struct device *dev,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
target->req_ring_size = target->queue_size - SRP_TSK_MGMT_SQ_SIZE;
|
||||
|
||||
if (!srp_conn_unique(target->srp_host, target)) {
|
||||
if (target->using_rdma_cm) {
|
||||
shost_printk(KERN_INFO, target->scsi_host,
|
||||
@@ -3839,10 +3811,6 @@ static ssize_t srp_create_target(struct device *dev,
|
||||
if (ret)
|
||||
goto err_disconnect;
|
||||
|
||||
ret = srp_alloc_req_data(ch);
|
||||
if (ret)
|
||||
goto err_disconnect;
|
||||
|
||||
ret = srp_connect_ch(ch, max_iu_len, multich);
|
||||
if (ret) {
|
||||
char dst[64];
|
||||
@@ -3861,7 +3829,6 @@ static ssize_t srp_create_target(struct device *dev,
|
||||
goto free_ch;
|
||||
} else {
|
||||
srp_free_ch_ib(target, ch);
|
||||
srp_free_req_data(target, ch);
|
||||
target->ch_count = ch - target->ch;
|
||||
goto connected;
|
||||
}
|
||||
@@ -3922,7 +3889,6 @@ free_ch:
|
||||
for (i = 0; i < target->ch_count; i++) {
|
||||
ch = &target->ch[i];
|
||||
srp_free_ch_ib(target, ch);
|
||||
srp_free_req_data(target, ch);
|
||||
}
|
||||
|
||||
kfree(target->ch);
|
||||
|
@@ -176,7 +176,6 @@ struct srp_rdma_ch {
|
||||
|
||||
struct srp_iu **tx_ring;
|
||||
struct srp_iu **rx_ring;
|
||||
struct srp_request *req_ring;
|
||||
int comp_vector;
|
||||
|
||||
u64 tsk_mgmt_tag;
|
||||
@@ -222,7 +221,6 @@ struct srp_target_port {
|
||||
int mr_pool_size;
|
||||
int mr_per_cmd;
|
||||
int queue_size;
|
||||
int req_ring_size;
|
||||
int comp_vector;
|
||||
int tl_retry_count;
|
||||
|
||||
|
@@ -252,6 +252,7 @@ static const struct xpad_device {
|
||||
{ 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
|
||||
{ 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
|
||||
{ 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
|
||||
{ 0x11ff, 0x0511, "PXN V900", 0, XTYPE_XBOX360 },
|
||||
{ 0x1209, 0x2882, "Ardwiino Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
|
||||
@@ -446,6 +447,7 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
|
||||
XPAD_XBOX360_VENDOR(0x11ff), /* PXN V900 */
|
||||
XPAD_XBOX360_VENDOR(0x1209), /* Ardwiino Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
|
||||
XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
|
||||
|
@@ -425,6 +425,7 @@ static void powermate_disconnect(struct usb_interface *intf)
|
||||
pm->requires_update = 0;
|
||||
usb_kill_urb(pm->irq);
|
||||
input_unregister_device(pm->input);
|
||||
usb_kill_urb(pm->config);
|
||||
usb_free_urb(pm->irq);
|
||||
usb_free_urb(pm->config);
|
||||
powermate_free_buffers(interface_to_usbdev(intf), pm);
|
||||
|
@@ -2112,6 +2112,7 @@ static int elantech_setup_ps2(struct psmouse *psmouse,
|
||||
psmouse->protocol_handler = elantech_process_byte;
|
||||
psmouse->disconnect = elantech_disconnect;
|
||||
psmouse->reconnect = elantech_reconnect;
|
||||
psmouse->fast_reconnect = NULL;
|
||||
psmouse->pktsize = info->hw_version > 1 ? 6 : 4;
|
||||
|
||||
return 0;
|
||||
|
@@ -1619,6 +1619,7 @@ static int synaptics_init_ps2(struct psmouse *psmouse,
|
||||
psmouse->set_rate = synaptics_set_rate;
|
||||
psmouse->disconnect = synaptics_disconnect;
|
||||
psmouse->reconnect = synaptics_reconnect;
|
||||
psmouse->fast_reconnect = NULL;
|
||||
psmouse->cleanup = synaptics_reset;
|
||||
/* Synaptics can usually stay in sync without extra help */
|
||||
psmouse->resync_time = 0;
|
||||
|
@@ -609,6 +609,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX)
|
||||
},
|
||||
{
|
||||
/* Fujitsu Lifebook E5411 */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU CLIENT COMPUTING LIMITED"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
|
||||
},
|
||||
{
|
||||
/* Gigabyte M912 */
|
||||
.matches = {
|
||||
|
@@ -820,6 +820,25 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
|
||||
dev_info(dev, "No ACPI GpioInt resource, assuming that the GPIO order is reset, int\n");
|
||||
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
|
||||
gpio_mapping = acpi_goodix_int_last_gpios;
|
||||
} else if (ts->gpio_count == 1 && ts->gpio_int_idx == 0) {
|
||||
/*
|
||||
* On newer devices there is only 1 GpioInt resource and _PS0
|
||||
* does the whole reset sequence for us.
|
||||
*/
|
||||
acpi_device_fix_up_power(ACPI_COMPANION(dev));
|
||||
|
||||
/*
|
||||
* Before the _PS0 call the int GPIO may have been in output
|
||||
* mode and the call should have put the int GPIO in input mode,
|
||||
* but the GPIO subsys cached state may still think it is
|
||||
* in output mode, causing gpiochip_lock_as_irq() failure.
|
||||
*
|
||||
* Add a mapping for the int GPIO to make the
|
||||
* gpiod_int = gpiod_get(..., GPIOD_IN) call succeed,
|
||||
* which will explicitly set the direction to input.
|
||||
*/
|
||||
ts->irq_pin_access_method = IRQ_PIN_ACCESS_NONE;
|
||||
gpio_mapping = acpi_goodix_int_first_gpios;
|
||||
} else {
|
||||
dev_warn(dev, "Unexpected ACPI resources: gpio_count %d, gpio_int_idx %d\n",
|
||||
ts->gpio_count, ts->gpio_int_idx);
|
||||
|
@@ -389,17 +389,13 @@ EXPORT_SYMBOL_NS_GPL(mcb_free_dev, MCB);
|
||||
|
||||
static int __mcb_bus_add_devices(struct device *dev, void *data)
|
||||
{
|
||||
struct mcb_device *mdev = to_mcb_device(dev);
|
||||
int retval;
|
||||
|
||||
if (mdev->is_added)
|
||||
return 0;
|
||||
|
||||
retval = device_attach(dev);
|
||||
if (retval < 0)
|
||||
if (retval < 0) {
|
||||
dev_err(dev, "Error adding device (%d)\n", retval);
|
||||
|
||||
mdev->is_added = true;
|
||||
return retval;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -99,8 +99,6 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
|
||||
mdev->mem.end = mdev->mem.start + size - 1;
|
||||
mdev->mem.flags = IORESOURCE_MEM;
|
||||
|
||||
mdev->is_added = false;
|
||||
|
||||
ret = mcb_device_register(bus, mdev);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
@@ -1455,6 +1455,7 @@ static int mtk_jpeg_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mtk_jpeg_dev *jpeg = platform_get_drvdata(pdev);
|
||||
|
||||
cancel_delayed_work_sync(&jpeg->job_timeout_work);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
video_unregister_device(jpeg->vdev);
|
||||
video_device_release(jpeg->vdev);
|
||||
|
@@ -95,7 +95,7 @@ static int mmc_decode_cid(struct mmc_card *card)
|
||||
case 3: /* MMC v3.1 - v3.3 */
|
||||
case 4: /* MMC v4 */
|
||||
card->cid.manfid = UNSTUFF_BITS(resp, 120, 8);
|
||||
card->cid.oemid = UNSTUFF_BITS(resp, 104, 16);
|
||||
card->cid.oemid = UNSTUFF_BITS(resp, 104, 8);
|
||||
card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8);
|
||||
card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8);
|
||||
card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8);
|
||||
|
@@ -1075,8 +1075,14 @@ static int mmc_sdio_resume(struct mmc_host *host)
|
||||
}
|
||||
err = mmc_sdio_reinit_card(host);
|
||||
} else if (mmc_card_wake_sdio_irq(host)) {
|
||||
/* We may have switched to 1-bit mode during suspend */
|
||||
/*
|
||||
* We may have switched to 1-bit mode during suspend,
|
||||
* need to hold retuning, because tuning only supprt
|
||||
* 4-bit mode or 8 bit mode.
|
||||
*/
|
||||
mmc_retune_hold_now(host);
|
||||
err = sdio_enable_4bit_bus(host->card);
|
||||
mmc_retune_release(host);
|
||||
}
|
||||
|
||||
if (err)
|
||||
|
@@ -556,6 +556,17 @@ static int physmap_flash_probe(struct platform_device *dev)
|
||||
if (info->probe_type) {
|
||||
info->mtds[i] = do_map_probe(info->probe_type,
|
||||
&info->maps[i]);
|
||||
|
||||
/* Fall back to mapping region as ROM */
|
||||
if (!info->mtds[i] && IS_ENABLED(CONFIG_MTD_ROM) &&
|
||||
strcmp(info->probe_type, "map_rom")) {
|
||||
dev_warn(&dev->dev,
|
||||
"map_probe() failed for type %s\n",
|
||||
info->probe_type);
|
||||
|
||||
info->mtds[i] = do_map_probe("map_rom",
|
||||
&info->maps[i]);
|
||||
}
|
||||
} else {
|
||||
int j;
|
||||
|
||||
|
@@ -451,6 +451,7 @@ static int anfc_write_page_hw_ecc(struct nand_chip *chip, const u8 *buf,
|
||||
struct mtd_info *mtd = nand_to_mtd(chip);
|
||||
unsigned int len = mtd->writesize + (oob_required ? mtd->oobsize : 0);
|
||||
dma_addr_t dma_addr;
|
||||
u8 status;
|
||||
int ret;
|
||||
struct anfc_op nfc_op = {
|
||||
.pkt_reg =
|
||||
@@ -497,10 +498,21 @@ static int anfc_write_page_hw_ecc(struct nand_chip *chip, const u8 *buf,
|
||||
}
|
||||
|
||||
/* Spare data is not protected */
|
||||
if (oob_required)
|
||||
if (oob_required) {
|
||||
ret = nand_write_oob_std(chip, page);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
/* Check write status on the chip side */
|
||||
ret = nand_status_op(chip, &status);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (status & NAND_STATUS_FAIL)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int anfc_sel_write_page_hw_ecc(struct nand_chip *chip, const u8 *buf,
|
||||
|
@@ -1148,6 +1148,7 @@ static int marvell_nfc_hw_ecc_hmg_do_write_page(struct nand_chip *chip,
|
||||
.ndcb[2] = NDCB2_ADDR5_PAGE(page),
|
||||
};
|
||||
unsigned int oob_bytes = lt->spare_bytes + (raw ? lt->ecc_bytes : 0);
|
||||
u8 status;
|
||||
int ret;
|
||||
|
||||
/* NFCv2 needs more information about the operation being executed */
|
||||
@@ -1181,7 +1182,18 @@ static int marvell_nfc_hw_ecc_hmg_do_write_page(struct nand_chip *chip,
|
||||
|
||||
ret = marvell_nfc_wait_op(chip,
|
||||
PSEC_TO_MSEC(sdr->tPROG_max));
|
||||
return ret;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Check write status on the chip side */
|
||||
ret = nand_status_op(chip, &status);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (status & NAND_STATUS_FAIL)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int marvell_nfc_hw_ecc_hmg_write_page_raw(struct nand_chip *chip,
|
||||
@@ -1610,6 +1622,7 @@ static int marvell_nfc_hw_ecc_bch_write_page(struct nand_chip *chip,
|
||||
int data_len = lt->data_bytes;
|
||||
int spare_len = lt->spare_bytes;
|
||||
int chunk, ret;
|
||||
u8 status;
|
||||
|
||||
marvell_nfc_select_target(chip, chip->cur_cs);
|
||||
|
||||
@@ -1646,6 +1659,14 @@ static int marvell_nfc_hw_ecc_bch_write_page(struct nand_chip *chip,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Check write status on the chip side */
|
||||
ret = nand_status_op(chip, &status);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (status & NAND_STATUS_FAIL)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -2996,7 +2996,7 @@ err_nandc_alloc:
|
||||
err_aon_clk:
|
||||
clk_disable_unprepare(nandc->core_clk);
|
||||
err_core_clk:
|
||||
dma_unmap_resource(dev, res->start, resource_size(res),
|
||||
dma_unmap_resource(dev, nandc->base_dma, resource_size(res),
|
||||
DMA_BIDIRECTIONAL, 0);
|
||||
return ret;
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
|
||||
#define SPINAND_MFR_MICRON 0x2c
|
||||
|
||||
#define MICRON_STATUS_ECC_MASK GENMASK(7, 4)
|
||||
#define MICRON_STATUS_ECC_MASK GENMASK(6, 4)
|
||||
#define MICRON_STATUS_ECC_NO_BITFLIPS (0 << 4)
|
||||
#define MICRON_STATUS_ECC_1TO3_BITFLIPS (1 << 4)
|
||||
#define MICRON_STATUS_ECC_4TO6_BITFLIPS (3 << 4)
|
||||
|
@@ -497,17 +497,16 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
|
||||
dn = of_find_compatible_node(NULL, NULL, "brcm,unimac-mdio");
|
||||
priv->master_mii_bus = of_mdio_find_bus(dn);
|
||||
if (!priv->master_mii_bus) {
|
||||
of_node_put(dn);
|
||||
return -EPROBE_DEFER;
|
||||
err = -EPROBE_DEFER;
|
||||
goto err_of_node_put;
|
||||
}
|
||||
|
||||
get_device(&priv->master_mii_bus->dev);
|
||||
priv->master_mii_dn = dn;
|
||||
|
||||
priv->slave_mii_bus = mdiobus_alloc();
|
||||
if (!priv->slave_mii_bus) {
|
||||
of_node_put(dn);
|
||||
return -ENOMEM;
|
||||
err = -ENOMEM;
|
||||
goto err_put_master_mii_bus_dev;
|
||||
}
|
||||
|
||||
priv->slave_mii_bus->priv = priv;
|
||||
@@ -564,11 +563,17 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
|
||||
}
|
||||
|
||||
err = mdiobus_register(priv->slave_mii_bus);
|
||||
if (err && dn) {
|
||||
mdiobus_free(priv->slave_mii_bus);
|
||||
of_node_put(dn);
|
||||
}
|
||||
if (err && dn)
|
||||
goto err_free_slave_mii_bus;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_slave_mii_bus:
|
||||
mdiobus_free(priv->slave_mii_bus);
|
||||
err_put_master_mii_bus_dev:
|
||||
put_device(&priv->master_mii_bus->dev);
|
||||
err_of_node_put:
|
||||
of_node_put(dn);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -576,6 +581,7 @@ static void bcm_sf2_mdio_unregister(struct bcm_sf2_priv *priv)
|
||||
{
|
||||
mdiobus_unregister(priv->slave_mii_bus);
|
||||
mdiobus_free(priv->slave_mii_bus);
|
||||
put_device(&priv->master_mii_bus->dev);
|
||||
of_node_put(priv->master_mii_dn);
|
||||
}
|
||||
|
||||
|
@@ -1339,7 +1339,7 @@ void i40e_clear_hw(struct i40e_hw *hw)
|
||||
I40E_PFLAN_QALLOC_FIRSTQ_SHIFT;
|
||||
j = (val & I40E_PFLAN_QALLOC_LASTQ_MASK) >>
|
||||
I40E_PFLAN_QALLOC_LASTQ_SHIFT;
|
||||
if (val & I40E_PFLAN_QALLOC_VALID_MASK)
|
||||
if (val & I40E_PFLAN_QALLOC_VALID_MASK && j >= base_queue)
|
||||
num_queues = (j - base_queue) + 1;
|
||||
else
|
||||
num_queues = 0;
|
||||
@@ -1349,7 +1349,7 @@ void i40e_clear_hw(struct i40e_hw *hw)
|
||||
I40E_PF_VT_PFALLOC_FIRSTVF_SHIFT;
|
||||
j = (val & I40E_PF_VT_PFALLOC_LASTVF_MASK) >>
|
||||
I40E_PF_VT_PFALLOC_LASTVF_SHIFT;
|
||||
if (val & I40E_PF_VT_PFALLOC_VALID_MASK)
|
||||
if (val & I40E_PF_VT_PFALLOC_VALID_MASK && j >= i)
|
||||
num_vfs = (j - i) + 1;
|
||||
else
|
||||
num_vfs = 0;
|
||||
|
@@ -931,8 +931,7 @@ static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)
|
||||
|
||||
ctxt->info.q_opt_rss = ((lut_type << ICE_AQ_VSI_Q_OPT_RSS_LUT_S) &
|
||||
ICE_AQ_VSI_Q_OPT_RSS_LUT_M) |
|
||||
((hash_type << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) &
|
||||
ICE_AQ_VSI_Q_OPT_RSS_HASH_M);
|
||||
(hash_type & ICE_AQ_VSI_Q_OPT_RSS_HASH_M);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#include <generated/utsrelease.h>
|
||||
#include <linux/crash_dump.h>
|
||||
#include "ice.h"
|
||||
#include "ice_base.h"
|
||||
#include "ice_lib.h"
|
||||
@@ -4025,6 +4026,20 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* when under a kdump kernel initiate a reset before enabling the
|
||||
* device in order to clear out any pending DMA transactions. These
|
||||
* transactions can cause some systems to machine check when doing
|
||||
* the pcim_enable_device() below.
|
||||
*/
|
||||
if (is_kdump_kernel()) {
|
||||
pci_save_state(pdev);
|
||||
pci_clear_master(pdev);
|
||||
err = pcie_flr(pdev);
|
||||
if (err)
|
||||
return err;
|
||||
pci_restore_state(pdev);
|
||||
}
|
||||
|
||||
/* this driver uses devres, see
|
||||
* Documentation/driver-api/driver-model/devres.rst
|
||||
*/
|
||||
|
@@ -28,6 +28,9 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter,
|
||||
struct vf_macvlans *mv_list;
|
||||
int num_vf_macvlans, i;
|
||||
|
||||
/* Initialize list of VF macvlans */
|
||||
INIT_LIST_HEAD(&adapter->vf_mvs.l);
|
||||
|
||||
num_vf_macvlans = hw->mac.num_rar_entries -
|
||||
(IXGBE_MAX_PF_MACVLANS + 1 + num_vfs);
|
||||
if (!num_vf_macvlans)
|
||||
@@ -36,8 +39,6 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter,
|
||||
mv_list = kcalloc(num_vf_macvlans, sizeof(struct vf_macvlans),
|
||||
GFP_KERNEL);
|
||||
if (mv_list) {
|
||||
/* Initialize list of VF macvlans */
|
||||
INIT_LIST_HEAD(&adapter->vf_mvs.l);
|
||||
for (i = 0; i < num_vf_macvlans; i++) {
|
||||
mv_list[i].vf = -1;
|
||||
mv_list[i].free = true;
|
||||
|
@@ -2195,7 +2195,7 @@ struct rx_ring_info {
|
||||
struct sk_buff *skb;
|
||||
dma_addr_t data_addr;
|
||||
DEFINE_DMA_UNMAP_LEN(data_size);
|
||||
dma_addr_t frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT];
|
||||
dma_addr_t frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT ?: 1];
|
||||
};
|
||||
|
||||
enum flow_control {
|
||||
|
@@ -821,7 +821,7 @@ static void mlx5_fw_tracer_ownership_change(struct work_struct *work)
|
||||
|
||||
mlx5_core_dbg(tracer->dev, "FWTracer: ownership changed, current=(%d)\n", tracer->owner);
|
||||
if (tracer->owner) {
|
||||
tracer->owner = false;
|
||||
mlx5_fw_tracer_ownership_acquire(tracer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -294,8 +294,8 @@ const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = {
|
||||
.fdb_clear_offload = mlxsw_sp_nve_vxlan_clear_offload,
|
||||
};
|
||||
|
||||
static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
|
||||
bool learning_en)
|
||||
static int mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
|
||||
bool learning_en)
|
||||
{
|
||||
char tnpc_pl[MLXSW_REG_TNPC_LEN];
|
||||
|
||||
|
@@ -87,7 +87,10 @@ static void qed_ll2b_complete_tx_packet(void *cxt,
|
||||
static int qed_ll2_alloc_buffer(struct qed_dev *cdev,
|
||||
u8 **data, dma_addr_t *phys_addr)
|
||||
{
|
||||
*data = kmalloc(cdev->ll2->rx_size, GFP_ATOMIC);
|
||||
size_t size = cdev->ll2->rx_size + NET_SKB_PAD +
|
||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||
|
||||
*data = kmalloc(size, GFP_ATOMIC);
|
||||
if (!(*data)) {
|
||||
DP_INFO(cdev, "Failed to allocate LL2 buffer data\n");
|
||||
return -ENOMEM;
|
||||
@@ -2541,7 +2544,7 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
|
||||
INIT_LIST_HEAD(&cdev->ll2->list);
|
||||
spin_lock_init(&cdev->ll2->lock);
|
||||
|
||||
cdev->ll2->rx_size = NET_SKB_PAD + ETH_HLEN +
|
||||
cdev->ll2->rx_size = PRM_DMA_PAD_BYTES_NUM + ETH_HLEN +
|
||||
L1_CACHE_BYTES + params->mtu;
|
||||
|
||||
/* Allocate memory for LL2.
|
||||
|
@@ -1706,6 +1706,8 @@ static int ravb_close(struct net_device *ndev)
|
||||
of_phy_deregister_fixed_link(np);
|
||||
}
|
||||
|
||||
cancel_work_sync(&priv->work);
|
||||
|
||||
if (priv->chip_id != RCAR_GEN2) {
|
||||
free_irq(priv->tx_irqs[RAVB_NC], ndev);
|
||||
free_irq(priv->rx_irqs[RAVB_NC], ndev);
|
||||
@@ -2249,14 +2251,14 @@ static int ravb_remove(struct platform_device *pdev)
|
||||
if (priv->chip_id != RCAR_GEN2)
|
||||
ravb_ptp_stop(ndev);
|
||||
|
||||
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);
|
||||
unregister_netdev(ndev);
|
||||
netif_napi_del(&priv->napi[RAVB_NC]);
|
||||
netif_napi_del(&priv->napi[RAVB_BE]);
|
||||
ravb_mdio_release(priv);
|
||||
dma_free_coherent(ndev->dev.parent, priv->desc_bat_size, priv->desc_bat,
|
||||
priv->desc_bat_dma);
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
free_netdev(ndev);
|
||||
|
@@ -2783,7 +2783,6 @@ static int ca8210_register_ext_clock(struct spi_device *spi)
|
||||
struct device_node *np = spi->dev.of_node;
|
||||
struct ca8210_priv *priv = spi_get_drvdata(spi);
|
||||
struct ca8210_platform_data *pdata = spi->dev.platform_data;
|
||||
int ret = 0;
|
||||
|
||||
if (!np)
|
||||
return -EFAULT;
|
||||
@@ -2800,18 +2799,8 @@ static int ca8210_register_ext_clock(struct spi_device *spi)
|
||||
dev_crit(&spi->dev, "Failed to register external clk\n");
|
||||
return PTR_ERR(priv->clk);
|
||||
}
|
||||
ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
|
||||
if (ret) {
|
||||
clk_unregister(priv->clk);
|
||||
dev_crit(
|
||||
&spi->dev,
|
||||
"Failed to register external clock as clock provider\n"
|
||||
);
|
||||
} else {
|
||||
dev_info(&spi->dev, "External clock set as clock provider\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
return of_clk_add_provider(np, of_clk_src_simple_get, priv->clk);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2823,8 +2812,8 @@ static void ca8210_unregister_ext_clock(struct spi_device *spi)
|
||||
{
|
||||
struct ca8210_priv *priv = spi_get_drvdata(spi);
|
||||
|
||||
if (!priv->clk)
|
||||
return
|
||||
if (IS_ERR_OR_NULL(priv->clk))
|
||||
return;
|
||||
|
||||
of_clk_del_provider(spi->dev.of_node);
|
||||
clk_unregister(priv->clk);
|
||||
|
@@ -2375,6 +2375,7 @@ static int macsec_upd_txsa(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
ctx.sa.assoc_num = assoc_num;
|
||||
ctx.sa.tx_sa = tx_sa;
|
||||
ctx.sa.update_pn = !!prev_pn.full64;
|
||||
ctx.secy = secy;
|
||||
|
||||
ret = macsec_offload(ops->mdo_upd_txsa, &ctx);
|
||||
@@ -2468,6 +2469,7 @@ static int macsec_upd_rxsa(struct sk_buff *skb, struct genl_info *info)
|
||||
|
||||
ctx.sa.assoc_num = assoc_num;
|
||||
ctx.sa.rx_sa = rx_sa;
|
||||
ctx.sa.update_pn = !!prev_pn.full64;
|
||||
ctx.secy = secy;
|
||||
|
||||
ret = macsec_offload(ops->mdo_upd_rxsa, &ctx);
|
||||
|
@@ -880,6 +880,9 @@ static int vsc8584_macsec_upd_rxsa(struct macsec_context *ctx)
|
||||
{
|
||||
struct macsec_flow *flow;
|
||||
|
||||
if (ctx->sa.update_pn)
|
||||
return -EINVAL;
|
||||
|
||||
flow = vsc8584_macsec_find_flow(ctx, MACSEC_INGR);
|
||||
if (IS_ERR(flow))
|
||||
return PTR_ERR(flow);
|
||||
@@ -929,6 +932,9 @@ static int vsc8584_macsec_upd_txsa(struct macsec_context *ctx)
|
||||
{
|
||||
struct macsec_flow *flow;
|
||||
|
||||
if (ctx->sa.update_pn)
|
||||
return -EINVAL;
|
||||
|
||||
flow = vsc8584_macsec_find_flow(ctx, MACSEC_EGR);
|
||||
if (IS_ERR(flow))
|
||||
return PTR_ERR(flow);
|
||||
|
@@ -3064,10 +3064,11 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
|
||||
struct net *net = sock_net(&tfile->sk);
|
||||
struct tun_struct *tun;
|
||||
void __user* argp = (void __user*)arg;
|
||||
unsigned int ifindex, carrier;
|
||||
unsigned int carrier;
|
||||
struct ifreq ifr;
|
||||
kuid_t owner;
|
||||
kgid_t group;
|
||||
int ifindex;
|
||||
int sndbuf;
|
||||
int vnet_hdr_sz;
|
||||
int le;
|
||||
@@ -3124,7 +3125,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
|
||||
ret = -EFAULT;
|
||||
if (copy_from_user(&ifindex, argp, sizeof(ifindex)))
|
||||
goto unlock;
|
||||
|
||||
ret = -EINVAL;
|
||||
if (ifindex < 0)
|
||||
goto unlock;
|
||||
ret = 0;
|
||||
tfile->ifindex = ifindex;
|
||||
goto unlock;
|
||||
|
@@ -221,13 +221,18 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
|
||||
struct usbnet *dev = netdev_priv(netdev);
|
||||
|
||||
__le16 res;
|
||||
int err;
|
||||
|
||||
if (phy_id) {
|
||||
netdev_dbg(dev->net, "Only internal phy supported\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
dm_read_shared_word(dev, 1, loc, &res);
|
||||
err = dm_read_shared_word(dev, 1, loc, &res);
|
||||
if (err < 0) {
|
||||
netdev_err(dev->net, "MDIO read error: %d\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
netdev_dbg(dev->net,
|
||||
"dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
|
||||
|
@@ -863,7 +863,7 @@ static int smsc95xx_reset(struct usbnet *dev)
|
||||
|
||||
if (timeout >= 100) {
|
||||
netdev_warn(dev->net, "timeout waiting for completion of Lite Reset\n");
|
||||
return ret;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
ret = smsc95xx_write_reg(dev, PM_CTRL, PM_CTL_PHY_RST_);
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#include <asm/xen/hypercall.h>
|
||||
#include <xen/balloon.h>
|
||||
|
||||
#define XENVIF_QUEUE_LENGTH 32
|
||||
#define XENVIF_NAPI_WEIGHT 64
|
||||
|
||||
/* Number of bytes allowed on the internal guest Rx queue. */
|
||||
@@ -528,8 +527,6 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
|
||||
dev->features = dev->hw_features | NETIF_F_RXCSUM;
|
||||
dev->ethtool_ops = &xenvif_ethtool_ops;
|
||||
|
||||
dev->tx_queue_len = XENVIF_QUEUE_LENGTH;
|
||||
|
||||
dev->min_mtu = ETH_MIN_MTU;
|
||||
dev->max_mtu = ETH_MAX_MTU - VLAN_ETH_HLEN;
|
||||
|
||||
|
@@ -3181,7 +3181,8 @@ static const struct pci_device_id nvme_id_table[] = {
|
||||
{ PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */
|
||||
.driver_data = NVME_QUIRK_STRIPE_SIZE |
|
||||
NVME_QUIRK_DEALLOCATE_ZEROES |
|
||||
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
|
||||
NVME_QUIRK_IGNORE_DEV_SUBNQN |
|
||||
NVME_QUIRK_BOGUS_NID, },
|
||||
{ PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */
|
||||
.driver_data = NVME_QUIRK_STRIPE_SIZE |
|
||||
NVME_QUIRK_DEALLOCATE_ZEROES, },
|
||||
|
@@ -644,6 +644,9 @@ static void __nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)
|
||||
|
||||
static void nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)
|
||||
{
|
||||
if (!test_bit(NVME_RDMA_Q_ALLOCATED, &queue->flags))
|
||||
return;
|
||||
|
||||
mutex_lock(&queue->queue_lock);
|
||||
if (test_and_clear_bit(NVME_RDMA_Q_LIVE, &queue->flags))
|
||||
__nvme_rdma_stop_queue(queue);
|
||||
|
@@ -336,6 +336,7 @@ static void nvmet_tcp_fatal_error(struct nvmet_tcp_queue *queue)
|
||||
|
||||
static void nvmet_tcp_socket_error(struct nvmet_tcp_queue *queue, int status)
|
||||
{
|
||||
queue->rcv_state = NVMET_TCP_RECV_ERR;
|
||||
if (status == -EPIPE || status == -ECONNRESET)
|
||||
kernel_sock_shutdown(queue->sock, SHUT_RDWR);
|
||||
else
|
||||
@@ -882,15 +883,11 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue)
|
||||
iov.iov_len = sizeof(*icresp);
|
||||
ret = kernel_sendmsg(queue->sock, &msg, &iov, 1, iov.iov_len);
|
||||
if (ret < 0)
|
||||
goto free_crypto;
|
||||
return ret; /* queue removal will cleanup */
|
||||
|
||||
queue->state = NVMET_TCP_Q_LIVE;
|
||||
nvmet_prepare_receive_pdu(queue);
|
||||
return 0;
|
||||
free_crypto:
|
||||
if (queue->hdr_digest || queue->data_digest)
|
||||
nvmet_tcp_free_crypto(queue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void nvmet_tcp_handle_req_failure(struct nvmet_tcp_queue *queue,
|
||||
|
@@ -1177,7 +1177,7 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
|
||||
u64 delta;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CMN_DTM_NUM_COUNTERS; i++) {
|
||||
for (i = 0; i < CMN_DT_NUM_COUNTERS; i++) {
|
||||
if (status & (1U << i)) {
|
||||
ret = IRQ_HANDLED;
|
||||
if (WARN_ON(!dtc->counters[i]))
|
||||
|
@@ -122,16 +122,10 @@ static int phy_mdm6600_power_on(struct phy *x)
|
||||
{
|
||||
struct phy_mdm6600 *ddata = phy_get_drvdata(x);
|
||||
struct gpio_desc *enable_gpio = ddata->ctrl_gpios[PHY_MDM6600_ENABLE];
|
||||
int error;
|
||||
|
||||
if (!ddata->enabled)
|
||||
return -ENODEV;
|
||||
|
||||
error = pinctrl_pm_select_default_state(ddata->dev);
|
||||
if (error)
|
||||
dev_warn(ddata->dev, "%s: error with default_state: %i\n",
|
||||
__func__, error);
|
||||
|
||||
gpiod_set_value_cansleep(enable_gpio, 1);
|
||||
|
||||
/* Allow aggressive PM for USB, it's only needed for n_gsm port */
|
||||
@@ -160,11 +154,6 @@ static int phy_mdm6600_power_off(struct phy *x)
|
||||
|
||||
gpiod_set_value_cansleep(enable_gpio, 0);
|
||||
|
||||
error = pinctrl_pm_select_sleep_state(ddata->dev);
|
||||
if (error)
|
||||
dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
|
||||
__func__, error);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -456,6 +445,7 @@ static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
|
||||
{
|
||||
struct gpio_desc *reset_gpio =
|
||||
ddata->ctrl_gpios[PHY_MDM6600_RESET];
|
||||
int error;
|
||||
|
||||
ddata->enabled = false;
|
||||
phy_mdm6600_cmd(ddata, PHY_MDM6600_CMD_BP_SHUTDOWN_REQ);
|
||||
@@ -471,6 +461,17 @@ static void phy_mdm6600_device_power_off(struct phy_mdm6600 *ddata)
|
||||
} else {
|
||||
dev_err(ddata->dev, "Timed out powering down\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Keep reset gpio high with padconf internal pull-up resistor to
|
||||
* prevent modem from waking up during deeper SoC idle states. The
|
||||
* gpio bank lines can have glitches if not in the always-on wkup
|
||||
* domain.
|
||||
*/
|
||||
error = pinctrl_pm_select_sleep_state(ddata->dev);
|
||||
if (error)
|
||||
dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
|
||||
__func__, error);
|
||||
}
|
||||
|
||||
static void phy_mdm6600_deferred_power_on(struct work_struct *work)
|
||||
@@ -571,12 +572,6 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
|
||||
ddata->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, ddata);
|
||||
|
||||
/* Active state selected in phy_mdm6600_power_on() */
|
||||
error = pinctrl_pm_select_sleep_state(ddata->dev);
|
||||
if (error)
|
||||
dev_warn(ddata->dev, "%s: error with sleep_state: %i\n",
|
||||
__func__, error);
|
||||
|
||||
error = phy_mdm6600_init_lines(ddata);
|
||||
if (error)
|
||||
return error;
|
||||
@@ -627,10 +622,12 @@ idle:
|
||||
pm_runtime_put_autosuspend(ddata->dev);
|
||||
|
||||
cleanup:
|
||||
if (error < 0)
|
||||
if (error < 0) {
|
||||
phy_mdm6600_device_power_off(ddata);
|
||||
pm_runtime_disable(ddata->dev);
|
||||
pm_runtime_dont_use_autosuspend(ddata->dev);
|
||||
pm_runtime_disable(ddata->dev);
|
||||
pm_runtime_dont_use_autosuspend(ddata->dev);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -639,6 +636,7 @@ static int phy_mdm6600_remove(struct platform_device *pdev)
|
||||
struct phy_mdm6600 *ddata = platform_get_drvdata(pdev);
|
||||
struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET];
|
||||
|
||||
pm_runtime_get_noresume(ddata->dev);
|
||||
pm_runtime_dont_use_autosuspend(ddata->dev);
|
||||
pm_runtime_put_sync(ddata->dev);
|
||||
pm_runtime_disable(ddata->dev);
|
||||
|
@@ -212,6 +212,7 @@ config PINCTRL_RZN1
|
||||
depends on OF
|
||||
depends on ARCH_RZN1 || COMPILE_TEST
|
||||
select GENERIC_PINCONF
|
||||
select PINMUX
|
||||
help
|
||||
This selects pinctrl driver for Renesas RZ/N1 devices.
|
||||
|
||||
|
@@ -475,6 +475,9 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
|
||||
static const struct key_entry asus_nb_wmi_keymap[] = {
|
||||
{ KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
|
||||
{ KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
|
||||
{ KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } },
|
||||
{ KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */
|
||||
{ KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */
|
||||
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
|
||||
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
|
||||
{ KE_KEY, 0x32, { KEY_MUTE } },
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include <linux/i8042.h>
|
||||
|
||||
#define ASUS_WMI_KEY_IGNORE (-1)
|
||||
#define ASUS_WMI_BRN_DOWN 0x20
|
||||
#define ASUS_WMI_BRN_DOWN 0x2e
|
||||
#define ASUS_WMI_BRN_UP 0x2f
|
||||
|
||||
struct module;
|
||||
|
@@ -726,6 +726,21 @@ static const struct ts_dmi_data pipo_w11_data = {
|
||||
.properties = pipo_w11_props,
|
||||
};
|
||||
|
||||
static const struct property_entry positivo_c4128b_props[] = {
|
||||
PROPERTY_ENTRY_U32("touchscreen-min-x", 4),
|
||||
PROPERTY_ENTRY_U32("touchscreen-min-y", 13),
|
||||
PROPERTY_ENTRY_U32("touchscreen-size-x", 1915),
|
||||
PROPERTY_ENTRY_U32("touchscreen-size-y", 1269),
|
||||
PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-positivo-c4128b.fw"),
|
||||
PROPERTY_ENTRY_U32("silead,max-fingers", 10),
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct ts_dmi_data positivo_c4128b_data = {
|
||||
.acpi_name = "MSSL1680:00",
|
||||
.properties = positivo_c4128b_props,
|
||||
};
|
||||
|
||||
static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
|
||||
PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
|
||||
PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
|
||||
@@ -1389,6 +1404,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
|
||||
DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Positivo C4128B */
|
||||
.driver_data = (void *)&positivo_c4128b_data,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Positivo Tecnologia SA"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "C4128B-1"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Point of View mobii wintab p800w (v2.0) */
|
||||
.driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
|
||||
|
@@ -5483,15 +5483,11 @@ wash:
|
||||
mutex_lock(®ulator_list_mutex);
|
||||
regulator_ena_gpio_free(rdev);
|
||||
mutex_unlock(®ulator_list_mutex);
|
||||
put_device(&rdev->dev);
|
||||
rdev = NULL;
|
||||
clean:
|
||||
if (dangling_of_gpiod)
|
||||
gpiod_put(config->ena_gpiod);
|
||||
if (rdev && rdev->dev.of_node)
|
||||
of_node_put(rdev->dev.of_node);
|
||||
kfree(rdev);
|
||||
kfree(config);
|
||||
put_device(&rdev->dev);
|
||||
rinse:
|
||||
if (dangling_cfg_gpiod)
|
||||
gpiod_put(cfg->ena_gpiod);
|
||||
|
@@ -1147,16 +1147,11 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
|
||||
pm_runtime_set_active(&pdev->dev);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
ret = pm_runtime_get_sync(&pdev->dev);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Failed to pm_runtime_get_sync: %d\n", ret);
|
||||
goto clk_dis_all;
|
||||
}
|
||||
|
||||
/* QSPI controller initializations */
|
||||
zynqmp_qspi_init_hw(xqspi);
|
||||
|
||||
pm_runtime_mark_last_busy(&pdev->dev);
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
xqspi->irq = platform_get_irq(pdev, 0);
|
||||
if (xqspi->irq <= 0) {
|
||||
ret = -ENXIO;
|
||||
@@ -1183,7 +1178,6 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
|
||||
ctlr->mode_bits = SPI_CPOL | SPI_CPHA | SPI_RX_DUAL | SPI_RX_QUAD |
|
||||
SPI_TX_DUAL | SPI_TX_QUAD;
|
||||
ctlr->dev.of_node = np;
|
||||
ctlr->auto_runtime_pm = true;
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, ctlr);
|
||||
if (ret) {
|
||||
@@ -1191,15 +1185,11 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
|
||||
goto clk_dis_all;
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(&pdev->dev);
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
clk_dis_all:
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
clk_disable_unprepare(xqspi->refclk);
|
||||
clk_dis_pclk:
|
||||
clk_disable_unprepare(xqspi->pclk);
|
||||
@@ -1223,15 +1213,11 @@ static int zynqmp_qspi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct zynqmp_qspi *xqspi = platform_get_drvdata(pdev);
|
||||
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
|
||||
zynqmp_gqspi_write(xqspi, GQSPI_EN_OFST, 0x0);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
clk_disable_unprepare(xqspi->refclk);
|
||||
clk_disable_unprepare(xqspi->pclk);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -217,12 +217,12 @@ unlock:
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* mutex must be held by caller */
|
||||
static void destroy_session(struct kref *ref)
|
||||
{
|
||||
struct amdtee_session *sess = container_of(ref, struct amdtee_session,
|
||||
refcount);
|
||||
|
||||
mutex_lock(&session_list_mutex);
|
||||
list_del(&sess->list_node);
|
||||
mutex_unlock(&session_list_mutex);
|
||||
kfree(sess);
|
||||
@@ -272,7 +272,8 @@ int amdtee_open_session(struct tee_context *ctx,
|
||||
if (arg->ret != TEEC_SUCCESS) {
|
||||
pr_err("open_session failed %d\n", arg->ret);
|
||||
handle_unload_ta(ta_handle);
|
||||
kref_put(&sess->refcount, destroy_session);
|
||||
kref_put_mutex(&sess->refcount, destroy_session,
|
||||
&session_list_mutex);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -290,7 +291,8 @@ int amdtee_open_session(struct tee_context *ctx,
|
||||
pr_err("reached maximum session count %d\n", TEE_NUM_SESSIONS);
|
||||
handle_close_session(ta_handle, session_info);
|
||||
handle_unload_ta(ta_handle);
|
||||
kref_put(&sess->refcount, destroy_session);
|
||||
kref_put_mutex(&sess->refcount, destroy_session,
|
||||
&session_list_mutex);
|
||||
rc = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -331,7 +333,7 @@ int amdtee_close_session(struct tee_context *ctx, u32 session)
|
||||
handle_close_session(ta_handle, session_info);
|
||||
handle_unload_ta(ta_handle);
|
||||
|
||||
kref_put(&sess->refcount, destroy_session);
|
||||
kref_put_mutex(&sess->refcount, destroy_session, &session_list_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#define PHY_PORT_CS1_LINK_STATE_SHIFT 26
|
||||
|
||||
#define ICM_TIMEOUT 5000 /* ms */
|
||||
#define ICM_RETRIES 3
|
||||
#define ICM_APPROVE_TIMEOUT 10000 /* ms */
|
||||
#define ICM_MAX_LINK 4
|
||||
|
||||
@@ -280,10 +281,9 @@ static bool icm_copy(struct tb_cfg_request *req, const struct ctl_pkg *pkg)
|
||||
|
||||
static int icm_request(struct tb *tb, const void *request, size_t request_size,
|
||||
void *response, size_t response_size, size_t npackets,
|
||||
unsigned int timeout_msec)
|
||||
int retries, unsigned int timeout_msec)
|
||||
{
|
||||
struct icm *icm = tb_priv(tb);
|
||||
int retries = 3;
|
||||
|
||||
do {
|
||||
struct tb_cfg_request *req;
|
||||
@@ -394,7 +394,7 @@ static int icm_fr_get_route(struct tb *tb, u8 link, u8 depth, u64 *route)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = icm_request(tb, &request, sizeof(request), switches,
|
||||
sizeof(*switches), npackets, ICM_TIMEOUT);
|
||||
sizeof(*switches), npackets, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
@@ -447,7 +447,7 @@ icm_fr_driver_ready(struct tb *tb, enum tb_security_level *security_level,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -472,7 +472,7 @@ static int icm_fr_approve_switch(struct tb *tb, struct tb_switch *sw)
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
/* Use larger timeout as establishing tunnels can take some time */
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_APPROVE_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_APPROVE_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -499,7 +499,7 @@ static int icm_fr_add_switch_key(struct tb *tb, struct tb_switch *sw)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -527,7 +527,7 @@ static int icm_fr_challenge_switch_key(struct tb *tb, struct tb_switch *sw,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -559,7 +559,7 @@ static int icm_fr_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -996,7 +996,7 @@ icm_tr_driver_ready(struct tb *tb, enum tb_security_level *security_level,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, 20000);
|
||||
1, 10, 2000);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1026,7 +1026,7 @@ static int icm_tr_approve_switch(struct tb *tb, struct tb_switch *sw)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_APPROVE_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_APPROVE_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1054,7 +1054,7 @@ static int icm_tr_add_switch_key(struct tb *tb, struct tb_switch *sw)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1083,7 +1083,7 @@ static int icm_tr_challenge_switch_key(struct tb *tb, struct tb_switch *sw,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1115,7 +1115,7 @@ static int icm_tr_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1141,7 +1141,7 @@ static int icm_tr_xdomain_tear_down(struct tb *tb, struct tb_xdomain *xd,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1460,7 +1460,7 @@ icm_ar_driver_ready(struct tb *tb, enum tb_security_level *security_level,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1486,7 +1486,7 @@ static int icm_ar_get_route(struct tb *tb, u8 link, u8 depth, u64 *route)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1507,7 +1507,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids)
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1568,7 +1568,7 @@ static int icm_ar_set_boot_acl(struct tb *tb, const uuid_t *uuids,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, ICM_TIMEOUT);
|
||||
1, ICM_RETRIES, ICM_TIMEOUT);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1590,7 +1590,7 @@ icm_icl_driver_ready(struct tb *tb, enum tb_security_level *security_level,
|
||||
|
||||
memset(&reply, 0, sizeof(reply));
|
||||
ret = icm_request(tb, &request, sizeof(request), &reply, sizeof(reply),
|
||||
1, 20000);
|
||||
1, ICM_RETRIES, 20000);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@@ -2303,6 +2303,13 @@ int tb_switch_lane_bonding_enable(struct tb_switch *sw)
|
||||
!tb_port_is_width_supported(down, 2))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Both lanes need to be in CL0. Here we assume lane 0 already be in
|
||||
* CL0 and check just for lane 1.
|
||||
*/
|
||||
if (tb_wait_for_port(down->dual_link_port, false) <= 0)
|
||||
return -ENOTCONN;
|
||||
|
||||
ret = tb_port_lane_bonding_enable(up);
|
||||
if (ret) {
|
||||
tb_port_warn(up, "failed to enable lane bonding\n");
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "8250.h"
|
||||
|
||||
#define DEFAULT_CLK_SPEED 48000000
|
||||
#define OMAP_UART_REGSHIFT 2
|
||||
|
||||
#define UART_ERRATA_i202_MDR1_ACCESS (1 << 0)
|
||||
#define OMAP_UART_WER_HAS_TX_WAKEUP (1 << 1)
|
||||
@@ -109,6 +110,7 @@
|
||||
#define UART_OMAP_RX_LVL 0x19
|
||||
|
||||
struct omap8250_priv {
|
||||
void __iomem *membase;
|
||||
int line;
|
||||
u8 habit;
|
||||
u8 mdr1;
|
||||
@@ -152,9 +154,14 @@ static void omap_8250_rx_dma_flush(struct uart_8250_port *p);
|
||||
static inline void omap_8250_rx_dma_flush(struct uart_8250_port *p) { }
|
||||
#endif
|
||||
|
||||
static u32 uart_read(struct uart_8250_port *up, u32 reg)
|
||||
static u32 uart_read(struct omap8250_priv *priv, u32 reg)
|
||||
{
|
||||
return readl(up->port.membase + (reg << up->port.regshift));
|
||||
return readl(priv->membase + (reg << OMAP_UART_REGSHIFT));
|
||||
}
|
||||
|
||||
static void uart_write(struct omap8250_priv *priv, u32 reg, u32 val)
|
||||
{
|
||||
writel(val, priv->membase + (reg << OMAP_UART_REGSHIFT));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -552,7 +559,7 @@ static void omap_serial_fill_features_erratas(struct uart_8250_port *up,
|
||||
u32 mvr, scheme;
|
||||
u16 revision, major, minor;
|
||||
|
||||
mvr = uart_read(up, UART_OMAP_MVER);
|
||||
mvr = uart_read(priv, UART_OMAP_MVER);
|
||||
|
||||
/* Check revision register scheme */
|
||||
scheme = mvr >> OMAP_UART_MVR_SCHEME_SHIFT;
|
||||
@@ -1336,7 +1343,7 @@ static int omap8250_probe(struct platform_device *pdev)
|
||||
UPF_HARD_FLOW;
|
||||
up.port.private_data = priv;
|
||||
|
||||
up.port.regshift = 2;
|
||||
up.port.regshift = OMAP_UART_REGSHIFT;
|
||||
up.port.fifosize = 64;
|
||||
up.tx_loadsz = 64;
|
||||
up.capabilities = UART_CAP_FIFO;
|
||||
@@ -1397,6 +1404,8 @@ static int omap8250_probe(struct platform_device *pdev)
|
||||
DEFAULT_CLK_SPEED);
|
||||
}
|
||||
|
||||
priv->membase = membase;
|
||||
priv->line = -ENODEV;
|
||||
priv->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
|
||||
priv->calc_latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
|
||||
cpu_latency_qos_add_request(&priv->pm_qos_request, priv->latency);
|
||||
@@ -1404,6 +1413,8 @@ static int omap8250_probe(struct platform_device *pdev)
|
||||
|
||||
spin_lock_init(&priv->rx_dma_lock);
|
||||
|
||||
platform_set_drvdata(pdev, priv);
|
||||
|
||||
device_init_wakeup(&pdev->dev, true);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
@@ -1465,7 +1476,6 @@ static int omap8250_probe(struct platform_device *pdev)
|
||||
goto err;
|
||||
}
|
||||
priv->line = ret;
|
||||
platform_set_drvdata(pdev, priv);
|
||||
pm_runtime_mark_last_busy(&pdev->dev);
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
return 0;
|
||||
@@ -1487,11 +1497,12 @@ static int omap8250_remove(struct platform_device *pdev)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
serial8250_unregister_port(priv->line);
|
||||
priv->line = -ENODEV;
|
||||
pm_runtime_dont_use_autosuspend(&pdev->dev);
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
flush_work(&priv->qos_work);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
serial8250_unregister_port(priv->line);
|
||||
cpu_latency_qos_remove_request(&priv->pm_qos_request);
|
||||
device_init_wakeup(&pdev->dev, false);
|
||||
return 0;
|
||||
@@ -1521,7 +1532,7 @@ static int omap8250_suspend(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
serial8250_suspend_port(priv->line);
|
||||
|
||||
@@ -1531,7 +1542,8 @@ static int omap8250_suspend(struct device *dev)
|
||||
if (!device_may_wakeup(dev))
|
||||
priv->wer = 0;
|
||||
serial_out(up, UART_OMAP_WER, priv->wer);
|
||||
err = pm_runtime_force_suspend(dev);
|
||||
if (uart_console(&up->port) && console_suspend_enabled)
|
||||
err = pm_runtime_force_suspend(dev);
|
||||
flush_work(&priv->qos_work);
|
||||
|
||||
return err;
|
||||
@@ -1540,11 +1552,15 @@ static int omap8250_suspend(struct device *dev)
|
||||
static int omap8250_resume(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
int err;
|
||||
|
||||
err = pm_runtime_force_resume(dev);
|
||||
if (err)
|
||||
return err;
|
||||
if (uart_console(&up->port) && console_suspend_enabled) {
|
||||
err = pm_runtime_force_resume(dev);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
serial8250_resume_port(priv->line);
|
||||
/* Paired with pm_runtime_resume_and_get() in omap8250_suspend() */
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
@@ -1577,7 +1593,6 @@ static int omap8250_lost_context(struct uart_8250_port *up)
|
||||
static int omap8250_soft_reset(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up = serial8250_get_port(priv->line);
|
||||
int timeout = 100;
|
||||
int sysc;
|
||||
int syss;
|
||||
@@ -1591,20 +1606,20 @@ static int omap8250_soft_reset(struct device *dev)
|
||||
* needing omap8250_soft_reset() quirk. Do it in two writes as
|
||||
* recommended in the comment for omap8250_update_scr().
|
||||
*/
|
||||
serial_out(up, UART_OMAP_SCR, OMAP_UART_SCR_DMAMODE_1);
|
||||
serial_out(up, UART_OMAP_SCR,
|
||||
uart_write(priv, UART_OMAP_SCR, OMAP_UART_SCR_DMAMODE_1);
|
||||
uart_write(priv, UART_OMAP_SCR,
|
||||
OMAP_UART_SCR_DMAMODE_1 | OMAP_UART_SCR_DMAMODE_CTL);
|
||||
|
||||
sysc = serial_in(up, UART_OMAP_SYSC);
|
||||
sysc = uart_read(priv, UART_OMAP_SYSC);
|
||||
|
||||
/* softreset the UART */
|
||||
sysc |= OMAP_UART_SYSC_SOFTRESET;
|
||||
serial_out(up, UART_OMAP_SYSC, sysc);
|
||||
uart_write(priv, UART_OMAP_SYSC, sysc);
|
||||
|
||||
/* By experiments, 1us enough for reset complete on AM335x */
|
||||
do {
|
||||
udelay(1);
|
||||
syss = serial_in(up, UART_OMAP_SYSS);
|
||||
syss = uart_read(priv, UART_OMAP_SYSS);
|
||||
} while (--timeout && !(syss & OMAP_UART_SYSS_RESETDONE));
|
||||
|
||||
if (!timeout) {
|
||||
@@ -1618,23 +1633,10 @@ static int omap8250_soft_reset(struct device *dev)
|
||||
static int omap8250_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up;
|
||||
struct uart_8250_port *up = NULL;
|
||||
|
||||
/* In case runtime-pm tries this before we are setup */
|
||||
if (!priv)
|
||||
return 0;
|
||||
|
||||
up = serial8250_get_port(priv->line);
|
||||
/*
|
||||
* When using 'no_console_suspend', the console UART must not be
|
||||
* suspended. Since driver suspend is managed by runtime suspend,
|
||||
* preventing runtime suspend (by returning error) will keep device
|
||||
* active during suspend.
|
||||
*/
|
||||
if (priv->is_suspending && !console_suspend_enabled) {
|
||||
if (uart_console(&up->port))
|
||||
return -EBUSY;
|
||||
}
|
||||
if (priv->line >= 0)
|
||||
up = serial8250_get_port(priv->line);
|
||||
|
||||
if (priv->habit & UART_ERRATA_CLOCK_DISABLE) {
|
||||
int ret;
|
||||
@@ -1643,13 +1645,15 @@ static int omap8250_runtime_suspend(struct device *dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Restore to UART mode after reset (for wakeup) */
|
||||
omap8250_update_mdr1(up, priv);
|
||||
/* Restore wakeup enable register */
|
||||
serial_out(up, UART_OMAP_WER, priv->wer);
|
||||
if (up) {
|
||||
/* Restore to UART mode after reset (for wakeup) */
|
||||
omap8250_update_mdr1(up, priv);
|
||||
/* Restore wakeup enable register */
|
||||
serial_out(up, UART_OMAP_WER, priv->wer);
|
||||
}
|
||||
}
|
||||
|
||||
if (up->dma && up->dma->rxchan)
|
||||
if (up && up->dma && up->dma->rxchan)
|
||||
omap_8250_rx_dma_flush(up);
|
||||
|
||||
priv->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
|
||||
@@ -1661,18 +1665,15 @@ static int omap8250_runtime_suspend(struct device *dev)
|
||||
static int omap8250_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct omap8250_priv *priv = dev_get_drvdata(dev);
|
||||
struct uart_8250_port *up;
|
||||
struct uart_8250_port *up = NULL;
|
||||
|
||||
/* In case runtime-pm tries this before we are setup */
|
||||
if (!priv)
|
||||
return 0;
|
||||
if (priv->line >= 0)
|
||||
up = serial8250_get_port(priv->line);
|
||||
|
||||
up = serial8250_get_port(priv->line);
|
||||
|
||||
if (omap8250_lost_context(up))
|
||||
if (up && omap8250_lost_context(up))
|
||||
omap8250_restore_regs(up);
|
||||
|
||||
if (up->dma && up->dma->rxchan && !(priv->habit & UART_HAS_EFR2))
|
||||
if (up && up->dma && up->dma->rxchan && !(priv->habit & UART_HAS_EFR2))
|
||||
omap_8250_rx_dma(up);
|
||||
|
||||
priv->latency = priv->calc_latency;
|
||||
|
@@ -2742,6 +2742,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
|
||||
|
||||
rhdev->rx_lanes = 1;
|
||||
rhdev->tx_lanes = 1;
|
||||
rhdev->ssp_rate = USB_SSP_GEN_UNKNOWN;
|
||||
|
||||
switch (hcd->speed) {
|
||||
case HCD_USB11:
|
||||
@@ -2759,8 +2760,11 @@ int usb_add_hcd(struct usb_hcd *hcd,
|
||||
case HCD_USB32:
|
||||
rhdev->rx_lanes = 2;
|
||||
rhdev->tx_lanes = 2;
|
||||
fallthrough;
|
||||
rhdev->ssp_rate = USB_SSP_GEN_2x2;
|
||||
rhdev->speed = USB_SPEED_SUPER_PLUS;
|
||||
break;
|
||||
case HCD_USB31:
|
||||
rhdev->ssp_rate = USB_SSP_GEN_2x1;
|
||||
rhdev->speed = USB_SPEED_SUPER_PLUS;
|
||||
break;
|
||||
default:
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <linux/pm_qos.h>
|
||||
#include <linux/kobject.h>
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
@@ -149,6 +150,10 @@ int usb_device_supports_lpm(struct usb_device *udev)
|
||||
if (udev->quirks & USB_QUIRK_NO_LPM)
|
||||
return 0;
|
||||
|
||||
/* Skip if the device BOS descriptor couldn't be read */
|
||||
if (!udev->bos)
|
||||
return 0;
|
||||
|
||||
/* USB 2.1 (and greater) devices indicate LPM support through
|
||||
* their USB 2.0 Extended Capabilities BOS descriptor.
|
||||
*/
|
||||
@@ -325,6 +330,10 @@ static void usb_set_lpm_parameters(struct usb_device *udev)
|
||||
if (!udev->lpm_capable || udev->speed < USB_SPEED_SUPER)
|
||||
return;
|
||||
|
||||
/* Skip if the device BOS descriptor couldn't be read */
|
||||
if (!udev->bos)
|
||||
return;
|
||||
|
||||
hub = usb_hub_to_struct_hub(udev->parent);
|
||||
/* It doesn't take time to transition the roothub into U0, since it
|
||||
* doesn't have an upstream link.
|
||||
@@ -2683,8 +2692,84 @@ out_authorized:
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_port_ssp_rate - Match the extended port status to SSP rate
|
||||
* @hdev: The hub device
|
||||
* @ext_portstatus: extended port status
|
||||
*
|
||||
* Match the extended port status speed id to the SuperSpeed Plus sublink speed
|
||||
* capability attributes. Base on the number of connected lanes and speed,
|
||||
* return the corresponding enum usb_ssp_rate.
|
||||
*/
|
||||
static enum usb_ssp_rate get_port_ssp_rate(struct usb_device *hdev,
|
||||
u32 ext_portstatus)
|
||||
{
|
||||
struct usb_ssp_cap_descriptor *ssp_cap = hdev->bos->ssp_cap;
|
||||
u32 attr;
|
||||
u8 speed_id;
|
||||
u8 ssac;
|
||||
u8 lanes;
|
||||
int i;
|
||||
|
||||
if (!ssp_cap)
|
||||
goto out;
|
||||
|
||||
speed_id = ext_portstatus & USB_EXT_PORT_STAT_RX_SPEED_ID;
|
||||
lanes = USB_EXT_PORT_RX_LANES(ext_portstatus) + 1;
|
||||
|
||||
ssac = le32_to_cpu(ssp_cap->bmAttributes) &
|
||||
USB_SSP_SUBLINK_SPEED_ATTRIBS;
|
||||
|
||||
for (i = 0; i <= ssac; i++) {
|
||||
u8 ssid;
|
||||
|
||||
attr = le32_to_cpu(ssp_cap->bmSublinkSpeedAttr[i]);
|
||||
ssid = FIELD_GET(USB_SSP_SUBLINK_SPEED_SSID, attr);
|
||||
if (speed_id == ssid) {
|
||||
u16 mantissa;
|
||||
u8 lse;
|
||||
u8 type;
|
||||
|
||||
/*
|
||||
* Note: currently asymmetric lane types are only
|
||||
* applicable for SSIC operate in SuperSpeed protocol
|
||||
*/
|
||||
type = FIELD_GET(USB_SSP_SUBLINK_SPEED_ST, attr);
|
||||
if (type == USB_SSP_SUBLINK_SPEED_ST_ASYM_RX ||
|
||||
type == USB_SSP_SUBLINK_SPEED_ST_ASYM_TX)
|
||||
goto out;
|
||||
|
||||
if (FIELD_GET(USB_SSP_SUBLINK_SPEED_LP, attr) !=
|
||||
USB_SSP_SUBLINK_SPEED_LP_SSP)
|
||||
goto out;
|
||||
|
||||
lse = FIELD_GET(USB_SSP_SUBLINK_SPEED_LSE, attr);
|
||||
mantissa = FIELD_GET(USB_SSP_SUBLINK_SPEED_LSM, attr);
|
||||
|
||||
/* Convert to Gbps */
|
||||
for (; lse < USB_SSP_SUBLINK_SPEED_LSE_GBPS; lse++)
|
||||
mantissa /= 1000;
|
||||
|
||||
if (mantissa >= 10 && lanes == 1)
|
||||
return USB_SSP_GEN_2x1;
|
||||
|
||||
if (mantissa >= 10 && lanes == 2)
|
||||
return USB_SSP_GEN_2x2;
|
||||
|
||||
if (mantissa >= 5 && lanes == 2)
|
||||
return USB_SSP_GEN_1x2;
|
||||
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
return USB_SSP_GEN_UNKNOWN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return 1 if port speed is SuperSpeedPlus, 0 otherwise
|
||||
* Return 1 if port speed is SuperSpeedPlus, 0 otherwise or if the
|
||||
* capability couldn't be checked.
|
||||
* check it from the link protocol field of the current speed ID attribute.
|
||||
* current speed ID is got from ext port status request. Sublink speed attribute
|
||||
* table is returned with the hub BOS SSP device capability descriptor
|
||||
@@ -2694,8 +2779,12 @@ static int port_speed_is_ssp(struct usb_device *hdev, int speed_id)
|
||||
int ssa_count;
|
||||
u32 ss_attr;
|
||||
int i;
|
||||
struct usb_ssp_cap_descriptor *ssp_cap = hdev->bos->ssp_cap;
|
||||
struct usb_ssp_cap_descriptor *ssp_cap;
|
||||
|
||||
if (!hdev->bos)
|
||||
return 0;
|
||||
|
||||
ssp_cap = hdev->bos->ssp_cap;
|
||||
if (!ssp_cap)
|
||||
return 0;
|
||||
|
||||
@@ -2865,9 +2954,11 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
|
||||
/* extended portstatus Rx and Tx lane count are zero based */
|
||||
udev->rx_lanes = USB_EXT_PORT_RX_LANES(ext_portstatus) + 1;
|
||||
udev->tx_lanes = USB_EXT_PORT_TX_LANES(ext_portstatus) + 1;
|
||||
udev->ssp_rate = get_port_ssp_rate(hub->hdev, ext_portstatus);
|
||||
} else {
|
||||
udev->rx_lanes = 1;
|
||||
udev->tx_lanes = 1;
|
||||
udev->ssp_rate = USB_SSP_GEN_UNKNOWN;
|
||||
}
|
||||
if (hub_is_wusb(hub))
|
||||
udev->speed = USB_SPEED_WIRELESS;
|
||||
@@ -4114,8 +4205,15 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
enum usb3_link_state state)
|
||||
{
|
||||
int timeout, ret;
|
||||
__u8 u1_mel = udev->bos->ss_cap->bU1devExitLat;
|
||||
__le16 u2_mel = udev->bos->ss_cap->bU2DevExitLat;
|
||||
__u8 u1_mel;
|
||||
__le16 u2_mel;
|
||||
|
||||
/* Skip if the device BOS descriptor couldn't be read */
|
||||
if (!udev->bos)
|
||||
return;
|
||||
|
||||
u1_mel = udev->bos->ss_cap->bU1devExitLat;
|
||||
u2_mel = udev->bos->ss_cap->bU2DevExitLat;
|
||||
|
||||
/* If the device says it doesn't have *any* exit latency to come out of
|
||||
* U1 or U2, it's probably lying. Assume it doesn't implement that link
|
||||
|
@@ -141,7 +141,7 @@ static inline int hub_is_superspeedplus(struct usb_device *hdev)
|
||||
{
|
||||
return (hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS &&
|
||||
le16_to_cpu(hdev->descriptor.bcdUSB) >= 0x0310 &&
|
||||
hdev->bos->ssp_cap);
|
||||
hdev->bos && hdev->bos->ssp_cap);
|
||||
}
|
||||
|
||||
static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
|
||||
|
@@ -277,9 +277,46 @@ int dwc3_core_soft_reset(struct dwc3 *dwc)
|
||||
* XHCI driver will reset the host block. If dwc3 was configured for
|
||||
* host-only mode or current role is host, then we can return early.
|
||||
*/
|
||||
if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
|
||||
if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If the dr_mode is host and the dwc->current_dr_role is not the
|
||||
* corresponding DWC3_GCTL_PRTCAP_HOST, then the dwc3_core_init_mode
|
||||
* isn't executed yet. Ensure the phy is ready before the controller
|
||||
* updates the GCTL.PRTCAPDIR or other settings by soft-resetting
|
||||
* the phy.
|
||||
*
|
||||
* Note: GUSB3PIPECTL[n] and GUSB2PHYCFG[n] are port settings where n
|
||||
* is port index. If this is a multiport host, then we need to reset
|
||||
* all active ports.
|
||||
*/
|
||||
if (dwc->dr_mode == USB_DR_MODE_HOST) {
|
||||
u32 usb3_port;
|
||||
u32 usb2_port;
|
||||
|
||||
usb3_port = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
|
||||
usb3_port |= DWC3_GUSB3PIPECTL_PHYSOFTRST;
|
||||
dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port);
|
||||
|
||||
usb2_port = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
|
||||
usb2_port |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
|
||||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port);
|
||||
|
||||
/* Small delay for phy reset assertion */
|
||||
usleep_range(1000, 2000);
|
||||
|
||||
usb3_port &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST;
|
||||
dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port);
|
||||
|
||||
usb2_port &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST;
|
||||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port);
|
||||
|
||||
/* Wait for clock synchronization */
|
||||
msleep(50);
|
||||
return 0;
|
||||
}
|
||||
|
||||
reg = dwc3_readl(dwc->regs, DWC3_DCTL);
|
||||
reg |= DWC3_DCTL_CSFTRST;
|
||||
reg &= ~DWC3_DCTL_RUN_STOP;
|
||||
|
@@ -1180,7 +1180,8 @@ static int ncm_unwrap_ntb(struct gether *port,
|
||||
struct sk_buff_head *list)
|
||||
{
|
||||
struct f_ncm *ncm = func_to_ncm(&port->func);
|
||||
__le16 *tmp = (void *) skb->data;
|
||||
unsigned char *ntb_ptr = skb->data;
|
||||
__le16 *tmp;
|
||||
unsigned index, index2;
|
||||
int ndp_index;
|
||||
unsigned dg_len, dg_len2;
|
||||
@@ -1193,6 +1194,10 @@ static int ncm_unwrap_ntb(struct gether *port,
|
||||
const struct ndp_parser_opts *opts = ncm->parser_opts;
|
||||
unsigned crc_len = ncm->is_crc ? sizeof(uint32_t) : 0;
|
||||
int dgram_counter;
|
||||
int to_process = skb->len;
|
||||
|
||||
parse_ntb:
|
||||
tmp = (__le16 *)ntb_ptr;
|
||||
|
||||
/* dwSignature */
|
||||
if (get_unaligned_le32(tmp) != opts->nth_sign) {
|
||||
@@ -1239,7 +1244,7 @@ static int ncm_unwrap_ntb(struct gether *port,
|
||||
* walk through NDP
|
||||
* dwSignature
|
||||
*/
|
||||
tmp = (void *)(skb->data + ndp_index);
|
||||
tmp = (__le16 *)(ntb_ptr + ndp_index);
|
||||
if (get_unaligned_le32(tmp) != ncm->ndp_sign) {
|
||||
INFO(port->func.config->cdev, "Wrong NDP SIGN\n");
|
||||
goto err;
|
||||
@@ -1296,11 +1301,11 @@ static int ncm_unwrap_ntb(struct gether *port,
|
||||
if (ncm->is_crc) {
|
||||
uint32_t crc, crc2;
|
||||
|
||||
crc = get_unaligned_le32(skb->data +
|
||||
crc = get_unaligned_le32(ntb_ptr +
|
||||
index + dg_len -
|
||||
crc_len);
|
||||
crc2 = ~crc32_le(~0,
|
||||
skb->data + index,
|
||||
ntb_ptr + index,
|
||||
dg_len - crc_len);
|
||||
if (crc != crc2) {
|
||||
INFO(port->func.config->cdev,
|
||||
@@ -1327,7 +1332,7 @@ static int ncm_unwrap_ntb(struct gether *port,
|
||||
dg_len - crc_len);
|
||||
if (skb2 == NULL)
|
||||
goto err;
|
||||
skb_put_data(skb2, skb->data + index,
|
||||
skb_put_data(skb2, ntb_ptr + index,
|
||||
dg_len - crc_len);
|
||||
|
||||
skb_queue_tail(list, skb2);
|
||||
@@ -1340,10 +1345,17 @@ static int ncm_unwrap_ntb(struct gether *port,
|
||||
} while (ndp_len > 2 * (opts->dgram_item_len * 2));
|
||||
} while (ndp_index);
|
||||
|
||||
dev_consume_skb_any(skb);
|
||||
|
||||
VDBG(port->func.config->cdev,
|
||||
"Parsed NTB with %d frames\n", dgram_counter);
|
||||
|
||||
to_process -= block_len;
|
||||
if (to_process != 0) {
|
||||
ntb_ptr = (unsigned char *)(ntb_ptr + block_len);
|
||||
goto parse_ntb;
|
||||
}
|
||||
|
||||
dev_consume_skb_any(skb);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
skb_queue_purge(list);
|
||||
|
@@ -496,11 +496,13 @@ static int xudc_eptxrx(struct xusb_ep *ep, struct xusb_req *req,
|
||||
/* Get the Buffer address and copy the transmit data.*/
|
||||
eprambase = (u32 __force *)(udc->addr + ep->rambase);
|
||||
if (ep->is_in) {
|
||||
memcpy(eprambase, bufferptr, bytestosend);
|
||||
memcpy_toio((void __iomem *)eprambase, bufferptr,
|
||||
bytestosend);
|
||||
udc->write_fn(udc->addr, ep->offset +
|
||||
XUSB_EP_BUF0COUNT_OFFSET, bufferlen);
|
||||
} else {
|
||||
memcpy(bufferptr, eprambase, bytestosend);
|
||||
memcpy_toio((void __iomem *)bufferptr, eprambase,
|
||||
bytestosend);
|
||||
}
|
||||
/*
|
||||
* Enable the buffer for transmission.
|
||||
@@ -514,11 +516,13 @@ static int xudc_eptxrx(struct xusb_ep *ep, struct xusb_req *req,
|
||||
eprambase = (u32 __force *)(udc->addr + ep->rambase +
|
||||
ep->ep_usb.maxpacket);
|
||||
if (ep->is_in) {
|
||||
memcpy(eprambase, bufferptr, bytestosend);
|
||||
memcpy_toio((void __iomem *)eprambase, bufferptr,
|
||||
bytestosend);
|
||||
udc->write_fn(udc->addr, ep->offset +
|
||||
XUSB_EP_BUF1COUNT_OFFSET, bufferlen);
|
||||
} else {
|
||||
memcpy(bufferptr, eprambase, bytestosend);
|
||||
memcpy_toio((void __iomem *)bufferptr, eprambase,
|
||||
bytestosend);
|
||||
}
|
||||
/*
|
||||
* Enable the buffer for transmission.
|
||||
@@ -1020,7 +1024,7 @@ static int __xudc_ep0_queue(struct xusb_ep *ep0, struct xusb_req *req)
|
||||
udc->addr);
|
||||
length = req->usb_req.actual = min_t(u32, length,
|
||||
EP0_MAX_PACKET);
|
||||
memcpy(corebuf, req->usb_req.buf, length);
|
||||
memcpy_toio((void __iomem *)corebuf, req->usb_req.buf, length);
|
||||
udc->write_fn(udc->addr, XUSB_EP_BUF0COUNT_OFFSET, length);
|
||||
udc->write_fn(udc->addr, XUSB_BUFFREADY_OFFSET, 1);
|
||||
} else {
|
||||
@@ -1746,7 +1750,7 @@ static void xudc_handle_setup(struct xusb_udc *udc)
|
||||
|
||||
/* Load up the chapter 9 command buffer.*/
|
||||
ep0rambase = (u32 __force *) (udc->addr + XUSB_SETUP_PKT_ADDR_OFFSET);
|
||||
memcpy(&setup, ep0rambase, 8);
|
||||
memcpy_toio((void __iomem *)&setup, ep0rambase, 8);
|
||||
|
||||
udc->setup = setup;
|
||||
udc->setup.wValue = cpu_to_le16(setup.wValue);
|
||||
@@ -1833,7 +1837,7 @@ static void xudc_ep0_out(struct xusb_udc *udc)
|
||||
(ep0->rambase << 2));
|
||||
buffer = req->usb_req.buf + req->usb_req.actual;
|
||||
req->usb_req.actual = req->usb_req.actual + bytes_to_rx;
|
||||
memcpy(buffer, ep0rambase, bytes_to_rx);
|
||||
memcpy_toio((void __iomem *)buffer, ep0rambase, bytes_to_rx);
|
||||
|
||||
if (req->usb_req.length == req->usb_req.actual) {
|
||||
/* Data transfer completed get ready for Status stage */
|
||||
@@ -1909,7 +1913,7 @@ static void xudc_ep0_in(struct xusb_udc *udc)
|
||||
(ep0->rambase << 2));
|
||||
buffer = req->usb_req.buf + req->usb_req.actual;
|
||||
req->usb_req.actual = req->usb_req.actual + length;
|
||||
memcpy(ep0rambase, buffer, length);
|
||||
memcpy_toio((void __iomem *)ep0rambase, buffer, length);
|
||||
}
|
||||
udc->write_fn(udc->addr, XUSB_EP_BUF0COUNT_OFFSET, count);
|
||||
udc->write_fn(udc->addr, XUSB_BUFFREADY_OFFSET, 1);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user