mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
Merge 5.15.6 into android13-5.15
Changes in 5.15.6 scsi: sd: Fix sd_do_mode_sense() buffer length handling ACPI: Get acpi_device's parent from the parent field ACPI: CPPC: Add NULL pointer check to cppc_get_perf() USB: serial: pl2303: fix GC type detection USB: serial: option: add Telit LE910S1 0x9200 composition USB: serial: option: add Fibocom FM101-GL variants usb: dwc2: gadget: Fix ISOC flow for elapsed frames usb: dwc2: hcd_queue: Fix use of floating point literal usb: dwc3: leave default DMA for PCI devices usb: dwc3: core: Revise GHWPARAMS9 offset usb: dwc3: gadget: Ignore NoStream after End Transfer usb: dwc3: gadget: Check for L1/L2/U3 for Start Transfer usb: dwc3: gadget: Fix null pointer exception net: usb: Correct PHY handling of smsc95xx net: nexthop: fix null pointer dereference when IPv6 is not enabled usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts usb: xhci: tegra: Check padctrl interrupt presence in device tree usb: hub: Fix usb enumeration issue due to address0 race usb: hub: Fix locking issues with address0_mutex binder: fix test regression due to sender_euid change ALSA: ctxfi: Fix out-of-range access ALSA: hda/realtek: Add quirk for ASRock NUC Box 1100 ALSA: hda/realtek: Fix LED on HP ProBook 435 G7 media: cec: copy sequence field for the reply Revert "parisc: Fix backtrace to always include init funtion names" HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts staging/fbtft: Fix backlight staging: greybus: Add missing rwsem around snd_ctl_remove() calls staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect() staging: r8188eu: Use kzalloc() with GFP_ATOMIC in atomic context staging: r8188eu: Fix breakage introduced when 5G code was removed staging: r8188eu: use GFP_ATOMIC under spinlock staging: r8188eu: fix a memory leak in rtw_wx_read32() fuse: release pipe buf after last use xen: don't continue xenstore initialization in case of errors xen: detect uninitialized xenbus in xenbus_init io_uring: correct link-list traversal locking io_uring: fail cancellation for EXITING tasks io_uring: fix link traversal locking drm/amdgpu: IH process reset count when restart drm/amdgpu/pm: fix powerplay OD interface drm/nouveau: recognise GA106 ksmbd: downgrade addition info error msg to debug in smb2_get_info_sec() ksmbd: contain default data stream even if xattr is empty ksmbd: fix memleak in get_file_stream_info() KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB tracing/uprobe: Fix uprobe_perf_open probes iteration tracing: Fix pid filtering when triggers are attached mmc: sdhci-esdhc-imx: disable CMDQ support mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB mdio: aspeed: Fix "Link is Down" issue arm64: mm: Fix VM_BUG_ON(mm != &init_mm) for trans_pgd cpufreq: intel_pstate: Fix active mode offline/online EPP handling powerpc/32: Fix hardlockup on vmap stack overflow iomap: Fix inline extent handling in iomap_readpage NFSv42: Fix pagecache invalidation after COPY/CLONE PCI: aardvark: Deduplicate code in advk_pcie_rd_conf() PCI: aardvark: Implement re-issuing config requests on CRS response PCI: aardvark: Simplify initialization of rootcap on virtual bridge PCI: aardvark: Fix link training drm/amd/display: Fix OLED brightness control on eDP proc/vmcore: fix clearing user buffer by properly using clear_user() ASoC: SOF: Intel: hda: fix hotplug when only codec is suspended netfilter: ctnetlink: fix filtering with CTA_TUPLE_REPLY netfilter: ctnetlink: do not erase error code with EINVAL netfilter: ipvs: Fix reuse connection if RS weight is 0 netfilter: flowtable: fix IPv6 tunnel addr match media: v4l2-core: fix VIDIOC_DQEVENT handling on non-x86 firmware: arm_scmi: Fix null de-reference on error path ARM: dts: BCM5301X: Fix I2C controller interrupt ARM: dts: BCM5301X: Add interrupt properties to GPIO node ARM: dts: bcm2711: Fix PCIe interrupts ASoC: qdsp6: q6routing: Conditionally reset FrontEnd Mixer ASoC: qdsp6: q6asm: fix q6asm_dai_prepare error handling ASoC: topology: Add missing rwsem around snd_ctl_remove() calls ASoC: codecs: wcd938x: fix volatile register range ASoC: codecs: wcd934x: return error code correctly from hw_params ASoC: codecs: lpass-rx-macro: fix HPHR setting CLSH mask net: ieee802154: handle iftypes as u32 firmware: arm_scmi: Fix base agent discover response firmware: arm_scmi: pm: Propagate return value to caller ASoC: stm32: i2s: fix 32 bits channel length without mclk NFSv42: Don't fail clone() unless the OP_CLONE operation failed ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE drm/nouveau/acr: fix a couple NULL vs IS_ERR() checks scsi: qla2xxx: edif: Fix off by one bug in qla_edif_app_getfcinfo() scsi: mpt3sas: Fix kernel panic during drive powercycle test scsi: mpt3sas: Fix system going into read-only mode scsi: mpt3sas: Fix incorrect system timestamp drm/vc4: fix error code in vc4_create_object() drm/aspeed: Fix vga_pw sysfs output net: marvell: prestera: fix brige port operation net: marvell: prestera: fix double free issue on err path HID: input: Fix parsing of HID_CP_CONSUMER_CONTROL fields HID: input: set usage type to key on keycode remap HID: magicmouse: prevent division by 0 on scroll iavf: Prevent changing static ITR values if adaptive moderation is on iavf: Fix refreshing iavf adapter stats on ethtool request iavf: Fix VLAN feature flags after VFR x86/pvh: add prototype for xen_pvh_init() xen/pvh: add missing prototype to header ALSA: intel-dsp-config: add quirk for JSL devices based on ES8336 codec mptcp: fix delack timer mptcp: use delegate action to schedule 3rd ack retrans af_unix: fix regression in read after shutdown firmware: smccc: Fix check for ARCH_SOC_ID not implemented ipv6: fix typos in __ip6_finish_output() nfp: checking parameter process for rx-usecs/tx-usecs is invalid net: stmmac: retain PTP clock time during SIOCSHWTSTAMP ioctls net: ipv6: add fib6_nh_release_dsts stub net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group ice: fix vsi->txq_map sizing ice: avoid bpf_prog refcount underflow scsi: core: sysfs: Fix setting device state to SDEV_RUNNING scsi: scsi_debug: Zero clear zones at reset write pointer erofs: fix deadlock when shrink erofs slab i2c: virtio: disable timeout handling net/smc: Ensure the active closing peer first closes clcsock mlxsw: spectrum: Protect driver from buggy firmware net: ipa: directly disable ipa-setup-ready interrupt net: ipa: separate disabling setup from modem stop net: ipa: kill ipa_cmd_pipeline_clear() net: marvell: mvpp2: increase MTU limit when XDP enabled cpufreq: intel_pstate: Add Ice Lake server to out-of-band IDs nvmet-tcp: fix incomplete data digest send drm/hyperv: Fix device removal on Gen1 VMs arm64: uaccess: avoid blocking within critical sections net/ncsi : Add payload to be 32-bit aligned to fix dropped packets PM: hibernate: use correct mode for swsusp_close() drm/amd/display: Fix DPIA outbox timeout after GPU reset drm/amd/display: Set plane update flags for all planes in reset tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows lan743x: fix deadlock in lan743x_phy_link_status_change() net: phylink: Force link down and retrigger resolve on interface change net: phylink: Force retrigger in case of latched link-fail indicator net/smc: Fix NULL pointer dereferencing in smc_vlan_by_tcpsk() net/smc: Fix loop in smc_listen nvmet: use IOCB_NOWAIT only if the filesystem supports it igb: fix netpoll exit with traffic MIPS: loongson64: fix FTLB configuration MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48 tls: splice_read: fix record type check tls: splice_read: fix accessing pre-processed records tls: fix replacing proto_ops net: stmmac: Disable Tx queues when reconfiguring the interface net/sched: sch_ets: don't peek at classes beyond 'nbands' ethtool: ioctl: fix potential NULL deref in ethtool_set_coalesce() net: vlan: fix underflow for the real_dev refcnt net/smc: Don't call clcsock shutdown twice when smc shutdown net: hns3: fix VF RSS failed problem after PF enable multi-TCs net: hns3: fix incorrect components info of ethtool --reset command net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP net: mscc: ocelot: correctly report the timestamping RX filters in ethtool locking/rwsem: Make handoff bit handling more consistent perf: Ignore sigtrap for tracepoints destined for other tasks sched/scs: Reset task stack state in bringup_cpu() iommu/rockchip: Fix PAGE_DESC_HI_MASKs for RK3568 iommu/vt-d: Fix unmap_pages support f2fs: quota: fix potential deadlock f2fs: set SBI_NEED_FSCK flag when inconsistent node block found riscv: dts: microchip: fix board compatible riscv: dts: microchip: drop duplicated MMC/SDHC node cifs: nosharesock should not share socket with future sessions ceph: properly handle statfs on multifs setups iommu/amd: Clarify AMD IOMMUv2 initialization messages vdpa_sim: avoid putting an uninitialized iova_domain vhost/vsock: fix incorrect used length reported to the guest ksmbd: Fix an error handling path in 'smb2_sess_setup()' tracing: Check pid filtering when creating events cifs: nosharesock should be set on new server io_uring: fix soft lockup when call __io_remove_buffers firmware: arm_scmi: Fix type error assignment in voltage protocol firmware: arm_scmi: Fix type error in sensor protocol docs: accounting: update delay-accounting.rst reference blk-mq: cancel blk-mq dispatch work in both blk_cleanup_queue and disk_release() block: avoid to quiesce queue in elevator_init_mq drm/amdgpu/gfx10: add wraparound gpu counter check for APUs as well drm/amdgpu/gfx9: switch to golden tsc registers for renoir+ Linux 5.15.6 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ibe65221ba285038e25de36ad3659e0ce201408c2
This commit is contained in:
@@ -1099,7 +1099,7 @@ task_delayacct
|
||||
===============
|
||||
|
||||
Enables/disables task delay accounting (see
|
||||
:doc:`accounting/delay-accounting.rst`). Enabling this feature incurs
|
||||
Documentation/accounting/delay-accounting.rst. Enabling this feature incurs
|
||||
a small amount of overhead in the scheduler but is useful for debugging
|
||||
and performance tuning. It is required by some tools such as iotop.
|
||||
|
||||
|
||||
@@ -37,8 +37,7 @@ conn_reuse_mode - INTEGER
|
||||
|
||||
0: disable any special handling on port reuse. The new
|
||||
connection will be delivered to the same real server that was
|
||||
servicing the previous connection. This will effectively
|
||||
disable expire_nodest_conn.
|
||||
servicing the previous connection.
|
||||
|
||||
bit 1: enable rescheduling of new connections when it is safe.
|
||||
That is, whenever expire_nodest_conn and for TCP sockets, when
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 15
|
||||
SUBLEVEL = 5
|
||||
SUBLEVEL = 6
|
||||
EXTRAVERSION =
|
||||
NAME = Trick or Treat
|
||||
|
||||
|
||||
@@ -506,11 +506,17 @@
|
||||
#address-cells = <3>;
|
||||
#interrupt-cells = <1>;
|
||||
#size-cells = <2>;
|
||||
interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
|
||||
interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "pcie", "msi";
|
||||
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
|
||||
interrupt-map = <0 0 0 1 &gicv2 GIC_SPI 143
|
||||
IRQ_TYPE_LEVEL_HIGH>,
|
||||
<0 0 0 2 &gicv2 GIC_SPI 144
|
||||
IRQ_TYPE_LEVEL_HIGH>,
|
||||
<0 0 0 3 &gicv2 GIC_SPI 145
|
||||
IRQ_TYPE_LEVEL_HIGH>,
|
||||
<0 0 0 4 &gicv2 GIC_SPI 146
|
||||
IRQ_TYPE_LEVEL_HIGH>;
|
||||
msi-controller;
|
||||
msi-parent = <&pcie0>;
|
||||
|
||||
@@ -242,6 +242,8 @@
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
pcie0: pcie@12000 {
|
||||
@@ -408,7 +410,7 @@
|
||||
i2c0: i2c@18009000 {
|
||||
compatible = "brcm,iproc-i2c";
|
||||
reg = <0x18009000 0x50>;
|
||||
interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
clock-frequency = <100000>;
|
||||
|
||||
@@ -33,7 +33,7 @@ extern void __iomem *sdr_ctl_base_addr;
|
||||
u32 socfpga_sdram_self_refresh(u32 sdr_base);
|
||||
extern unsigned int socfpga_sdram_self_refresh_sz;
|
||||
|
||||
extern char secondary_trampoline, secondary_trampoline_end;
|
||||
extern char secondary_trampoline[], secondary_trampoline_end[];
|
||||
|
||||
extern unsigned long socfpga_cpu1start_addr;
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
|
||||
static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||
{
|
||||
int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
|
||||
int trampoline_size = secondary_trampoline_end - secondary_trampoline;
|
||||
|
||||
if (socfpga_cpu1start_addr) {
|
||||
/* This will put CPU #1 into reset. */
|
||||
writel(RSTMGR_MPUMODRST_CPU1,
|
||||
rst_manager_base_addr + SOCFPGA_RSTMGR_MODMPURST);
|
||||
|
||||
memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
|
||||
memcpy(phys_to_virt(0), secondary_trampoline, trampoline_size);
|
||||
|
||||
writel(__pa_symbol(secondary_startup),
|
||||
sys_manager_base_addr + (socfpga_cpu1start_addr & 0x000000ff));
|
||||
@@ -45,12 +45,12 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||
|
||||
static int socfpga_a10_boot_secondary(unsigned int cpu, struct task_struct *idle)
|
||||
{
|
||||
int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
|
||||
int trampoline_size = secondary_trampoline_end - secondary_trampoline;
|
||||
|
||||
if (socfpga_cpu1start_addr) {
|
||||
writel(RSTMGR_MPUMODRST_CPU1, rst_manager_base_addr +
|
||||
SOCFPGA_A10_RSTMGR_MODMPURST);
|
||||
memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
|
||||
memcpy(phys_to_virt(0), secondary_trampoline, trampoline_size);
|
||||
|
||||
writel(__pa_symbol(secondary_startup),
|
||||
sys_manager_base_addr + (socfpga_cpu1start_addr & 0x00000fff));
|
||||
|
||||
@@ -76,7 +76,7 @@ static inline void __pmd_populate(pmd_t *pmdp, phys_addr_t ptep,
|
||||
static inline void
|
||||
pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
|
||||
{
|
||||
VM_BUG_ON(mm != &init_mm);
|
||||
VM_BUG_ON(mm && mm != &init_mm);
|
||||
__pmd_populate(pmdp, __pa(ptep), PMD_TYPE_TABLE | PMD_TABLE_UXN);
|
||||
}
|
||||
|
||||
|
||||
@@ -292,12 +292,22 @@ do { \
|
||||
(x) = (__force __typeof__(*(ptr)))__gu_val; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* We must not call into the scheduler between uaccess_ttbr0_enable() and
|
||||
* uaccess_ttbr0_disable(). As `x` and `ptr` could contain blocking functions,
|
||||
* we must evaluate these outside of the critical section.
|
||||
*/
|
||||
#define __raw_get_user(x, ptr, err) \
|
||||
do { \
|
||||
__typeof__(*(ptr)) __user *__rgu_ptr = (ptr); \
|
||||
__typeof__(x) __rgu_val; \
|
||||
__chk_user_ptr(ptr); \
|
||||
\
|
||||
uaccess_ttbr0_enable(); \
|
||||
__raw_get_mem("ldtr", x, ptr, err); \
|
||||
__raw_get_mem("ldtr", __rgu_val, __rgu_ptr, err); \
|
||||
uaccess_ttbr0_disable(); \
|
||||
\
|
||||
(x) = __rgu_val; \
|
||||
} while (0)
|
||||
|
||||
#define __get_user_error(x, ptr, err) \
|
||||
@@ -321,14 +331,22 @@ do { \
|
||||
|
||||
#define get_user __get_user
|
||||
|
||||
/*
|
||||
* We must not call into the scheduler between __uaccess_enable_tco_async() and
|
||||
* __uaccess_disable_tco_async(). As `dst` and `src` may contain blocking
|
||||
* functions, we must evaluate these outside of the critical section.
|
||||
*/
|
||||
#define __get_kernel_nofault(dst, src, type, err_label) \
|
||||
do { \
|
||||
__typeof__(dst) __gkn_dst = (dst); \
|
||||
__typeof__(src) __gkn_src = (src); \
|
||||
int __gkn_err = 0; \
|
||||
\
|
||||
__uaccess_enable_tco_async(); \
|
||||
__raw_get_mem("ldr", *((type *)(dst)), \
|
||||
(__force type *)(src), __gkn_err); \
|
||||
__raw_get_mem("ldr", *((type *)(__gkn_dst)), \
|
||||
(__force type *)(__gkn_src), __gkn_err); \
|
||||
__uaccess_disable_tco_async(); \
|
||||
\
|
||||
if (unlikely(__gkn_err)) \
|
||||
goto err_label; \
|
||||
} while (0)
|
||||
@@ -367,11 +385,19 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* We must not call into the scheduler between uaccess_ttbr0_enable() and
|
||||
* uaccess_ttbr0_disable(). As `x` and `ptr` could contain blocking functions,
|
||||
* we must evaluate these outside of the critical section.
|
||||
*/
|
||||
#define __raw_put_user(x, ptr, err) \
|
||||
do { \
|
||||
__chk_user_ptr(ptr); \
|
||||
__typeof__(*(ptr)) __user *__rpu_ptr = (ptr); \
|
||||
__typeof__(*(ptr)) __rpu_val = (x); \
|
||||
__chk_user_ptr(__rpu_ptr); \
|
||||
\
|
||||
uaccess_ttbr0_enable(); \
|
||||
__raw_put_mem("sttr", x, ptr, err); \
|
||||
__raw_put_mem("sttr", __rpu_val, __rpu_ptr, err); \
|
||||
uaccess_ttbr0_disable(); \
|
||||
} while (0)
|
||||
|
||||
@@ -396,14 +422,22 @@ do { \
|
||||
|
||||
#define put_user __put_user
|
||||
|
||||
/*
|
||||
* We must not call into the scheduler between __uaccess_enable_tco_async() and
|
||||
* __uaccess_disable_tco_async(). As `dst` and `src` may contain blocking
|
||||
* functions, we must evaluate these outside of the critical section.
|
||||
*/
|
||||
#define __put_kernel_nofault(dst, src, type, err_label) \
|
||||
do { \
|
||||
__typeof__(dst) __pkn_dst = (dst); \
|
||||
__typeof__(src) __pkn_src = (src); \
|
||||
int __pkn_err = 0; \
|
||||
\
|
||||
__uaccess_enable_tco_async(); \
|
||||
__raw_put_mem("str", *((type *)(src)), \
|
||||
(__force type *)(dst), __pkn_err); \
|
||||
__raw_put_mem("str", *((type *)(__pkn_src)), \
|
||||
(__force type *)(__pkn_dst), __pkn_err); \
|
||||
__uaccess_disable_tco_async(); \
|
||||
\
|
||||
if (unlikely(__pkn_err)) \
|
||||
goto err_label; \
|
||||
} while(0)
|
||||
|
||||
@@ -3189,7 +3189,7 @@ config STACKTRACE_SUPPORT
|
||||
config PGTABLE_LEVELS
|
||||
int
|
||||
default 4 if PAGE_SIZE_4KB && MIPS_VA_BITS_48
|
||||
default 3 if 64BIT && !PAGE_SIZE_64KB
|
||||
default 3 if 64BIT && (!PAGE_SIZE_64KB || MIPS_VA_BITS_48)
|
||||
default 2
|
||||
|
||||
config MIPS_AUTO_PFN_OFFSET
|
||||
|
||||
@@ -1734,8 +1734,6 @@ static inline void decode_cpucfg(struct cpuinfo_mips *c)
|
||||
|
||||
static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
|
||||
/* All Loongson processors covered here define ExcCode 16 as GSExc. */
|
||||
c->options |= MIPS_CPU_GSEXCEX;
|
||||
|
||||
@@ -1796,6 +1794,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
panic("Unknown Loongson Processor ID!");
|
||||
break;
|
||||
}
|
||||
|
||||
decode_configs(c);
|
||||
}
|
||||
#else
|
||||
static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu) { }
|
||||
|
||||
@@ -57,8 +57,6 @@ SECTIONS
|
||||
{
|
||||
. = KERNEL_BINARY_TEXT_START;
|
||||
|
||||
_stext = .; /* start of kernel text, includes init code & data */
|
||||
|
||||
__init_begin = .;
|
||||
HEAD_TEXT_SECTION
|
||||
MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
|
||||
@@ -82,6 +80,7 @@ SECTIONS
|
||||
/* freed after init ends here */
|
||||
|
||||
_text = .; /* Text and read-only data */
|
||||
_stext = .;
|
||||
MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
|
||||
.text ALIGN(PAGE_SIZE) : {
|
||||
TEXT_TEXT
|
||||
|
||||
@@ -202,11 +202,11 @@ vmap_stack_overflow:
|
||||
mfspr r1, SPRN_SPRG_THREAD
|
||||
lwz r1, TASK_CPU - THREAD(r1)
|
||||
slwi r1, r1, 3
|
||||
addis r1, r1, emergency_ctx@ha
|
||||
addis r1, r1, emergency_ctx-PAGE_OFFSET@ha
|
||||
#else
|
||||
lis r1, emergency_ctx@ha
|
||||
lis r1, emergency_ctx-PAGE_OFFSET@ha
|
||||
#endif
|
||||
lwz r1, emergency_ctx@l(r1)
|
||||
lwz r1, emergency_ctx-PAGE_OFFSET@l(r1)
|
||||
addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE
|
||||
EXCEPTION_PROLOG_2 0 vmap_stack_overflow
|
||||
prepare_transfer_to_handler
|
||||
|
||||
@@ -695,6 +695,7 @@ static void flush_guest_tlb(struct kvm *kvm)
|
||||
"r" (0) : "memory");
|
||||
}
|
||||
asm volatile("ptesync": : :"memory");
|
||||
// POWER9 congruence-class TLBIEL leaves ERAT. Flush it now.
|
||||
asm volatile(PPC_RADIX_INVALIDATE_ERAT_GUEST : : :"memory");
|
||||
} else {
|
||||
for (set = 0; set < kvm->arch.tlb_sets; ++set) {
|
||||
@@ -705,7 +706,9 @@ static void flush_guest_tlb(struct kvm *kvm)
|
||||
rb += PPC_BIT(51); /* increment set number */
|
||||
}
|
||||
asm volatile("ptesync": : :"memory");
|
||||
asm volatile(PPC_ISA_3_0_INVALIDATE_ERAT : : :"memory");
|
||||
// POWER9 congruence-class TLBIEL leaves ERAT. Flush it now.
|
||||
if (cpu_has_feature(CPU_FTR_ARCH_300))
|
||||
asm volatile(PPC_ISA_3_0_INVALIDATE_ERAT : : :"memory");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
model = "Microchip PolarFire-SoC Icicle Kit";
|
||||
compatible = "microchip,mpfs-icicle-kit";
|
||||
compatible = "microchip,mpfs-icicle-kit", "microchip,mpfs";
|
||||
|
||||
aliases {
|
||||
ethernet0 = &emac1;
|
||||
@@ -56,8 +56,17 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdcard {
|
||||
&mmc {
|
||||
status = "okay";
|
||||
|
||||
bus-width = <4>;
|
||||
disable-wp;
|
||||
cap-sd-highspeed;
|
||||
card-detect-delay = <200>;
|
||||
sd-uhs-sdr12;
|
||||
sd-uhs-sdr25;
|
||||
sd-uhs-sdr50;
|
||||
sd-uhs-sdr104;
|
||||
};
|
||||
|
||||
&emac0 {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
/ {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
model = "Microchip MPFS Icicle Kit";
|
||||
compatible = "microchip,mpfs-icicle-kit";
|
||||
model = "Microchip PolarFire SoC";
|
||||
compatible = "microchip,mpfs";
|
||||
|
||||
chosen {
|
||||
};
|
||||
@@ -262,39 +262,14 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
emmc: mmc@20008000 {
|
||||
/* Common node entry for emmc/sd */
|
||||
mmc: mmc@20008000 {
|
||||
compatible = "cdns,sd4hc";
|
||||
reg = <0x0 0x20008000 0x0 0x1000>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <88 89>;
|
||||
pinctrl-names = "default";
|
||||
clocks = <&clkcfg 6>;
|
||||
bus-width = <4>;
|
||||
cap-mmc-highspeed;
|
||||
mmc-ddr-3_3v;
|
||||
max-frequency = <200000000>;
|
||||
non-removable;
|
||||
no-sd;
|
||||
no-sdio;
|
||||
voltage-ranges = <3300 3300>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdcard: sdhc@20008000 {
|
||||
compatible = "cdns,sd4hc";
|
||||
reg = <0x0 0x20008000 0x0 0x1000>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <88>;
|
||||
pinctrl-names = "default";
|
||||
clocks = <&clkcfg 6>;
|
||||
bus-width = <4>;
|
||||
disable-wp;
|
||||
cap-sd-highspeed;
|
||||
card-detect-delay = <200>;
|
||||
sd-uhs-sdr12;
|
||||
sd-uhs-sdr25;
|
||||
sd-uhs-sdr50;
|
||||
sd-uhs-sdr104;
|
||||
max-frequency = <200000000>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -62,4 +62,9 @@ void xen_arch_register_cpu(int num);
|
||||
void xen_arch_unregister_cpu(int num);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PVH
|
||||
void __init xen_pvh_init(struct boot_params *boot_params);
|
||||
void __init mem_map_via_hcall(struct boot_params *boot_params_p);
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_X86_XEN_HYPERVISOR_H */
|
||||
|
||||
@@ -389,8 +389,10 @@ void blk_cleanup_queue(struct request_queue *q)
|
||||
blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
|
||||
|
||||
blk_sync_queue(q);
|
||||
if (queue_is_mq(q))
|
||||
if (queue_is_mq(q)) {
|
||||
blk_mq_cancel_work_sync(q);
|
||||
blk_mq_exit_queue(q);
|
||||
}
|
||||
|
||||
/*
|
||||
* In theory, request pool of sched_tags belongs to request queue.
|
||||
|
||||
@@ -4018,6 +4018,19 @@ unsigned int blk_mq_rq_cpu(struct request *rq)
|
||||
}
|
||||
EXPORT_SYMBOL(blk_mq_rq_cpu);
|
||||
|
||||
void blk_mq_cancel_work_sync(struct request_queue *q)
|
||||
{
|
||||
if (queue_is_mq(q)) {
|
||||
struct blk_mq_hw_ctx *hctx;
|
||||
int i;
|
||||
|
||||
cancel_delayed_work_sync(&q->requeue_work);
|
||||
|
||||
queue_for_each_hw_ctx(q, hctx, i)
|
||||
cancel_delayed_work_sync(&hctx->run_work);
|
||||
}
|
||||
}
|
||||
|
||||
static int __init blk_mq_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -129,6 +129,8 @@ extern int blk_mq_sysfs_register(struct request_queue *q);
|
||||
extern void blk_mq_sysfs_unregister(struct request_queue *q);
|
||||
extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx);
|
||||
|
||||
void blk_mq_cancel_work_sync(struct request_queue *q);
|
||||
|
||||
void blk_mq_release(struct request_queue *q);
|
||||
|
||||
static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q,
|
||||
|
||||
@@ -805,16 +805,6 @@ static void blk_release_queue(struct kobject *kobj)
|
||||
|
||||
blk_free_queue_stats(q->stats);
|
||||
|
||||
if (queue_is_mq(q)) {
|
||||
struct blk_mq_hw_ctx *hctx;
|
||||
int i;
|
||||
|
||||
cancel_delayed_work_sync(&q->requeue_work);
|
||||
|
||||
queue_for_each_hw_ctx(q, hctx, i)
|
||||
cancel_delayed_work_sync(&hctx->run_work);
|
||||
}
|
||||
|
||||
blk_exit_queue(q);
|
||||
|
||||
blk_queue_free_zone_bitmaps(q);
|
||||
|
||||
@@ -694,12 +694,18 @@ void elevator_init_mq(struct request_queue *q)
|
||||
if (!e)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We are called before adding disk, when there isn't any FS I/O,
|
||||
* so freezing queue plus canceling dispatch work is enough to
|
||||
* drain any dispatch activities originated from passthrough
|
||||
* requests, then no need to quiesce queue which may add long boot
|
||||
* latency, especially when lots of disks are involved.
|
||||
*/
|
||||
blk_mq_freeze_queue(q);
|
||||
blk_mq_quiesce_queue(q);
|
||||
blk_mq_cancel_work_sync(q);
|
||||
|
||||
err = blk_mq_init_sched(q, e);
|
||||
|
||||
blk_mq_unquiesce_queue(q);
|
||||
blk_mq_unfreeze_queue(q);
|
||||
|
||||
if (err) {
|
||||
|
||||
@@ -1086,6 +1086,8 @@ static void disk_release(struct device *dev)
|
||||
might_sleep();
|
||||
WARN_ON_ONCE(disk_live(disk));
|
||||
|
||||
blk_mq_cancel_work_sync(disk->queue);
|
||||
|
||||
disk_release_events(disk);
|
||||
kfree(disk->random);
|
||||
xa_destroy(&disk->part_tbl);
|
||||
|
||||
@@ -1011,7 +1011,14 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
|
||||
static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf)
|
||||
{
|
||||
struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum);
|
||||
struct cpc_register_resource *reg = &cpc_desc->cpc_regs[reg_idx];
|
||||
struct cpc_register_resource *reg;
|
||||
|
||||
if (!cpc_desc) {
|
||||
pr_debug("No CPC descriptor for CPU:%d\n", cpunum);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
reg = &cpc_desc->cpc_regs[reg_idx];
|
||||
|
||||
if (CPC_IN_PCC(reg)) {
|
||||
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum);
|
||||
|
||||
@@ -1090,15 +1090,10 @@ struct fwnode_handle *acpi_node_get_parent(const struct fwnode_handle *fwnode)
|
||||
/* All data nodes have parent pointer so just return that */
|
||||
return to_acpi_data_node(fwnode)->parent;
|
||||
} else if (is_acpi_device_node(fwnode)) {
|
||||
acpi_handle handle, parent_handle;
|
||||
struct device *dev = to_acpi_device_node(fwnode)->dev.parent;
|
||||
|
||||
handle = to_acpi_device_node(fwnode)->handle;
|
||||
if (ACPI_SUCCESS(acpi_get_parent(handle, &parent_handle))) {
|
||||
struct acpi_device *adev;
|
||||
|
||||
if (!acpi_bus_get_device(parent_handle, &adev))
|
||||
return acpi_fwnode_handle(adev);
|
||||
}
|
||||
if (dev)
|
||||
return acpi_fwnode_handle(to_acpi_device(dev));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -999,6 +999,12 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu)
|
||||
*/
|
||||
value &= ~GENMASK_ULL(31, 24);
|
||||
value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached);
|
||||
/*
|
||||
* However, make sure that EPP will be set to "performance" when
|
||||
* the CPU is brought back online again and the "performance"
|
||||
* scaling algorithm is still in effect.
|
||||
*/
|
||||
cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2249,6 +2255,7 @@ static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] __initconst = {
|
||||
X86_MATCH(BROADWELL_D, core_funcs),
|
||||
X86_MATCH(BROADWELL_X, core_funcs),
|
||||
X86_MATCH(SKYLAKE_X, core_funcs),
|
||||
X86_MATCH(ICELAKE_X, core_funcs),
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -34,6 +34,12 @@ struct scmi_msg_resp_base_attributes {
|
||||
__le16 reserved;
|
||||
};
|
||||
|
||||
struct scmi_msg_resp_base_discover_agent {
|
||||
__le32 agent_id;
|
||||
u8 name[SCMI_MAX_STR_SIZE];
|
||||
};
|
||||
|
||||
|
||||
struct scmi_msg_base_error_notify {
|
||||
__le32 event_control;
|
||||
#define BASE_TP_NOTIFY_ALL BIT(0)
|
||||
@@ -225,18 +231,21 @@ static int scmi_base_discover_agent_get(const struct scmi_protocol_handle *ph,
|
||||
int id, char *name)
|
||||
{
|
||||
int ret;
|
||||
struct scmi_msg_resp_base_discover_agent *agent_info;
|
||||
struct scmi_xfer *t;
|
||||
|
||||
ret = ph->xops->xfer_get_init(ph, BASE_DISCOVER_AGENT,
|
||||
sizeof(__le32), SCMI_MAX_STR_SIZE, &t);
|
||||
sizeof(__le32), sizeof(*agent_info), &t);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
put_unaligned_le32(id, t->tx.buf);
|
||||
|
||||
ret = ph->xops->do_xfer(ph, t);
|
||||
if (!ret)
|
||||
strlcpy(name, t->rx.buf, SCMI_MAX_STR_SIZE);
|
||||
if (!ret) {
|
||||
agent_info = t->rx.buf;
|
||||
strlcpy(name, agent_info->name, SCMI_MAX_STR_SIZE);
|
||||
}
|
||||
|
||||
ph->xops->xfer_put(ph, t);
|
||||
|
||||
|
||||
@@ -138,9 +138,7 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
|
||||
scmi_pd_data->domains = domains;
|
||||
scmi_pd_data->num_domains = num_domains;
|
||||
|
||||
of_genpd_add_provider_onecell(np, scmi_pd_data);
|
||||
|
||||
return 0;
|
||||
return of_genpd_add_provider_onecell(np, scmi_pd_data);
|
||||
}
|
||||
|
||||
static const struct scmi_device_id scmi_id_table[] = {
|
||||
|
||||
@@ -637,7 +637,7 @@ static int scmi_sensor_config_get(const struct scmi_protocol_handle *ph,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
put_unaligned_le32(cpu_to_le32(sensor_id), t->tx.buf);
|
||||
put_unaligned_le32(sensor_id, t->tx.buf);
|
||||
ret = ph->xops->do_xfer(ph, t);
|
||||
if (!ret) {
|
||||
struct sensors_info *si = ph->get_priv(ph);
|
||||
|
||||
@@ -82,7 +82,8 @@ static bool scmi_vio_have_vq_rx(struct virtio_device *vdev)
|
||||
}
|
||||
|
||||
static int scmi_vio_feed_vq_rx(struct scmi_vio_channel *vioch,
|
||||
struct scmi_vio_msg *msg)
|
||||
struct scmi_vio_msg *msg,
|
||||
struct device *dev)
|
||||
{
|
||||
struct scatterlist sg_in;
|
||||
int rc;
|
||||
@@ -94,8 +95,7 @@ static int scmi_vio_feed_vq_rx(struct scmi_vio_channel *vioch,
|
||||
|
||||
rc = virtqueue_add_inbuf(vioch->vqueue, &sg_in, 1, msg, GFP_ATOMIC);
|
||||
if (rc)
|
||||
dev_err_once(vioch->cinfo->dev,
|
||||
"failed to add to virtqueue (%d)\n", rc);
|
||||
dev_err_once(dev, "failed to add to virtqueue (%d)\n", rc);
|
||||
else
|
||||
virtqueue_kick(vioch->vqueue);
|
||||
|
||||
@@ -108,7 +108,7 @@ static void scmi_finalize_message(struct scmi_vio_channel *vioch,
|
||||
struct scmi_vio_msg *msg)
|
||||
{
|
||||
if (vioch->is_rx) {
|
||||
scmi_vio_feed_vq_rx(vioch, msg);
|
||||
scmi_vio_feed_vq_rx(vioch, msg, vioch->cinfo->dev);
|
||||
} else {
|
||||
/* Here IRQs are assumed to be already disabled by the caller */
|
||||
spin_lock(&vioch->lock);
|
||||
@@ -269,7 +269,7 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
|
||||
list_add_tail(&msg->list, &vioch->free_list);
|
||||
spin_unlock_irqrestore(&vioch->lock, flags);
|
||||
} else {
|
||||
scmi_vio_feed_vq_rx(vioch, msg);
|
||||
scmi_vio_feed_vq_rx(vioch, msg, cinfo->dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ static int scmi_voltage_descriptors_get(const struct scmi_protocol_handle *ph,
|
||||
int cnt;
|
||||
|
||||
cmd->domain_id = cpu_to_le32(v->id);
|
||||
cmd->level_index = desc_index;
|
||||
cmd->level_index = cpu_to_le32(desc_index);
|
||||
ret = ph->xops->do_xfer(ph, tl);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
@@ -50,7 +50,7 @@ static int __init smccc_soc_init(void)
|
||||
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
|
||||
ARM_SMCCC_ARCH_SOC_ID, &res);
|
||||
|
||||
if (res.a0 == SMCCC_RET_NOT_SUPPORTED) {
|
||||
if ((int)res.a0 == SMCCC_RET_NOT_SUPPORTED) {
|
||||
pr_info("ARCH_SOC_ID not implemented, skipping ....\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ int amdgpu_ih_wait_on_checkpoint_process(struct amdgpu_device *adev,
|
||||
*/
|
||||
int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih)
|
||||
{
|
||||
unsigned int count = AMDGPU_IH_MAX_NUM_IVS;
|
||||
unsigned int count;
|
||||
u32 wptr;
|
||||
|
||||
if (!ih->enabled || adev->shutdown)
|
||||
@@ -232,6 +232,7 @@ int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih)
|
||||
wptr = amdgpu_ih_get_wptr(adev, ih);
|
||||
|
||||
restart_ih:
|
||||
count = AMDGPU_IH_MAX_NUM_IVS;
|
||||
DRM_DEBUG("%s: rptr %d, wptr %d\n", __func__, ih->rptr, wptr);
|
||||
|
||||
/* Order reading of wptr vs. reading of IH ring data */
|
||||
|
||||
@@ -7729,8 +7729,19 @@ static uint64_t gfx_v10_0_get_gpu_clock_counter(struct amdgpu_device *adev)
|
||||
switch (adev->asic_type) {
|
||||
case CHIP_VANGOGH:
|
||||
case CHIP_YELLOW_CARP:
|
||||
clock = (uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh) |
|
||||
((uint64_t)RREG32_SOC15(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh) << 32ULL);
|
||||
preempt_disable();
|
||||
clock_hi = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh);
|
||||
clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh);
|
||||
hi_check = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Vangogh);
|
||||
/* The SMUIO TSC clock frequency is 100MHz, which sets 32-bit carry over
|
||||
* roughly every 42 seconds.
|
||||
*/
|
||||
if (hi_check != clock_hi) {
|
||||
clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Vangogh);
|
||||
clock_hi = hi_check;
|
||||
}
|
||||
preempt_enable();
|
||||
clock = clock_lo | (clock_hi << 32ULL);
|
||||
break;
|
||||
default:
|
||||
preempt_disable();
|
||||
|
||||
@@ -140,6 +140,11 @@ MODULE_FIRMWARE("amdgpu/aldebaran_rlc.bin");
|
||||
#define mmTCP_CHAN_STEER_5_ARCT 0x0b0c
|
||||
#define mmTCP_CHAN_STEER_5_ARCT_BASE_IDX 0
|
||||
|
||||
#define mmGOLDEN_TSC_COUNT_UPPER_Renoir 0x0025
|
||||
#define mmGOLDEN_TSC_COUNT_UPPER_Renoir_BASE_IDX 1
|
||||
#define mmGOLDEN_TSC_COUNT_LOWER_Renoir 0x0026
|
||||
#define mmGOLDEN_TSC_COUNT_LOWER_Renoir_BASE_IDX 1
|
||||
|
||||
enum ta_ras_gfx_subblock {
|
||||
/*CPC*/
|
||||
TA_RAS_BLOCK__GFX_CPC_INDEX_START = 0,
|
||||
@@ -4228,19 +4233,38 @@ failed_kiq_read:
|
||||
|
||||
static uint64_t gfx_v9_0_get_gpu_clock_counter(struct amdgpu_device *adev)
|
||||
{
|
||||
uint64_t clock;
|
||||
uint64_t clock, clock_lo, clock_hi, hi_check;
|
||||
|
||||
amdgpu_gfx_off_ctrl(adev, false);
|
||||
mutex_lock(&adev->gfx.gpu_clock_mutex);
|
||||
if (adev->asic_type == CHIP_VEGA10 && amdgpu_sriov_runtime(adev)) {
|
||||
clock = gfx_v9_0_kiq_read_clock(adev);
|
||||
} else {
|
||||
WREG32_SOC15(GC, 0, mmRLC_CAPTURE_GPU_CLOCK_COUNT, 1);
|
||||
clock = (uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_LSB) |
|
||||
((uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_MSB) << 32ULL);
|
||||
switch (adev->asic_type) {
|
||||
case CHIP_RENOIR:
|
||||
preempt_disable();
|
||||
clock_hi = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Renoir);
|
||||
clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Renoir);
|
||||
hi_check = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_UPPER_Renoir);
|
||||
/* The SMUIO TSC clock frequency is 100MHz, which sets 32-bit carry over
|
||||
* roughly every 42 seconds.
|
||||
*/
|
||||
if (hi_check != clock_hi) {
|
||||
clock_lo = RREG32_SOC15_NO_KIQ(SMUIO, 0, mmGOLDEN_TSC_COUNT_LOWER_Renoir);
|
||||
clock_hi = hi_check;
|
||||
}
|
||||
preempt_enable();
|
||||
clock = clock_lo | (clock_hi << 32ULL);
|
||||
break;
|
||||
default:
|
||||
amdgpu_gfx_off_ctrl(adev, false);
|
||||
mutex_lock(&adev->gfx.gpu_clock_mutex);
|
||||
if (adev->asic_type == CHIP_VEGA10 && amdgpu_sriov_runtime(adev)) {
|
||||
clock = gfx_v9_0_kiq_read_clock(adev);
|
||||
} else {
|
||||
WREG32_SOC15(GC, 0, mmRLC_CAPTURE_GPU_CLOCK_COUNT, 1);
|
||||
clock = (uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_LSB) |
|
||||
((uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_MSB) << 32ULL);
|
||||
}
|
||||
mutex_unlock(&adev->gfx.gpu_clock_mutex);
|
||||
amdgpu_gfx_off_ctrl(adev, true);
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&adev->gfx.gpu_clock_mutex);
|
||||
amdgpu_gfx_off_ctrl(adev, true);
|
||||
return clock;
|
||||
}
|
||||
|
||||
|
||||
@@ -2213,6 +2213,8 @@ static int dm_resume(void *handle)
|
||||
if (amdgpu_in_reset(adev)) {
|
||||
dc_state = dm->cached_dc_state;
|
||||
|
||||
amdgpu_dm_outbox_init(adev);
|
||||
|
||||
r = dm_dmub_hw_init(adev);
|
||||
if (r)
|
||||
DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
|
||||
@@ -2224,8 +2226,8 @@ static int dm_resume(void *handle)
|
||||
|
||||
for (i = 0; i < dc_state->stream_count; i++) {
|
||||
dc_state->streams[i]->mode_changed = true;
|
||||
for (j = 0; j < dc_state->stream_status->plane_count; j++) {
|
||||
dc_state->stream_status->plane_states[j]->update_flags.raw
|
||||
for (j = 0; j < dc_state->stream_status[i].plane_count; j++) {
|
||||
dc_state->stream_status[i].plane_states[j]->update_flags.raw
|
||||
= 0xffffffff;
|
||||
}
|
||||
}
|
||||
@@ -3846,6 +3848,9 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
|
||||
} else if (dc_link_detect(link, DETECT_REASON_BOOT)) {
|
||||
amdgpu_dm_update_connector_after_detect(aconnector);
|
||||
register_backlight_device(dm, link);
|
||||
|
||||
if (dm->num_of_edps)
|
||||
update_connector_ext_caps(aconnector);
|
||||
if (amdgpu_dc_feature_mask & DC_PSR_MASK)
|
||||
amdgpu_dm_set_psr_caps(link);
|
||||
}
|
||||
|
||||
@@ -1024,8 +1024,6 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
uint32_t min_freq, max_freq = 0;
|
||||
uint32_t ret = 0;
|
||||
|
||||
phm_get_sysfs_buf(&buf, &size);
|
||||
|
||||
switch (type) {
|
||||
case PP_SCLK:
|
||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetGfxclkFrequency, &now);
|
||||
@@ -1038,13 +1036,13 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
else
|
||||
i = 1;
|
||||
|
||||
size += sysfs_emit_at(buf, size, "0: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "0: %uMhz %s\n",
|
||||
data->gfx_min_freq_limit/100,
|
||||
i == 0 ? "*" : "");
|
||||
size += sysfs_emit_at(buf, size, "1: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "1: %uMhz %s\n",
|
||||
i == 1 ? now : SMU10_UMD_PSTATE_GFXCLK,
|
||||
i == 1 ? "*" : "");
|
||||
size += sysfs_emit_at(buf, size, "2: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "2: %uMhz %s\n",
|
||||
data->gfx_max_freq_limit/100,
|
||||
i == 2 ? "*" : "");
|
||||
break;
|
||||
@@ -1052,7 +1050,7 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetFclkFrequency, &now);
|
||||
|
||||
for (i = 0; i < mclk_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i,
|
||||
mclk_table->entries[i].clk / 100,
|
||||
((mclk_table->entries[i].clk / 100)
|
||||
@@ -1067,10 +1065,10 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
|
||||
size += sysfs_emit_at(buf, size, "0: %10uMhz\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_SCLK");
|
||||
size += sprintf(buf + size, "0: %10uMhz\n",
|
||||
(data->gfx_actual_soft_min_freq > 0) ? data->gfx_actual_soft_min_freq : min_freq);
|
||||
size += sysfs_emit_at(buf, size, "1: %10uMhz\n",
|
||||
size += sprintf(buf + size, "1: %10uMhz\n",
|
||||
(data->gfx_actual_soft_max_freq > 0) ? data->gfx_actual_soft_max_freq : max_freq);
|
||||
}
|
||||
break;
|
||||
@@ -1083,8 +1081,8 @@ static int smu10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
|
||||
size += sysfs_emit_at(buf, size, "SCLK: %7uMHz %10uMHz\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_RANGE");
|
||||
size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
|
||||
min_freq, max_freq);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4914,8 +4914,6 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
int size = 0;
|
||||
uint32_t i, now, clock, pcie_speed;
|
||||
|
||||
phm_get_sysfs_buf(&buf, &size);
|
||||
|
||||
switch (type) {
|
||||
case PP_SCLK:
|
||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_API_GetSclkFrequency, &clock);
|
||||
@@ -4928,7 +4926,7 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
now = i;
|
||||
|
||||
for (i = 0; i < sclk_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, sclk_table->dpm_levels[i].value / 100,
|
||||
(i == now) ? "*" : "");
|
||||
break;
|
||||
@@ -4943,7 +4941,7 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
now = i;
|
||||
|
||||
for (i = 0; i < mclk_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, mclk_table->dpm_levels[i].value / 100,
|
||||
(i == now) ? "*" : "");
|
||||
break;
|
||||
@@ -4957,7 +4955,7 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
now = i;
|
||||
|
||||
for (i = 0; i < pcie_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %s %s\n", i,
|
||||
size += sprintf(buf + size, "%d: %s %s\n", i,
|
||||
(pcie_table->dpm_levels[i].value == 0) ? "2.5GT/s, x8" :
|
||||
(pcie_table->dpm_levels[i].value == 1) ? "5.0GT/s, x16" :
|
||||
(pcie_table->dpm_levels[i].value == 2) ? "8.0GT/s, x16" : "",
|
||||
@@ -4965,32 +4963,32 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
break;
|
||||
case OD_SCLK:
|
||||
if (hwmgr->od_enabled) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
|
||||
size += sprintf(buf + size, "%s:\n", "OD_SCLK");
|
||||
for (i = 0; i < odn_sclk_table->num_of_pl; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %10uMHz %10umV\n",
|
||||
size += sprintf(buf + size, "%d: %10uMHz %10umV\n",
|
||||
i, odn_sclk_table->entries[i].clock/100,
|
||||
odn_sclk_table->entries[i].vddc);
|
||||
}
|
||||
break;
|
||||
case OD_MCLK:
|
||||
if (hwmgr->od_enabled) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
|
||||
size += sprintf(buf + size, "%s:\n", "OD_MCLK");
|
||||
for (i = 0; i < odn_mclk_table->num_of_pl; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %10uMHz %10umV\n",
|
||||
size += sprintf(buf + size, "%d: %10uMHz %10umV\n",
|
||||
i, odn_mclk_table->entries[i].clock/100,
|
||||
odn_mclk_table->entries[i].vddc);
|
||||
}
|
||||
break;
|
||||
case OD_RANGE:
|
||||
if (hwmgr->od_enabled) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
|
||||
size += sysfs_emit_at(buf, size, "SCLK: %7uMHz %10uMHz\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_RANGE");
|
||||
size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
|
||||
data->golden_dpm_table.sclk_table.dpm_levels[0].value/100,
|
||||
hwmgr->platform_descriptor.overdriveLimit.engineClock/100);
|
||||
size += sysfs_emit_at(buf, size, "MCLK: %7uMHz %10uMHz\n",
|
||||
size += sprintf(buf + size, "MCLK: %7uMHz %10uMHz\n",
|
||||
data->golden_dpm_table.mclk_table.dpm_levels[0].value/100,
|
||||
hwmgr->platform_descriptor.overdriveLimit.memoryClock/100);
|
||||
size += sysfs_emit_at(buf, size, "VDDC: %7umV %11umV\n",
|
||||
size += sprintf(buf + size, "VDDC: %7umV %11umV\n",
|
||||
data->odn_dpm_table.min_vddc,
|
||||
data->odn_dpm_table.max_vddc);
|
||||
}
|
||||
|
||||
@@ -1550,8 +1550,6 @@ static int smu8_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
uint32_t i, now;
|
||||
int size = 0;
|
||||
|
||||
phm_get_sysfs_buf(&buf, &size);
|
||||
|
||||
switch (type) {
|
||||
case PP_SCLK:
|
||||
now = PHM_GET_FIELD(cgs_read_ind_register(hwmgr->device,
|
||||
@@ -1561,7 +1559,7 @@ static int smu8_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
CURR_SCLK_INDEX);
|
||||
|
||||
for (i = 0; i < sclk_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, sclk_table->entries[i].clk / 100,
|
||||
(i == now) ? "*" : "");
|
||||
break;
|
||||
@@ -1573,7 +1571,7 @@ static int smu8_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
CURR_MCLK_INDEX);
|
||||
|
||||
for (i = SMU8_NUM_NBPMEMORYCLOCK; i > 0; i--)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
SMU8_NUM_NBPMEMORYCLOCK-i, data->sys_info.nbp_memory_clock[i-1] / 100,
|
||||
(SMU8_NUM_NBPMEMORYCLOCK-i == now) ? "*" : "");
|
||||
break;
|
||||
|
||||
@@ -4639,8 +4639,6 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
|
||||
int i, now, size = 0, count = 0;
|
||||
|
||||
phm_get_sysfs_buf(&buf, &size);
|
||||
|
||||
switch (type) {
|
||||
case PP_SCLK:
|
||||
if (data->registry_data.sclk_dpm_key_disabled)
|
||||
@@ -4654,7 +4652,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
else
|
||||
count = sclk_table->count;
|
||||
for (i = 0; i < count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, sclk_table->dpm_levels[i].value / 100,
|
||||
(i == now) ? "*" : "");
|
||||
break;
|
||||
@@ -4665,7 +4663,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentUclkIndex, &now);
|
||||
|
||||
for (i = 0; i < mclk_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, mclk_table->dpm_levels[i].value / 100,
|
||||
(i == now) ? "*" : "");
|
||||
break;
|
||||
@@ -4676,7 +4674,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentSocclkIndex, &now);
|
||||
|
||||
for (i = 0; i < soc_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, soc_table->dpm_levels[i].value / 100,
|
||||
(i == now) ? "*" : "");
|
||||
break;
|
||||
@@ -4688,7 +4686,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
PPSMC_MSG_GetClockFreqMHz, CLK_DCEFCLK, &now);
|
||||
|
||||
for (i = 0; i < dcef_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, dcef_table->dpm_levels[i].value / 100,
|
||||
(dcef_table->dpm_levels[i].value / 100 == now) ?
|
||||
"*" : "");
|
||||
@@ -4702,7 +4700,7 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
gen_speed = pptable->PcieGenSpeed[i];
|
||||
lane_width = pptable->PcieLaneCount[i];
|
||||
|
||||
size += sysfs_emit_at(buf, size, "%d: %s %s %s\n", i,
|
||||
size += sprintf(buf + size, "%d: %s %s %s\n", i,
|
||||
(gen_speed == 0) ? "2.5GT/s," :
|
||||
(gen_speed == 1) ? "5.0GT/s," :
|
||||
(gen_speed == 2) ? "8.0GT/s," :
|
||||
@@ -4721,34 +4719,34 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
|
||||
case OD_SCLK:
|
||||
if (hwmgr->od_enabled) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
|
||||
size += sprintf(buf + size, "%s:\n", "OD_SCLK");
|
||||
podn_vdd_dep = &data->odn_dpm_table.vdd_dep_on_sclk;
|
||||
for (i = 0; i < podn_vdd_dep->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %10uMhz %10umV\n",
|
||||
size += sprintf(buf + size, "%d: %10uMhz %10umV\n",
|
||||
i, podn_vdd_dep->entries[i].clk / 100,
|
||||
podn_vdd_dep->entries[i].vddc);
|
||||
}
|
||||
break;
|
||||
case OD_MCLK:
|
||||
if (hwmgr->od_enabled) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
|
||||
size += sprintf(buf + size, "%s:\n", "OD_MCLK");
|
||||
podn_vdd_dep = &data->odn_dpm_table.vdd_dep_on_mclk;
|
||||
for (i = 0; i < podn_vdd_dep->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %10uMhz %10umV\n",
|
||||
size += sprintf(buf + size, "%d: %10uMhz %10umV\n",
|
||||
i, podn_vdd_dep->entries[i].clk/100,
|
||||
podn_vdd_dep->entries[i].vddc);
|
||||
}
|
||||
break;
|
||||
case OD_RANGE:
|
||||
if (hwmgr->od_enabled) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
|
||||
size += sysfs_emit_at(buf, size, "SCLK: %7uMHz %10uMHz\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_RANGE");
|
||||
size += sprintf(buf + size, "SCLK: %7uMHz %10uMHz\n",
|
||||
data->golden_dpm_table.gfx_table.dpm_levels[0].value/100,
|
||||
hwmgr->platform_descriptor.overdriveLimit.engineClock/100);
|
||||
size += sysfs_emit_at(buf, size, "MCLK: %7uMHz %10uMHz\n",
|
||||
size += sprintf(buf + size, "MCLK: %7uMHz %10uMHz\n",
|
||||
data->golden_dpm_table.mem_table.dpm_levels[0].value/100,
|
||||
hwmgr->platform_descriptor.overdriveLimit.memoryClock/100);
|
||||
size += sysfs_emit_at(buf, size, "VDDC: %7umV %11umV\n",
|
||||
size += sprintf(buf + size, "VDDC: %7umV %11umV\n",
|
||||
data->odn_dpm_table.min_vddc,
|
||||
data->odn_dpm_table.max_vddc);
|
||||
}
|
||||
|
||||
@@ -2246,8 +2246,6 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
int i, now, size = 0;
|
||||
struct pp_clock_levels_with_latency clocks;
|
||||
|
||||
phm_get_sysfs_buf(&buf, &size);
|
||||
|
||||
switch (type) {
|
||||
case PP_SCLK:
|
||||
PP_ASSERT_WITH_CODE(
|
||||
@@ -2260,7 +2258,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
"Attempt to get gfx clk levels Failed!",
|
||||
return -1);
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
|
||||
break;
|
||||
@@ -2276,7 +2274,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
"Attempt to get memory clk levels Failed!",
|
||||
return -1);
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz / 1000 == now / 100) ? "*" : "");
|
||||
break;
|
||||
@@ -2294,7 +2292,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
"Attempt to get soc clk levels Failed!",
|
||||
return -1);
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
|
||||
break;
|
||||
@@ -2312,7 +2310,7 @@ static int vega12_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
"Attempt to get dcef clk levels Failed!",
|
||||
return -1);
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz / 1000 == now) ? "*" : "");
|
||||
break;
|
||||
|
||||
@@ -3366,8 +3366,6 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
int ret = 0;
|
||||
uint32_t gen_speed, lane_width, current_gen_speed, current_lane_width;
|
||||
|
||||
phm_get_sysfs_buf(&buf, &size);
|
||||
|
||||
switch (type) {
|
||||
case PP_SCLK:
|
||||
ret = vega20_get_current_clk_freq(hwmgr, PPCLK_GFXCLK, &now);
|
||||
@@ -3376,13 +3374,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
return ret);
|
||||
|
||||
if (vega20_get_sclks(hwmgr, &clocks)) {
|
||||
size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
|
||||
size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
|
||||
now / 100);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
|
||||
break;
|
||||
@@ -3394,13 +3392,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
return ret);
|
||||
|
||||
if (vega20_get_memclocks(hwmgr, &clocks)) {
|
||||
size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
|
||||
size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
|
||||
now / 100);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
|
||||
break;
|
||||
@@ -3412,13 +3410,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
return ret);
|
||||
|
||||
if (vega20_get_socclocks(hwmgr, &clocks)) {
|
||||
size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
|
||||
size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
|
||||
now / 100);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
|
||||
break;
|
||||
@@ -3430,7 +3428,7 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
return ret);
|
||||
|
||||
for (i = 0; i < fclk_dpm_table->count; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, fclk_dpm_table->dpm_levels[i].value,
|
||||
fclk_dpm_table->dpm_levels[i].value == (now / 100) ? "*" : "");
|
||||
break;
|
||||
@@ -3442,13 +3440,13 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
return ret);
|
||||
|
||||
if (vega20_get_dcefclocks(hwmgr, &clocks)) {
|
||||
size += sysfs_emit_at(buf, size, "0: %uMhz * (DPM disabled)\n",
|
||||
size += sprintf(buf + size, "0: %uMhz * (DPM disabled)\n",
|
||||
now / 100);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < clocks.num_levels; i++)
|
||||
size += sysfs_emit_at(buf, size, "%d: %uMhz %s\n",
|
||||
size += sprintf(buf + size, "%d: %uMhz %s\n",
|
||||
i, clocks.data[i].clocks_in_khz / 1000,
|
||||
(clocks.data[i].clocks_in_khz == now * 10) ? "*" : "");
|
||||
break;
|
||||
@@ -3462,7 +3460,7 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
gen_speed = pptable->PcieGenSpeed[i];
|
||||
lane_width = pptable->PcieLaneCount[i];
|
||||
|
||||
size += sysfs_emit_at(buf, size, "%d: %s %s %dMhz %s\n", i,
|
||||
size += sprintf(buf + size, "%d: %s %s %dMhz %s\n", i,
|
||||
(gen_speed == 0) ? "2.5GT/s," :
|
||||
(gen_speed == 1) ? "5.0GT/s," :
|
||||
(gen_speed == 2) ? "8.0GT/s," :
|
||||
@@ -3483,18 +3481,18 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
case OD_SCLK:
|
||||
if (od8_settings[OD8_SETTING_GFXCLK_FMIN].feature_id &&
|
||||
od8_settings[OD8_SETTING_GFXCLK_FMAX].feature_id) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
|
||||
size += sysfs_emit_at(buf, size, "0: %10uMhz\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_SCLK");
|
||||
size += sprintf(buf + size, "0: %10uMhz\n",
|
||||
od_table->GfxclkFmin);
|
||||
size += sysfs_emit_at(buf, size, "1: %10uMhz\n",
|
||||
size += sprintf(buf + size, "1: %10uMhz\n",
|
||||
od_table->GfxclkFmax);
|
||||
}
|
||||
break;
|
||||
|
||||
case OD_MCLK:
|
||||
if (od8_settings[OD8_SETTING_UCLK_FMAX].feature_id) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
|
||||
size += sysfs_emit_at(buf, size, "1: %10uMhz\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_MCLK");
|
||||
size += sprintf(buf + size, "1: %10uMhz\n",
|
||||
od_table->UclkFmax);
|
||||
}
|
||||
|
||||
@@ -3507,14 +3505,14 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].feature_id &&
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].feature_id &&
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].feature_id) {
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_VDDC_CURVE");
|
||||
size += sysfs_emit_at(buf, size, "0: %10uMhz %10dmV\n",
|
||||
size += sprintf(buf + size, "%s:\n", "OD_VDDC_CURVE");
|
||||
size += sprintf(buf + size, "0: %10uMhz %10dmV\n",
|
||||
od_table->GfxclkFreq1,
|
||||
od_table->GfxclkVolt1 / VOLTAGE_SCALE);
|
||||
size += sysfs_emit_at(buf, size, "1: %10uMhz %10dmV\n",
|
||||
size += sprintf(buf + size, "1: %10uMhz %10dmV\n",
|
||||
od_table->GfxclkFreq2,
|
||||
od_table->GfxclkVolt2 / VOLTAGE_SCALE);
|
||||
size += sysfs_emit_at(buf, size, "2: %10uMhz %10dmV\n",
|
||||
size += sprintf(buf + size, "2: %10uMhz %10dmV\n",
|
||||
od_table->GfxclkFreq3,
|
||||
od_table->GfxclkVolt3 / VOLTAGE_SCALE);
|
||||
}
|
||||
@@ -3522,17 +3520,17 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
break;
|
||||
|
||||
case OD_RANGE:
|
||||
size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
|
||||
size += sprintf(buf + size, "%s:\n", "OD_RANGE");
|
||||
|
||||
if (od8_settings[OD8_SETTING_GFXCLK_FMIN].feature_id &&
|
||||
od8_settings[OD8_SETTING_GFXCLK_FMAX].feature_id) {
|
||||
size += sysfs_emit_at(buf, size, "SCLK: %7uMhz %10uMhz\n",
|
||||
size += sprintf(buf + size, "SCLK: %7uMhz %10uMhz\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_FMIN].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_FMAX].max_value);
|
||||
}
|
||||
|
||||
if (od8_settings[OD8_SETTING_UCLK_FMAX].feature_id) {
|
||||
size += sysfs_emit_at(buf, size, "MCLK: %7uMhz %10uMhz\n",
|
||||
size += sprintf(buf + size, "MCLK: %7uMhz %10uMhz\n",
|
||||
od8_settings[OD8_SETTING_UCLK_FMAX].min_value,
|
||||
od8_settings[OD8_SETTING_UCLK_FMAX].max_value);
|
||||
}
|
||||
@@ -3543,22 +3541,22 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr,
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].feature_id &&
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].feature_id &&
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].feature_id) {
|
||||
size += sysfs_emit_at(buf, size, "VDDC_CURVE_SCLK[0]: %7uMhz %10uMhz\n",
|
||||
size += sprintf(buf + size, "VDDC_CURVE_SCLK[0]: %7uMhz %10uMhz\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_FREQ1].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_FREQ1].max_value);
|
||||
size += sysfs_emit_at(buf, size, "VDDC_CURVE_VOLT[0]: %7dmV %11dmV\n",
|
||||
size += sprintf(buf + size, "VDDC_CURVE_VOLT[0]: %7dmV %11dmV\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE1].max_value);
|
||||
size += sysfs_emit_at(buf, size, "VDDC_CURVE_SCLK[1]: %7uMhz %10uMhz\n",
|
||||
size += sprintf(buf + size, "VDDC_CURVE_SCLK[1]: %7uMhz %10uMhz\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_FREQ2].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_FREQ2].max_value);
|
||||
size += sysfs_emit_at(buf, size, "VDDC_CURVE_VOLT[1]: %7dmV %11dmV\n",
|
||||
size += sprintf(buf + size, "VDDC_CURVE_VOLT[1]: %7dmV %11dmV\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE2].max_value);
|
||||
size += sysfs_emit_at(buf, size, "VDDC_CURVE_SCLK[2]: %7uMhz %10uMhz\n",
|
||||
size += sprintf(buf + size, "VDDC_CURVE_SCLK[2]: %7uMhz %10uMhz\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_FREQ3].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_FREQ3].max_value);
|
||||
size += sysfs_emit_at(buf, size, "VDDC_CURVE_VOLT[2]: %7dmV %11dmV\n",
|
||||
size += sprintf(buf + size, "VDDC_CURVE_VOLT[2]: %7dmV %11dmV\n",
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].min_value,
|
||||
od8_settings[OD8_SETTING_GFXCLK_VOLTAGE3].max_value);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ vga_pw_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return sprintf(buf, "%u\n", reg & 1);
|
||||
return sprintf(buf, "%u\n", reg);
|
||||
}
|
||||
static DEVICE_ATTR_RO(vga_pw);
|
||||
|
||||
|
||||
@@ -225,12 +225,29 @@ static int hyperv_vmbus_remove(struct hv_device *hdev)
|
||||
{
|
||||
struct drm_device *dev = hv_get_drvdata(hdev);
|
||||
struct hyperv_drm_device *hv = to_hv(dev);
|
||||
struct pci_dev *pdev;
|
||||
|
||||
drm_dev_unplug(dev);
|
||||
drm_atomic_helper_shutdown(dev);
|
||||
vmbus_close(hdev->channel);
|
||||
hv_set_drvdata(hdev, NULL);
|
||||
vmbus_free_mmio(hv->mem->start, hv->fb_size);
|
||||
|
||||
/*
|
||||
* Free allocated MMIO memory only on Gen2 VMs.
|
||||
* On Gen1 VMs, release the PCI device
|
||||
*/
|
||||
if (efi_enabled(EFI_BOOT)) {
|
||||
vmbus_free_mmio(hv->mem->start, hv->fb_size);
|
||||
} else {
|
||||
pdev = pci_get_device(PCI_VENDOR_ID_MICROSOFT,
|
||||
PCI_DEVICE_ID_HYPERV_VIDEO, NULL);
|
||||
if (!pdev) {
|
||||
drm_err(dev, "Unable to find PCI Hyper-V video\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
pci_release_region(pdev, 0);
|
||||
pci_dev_put(pdev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2626,6 +2626,27 @@ nv174_chipset = {
|
||||
.fifo = { 0x00000001, ga102_fifo_new },
|
||||
};
|
||||
|
||||
static const struct nvkm_device_chip
|
||||
nv176_chipset = {
|
||||
.name = "GA106",
|
||||
.bar = { 0x00000001, tu102_bar_new },
|
||||
.bios = { 0x00000001, nvkm_bios_new },
|
||||
.devinit = { 0x00000001, ga100_devinit_new },
|
||||
.fb = { 0x00000001, ga102_fb_new },
|
||||
.gpio = { 0x00000001, ga102_gpio_new },
|
||||
.i2c = { 0x00000001, gm200_i2c_new },
|
||||
.imem = { 0x00000001, nv50_instmem_new },
|
||||
.mc = { 0x00000001, ga100_mc_new },
|
||||
.mmu = { 0x00000001, tu102_mmu_new },
|
||||
.pci = { 0x00000001, gp100_pci_new },
|
||||
.privring = { 0x00000001, gm200_privring_new },
|
||||
.timer = { 0x00000001, gk20a_timer_new },
|
||||
.top = { 0x00000001, ga100_top_new },
|
||||
.disp = { 0x00000001, ga102_disp_new },
|
||||
.dma = { 0x00000001, gv100_dma_new },
|
||||
.fifo = { 0x00000001, ga102_fifo_new },
|
||||
};
|
||||
|
||||
static const struct nvkm_device_chip
|
||||
nv177_chipset = {
|
||||
.name = "GA107",
|
||||
@@ -3072,6 +3093,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
|
||||
case 0x168: device->chip = &nv168_chipset; break;
|
||||
case 0x172: device->chip = &nv172_chipset; break;
|
||||
case 0x174: device->chip = &nv174_chipset; break;
|
||||
case 0x176: device->chip = &nv176_chipset; break;
|
||||
case 0x177: device->chip = &nv177_chipset; break;
|
||||
default:
|
||||
if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
|
||||
|
||||
@@ -207,11 +207,13 @@ int
|
||||
gm200_acr_wpr_parse(struct nvkm_acr *acr)
|
||||
{
|
||||
const struct wpr_header *hdr = (void *)acr->wpr_fw->data;
|
||||
struct nvkm_acr_lsfw *lsfw;
|
||||
|
||||
while (hdr->falcon_id != WPR_HEADER_V0_FALCON_ID_INVALID) {
|
||||
wpr_header_dump(&acr->subdev, hdr);
|
||||
if (!nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id))
|
||||
return -ENOMEM;
|
||||
lsfw = nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id);
|
||||
if (IS_ERR(lsfw))
|
||||
return PTR_ERR(lsfw);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -161,11 +161,13 @@ int
|
||||
gp102_acr_wpr_parse(struct nvkm_acr *acr)
|
||||
{
|
||||
const struct wpr_header_v1 *hdr = (void *)acr->wpr_fw->data;
|
||||
struct nvkm_acr_lsfw *lsfw;
|
||||
|
||||
while (hdr->falcon_id != WPR_HEADER_V1_FALCON_ID_INVALID) {
|
||||
wpr_header_v1_dump(&acr->subdev, hdr);
|
||||
if (!nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id))
|
||||
return -ENOMEM;
|
||||
lsfw = nvkm_acr_lsfw_add(NULL, acr, NULL, (hdr++)->falcon_id);
|
||||
if (IS_ERR(lsfw))
|
||||
return PTR_ERR(lsfw);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -391,7 +391,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size)
|
||||
|
||||
bo = kzalloc(sizeof(*bo), GFP_KERNEL);
|
||||
if (!bo)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
return NULL;
|
||||
|
||||
bo->madv = VC4_MADV_WILLNEED;
|
||||
refcount_set(&bo->usecnt, 0);
|
||||
|
||||
@@ -160,6 +160,7 @@ static int hidinput_setkeycode(struct input_dev *dev,
|
||||
if (usage) {
|
||||
*old_keycode = usage->type == EV_KEY ?
|
||||
usage->code : KEY_RESERVED;
|
||||
usage->type = EV_KEY;
|
||||
usage->code = ke->keycode;
|
||||
|
||||
clear_bit(*old_keycode, dev->keybit);
|
||||
@@ -650,10 +651,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||
code += KEY_MACRO1;
|
||||
else
|
||||
code += BTN_TRIGGER_HAPPY - 0x1e;
|
||||
} else {
|
||||
goto ignore;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
fallthrough;
|
||||
default:
|
||||
switch (field->physical) {
|
||||
case HID_GD_MOUSE:
|
||||
|
||||
@@ -256,8 +256,11 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
|
||||
unsigned long now = jiffies;
|
||||
int step_x = msc->touches[id].scroll_x - x;
|
||||
int step_y = msc->touches[id].scroll_y - y;
|
||||
int step_hr = ((64 - (int)scroll_speed) * msc->scroll_accel) /
|
||||
SCROLL_HR_STEPS;
|
||||
int step_hr =
|
||||
max_t(int,
|
||||
((64 - (int)scroll_speed) * msc->scroll_accel) /
|
||||
SCROLL_HR_STEPS,
|
||||
1);
|
||||
int step_x_hr = msc->touches[id].scroll_x_hr - x;
|
||||
int step_y_hr = msc->touches[id].scroll_y_hr - y;
|
||||
|
||||
|
||||
@@ -2603,6 +2603,9 @@ static void wacom_wac_finger_event(struct hid_device *hdev,
|
||||
return;
|
||||
|
||||
switch (equivalent_usage) {
|
||||
case HID_DG_CONFIDENCE:
|
||||
wacom_wac->hid_data.confidence = value;
|
||||
break;
|
||||
case HID_GD_X:
|
||||
wacom_wac->hid_data.x = value;
|
||||
break;
|
||||
@@ -2635,7 +2638,8 @@ static void wacom_wac_finger_event(struct hid_device *hdev,
|
||||
}
|
||||
|
||||
if (usage->usage_index + 1 == field->report_count) {
|
||||
if (equivalent_usage == wacom_wac->hid_data.last_slot_field)
|
||||
if (equivalent_usage == wacom_wac->hid_data.last_slot_field &&
|
||||
wacom_wac->hid_data.confidence)
|
||||
wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input);
|
||||
}
|
||||
}
|
||||
@@ -2653,6 +2657,8 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev,
|
||||
|
||||
wacom_wac->is_invalid_bt_frame = false;
|
||||
|
||||
hid_data->confidence = true;
|
||||
|
||||
for (i = 0; i < report->maxfield; i++) {
|
||||
struct hid_field *field = report->field[i];
|
||||
int j;
|
||||
|
||||
@@ -301,6 +301,7 @@ struct hid_data {
|
||||
bool barrelswitch;
|
||||
bool barrelswitch2;
|
||||
bool serialhi;
|
||||
bool confidence;
|
||||
int x;
|
||||
int y;
|
||||
int pressure;
|
||||
|
||||
@@ -106,11 +106,10 @@ static int virtio_i2c_prepare_reqs(struct virtqueue *vq,
|
||||
|
||||
static int virtio_i2c_complete_reqs(struct virtqueue *vq,
|
||||
struct virtio_i2c_req *reqs,
|
||||
struct i2c_msg *msgs, int num,
|
||||
bool timedout)
|
||||
struct i2c_msg *msgs, int num)
|
||||
{
|
||||
struct virtio_i2c_req *req;
|
||||
bool failed = timedout;
|
||||
bool failed = false;
|
||||
unsigned int len;
|
||||
int i, j = 0;
|
||||
|
||||
@@ -132,7 +131,7 @@ static int virtio_i2c_complete_reqs(struct virtqueue *vq,
|
||||
j++;
|
||||
}
|
||||
|
||||
return timedout ? -ETIMEDOUT : j;
|
||||
return j;
|
||||
}
|
||||
|
||||
static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
||||
@@ -141,7 +140,6 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
||||
struct virtio_i2c *vi = i2c_get_adapdata(adap);
|
||||
struct virtqueue *vq = vi->vq;
|
||||
struct virtio_i2c_req *reqs;
|
||||
unsigned long time_left;
|
||||
int count;
|
||||
|
||||
reqs = kcalloc(num, sizeof(*reqs), GFP_KERNEL);
|
||||
@@ -164,11 +162,9 @@ static int virtio_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
||||
reinit_completion(&vi->completion);
|
||||
virtqueue_kick(vq);
|
||||
|
||||
time_left = wait_for_completion_timeout(&vi->completion, adap->timeout);
|
||||
if (!time_left)
|
||||
dev_err(&adap->dev, "virtio i2c backend timeout.\n");
|
||||
wait_for_completion(&vi->completion);
|
||||
|
||||
count = virtio_i2c_complete_reqs(vq, reqs, msgs, count, !time_left);
|
||||
count = virtio_i2c_complete_reqs(vq, reqs, msgs, count);
|
||||
|
||||
err_free:
|
||||
kfree(reqs);
|
||||
|
||||
@@ -928,10 +928,8 @@ static int __init amd_iommu_v2_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pr_info("AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>\n");
|
||||
|
||||
if (!amd_iommu_v2_supported()) {
|
||||
pr_info("AMD IOMMUv2 functionality not available on this system\n");
|
||||
pr_info("AMD IOMMUv2 functionality not available on this system - This is not a bug.\n");
|
||||
/*
|
||||
* Load anyway to provide the symbols to other modules
|
||||
* which may use AMD IOMMUv2 optionally.
|
||||
@@ -946,6 +944,8 @@ static int __init amd_iommu_v2_init(void)
|
||||
|
||||
amd_iommu_register_ppr_notifier(&ppr_nb);
|
||||
|
||||
pr_info("AMD IOMMUv2 loaded and initialized\n");
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
|
||||
@@ -1226,13 +1226,11 @@ static struct page *dma_pte_clear_level(struct dmar_domain *domain, int level,
|
||||
pte = &pte[pfn_level_offset(pfn, level)];
|
||||
|
||||
do {
|
||||
unsigned long level_pfn;
|
||||
unsigned long level_pfn = pfn & level_mask(level);
|
||||
|
||||
if (!dma_pte_present(pte))
|
||||
goto next;
|
||||
|
||||
level_pfn = pfn & level_mask(level);
|
||||
|
||||
/* If range covers entire pagetable, free it */
|
||||
if (start_pfn <= level_pfn &&
|
||||
last_pfn >= level_pfn + level_size(level) - 1) {
|
||||
@@ -1253,7 +1251,7 @@ static struct page *dma_pte_clear_level(struct dmar_domain *domain, int level,
|
||||
freelist);
|
||||
}
|
||||
next:
|
||||
pfn += level_size(level);
|
||||
pfn = level_pfn + level_size(level);
|
||||
} while (!first_pte_in_page(++pte) && pfn <= last_pfn);
|
||||
|
||||
if (first_pte)
|
||||
|
||||
@@ -200,8 +200,8 @@ static inline phys_addr_t rk_dte_pt_address(u32 dte)
|
||||
#define DTE_HI_MASK2 GENMASK(7, 4)
|
||||
#define DTE_HI_SHIFT1 24 /* shift bit 8 to bit 32 */
|
||||
#define DTE_HI_SHIFT2 32 /* shift bit 4 to bit 36 */
|
||||
#define PAGE_DESC_HI_MASK1 GENMASK_ULL(39, 36)
|
||||
#define PAGE_DESC_HI_MASK2 GENMASK_ULL(35, 32)
|
||||
#define PAGE_DESC_HI_MASK1 GENMASK_ULL(35, 32)
|
||||
#define PAGE_DESC_HI_MASK2 GENMASK_ULL(39, 36)
|
||||
|
||||
static inline phys_addr_t rk_dte_pt_address_v2(u32 dte)
|
||||
{
|
||||
|
||||
@@ -1199,6 +1199,7 @@ void cec_received_msg_ts(struct cec_adapter *adap,
|
||||
if (abort)
|
||||
dst->rx_status |= CEC_RX_STATUS_FEATURE_ABORT;
|
||||
msg->flags = dst->flags;
|
||||
msg->sequence = dst->sequence;
|
||||
/* Remove it from the wait_queue */
|
||||
list_del_init(&data->list);
|
||||
|
||||
|
||||
@@ -744,10 +744,6 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *p64,
|
||||
/*
|
||||
* x86 is the only compat architecture with different struct alignment
|
||||
* between 32-bit and 64-bit tasks.
|
||||
*
|
||||
* On all other architectures, v4l2_event32 and v4l2_event32_time32 are
|
||||
* the same as v4l2_event and v4l2_event_time32, so we can use the native
|
||||
* handlers, converting v4l2_event to v4l2_event_time32 if necessary.
|
||||
*/
|
||||
struct v4l2_event32 {
|
||||
__u32 type;
|
||||
@@ -765,21 +761,6 @@ struct v4l2_event32 {
|
||||
__u32 reserved[8];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_COMPAT_32BIT_TIME
|
||||
struct v4l2_event32_time32 {
|
||||
__u32 type;
|
||||
union {
|
||||
compat_s64 value64;
|
||||
__u8 data[64];
|
||||
} u;
|
||||
__u32 pending;
|
||||
__u32 sequence;
|
||||
struct old_timespec32 timestamp;
|
||||
__u32 id;
|
||||
__u32 reserved[8];
|
||||
};
|
||||
#endif
|
||||
|
||||
static int put_v4l2_event32(struct v4l2_event *p64,
|
||||
struct v4l2_event32 __user *p32)
|
||||
{
|
||||
@@ -795,7 +776,22 @@ static int put_v4l2_event32(struct v4l2_event *p64,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_COMPAT_32BIT_TIME
|
||||
struct v4l2_event32_time32 {
|
||||
__u32 type;
|
||||
union {
|
||||
compat_s64 value64;
|
||||
__u8 data[64];
|
||||
} u;
|
||||
__u32 pending;
|
||||
__u32 sequence;
|
||||
struct old_timespec32 timestamp;
|
||||
__u32 id;
|
||||
__u32 reserved[8];
|
||||
};
|
||||
|
||||
static int put_v4l2_event32_time32(struct v4l2_event *p64,
|
||||
struct v4l2_event32_time32 __user *p32)
|
||||
{
|
||||
@@ -811,7 +807,6 @@ static int put_v4l2_event32_time32(struct v4l2_event *p64,
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct v4l2_edid32 {
|
||||
__u32 pad;
|
||||
@@ -873,9 +868,7 @@ static int put_v4l2_edid32(struct v4l2_edid *p64,
|
||||
#define VIDIOC_QUERYBUF32_TIME32 _IOWR('V', 9, struct v4l2_buffer32_time32)
|
||||
#define VIDIOC_QBUF32_TIME32 _IOWR('V', 15, struct v4l2_buffer32_time32)
|
||||
#define VIDIOC_DQBUF32_TIME32 _IOWR('V', 17, struct v4l2_buffer32_time32)
|
||||
#ifdef CONFIG_X86_64
|
||||
#define VIDIOC_DQEVENT32_TIME32 _IOR ('V', 89, struct v4l2_event32_time32)
|
||||
#endif
|
||||
#define VIDIOC_PREPARE_BUF32_TIME32 _IOWR('V', 93, struct v4l2_buffer32_time32)
|
||||
#endif
|
||||
|
||||
@@ -929,10 +922,10 @@ unsigned int v4l2_compat_translate_cmd(unsigned int cmd)
|
||||
#ifdef CONFIG_X86_64
|
||||
case VIDIOC_DQEVENT32:
|
||||
return VIDIOC_DQEVENT;
|
||||
#endif
|
||||
#ifdef CONFIG_COMPAT_32BIT_TIME
|
||||
case VIDIOC_DQEVENT32_TIME32:
|
||||
return VIDIOC_DQEVENT;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return cmd;
|
||||
@@ -1025,10 +1018,10 @@ int v4l2_compat_put_user(void __user *arg, void *parg, unsigned int cmd)
|
||||
#ifdef CONFIG_X86_64
|
||||
case VIDIOC_DQEVENT32:
|
||||
return put_v4l2_event32(parg, arg);
|
||||
#endif
|
||||
#ifdef CONFIG_COMPAT_32BIT_TIME
|
||||
case VIDIOC_DQEVENT32_TIME32:
|
||||
return put_v4l2_event32_time32(parg, arg);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -300,7 +300,6 @@ static struct esdhc_soc_data usdhc_imx8qxp_data = {
|
||||
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
|
||||
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
|
||||
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
|
||||
| ESDHC_FLAG_CQHCI
|
||||
| ESDHC_FLAG_STATE_LOST_IN_LPMODE
|
||||
| ESDHC_FLAG_CLK_RATE_LOST_IN_PM_RUNTIME,
|
||||
};
|
||||
@@ -309,7 +308,6 @@ static struct esdhc_soc_data usdhc_imx8mm_data = {
|
||||
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
|
||||
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
|
||||
| ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
|
||||
| ESDHC_FLAG_CQHCI
|
||||
| ESDHC_FLAG_STATE_LOST_IN_LPMODE,
|
||||
};
|
||||
|
||||
|
||||
@@ -771,7 +771,19 @@ static void sdhci_adma_table_pre(struct sdhci_host *host,
|
||||
len -= offset;
|
||||
}
|
||||
|
||||
BUG_ON(len > 65536);
|
||||
/*
|
||||
* The block layer forces a minimum segment size of PAGE_SIZE,
|
||||
* so 'len' can be too big here if PAGE_SIZE >= 64KiB. Write
|
||||
* multiple descriptors, noting that the ADMA table is sized
|
||||
* for 4KiB chunks anyway, so it will be big enough.
|
||||
*/
|
||||
while (len > host->max_adma) {
|
||||
int n = 32 * 1024; /* 32KiB*/
|
||||
|
||||
__sdhci_adma_write_desc(host, &desc, addr, n, ADMA2_TRAN_VALID);
|
||||
addr += n;
|
||||
len -= n;
|
||||
}
|
||||
|
||||
/* tran, valid */
|
||||
if (len)
|
||||
@@ -3952,6 +3964,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
|
||||
* descriptor for each segment, plus 1 for a nop end descriptor.
|
||||
*/
|
||||
host->adma_table_cnt = SDHCI_MAX_SEGS * 2 + 1;
|
||||
host->max_adma = 65536;
|
||||
|
||||
host->max_timeout_count = 0xE;
|
||||
|
||||
@@ -4617,10 +4630,12 @@ int sdhci_setup_host(struct sdhci_host *host)
|
||||
* be larger than 64 KiB though.
|
||||
*/
|
||||
if (host->flags & SDHCI_USE_ADMA) {
|
||||
if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC)
|
||||
if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) {
|
||||
host->max_adma = 65532; /* 32-bit alignment */
|
||||
mmc->max_seg_size = 65535;
|
||||
else
|
||||
} else {
|
||||
mmc->max_seg_size = 65536;
|
||||
}
|
||||
} else {
|
||||
mmc->max_seg_size = mmc->max_req_size;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,8 @@ struct sdhci_adma2_64_desc {
|
||||
|
||||
/*
|
||||
* Maximum segments assuming a 512KiB maximum requisition size and a minimum
|
||||
* 4KiB page size.
|
||||
* 4KiB page size. Note this also allows enough for multiple descriptors in
|
||||
* case of PAGE_SIZE >= 64KiB.
|
||||
*/
|
||||
#define SDHCI_MAX_SEGS 128
|
||||
|
||||
@@ -543,6 +544,7 @@ struct sdhci_host {
|
||||
unsigned int blocks; /* remaining PIO blocks */
|
||||
|
||||
int sg_count; /* Mapped sg entries */
|
||||
int max_adma; /* Max. length in ADMA descriptor */
|
||||
|
||||
void *adma_table; /* ADMA descriptor table */
|
||||
void *align_buffer; /* Bounce buffer */
|
||||
|
||||
@@ -985,6 +985,7 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
|
||||
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
|
||||
const struct hnae3_ae_ops *ops = h->ae_algo->ops;
|
||||
const struct hns3_reset_type_map *rst_type_map;
|
||||
enum ethtool_reset_flags rst_flags;
|
||||
u32 i, size;
|
||||
|
||||
if (ops->ae_dev_resetting && ops->ae_dev_resetting(h))
|
||||
@@ -1004,6 +1005,7 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
|
||||
for (i = 0; i < size; i++) {
|
||||
if (rst_type_map[i].rst_flags == *flags) {
|
||||
rst_type = rst_type_map[i].rst_type;
|
||||
rst_flags = rst_type_map[i].rst_flags;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1019,6 +1021,8 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
|
||||
|
||||
ops->reset_event(h->pdev, h);
|
||||
|
||||
*flags &= ~rst_flags;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -703,9 +703,9 @@ static int hclgevf_set_rss_tc_mode(struct hclgevf_dev *hdev, u16 rss_size)
|
||||
roundup_size = ilog2(roundup_size);
|
||||
|
||||
for (i = 0; i < HCLGEVF_MAX_TC_NUM; i++) {
|
||||
tc_valid[i] = !!(hdev->hw_tc_map & BIT(i));
|
||||
tc_valid[i] = 1;
|
||||
tc_size[i] = roundup_size;
|
||||
tc_offset[i] = rss_size * i;
|
||||
tc_offset[i] = (hdev->hw_tc_map & BIT(i)) ? rss_size * i : 0;
|
||||
}
|
||||
|
||||
hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_RSS_TC_MODE, false);
|
||||
|
||||
@@ -305,6 +305,7 @@ struct iavf_adapter {
|
||||
#define IAVF_FLAG_AQ_DEL_FDIR_FILTER BIT(26)
|
||||
#define IAVF_FLAG_AQ_ADD_ADV_RSS_CFG BIT(27)
|
||||
#define IAVF_FLAG_AQ_DEL_ADV_RSS_CFG BIT(28)
|
||||
#define IAVF_FLAG_AQ_REQUEST_STATS BIT(29)
|
||||
|
||||
/* OS defined structs */
|
||||
struct net_device *netdev;
|
||||
@@ -398,6 +399,7 @@ int iavf_up(struct iavf_adapter *adapter);
|
||||
void iavf_down(struct iavf_adapter *adapter);
|
||||
int iavf_process_config(struct iavf_adapter *adapter);
|
||||
void iavf_schedule_reset(struct iavf_adapter *adapter);
|
||||
void iavf_schedule_request_stats(struct iavf_adapter *adapter);
|
||||
void iavf_reset(struct iavf_adapter *adapter);
|
||||
void iavf_set_ethtool_ops(struct net_device *netdev);
|
||||
void iavf_update_stats(struct iavf_adapter *adapter);
|
||||
@@ -455,4 +457,5 @@ void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
|
||||
void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
|
||||
struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
|
||||
const u8 *macaddr);
|
||||
int iavf_lock_timeout(struct mutex *lock, unsigned int msecs);
|
||||
#endif /* _IAVF_H_ */
|
||||
|
||||
@@ -354,6 +354,9 @@ static void iavf_get_ethtool_stats(struct net_device *netdev,
|
||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||
unsigned int i;
|
||||
|
||||
/* Explicitly request stats refresh */
|
||||
iavf_schedule_request_stats(adapter);
|
||||
|
||||
iavf_add_ethtool_stats(&data, adapter, iavf_gstrings_stats);
|
||||
|
||||
rcu_read_lock();
|
||||
@@ -723,12 +726,31 @@ static int iavf_get_per_queue_coalesce(struct net_device *netdev, u32 queue,
|
||||
*
|
||||
* Change the ITR settings for a specific queue.
|
||||
**/
|
||||
static void iavf_set_itr_per_queue(struct iavf_adapter *adapter,
|
||||
struct ethtool_coalesce *ec, int queue)
|
||||
static int iavf_set_itr_per_queue(struct iavf_adapter *adapter,
|
||||
struct ethtool_coalesce *ec, int queue)
|
||||
{
|
||||
struct iavf_ring *rx_ring = &adapter->rx_rings[queue];
|
||||
struct iavf_ring *tx_ring = &adapter->tx_rings[queue];
|
||||
struct iavf_q_vector *q_vector;
|
||||
u16 itr_setting;
|
||||
|
||||
itr_setting = rx_ring->itr_setting & ~IAVF_ITR_DYNAMIC;
|
||||
|
||||
if (ec->rx_coalesce_usecs != itr_setting &&
|
||||
ec->use_adaptive_rx_coalesce) {
|
||||
netif_info(adapter, drv, adapter->netdev,
|
||||
"Rx interrupt throttling cannot be changed if adaptive-rx is enabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
itr_setting = tx_ring->itr_setting & ~IAVF_ITR_DYNAMIC;
|
||||
|
||||
if (ec->tx_coalesce_usecs != itr_setting &&
|
||||
ec->use_adaptive_tx_coalesce) {
|
||||
netif_info(adapter, drv, adapter->netdev,
|
||||
"Tx interrupt throttling cannot be changed if adaptive-tx is enabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rx_ring->itr_setting = ITR_REG_ALIGN(ec->rx_coalesce_usecs);
|
||||
tx_ring->itr_setting = ITR_REG_ALIGN(ec->tx_coalesce_usecs);
|
||||
@@ -751,6 +773,7 @@ static void iavf_set_itr_per_queue(struct iavf_adapter *adapter,
|
||||
* the Tx and Rx ITR values based on the values we have entered
|
||||
* into the q_vector, no need to write the values now.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -792,9 +815,11 @@ static int __iavf_set_coalesce(struct net_device *netdev,
|
||||
*/
|
||||
if (queue < 0) {
|
||||
for (i = 0; i < adapter->num_active_queues; i++)
|
||||
iavf_set_itr_per_queue(adapter, ec, i);
|
||||
if (iavf_set_itr_per_queue(adapter, ec, i))
|
||||
return -EINVAL;
|
||||
} else if (queue < adapter->num_active_queues) {
|
||||
iavf_set_itr_per_queue(adapter, ec, queue);
|
||||
if (iavf_set_itr_per_queue(adapter, ec, queue))
|
||||
return -EINVAL;
|
||||
} else {
|
||||
netif_info(adapter, drv, netdev, "Invalid queue value, queue range is 0 - %d\n",
|
||||
adapter->num_active_queues - 1);
|
||||
|
||||
@@ -138,7 +138,7 @@ enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw,
|
||||
*
|
||||
* Returns 0 on success, negative on failure
|
||||
**/
|
||||
static int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
|
||||
int iavf_lock_timeout(struct mutex *lock, unsigned int msecs)
|
||||
{
|
||||
unsigned int wait, delay = 10;
|
||||
|
||||
@@ -165,6 +165,19 @@ void iavf_schedule_reset(struct iavf_adapter *adapter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* iavf_schedule_request_stats - Set the flags and schedule statistics request
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* Sets IAVF_FLAG_AQ_REQUEST_STATS flag so iavf_watchdog_task() will explicitly
|
||||
* request and refresh ethtool stats
|
||||
**/
|
||||
void iavf_schedule_request_stats(struct iavf_adapter *adapter)
|
||||
{
|
||||
adapter->aq_required |= IAVF_FLAG_AQ_REQUEST_STATS;
|
||||
mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* iavf_tx_timeout - Respond to a Tx Hang
|
||||
* @netdev: network interface device structure
|
||||
@@ -695,13 +708,11 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, u16 vlan)
|
||||
**/
|
||||
static void iavf_restore_filters(struct iavf_adapter *adapter)
|
||||
{
|
||||
/* re-add all VLAN filters */
|
||||
if (VLAN_ALLOWED(adapter)) {
|
||||
u16 vid;
|
||||
u16 vid;
|
||||
|
||||
for_each_set_bit(vid, adapter->vsi.active_vlans, VLAN_N_VID)
|
||||
iavf_add_vlan(adapter, vid);
|
||||
}
|
||||
/* re-add all VLAN filters */
|
||||
for_each_set_bit(vid, adapter->vsi.active_vlans, VLAN_N_VID)
|
||||
iavf_add_vlan(adapter, vid);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -736,9 +747,6 @@ static int iavf_vlan_rx_kill_vid(struct net_device *netdev,
|
||||
{
|
||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
if (!VLAN_ALLOWED(adapter))
|
||||
return -EIO;
|
||||
|
||||
iavf_del_vlan(adapter, vid);
|
||||
clear_bit(vid, adapter->vsi.active_vlans);
|
||||
|
||||
@@ -1700,6 +1708,11 @@ static int iavf_process_aq_command(struct iavf_adapter *adapter)
|
||||
iavf_del_adv_rss_cfg(adapter);
|
||||
return 0;
|
||||
}
|
||||
if (adapter->aq_required & IAVF_FLAG_AQ_REQUEST_STATS) {
|
||||
iavf_request_stats(adapter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
@@ -2124,7 +2137,6 @@ static void iavf_reset_task(struct work_struct *work)
|
||||
struct net_device *netdev = adapter->netdev;
|
||||
struct iavf_hw *hw = &adapter->hw;
|
||||
struct iavf_mac_filter *f, *ftmp;
|
||||
struct iavf_vlan_filter *vlf;
|
||||
struct iavf_cloud_filter *cf;
|
||||
u32 reg_val;
|
||||
int i = 0, err;
|
||||
@@ -2264,11 +2276,6 @@ continue_reset:
|
||||
list_for_each_entry(f, &adapter->mac_filter_list, list) {
|
||||
f->add = true;
|
||||
}
|
||||
/* re-add all VLAN filters */
|
||||
list_for_each_entry(vlf, &adapter->vlan_filter_list, list) {
|
||||
vlf->add = true;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
||||
|
||||
/* check if TCs are running and re-add all cloud filters */
|
||||
@@ -2282,7 +2289,6 @@ continue_reset:
|
||||
spin_unlock_bh(&adapter->cloud_filter_list_lock);
|
||||
|
||||
adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
|
||||
adapter->aq_required |= IAVF_FLAG_AQ_ADD_VLAN_FILTER;
|
||||
adapter->aq_required |= IAVF_FLAG_AQ_ADD_CLOUD_FILTER;
|
||||
iavf_misc_irq_enable(adapter);
|
||||
|
||||
@@ -3380,11 +3386,16 @@ static int iavf_set_features(struct net_device *netdev,
|
||||
{
|
||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
/* Don't allow changing VLAN_RX flag when adapter is not capable
|
||||
* of VLAN offload
|
||||
/* Don't allow enabling VLAN features when adapter is not capable
|
||||
* of VLAN offload/filtering
|
||||
*/
|
||||
if (!VLAN_ALLOWED(adapter)) {
|
||||
if ((netdev->features ^ features) & NETIF_F_HW_VLAN_CTAG_RX)
|
||||
netdev->hw_features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
|
||||
NETIF_F_HW_VLAN_CTAG_TX |
|
||||
NETIF_F_HW_VLAN_CTAG_FILTER);
|
||||
if (features & (NETIF_F_HW_VLAN_CTAG_RX |
|
||||
NETIF_F_HW_VLAN_CTAG_TX |
|
||||
NETIF_F_HW_VLAN_CTAG_FILTER))
|
||||
return -EINVAL;
|
||||
} else if ((netdev->features ^ features) & NETIF_F_HW_VLAN_CTAG_RX) {
|
||||
if (features & NETIF_F_HW_VLAN_CTAG_RX)
|
||||
|
||||
@@ -607,7 +607,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter)
|
||||
if (f->add)
|
||||
count++;
|
||||
}
|
||||
if (!count) {
|
||||
if (!count || !VLAN_ALLOWED(adapter)) {
|
||||
adapter->aq_required &= ~IAVF_FLAG_AQ_ADD_VLAN_FILTER;
|
||||
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
||||
return;
|
||||
@@ -673,9 +673,19 @@ void iavf_del_vlans(struct iavf_adapter *adapter)
|
||||
|
||||
spin_lock_bh(&adapter->mac_vlan_list_lock);
|
||||
|
||||
list_for_each_entry(f, &adapter->vlan_filter_list, list) {
|
||||
if (f->remove)
|
||||
list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) {
|
||||
/* since VLAN capabilities are not allowed, we dont want to send
|
||||
* a VLAN delete request because it will most likely fail and
|
||||
* create unnecessary errors/noise, so just free the VLAN
|
||||
* filters marked for removal to enable bailing out before
|
||||
* sending a virtchnl message
|
||||
*/
|
||||
if (f->remove && !VLAN_ALLOWED(adapter)) {
|
||||
list_del(&f->list);
|
||||
kfree(f);
|
||||
} else if (f->remove) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (!count) {
|
||||
adapter->aq_required &= ~IAVF_FLAG_AQ_DEL_VLAN_FILTER;
|
||||
@@ -784,6 +794,8 @@ void iavf_request_stats(struct iavf_adapter *adapter)
|
||||
/* no error message, this isn't crucial */
|
||||
return;
|
||||
}
|
||||
|
||||
adapter->aq_required &= ~IAVF_FLAG_AQ_REQUEST_STATS;
|
||||
adapter->current_op = VIRTCHNL_OP_GET_STATS;
|
||||
vqs.vsi_id = adapter->vsi_res->vsi_id;
|
||||
/* queue maps are ignored for this message - only the vsi is used */
|
||||
@@ -1722,8 +1734,37 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
|
||||
}
|
||||
spin_lock_bh(&adapter->mac_vlan_list_lock);
|
||||
iavf_add_filter(adapter, adapter->hw.mac.addr);
|
||||
|
||||
if (VLAN_ALLOWED(adapter)) {
|
||||
if (!list_empty(&adapter->vlan_filter_list)) {
|
||||
struct iavf_vlan_filter *vlf;
|
||||
|
||||
/* re-add all VLAN filters over virtchnl */
|
||||
list_for_each_entry(vlf,
|
||||
&adapter->vlan_filter_list,
|
||||
list)
|
||||
vlf->add = true;
|
||||
|
||||
adapter->aq_required |=
|
||||
IAVF_FLAG_AQ_ADD_VLAN_FILTER;
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&adapter->mac_vlan_list_lock);
|
||||
iavf_process_config(adapter);
|
||||
|
||||
/* unlock crit_lock before acquiring rtnl_lock as other
|
||||
* processes holding rtnl_lock could be waiting for the same
|
||||
* crit_lock
|
||||
*/
|
||||
mutex_unlock(&adapter->crit_lock);
|
||||
rtnl_lock();
|
||||
netdev_update_features(adapter->netdev);
|
||||
rtnl_unlock();
|
||||
if (iavf_lock_timeout(&adapter->crit_lock, 10000))
|
||||
dev_warn(&adapter->pdev->dev, "failed to acquire crit_lock in %s\n",
|
||||
__FUNCTION__);
|
||||
|
||||
}
|
||||
break;
|
||||
case VIRTCHNL_OP_ENABLE_QUEUES:
|
||||
|
||||
@@ -83,8 +83,13 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)
|
||||
if (!vsi->rx_rings)
|
||||
goto err_rings;
|
||||
|
||||
/* XDP will have vsi->alloc_txq Tx queues as well, so double the size */
|
||||
vsi->txq_map = devm_kcalloc(dev, (2 * vsi->alloc_txq),
|
||||
/* txq_map needs to have enough space to track both Tx (stack) rings
|
||||
* and XDP rings; at this point vsi->num_xdp_txq might not be set,
|
||||
* so use num_possible_cpus() as we want to always provide XDP ring
|
||||
* per CPU, regardless of queue count settings from user that might
|
||||
* have come from ethtool's set_channels() callback;
|
||||
*/
|
||||
vsi->txq_map = devm_kcalloc(dev, (vsi->alloc_txq + num_possible_cpus()),
|
||||
sizeof(*vsi->txq_map), GFP_KERNEL);
|
||||
|
||||
if (!vsi->txq_map)
|
||||
|
||||
@@ -2497,7 +2497,18 @@ int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog)
|
||||
ice_stat_str(status));
|
||||
goto clear_xdp_rings;
|
||||
}
|
||||
ice_vsi_assign_bpf_prog(vsi, prog);
|
||||
|
||||
/* assign the prog only when it's not already present on VSI;
|
||||
* this flow is a subject of both ethtool -L and ndo_bpf flows;
|
||||
* VSI rebuild that happens under ethtool -L can expose us to
|
||||
* the bpf_prog refcount issues as we would be swapping same
|
||||
* bpf_prog pointers from vsi->xdp_prog and calling bpf_prog_put
|
||||
* on it as it would be treated as an 'old_prog'; for ndo_bpf
|
||||
* this is not harmful as dev_xdp_install bumps the refcount
|
||||
* before calling the op exposed by the driver;
|
||||
*/
|
||||
if (!ice_is_xdp_ena_vsi(vsi))
|
||||
ice_vsi_assign_bpf_prog(vsi, prog);
|
||||
|
||||
return 0;
|
||||
clear_xdp_rings:
|
||||
@@ -2643,6 +2654,11 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
|
||||
if (xdp_ring_err)
|
||||
NL_SET_ERR_MSG_MOD(extack, "Freeing XDP Tx resources failed");
|
||||
} else {
|
||||
/* safe to call even when prog == vsi->xdp_prog as
|
||||
* dev_xdp_install in net/core/dev.c incremented prog's
|
||||
* refcount so corresponding bpf_prog_put won't cause
|
||||
* underflow
|
||||
*/
|
||||
ice_vsi_assign_bpf_prog(vsi, prog);
|
||||
}
|
||||
|
||||
|
||||
@@ -8019,7 +8019,7 @@ static int igb_poll(struct napi_struct *napi, int budget)
|
||||
if (likely(napi_complete_done(napi, work_done)))
|
||||
igb_ring_irq_enable(q_vector);
|
||||
|
||||
return min(work_done, budget - 1);
|
||||
return work_done;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5017,11 +5017,13 @@ static int mvpp2_change_mtu(struct net_device *dev, int mtu)
|
||||
mtu = ALIGN(MVPP2_RX_PKT_SIZE(mtu), 8);
|
||||
}
|
||||
|
||||
if (port->xdp_prog && mtu > MVPP2_MAX_RX_BUF_SIZE) {
|
||||
netdev_err(dev, "Illegal MTU value %d (> %d) for XDP mode\n",
|
||||
mtu, (int)MVPP2_MAX_RX_BUF_SIZE);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (MVPP2_RX_PKT_SIZE(mtu) > MVPP2_BM_LONG_PKT_SIZE) {
|
||||
if (port->xdp_prog) {
|
||||
netdev_err(dev, "Jumbo frames are not supported with XDP\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (priv->percpu_pools) {
|
||||
netdev_warn(dev, "mtu %d too high, switching to shared buffers", mtu);
|
||||
mvpp2_bm_switch_buffers(priv, false);
|
||||
@@ -5307,8 +5309,8 @@ static int mvpp2_xdp_setup(struct mvpp2_port *port, struct netdev_bpf *bpf)
|
||||
bool running = netif_running(port->dev);
|
||||
bool reset = !prog != !port->xdp_prog;
|
||||
|
||||
if (port->dev->mtu > ETH_DATA_LEN) {
|
||||
NL_SET_ERR_MSG_MOD(bpf->extack, "XDP is not supported with jumbo frames enabled");
|
||||
if (port->dev->mtu > MVPP2_MAX_RX_BUF_SIZE) {
|
||||
NL_SET_ERR_MSG_MOD(bpf->extack, "MTU too large for XDP");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
|
||||
@@ -497,8 +497,8 @@ int prestera_bridge_port_join(struct net_device *br_dev,
|
||||
|
||||
br_port = prestera_bridge_port_add(bridge, port->dev);
|
||||
if (IS_ERR(br_port)) {
|
||||
err = PTR_ERR(br_port);
|
||||
goto err_brport_create;
|
||||
prestera_bridge_put(bridge);
|
||||
return PTR_ERR(br_port);
|
||||
}
|
||||
|
||||
err = switchdev_bridge_port_offload(br_port->dev, port->dev, NULL,
|
||||
@@ -519,8 +519,6 @@ err_port_join:
|
||||
switchdev_bridge_port_unoffload(br_port->dev, NULL, NULL, NULL);
|
||||
err_switchdev_offload:
|
||||
prestera_bridge_port_put(br_port);
|
||||
err_brport_create:
|
||||
prestera_bridge_put(bridge);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1124,7 +1122,7 @@ static int prestera_switchdev_blk_event(struct notifier_block *unused,
|
||||
prestera_port_obj_attr_set);
|
||||
break;
|
||||
default:
|
||||
err = -EOPNOTSUPP;
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
return notifier_from_errno(err);
|
||||
|
||||
@@ -2131,7 +2131,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
|
||||
max_ports = mlxsw_core_max_ports(mlxsw_sp->core);
|
||||
local_port = mlxsw_reg_pude_local_port_get(pude_pl);
|
||||
|
||||
if (WARN_ON_ONCE(local_port >= max_ports))
|
||||
if (WARN_ON_ONCE(!local_port || local_port >= max_ports))
|
||||
return;
|
||||
mlxsw_sp_port = mlxsw_sp->ports[local_port];
|
||||
if (!mlxsw_sp_port)
|
||||
|
||||
@@ -914,8 +914,7 @@ static int lan743x_phy_reset(struct lan743x_adapter *adapter)
|
||||
}
|
||||
|
||||
static void lan743x_phy_update_flowcontrol(struct lan743x_adapter *adapter,
|
||||
u8 duplex, u16 local_adv,
|
||||
u16 remote_adv)
|
||||
u16 local_adv, u16 remote_adv)
|
||||
{
|
||||
struct lan743x_phy *phy = &adapter->phy;
|
||||
u8 cap;
|
||||
@@ -943,7 +942,6 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
|
||||
|
||||
phy_print_status(phydev);
|
||||
if (phydev->state == PHY_RUNNING) {
|
||||
struct ethtool_link_ksettings ksettings;
|
||||
int remote_advertisement = 0;
|
||||
int local_advertisement = 0;
|
||||
|
||||
@@ -980,18 +978,14 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
|
||||
}
|
||||
lan743x_csr_write(adapter, MAC_CR, data);
|
||||
|
||||
memset(&ksettings, 0, sizeof(ksettings));
|
||||
phy_ethtool_get_link_ksettings(netdev, &ksettings);
|
||||
local_advertisement =
|
||||
linkmode_adv_to_mii_adv_t(phydev->advertising);
|
||||
remote_advertisement =
|
||||
linkmode_adv_to_mii_adv_t(phydev->lp_advertising);
|
||||
|
||||
lan743x_phy_update_flowcontrol(adapter,
|
||||
ksettings.base.duplex,
|
||||
local_advertisement,
|
||||
lan743x_phy_update_flowcontrol(adapter, local_advertisement,
|
||||
remote_advertisement);
|
||||
lan743x_ptp_update_latency(adapter, ksettings.base.speed);
|
||||
lan743x_ptp_update_latency(adapter, phydev->speed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1175,12 +1175,6 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
|
||||
switch (cfg.rx_filter) {
|
||||
case HWTSTAMP_FILTER_NONE:
|
||||
break;
|
||||
case HWTSTAMP_FILTER_ALL:
|
||||
case HWTSTAMP_FILTER_SOME:
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
|
||||
case HWTSTAMP_FILTER_NTP_ALL:
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
|
||||
@@ -1299,7 +1293,10 @@ int ocelot_get_ts_info(struct ocelot *ocelot, int port,
|
||||
SOF_TIMESTAMPING_RAW_HARDWARE;
|
||||
info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON) |
|
||||
BIT(HWTSTAMP_TX_ONESTEP_SYNC);
|
||||
info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | BIT(HWTSTAMP_FILTER_ALL);
|
||||
info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
|
||||
BIT(HWTSTAMP_FILTER_PTP_V2_EVENT) |
|
||||
BIT(HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
|
||||
BIT(HWTSTAMP_FILTER_PTP_V2_L4_EVENT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -565,7 +565,6 @@ struct nfp_net_dp {
|
||||
* @exn_name: Name for Exception interrupt
|
||||
* @shared_handler: Handler for shared interrupts
|
||||
* @shared_name: Name for shared interrupt
|
||||
* @me_freq_mhz: ME clock_freq (MHz)
|
||||
* @reconfig_lock: Protects @reconfig_posted, @reconfig_timer_active,
|
||||
* @reconfig_sync_present and HW reconfiguration request
|
||||
* regs/machinery from async requests (sync must take
|
||||
@@ -650,8 +649,6 @@ struct nfp_net {
|
||||
irq_handler_t shared_handler;
|
||||
char shared_name[IFNAMSIZ + 8];
|
||||
|
||||
u32 me_freq_mhz;
|
||||
|
||||
bool link_up;
|
||||
spinlock_t link_status_lock;
|
||||
|
||||
|
||||
@@ -1343,7 +1343,7 @@ static int nfp_net_set_coalesce(struct net_device *netdev,
|
||||
* ME timestamp ticks. There are 16 ME clock cycles for each timestamp
|
||||
* count.
|
||||
*/
|
||||
factor = nn->me_freq_mhz / 16;
|
||||
factor = nn->tlv_caps.me_freq_mhz / 16;
|
||||
|
||||
/* Each pair of (usecs, max_frames) fields specifies that interrupts
|
||||
* should be coalesced until
|
||||
|
||||
@@ -314,6 +314,7 @@ int stmmac_mdio_reset(struct mii_bus *mii);
|
||||
int stmmac_xpcs_setup(struct mii_bus *mii);
|
||||
void stmmac_set_ethtool_ops(struct net_device *netdev);
|
||||
|
||||
int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags);
|
||||
void stmmac_ptp_register(struct stmmac_priv *priv);
|
||||
void stmmac_ptp_unregister(struct stmmac_priv *priv);
|
||||
int stmmac_open(struct net_device *dev);
|
||||
|
||||
@@ -50,6 +50,13 @@
|
||||
#include "dwxgmac2.h"
|
||||
#include "hwif.h"
|
||||
|
||||
/* As long as the interface is active, we keep the timestamping counter enabled
|
||||
* with fine resolution and binary rollover. This avoid non-monotonic behavior
|
||||
* (clock jumps) when changing timestamping settings at runtime.
|
||||
*/
|
||||
#define STMMAC_HWTS_ACTIVE (PTP_TCR_TSENA | PTP_TCR_TSCFUPDT | \
|
||||
PTP_TCR_TSCTRLSSR)
|
||||
|
||||
#define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
|
||||
#define TSO_MAX_BUFF_SIZE (SZ_16K - 1)
|
||||
|
||||
@@ -613,8 +620,6 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
struct hwtstamp_config config;
|
||||
struct timespec64 now;
|
||||
u64 temp = 0;
|
||||
u32 ptp_v2 = 0;
|
||||
u32 tstamp_all = 0;
|
||||
u32 ptp_over_ipv4_udp = 0;
|
||||
@@ -623,11 +628,6 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
|
||||
u32 snap_type_sel = 0;
|
||||
u32 ts_master_en = 0;
|
||||
u32 ts_event_en = 0;
|
||||
u32 sec_inc = 0;
|
||||
u32 value = 0;
|
||||
bool xmac;
|
||||
|
||||
xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
|
||||
|
||||
if (!(priv->dma_cap.time_stamp || priv->adv_ts)) {
|
||||
netdev_alert(priv->dev, "No support for HW time stamping\n");
|
||||
@@ -789,42 +789,17 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
|
||||
priv->hwts_rx_en = ((config.rx_filter == HWTSTAMP_FILTER_NONE) ? 0 : 1);
|
||||
priv->hwts_tx_en = config.tx_type == HWTSTAMP_TX_ON;
|
||||
|
||||
if (!priv->hwts_tx_en && !priv->hwts_rx_en)
|
||||
stmmac_config_hw_tstamping(priv, priv->ptpaddr, 0);
|
||||
else {
|
||||
value = (PTP_TCR_TSENA | PTP_TCR_TSCFUPDT | PTP_TCR_TSCTRLSSR |
|
||||
tstamp_all | ptp_v2 | ptp_over_ethernet |
|
||||
ptp_over_ipv6_udp | ptp_over_ipv4_udp | ts_event_en |
|
||||
ts_master_en | snap_type_sel);
|
||||
stmmac_config_hw_tstamping(priv, priv->ptpaddr, value);
|
||||
priv->systime_flags = STMMAC_HWTS_ACTIVE;
|
||||
|
||||
/* program Sub Second Increment reg */
|
||||
stmmac_config_sub_second_increment(priv,
|
||||
priv->ptpaddr, priv->plat->clk_ptp_rate,
|
||||
xmac, &sec_inc);
|
||||
temp = div_u64(1000000000ULL, sec_inc);
|
||||
|
||||
/* Store sub second increment and flags for later use */
|
||||
priv->sub_second_inc = sec_inc;
|
||||
priv->systime_flags = value;
|
||||
|
||||
/* calculate default added value:
|
||||
* formula is :
|
||||
* addend = (2^32)/freq_div_ratio;
|
||||
* where, freq_div_ratio = 1e9ns/sec_inc
|
||||
*/
|
||||
temp = (u64)(temp << 32);
|
||||
priv->default_addend = div_u64(temp, priv->plat->clk_ptp_rate);
|
||||
stmmac_config_addend(priv, priv->ptpaddr, priv->default_addend);
|
||||
|
||||
/* initialize system time */
|
||||
ktime_get_real_ts64(&now);
|
||||
|
||||
/* lower 32 bits of tv_sec are safe until y2106 */
|
||||
stmmac_init_systime(priv, priv->ptpaddr,
|
||||
(u32)now.tv_sec, now.tv_nsec);
|
||||
if (priv->hwts_tx_en || priv->hwts_rx_en) {
|
||||
priv->systime_flags |= tstamp_all | ptp_v2 |
|
||||
ptp_over_ethernet | ptp_over_ipv6_udp |
|
||||
ptp_over_ipv4_udp | ts_event_en |
|
||||
ts_master_en | snap_type_sel;
|
||||
}
|
||||
|
||||
stmmac_config_hw_tstamping(priv, priv->ptpaddr, priv->systime_flags);
|
||||
|
||||
memcpy(&priv->tstamp_config, &config, sizeof(config));
|
||||
|
||||
return copy_to_user(ifr->ifr_data, &config,
|
||||
@@ -852,6 +827,66 @@ static int stmmac_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
|
||||
sizeof(*config)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* stmmac_init_tstamp_counter - init hardware timestamping counter
|
||||
* @priv: driver private structure
|
||||
* @systime_flags: timestamping flags
|
||||
* Description:
|
||||
* Initialize hardware counter for packet timestamping.
|
||||
* This is valid as long as the interface is open and not suspended.
|
||||
* Will be rerun after resuming from suspend, case in which the timestamping
|
||||
* flags updated by stmmac_hwtstamp_set() also need to be restored.
|
||||
*/
|
||||
int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags)
|
||||
{
|
||||
bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
|
||||
struct timespec64 now;
|
||||
u32 sec_inc = 0;
|
||||
u64 temp = 0;
|
||||
int ret;
|
||||
|
||||
if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ret = clk_prepare_enable(priv->plat->clk_ptp_ref);
|
||||
if (ret < 0) {
|
||||
netdev_warn(priv->dev,
|
||||
"failed to enable PTP reference clock: %pe\n",
|
||||
ERR_PTR(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
stmmac_config_hw_tstamping(priv, priv->ptpaddr, systime_flags);
|
||||
priv->systime_flags = systime_flags;
|
||||
|
||||
/* program Sub Second Increment reg */
|
||||
stmmac_config_sub_second_increment(priv, priv->ptpaddr,
|
||||
priv->plat->clk_ptp_rate,
|
||||
xmac, &sec_inc);
|
||||
temp = div_u64(1000000000ULL, sec_inc);
|
||||
|
||||
/* Store sub second increment for later use */
|
||||
priv->sub_second_inc = sec_inc;
|
||||
|
||||
/* calculate default added value:
|
||||
* formula is :
|
||||
* addend = (2^32)/freq_div_ratio;
|
||||
* where, freq_div_ratio = 1e9ns/sec_inc
|
||||
*/
|
||||
temp = (u64)(temp << 32);
|
||||
priv->default_addend = div_u64(temp, priv->plat->clk_ptp_rate);
|
||||
stmmac_config_addend(priv, priv->ptpaddr, priv->default_addend);
|
||||
|
||||
/* initialize system time */
|
||||
ktime_get_real_ts64(&now);
|
||||
|
||||
/* lower 32 bits of tv_sec are safe until y2106 */
|
||||
stmmac_init_systime(priv, priv->ptpaddr, (u32)now.tv_sec, now.tv_nsec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(stmmac_init_tstamp_counter);
|
||||
|
||||
/**
|
||||
* stmmac_init_ptp - init PTP
|
||||
* @priv: driver private structure
|
||||
@@ -862,9 +897,11 @@ static int stmmac_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
|
||||
static int stmmac_init_ptp(struct stmmac_priv *priv)
|
||||
{
|
||||
bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
|
||||
int ret;
|
||||
|
||||
if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
|
||||
return -EOPNOTSUPP;
|
||||
ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
priv->adv_ts = 0;
|
||||
/* Check if adv_ts can be enabled for dwmac 4.x / xgmac core */
|
||||
@@ -3268,10 +3305,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
|
||||
stmmac_mmc_setup(priv);
|
||||
|
||||
if (init_ptp) {
|
||||
ret = clk_prepare_enable(priv->plat->clk_ptp_ref);
|
||||
if (ret < 0)
|
||||
netdev_warn(priv->dev, "failed to enable PTP reference clock: %d\n", ret);
|
||||
|
||||
ret = stmmac_init_ptp(priv);
|
||||
if (ret == -EOPNOTSUPP)
|
||||
netdev_warn(priv->dev, "PTP not supported by HW\n");
|
||||
@@ -3761,6 +3794,8 @@ int stmmac_release(struct net_device *dev)
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
u32 chan;
|
||||
|
||||
netif_tx_disable(dev);
|
||||
|
||||
if (device_may_wakeup(priv->device))
|
||||
phylink_speed_down(priv->phylink, false);
|
||||
/* Stop and disconnect the PHY */
|
||||
|
||||
@@ -816,7 +816,7 @@ static int __maybe_unused stmmac_pltfr_noirq_resume(struct device *dev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
clk_prepare_enable(priv->plat->clk_ptp_ref);
|
||||
stmmac_init_tstamp_counter(priv, priv->systime_flags);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -661,22 +661,6 @@ void ipa_cmd_pipeline_clear_wait(struct ipa *ipa)
|
||||
wait_for_completion(&ipa->completion);
|
||||
}
|
||||
|
||||
void ipa_cmd_pipeline_clear(struct ipa *ipa)
|
||||
{
|
||||
u32 count = ipa_cmd_pipeline_clear_count();
|
||||
struct gsi_trans *trans;
|
||||
|
||||
trans = ipa_cmd_trans_alloc(ipa, count);
|
||||
if (trans) {
|
||||
ipa_cmd_pipeline_clear_add(trans);
|
||||
gsi_trans_commit_wait(trans);
|
||||
ipa_cmd_pipeline_clear_wait(ipa);
|
||||
} else {
|
||||
dev_err(&ipa->pdev->dev,
|
||||
"error allocating %u entry tag transaction\n", count);
|
||||
}
|
||||
}
|
||||
|
||||
static struct ipa_cmd_info *
|
||||
ipa_cmd_info_alloc(struct ipa_endpoint *endpoint, u32 tre_count)
|
||||
{
|
||||
|
||||
@@ -163,12 +163,6 @@ u32 ipa_cmd_pipeline_clear_count(void);
|
||||
*/
|
||||
void ipa_cmd_pipeline_clear_wait(struct ipa *ipa);
|
||||
|
||||
/**
|
||||
* ipa_cmd_pipeline_clear() - Clear the hardware pipeline
|
||||
* @ipa: - IPA pointer
|
||||
*/
|
||||
void ipa_cmd_pipeline_clear(struct ipa *ipa);
|
||||
|
||||
/**
|
||||
* ipa_cmd_trans_alloc() - Allocate a transaction for the command TX endpoint
|
||||
* @ipa: IPA pointer
|
||||
|
||||
@@ -1636,8 +1636,6 @@ void ipa_endpoint_suspend(struct ipa *ipa)
|
||||
if (ipa->modem_netdev)
|
||||
ipa_modem_suspend(ipa->modem_netdev);
|
||||
|
||||
ipa_cmd_pipeline_clear(ipa);
|
||||
|
||||
ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]);
|
||||
ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "ipa_reg.h"
|
||||
#include "ipa_mem.h"
|
||||
#include "ipa_table.h"
|
||||
#include "ipa_smp2p.h"
|
||||
#include "ipa_modem.h"
|
||||
#include "ipa_uc.h"
|
||||
#include "ipa_interrupt.h"
|
||||
@@ -801,6 +802,11 @@ static int ipa_remove(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
int ret;
|
||||
|
||||
/* Prevent the modem from triggering a call to ipa_setup(). This
|
||||
* also ensures a modem-initiated setup that's underway completes.
|
||||
*/
|
||||
ipa_smp2p_irq_disable_setup(ipa);
|
||||
|
||||
ret = pm_runtime_get_sync(dev);
|
||||
if (WARN_ON(ret < 0))
|
||||
goto out_power_put;
|
||||
|
||||
@@ -339,9 +339,6 @@ int ipa_modem_stop(struct ipa *ipa)
|
||||
if (state != IPA_MODEM_STATE_RUNNING)
|
||||
return -EBUSY;
|
||||
|
||||
/* Prevent the modem from triggering a call to ipa_setup() */
|
||||
ipa_smp2p_disable(ipa);
|
||||
|
||||
/* Clean up the netdev and endpoints if it was started */
|
||||
if (netdev) {
|
||||
struct ipa_priv *priv = netdev_priv(netdev);
|
||||
@@ -369,6 +366,9 @@ static void ipa_modem_crashed(struct ipa *ipa)
|
||||
struct device *dev = &ipa->pdev->dev;
|
||||
int ret;
|
||||
|
||||
/* Prevent the modem from triggering a call to ipa_setup() */
|
||||
ipa_smp2p_irq_disable_setup(ipa);
|
||||
|
||||
ret = pm_runtime_get_sync(dev);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "error %d getting power to handle crash\n", ret);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
* @setup_ready_irq: IPA interrupt triggered by modem to signal GSI ready
|
||||
* @power_on: Whether IPA power is on
|
||||
* @notified: Whether modem has been notified of power state
|
||||
* @disabled: Whether setup ready interrupt handling is disabled
|
||||
* @setup_disabled: Whether setup ready interrupt handler is disabled
|
||||
* @mutex: Mutex protecting ready-interrupt/shutdown interlock
|
||||
* @panic_notifier: Panic notifier structure
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ struct ipa_smp2p {
|
||||
u32 setup_ready_irq;
|
||||
bool power_on;
|
||||
bool notified;
|
||||
bool disabled;
|
||||
bool setup_disabled;
|
||||
struct mutex mutex;
|
||||
struct notifier_block panic_notifier;
|
||||
};
|
||||
@@ -155,11 +155,9 @@ static irqreturn_t ipa_smp2p_modem_setup_ready_isr(int irq, void *dev_id)
|
||||
struct device *dev;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&smp2p->mutex);
|
||||
|
||||
if (smp2p->disabled)
|
||||
goto out_mutex_unlock;
|
||||
smp2p->disabled = true; /* If any others arrive, ignore them */
|
||||
/* Ignore any (spurious) interrupts received after the first */
|
||||
if (smp2p->ipa->setup_complete)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
/* Power needs to be active for setup */
|
||||
dev = &smp2p->ipa->pdev->dev;
|
||||
@@ -176,8 +174,6 @@ static irqreturn_t ipa_smp2p_modem_setup_ready_isr(int irq, void *dev_id)
|
||||
out_power_put:
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
(void)pm_runtime_put_autosuspend(dev);
|
||||
out_mutex_unlock:
|
||||
mutex_unlock(&smp2p->mutex);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -313,7 +309,7 @@ void ipa_smp2p_exit(struct ipa *ipa)
|
||||
kfree(smp2p);
|
||||
}
|
||||
|
||||
void ipa_smp2p_disable(struct ipa *ipa)
|
||||
void ipa_smp2p_irq_disable_setup(struct ipa *ipa)
|
||||
{
|
||||
struct ipa_smp2p *smp2p = ipa->smp2p;
|
||||
|
||||
@@ -322,7 +318,10 @@ void ipa_smp2p_disable(struct ipa *ipa)
|
||||
|
||||
mutex_lock(&smp2p->mutex);
|
||||
|
||||
smp2p->disabled = true;
|
||||
if (!smp2p->setup_disabled) {
|
||||
disable_irq(smp2p->setup_ready_irq);
|
||||
smp2p->setup_disabled = true;
|
||||
}
|
||||
|
||||
mutex_unlock(&smp2p->mutex);
|
||||
}
|
||||
|
||||
@@ -27,13 +27,12 @@ int ipa_smp2p_init(struct ipa *ipa, bool modem_init);
|
||||
void ipa_smp2p_exit(struct ipa *ipa);
|
||||
|
||||
/**
|
||||
* ipa_smp2p_disable() - Prevent "ipa-setup-ready" interrupt handling
|
||||
* ipa_smp2p_irq_disable_setup() - Disable the "setup ready" interrupt
|
||||
* @ipa: IPA pointer
|
||||
*
|
||||
* Prevent handling of the "setup ready" interrupt from the modem.
|
||||
* This is used before initiating shutdown of the driver.
|
||||
* Disable the "ipa-setup-ready" interrupt from the modem.
|
||||
*/
|
||||
void ipa_smp2p_disable(struct ipa *ipa);
|
||||
void ipa_smp2p_irq_disable_setup(struct ipa *ipa);
|
||||
|
||||
/**
|
||||
* ipa_smp2p_notify_reset() - Reset modem notification state
|
||||
|
||||
@@ -61,6 +61,13 @@ static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum)
|
||||
|
||||
iowrite32(ctrl, ctx->base + ASPEED_MDIO_CTRL);
|
||||
|
||||
rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_CTRL, ctrl,
|
||||
!(ctrl & ASPEED_MDIO_CTRL_FIRE),
|
||||
ASPEED_MDIO_INTERVAL_US,
|
||||
ASPEED_MDIO_TIMEOUT_US);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = readl_poll_timeout(ctx->base + ASPEED_MDIO_DATA, data,
|
||||
data & ASPEED_MDIO_DATA_IDLE,
|
||||
ASPEED_MDIO_INTERVAL_US,
|
||||
|
||||
@@ -657,6 +657,7 @@ static void phylink_resolve(struct work_struct *w)
|
||||
struct phylink_link_state link_state;
|
||||
struct net_device *ndev = pl->netdev;
|
||||
bool mac_config = false;
|
||||
bool retrigger = false;
|
||||
bool cur_link_state;
|
||||
|
||||
mutex_lock(&pl->state_mutex);
|
||||
@@ -670,6 +671,7 @@ static void phylink_resolve(struct work_struct *w)
|
||||
link_state.link = false;
|
||||
} else if (pl->mac_link_dropped) {
|
||||
link_state.link = false;
|
||||
retrigger = true;
|
||||
} else {
|
||||
switch (pl->cur_link_an_mode) {
|
||||
case MLO_AN_PHY:
|
||||
@@ -686,6 +688,19 @@ static void phylink_resolve(struct work_struct *w)
|
||||
case MLO_AN_INBAND:
|
||||
phylink_mac_pcs_get_state(pl, &link_state);
|
||||
|
||||
/* The PCS may have a latching link-fail indicator.
|
||||
* If the link was up, bring the link down and
|
||||
* re-trigger the resolve. Otherwise, re-read the
|
||||
* PCS state to get the current status of the link.
|
||||
*/
|
||||
if (!link_state.link) {
|
||||
if (cur_link_state)
|
||||
retrigger = true;
|
||||
else
|
||||
phylink_mac_pcs_get_state(pl,
|
||||
&link_state);
|
||||
}
|
||||
|
||||
/* If we have a phy, the "up" state is the union of
|
||||
* both the PHY and the MAC
|
||||
*/
|
||||
@@ -694,6 +709,15 @@ static void phylink_resolve(struct work_struct *w)
|
||||
|
||||
/* Only update if the PHY link is up */
|
||||
if (pl->phydev && pl->phy_state.link) {
|
||||
/* If the interface has changed, force a
|
||||
* link down event if the link isn't already
|
||||
* down, and re-resolve.
|
||||
*/
|
||||
if (link_state.interface !=
|
||||
pl->phy_state.interface) {
|
||||
retrigger = true;
|
||||
link_state.link = false;
|
||||
}
|
||||
link_state.interface = pl->phy_state.interface;
|
||||
|
||||
/* If we have a PHY, we need to update with
|
||||
@@ -736,7 +760,7 @@ static void phylink_resolve(struct work_struct *w)
|
||||
else
|
||||
phylink_link_up(pl, link_state);
|
||||
}
|
||||
if (!link_state.link && pl->mac_link_dropped) {
|
||||
if (!link_state.link && retrigger) {
|
||||
pl->mac_link_dropped = false;
|
||||
queue_work(system_power_efficient_wq, &pl->resolve);
|
||||
}
|
||||
|
||||
@@ -1049,6 +1049,14 @@ static const struct net_device_ops smsc95xx_netdev_ops = {
|
||||
.ndo_set_features = smsc95xx_set_features,
|
||||
};
|
||||
|
||||
static void smsc95xx_handle_link_change(struct net_device *net)
|
||||
{
|
||||
struct usbnet *dev = netdev_priv(net);
|
||||
|
||||
phy_print_status(net->phydev);
|
||||
usbnet_defer_kevent(dev, EVENT_LINK_CHANGE);
|
||||
}
|
||||
|
||||
static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
{
|
||||
struct smsc95xx_priv *pdata;
|
||||
@@ -1153,6 +1161,17 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
|
||||
dev->net->min_mtu = ETH_MIN_MTU;
|
||||
dev->net->max_mtu = ETH_DATA_LEN;
|
||||
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
|
||||
|
||||
ret = phy_connect_direct(dev->net, pdata->phydev,
|
||||
&smsc95xx_handle_link_change,
|
||||
PHY_INTERFACE_MODE_MII);
|
||||
if (ret) {
|
||||
netdev_err(dev->net, "can't attach PHY to %s\n", pdata->mdiobus->id);
|
||||
goto unregister_mdio;
|
||||
}
|
||||
|
||||
phy_attached_info(dev->net->phydev);
|
||||
|
||||
return 0;
|
||||
|
||||
unregister_mdio:
|
||||
@@ -1170,47 +1189,25 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
|
||||
{
|
||||
struct smsc95xx_priv *pdata = dev->driver_priv;
|
||||
|
||||
phy_disconnect(dev->net->phydev);
|
||||
mdiobus_unregister(pdata->mdiobus);
|
||||
mdiobus_free(pdata->mdiobus);
|
||||
netif_dbg(dev, ifdown, dev->net, "free pdata\n");
|
||||
kfree(pdata);
|
||||
}
|
||||
|
||||
static void smsc95xx_handle_link_change(struct net_device *net)
|
||||
{
|
||||
struct usbnet *dev = netdev_priv(net);
|
||||
|
||||
phy_print_status(net->phydev);
|
||||
usbnet_defer_kevent(dev, EVENT_LINK_CHANGE);
|
||||
}
|
||||
|
||||
static int smsc95xx_start_phy(struct usbnet *dev)
|
||||
{
|
||||
struct smsc95xx_priv *pdata = dev->driver_priv;
|
||||
struct net_device *net = dev->net;
|
||||
int ret;
|
||||
phy_start(dev->net->phydev);
|
||||
|
||||
ret = smsc95xx_reset(dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = phy_connect_direct(net, pdata->phydev,
|
||||
&smsc95xx_handle_link_change,
|
||||
PHY_INTERFACE_MODE_MII);
|
||||
if (ret) {
|
||||
netdev_err(net, "can't attach PHY to %s\n", pdata->mdiobus->id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
phy_attached_info(net->phydev);
|
||||
phy_start(net->phydev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smsc95xx_disconnect_phy(struct usbnet *dev)
|
||||
static int smsc95xx_stop(struct usbnet *dev)
|
||||
{
|
||||
phy_stop(dev->net->phydev);
|
||||
phy_disconnect(dev->net->phydev);
|
||||
if (dev->net->phydev)
|
||||
phy_stop(dev->net->phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1965,7 +1962,7 @@ static const struct driver_info smsc95xx_info = {
|
||||
.unbind = smsc95xx_unbind,
|
||||
.link_reset = smsc95xx_link_reset,
|
||||
.reset = smsc95xx_start_phy,
|
||||
.stop = smsc95xx_disconnect_phy,
|
||||
.stop = smsc95xx_stop,
|
||||
.rx_fixup = smsc95xx_rx_fixup,
|
||||
.tx_fixup = smsc95xx_tx_fixup,
|
||||
.status = smsc95xx_status,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/uio.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/fs.h>
|
||||
#include "nvmet.h"
|
||||
|
||||
#define NVMET_MAX_MPOOL_BVEC 16
|
||||
@@ -266,7 +267,8 @@ static void nvmet_file_execute_rw(struct nvmet_req *req)
|
||||
|
||||
if (req->ns->buffered_io) {
|
||||
if (likely(!req->f.mpool_alloc) &&
|
||||
nvmet_file_execute_io(req, IOCB_NOWAIT))
|
||||
(req->ns->file->f_mode & FMODE_NOWAIT) &&
|
||||
nvmet_file_execute_io(req, IOCB_NOWAIT))
|
||||
return;
|
||||
nvmet_file_submit_buffered_io(req);
|
||||
} else
|
||||
|
||||
@@ -700,10 +700,11 @@ static int nvmet_try_send_r2t(struct nvmet_tcp_cmd *cmd, bool last_in_batch)
|
||||
static int nvmet_try_send_ddgst(struct nvmet_tcp_cmd *cmd, bool last_in_batch)
|
||||
{
|
||||
struct nvmet_tcp_queue *queue = cmd->queue;
|
||||
int left = NVME_TCP_DIGEST_LENGTH - cmd->offset;
|
||||
struct msghdr msg = { .msg_flags = MSG_DONTWAIT };
|
||||
struct kvec iov = {
|
||||
.iov_base = (u8 *)&cmd->exp_ddgst + cmd->offset,
|
||||
.iov_len = NVME_TCP_DIGEST_LENGTH - cmd->offset
|
||||
.iov_len = left
|
||||
};
|
||||
int ret;
|
||||
|
||||
@@ -717,6 +718,10 @@ static int nvmet_try_send_ddgst(struct nvmet_tcp_cmd *cmd, bool last_in_batch)
|
||||
return ret;
|
||||
|
||||
cmd->offset += ret;
|
||||
left -= ret;
|
||||
|
||||
if (left)
|
||||
return -EAGAIN;
|
||||
|
||||
if (queue->nvme_sq.sqhd_disabled) {
|
||||
cmd->queue->snd_cmd = NULL;
|
||||
|
||||
@@ -299,11 +299,6 @@ static inline u32 advk_readl(struct advk_pcie *pcie, u64 reg)
|
||||
return readl(pcie->base + reg);
|
||||
}
|
||||
|
||||
static inline u16 advk_read16(struct advk_pcie *pcie, u64 reg)
|
||||
{
|
||||
return advk_readl(pcie, (reg & ~0x3)) >> ((reg & 0x3) * 8);
|
||||
}
|
||||
|
||||
static u8 advk_pcie_ltssm_state(struct advk_pcie *pcie)
|
||||
{
|
||||
u32 val;
|
||||
@@ -377,23 +372,9 @@ static void advk_pcie_wait_for_retrain(struct advk_pcie *pcie)
|
||||
|
||||
static void advk_pcie_issue_perst(struct advk_pcie *pcie)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
if (!pcie->reset_gpio)
|
||||
return;
|
||||
|
||||
/*
|
||||
* As required by PCI Express spec (PCI Express Base Specification, REV.
|
||||
* 4.0 PCI Express, February 19 2014, 6.6.1 Conventional Reset) a delay
|
||||
* for at least 100ms after de-asserting PERST# signal is needed before
|
||||
* link training is enabled. So ensure that link training is disabled
|
||||
* prior de-asserting PERST# signal to fulfill that PCI Express spec
|
||||
* requirement.
|
||||
*/
|
||||
reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
|
||||
reg &= ~LINK_TRAINING_EN;
|
||||
advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
|
||||
|
||||
/* 10ms delay is needed for some cards */
|
||||
dev_info(&pcie->pdev->dev, "issuing PERST via reset GPIO for 10ms\n");
|
||||
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
|
||||
@@ -401,53 +382,46 @@ static void advk_pcie_issue_perst(struct advk_pcie *pcie)
|
||||
gpiod_set_value_cansleep(pcie->reset_gpio, 0);
|
||||
}
|
||||
|
||||
static int advk_pcie_train_at_gen(struct advk_pcie *pcie, int gen)
|
||||
static void advk_pcie_train_link(struct advk_pcie *pcie)
|
||||
{
|
||||
int ret, neg_gen;
|
||||
struct device *dev = &pcie->pdev->dev;
|
||||
u32 reg;
|
||||
int ret;
|
||||
|
||||
/* Setup link speed */
|
||||
/*
|
||||
* Setup PCIe rev / gen compliance based on device tree property
|
||||
* 'max-link-speed' which also forces maximal link speed.
|
||||
*/
|
||||
reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
|
||||
reg &= ~PCIE_GEN_SEL_MSK;
|
||||
if (gen == 3)
|
||||
if (pcie->link_gen == 3)
|
||||
reg |= SPEED_GEN_3;
|
||||
else if (gen == 2)
|
||||
else if (pcie->link_gen == 2)
|
||||
reg |= SPEED_GEN_2;
|
||||
else
|
||||
reg |= SPEED_GEN_1;
|
||||
advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
|
||||
|
||||
/*
|
||||
* Enable link training. This is not needed in every call to this
|
||||
* function, just once suffices, but it does not break anything either.
|
||||
* Set maximal link speed value also into PCIe Link Control 2 register.
|
||||
* Armada 3700 Functional Specification says that default value is based
|
||||
* on SPEED_GEN but tests showed that default value is always 8.0 GT/s.
|
||||
*/
|
||||
reg = advk_readl(pcie, PCIE_CORE_PCIEXP_CAP + PCI_EXP_LNKCTL2);
|
||||
reg &= ~PCI_EXP_LNKCTL2_TLS;
|
||||
if (pcie->link_gen == 3)
|
||||
reg |= PCI_EXP_LNKCTL2_TLS_8_0GT;
|
||||
else if (pcie->link_gen == 2)
|
||||
reg |= PCI_EXP_LNKCTL2_TLS_5_0GT;
|
||||
else
|
||||
reg |= PCI_EXP_LNKCTL2_TLS_2_5GT;
|
||||
advk_writel(pcie, reg, PCIE_CORE_PCIEXP_CAP + PCI_EXP_LNKCTL2);
|
||||
|
||||
/* Enable link training after selecting PCIe generation */
|
||||
reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
|
||||
reg |= LINK_TRAINING_EN;
|
||||
advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
|
||||
|
||||
/*
|
||||
* Start link training immediately after enabling it.
|
||||
* This solves problems for some buggy cards.
|
||||
*/
|
||||
reg = advk_readl(pcie, PCIE_CORE_PCIEXP_CAP + PCI_EXP_LNKCTL);
|
||||
reg |= PCI_EXP_LNKCTL_RL;
|
||||
advk_writel(pcie, reg, PCIE_CORE_PCIEXP_CAP + PCI_EXP_LNKCTL);
|
||||
|
||||
ret = advk_pcie_wait_for_link(pcie);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
reg = advk_read16(pcie, PCIE_CORE_PCIEXP_CAP + PCI_EXP_LNKSTA);
|
||||
neg_gen = reg & PCI_EXP_LNKSTA_CLS;
|
||||
|
||||
return neg_gen;
|
||||
}
|
||||
|
||||
static void advk_pcie_train_link(struct advk_pcie *pcie)
|
||||
{
|
||||
struct device *dev = &pcie->pdev->dev;
|
||||
int neg_gen = -1, gen;
|
||||
|
||||
/*
|
||||
* Reset PCIe card via PERST# signal. Some cards are not detected
|
||||
* during link training when they are in some non-initial state.
|
||||
@@ -458,41 +432,18 @@ static void advk_pcie_train_link(struct advk_pcie *pcie)
|
||||
* PERST# signal could have been asserted by pinctrl subsystem before
|
||||
* probe() callback has been called or issued explicitly by reset gpio
|
||||
* function advk_pcie_issue_perst(), making the endpoint going into
|
||||
* fundamental reset. As required by PCI Express spec a delay for at
|
||||
* least 100ms after such a reset before link training is needed.
|
||||
* fundamental reset. As required by PCI Express spec (PCI Express
|
||||
* Base Specification, REV. 4.0 PCI Express, February 19 2014, 6.6.1
|
||||
* Conventional Reset) a delay for at least 100ms after such a reset
|
||||
* before sending a Configuration Request to the device is needed.
|
||||
* So wait until PCIe link is up. Function advk_pcie_wait_for_link()
|
||||
* waits for link at least 900ms.
|
||||
*/
|
||||
msleep(PCI_PM_D3COLD_WAIT);
|
||||
|
||||
/*
|
||||
* Try link training at link gen specified by device tree property
|
||||
* 'max-link-speed'. If this fails, iteratively train at lower gen.
|
||||
*/
|
||||
for (gen = pcie->link_gen; gen > 0; --gen) {
|
||||
neg_gen = advk_pcie_train_at_gen(pcie, gen);
|
||||
if (neg_gen > 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (neg_gen < 0)
|
||||
goto err;
|
||||
|
||||
/*
|
||||
* After successful training if negotiated gen is lower than requested,
|
||||
* train again on negotiated gen. This solves some stability issues for
|
||||
* some buggy gen1 cards.
|
||||
*/
|
||||
if (neg_gen < gen) {
|
||||
gen = neg_gen;
|
||||
neg_gen = advk_pcie_train_at_gen(pcie, gen);
|
||||
}
|
||||
|
||||
if (neg_gen == gen) {
|
||||
dev_info(dev, "link up at gen %i\n", gen);
|
||||
return;
|
||||
}
|
||||
|
||||
err:
|
||||
dev_err(dev, "link never came up\n");
|
||||
ret = advk_pcie_wait_for_link(pcie);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "link never came up\n");
|
||||
else
|
||||
dev_info(dev, "link up\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -692,6 +643,7 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
|
||||
u32 reg;
|
||||
unsigned int status;
|
||||
char *strcomp_status, *str_posted;
|
||||
int ret;
|
||||
|
||||
reg = advk_readl(pcie, PIO_STAT);
|
||||
status = (reg & PIO_COMPLETION_STATUS_MASK) >>
|
||||
@@ -716,6 +668,7 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
|
||||
case PIO_COMPLETION_STATUS_OK:
|
||||
if (reg & PIO_ERR_STATUS) {
|
||||
strcomp_status = "COMP_ERR";
|
||||
ret = -EFAULT;
|
||||
break;
|
||||
}
|
||||
/* Get the read result */
|
||||
@@ -723,9 +676,11 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
|
||||
*val = advk_readl(pcie, PIO_RD_DATA);
|
||||
/* No error */
|
||||
strcomp_status = NULL;
|
||||
ret = 0;
|
||||
break;
|
||||
case PIO_COMPLETION_STATUS_UR:
|
||||
strcomp_status = "UR";
|
||||
ret = -EOPNOTSUPP;
|
||||
break;
|
||||
case PIO_COMPLETION_STATUS_CRS:
|
||||
if (allow_crs && val) {
|
||||
@@ -743,6 +698,7 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
|
||||
*/
|
||||
*val = CFG_RD_CRS_VAL;
|
||||
strcomp_status = NULL;
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
/* PCIe r4.0, sec 2.3.2, says:
|
||||
@@ -758,21 +714,24 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
|
||||
* Request and taking appropriate action, e.g., complete the
|
||||
* Request to the host as a failed transaction.
|
||||
*
|
||||
* To simplify implementation do not re-issue the Configuration
|
||||
* Request and complete the Request as a failed transaction.
|
||||
* So return -EAGAIN and caller (pci-aardvark.c driver) will
|
||||
* re-issue request again up to the PIO_RETRY_CNT retries.
|
||||
*/
|
||||
strcomp_status = "CRS";
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
case PIO_COMPLETION_STATUS_CA:
|
||||
strcomp_status = "CA";
|
||||
ret = -ECANCELED;
|
||||
break;
|
||||
default:
|
||||
strcomp_status = "Unknown";
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!strcomp_status)
|
||||
return 0;
|
||||
return ret;
|
||||
|
||||
if (reg & PIO_NON_POSTED_REQ)
|
||||
str_posted = "Non-posted";
|
||||
@@ -782,7 +741,7 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
|
||||
dev_dbg(dev, "%s PIO Response Status: %s, %#x @ %#x\n",
|
||||
str_posted, strcomp_status, reg, advk_readl(pcie, PIO_ADDR_LS));
|
||||
|
||||
return -EFAULT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int advk_pcie_wait_pio(struct advk_pcie *pcie)
|
||||
@@ -790,13 +749,13 @@ static int advk_pcie_wait_pio(struct advk_pcie *pcie)
|
||||
struct device *dev = &pcie->pdev->dev;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < PIO_RETRY_CNT; i++) {
|
||||
for (i = 1; i <= PIO_RETRY_CNT; i++) {
|
||||
u32 start, isr;
|
||||
|
||||
start = advk_readl(pcie, PIO_START);
|
||||
isr = advk_readl(pcie, PIO_ISR);
|
||||
if (!start && isr)
|
||||
return 0;
|
||||
return i;
|
||||
udelay(PIO_RETRY_DELAY);
|
||||
}
|
||||
|
||||
@@ -984,7 +943,6 @@ static struct pci_bridge_emul_ops advk_pci_bridge_emul_ops = {
|
||||
static int advk_sw_pci_bridge_init(struct advk_pcie *pcie)
|
||||
{
|
||||
struct pci_bridge_emul *bridge = &pcie->bridge;
|
||||
int ret;
|
||||
|
||||
bridge->conf.vendor =
|
||||
cpu_to_le16(advk_readl(pcie, PCIE_CORE_DEV_ID_REG) & 0xffff);
|
||||
@@ -1004,19 +962,14 @@ static int advk_sw_pci_bridge_init(struct advk_pcie *pcie)
|
||||
/* Support interrupt A for MSI feature */
|
||||
bridge->conf.intpin = PCIE_CORE_INT_A_ASSERT_ENABLE;
|
||||
|
||||
/* Indicates supports for Completion Retry Status */
|
||||
bridge->pcie_conf.rootcap = cpu_to_le16(PCI_EXP_RTCAP_CRSVIS);
|
||||
|
||||
bridge->has_pcie = true;
|
||||
bridge->data = pcie;
|
||||
bridge->ops = &advk_pci_bridge_emul_ops;
|
||||
|
||||
/* PCIe config space can be initialized after pci_bridge_emul_init() */
|
||||
ret = pci_bridge_emul_init(bridge, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Indicates supports for Completion Retry Status */
|
||||
bridge->pcie_conf.rootcap = cpu_to_le16(PCI_EXP_RTCAP_CRSVIS);
|
||||
|
||||
return 0;
|
||||
return pci_bridge_emul_init(bridge, 0);
|
||||
}
|
||||
|
||||
static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bus *bus,
|
||||
@@ -1068,6 +1021,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
|
||||
int where, int size, u32 *val)
|
||||
{
|
||||
struct advk_pcie *pcie = bus->sysdata;
|
||||
int retry_count;
|
||||
bool allow_crs;
|
||||
u32 reg;
|
||||
int ret;
|
||||
@@ -1090,18 +1044,8 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
|
||||
(le16_to_cpu(pcie->bridge.pcie_conf.rootctl) &
|
||||
PCI_EXP_RTCTL_CRSSVE);
|
||||
|
||||
if (advk_pcie_pio_is_running(pcie)) {
|
||||
/*
|
||||
* If it is possible return Completion Retry Status so caller
|
||||
* tries to issue the request again instead of failing.
|
||||
*/
|
||||
if (allow_crs) {
|
||||
*val = CFG_RD_CRS_VAL;
|
||||
return PCIBIOS_SUCCESSFUL;
|
||||
}
|
||||
*val = 0xffffffff;
|
||||
return PCIBIOS_SET_FAILED;
|
||||
}
|
||||
if (advk_pcie_pio_is_running(pcie))
|
||||
goto try_crs;
|
||||
|
||||
/* Program the control register */
|
||||
reg = advk_readl(pcie, PIO_CTRL);
|
||||
@@ -1120,30 +1064,24 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
|
||||
/* Program the data strobe */
|
||||
advk_writel(pcie, 0xf, PIO_WR_DATA_STRB);
|
||||
|
||||
/* Clear PIO DONE ISR and start the transfer */
|
||||
advk_writel(pcie, 1, PIO_ISR);
|
||||
advk_writel(pcie, 1, PIO_START);
|
||||
retry_count = 0;
|
||||
do {
|
||||
/* Clear PIO DONE ISR and start the transfer */
|
||||
advk_writel(pcie, 1, PIO_ISR);
|
||||
advk_writel(pcie, 1, PIO_START);
|
||||
|
||||
ret = advk_pcie_wait_pio(pcie);
|
||||
if (ret < 0) {
|
||||
/*
|
||||
* If it is possible return Completion Retry Status so caller
|
||||
* tries to issue the request again instead of failing.
|
||||
*/
|
||||
if (allow_crs) {
|
||||
*val = CFG_RD_CRS_VAL;
|
||||
return PCIBIOS_SUCCESSFUL;
|
||||
}
|
||||
*val = 0xffffffff;
|
||||
return PCIBIOS_SET_FAILED;
|
||||
}
|
||||
ret = advk_pcie_wait_pio(pcie);
|
||||
if (ret < 0)
|
||||
goto try_crs;
|
||||
|
||||
/* Check PIO status and get the read result */
|
||||
ret = advk_pcie_check_pio_status(pcie, allow_crs, val);
|
||||
if (ret < 0) {
|
||||
*val = 0xffffffff;
|
||||
return PCIBIOS_SET_FAILED;
|
||||
}
|
||||
retry_count += ret;
|
||||
|
||||
/* Check PIO status and get the read result */
|
||||
ret = advk_pcie_check_pio_status(pcie, allow_crs, val);
|
||||
} while (ret == -EAGAIN && retry_count < PIO_RETRY_CNT);
|
||||
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
if (size == 1)
|
||||
*val = (*val >> (8 * (where & 3))) & 0xff;
|
||||
@@ -1151,6 +1089,20 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
|
||||
*val = (*val >> (8 * (where & 3))) & 0xffff;
|
||||
|
||||
return PCIBIOS_SUCCESSFUL;
|
||||
|
||||
try_crs:
|
||||
/*
|
||||
* If it is possible, return Completion Retry Status so that caller
|
||||
* tries to issue the request again instead of failing.
|
||||
*/
|
||||
if (allow_crs) {
|
||||
*val = CFG_RD_CRS_VAL;
|
||||
return PCIBIOS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
fail:
|
||||
*val = 0xffffffff;
|
||||
return PCIBIOS_SET_FAILED;
|
||||
}
|
||||
|
||||
static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
|
||||
@@ -1159,6 +1111,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
|
||||
struct advk_pcie *pcie = bus->sysdata;
|
||||
u32 reg;
|
||||
u32 data_strobe = 0x0;
|
||||
int retry_count;
|
||||
int offset;
|
||||
int ret;
|
||||
|
||||
@@ -1200,19 +1153,22 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
|
||||
/* Program the data strobe */
|
||||
advk_writel(pcie, data_strobe, PIO_WR_DATA_STRB);
|
||||
|
||||
/* Clear PIO DONE ISR and start the transfer */
|
||||
advk_writel(pcie, 1, PIO_ISR);
|
||||
advk_writel(pcie, 1, PIO_START);
|
||||
retry_count = 0;
|
||||
do {
|
||||
/* Clear PIO DONE ISR and start the transfer */
|
||||
advk_writel(pcie, 1, PIO_ISR);
|
||||
advk_writel(pcie, 1, PIO_START);
|
||||
|
||||
ret = advk_pcie_wait_pio(pcie);
|
||||
if (ret < 0)
|
||||
return PCIBIOS_SET_FAILED;
|
||||
ret = advk_pcie_wait_pio(pcie);
|
||||
if (ret < 0)
|
||||
return PCIBIOS_SET_FAILED;
|
||||
|
||||
ret = advk_pcie_check_pio_status(pcie, false, NULL);
|
||||
if (ret < 0)
|
||||
return PCIBIOS_SET_FAILED;
|
||||
retry_count += ret;
|
||||
|
||||
return PCIBIOS_SUCCESSFUL;
|
||||
ret = advk_pcie_check_pio_status(pcie, false, NULL);
|
||||
} while (ret == -EAGAIN && retry_count < PIO_RETRY_CNT);
|
||||
|
||||
return ret < 0 ? PCIBIOS_SET_FAILED : PCIBIOS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
static struct pci_ops advk_pcie_ops = {
|
||||
|
||||
@@ -639,8 +639,8 @@ static void _base_sync_drv_fw_timestamp(struct MPT3SAS_ADAPTER *ioc)
|
||||
mpi_request->IOCParameter = MPI26_SET_IOC_PARAMETER_SYNC_TIMESTAMP;
|
||||
current_time = ktime_get_real();
|
||||
TimeStamp = ktime_to_ms(current_time);
|
||||
mpi_request->Reserved7 = cpu_to_le32(TimeStamp & 0xFFFFFFFF);
|
||||
mpi_request->IOCParameterValue = cpu_to_le32(TimeStamp >> 32);
|
||||
mpi_request->Reserved7 = cpu_to_le32(TimeStamp >> 32);
|
||||
mpi_request->IOCParameterValue = cpu_to_le32(TimeStamp & 0xFFFFFFFF);
|
||||
init_completion(&ioc->scsih_cmds.done);
|
||||
ioc->put_smid_default(ioc, smid);
|
||||
dinitprintk(ioc, ioc_info(ioc,
|
||||
|
||||
@@ -142,6 +142,8 @@
|
||||
|
||||
#define MPT_MAX_CALLBACKS 32
|
||||
|
||||
#define MPT_MAX_HBA_NUM_PHYS 32
|
||||
|
||||
#define INTERNAL_CMDS_COUNT 10 /* reserved cmds */
|
||||
/* reserved for issuing internally framed scsi io cmds */
|
||||
#define INTERNAL_SCSIIO_CMDS_COUNT 3
|
||||
@@ -798,6 +800,7 @@ struct _sas_phy {
|
||||
* @enclosure_handle: handle for this a member of an enclosure
|
||||
* @device_info: bitwise defining capabilities of this sas_host/expander
|
||||
* @responding: used in _scsih_expander_device_mark_responding
|
||||
* @nr_phys_allocated: Allocated memory for this many count phys
|
||||
* @phy: a list of phys that make up this sas_host/expander
|
||||
* @sas_port_list: list of ports attached to this sas_host/expander
|
||||
* @port: hba port entry containing node's port number info
|
||||
@@ -813,6 +816,7 @@ struct _sas_node {
|
||||
u16 enclosure_handle;
|
||||
u64 enclosure_logical_id;
|
||||
u8 responding;
|
||||
u8 nr_phys_allocated;
|
||||
struct hba_port *port;
|
||||
struct _sas_phy *phy;
|
||||
struct list_head sas_port_list;
|
||||
|
||||
@@ -3869,7 +3869,7 @@ _scsih_ublock_io_device(struct MPT3SAS_ADAPTER *ioc,
|
||||
|
||||
shost_for_each_device(sdev, ioc->shost) {
|
||||
sas_device_priv_data = sdev->hostdata;
|
||||
if (!sas_device_priv_data)
|
||||
if (!sas_device_priv_data || !sas_device_priv_data->sas_target)
|
||||
continue;
|
||||
if (sas_device_priv_data->sas_target->sas_address
|
||||
!= sas_address)
|
||||
@@ -6406,11 +6406,26 @@ _scsih_sas_port_refresh(struct MPT3SAS_ADAPTER *ioc)
|
||||
int i, j, count = 0, lcount = 0;
|
||||
int ret;
|
||||
u64 sas_addr;
|
||||
u8 num_phys;
|
||||
|
||||
drsprintk(ioc, ioc_info(ioc,
|
||||
"updating ports for sas_host(0x%016llx)\n",
|
||||
(unsigned long long)ioc->sas_hba.sas_address));
|
||||
|
||||
mpt3sas_config_get_number_hba_phys(ioc, &num_phys);
|
||||
if (!num_phys) {
|
||||
ioc_err(ioc, "failure at %s:%d/%s()!\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (num_phys > ioc->sas_hba.nr_phys_allocated) {
|
||||
ioc_err(ioc, "failure at %s:%d/%s()!\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
return;
|
||||
}
|
||||
ioc->sas_hba.num_phys = num_phys;
|
||||
|
||||
port_table = kcalloc(ioc->sas_hba.num_phys,
|
||||
sizeof(struct hba_port), GFP_KERNEL);
|
||||
if (!port_table)
|
||||
@@ -6611,6 +6626,30 @@ _scsih_sas_host_refresh(struct MPT3SAS_ADAPTER *ioc)
|
||||
ioc->sas_hba.phy[i].hba_vphy = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add new HBA phys to STL if these new phys got added as part
|
||||
* of HBA Firmware upgrade/downgrade operation.
|
||||
*/
|
||||
if (!ioc->sas_hba.phy[i].phy) {
|
||||
if ((mpt3sas_config_get_phy_pg0(ioc, &mpi_reply,
|
||||
&phy_pg0, i))) {
|
||||
ioc_err(ioc, "failure at %s:%d/%s()!\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
continue;
|
||||
}
|
||||
ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
|
||||
MPI2_IOCSTATUS_MASK;
|
||||
if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
|
||||
ioc_err(ioc, "failure at %s:%d/%s()!\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
continue;
|
||||
}
|
||||
ioc->sas_hba.phy[i].phy_id = i;
|
||||
mpt3sas_transport_add_host_phy(ioc,
|
||||
&ioc->sas_hba.phy[i], phy_pg0,
|
||||
ioc->sas_hba.parent_dev);
|
||||
continue;
|
||||
}
|
||||
ioc->sas_hba.phy[i].handle = ioc->sas_hba.handle;
|
||||
attached_handle = le16_to_cpu(sas_iounit_pg0->PhyData[i].
|
||||
AttachedDevHandle);
|
||||
@@ -6622,6 +6661,19 @@ _scsih_sas_host_refresh(struct MPT3SAS_ADAPTER *ioc)
|
||||
attached_handle, i, link_rate,
|
||||
ioc->sas_hba.phy[i].port);
|
||||
}
|
||||
/*
|
||||
* Clear the phy details if this phy got disabled as part of
|
||||
* HBA Firmware upgrade/downgrade operation.
|
||||
*/
|
||||
for (i = ioc->sas_hba.num_phys;
|
||||
i < ioc->sas_hba.nr_phys_allocated; i++) {
|
||||
if (ioc->sas_hba.phy[i].phy &&
|
||||
ioc->sas_hba.phy[i].phy->negotiated_linkrate >=
|
||||
SAS_LINK_RATE_1_5_GBPS)
|
||||
mpt3sas_transport_update_links(ioc,
|
||||
ioc->sas_hba.sas_address, 0, i,
|
||||
MPI2_SAS_NEG_LINK_RATE_PHY_DISABLED, NULL);
|
||||
}
|
||||
out:
|
||||
kfree(sas_iounit_pg0);
|
||||
}
|
||||
@@ -6654,7 +6706,10 @@ _scsih_sas_host_add(struct MPT3SAS_ADAPTER *ioc)
|
||||
__FILE__, __LINE__, __func__);
|
||||
return;
|
||||
}
|
||||
ioc->sas_hba.phy = kcalloc(num_phys,
|
||||
|
||||
ioc->sas_hba.nr_phys_allocated = max_t(u8,
|
||||
MPT_MAX_HBA_NUM_PHYS, num_phys);
|
||||
ioc->sas_hba.phy = kcalloc(ioc->sas_hba.nr_phys_allocated,
|
||||
sizeof(struct _sas_phy), GFP_KERNEL);
|
||||
if (!ioc->sas_hba.phy) {
|
||||
ioc_err(ioc, "failure at %s:%d/%s()!\n",
|
||||
|
||||
@@ -865,7 +865,7 @@ qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
|
||||
"APP request entry - portid=%06x.\n", tdid.b24);
|
||||
|
||||
/* Ran out of space */
|
||||
if (pcnt > app_req.num_ports)
|
||||
if (pcnt >= app_req.num_ports)
|
||||
break;
|
||||
|
||||
if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24)
|
||||
|
||||
@@ -4649,6 +4649,7 @@ static void zbc_rwp_zone(struct sdebug_dev_info *devip,
|
||||
struct sdeb_zone_state *zsp)
|
||||
{
|
||||
enum sdebug_z_cond zc;
|
||||
struct sdeb_store_info *sip = devip2sip(devip, false);
|
||||
|
||||
if (zbc_zone_is_conv(zsp))
|
||||
return;
|
||||
@@ -4660,6 +4661,10 @@ static void zbc_rwp_zone(struct sdebug_dev_info *devip,
|
||||
if (zsp->z_cond == ZC4_CLOSED)
|
||||
devip->nr_closed--;
|
||||
|
||||
if (zsp->z_wp > zsp->z_start)
|
||||
memset(sip->storep + zsp->z_start * sdebug_sector_size, 0,
|
||||
(zsp->z_wp - zsp->z_start) * sdebug_sector_size);
|
||||
|
||||
zsp->z_non_seq_resource = false;
|
||||
zsp->z_wp = zsp->z_start;
|
||||
zsp->z_cond = ZC1_EMPTY;
|
||||
|
||||
@@ -817,7 +817,7 @@ store_state_field(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
mutex_lock(&sdev->state_mutex);
|
||||
if (sdev->sdev_state == SDEV_RUNNING && state == SDEV_RUNNING) {
|
||||
ret = count;
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = scsi_device_set_state(sdev, state);
|
||||
if (ret == 0 && state == SDEV_RUNNING)
|
||||
|
||||
@@ -2607,6 +2607,13 @@ sd_do_mode_sense(struct scsi_disk *sdkp, int dbd, int modepage,
|
||||
unsigned char *buffer, int len, struct scsi_mode_data *data,
|
||||
struct scsi_sense_hdr *sshdr)
|
||||
{
|
||||
/*
|
||||
* If we must use MODE SENSE(10), make sure that the buffer length
|
||||
* is at least 8 bytes so that the mode sense header fits.
|
||||
*/
|
||||
if (sdkp->device->use_10_for_ms && len < 8)
|
||||
len = 8;
|
||||
|
||||
return scsi_mode_sense(sdkp->device, dbd, modepage, buffer, len,
|
||||
SD_TIMEOUT, sdkp->max_retries, data,
|
||||
sshdr);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user