Merge 5.15.66 into android14-5.15
Changes in 5.15.66 drm/msm/dsi: fix the inconsistent indenting drm/msm/dp: delete DP_RECOVERED_CLOCK_OUT_EN to fix tps4 drm/msm/dsi: Fix number of regulators for msm8996_dsi_cfg drm/msm/dsi: Fix number of regulators for SDM660 platform/x86: pmc_atom: Fix SLP_TYPx bitfield mask iio: adc: mcp3911: make use of the sign bit skmsg: Fix wrong last sg check in sk_msg_recvmsg() bpf: Restrict bpf_sys_bpf to CAP_PERFMON bpf, cgroup: Fix kernel BUG in purge_effective_progs ieee802154/adf7242: defer destroy_workqueue call drm/i915/backlight: extract backlight code to a separate file drm/i915/display: avoid warnings when registering dual panel backlight ALSA: hda: intel-nhlt: remove use of __func__ in dev_dbg ALSA: hda: intel-nhlt: Correct the handling of fmt_config flexible array wifi: cfg80211: debugfs: fix return type in ht40allow_map_read() Revert "xhci: turn off port power in shutdown" net: sparx5: fix handling uneven length packets in manual extraction net: smsc911x: Stop and start PHY during suspend and resume openvswitch: fix memory leak at failed datapath creation net: dsa: xrs700x: Use irqsave variant for u64 stats update net: sched: tbf: don't call qdisc_put() while holding tree lock net/sched: fix netdevice reference leaks in attach_default_qdiscs() ethernet: rocker: fix sleep in atomic context bug in neigh_timer_handler mlxbf_gige: compute MDIO period based on i1clk kcm: fix strp_init() order and cleanup sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb tcp: annotate data-race around challenge_timestamp Revert "sch_cake: Return __NET_XMIT_STOLEN when consuming enqueued skb" net/smc: Remove redundant refcount increase soundwire: qcom: fix device status array range serial: fsl_lpuart: RS485 RTS polariy is inverse staging: rtl8712: fix use after free bugs staging: r8188eu: add firmware dependency powerpc: align syscall table for ppc32 vt: Clear selection before changing the font musb: fix USB_MUSB_TUSB6010 dependency tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete Input: iforce - wake up after clearing IFORCE_XMIT_RUNNING flag iio: ad7292: Prevent regulator double disable iio: adc: mcp3911: use correct formula for AD conversion misc: fastrpc: fix memory corruption on probe misc: fastrpc: fix memory corruption on open USB: serial: ftdi_sio: add Omron CS1W-CIF31 device id mmc: core: Fix UHS-I SD 1.8V workaround branch mmc: core: Fix inconsistent sd3_bus_mode at UHS-I SD voltage switch failure binder: fix UAF of ref->proc caused by race condition binder: fix alloc->vma_vm_mm null-ptr dereference cifs: fix small mempool leak in SMB2_negotiate() KVM: VMX: Heed the 'msr' argument in msr_write_intercepted() drm/i915/reg: Fix spelling mistake "Unsupport" -> "Unsupported" clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops Revert "clk: core: Honor CLK_OPS_PARENT_ENABLE for clk gate ops" clk: core: Fix runtime PM sequence in clk_core_unprepare() Input: rk805-pwrkey - fix module autoloading clk: bcm: rpi: Fix error handling of raspberrypi_fw_get_rate clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc() clk: bcm: rpi: Prevent out-of-bounds access clk: bcm: rpi: Add missing newline hwmon: (gpio-fan) Fix array out of bounds access gpio: pca953x: Add mutex_lock for regcache sync in PM KVM: x86: Mask off unsupported and unknown bits of IA32_ARCH_CAPABILITIES xen/grants: prevent integer overflow in gnttab_dma_alloc_pages() mm: pagewalk: Fix race between unmap and page walker xen-blkback: Advertise feature-persistent as user requested xen-blkfront: Advertise feature-persistent as user requested xen-blkfront: Cache feature_persistent value before advertisement thunderbolt: Use the actual buffer in tb_async_error() usb: dwc3: pci: Add support for Intel Raptor Lake media: mceusb: Use new usb_control_msg_*() routines xhci: Add grace period after xHC start to prevent premature runtime suspend. USB: serial: cp210x: add Decagon UCA device id USB: serial: option: add support for OPPO R11 diag port USB: serial: option: add Quectel EM060K modem USB: serial: option: add support for Cinterion MV32-WA/WB RmNet mode usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles usb: typec: intel_pmc_mux: Add new ACPI ID for Meteor Lake IOM device usb: typec: tcpm: Return ENOTSUPP for power supply prop writes usb: dwc2: fix wrong order of phy_power_on and phy_init usb: cdns3: fix issue with rearming ISO OUT endpoint usb: cdns3: fix incorrect handling TRB_SMM flag for ISOC transfer USB: cdc-acm: Add Icom PMR F3400 support (0c26:0020) usb-storage: Add ignore-residue quirk for NXP PN7462AU s390/hugetlb: fix prepare_hugepage_range() check for 2 GB hugepages s390: fix nospec table alignments USB: core: Prevent nested device-reset calls usb: xhci-mtk: relax TT periodic bandwidth allocation usb: xhci-mtk: fix bandwidth release issue usb: gadget: mass_storage: Fix cdrom data transfers on MAC-OS driver core: Don't probe devices after bus_type.match() probe deferral wifi: mac80211: Don't finalize CSA in IBSS mode if state is disconnected wifi: mac80211: Fix UAF in ieee80211_scan_rx() ip: fix triggering of 'icmp redirect' net: Use u64_stats_fetch_begin_irq() for stats fetch. net: mac802154: Fix a condition in the receive path ALSA: hda/realtek: Add speaker AMP init for Samsung laptops with ALC298 ALSA: seq: oss: Fix data-race for max_midi_devs access ALSA: seq: Fix data-race at module auto-loading drm/i915/glk: ECS Liva Q2 needs GLK HDMI port timing quirk drm/i915: Skip wm/ddb readout for disabled pipes tty: n_gsm: add sanity check for gsm->receive in gsm_receive_buf() kbuild: Unify options for BTF generation for vmlinux and modules kbuild: Add skip_encoding_btf_enum64 option to pahole usb: dwc3: fix PHY disable sequence usb: dwc3: qcom: fix use-after-free on runtime-PM wakeup usb: dwc3: disable USB core PHY management USB: serial: ch341: fix lost character on LCR updates USB: serial: ch341: fix disabled rx timer on older devices Linux 5.15.66 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I309eed59f20bde6cdb0b4debdb6a9c5909f620ee
This commit is contained in:
5
Makefile
5
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 15
|
||||
SUBLEVEL = 65
|
||||
SUBLEVEL = 66
|
||||
EXTRAVERSION =
|
||||
NAME = Trick or Treat
|
||||
|
||||
@@ -499,6 +499,8 @@ LZ4 = lz4
|
||||
XZ = xz
|
||||
ZSTD = zstd
|
||||
|
||||
PAHOLE_FLAGS = $(shell PAHOLE=$(PAHOLE) $(srctree)/scripts/pahole-flags.sh)
|
||||
|
||||
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
||||
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
||||
NOSTDINC_FLAGS :=
|
||||
@@ -554,6 +556,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
|
||||
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
|
||||
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
|
||||
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
|
||||
export PAHOLE_FLAGS
|
||||
|
||||
# Files to ignore in find ... statements
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
.p2align 3
|
||||
#define __SYSCALL(nr, entry) .8byte entry
|
||||
#else
|
||||
.p2align 2
|
||||
#define __SYSCALL(nr, entry) .long entry
|
||||
#endif
|
||||
|
||||
|
||||
@@ -118,10 +118,10 @@ static int __set_memory(unsigned long addr, int numpages, pgprot_t set_mask,
|
||||
if (!numpages)
|
||||
return 0;
|
||||
|
||||
mmap_read_lock(&init_mm);
|
||||
mmap_write_lock(&init_mm);
|
||||
ret = walk_page_range_novma(&init_mm, start, end, &pageattr_ops, NULL,
|
||||
&masks);
|
||||
mmap_read_unlock(&init_mm);
|
||||
mmap_write_unlock(&init_mm);
|
||||
|
||||
flush_tlb_kernel_range(start, end);
|
||||
|
||||
|
||||
@@ -28,9 +28,11 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||||
static inline int prepare_hugepage_range(struct file *file,
|
||||
unsigned long addr, unsigned long len)
|
||||
{
|
||||
if (len & ~HPAGE_MASK)
|
||||
struct hstate *h = hstate_file(file);
|
||||
|
||||
if (len & ~huge_page_mask(h))
|
||||
return -EINVAL;
|
||||
if (addr & ~HPAGE_MASK)
|
||||
if (addr & ~huge_page_mask(h))
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ SECTIONS
|
||||
/*
|
||||
* Table with the patch locations to undo expolines
|
||||
*/
|
||||
. = ALIGN(4);
|
||||
.nospec_call_table : {
|
||||
__nospec_call_start = . ;
|
||||
*(.s390_indirect*)
|
||||
|
||||
@@ -831,8 +831,7 @@ static bool msr_write_intercepted(struct vcpu_vmx *vmx, u32 msr)
|
||||
if (!(exec_controls_get(vmx) & CPU_BASED_USE_MSR_BITMAPS))
|
||||
return true;
|
||||
|
||||
return vmx_test_msr_bitmap_write(vmx->loaded_vmcs->msr_bitmap,
|
||||
MSR_IA32_SPEC_CTRL);
|
||||
return vmx_test_msr_bitmap_write(vmx->loaded_vmcs->msr_bitmap, msr);
|
||||
}
|
||||
|
||||
unsigned int __vmx_vcpu_run_flags(struct vcpu_vmx *vmx)
|
||||
|
||||
@@ -1465,12 +1465,32 @@ static const u32 msr_based_features_all[] = {
|
||||
static u32 msr_based_features[ARRAY_SIZE(msr_based_features_all)];
|
||||
static unsigned int num_msr_based_features;
|
||||
|
||||
/*
|
||||
* Some IA32_ARCH_CAPABILITIES bits have dependencies on MSRs that KVM
|
||||
* does not yet virtualize. These include:
|
||||
* 10 - MISC_PACKAGE_CTRLS
|
||||
* 11 - ENERGY_FILTERING_CTL
|
||||
* 12 - DOITM
|
||||
* 18 - FB_CLEAR_CTRL
|
||||
* 21 - XAPIC_DISABLE_STATUS
|
||||
* 23 - OVERCLOCKING_STATUS
|
||||
*/
|
||||
|
||||
#define KVM_SUPPORTED_ARCH_CAP \
|
||||
(ARCH_CAP_RDCL_NO | ARCH_CAP_IBRS_ALL | ARCH_CAP_RSBA | \
|
||||
ARCH_CAP_SKIP_VMENTRY_L1DFLUSH | ARCH_CAP_SSB_NO | ARCH_CAP_MDS_NO | \
|
||||
ARCH_CAP_PSCHANGE_MC_NO | ARCH_CAP_TSX_CTRL_MSR | ARCH_CAP_TAA_NO | \
|
||||
ARCH_CAP_SBDR_SSDP_NO | ARCH_CAP_FBSDP_NO | ARCH_CAP_PSDP_NO | \
|
||||
ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO)
|
||||
|
||||
static u64 kvm_get_arch_capabilities(void)
|
||||
{
|
||||
u64 data = 0;
|
||||
|
||||
if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES))
|
||||
if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES)) {
|
||||
rdmsrl(MSR_IA32_ARCH_CAPABILITIES, data);
|
||||
data &= KVM_SUPPORTED_ARCH_CAP;
|
||||
}
|
||||
|
||||
/*
|
||||
* If nx_huge_pages is enabled, KVM's shadow paging will ensure that
|
||||
@@ -1518,9 +1538,6 @@ static u64 kvm_get_arch_capabilities(void)
|
||||
*/
|
||||
}
|
||||
|
||||
/* Guests don't need to know "Fill buffer clear control" exists */
|
||||
data &= ~ARCH_CAP_FB_CLEAR_CTRL;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,6 @@ static inline void binder_alloc_set_vma(struct binder_alloc *alloc,
|
||||
*/
|
||||
if (vma) {
|
||||
vm_start = vma->vm_start;
|
||||
alloc->vma_vm_mm = vma->vm_mm;
|
||||
mmap_assert_write_locked(alloc->vma_vm_mm);
|
||||
} else {
|
||||
mmap_assert_locked(alloc->vma_vm_mm);
|
||||
@@ -795,7 +794,6 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
|
||||
binder_insert_free_buffer(alloc, buffer);
|
||||
alloc->free_async_space = alloc->buffer_size / 2;
|
||||
binder_alloc_set_vma(alloc, vma);
|
||||
mmgrab(alloc->vma_vm_mm);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1095,6 +1093,8 @@ static struct shrinker binder_shrinker = {
|
||||
void binder_alloc_init(struct binder_alloc *alloc)
|
||||
{
|
||||
alloc->pid = current->group_leader->pid;
|
||||
alloc->vma_vm_mm = current->mm;
|
||||
mmgrab(alloc->vma_vm_mm);
|
||||
mutex_init(&alloc->mutex);
|
||||
INIT_LIST_HEAD(&alloc->buffers);
|
||||
}
|
||||
|
||||
@@ -877,6 +877,11 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
|
||||
dev_dbg(dev, "Device match requests probe deferral\n");
|
||||
dev->can_match = true;
|
||||
driver_deferred_probe_add(dev);
|
||||
/*
|
||||
* Device can't match with a driver right now, so don't attempt
|
||||
* to match or bind with other drivers on the bus.
|
||||
*/
|
||||
return ret;
|
||||
} else if (ret < 0) {
|
||||
dev_dbg(dev, "Bus failed to match device: %d\n", ret);
|
||||
return ret;
|
||||
@@ -1115,6 +1120,11 @@ static int __driver_attach(struct device *dev, void *data)
|
||||
dev_dbg(dev, "Device match requests probe deferral\n");
|
||||
dev->can_match = true;
|
||||
driver_deferred_probe_add(dev);
|
||||
/*
|
||||
* Driver could not match with device, but may match with
|
||||
* another device on the bus.
|
||||
*/
|
||||
return 0;
|
||||
} else if (ret < 0) {
|
||||
dev_dbg(dev, "Bus failed to match device: %d\n", ret);
|
||||
return ret;
|
||||
|
||||
@@ -226,6 +226,9 @@ struct xen_vbd {
|
||||
sector_t size;
|
||||
unsigned int flush_support:1;
|
||||
unsigned int discard_secure:1;
|
||||
/* Connect-time cached feature_persistent parameter value */
|
||||
unsigned int feature_gnt_persistent_parm:1;
|
||||
/* Persistent grants feature negotiation result */
|
||||
unsigned int feature_gnt_persistent:1;
|
||||
unsigned int overflow_max_grants:1;
|
||||
};
|
||||
|
||||
@@ -910,7 +910,7 @@ again:
|
||||
xen_blkbk_barrier(xbt, be, be->blkif->vbd.flush_support);
|
||||
|
||||
err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u",
|
||||
be->blkif->vbd.feature_gnt_persistent);
|
||||
be->blkif->vbd.feature_gnt_persistent_parm);
|
||||
if (err) {
|
||||
xenbus_dev_fatal(dev, err, "writing %s/feature-persistent",
|
||||
dev->nodename);
|
||||
@@ -1088,7 +1088,9 @@ static int connect_ring(struct backend_info *be)
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
blkif->vbd.feature_gnt_persistent = feature_persistent &&
|
||||
blkif->vbd.feature_gnt_persistent_parm = feature_persistent;
|
||||
blkif->vbd.feature_gnt_persistent =
|
||||
blkif->vbd.feature_gnt_persistent_parm &&
|
||||
xenbus_read_unsigned(dev->otherend, "feature-persistent", 0);
|
||||
|
||||
blkif->vbd.overflow_max_grants = 0;
|
||||
|
||||
@@ -212,6 +212,9 @@ struct blkfront_info
|
||||
unsigned int feature_fua:1;
|
||||
unsigned int feature_discard:1;
|
||||
unsigned int feature_secdiscard:1;
|
||||
/* Connect-time cached feature_persistent parameter */
|
||||
unsigned int feature_persistent_parm:1;
|
||||
/* Persistent grants feature negotiation result */
|
||||
unsigned int feature_persistent:1;
|
||||
unsigned int bounce:1;
|
||||
unsigned int discard_granularity;
|
||||
@@ -1782,6 +1785,12 @@ abort_transaction:
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Enable the persistent grants feature. */
|
||||
static bool feature_persistent = true;
|
||||
module_param(feature_persistent, bool, 0644);
|
||||
MODULE_PARM_DESC(feature_persistent,
|
||||
"Enables the persistent grants feature");
|
||||
|
||||
/* Common code used when first setting up, and when resuming. */
|
||||
static int talk_to_blkback(struct xenbus_device *dev,
|
||||
struct blkfront_info *info)
|
||||
@@ -1873,8 +1882,9 @@ again:
|
||||
message = "writing protocol";
|
||||
goto abort_transaction;
|
||||
}
|
||||
info->feature_persistent_parm = feature_persistent;
|
||||
err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u",
|
||||
info->feature_persistent);
|
||||
info->feature_persistent_parm);
|
||||
if (err)
|
||||
dev_warn(&dev->dev,
|
||||
"writing persistent grants feature to xenbus");
|
||||
@@ -1942,12 +1952,6 @@ static int negotiate_mq(struct blkfront_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Enable the persistent grants feature. */
|
||||
static bool feature_persistent = true;
|
||||
module_param(feature_persistent, bool, 0644);
|
||||
MODULE_PARM_DESC(feature_persistent,
|
||||
"Enables the persistent grants feature");
|
||||
|
||||
/*
|
||||
* Entry point to this code when a new device is created. Allocate the basic
|
||||
* structures and the ring buffer for communication with the backend, and
|
||||
@@ -2307,7 +2311,7 @@ static void blkfront_gather_backend_features(struct blkfront_info *info)
|
||||
if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0))
|
||||
blkfront_setup_discard(info);
|
||||
|
||||
if (feature_persistent)
|
||||
if (info->feature_persistent_parm)
|
||||
info->feature_persistent =
|
||||
!!xenbus_read_unsigned(info->xbdev->otherend,
|
||||
"feature-persistent", 0);
|
||||
|
||||
@@ -139,7 +139,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
|
||||
ret = raspberrypi_clock_property(rpi->firmware, data,
|
||||
RPI_FIRMWARE_GET_CLOCK_RATE, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
return 0;
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
ret = raspberrypi_clock_property(rpi->firmware, data,
|
||||
RPI_FIRMWARE_SET_CLOCK_RATE, &_rate);
|
||||
if (ret)
|
||||
dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d",
|
||||
dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d\n",
|
||||
clk_hw_get_name(hw), ret);
|
||||
|
||||
return ret;
|
||||
@@ -208,7 +208,7 @@ static struct clk_hw *raspberrypi_clk_register(struct raspberrypi_clk *rpi,
|
||||
RPI_FIRMWARE_GET_MIN_CLOCK_RATE,
|
||||
&min_rate);
|
||||
if (ret) {
|
||||
dev_err(rpi->dev, "Failed to get clock %d min freq: %d",
|
||||
dev_err(rpi->dev, "Failed to get clock %d min freq: %d\n",
|
||||
id, ret);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
@@ -251,8 +251,13 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi,
|
||||
struct rpi_firmware_get_clocks_response *clks;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* The firmware doesn't guarantee that the last element of
|
||||
* RPI_FIRMWARE_GET_CLOCKS is zeroed. So allocate an additional
|
||||
* zero element as sentinel.
|
||||
*/
|
||||
clks = devm_kcalloc(rpi->dev,
|
||||
sizeof(*clks), RPI_FIRMWARE_NUM_CLK_ID,
|
||||
RPI_FIRMWARE_NUM_CLK_ID + 1, sizeof(*clks),
|
||||
GFP_KERNEL);
|
||||
if (!clks)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -848,10 +848,9 @@ static void clk_core_unprepare(struct clk_core *core)
|
||||
if (core->ops->unprepare)
|
||||
core->ops->unprepare(core->hw);
|
||||
|
||||
clk_pm_runtime_put(core);
|
||||
|
||||
trace_clk_unprepare_complete(core);
|
||||
clk_core_unprepare(core->parent);
|
||||
clk_pm_runtime_put(core);
|
||||
}
|
||||
|
||||
static void clk_core_unprepare_lock(struct clk_core *core)
|
||||
|
||||
@@ -1163,7 +1163,9 @@ static int pca953x_suspend(struct device *dev)
|
||||
{
|
||||
struct pca953x_chip *chip = dev_get_drvdata(dev);
|
||||
|
||||
mutex_lock(&chip->i2c_lock);
|
||||
regcache_cache_only(chip->regmap, true);
|
||||
mutex_unlock(&chip->i2c_lock);
|
||||
|
||||
if (atomic_read(&chip->wakeup_path))
|
||||
device_set_wakeup_path(dev);
|
||||
@@ -1186,13 +1188,17 @@ static int pca953x_resume(struct device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
mutex_lock(&chip->i2c_lock);
|
||||
regcache_cache_only(chip->regmap, false);
|
||||
regcache_mark_dirty(chip->regmap);
|
||||
ret = pca953x_regcache_sync(dev);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
mutex_unlock(&chip->i2c_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = regcache_sync(chip->regmap);
|
||||
mutex_unlock(&chip->i2c_lock);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to restore register map: %d\n", ret);
|
||||
return ret;
|
||||
|
||||
@@ -249,6 +249,7 @@ i915-y += \
|
||||
display/g4x_dp.o \
|
||||
display/g4x_hdmi.o \
|
||||
display/icl_dsi.o \
|
||||
display/intel_backlight.o \
|
||||
display/intel_crt.o \
|
||||
display/intel_ddi.o \
|
||||
display/intel_ddi_buf_trans.o \
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "g4x_dp.h"
|
||||
#include "intel_audio.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
#include "intel_fifo_underrun.h"
|
||||
#include "intel_hdmi.h"
|
||||
#include "intel_hotplug.h"
|
||||
#include "intel_panel.h"
|
||||
#include "intel_pps.h"
|
||||
#include "intel_sideband.h"
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_combo_phy.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
|
||||
1776
drivers/gpu/drm/i915/display/intel_backlight.c
Normal file
1776
drivers/gpu/drm/i915/display/intel_backlight.c
Normal file
File diff suppressed because it is too large
Load Diff
51
drivers/gpu/drm/i915/display/intel_backlight.h
Normal file
51
drivers/gpu/drm/i915/display/intel_backlight.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __INTEL_BACKLIGHT_H__
|
||||
#define __INTEL_BACKLIGHT_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_connector;
|
||||
struct drm_connector_state;
|
||||
struct intel_atomic_state;
|
||||
struct intel_connector;
|
||||
struct intel_crtc_state;
|
||||
struct intel_encoder;
|
||||
struct intel_panel;
|
||||
enum pipe;
|
||||
|
||||
void intel_panel_init_backlight_funcs(struct intel_panel *panel);
|
||||
void intel_panel_destroy_backlight(struct intel_panel *panel);
|
||||
void intel_panel_set_backlight_acpi(const struct drm_connector_state *conn_state,
|
||||
u32 level, u32 max);
|
||||
int intel_panel_setup_backlight(struct drm_connector *connector,
|
||||
enum pipe pipe);
|
||||
void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state);
|
||||
void intel_panel_update_backlight(struct intel_atomic_state *state,
|
||||
struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state);
|
||||
void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
|
||||
void intel_panel_set_pwm_level(const struct drm_connector_state *conn_state, u32 level);
|
||||
u32 intel_panel_invert_pwm_level(struct intel_connector *connector, u32 level);
|
||||
u32 intel_panel_backlight_level_to_pwm(struct intel_connector *connector, u32 level);
|
||||
u32 intel_panel_backlight_level_from_pwm(struct intel_connector *connector, u32 val);
|
||||
|
||||
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
|
||||
int intel_backlight_device_register(struct intel_connector *connector);
|
||||
void intel_backlight_device_unregister(struct intel_connector *connector);
|
||||
#else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
|
||||
static inline int intel_backlight_device_register(struct intel_connector *connector)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void intel_backlight_device_unregister(struct intel_connector *connector)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
|
||||
|
||||
#endif /* __INTEL_BACKLIGHT_H__ */
|
||||
@@ -29,13 +29,13 @@
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
|
||||
#include "display/intel_panel.h"
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_display_debugfs.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_hdcp.h"
|
||||
#include "intel_panel.h"
|
||||
|
||||
int intel_connector_init(struct intel_connector *connector)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_audio.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_combo_phy.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
@@ -49,7 +50,6 @@
|
||||
#include "intel_hdmi.h"
|
||||
#include "intel_hotplug.h"
|
||||
#include "intel_lspcon.h"
|
||||
#include "intel_panel.h"
|
||||
#include "intel_pps.h"
|
||||
#include "intel_psr.h"
|
||||
#include "intel_snps_phy.h"
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "i915_drv.h"
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_audio.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_ddi.h"
|
||||
#include "intel_de.h"
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
* for some reason.
|
||||
*/
|
||||
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
#include "intel_dp_aux_backlight.h"
|
||||
#include "intel_panel.h"
|
||||
|
||||
/* TODO:
|
||||
* Implement HDR, right now we just implement the bare minimum to bring us back into SDR mode so we
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
|
||||
@@ -30,10 +30,9 @@
|
||||
#include <linux/firmware.h>
|
||||
#include <acpi/video.h>
|
||||
|
||||
#include "display/intel_panel.h"
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_acpi.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_opregion.h"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,15 +8,13 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "intel_display.h"
|
||||
|
||||
enum drm_connector_status;
|
||||
struct drm_connector;
|
||||
struct drm_connector_state;
|
||||
struct drm_display_mode;
|
||||
struct drm_i915_private;
|
||||
struct intel_connector;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
struct intel_encoder;
|
||||
struct intel_panel;
|
||||
|
||||
int intel_panel_init(struct intel_panel *panel,
|
||||
@@ -31,17 +29,6 @@ int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state);
|
||||
int intel_gmch_panel_fitting(struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state);
|
||||
void intel_panel_set_backlight_acpi(const struct drm_connector_state *conn_state,
|
||||
u32 level, u32 max);
|
||||
int intel_panel_setup_backlight(struct drm_connector *connector,
|
||||
enum pipe pipe);
|
||||
void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state);
|
||||
void intel_panel_update_backlight(struct intel_atomic_state *state,
|
||||
struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state);
|
||||
void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
|
||||
struct drm_display_mode *
|
||||
intel_panel_edid_downclock_mode(struct intel_connector *connector,
|
||||
const struct drm_display_mode *fixed_mode);
|
||||
@@ -49,22 +36,5 @@ struct drm_display_mode *
|
||||
intel_panel_edid_fixed_mode(struct intel_connector *connector);
|
||||
struct drm_display_mode *
|
||||
intel_panel_vbt_fixed_mode(struct intel_connector *connector);
|
||||
void intel_panel_set_pwm_level(const struct drm_connector_state *conn_state, u32 level);
|
||||
u32 intel_panel_invert_pwm_level(struct intel_connector *connector, u32 level);
|
||||
u32 intel_panel_backlight_level_to_pwm(struct intel_connector *connector, u32 level);
|
||||
u32 intel_panel_backlight_level_from_pwm(struct intel_connector *connector, u32 val);
|
||||
|
||||
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
|
||||
int intel_backlight_device_register(struct intel_connector *connector);
|
||||
void intel_backlight_device_unregister(struct intel_connector *connector);
|
||||
#else /* CONFIG_BACKLIGHT_CLASS_DEVICE */
|
||||
static inline int intel_backlight_device_register(struct intel_connector *connector)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void intel_backlight_device_unregister(struct intel_connector *connector)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_BACKLIGHT_CLASS_DEVICE */
|
||||
|
||||
#endif /* __INTEL_PANEL_H__ */
|
||||
|
||||
@@ -190,6 +190,9 @@ static struct intel_quirk intel_quirks[] = {
|
||||
/* ASRock ITX*/
|
||||
{ 0x3185, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
|
||||
{ 0x3184, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
|
||||
/* ECS Liva Q2 */
|
||||
{ 0x3185, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time },
|
||||
{ 0x3184, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time },
|
||||
};
|
||||
|
||||
void intel_init_quirks(struct drm_i915_private *i915)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
|
||||
@@ -909,7 +909,7 @@ static int update_fdi_rx_iir_status(struct intel_vgpu *vgpu,
|
||||
else if (FDI_RX_IMR_TO_PIPE(offset) != INVALID_INDEX)
|
||||
index = FDI_RX_IMR_TO_PIPE(offset);
|
||||
else {
|
||||
gvt_vgpu_err("Unsupport registers %x\n", offset);
|
||||
gvt_vgpu_err("Unsupported registers %x\n", offset);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -6638,7 +6638,10 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
|
||||
enum plane_id plane_id;
|
||||
u8 slices;
|
||||
|
||||
skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
|
||||
memset(&crtc_state->wm.skl.optimal, 0,
|
||||
sizeof(crtc_state->wm.skl.optimal));
|
||||
if (crtc_state->hw.active)
|
||||
skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
|
||||
crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal;
|
||||
|
||||
memset(&dbuf_state->ddb[pipe], 0, sizeof(dbuf_state->ddb[pipe]));
|
||||
@@ -6649,6 +6652,9 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
|
||||
struct skl_ddb_entry *ddb_uv =
|
||||
&crtc_state->wm.skl.plane_ddb_uv[plane_id];
|
||||
|
||||
if (!crtc_state->hw.active)
|
||||
continue;
|
||||
|
||||
skl_ddb_get_hw_plane_state(dev_priv, crtc->pipe,
|
||||
plane_id, ddb_y, ddb_uv);
|
||||
|
||||
|
||||
@@ -1198,7 +1198,7 @@ static int dp_ctrl_link_train_2(struct dp_ctrl_private *ctrl,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dp_ctrl_train_pattern_set(ctrl, pattern | DP_RECOVERED_CLOCK_OUT_EN);
|
||||
dp_ctrl_train_pattern_set(ctrl, pattern);
|
||||
|
||||
for (tries = 0; tries <= maximum_retries; tries++) {
|
||||
drm_dp_link_train_channel_eq_delay(ctrl->aux, ctrl->panel->dpcd);
|
||||
|
||||
@@ -109,7 +109,7 @@ static const char * const dsi_8996_bus_clk_names[] = {
|
||||
static const struct msm_dsi_config msm8996_dsi_cfg = {
|
||||
.io_offset = DSI_6G_REG_SHIFT,
|
||||
.reg_cfg = {
|
||||
.num = 2,
|
||||
.num = 3,
|
||||
.regs = {
|
||||
{"vdda", 18160, 1 }, /* 1.25 V */
|
||||
{"vcca", 17000, 32 }, /* 0.925 V */
|
||||
@@ -148,7 +148,7 @@ static const char * const dsi_sdm660_bus_clk_names[] = {
|
||||
static const struct msm_dsi_config sdm660_dsi_cfg = {
|
||||
.io_offset = DSI_6G_REG_SHIFT,
|
||||
.reg_cfg = {
|
||||
.num = 2,
|
||||
.num = 1,
|
||||
.regs = {
|
||||
{"vdda", 12560, 4 }, /* 1.2 V */
|
||||
},
|
||||
|
||||
@@ -347,7 +347,7 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
|
||||
} else {
|
||||
timing->shared_timings.clk_pre =
|
||||
linear_inter(tmax, tmin, pcnt2, 0, false);
|
||||
timing->shared_timings.clk_pre_inc_by_2 = 0;
|
||||
timing->shared_timings.clk_pre_inc_by_2 = 0;
|
||||
}
|
||||
|
||||
timing->ta_go = 3;
|
||||
|
||||
@@ -391,6 +391,9 @@ static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
|
||||
if (!fan_data)
|
||||
return -EINVAL;
|
||||
|
||||
if (state >= fan_data->num_speed)
|
||||
return -EINVAL;
|
||||
|
||||
set_fan_speed(fan_data, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -287,10 +287,8 @@ static int ad7292_probe(struct spi_device *spi)
|
||||
|
||||
ret = devm_add_action_or_reset(&spi->dev,
|
||||
ad7292_regulator_disable, st);
|
||||
if (ret) {
|
||||
regulator_disable(st->reg);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = regulator_get_voltage(st->reg);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
#define MCP3911_CHANNEL(x) (MCP3911_REG_CHANNEL0 + x * 3)
|
||||
#define MCP3911_OFFCAL(x) (MCP3911_REG_OFFCAL_CH0 + x * 6)
|
||||
|
||||
/* Internal voltage reference in uV */
|
||||
#define MCP3911_INT_VREF_UV 1200000
|
||||
/* Internal voltage reference in mV */
|
||||
#define MCP3911_INT_VREF_MV 1200
|
||||
|
||||
#define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 5) | (1 << 0)) & 0xff)
|
||||
#define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 5) | (0 << 0)) & 0xff)
|
||||
@@ -111,6 +111,8 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
*val = sign_extend32(*val, 23);
|
||||
|
||||
ret = IIO_VAL_INT;
|
||||
break;
|
||||
|
||||
@@ -135,11 +137,18 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev,
|
||||
|
||||
*val = ret / 1000;
|
||||
} else {
|
||||
*val = MCP3911_INT_VREF_UV;
|
||||
*val = MCP3911_INT_VREF_MV;
|
||||
}
|
||||
|
||||
*val2 = 24;
|
||||
ret = IIO_VAL_FRACTIONAL_LOG2;
|
||||
/*
|
||||
* For 24bit Conversion
|
||||
* Raw = ((Voltage)/(Vref) * 2^23 * Gain * 1.5
|
||||
* Voltage = Raw * (Vref)/(2^23 * Gain * 1.5)
|
||||
*/
|
||||
|
||||
/* val2 = (2^23 * 1.5) */
|
||||
*val2 = 12582912;
|
||||
ret = IIO_VAL_FRACTIONAL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ static void iforce_serio_xmit(struct iforce *iforce)
|
||||
|
||||
again:
|
||||
if (iforce->xmit.head == iforce->xmit.tail) {
|
||||
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||
iforce_clear_xmit_and_wake(iforce);
|
||||
spin_unlock_irqrestore(&iforce->xmit_lock, flags);
|
||||
return;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ again:
|
||||
if (test_and_clear_bit(IFORCE_XMIT_AGAIN, iforce->xmit_flags))
|
||||
goto again;
|
||||
|
||||
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||
iforce_clear_xmit_and_wake(iforce);
|
||||
|
||||
spin_unlock_irqrestore(&iforce->xmit_lock, flags);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ static irqreturn_t iforce_serio_irq(struct serio *serio,
|
||||
iforce_serio->cmd_response_len = iforce_serio->len;
|
||||
|
||||
/* Signal that command is done */
|
||||
wake_up(&iforce->wait);
|
||||
wake_up_all(&iforce->wait);
|
||||
} else if (likely(iforce->type)) {
|
||||
iforce_process_packet(iforce, iforce_serio->id,
|
||||
iforce_serio->data_in,
|
||||
|
||||
@@ -30,7 +30,7 @@ static void __iforce_usb_xmit(struct iforce *iforce)
|
||||
spin_lock_irqsave(&iforce->xmit_lock, flags);
|
||||
|
||||
if (iforce->xmit.head == iforce->xmit.tail) {
|
||||
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||
iforce_clear_xmit_and_wake(iforce);
|
||||
spin_unlock_irqrestore(&iforce->xmit_lock, flags);
|
||||
return;
|
||||
}
|
||||
@@ -58,9 +58,9 @@ static void __iforce_usb_xmit(struct iforce *iforce)
|
||||
XMIT_INC(iforce->xmit.tail, n);
|
||||
|
||||
if ( (n=usb_submit_urb(iforce_usb->out, GFP_ATOMIC)) ) {
|
||||
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||
dev_warn(&iforce_usb->intf->dev,
|
||||
"usb_submit_urb failed %d\n", n);
|
||||
iforce_clear_xmit_and_wake(iforce);
|
||||
}
|
||||
|
||||
/* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.
|
||||
@@ -175,15 +175,15 @@ static void iforce_usb_out(struct urb *urb)
|
||||
struct iforce *iforce = &iforce_usb->iforce;
|
||||
|
||||
if (urb->status) {
|
||||
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||
dev_dbg(&iforce_usb->intf->dev, "urb->status %d, exiting\n",
|
||||
urb->status);
|
||||
iforce_clear_xmit_and_wake(iforce);
|
||||
return;
|
||||
}
|
||||
|
||||
__iforce_usb_xmit(iforce);
|
||||
|
||||
wake_up(&iforce->wait);
|
||||
wake_up_all(&iforce->wait);
|
||||
}
|
||||
|
||||
static int iforce_usb_probe(struct usb_interface *intf,
|
||||
|
||||
@@ -119,6 +119,12 @@ static inline int iforce_get_id_packet(struct iforce *iforce, u8 id,
|
||||
response_data, response_len);
|
||||
}
|
||||
|
||||
static inline void iforce_clear_xmit_and_wake(struct iforce *iforce)
|
||||
{
|
||||
clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
|
||||
wake_up_all(&iforce->wait);
|
||||
}
|
||||
|
||||
/* Public functions */
|
||||
/* iforce-main.c */
|
||||
int iforce_init_device(struct device *parent, u16 bustype,
|
||||
|
||||
@@ -98,6 +98,7 @@ static struct platform_driver rk805_pwrkey_driver = {
|
||||
};
|
||||
module_platform_driver(rk805_pwrkey_driver);
|
||||
|
||||
MODULE_ALIAS("platform:rk805-pwrkey");
|
||||
MODULE_AUTHOR("Joseph Chen <chenjh@rock-chips.com>");
|
||||
MODULE_DESCRIPTION("RK805 PMIC Power Key driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -1416,42 +1416,37 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
|
||||
{
|
||||
int ret;
|
||||
struct device *dev = ir->dev;
|
||||
char *data;
|
||||
|
||||
data = kzalloc(USB_CTRL_MSG_SZ, GFP_KERNEL);
|
||||
if (!data) {
|
||||
dev_err(dev, "%s: memory allocation failed!", __func__);
|
||||
return;
|
||||
}
|
||||
char data[USB_CTRL_MSG_SZ];
|
||||
|
||||
/*
|
||||
* This is a strange one. Windows issues a set address to the device
|
||||
* on the receive control pipe and expect a certain value pair back
|
||||
*/
|
||||
ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
|
||||
USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
|
||||
data, USB_CTRL_MSG_SZ, 3000);
|
||||
ret = usb_control_msg_recv(ir->usbdev, 0, USB_REQ_SET_ADDRESS,
|
||||
USB_DIR_IN | USB_TYPE_VENDOR,
|
||||
0, 0, data, USB_CTRL_MSG_SZ, 3000,
|
||||
GFP_KERNEL);
|
||||
dev_dbg(dev, "set address - ret = %d", ret);
|
||||
dev_dbg(dev, "set address - data[0] = %d, data[1] = %d",
|
||||
data[0], data[1]);
|
||||
|
||||
/* set feature: bit rate 38400 bps */
|
||||
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
|
||||
USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
|
||||
0xc04e, 0x0000, NULL, 0, 3000);
|
||||
ret = usb_control_msg_send(ir->usbdev, 0,
|
||||
USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
|
||||
0xc04e, 0x0000, NULL, 0, 3000, GFP_KERNEL);
|
||||
|
||||
dev_dbg(dev, "set feature - ret = %d", ret);
|
||||
|
||||
/* bRequest 4: set char length to 8 bits */
|
||||
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
|
||||
4, USB_TYPE_VENDOR,
|
||||
0x0808, 0x0000, NULL, 0, 3000);
|
||||
ret = usb_control_msg_send(ir->usbdev, 0,
|
||||
4, USB_TYPE_VENDOR,
|
||||
0x0808, 0x0000, NULL, 0, 3000, GFP_KERNEL);
|
||||
dev_dbg(dev, "set char length - retB = %d", ret);
|
||||
|
||||
/* bRequest 2: set handshaking to use DTR/DSR */
|
||||
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
|
||||
2, USB_TYPE_VENDOR,
|
||||
0x0000, 0x0100, NULL, 0, 3000);
|
||||
ret = usb_control_msg_send(ir->usbdev, 0,
|
||||
2, USB_TYPE_VENDOR,
|
||||
0x0000, 0x0100, NULL, 0, 3000, GFP_KERNEL);
|
||||
dev_dbg(dev, "set handshake - retC = %d", ret);
|
||||
|
||||
/* device resume */
|
||||
@@ -1459,8 +1454,6 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
|
||||
|
||||
/* get hw/sw revision? */
|
||||
mce_command_out(ir, GET_REVISION, sizeof(GET_REVISION));
|
||||
|
||||
kfree(data);
|
||||
}
|
||||
|
||||
static void mceusb_gen2_init(struct mceusb_dev *ir)
|
||||
|
||||
@@ -1550,7 +1550,12 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
|
||||
of_property_read_u32(dev->of_node, "qcom,nsessions", &sessions);
|
||||
|
||||
spin_lock_irqsave(&cctx->lock, flags);
|
||||
sess = &cctx->session[cctx->sesscount];
|
||||
if (cctx->sesscount >= FASTRPC_MAX_SESSIONS) {
|
||||
dev_err(&pdev->dev, "too many sessions\n");
|
||||
spin_unlock_irqrestore(&cctx->lock, flags);
|
||||
return -ENOSPC;
|
||||
}
|
||||
sess = &cctx->session[cctx->sesscount++];
|
||||
sess->used = false;
|
||||
sess->valid = true;
|
||||
sess->dev = dev;
|
||||
@@ -1563,13 +1568,12 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
|
||||
struct fastrpc_session_ctx *dup_sess;
|
||||
|
||||
for (i = 1; i < sessions; i++) {
|
||||
if (cctx->sesscount++ >= FASTRPC_MAX_SESSIONS)
|
||||
if (cctx->sesscount >= FASTRPC_MAX_SESSIONS)
|
||||
break;
|
||||
dup_sess = &cctx->session[cctx->sesscount];
|
||||
dup_sess = &cctx->session[cctx->sesscount++];
|
||||
memcpy(dup_sess, sess, sizeof(*dup_sess));
|
||||
}
|
||||
}
|
||||
cctx->sesscount++;
|
||||
spin_unlock_irqrestore(&cctx->lock, flags);
|
||||
rc = dma_set_mask(dev, DMA_BIT_MASK(32));
|
||||
if (rc) {
|
||||
|
||||
@@ -946,15 +946,16 @@ int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card,
|
||||
|
||||
/* Erase init depends on CSD and SSR */
|
||||
mmc_init_erase(card);
|
||||
|
||||
/*
|
||||
* Fetch switch information from card.
|
||||
*/
|
||||
err = mmc_read_switch(card);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetch switch information from card. Note, sd3_bus_mode can change if
|
||||
* voltage switch outcome changes, so do this always.
|
||||
*/
|
||||
err = mmc_read_switch(card);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/*
|
||||
* For SPI, enable CRC as appropriate.
|
||||
* This CRC enable is located AFTER the reading of the
|
||||
@@ -1477,26 +1478,15 @@ retry:
|
||||
if (!v18_fixup_failed && !mmc_host_is_spi(host) && mmc_host_uhs(host) &&
|
||||
mmc_sd_card_using_v18(card) &&
|
||||
host->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
|
||||
/*
|
||||
* Re-read switch information in case it has changed since
|
||||
* oldcard was initialized.
|
||||
*/
|
||||
if (oldcard) {
|
||||
err = mmc_read_switch(card);
|
||||
if (err)
|
||||
goto free_card;
|
||||
}
|
||||
if (mmc_sd_card_using_v18(card)) {
|
||||
if (mmc_host_set_uhs_voltage(host) ||
|
||||
mmc_sd_init_uhs_card(card)) {
|
||||
v18_fixup_failed = true;
|
||||
mmc_power_cycle(host, ocr);
|
||||
if (!oldcard)
|
||||
mmc_remove_card(card);
|
||||
goto retry;
|
||||
}
|
||||
goto done;
|
||||
if (mmc_host_set_uhs_voltage(host) ||
|
||||
mmc_sd_init_uhs_card(card)) {
|
||||
v18_fixup_failed = true;
|
||||
mmc_power_cycle(host, ocr);
|
||||
if (!oldcard)
|
||||
mmc_remove_card(card);
|
||||
goto retry;
|
||||
}
|
||||
goto cont;
|
||||
}
|
||||
|
||||
/* Initialization sequence for UHS-I cards */
|
||||
@@ -1531,7 +1521,7 @@ retry:
|
||||
mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
|
||||
}
|
||||
}
|
||||
|
||||
cont:
|
||||
if (!oldcard) {
|
||||
/* Read/parse the extension registers. */
|
||||
err = sd_read_ext_regs(card);
|
||||
@@ -1563,7 +1553,7 @@ retry:
|
||||
err = -EINVAL;
|
||||
goto free_card;
|
||||
}
|
||||
done:
|
||||
|
||||
host->card = card;
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ static void xrs700x_read_port_counters(struct xrs700x *priv, int port)
|
||||
{
|
||||
struct xrs700x_port *p = &priv->ports[port];
|
||||
struct rtnl_link_stats64 stats;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
memset(&stats, 0, sizeof(stats));
|
||||
@@ -137,9 +138,9 @@ static void xrs700x_read_port_counters(struct xrs700x *priv, int port)
|
||||
*/
|
||||
stats.rx_packets += stats.multicast;
|
||||
|
||||
u64_stats_update_begin(&p->syncp);
|
||||
flags = u64_stats_update_begin_irqsave(&p->syncp);
|
||||
p->stats64 = stats;
|
||||
u64_stats_update_end(&p->syncp);
|
||||
u64_stats_update_end_irqrestore(&p->syncp, flags);
|
||||
|
||||
mutex_unlock(&p->mib_mutex);
|
||||
}
|
||||
|
||||
@@ -1920,7 +1920,7 @@ static void gmac_get_stats64(struct net_device *netdev,
|
||||
|
||||
/* Racing with RX NAPI */
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&port->rx_stats_syncp);
|
||||
start = u64_stats_fetch_begin_irq(&port->rx_stats_syncp);
|
||||
|
||||
stats->rx_packets = port->stats.rx_packets;
|
||||
stats->rx_bytes = port->stats.rx_bytes;
|
||||
@@ -1932,11 +1932,11 @@ static void gmac_get_stats64(struct net_device *netdev,
|
||||
stats->rx_crc_errors = port->stats.rx_crc_errors;
|
||||
stats->rx_frame_errors = port->stats.rx_frame_errors;
|
||||
|
||||
} while (u64_stats_fetch_retry(&port->rx_stats_syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&port->rx_stats_syncp, start));
|
||||
|
||||
/* Racing with MIB and TX completion interrupts */
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&port->ir_stats_syncp);
|
||||
start = u64_stats_fetch_begin_irq(&port->ir_stats_syncp);
|
||||
|
||||
stats->tx_errors = port->stats.tx_errors;
|
||||
stats->tx_packets = port->stats.tx_packets;
|
||||
@@ -1946,15 +1946,15 @@ static void gmac_get_stats64(struct net_device *netdev,
|
||||
stats->rx_missed_errors = port->stats.rx_missed_errors;
|
||||
stats->rx_fifo_errors = port->stats.rx_fifo_errors;
|
||||
|
||||
} while (u64_stats_fetch_retry(&port->ir_stats_syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&port->ir_stats_syncp, start));
|
||||
|
||||
/* Racing with hard_start_xmit */
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&port->tx_stats_syncp);
|
||||
start = u64_stats_fetch_begin_irq(&port->tx_stats_syncp);
|
||||
|
||||
stats->tx_dropped = port->stats.tx_dropped;
|
||||
|
||||
} while (u64_stats_fetch_retry(&port->tx_stats_syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&port->tx_stats_syncp, start));
|
||||
|
||||
stats->rx_dropped += stats->rx_missed_errors;
|
||||
}
|
||||
@@ -2032,18 +2032,18 @@ static void gmac_get_ethtool_stats(struct net_device *netdev,
|
||||
/* Racing with MIB interrupt */
|
||||
do {
|
||||
p = values;
|
||||
start = u64_stats_fetch_begin(&port->ir_stats_syncp);
|
||||
start = u64_stats_fetch_begin_irq(&port->ir_stats_syncp);
|
||||
|
||||
for (i = 0; i < RX_STATS_NUM; i++)
|
||||
*p++ = port->hw_stats[i];
|
||||
|
||||
} while (u64_stats_fetch_retry(&port->ir_stats_syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&port->ir_stats_syncp, start));
|
||||
values = p;
|
||||
|
||||
/* Racing with RX NAPI */
|
||||
do {
|
||||
p = values;
|
||||
start = u64_stats_fetch_begin(&port->rx_stats_syncp);
|
||||
start = u64_stats_fetch_begin_irq(&port->rx_stats_syncp);
|
||||
|
||||
for (i = 0; i < RX_STATUS_NUM; i++)
|
||||
*p++ = port->rx_stats[i];
|
||||
@@ -2051,13 +2051,13 @@ static void gmac_get_ethtool_stats(struct net_device *netdev,
|
||||
*p++ = port->rx_csum_stats[i];
|
||||
*p++ = port->rx_napi_exits;
|
||||
|
||||
} while (u64_stats_fetch_retry(&port->rx_stats_syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&port->rx_stats_syncp, start));
|
||||
values = p;
|
||||
|
||||
/* Racing with TX start_xmit */
|
||||
do {
|
||||
p = values;
|
||||
start = u64_stats_fetch_begin(&port->tx_stats_syncp);
|
||||
start = u64_stats_fetch_begin_irq(&port->tx_stats_syncp);
|
||||
|
||||
for (i = 0; i < TX_MAX_FRAGS; i++) {
|
||||
*values++ = port->tx_frag_stats[i];
|
||||
@@ -2066,7 +2066,7 @@ static void gmac_get_ethtool_stats(struct net_device *netdev,
|
||||
*values++ = port->tx_frags_linearized;
|
||||
*values++ = port->tx_hw_csummed;
|
||||
|
||||
} while (u64_stats_fetch_retry(&port->tx_stats_syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&port->tx_stats_syncp, start));
|
||||
}
|
||||
|
||||
static int gmac_get_ksettings(struct net_device *netdev,
|
||||
|
||||
@@ -174,14 +174,14 @@ gve_get_ethtool_stats(struct net_device *netdev,
|
||||
struct gve_rx_ring *rx = &priv->rx[ring];
|
||||
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->rx[ring].statss);
|
||||
u64_stats_fetch_begin_irq(&priv->rx[ring].statss);
|
||||
tmp_rx_pkts = rx->rpackets;
|
||||
tmp_rx_bytes = rx->rbytes;
|
||||
tmp_rx_skb_alloc_fail = rx->rx_skb_alloc_fail;
|
||||
tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
|
||||
tmp_rx_desc_err_dropped_pkt =
|
||||
rx->rx_desc_err_dropped_pkt;
|
||||
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
|
||||
} while (u64_stats_fetch_retry_irq(&priv->rx[ring].statss,
|
||||
start));
|
||||
rx_pkts += tmp_rx_pkts;
|
||||
rx_bytes += tmp_rx_bytes;
|
||||
@@ -195,10 +195,10 @@ gve_get_ethtool_stats(struct net_device *netdev,
|
||||
if (priv->tx) {
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->tx[ring].statss);
|
||||
u64_stats_fetch_begin_irq(&priv->tx[ring].statss);
|
||||
tmp_tx_pkts = priv->tx[ring].pkt_done;
|
||||
tmp_tx_bytes = priv->tx[ring].bytes_done;
|
||||
} while (u64_stats_fetch_retry(&priv->tx[ring].statss,
|
||||
} while (u64_stats_fetch_retry_irq(&priv->tx[ring].statss,
|
||||
start));
|
||||
tx_pkts += tmp_tx_pkts;
|
||||
tx_bytes += tmp_tx_bytes;
|
||||
@@ -256,13 +256,13 @@ gve_get_ethtool_stats(struct net_device *netdev,
|
||||
data[i++] = rx->cnt;
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->rx[ring].statss);
|
||||
u64_stats_fetch_begin_irq(&priv->rx[ring].statss);
|
||||
tmp_rx_bytes = rx->rbytes;
|
||||
tmp_rx_skb_alloc_fail = rx->rx_skb_alloc_fail;
|
||||
tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
|
||||
tmp_rx_desc_err_dropped_pkt =
|
||||
rx->rx_desc_err_dropped_pkt;
|
||||
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
|
||||
} while (u64_stats_fetch_retry_irq(&priv->rx[ring].statss,
|
||||
start));
|
||||
data[i++] = tmp_rx_bytes;
|
||||
/* rx dropped packets */
|
||||
@@ -323,9 +323,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
|
||||
}
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->tx[ring].statss);
|
||||
u64_stats_fetch_begin_irq(&priv->tx[ring].statss);
|
||||
tmp_tx_bytes = tx->bytes_done;
|
||||
} while (u64_stats_fetch_retry(&priv->tx[ring].statss,
|
||||
} while (u64_stats_fetch_retry_irq(&priv->tx[ring].statss,
|
||||
start));
|
||||
data[i++] = tmp_tx_bytes;
|
||||
data[i++] = tx->wake_queue;
|
||||
|
||||
@@ -51,10 +51,10 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->rx[ring].statss);
|
||||
u64_stats_fetch_begin_irq(&priv->rx[ring].statss);
|
||||
packets = priv->rx[ring].rpackets;
|
||||
bytes = priv->rx[ring].rbytes;
|
||||
} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
|
||||
} while (u64_stats_fetch_retry_irq(&priv->rx[ring].statss,
|
||||
start));
|
||||
s->rx_packets += packets;
|
||||
s->rx_bytes += bytes;
|
||||
@@ -64,10 +64,10 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
|
||||
for (ring = 0; ring < priv->tx_cfg.num_queues; ring++) {
|
||||
do {
|
||||
start =
|
||||
u64_stats_fetch_begin(&priv->tx[ring].statss);
|
||||
u64_stats_fetch_begin_irq(&priv->tx[ring].statss);
|
||||
packets = priv->tx[ring].pkt_done;
|
||||
bytes = priv->tx[ring].bytes_done;
|
||||
} while (u64_stats_fetch_retry(&priv->tx[ring].statss,
|
||||
} while (u64_stats_fetch_retry_irq(&priv->tx[ring].statss,
|
||||
start));
|
||||
s->tx_packets += packets;
|
||||
s->tx_bytes += bytes;
|
||||
@@ -1260,9 +1260,9 @@ void gve_handle_report_stats(struct gve_priv *priv)
|
||||
}
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&priv->tx[idx].statss);
|
||||
start = u64_stats_fetch_begin_irq(&priv->tx[idx].statss);
|
||||
tx_bytes = priv->tx[idx].bytes_done;
|
||||
} while (u64_stats_fetch_retry(&priv->tx[idx].statss, start));
|
||||
} while (u64_stats_fetch_retry_irq(&priv->tx[idx].statss, start));
|
||||
stats[stats_idx++] = (struct stats) {
|
||||
.stat_name = cpu_to_be32(TX_WAKE_CNT),
|
||||
.value = cpu_to_be64(priv->tx[idx].wake_queue),
|
||||
|
||||
@@ -74,14 +74,14 @@ void hinic_rxq_get_stats(struct hinic_rxq *rxq, struct hinic_rxq_stats *stats)
|
||||
unsigned int start;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&rxq_stats->syncp);
|
||||
start = u64_stats_fetch_begin_irq(&rxq_stats->syncp);
|
||||
stats->pkts = rxq_stats->pkts;
|
||||
stats->bytes = rxq_stats->bytes;
|
||||
stats->errors = rxq_stats->csum_errors +
|
||||
rxq_stats->other_errors;
|
||||
stats->csum_errors = rxq_stats->csum_errors;
|
||||
stats->other_errors = rxq_stats->other_errors;
|
||||
} while (u64_stats_fetch_retry(&rxq_stats->syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&rxq_stats->syncp, start));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,14 +98,14 @@ void hinic_txq_get_stats(struct hinic_txq *txq, struct hinic_txq_stats *stats)
|
||||
unsigned int start;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&txq_stats->syncp);
|
||||
start = u64_stats_fetch_begin_irq(&txq_stats->syncp);
|
||||
stats->pkts = txq_stats->pkts;
|
||||
stats->bytes = txq_stats->bytes;
|
||||
stats->tx_busy = txq_stats->tx_busy;
|
||||
stats->tx_wake = txq_stats->tx_wake;
|
||||
stats->tx_dropped = txq_stats->tx_dropped;
|
||||
stats->big_frags_pkts = txq_stats->big_frags_pkts;
|
||||
} while (u64_stats_fetch_retry(&txq_stats->syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&txq_stats->syncp, start));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,6 +80,7 @@ struct mlxbf_gige {
|
||||
struct net_device *netdev;
|
||||
struct platform_device *pdev;
|
||||
void __iomem *mdio_io;
|
||||
void __iomem *clk_io;
|
||||
struct mii_bus *mdiobus;
|
||||
void __iomem *gpio_io;
|
||||
struct irq_domain *irqdomain;
|
||||
@@ -149,7 +150,8 @@ enum mlxbf_gige_res {
|
||||
MLXBF_GIGE_RES_MDIO9,
|
||||
MLXBF_GIGE_RES_GPIO0,
|
||||
MLXBF_GIGE_RES_LLU,
|
||||
MLXBF_GIGE_RES_PLU
|
||||
MLXBF_GIGE_RES_PLU,
|
||||
MLXBF_GIGE_RES_CLK
|
||||
};
|
||||
|
||||
/* Version of register data returned by mlxbf_gige_get_regs() */
|
||||
|
||||
@@ -22,10 +22,23 @@
|
||||
#include <linux/property.h>
|
||||
|
||||
#include "mlxbf_gige.h"
|
||||
#include "mlxbf_gige_regs.h"
|
||||
|
||||
#define MLXBF_GIGE_MDIO_GW_OFFSET 0x0
|
||||
#define MLXBF_GIGE_MDIO_CFG_OFFSET 0x4
|
||||
|
||||
#define MLXBF_GIGE_MDIO_FREQ_REFERENCE 156250000ULL
|
||||
#define MLXBF_GIGE_MDIO_COREPLL_CONST 16384ULL
|
||||
#define MLXBF_GIGE_MDC_CLK_NS 400
|
||||
#define MLXBF_GIGE_MDIO_PLL_I1CLK_REG1 0x4
|
||||
#define MLXBF_GIGE_MDIO_PLL_I1CLK_REG2 0x8
|
||||
#define MLXBF_GIGE_MDIO_CORE_F_SHIFT 0
|
||||
#define MLXBF_GIGE_MDIO_CORE_F_MASK GENMASK(25, 0)
|
||||
#define MLXBF_GIGE_MDIO_CORE_R_SHIFT 26
|
||||
#define MLXBF_GIGE_MDIO_CORE_R_MASK GENMASK(31, 26)
|
||||
#define MLXBF_GIGE_MDIO_CORE_OD_SHIFT 0
|
||||
#define MLXBF_GIGE_MDIO_CORE_OD_MASK GENMASK(3, 0)
|
||||
|
||||
/* Support clause 22 */
|
||||
#define MLXBF_GIGE_MDIO_CL22_ST1 0x1
|
||||
#define MLXBF_GIGE_MDIO_CL22_WRITE 0x1
|
||||
@@ -50,28 +63,77 @@
|
||||
#define MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK GENMASK(23, 16)
|
||||
#define MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK GENMASK(31, 24)
|
||||
|
||||
/* Formula for encoding the MDIO period. The encoded value is
|
||||
* passed to the MDIO config register.
|
||||
*
|
||||
* mdc_clk = 2*(val + 1)*i1clk
|
||||
*
|
||||
* 400 ns = 2*(val + 1)*(((1/430)*1000) ns)
|
||||
*
|
||||
* val = (((400 * 430 / 1000) / 2) - 1)
|
||||
*/
|
||||
#define MLXBF_GIGE_I1CLK_MHZ 430
|
||||
#define MLXBF_GIGE_MDC_CLK_NS 400
|
||||
|
||||
#define MLXBF_GIGE_MDIO_PERIOD (((MLXBF_GIGE_MDC_CLK_NS * MLXBF_GIGE_I1CLK_MHZ / 1000) / 2) - 1)
|
||||
|
||||
#define MLXBF_GIGE_MDIO_CFG_VAL (FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_MODE_MASK, 1) | \
|
||||
FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO3_3_MASK, 1) | \
|
||||
FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_FULL_DRIVE_MASK, 1) | \
|
||||
FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK, \
|
||||
MLXBF_GIGE_MDIO_PERIOD) | \
|
||||
FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_IN_SAMP_MASK, 6) | \
|
||||
FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDIO_OUT_SAMP_MASK, 13))
|
||||
|
||||
#define MLXBF_GIGE_BF2_COREPLL_ADDR 0x02800c30
|
||||
#define MLXBF_GIGE_BF2_COREPLL_SIZE 0x0000000c
|
||||
|
||||
static struct resource corepll_params[] = {
|
||||
[MLXBF_GIGE_VERSION_BF2] = {
|
||||
.start = MLXBF_GIGE_BF2_COREPLL_ADDR,
|
||||
.end = MLXBF_GIGE_BF2_COREPLL_ADDR + MLXBF_GIGE_BF2_COREPLL_SIZE - 1,
|
||||
.name = "COREPLL_RES"
|
||||
},
|
||||
};
|
||||
|
||||
/* Returns core clock i1clk in Hz */
|
||||
static u64 calculate_i1clk(struct mlxbf_gige *priv)
|
||||
{
|
||||
u8 core_od, core_r;
|
||||
u64 freq_output;
|
||||
u32 reg1, reg2;
|
||||
u32 core_f;
|
||||
|
||||
reg1 = readl(priv->clk_io + MLXBF_GIGE_MDIO_PLL_I1CLK_REG1);
|
||||
reg2 = readl(priv->clk_io + MLXBF_GIGE_MDIO_PLL_I1CLK_REG2);
|
||||
|
||||
core_f = (reg1 & MLXBF_GIGE_MDIO_CORE_F_MASK) >>
|
||||
MLXBF_GIGE_MDIO_CORE_F_SHIFT;
|
||||
core_r = (reg1 & MLXBF_GIGE_MDIO_CORE_R_MASK) >>
|
||||
MLXBF_GIGE_MDIO_CORE_R_SHIFT;
|
||||
core_od = (reg2 & MLXBF_GIGE_MDIO_CORE_OD_MASK) >>
|
||||
MLXBF_GIGE_MDIO_CORE_OD_SHIFT;
|
||||
|
||||
/* Compute PLL output frequency as follow:
|
||||
*
|
||||
* CORE_F / 16384
|
||||
* freq_output = freq_reference * ----------------------------
|
||||
* (CORE_R + 1) * (CORE_OD + 1)
|
||||
*/
|
||||
freq_output = div_u64((MLXBF_GIGE_MDIO_FREQ_REFERENCE * core_f),
|
||||
MLXBF_GIGE_MDIO_COREPLL_CONST);
|
||||
freq_output = div_u64(freq_output, (core_r + 1) * (core_od + 1));
|
||||
|
||||
return freq_output;
|
||||
}
|
||||
|
||||
/* Formula for encoding the MDIO period. The encoded value is
|
||||
* passed to the MDIO config register.
|
||||
*
|
||||
* mdc_clk = 2*(val + 1)*(core clock in sec)
|
||||
*
|
||||
* i1clk is in Hz:
|
||||
* 400 ns = 2*(val + 1)*(1/i1clk)
|
||||
*
|
||||
* val = (((400/10^9) / (1/i1clk) / 2) - 1)
|
||||
* val = (400/2 * i1clk)/10^9 - 1
|
||||
*/
|
||||
static u8 mdio_period_map(struct mlxbf_gige *priv)
|
||||
{
|
||||
u8 mdio_period;
|
||||
u64 i1clk;
|
||||
|
||||
i1clk = calculate_i1clk(priv);
|
||||
|
||||
mdio_period = div_u64((MLXBF_GIGE_MDC_CLK_NS >> 1) * i1clk, 1000000000) - 1;
|
||||
|
||||
return mdio_period;
|
||||
}
|
||||
|
||||
static u32 mlxbf_gige_mdio_create_cmd(u16 data, int phy_add,
|
||||
int phy_reg, u32 opcode)
|
||||
{
|
||||
@@ -123,9 +185,9 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add,
|
||||
int phy_reg, u16 val)
|
||||
{
|
||||
struct mlxbf_gige *priv = bus->priv;
|
||||
u32 temp;
|
||||
u32 cmd;
|
||||
int ret;
|
||||
u32 temp;
|
||||
|
||||
if (phy_reg & MII_ADDR_C45)
|
||||
return -EOPNOTSUPP;
|
||||
@@ -142,18 +204,44 @@ static int mlxbf_gige_mdio_write(struct mii_bus *bus, int phy_add,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void mlxbf_gige_mdio_cfg(struct mlxbf_gige *priv)
|
||||
{
|
||||
u8 mdio_period;
|
||||
u32 val;
|
||||
|
||||
mdio_period = mdio_period_map(priv);
|
||||
|
||||
val = MLXBF_GIGE_MDIO_CFG_VAL;
|
||||
val |= FIELD_PREP(MLXBF_GIGE_MDIO_CFG_MDC_PERIOD_MASK, mdio_period);
|
||||
writel(val, priv->mdio_io + MLXBF_GIGE_MDIO_CFG_OFFSET);
|
||||
}
|
||||
|
||||
int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
priv->mdio_io = devm_platform_ioremap_resource(pdev, MLXBF_GIGE_RES_MDIO9);
|
||||
if (IS_ERR(priv->mdio_io))
|
||||
return PTR_ERR(priv->mdio_io);
|
||||
|
||||
/* Configure mdio parameters */
|
||||
writel(MLXBF_GIGE_MDIO_CFG_VAL,
|
||||
priv->mdio_io + MLXBF_GIGE_MDIO_CFG_OFFSET);
|
||||
/* clk resource shared with other drivers so cannot use
|
||||
* devm_platform_ioremap_resource
|
||||
*/
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, MLXBF_GIGE_RES_CLK);
|
||||
if (!res) {
|
||||
/* For backward compatibility with older ACPI tables, also keep
|
||||
* CLK resource internal to the driver.
|
||||
*/
|
||||
res = &corepll_params[MLXBF_GIGE_VERSION_BF2];
|
||||
}
|
||||
|
||||
priv->clk_io = devm_ioremap(dev, res->start, resource_size(res));
|
||||
if (IS_ERR(priv->clk_io))
|
||||
return PTR_ERR(priv->clk_io);
|
||||
|
||||
mlxbf_gige_mdio_cfg(priv);
|
||||
|
||||
priv->mdiobus = devm_mdiobus_alloc(dev);
|
||||
if (!priv->mdiobus) {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef __MLXBF_GIGE_REGS_H__
|
||||
#define __MLXBF_GIGE_REGS_H__
|
||||
|
||||
#define MLXBF_GIGE_VERSION 0x0000
|
||||
#define MLXBF_GIGE_VERSION_BF2 0x0
|
||||
#define MLXBF_GIGE_STATUS 0x0010
|
||||
#define MLXBF_GIGE_STATUS_READY BIT(0)
|
||||
#define MLXBF_GIGE_INT_STATUS 0x0028
|
||||
|
||||
@@ -107,6 +107,8 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap)
|
||||
/* This assumes STATUS_WORD_POS == 1, Status
|
||||
* just after last data
|
||||
*/
|
||||
if (!byte_swap)
|
||||
val = ntohl((__force __be32)val);
|
||||
byte_cnt -= (4 - XTR_VALID_BYTES(val));
|
||||
eof_flag = true;
|
||||
break;
|
||||
|
||||
@@ -3482,21 +3482,21 @@ static void nfp_net_stat64(struct net_device *netdev,
|
||||
unsigned int start;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&r_vec->rx_sync);
|
||||
start = u64_stats_fetch_begin_irq(&r_vec->rx_sync);
|
||||
data[0] = r_vec->rx_pkts;
|
||||
data[1] = r_vec->rx_bytes;
|
||||
data[2] = r_vec->rx_drops;
|
||||
} while (u64_stats_fetch_retry(&r_vec->rx_sync, start));
|
||||
} while (u64_stats_fetch_retry_irq(&r_vec->rx_sync, start));
|
||||
stats->rx_packets += data[0];
|
||||
stats->rx_bytes += data[1];
|
||||
stats->rx_dropped += data[2];
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&r_vec->tx_sync);
|
||||
start = u64_stats_fetch_begin_irq(&r_vec->tx_sync);
|
||||
data[0] = r_vec->tx_pkts;
|
||||
data[1] = r_vec->tx_bytes;
|
||||
data[2] = r_vec->tx_errors;
|
||||
} while (u64_stats_fetch_retry(&r_vec->tx_sync, start));
|
||||
} while (u64_stats_fetch_retry_irq(&r_vec->tx_sync, start));
|
||||
stats->tx_packets += data[0];
|
||||
stats->tx_bytes += data[1];
|
||||
stats->tx_errors += data[2];
|
||||
|
||||
@@ -483,7 +483,7 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
|
||||
unsigned int start;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&nn->r_vecs[i].rx_sync);
|
||||
start = u64_stats_fetch_begin_irq(&nn->r_vecs[i].rx_sync);
|
||||
data[0] = nn->r_vecs[i].rx_pkts;
|
||||
tmp[0] = nn->r_vecs[i].hw_csum_rx_ok;
|
||||
tmp[1] = nn->r_vecs[i].hw_csum_rx_inner_ok;
|
||||
@@ -491,10 +491,10 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
|
||||
tmp[3] = nn->r_vecs[i].hw_csum_rx_error;
|
||||
tmp[4] = nn->r_vecs[i].rx_replace_buf_alloc_fail;
|
||||
tmp[5] = nn->r_vecs[i].hw_tls_rx;
|
||||
} while (u64_stats_fetch_retry(&nn->r_vecs[i].rx_sync, start));
|
||||
} while (u64_stats_fetch_retry_irq(&nn->r_vecs[i].rx_sync, start));
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&nn->r_vecs[i].tx_sync);
|
||||
start = u64_stats_fetch_begin_irq(&nn->r_vecs[i].tx_sync);
|
||||
data[1] = nn->r_vecs[i].tx_pkts;
|
||||
data[2] = nn->r_vecs[i].tx_busy;
|
||||
tmp[6] = nn->r_vecs[i].hw_csum_tx;
|
||||
@@ -504,7 +504,7 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
|
||||
tmp[10] = nn->r_vecs[i].hw_tls_tx;
|
||||
tmp[11] = nn->r_vecs[i].tls_tx_fallback;
|
||||
tmp[12] = nn->r_vecs[i].tls_tx_no_fallback;
|
||||
} while (u64_stats_fetch_retry(&nn->r_vecs[i].tx_sync, start));
|
||||
} while (u64_stats_fetch_retry_irq(&nn->r_vecs[i].tx_sync, start));
|
||||
|
||||
data += NN_RVEC_PER_Q_STATS;
|
||||
|
||||
|
||||
@@ -1273,7 +1273,7 @@ static int ofdpa_port_ipv4_neigh(struct ofdpa_port *ofdpa_port,
|
||||
bool removing;
|
||||
int err = 0;
|
||||
|
||||
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
||||
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
|
||||
if (!entry)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1037,6 +1037,8 @@ static int smsc911x_mii_probe(struct net_device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Indicate that the MAC is responsible for managing PHY PM */
|
||||
phydev->mac_managed_pm = true;
|
||||
phy_attached_info(phydev);
|
||||
|
||||
phy_set_max_speed(phydev, SPEED_100);
|
||||
@@ -2584,6 +2586,8 @@ static int smsc911x_suspend(struct device *dev)
|
||||
if (netif_running(ndev)) {
|
||||
netif_stop_queue(ndev);
|
||||
netif_device_detach(ndev);
|
||||
if (!device_may_wakeup(dev))
|
||||
phy_stop(ndev->phydev);
|
||||
}
|
||||
|
||||
/* enable wake on LAN, energy detection and the external PME
|
||||
@@ -2625,6 +2629,8 @@ static int smsc911x_resume(struct device *dev)
|
||||
if (netif_running(ndev)) {
|
||||
netif_device_attach(ndev);
|
||||
netif_start_queue(ndev);
|
||||
if (!device_may_wakeup(dev))
|
||||
phy_start(ndev->phydev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1310,10 +1310,11 @@ static int adf7242_remove(struct spi_device *spi)
|
||||
|
||||
debugfs_remove_recursive(lp->debugfs_root);
|
||||
|
||||
ieee802154_unregister_hw(lp->hw);
|
||||
|
||||
cancel_delayed_work_sync(&lp->work);
|
||||
destroy_workqueue(lp->wqueue);
|
||||
|
||||
ieee802154_unregister_hw(lp->hw);
|
||||
mutex_destroy(&lp->bmux);
|
||||
ieee802154_free_hw(lp->hw);
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ nsim_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
unsigned int start;
|
||||
|
||||
do {
|
||||
start = u64_stats_fetch_begin(&ns->syncp);
|
||||
start = u64_stats_fetch_begin_irq(&ns->syncp);
|
||||
stats->tx_bytes = ns->tx_bytes;
|
||||
stats->tx_packets = ns->tx_packets;
|
||||
} while (u64_stats_fetch_retry(&ns->syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&ns->syncp, start));
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -244,7 +244,7 @@ static void pmc_power_off(void)
|
||||
pm1_cnt_port = acpi_base_addr + PM1_CNT;
|
||||
|
||||
pm1_cnt_value = inl(pm1_cnt_port);
|
||||
pm1_cnt_value &= SLEEP_TYPE_MASK;
|
||||
pm1_cnt_value &= ~SLEEP_TYPE_MASK;
|
||||
pm1_cnt_value |= SLEEP_TYPE_S5;
|
||||
pm1_cnt_value |= SLEEP_ENABLE;
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ struct qcom_swrm_ctrl {
|
||||
u8 wcmd_id;
|
||||
struct qcom_swrm_port_config pconfig[QCOM_SDW_MAX_PORTS];
|
||||
struct sdw_stream_runtime *sruntime[SWRM_MAX_DAIS];
|
||||
enum sdw_slave_status status[SDW_MAX_DEVICES];
|
||||
enum sdw_slave_status status[SDW_MAX_DEVICES + 1];
|
||||
int (*reg_read)(struct qcom_swrm_ctrl *ctrl, int reg, u32 *val);
|
||||
int (*reg_write)(struct qcom_swrm_ctrl *ctrl, int reg, int val);
|
||||
u32 slave_status;
|
||||
@@ -391,7 +391,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
|
||||
|
||||
ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
|
||||
|
||||
for (dev_num = 0; dev_num < SDW_MAX_DEVICES; dev_num++) {
|
||||
for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) {
|
||||
status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
|
||||
|
||||
if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
|
||||
@@ -411,7 +411,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl)
|
||||
ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
|
||||
ctrl->slave_status = val;
|
||||
|
||||
for (i = 0; i < SDW_MAX_DEVICES; i++) {
|
||||
for (i = 0; i <= SDW_MAX_DEVICES; i++) {
|
||||
u32 s;
|
||||
|
||||
s = (val >> (i * 2));
|
||||
|
||||
@@ -17,6 +17,7 @@ MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
|
||||
MODULE_AUTHOR("Realtek Semiconductor Corp.");
|
||||
MODULE_VERSION(DRIVERVERSION);
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8188eufw.bin");
|
||||
|
||||
#define CONFIG_BR_EXT_BRNAME "br0"
|
||||
#define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable, */
|
||||
|
||||
@@ -117,34 +117,6 @@ static void r871x_internal_cmd_hdl(struct _adapter *padapter, u8 *pbuf)
|
||||
kfree(pdrvcmd->pbuf);
|
||||
}
|
||||
|
||||
static u8 read_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
||||
{
|
||||
void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
|
||||
struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
|
||||
|
||||
/* invoke cmd->callback function */
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
return H2C_SUCCESS;
|
||||
}
|
||||
|
||||
static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
||||
{
|
||||
void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
|
||||
struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
|
||||
|
||||
/* invoke cmd->callback function */
|
||||
pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
|
||||
if (!pcmd_callback)
|
||||
r8712_free_cmd_obj(pcmd);
|
||||
else
|
||||
pcmd_callback(padapter, pcmd);
|
||||
return H2C_SUCCESS;
|
||||
}
|
||||
|
||||
static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
|
||||
{
|
||||
struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
|
||||
@@ -213,14 +185,6 @@ static struct cmd_obj *cmd_hdl_filter(struct _adapter *padapter,
|
||||
pcmd_r = NULL;
|
||||
|
||||
switch (pcmd->cmdcode) {
|
||||
case GEN_CMD_CODE(_Read_MACREG):
|
||||
read_macreg_hdl(padapter, (u8 *)pcmd);
|
||||
pcmd_r = pcmd;
|
||||
break;
|
||||
case GEN_CMD_CODE(_Write_MACREG):
|
||||
write_macreg_hdl(padapter, (u8 *)pcmd);
|
||||
pcmd_r = pcmd;
|
||||
break;
|
||||
case GEN_CMD_CODE(_Read_BBREG):
|
||||
read_bbreg_hdl(padapter, (u8 *)pcmd);
|
||||
break;
|
||||
|
||||
@@ -408,7 +408,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
|
||||
|
||||
static int tb_async_error(const struct ctl_pkg *pkg)
|
||||
{
|
||||
const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
|
||||
const struct cfg_error_pkg *error = pkg->buffer;
|
||||
|
||||
if (pkg->frame.eof != TB_CFG_PKG_ERROR)
|
||||
return false;
|
||||
|
||||
@@ -2753,7 +2753,8 @@ static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp,
|
||||
flags = *fp++;
|
||||
switch (flags) {
|
||||
case TTY_NORMAL:
|
||||
gsm->receive(gsm, *cp);
|
||||
if (gsm->receive)
|
||||
gsm->receive(gsm, *cp);
|
||||
break;
|
||||
case TTY_OVERRUN:
|
||||
case TTY_BREAK:
|
||||
|
||||
@@ -1381,9 +1381,9 @@ static int lpuart_config_rs485(struct uart_port *port,
|
||||
* Note: UART is assumed to be active high.
|
||||
*/
|
||||
if (rs485->flags & SER_RS485_RTS_ON_SEND)
|
||||
modem &= ~UARTMODEM_TXRTSPOL;
|
||||
else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
|
||||
modem |= UARTMODEM_TXRTSPOL;
|
||||
else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
|
||||
modem &= ~UARTMODEM_TXRTSPOL;
|
||||
}
|
||||
|
||||
/* Store the new configuration */
|
||||
@@ -2203,6 +2203,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
uart_update_timeout(port, termios->c_cflag, baud);
|
||||
|
||||
/* wait transmit engin complete */
|
||||
lpuart32_write(&sport->port, 0, UARTMODIR);
|
||||
lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
|
||||
|
||||
/* disable transmit and receive */
|
||||
|
||||
@@ -4662,9 +4662,11 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
|
||||
console_lock();
|
||||
if (vc->vc_mode != KD_TEXT)
|
||||
rc = -EINVAL;
|
||||
else if (vc->vc_sw->con_font_set)
|
||||
else if (vc->vc_sw->con_font_set) {
|
||||
if (vc_is_sel(vc))
|
||||
clear_selection();
|
||||
rc = vc->vc_sw->con_font_set(vc, &font, op->flags);
|
||||
else
|
||||
} else
|
||||
rc = -ENOSYS;
|
||||
console_unlock();
|
||||
kfree(font.data);
|
||||
@@ -4691,9 +4693,11 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op)
|
||||
console_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
if (vc->vc_sw->con_font_default)
|
||||
if (vc->vc_sw->con_font_default) {
|
||||
if (vc_is_sel(vc))
|
||||
clear_selection();
|
||||
rc = vc->vc_sw->con_font_default(vc, &font, s);
|
||||
else
|
||||
} else
|
||||
rc = -ENOSYS;
|
||||
console_unlock();
|
||||
if (!rc) {
|
||||
|
||||
@@ -1530,7 +1530,8 @@ static void cdns3_transfer_completed(struct cdns3_device *priv_dev,
|
||||
TRB_LEN(le32_to_cpu(trb->length));
|
||||
|
||||
if (priv_req->num_of_trb > 1 &&
|
||||
le32_to_cpu(trb->control) & TRB_SMM)
|
||||
le32_to_cpu(trb->control) & TRB_SMM &&
|
||||
le32_to_cpu(trb->control) & TRB_CHAIN)
|
||||
transfer_end = true;
|
||||
|
||||
cdns3_ep_inc_deq(priv_ep);
|
||||
@@ -1690,6 +1691,7 @@ static int cdns3_check_ep_interrupt_proceed(struct cdns3_endpoint *priv_ep)
|
||||
ep_cfg &= ~EP_CFG_ENABLE;
|
||||
writel(ep_cfg, &priv_dev->regs->ep_cfg);
|
||||
priv_ep->flags &= ~EP_QUIRK_ISO_OUT_EN;
|
||||
priv_ep->flags |= EP_UPDATE_EP_TRBADDR;
|
||||
}
|
||||
cdns3_transfer_completed(priv_dev, priv_ep);
|
||||
} else if (!(priv_ep->flags & EP_STALLED) &&
|
||||
|
||||
@@ -1814,6 +1814,9 @@ static const struct usb_device_id acm_ids[] = {
|
||||
{ USB_DEVICE(0x09d8, 0x0320), /* Elatec GmbH TWN3 */
|
||||
.driver_info = NO_UNION_NORMAL, /* has misplaced union descriptor */
|
||||
},
|
||||
{ USB_DEVICE(0x0c26, 0x0020), /* Icom ICF3400 Serie */
|
||||
.driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
|
||||
},
|
||||
{ USB_DEVICE(0x0ca6, 0xa050), /* Castles VEGA3000 */
|
||||
.driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
|
||||
},
|
||||
|
||||
@@ -6049,6 +6049,11 @@ re_enumerate_no_bos:
|
||||
* the reset is over (using their post_reset method).
|
||||
*
|
||||
* Return: The same as for usb_reset_and_verify_device().
|
||||
* However, if a reset is already in progress (for instance, if a
|
||||
* driver doesn't have pre_ or post_reset() callbacks, and while
|
||||
* being unbound or re-bound during the ongoing reset its disconnect()
|
||||
* or probe() routine tries to perform a second, nested reset), the
|
||||
* routine returns -EINPROGRESS.
|
||||
*
|
||||
* Note:
|
||||
* The caller must own the device lock. For example, it's safe to use
|
||||
@@ -6082,6 +6087,10 @@ int usb_reset_device(struct usb_device *udev)
|
||||
return -EISDIR;
|
||||
}
|
||||
|
||||
if (udev->reset_in_progress)
|
||||
return -EINPROGRESS;
|
||||
udev->reset_in_progress = 1;
|
||||
|
||||
port_dev = hub->ports[udev->portnum - 1];
|
||||
|
||||
/*
|
||||
@@ -6146,6 +6155,7 @@ int usb_reset_device(struct usb_device *udev)
|
||||
|
||||
usb_autosuspend_device(udev);
|
||||
memalloc_noio_restore(noio_flag);
|
||||
udev->reset_in_progress = 0;
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(usb_reset_device);
|
||||
|
||||
@@ -154,9 +154,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
|
||||
} else if (hsotg->plat && hsotg->plat->phy_init) {
|
||||
ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
|
||||
} else {
|
||||
ret = phy_power_on(hsotg->phy);
|
||||
ret = phy_init(hsotg->phy);
|
||||
if (ret == 0)
|
||||
ret = phy_init(hsotg->phy);
|
||||
ret = phy_power_on(hsotg->phy);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -188,9 +188,9 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
|
||||
} else if (hsotg->plat && hsotg->plat->phy_exit) {
|
||||
ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
|
||||
} else {
|
||||
ret = phy_exit(hsotg->phy);
|
||||
ret = phy_power_off(hsotg->phy);
|
||||
if (ret == 0)
|
||||
ret = phy_power_off(hsotg->phy);
|
||||
ret = phy_exit(hsotg->phy);
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -730,15 +730,16 @@ static void dwc3_core_exit(struct dwc3 *dwc)
|
||||
{
|
||||
dwc3_event_buffers_cleanup(dwc);
|
||||
|
||||
usb_phy_set_suspend(dwc->usb2_phy, 1);
|
||||
usb_phy_set_suspend(dwc->usb3_phy, 1);
|
||||
phy_power_off(dwc->usb2_generic_phy);
|
||||
phy_power_off(dwc->usb3_generic_phy);
|
||||
|
||||
usb_phy_shutdown(dwc->usb2_phy);
|
||||
usb_phy_shutdown(dwc->usb3_phy);
|
||||
phy_exit(dwc->usb2_generic_phy);
|
||||
phy_exit(dwc->usb3_generic_phy);
|
||||
|
||||
usb_phy_set_suspend(dwc->usb2_phy, 1);
|
||||
usb_phy_set_suspend(dwc->usb3_phy, 1);
|
||||
phy_power_off(dwc->usb2_generic_phy);
|
||||
phy_power_off(dwc->usb3_generic_phy);
|
||||
clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks);
|
||||
reset_control_assert(dwc->reset);
|
||||
}
|
||||
@@ -1702,16 +1703,16 @@ err5:
|
||||
dwc3_debugfs_exit(dwc);
|
||||
dwc3_event_buffers_cleanup(dwc);
|
||||
|
||||
usb_phy_shutdown(dwc->usb2_phy);
|
||||
usb_phy_shutdown(dwc->usb3_phy);
|
||||
phy_exit(dwc->usb2_generic_phy);
|
||||
phy_exit(dwc->usb3_generic_phy);
|
||||
|
||||
usb_phy_set_suspend(dwc->usb2_phy, 1);
|
||||
usb_phy_set_suspend(dwc->usb3_phy, 1);
|
||||
phy_power_off(dwc->usb2_generic_phy);
|
||||
phy_power_off(dwc->usb3_generic_phy);
|
||||
|
||||
usb_phy_shutdown(dwc->usb2_phy);
|
||||
usb_phy_shutdown(dwc->usb3_phy);
|
||||
phy_exit(dwc->usb2_generic_phy);
|
||||
phy_exit(dwc->usb3_generic_phy);
|
||||
|
||||
dwc3_ulpi_exit(dwc);
|
||||
|
||||
err4:
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#define PCI_DEVICE_ID_INTEL_ADLP 0x51ee
|
||||
#define PCI_DEVICE_ID_INTEL_ADLM 0x54ee
|
||||
#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1
|
||||
#define PCI_DEVICE_ID_INTEL_RPL 0x460e
|
||||
#define PCI_DEVICE_ID_INTEL_RPLS 0x7a61
|
||||
#define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1
|
||||
#define PCI_DEVICE_ID_INTEL_MTL 0x7e7e
|
||||
@@ -420,6 +421,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
|
||||
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ADLS),
|
||||
(kernel_ulong_t) &dwc3_pci_intel_swnode, },
|
||||
|
||||
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_RPL),
|
||||
(kernel_ulong_t) &dwc3_pci_intel_swnode, },
|
||||
|
||||
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_RPLS),
|
||||
(kernel_ulong_t) &dwc3_pci_intel_swnode, },
|
||||
|
||||
|
||||
@@ -296,6 +296,14 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom)
|
||||
icc_put(qcom->icc_path_apps);
|
||||
}
|
||||
|
||||
/* Only usable in contexts where the role can not change. */
|
||||
static bool dwc3_qcom_is_host(struct dwc3_qcom *qcom)
|
||||
{
|
||||
struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3);
|
||||
|
||||
return dwc->xhci;
|
||||
}
|
||||
|
||||
static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
|
||||
{
|
||||
if (qcom->hs_phy_irq) {
|
||||
@@ -411,7 +419,11 @@ static irqreturn_t qcom_dwc3_resume_irq(int irq, void *data)
|
||||
if (qcom->pm_suspended)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
if (dwc->xhci)
|
||||
/*
|
||||
* This is safe as role switching is done from a freezable workqueue
|
||||
* and the wakeup interrupts are disabled as part of resume.
|
||||
*/
|
||||
if (dwc3_qcom_is_host(qcom))
|
||||
pm_runtime_resume(&dwc->xhci->dev);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
||||
@@ -10,8 +10,13 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include "../host/xhci-plat.h"
|
||||
#include "core.h"
|
||||
|
||||
static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
|
||||
.quirks = XHCI_SKIP_PHY_INIT,
|
||||
};
|
||||
|
||||
static int dwc3_host_get_irq(struct dwc3 *dwc)
|
||||
{
|
||||
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
|
||||
@@ -87,6 +92,11 @@ int dwc3_host_init(struct dwc3 *dwc)
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
|
||||
sizeof(dwc3_xhci_plat_priv));
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
|
||||
|
||||
if (dwc->usb3_lpm_capable)
|
||||
@@ -130,4 +140,5 @@ err:
|
||||
void dwc3_host_exit(struct dwc3 *dwc)
|
||||
{
|
||||
platform_device_unregister(dwc->xhci);
|
||||
dwc->xhci = NULL;
|
||||
}
|
||||
|
||||
@@ -294,8 +294,10 @@ EXPORT_SYMBOL_GPL(fsg_lun_fsync_sub);
|
||||
void store_cdrom_address(u8 *dest, int msf, u32 addr)
|
||||
{
|
||||
if (msf) {
|
||||
/* Convert to Minutes-Seconds-Frames */
|
||||
addr >>= 2; /* Convert to 2048-byte frames */
|
||||
/*
|
||||
* Convert to Minutes-Seconds-Frames.
|
||||
* Sector size is already set to 2048 bytes.
|
||||
*/
|
||||
addr += 2*75; /* Lead-in occupies 2 seconds */
|
||||
dest[3] = addr % 75; /* Frames */
|
||||
addr /= 75;
|
||||
|
||||
@@ -652,7 +652,7 @@ struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
|
||||
* It will release and re-aquire the lock while calling ACPI
|
||||
* method.
|
||||
*/
|
||||
void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
|
||||
static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
|
||||
u16 index, bool on, unsigned long *flags)
|
||||
__must_hold(&xhci->lock)
|
||||
{
|
||||
@@ -1647,6 +1647,17 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
|
||||
|
||||
status = bus_state->resuming_ports;
|
||||
|
||||
/*
|
||||
* SS devices are only visible to roothub after link training completes.
|
||||
* Keep polling roothubs for a grace period after xHC start
|
||||
*/
|
||||
if (xhci->run_graceperiod) {
|
||||
if (time_before(jiffies, xhci->run_graceperiod))
|
||||
status = 1;
|
||||
else
|
||||
xhci->run_graceperiod = 0;
|
||||
}
|
||||
|
||||
mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC | PORT_WRC | PORT_CEC;
|
||||
|
||||
/* For each port, did anything change? If so, set that bit in buf. */
|
||||
|
||||
@@ -476,7 +476,6 @@ static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset)
|
||||
|
||||
static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset)
|
||||
{
|
||||
u32 extra_cs_count;
|
||||
u32 start_ss, last_ss;
|
||||
u32 start_cs, last_cs;
|
||||
|
||||
@@ -512,18 +511,12 @@ static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset)
|
||||
if (last_cs > 7)
|
||||
return -ESCH_CS_OVERFLOW;
|
||||
|
||||
if (sch_ep->ep_type == ISOC_IN_EP)
|
||||
extra_cs_count = (last_cs == 7) ? 1 : 2;
|
||||
else /* ep_type : INTR IN / INTR OUT */
|
||||
extra_cs_count = 1;
|
||||
|
||||
cs_count += extra_cs_count;
|
||||
if (cs_count > 7)
|
||||
cs_count = 7; /* HW limit */
|
||||
|
||||
sch_ep->cs_count = cs_count;
|
||||
/* one for ss, the other for idle */
|
||||
sch_ep->num_budget_microframes = cs_count + 2;
|
||||
/* ss, idle are ignored */
|
||||
sch_ep->num_budget_microframes = cs_count;
|
||||
|
||||
/*
|
||||
* if interval=1, maxp >752, num_budge_micoframe is larger
|
||||
@@ -822,8 +815,8 @@ int xhci_mtk_drop_ep(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (ep->hcpriv)
|
||||
drop_ep_quirk(hcd, udev, ep);
|
||||
/* needn't check @ep->hcpriv, xhci_endpoint_disable set it NULL */
|
||||
drop_ep_quirk(hcd, udev, ep);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -148,9 +148,11 @@ int xhci_start(struct xhci_hcd *xhci)
|
||||
xhci_err(xhci, "Host took too long to start, "
|
||||
"waited %u microseconds.\n",
|
||||
XHCI_MAX_HALT_USEC);
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
/* clear state flags. Including dying, halted or removing */
|
||||
xhci->xhc_state = 0;
|
||||
xhci->run_graceperiod = jiffies + msecs_to_jiffies(500);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -776,8 +778,6 @@ static void xhci_stop(struct usb_hcd *hcd)
|
||||
void xhci_shutdown(struct usb_hcd *hcd)
|
||||
{
|
||||
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
|
||||
usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
|
||||
@@ -793,21 +793,12 @@ void xhci_shutdown(struct usb_hcd *hcd)
|
||||
del_timer_sync(&xhci->shared_hcd->rh_timer);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&xhci->lock, flags);
|
||||
spin_lock_irq(&xhci->lock);
|
||||
xhci_halt(xhci);
|
||||
|
||||
/* Power off USB2 ports*/
|
||||
for (i = 0; i < xhci->usb2_rhub.num_ports; i++)
|
||||
xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags);
|
||||
|
||||
/* Power off USB3 ports*/
|
||||
for (i = 0; i < xhci->usb3_rhub.num_ports; i++)
|
||||
xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags);
|
||||
|
||||
/* Workaround for spurious wakeups at shutdown with HSW */
|
||||
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
|
||||
xhci_reset(xhci, XHCI_RESET_SHORT_USEC);
|
||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
spin_unlock_irq(&xhci->lock);
|
||||
|
||||
xhci_cleanup_msix(xhci);
|
||||
|
||||
|
||||
@@ -1841,7 +1841,7 @@ struct xhci_hcd {
|
||||
|
||||
/* Host controller watchdog timer structures */
|
||||
unsigned int xhc_state;
|
||||
|
||||
unsigned long run_graceperiod;
|
||||
u32 command;
|
||||
struct s3_save s3;
|
||||
/* Host controller is dying - not responding to commands. "I'm not dead yet!"
|
||||
@@ -2191,8 +2191,6 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
|
||||
int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
|
||||
int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
|
||||
struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);
|
||||
void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index,
|
||||
bool on, unsigned long *flags);
|
||||
|
||||
void xhci_hc_died(struct xhci_hcd *xhci);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ config USB_MUSB_TUSB6010
|
||||
tristate "TUSB6010"
|
||||
depends on HAS_IOMEM
|
||||
depends on ARCH_OMAP2PLUS || COMPILE_TEST
|
||||
depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules
|
||||
depends on NOP_USB_XCEIV!=m || USB_MUSB_HDRC=m
|
||||
|
||||
config USB_MUSB_OMAP2PLUS
|
||||
tristate "OMAP2430 and onwards"
|
||||
|
||||
@@ -97,7 +97,10 @@ struct ch341_private {
|
||||
u8 mcr;
|
||||
u8 msr;
|
||||
u8 lcr;
|
||||
|
||||
unsigned long quirks;
|
||||
u8 version;
|
||||
|
||||
unsigned long break_end;
|
||||
};
|
||||
|
||||
@@ -256,8 +259,12 @@ static int ch341_set_baudrate_lcr(struct usb_device *dev,
|
||||
/*
|
||||
* CH341A buffers data until a full endpoint-size packet (32 bytes)
|
||||
* has been received unless bit 7 is set.
|
||||
*
|
||||
* At least one device with version 0x27 appears to have this bit
|
||||
* inverted.
|
||||
*/
|
||||
val |= BIT(7);
|
||||
if (priv->version > 0x27)
|
||||
val |= BIT(7);
|
||||
|
||||
r = ch341_control_out(dev, CH341_REQ_WRITE_REG,
|
||||
CH341_REG_DIVISOR << 8 | CH341_REG_PRESCALER,
|
||||
@@ -271,6 +278,9 @@ static int ch341_set_baudrate_lcr(struct usb_device *dev,
|
||||
* (stop bits, parity and word length). Version 0x30 and above use
|
||||
* CH341_REG_LCR only and CH341_REG_LCR2 is always set to zero.
|
||||
*/
|
||||
if (priv->version < 0x30)
|
||||
return 0;
|
||||
|
||||
r = ch341_control_out(dev, CH341_REQ_WRITE_REG,
|
||||
CH341_REG_LCR2 << 8 | CH341_REG_LCR, lcr);
|
||||
if (r)
|
||||
@@ -323,7 +333,9 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv)
|
||||
r = ch341_control_in(dev, CH341_REQ_READ_VERSION, 0, 0, buffer, size);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
dev_dbg(&dev->dev, "Chip version: 0x%02x\n", buffer[0]);
|
||||
|
||||
priv->version = buffer[0];
|
||||
dev_dbg(&dev->dev, "Chip version: 0x%02x\n", priv->version);
|
||||
|
||||
r = ch341_control_out(dev, CH341_REQ_SERIAL_INIT, 0, 0);
|
||||
if (r < 0)
|
||||
|
||||
@@ -130,6 +130,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x10C4, 0x83AA) }, /* Mark-10 Digital Force Gauge */
|
||||
{ USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */
|
||||
{ USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
|
||||
{ USB_DEVICE(0x10C4, 0x8414) }, /* Decagon USB Cable Adapter */
|
||||
{ USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
|
||||
{ USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
|
||||
{ USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */
|
||||
|
||||
@@ -1045,6 +1045,8 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
/* IDS GmbH devices */
|
||||
{ USB_DEVICE(IDS_VID, IDS_SI31A_PID) },
|
||||
{ USB_DEVICE(IDS_VID, IDS_CM31A_PID) },
|
||||
/* Omron devices */
|
||||
{ USB_DEVICE(OMRON_VID, OMRON_CS1W_CIF31_PID) },
|
||||
/* U-Blox devices */
|
||||
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
|
||||
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
|
||||
|
||||
@@ -661,6 +661,12 @@
|
||||
#define INFINEON_TRIBOARD_TC1798_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
|
||||
#define INFINEON_TRIBOARD_TC2X7_PID 0x0043 /* DAS JTAG TriBoard TC2X7 V1.0 */
|
||||
|
||||
/*
|
||||
* Omron corporation (https://www.omron.com)
|
||||
*/
|
||||
#define OMRON_VID 0x0590
|
||||
#define OMRON_CS1W_CIF31_PID 0x00b2
|
||||
|
||||
/*
|
||||
* Acton Research Corp.
|
||||
*/
|
||||
|
||||
@@ -253,6 +253,7 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define QUECTEL_PRODUCT_BG96 0x0296
|
||||
#define QUECTEL_PRODUCT_EP06 0x0306
|
||||
#define QUECTEL_PRODUCT_EM05G 0x030a
|
||||
#define QUECTEL_PRODUCT_EM060K 0x030b
|
||||
#define QUECTEL_PRODUCT_EM12 0x0512
|
||||
#define QUECTEL_PRODUCT_RM500Q 0x0800
|
||||
#define QUECTEL_PRODUCT_EC200S_CN 0x6002
|
||||
@@ -438,6 +439,8 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define CINTERION_PRODUCT_MV31_2_RMNET 0x00b9
|
||||
#define CINTERION_PRODUCT_MV32_WA 0x00f1
|
||||
#define CINTERION_PRODUCT_MV32_WB 0x00f2
|
||||
#define CINTERION_PRODUCT_MV32_WA_RMNET 0x00f3
|
||||
#define CINTERION_PRODUCT_MV32_WB_RMNET 0x00f4
|
||||
|
||||
/* Olivetti products */
|
||||
#define OLIVETTI_VENDOR_ID 0x0b3c
|
||||
@@ -573,6 +576,10 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define WETELECOM_PRODUCT_6802 0x6802
|
||||
#define WETELECOM_PRODUCT_WMD300 0x6803
|
||||
|
||||
/* OPPO products */
|
||||
#define OPPO_VENDOR_ID 0x22d9
|
||||
#define OPPO_PRODUCT_R11 0x276c
|
||||
|
||||
|
||||
/* Device flags */
|
||||
|
||||
@@ -1138,6 +1145,9 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
|
||||
.driver_info = RSVD(6) | ZLP },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
|
||||
.driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
|
||||
@@ -1993,8 +2003,12 @@ static const struct usb_device_id option_ids[] = {
|
||||
.driver_info = RSVD(0)},
|
||||
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff),
|
||||
.driver_info = RSVD(3)},
|
||||
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA_RMNET, 0xff),
|
||||
.driver_info = RSVD(0) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff),
|
||||
.driver_info = RSVD(3)},
|
||||
{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB_RMNET, 0xff),
|
||||
.driver_info = RSVD(0) },
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
|
||||
.driver_info = RSVD(4) },
|
||||
{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
|
||||
@@ -2155,6 +2169,7 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, option_ids);
|
||||
|
||||
@@ -2294,6 +2294,13 @@ UNUSUAL_DEV( 0x1e74, 0x4621, 0x0000, 0x0000,
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ),
|
||||
|
||||
/* Reported by Witold Lipieta <witold.lipieta@thaumatec.com> */
|
||||
UNUSUAL_DEV( 0x1fc9, 0x0117, 0x0100, 0x0100,
|
||||
"NXP Semiconductors",
|
||||
"PN7462AU",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_IGNORE_RESIDUE ),
|
||||
|
||||
/* Supplied with some Castlewood ORB removable drives */
|
||||
UNUSUAL_DEV( 0x2027, 0xa001, 0x0000, 0x9999,
|
||||
"Double-H Technology",
|
||||
|
||||
@@ -88,8 +88,8 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
|
||||
case DP_STATUS_CON_UFP_D:
|
||||
case DP_STATUS_CON_BOTH: /* NOTE: First acting as DP source */
|
||||
conf |= DP_CONF_UFP_U_AS_UFP_D;
|
||||
pin_assign = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo) &
|
||||
DP_CAP_UFP_D_PIN_ASSIGN(dp->port->vdo);
|
||||
pin_assign = DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo) &
|
||||
DP_CAP_PIN_ASSIGN_DFP_D(dp->port->vdo);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -554,9 +554,11 @@ err_unregister_switch:
|
||||
|
||||
static int is_memory(struct acpi_resource *res, void *data)
|
||||
{
|
||||
struct resource r;
|
||||
struct resource_win win = {};
|
||||
struct resource *r = &win.res;
|
||||
|
||||
return !acpi_dev_resource_memory(res, &r);
|
||||
return !(acpi_dev_resource_memory(res, r) ||
|
||||
acpi_dev_resource_address_space(res, &win));
|
||||
}
|
||||
|
||||
/* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
|
||||
@@ -566,6 +568,9 @@ static const struct acpi_device_id iom_acpi_ids[] = {
|
||||
|
||||
/* AlderLake */
|
||||
{ "INTC1079", 0x160, },
|
||||
|
||||
/* Meteor Lake */
|
||||
{ "INTC107A", 0x160, },
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -6304,6 +6304,13 @@ static int tcpm_psy_set_prop(struct power_supply *psy,
|
||||
struct tcpm_port *port = power_supply_get_drvdata(psy);
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* All the properties below are related to USB PD. The check needs to be
|
||||
* property specific when a non-pd related property is added.
|
||||
*/
|
||||
if (!port->pd_supported)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
switch (psp) {
|
||||
case POWER_SUPPLY_PROP_ONLINE:
|
||||
ret = tcpm_psy_set_online(port, val);
|
||||
|
||||
@@ -981,6 +981,9 @@ int gnttab_dma_alloc_pages(struct gnttab_dma_alloc_args *args)
|
||||
size_t size;
|
||||
int i, ret;
|
||||
|
||||
if (args->nr_pages < 0 || args->nr_pages > (INT_MAX >> PAGE_SHIFT))
|
||||
return -ENOMEM;
|
||||
|
||||
size = args->nr_pages << PAGE_SHIFT;
|
||||
if (args->coherent)
|
||||
args->vaddr = dma_alloc_coherent(args->dev, size,
|
||||
|
||||
@@ -933,16 +933,17 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
|
||||
} else if (rc != 0)
|
||||
goto neg_exit;
|
||||
|
||||
rc = -EIO;
|
||||
if (strcmp(server->vals->version_string,
|
||||
SMB3ANY_VERSION_STRING) == 0) {
|
||||
if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) {
|
||||
cifs_server_dbg(VFS,
|
||||
"SMB2 dialect returned but not requested\n");
|
||||
return -EIO;
|
||||
goto neg_exit;
|
||||
} else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) {
|
||||
cifs_server_dbg(VFS,
|
||||
"SMB2.1 dialect returned but not requested\n");
|
||||
return -EIO;
|
||||
goto neg_exit;
|
||||
} else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID)) {
|
||||
/* ops set to 3.0 by default for default so update */
|
||||
server->ops = &smb311_operations;
|
||||
@@ -953,7 +954,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
|
||||
if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) {
|
||||
cifs_server_dbg(VFS,
|
||||
"SMB2 dialect returned but not requested\n");
|
||||
return -EIO;
|
||||
goto neg_exit;
|
||||
} else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) {
|
||||
/* ops set to 3.0 by default for default so update */
|
||||
server->ops = &smb21_operations;
|
||||
@@ -967,7 +968,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
|
||||
/* if requested single dialect ensure returned dialect matched */
|
||||
cifs_server_dbg(VFS, "Invalid 0x%x dialect returned: not requested\n",
|
||||
le16_to_cpu(rsp->DialectRevision));
|
||||
return -EIO;
|
||||
goto neg_exit;
|
||||
}
|
||||
|
||||
cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode);
|
||||
@@ -985,9 +986,10 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
|
||||
else {
|
||||
cifs_server_dbg(VFS, "Invalid dialect returned by server 0x%x\n",
|
||||
le16_to_cpu(rsp->DialectRevision));
|
||||
rc = -EIO;
|
||||
goto neg_exit;
|
||||
}
|
||||
|
||||
rc = 0;
|
||||
server->dialect = le16_to_cpu(rsp->DialectRevision);
|
||||
|
||||
/*
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef PMC_ATOM_H
|
||||
#define PMC_ATOM_H
|
||||
|
||||
#include <linux/bits.h>
|
||||
|
||||
/* ValleyView Power Control Unit PCI Device ID */
|
||||
#define PCI_DEVICE_ID_VLV_PMC 0x0F1C
|
||||
/* CherryTrail Power Control Unit PCI Device ID */
|
||||
@@ -139,9 +141,9 @@
|
||||
#define ACPI_MMIO_REG_LEN 0x100
|
||||
|
||||
#define PM1_CNT 0x4
|
||||
#define SLEEP_TYPE_MASK 0xFFFFECFF
|
||||
#define SLEEP_TYPE_MASK GENMASK(12, 10)
|
||||
#define SLEEP_TYPE_S5 0x1C00
|
||||
#define SLEEP_ENABLE 0x2000
|
||||
#define SLEEP_ENABLE BIT(13)
|
||||
|
||||
extern int pmc_atom_read(int offset, u32 *value);
|
||||
extern int pmc_atom_write(int offset, u32 value);
|
||||
|
||||
@@ -589,6 +589,7 @@ struct usb3_lpm_parameters {
|
||||
* @devaddr: device address, XHCI: assigned by HW, others: same as devnum
|
||||
* @can_submit: URBs may be submitted
|
||||
* @persist_enabled: USB_PERSIST enabled for this device
|
||||
* @reset_in_progress: the device is being reset
|
||||
* @have_langid: whether string_langid is valid
|
||||
* @authorized: policy has said we can use it;
|
||||
* (user space) policy determines if we authorize this device to be
|
||||
@@ -675,6 +676,7 @@ struct usb_device {
|
||||
|
||||
unsigned can_submit:1;
|
||||
unsigned persist_enabled:1;
|
||||
unsigned reset_in_progress:1;
|
||||
unsigned have_langid:1;
|
||||
unsigned authorized:1;
|
||||
unsigned authenticated:1;
|
||||
|
||||
@@ -73,6 +73,11 @@ enum {
|
||||
#define DP_CAP_USB BIT(7)
|
||||
#define DP_CAP_DFP_D_PIN_ASSIGN(_cap_) (((_cap_) & GENMASK(15, 8)) >> 8)
|
||||
#define DP_CAP_UFP_D_PIN_ASSIGN(_cap_) (((_cap_) & GENMASK(23, 16)) >> 16)
|
||||
/* Get pin assignment taking plug & receptacle into consideration */
|
||||
#define DP_CAP_PIN_ASSIGN_UFP_D(_cap_) ((_cap_ & DP_CAP_RECEPTACLE) ? \
|
||||
DP_CAP_UFP_D_PIN_ASSIGN(_cap_) : DP_CAP_DFP_D_PIN_ASSIGN(_cap_))
|
||||
#define DP_CAP_PIN_ASSIGN_DFP_D(_cap_) ((_cap_ & DP_CAP_RECEPTACLE) ? \
|
||||
DP_CAP_DFP_D_PIN_ASSIGN(_cap_) : DP_CAP_UFP_D_PIN_ASSIGN(_cap_))
|
||||
|
||||
/* DisplayPort Status Update VDO bits */
|
||||
#define DP_STATUS_CONNECTION(_status_) ((_status_) & 3)
|
||||
|
||||
@@ -709,8 +709,10 @@ static void purge_effective_progs(struct cgroup *cgrp, struct bpf_prog *prog,
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
/* no link or prog match, skip the cgroup of this layer */
|
||||
continue;
|
||||
found:
|
||||
BUG_ON(!cg);
|
||||
progs = rcu_dereference_protected(
|
||||
desc->bpf.effective[atype],
|
||||
lockdep_is_held(&cgroup_mutex));
|
||||
|
||||
@@ -4789,7 +4789,7 @@ syscall_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
|
||||
{
|
||||
switch (func_id) {
|
||||
case BPF_FUNC_sys_bpf:
|
||||
return &bpf_sys_bpf_proto;
|
||||
return !perfmon_capable() ? NULL : &bpf_sys_bpf_proto;
|
||||
case BPF_FUNC_btf_find_by_name_kind:
|
||||
return &bpf_btf_find_by_name_kind_proto;
|
||||
case BPF_FUNC_sys_close:
|
||||
|
||||
@@ -110,7 +110,7 @@ static int walk_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
|
||||
do {
|
||||
again:
|
||||
next = pmd_addr_end(addr, end);
|
||||
if (pmd_none(*pmd) || (!walk->vma && !walk->no_vma)) {
|
||||
if (pmd_none(*pmd)) {
|
||||
if (ops->pte_hole)
|
||||
err = ops->pte_hole(addr, next, depth, walk);
|
||||
if (err)
|
||||
@@ -171,7 +171,7 @@ static int walk_pud_range(p4d_t *p4d, unsigned long addr, unsigned long end,
|
||||
do {
|
||||
again:
|
||||
next = pud_addr_end(addr, end);
|
||||
if (pud_none(*pud) || (!walk->vma && !walk->no_vma)) {
|
||||
if (pud_none(*pud)) {
|
||||
if (ops->pte_hole)
|
||||
err = ops->pte_hole(addr, next, depth, walk);
|
||||
if (err)
|
||||
@@ -366,19 +366,19 @@ static int __walk_page_range(unsigned long start, unsigned long end,
|
||||
struct vm_area_struct *vma = walk->vma;
|
||||
const struct mm_walk_ops *ops = walk->ops;
|
||||
|
||||
if (vma && ops->pre_vma) {
|
||||
if (ops->pre_vma) {
|
||||
err = ops->pre_vma(start, end, walk);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (vma && is_vm_hugetlb_page(vma)) {
|
||||
if (is_vm_hugetlb_page(vma)) {
|
||||
if (ops->hugetlb_entry)
|
||||
err = walk_hugetlb_range(start, end, walk);
|
||||
} else
|
||||
err = walk_pgd_range(start, end, walk);
|
||||
|
||||
if (vma && ops->post_vma)
|
||||
if (ops->post_vma)
|
||||
ops->post_vma(walk);
|
||||
|
||||
return err;
|
||||
@@ -450,9 +450,13 @@ int walk_page_range(struct mm_struct *mm, unsigned long start,
|
||||
if (!vma) { /* after the last vma */
|
||||
walk.vma = NULL;
|
||||
next = end;
|
||||
if (ops->pte_hole)
|
||||
err = ops->pte_hole(start, next, -1, &walk);
|
||||
} else if (start < vma->vm_start) { /* outside vma */
|
||||
walk.vma = NULL;
|
||||
next = min(end, vma->vm_start);
|
||||
if (ops->pte_hole)
|
||||
err = ops->pte_hole(start, next, -1, &walk);
|
||||
} else { /* inside vma */
|
||||
walk.vma = vma;
|
||||
next = min(end, vma->vm_end);
|
||||
@@ -470,9 +474,8 @@ int walk_page_range(struct mm_struct *mm, unsigned long start,
|
||||
}
|
||||
if (err < 0)
|
||||
break;
|
||||
}
|
||||
if (walk.vma || walk.ops->pte_hole)
|
||||
err = __walk_page_range(start, next, &walk);
|
||||
}
|
||||
if (err)
|
||||
break;
|
||||
} while (start = next, start < end);
|
||||
@@ -501,9 +504,9 @@ int walk_page_range_novma(struct mm_struct *mm, unsigned long start,
|
||||
if (start >= end || !walk.mm)
|
||||
return -EINVAL;
|
||||
|
||||
mmap_assert_locked(walk.mm);
|
||||
mmap_assert_write_locked(walk.mm);
|
||||
|
||||
return __walk_page_range(start, end, &walk);
|
||||
return walk_pgd_range(start, end, &walk);
|
||||
}
|
||||
|
||||
int walk_page_vma(struct vm_area_struct *vma, const struct mm_walk_ops *ops,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user