This is the 5.4.262 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmVmGmUACgkQONu9yGCS aT4V7A//YzFdP4ANGVpZ7tBob7OxpgGgvEu32zCDx51LQ8n2uJRJ8WBWW6kVOBUZ YyUEXzjPPaS7JRS1O7TpCGYFWrH0ue9c/xzyvUQyyHEBZvZVj0P3O1iHlAk2FWSG pOTEfW1cFp8vtHwGn82rmIDETu56LMWd+aeVhg6psb2L6ho2LPipCkxN79kbBGSB DLfD71O2Pb3mw8ZYHVC5KKIlfODLqjq9N6T+3VsG4uQCEMHTVAHjjoIvYFeSi1cR MqPXS4/3GUyYUDTe2tjYznkSfPbdARfD1aKKPEXLuq1+q6WqvHCAG7nwgtPT/gd9 JPCxm+9DPN9+YhmEsCJpMSq3pD2eTrD5ZXhYFNc5sOsNw0L4oFRLtrB782snerw+ ogQ8DED4qATn1+x7jfRD7hwMzHih4nAL7zqy32s8knKHfp1+rOOkXfIohfc9qrUI svUjb1B+guuGHwFq6YDzxpUxmhdGqOo262cnU4jfH8lxH+w03vyNxxyQn0ZUUe2I gkvJ5wNpq4QhD/++B/DaCptw0l5AzfjOO+0xlp20xMzn5qW/BS8W26zUXhGeLOAd MHu+fv9DU0mzs3V1MxRvbBQ5gI9TngRWXJSIBCJx5YhZ8gGIhfrzoIzY+IeF6l3F idjruirbfujAQv0vQHuz7JmhHrTG+T90slQ/R8pPud73WGz5BMI= =A+DX -----END PGP SIGNATURE----- Merge 5.4.262 into android11-5.4-lts Changes in 5.4.262 locking/ww_mutex/test: Fix potential workqueue corruption perf/core: Bail out early if the request AUX area is out of bound clocksource/drivers/timer-imx-gpt: Fix potential memory leak clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size wifi: mac80211_hwsim: fix clang-specific fortify warning wifi: mac80211: don't return unset power in ieee80211_get_tx_power() wifi: ath9k: fix clang-specific fortify warnings wifi: ath10k: fix clang-specific fortify warning net: annotate data-races around sk->sk_tx_queue_mapping net: annotate data-races around sk->sk_dst_pending_confirm wifi: ath10k: Don't touch the CE interrupt registers after power up Bluetooth: Fix double free in hci_conn_cleanup platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e drm/komeda: drop all currently held locks if deadlock happens drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL selftests/efivarfs: create-read: fix a resource leak crypto: pcrypt - Fix hungtask for PADATA_RESET RDMA/hfi1: Use FIELD_GET() to extract Link Width fs/jfs: Add check for negative db_l2nbperpage fs/jfs: Add validity check for db_maxag and db_agpref jfs: fix array-index-out-of-bounds in dbFindLeaf jfs: fix array-index-out-of-bounds in diAlloc ARM: 9320/1: fix stack depot IRQ stack filter ALSA: hda: Fix possible null-ptr-deref when assigning a stream PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields atm: iphase: Do PCI error checks on own line scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W tty: vcc: Add check for kstrdup() in vcc_probe() usb: gadget: f_ncm: Always set current gadget in ncm_bind() i2c: sun6i-p2wi: Prevent potential division by zero media: gspca: cpia1: shift-out-of-bounds in set_flicker media: vivid: avoid integer overflow gfs2: ignore negated quota changes media: cobalt: Use FIELD_GET() to extract Link Width drm/amd/display: Avoid NULL dereference of timing generator kgdb: Flush console before entering kgdb on panic ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings pwm: Fix double shift bug wifi: iwlwifi: Use FW rate for non-data frames NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO ipvlan: add ipvlan_route_v6_outbound() helper tty: Fix uninit-value access in ppp_sync_receive() net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() tipc: Fix kernel-infoleak due to uninitialized TLV value ppp: limit MRU to 64K xen/events: fix delayed eoi list handling ptp: annotate data-race around q->head and q->tail bonding: stop the device in bond_setup_by_slave() net: ethernet: cortina: Fix max RX frame define net: ethernet: cortina: Handle large frames net: ethernet: cortina: Fix MTU max setting netfilter: nf_conntrack_bridge: initialize err to 0 net: stmmac: Rework stmmac_rx() net: stmmac: fix rx budget limit check net/mlx5e: fix double free of encap_header net/mlx5_core: Clean driver version and name net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors macvlan: Don't propagate promisc change to lower dev in passthru tools/power/turbostat: Fix a knl bug cifs: spnego: add ';' in HOST_KEY_LEN media: venus: hfi: add checks to perform sanity on queue pointers randstruct: Fix gcc-plugin performance mode to stay in group bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for selected registers x86/cpu/hygon: Fix the CPU topology evaluation for real KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space KVM: x86: Ignore MSR_AMD64_TW_CFG access audit: don't take task_lock() in audit_exe_compare() code path audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() hvc/xen: fix error path in xen_hvc_init() to always register frontend driver PCI/sysfs: Protect driver's D3cold preference from user space ACPI: resource: Do IRQ override on TongFang GMxXGxx mmc: meson-gx: Remove setting of CMD_CFG_ERROR genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware PCI: keystone: Don't discard .remove() callback PCI: keystone: Don't discard .probe() callback parisc/pdc: Add width field to struct pdc_model clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks mmc: vub300: fix an error code PM: hibernate: Use __get_safe_page() rather than touching the list PM: hibernate: Clean up sync_read handling in snapshot_write_next() btrfs: don't arbitrarily slow down delalloc if we're committing jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev quota: explicitly forbid quota files from being encrypted kernel/reboot: emergency_restart: Set correct system_state i2c: core: Run atomic i2c xfer when !preemptible mcb: fix error handling for different scenarios when parsing dmaengine: stm32-mdma: correct desc prep when channel running mm/cma: use nth_page() in place of direct struct page manipulation i3c: master: cdns: Fix reading status register parisc: Prevent booting 64-bit kernels on PA1.x machines parisc/pgtable: Do not drop upper 5 address bits of physical address ALSA: info: Fix potential deadlock at disconnection ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC serial: meson: remove redundant initialization of variable id tty: serial: meson: retrieve port FIFO size from DT serial: meson: Use platform_get_irq() to get the interrupt tty: serial: meson: fix hard LOCKUP on crtscts mode Bluetooth: btusb: Add flag to define wideband speech capability Bluetooth: btusb: add Realtek 8822CE to usb_device_id table Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0cb8:0xc559 bluetooth: Add device 0bda:887b to device tables bluetooth: Add device 13d3:3571 to device tables Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE Revert ncsi: Propagate carrier gain/loss events to the NCSI controller net: dsa: lan9303: consequently nested-lock physical MDIO i2c: i801: fix potential race in i801_block_transaction_byte_by_byte media: lirc: drop trailing space from scancode transmit media: sharp: fix sharp encoding media: venus: hfi_parser: Add check to keep the number of codecs within range media: venus: hfi: fix the check to handle session buffer requirement media: venus: hfi: add checks to handle capabilities from firmware nfsd: fix file memleak on client_opens_release Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E" ext4: apply umask if ACL support is disabled ext4: correct offset of gdb backup in non meta_bg group to update_backups ext4: correct return value of ext4_convert_meta_bg ext4: correct the start block of counting reserved clusters ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks drm/amdgpu: fix error handling in amdgpu_bo_list_get() tracing: Have trace_event_file have ref counters netfilter: nf_tables: pass context to nft_set_destroy() netfilter: nftables: rename set element data activation/deactivation functions netfilter: nf_tables: drop map element references from preparation phase netfilter: nft_set_rbtree: Switch to node list walk for overlap detection netfilter: nft_set_rbtree: fix null deref on element insertion netfilter: nft_set_rbtree: fix overlap expiration walk netfilter: nf_tables: don't skip expired elements during walk netfilter: nf_tables: GC transaction API to avoid race with control plane netfilter: nf_tables: adapt set backend to use GC transaction API netfilter: nft_set_hash: mark set element as dead when deleting from packet path netfilter: nf_tables: remove busy mark and gc batch API netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path netfilter: nf_tables: GC transaction race with netns dismantle netfilter: nf_tables: GC transaction race with abort path netfilter: nf_tables: use correct lock to protect gc_list netfilter: nf_tables: defer gc run if previous batch is still pending netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration netfilter: nf_tables: fix memleak when more than 255 elements expired netfilter: nf_tables: unregister flowtable hooks on netns exit netfilter: nf_tables: double hook unregistration in netns path netfilter: nftables: update table flags from the commit phase netfilter: nf_tables: fix table flag updates netfilter: nf_tables: disable toggling dormant table state more than once netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4) Linux 5.4.262 Change-Id: I93e0070751c904fd8a44800ce1756e6e93c1a95b Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
a3aeec7ab8
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
VERSION = 5
|
VERSION = 5
|
||||||
PATCHLEVEL = 4
|
PATCHLEVEL = 4
|
||||||
SUBLEVEL = 261
|
SUBLEVEL = 262
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = Kleptomaniac Octopus
|
NAME = Kleptomaniac Octopus
|
||||||
|
|
||||||
|
@ -10,10 +10,6 @@
|
|||||||
|
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
|
||||||
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
||||||
#define __exception_irq_entry __irq_entry
|
#define __exception_irq_entry __irq_entry
|
||||||
#else
|
|
||||||
#define __exception_irq_entry
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ASM_ARM_EXCEPTION_H */
|
#endif /* __ASM_ARM_EXCEPTION_H */
|
||||||
|
@ -465,6 +465,7 @@ struct pdc_model { /* for PDC_MODEL */
|
|||||||
unsigned long arch_rev;
|
unsigned long arch_rev;
|
||||||
unsigned long pot_key;
|
unsigned long pot_key;
|
||||||
unsigned long curr_key;
|
unsigned long curr_key;
|
||||||
|
unsigned long width; /* default of PSW_W bit (1=enabled) */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
|
struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
|
||||||
|
@ -511,13 +511,13 @@
|
|||||||
* to a CPU TLB 4k PFN (4k => 12 bits to shift) */
|
* to a CPU TLB 4k PFN (4k => 12 bits to shift) */
|
||||||
#define PAGE_ADD_SHIFT (PAGE_SHIFT-12)
|
#define PAGE_ADD_SHIFT (PAGE_SHIFT-12)
|
||||||
#define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12)
|
#define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12)
|
||||||
|
#define PFN_START_BIT (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT)
|
||||||
|
|
||||||
/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
|
/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
|
||||||
.macro convert_for_tlb_insert20 pte,tmp
|
.macro convert_for_tlb_insert20 pte,tmp
|
||||||
#ifdef CONFIG_HUGETLB_PAGE
|
#ifdef CONFIG_HUGETLB_PAGE
|
||||||
copy \pte,\tmp
|
copy \pte,\tmp
|
||||||
extrd,u \tmp,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
|
extrd,u \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte
|
||||||
64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
|
|
||||||
|
|
||||||
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
|
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
|
||||||
(63-58)+PAGE_ADD_SHIFT,\pte
|
(63-58)+PAGE_ADD_SHIFT,\pte
|
||||||
@ -525,8 +525,7 @@
|
|||||||
depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\
|
depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\
|
||||||
(63-58)+PAGE_ADD_HUGE_SHIFT,\pte
|
(63-58)+PAGE_ADD_HUGE_SHIFT,\pte
|
||||||
#else /* Huge pages disabled */
|
#else /* Huge pages disabled */
|
||||||
extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
|
extrd,u \pte,PFN_START_BIT,PFN_START_BIT+1,\pte
|
||||||
64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
|
|
||||||
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
|
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
|
||||||
(63-58)+PAGE_ADD_SHIFT,\pte
|
(63-58)+PAGE_ADD_SHIFT,\pte
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,9 +69,8 @@ $bss_loop:
|
|||||||
stw,ma %arg2,4(%r1)
|
stw,ma %arg2,4(%r1)
|
||||||
stw,ma %arg3,4(%r1)
|
stw,ma %arg3,4(%r1)
|
||||||
|
|
||||||
#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
|
#if defined(CONFIG_PA20)
|
||||||
/* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
|
/* check for 64-bit capable CPU as required by current kernel */
|
||||||
* and halt kernel if we detect a PA1.x CPU. */
|
|
||||||
ldi 32,%r10
|
ldi 32,%r10
|
||||||
mtctl %r10,%cr11
|
mtctl %r10,%cr11
|
||||||
.level 2.0
|
.level 2.0
|
||||||
|
@ -469,6 +469,7 @@
|
|||||||
#define MSR_AMD64_OSVW_STATUS 0xc0010141
|
#define MSR_AMD64_OSVW_STATUS 0xc0010141
|
||||||
#define MSR_AMD64_LS_CFG 0xc0011020
|
#define MSR_AMD64_LS_CFG 0xc0011020
|
||||||
#define MSR_AMD64_DC_CFG 0xc0011022
|
#define MSR_AMD64_DC_CFG 0xc0011022
|
||||||
|
#define MSR_AMD64_TW_CFG 0xc0011023
|
||||||
|
|
||||||
#define MSR_AMD64_DE_CFG 0xc0011029
|
#define MSR_AMD64_DE_CFG 0xc0011029
|
||||||
#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
|
#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
|
||||||
|
@ -11,13 +11,6 @@
|
|||||||
|
|
||||||
#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
|
#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
|
||||||
|
|
||||||
/*
|
|
||||||
* Too small node sizes may confuse the VM badly. Usually they
|
|
||||||
* result from BIOS bugs. So dont recognize nodes as standalone
|
|
||||||
* NUMA entities that have less than this amount of RAM listed:
|
|
||||||
*/
|
|
||||||
#define NODE_MIN_SIZE (4*1024*1024)
|
|
||||||
|
|
||||||
extern int numa_off;
|
extern int numa_off;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -88,7 +88,11 @@ static void hygon_get_topology(struct cpuinfo_x86 *c)
|
|||||||
if (!err)
|
if (!err)
|
||||||
c->x86_coreid_bits = get_count_order(c->x86_max_cores);
|
c->x86_coreid_bits = get_count_order(c->x86_max_cores);
|
||||||
|
|
||||||
/* Socket ID is ApicId[6] for these processors. */
|
/*
|
||||||
|
* Socket ID is ApicId[6] for the processors with model <= 0x3
|
||||||
|
* when running on host.
|
||||||
|
*/
|
||||||
|
if (!boot_cpu_has(X86_FEATURE_HYPERVISOR) && c->x86_model <= 0x3)
|
||||||
c->phys_proc_id = c->apicid >> APICID_SOCKET_ID_BIT;
|
c->phys_proc_id = c->apicid >> APICID_SOCKET_ID_BIT;
|
||||||
|
|
||||||
cacheinfo_hygon_init_llc_id(c, cpu);
|
cacheinfo_hygon_init_llc_id(c, cpu);
|
||||||
|
@ -555,10 +555,12 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
|
|||||||
|
|
||||||
stimer_cleanup(stimer);
|
stimer_cleanup(stimer);
|
||||||
stimer->count = count;
|
stimer->count = count;
|
||||||
|
if (!host) {
|
||||||
if (stimer->count == 0)
|
if (stimer->count == 0)
|
||||||
stimer->config.enable = 0;
|
stimer->config.enable = 0;
|
||||||
else if (stimer->config.auto_enable)
|
else if (stimer->config.auto_enable)
|
||||||
stimer->config.enable = 1;
|
stimer->config.enable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (stimer->config.enable)
|
if (stimer->config.enable)
|
||||||
stimer_mark_pending(stimer, false);
|
stimer_mark_pending(stimer, false);
|
||||||
|
@ -2720,6 +2720,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
|
|||||||
case MSR_AMD64_PATCH_LOADER:
|
case MSR_AMD64_PATCH_LOADER:
|
||||||
case MSR_AMD64_BU_CFG2:
|
case MSR_AMD64_BU_CFG2:
|
||||||
case MSR_AMD64_DC_CFG:
|
case MSR_AMD64_DC_CFG:
|
||||||
|
case MSR_AMD64_TW_CFG:
|
||||||
case MSR_F15H_EX_CFG:
|
case MSR_F15H_EX_CFG:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3029,6 +3030,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
|
|||||||
case MSR_AMD64_BU_CFG2:
|
case MSR_AMD64_BU_CFG2:
|
||||||
case MSR_IA32_PERF_CTL:
|
case MSR_IA32_PERF_CTL:
|
||||||
case MSR_AMD64_DC_CFG:
|
case MSR_AMD64_DC_CFG:
|
||||||
|
case MSR_AMD64_TW_CFG:
|
||||||
case MSR_F15H_EX_CFG:
|
case MSR_F15H_EX_CFG:
|
||||||
msr_info->data = 0;
|
msr_info->data = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -581,13 +581,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
|
|||||||
if (start >= end)
|
if (start >= end)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
|
||||||
* Don't confuse VM with a node that doesn't have the
|
|
||||||
* minimum amount of memory:
|
|
||||||
*/
|
|
||||||
if (end && (end - start) < NODE_MIN_SIZE)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
alloc_node_data(nid);
|
alloc_node_data(nid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +118,8 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
|
|||||||
err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu);
|
err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu);
|
||||||
if (!err)
|
if (!err)
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
|
if (err == -EBUSY)
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -165,6 +167,8 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
|
|||||||
err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu);
|
err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu);
|
||||||
if (!err)
|
if (!err)
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
|
if (err == -EBUSY)
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -442,6 +442,18 @@ static const struct dmi_system_id asus_laptop[] = {
|
|||||||
DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
|
DMI_MATCH(DMI_BOARD_NAME, "B2402CBA"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
/* TongFang GMxXGxx/TUXEDO Polaris 15 Gen5 AMD */
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
/* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.ident = "Asus ExpertBook B2502",
|
.ident = "Asus ExpertBook B2502",
|
||||||
.matches = {
|
.matches = {
|
||||||
|
@ -2290,19 +2290,21 @@ static int get_esi(struct atm_dev *dev)
|
|||||||
static int reset_sar(struct atm_dev *dev)
|
static int reset_sar(struct atm_dev *dev)
|
||||||
{
|
{
|
||||||
IADEV *iadev;
|
IADEV *iadev;
|
||||||
int i, error = 1;
|
int i, error;
|
||||||
unsigned int pci[64];
|
unsigned int pci[64];
|
||||||
|
|
||||||
iadev = INPH_IA_DEV(dev);
|
iadev = INPH_IA_DEV(dev);
|
||||||
for(i=0; i<64; i++)
|
for (i = 0; i < 64; i++) {
|
||||||
if ((error = pci_read_config_dword(iadev->pci,
|
error = pci_read_config_dword(iadev->pci, i * 4, &pci[i]);
|
||||||
i*4, &pci[i])) != PCIBIOS_SUCCESSFUL)
|
if (error != PCIBIOS_SUCCESSFUL)
|
||||||
return error;
|
return error;
|
||||||
|
}
|
||||||
writel(0, iadev->reg+IPHASE5575_EXT_RESET);
|
writel(0, iadev->reg+IPHASE5575_EXT_RESET);
|
||||||
for(i=0; i<64; i++)
|
for (i = 0; i < 64; i++) {
|
||||||
if ((error = pci_write_config_dword(iadev->pci,
|
error = pci_write_config_dword(iadev->pci, i * 4, pci[i]);
|
||||||
i*4, pci[i])) != PCIBIOS_SUCCESSFUL)
|
if (error != PCIBIOS_SUCCESSFUL)
|
||||||
return error;
|
return error;
|
||||||
|
}
|
||||||
udelay(5);
|
udelay(5);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ static struct usb_driver btusb_driver;
|
|||||||
#define BTUSB_IFNUM_2 0x80000
|
#define BTUSB_IFNUM_2 0x80000
|
||||||
#define BTUSB_CW6622 0x100000
|
#define BTUSB_CW6622 0x100000
|
||||||
#define BTUSB_MEDIATEK 0x200000
|
#define BTUSB_MEDIATEK 0x200000
|
||||||
|
#define BTUSB_WIDEBAND_SPEECH 0x400000
|
||||||
|
|
||||||
static const struct usb_device_id btusb_table[] = {
|
static const struct usb_device_id btusb_table[] = {
|
||||||
/* Generic Bluetooth USB device */
|
/* Generic Bluetooth USB device */
|
||||||
@ -332,20 +333,42 @@ static const struct usb_device_id blacklist_table[] = {
|
|||||||
{ USB_DEVICE(0x1286, 0x204e), .driver_info = BTUSB_MARVELL },
|
{ USB_DEVICE(0x1286, 0x204e), .driver_info = BTUSB_MARVELL },
|
||||||
|
|
||||||
/* Intel Bluetooth devices */
|
/* Intel Bluetooth devices */
|
||||||
{ USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_NEW },
|
{ USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_NEW |
|
||||||
{ USB_DEVICE(0x8087, 0x0026), .driver_info = BTUSB_INTEL_NEW },
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
{ USB_DEVICE(0x8087, 0x0029), .driver_info = BTUSB_INTEL_NEW },
|
{ USB_DEVICE(0x8087, 0x0026), .driver_info = BTUSB_INTEL_NEW |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
{ USB_DEVICE(0x8087, 0x0029), .driver_info = BTUSB_INTEL_NEW |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
{ USB_DEVICE(0x8087, 0x07da), .driver_info = BTUSB_CSR },
|
{ USB_DEVICE(0x8087, 0x07da), .driver_info = BTUSB_CSR },
|
||||||
{ USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL },
|
{ USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL },
|
||||||
{ USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL },
|
{ USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL },
|
||||||
{ USB_DEVICE(0x8087, 0x0a2b), .driver_info = BTUSB_INTEL_NEW },
|
{ USB_DEVICE(0x8087, 0x0a2b), .driver_info = BTUSB_INTEL_NEW |
|
||||||
{ USB_DEVICE(0x8087, 0x0aa7), .driver_info = BTUSB_INTEL },
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
{ USB_DEVICE(0x8087, 0x0aaa), .driver_info = BTUSB_INTEL_NEW },
|
{ USB_DEVICE(0x8087, 0x0aa7), .driver_info = BTUSB_INTEL |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
{ USB_DEVICE(0x8087, 0x0aaa), .driver_info = BTUSB_INTEL_NEW |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
|
||||||
/* Other Intel Bluetooth devices */
|
/* Other Intel Bluetooth devices */
|
||||||
{ USB_VENDOR_AND_INTERFACE_INFO(0x8087, 0xe0, 0x01, 0x01),
|
{ USB_VENDOR_AND_INTERFACE_INFO(0x8087, 0xe0, 0x01, 0x01),
|
||||||
.driver_info = BTUSB_IGNORE },
|
.driver_info = BTUSB_IGNORE },
|
||||||
|
|
||||||
|
/* Realtek 8822CE Bluetooth devices */
|
||||||
|
{ USB_DEVICE(0x0bda, 0xb00c), .driver_info = BTUSB_REALTEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
|
||||||
|
/* Realtek 8852BE Bluetooth devices */
|
||||||
|
{ USB_DEVICE(0x0cb8, 0xc559), .driver_info = BTUSB_REALTEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
{ USB_DEVICE(0x0bda, 0x887b), .driver_info = BTUSB_REALTEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
{ USB_DEVICE(0x0bda, 0xb85b), .driver_info = BTUSB_REALTEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
{ USB_DEVICE(0x13d3, 0x3570), .driver_info = BTUSB_REALTEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
{ USB_DEVICE(0x13d3, 0x3571), .driver_info = BTUSB_REALTEK |
|
||||||
|
BTUSB_WIDEBAND_SPEECH },
|
||||||
|
|
||||||
/* Realtek Bluetooth devices */
|
/* Realtek Bluetooth devices */
|
||||||
{ USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
|
{ USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
|
||||||
.driver_info = BTUSB_REALTEK },
|
.driver_info = BTUSB_REALTEK },
|
||||||
|
@ -423,7 +423,6 @@ static struct clk_fixed_factor gpll0_out_main_div2 = {
|
|||||||
},
|
},
|
||||||
.num_parents = 1,
|
.num_parents = 1,
|
||||||
.ops = &clk_fixed_factor_ops,
|
.ops = &clk_fixed_factor_ops,
|
||||||
.flags = CLK_SET_RATE_PARENT,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -470,7 +469,6 @@ static struct clk_alpha_pll_postdiv gpll2 = {
|
|||||||
},
|
},
|
||||||
.num_parents = 1,
|
.num_parents = 1,
|
||||||
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
||||||
.flags = CLK_SET_RATE_PARENT,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -503,7 +501,6 @@ static struct clk_alpha_pll_postdiv gpll4 = {
|
|||||||
},
|
},
|
||||||
.num_parents = 1,
|
.num_parents = 1,
|
||||||
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
||||||
.flags = CLK_SET_RATE_PARENT,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -537,7 +534,6 @@ static struct clk_alpha_pll_postdiv gpll6 = {
|
|||||||
},
|
},
|
||||||
.num_parents = 1,
|
.num_parents = 1,
|
||||||
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
||||||
.flags = CLK_SET_RATE_PARENT,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -551,7 +547,6 @@ static struct clk_fixed_factor gpll6_out_main_div2 = {
|
|||||||
},
|
},
|
||||||
.num_parents = 1,
|
.num_parents = 1,
|
||||||
.ops = &clk_fixed_factor_ops,
|
.ops = &clk_fixed_factor_ops,
|
||||||
.flags = CLK_SET_RATE_PARENT,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -616,7 +611,6 @@ static struct clk_alpha_pll_postdiv nss_crypto_pll = {
|
|||||||
},
|
},
|
||||||
.num_parents = 1,
|
.num_parents = 1,
|
||||||
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
.ops = &clk_alpha_pll_postdiv_ro_ops,
|
||||||
.flags = CLK_SET_RATE_PARENT,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -310,6 +310,7 @@ static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx)
|
|||||||
writel(mck_divisor_idx /* likely divide-by-8 */
|
writel(mck_divisor_idx /* likely divide-by-8 */
|
||||||
| ATMEL_TC_WAVE
|
| ATMEL_TC_WAVE
|
||||||
| ATMEL_TC_WAVESEL_UP /* free-run */
|
| ATMEL_TC_WAVESEL_UP /* free-run */
|
||||||
|
| ATMEL_TC_ASWTRG_SET /* TIOA0 rises at software trigger */
|
||||||
| ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */
|
| ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */
|
||||||
| ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */
|
| ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */
|
||||||
tcaddr + ATMEL_TC_REG(0, CMR));
|
tcaddr + ATMEL_TC_REG(0, CMR));
|
||||||
|
@ -460,12 +460,16 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
imxtm->base = of_iomap(np, 0);
|
imxtm->base = of_iomap(np, 0);
|
||||||
if (!imxtm->base)
|
if (!imxtm->base) {
|
||||||
return -ENXIO;
|
ret = -ENXIO;
|
||||||
|
goto err_kfree;
|
||||||
|
}
|
||||||
|
|
||||||
imxtm->irq = irq_of_parse_and_map(np, 0);
|
imxtm->irq = irq_of_parse_and_map(np, 0);
|
||||||
if (imxtm->irq <= 0)
|
if (imxtm->irq <= 0) {
|
||||||
return -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto err_kfree;
|
||||||
|
}
|
||||||
|
|
||||||
imxtm->clk_ipg = of_clk_get_by_name(np, "ipg");
|
imxtm->clk_ipg = of_clk_get_by_name(np, "ipg");
|
||||||
|
|
||||||
@ -478,11 +482,15 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
|
|||||||
|
|
||||||
ret = _mxc_timer_init(imxtm);
|
ret = _mxc_timer_init(imxtm);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto err_kfree;
|
||||||
|
|
||||||
initialized = 1;
|
initialized = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_kfree:
|
||||||
|
kfree(imxtm);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init imx1_timer_init_dt(struct device_node *np)
|
static int __init imx1_timer_init_dt(struct device_node *np)
|
||||||
|
@ -510,7 +510,7 @@ static int stm32_mdma_set_xfer_param(struct stm32_mdma_chan *chan,
|
|||||||
src_maxburst = chan->dma_config.src_maxburst;
|
src_maxburst = chan->dma_config.src_maxburst;
|
||||||
dst_maxburst = chan->dma_config.dst_maxburst;
|
dst_maxburst = chan->dma_config.dst_maxburst;
|
||||||
|
|
||||||
ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id));
|
ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & ~STM32_MDMA_CCR_EN;
|
||||||
ctcr = stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id));
|
ctcr = stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id));
|
||||||
ctbr = stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id));
|
ctbr = stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id));
|
||||||
|
|
||||||
@ -938,7 +938,7 @@ stm32_mdma_prep_dma_memcpy(struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
|
|||||||
if (!desc)
|
if (!desc)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id));
|
ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & ~STM32_MDMA_CCR_EN;
|
||||||
ctcr = stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id));
|
ctcr = stm32_mdma_read(dmadev, STM32_MDMA_CTCR(chan->id));
|
||||||
ctbr = stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id));
|
ctbr = stm32_mdma_read(dmadev, STM32_MDMA_CTBR(chan->id));
|
||||||
cbndtr = stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id));
|
cbndtr = stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id));
|
||||||
|
@ -178,6 +178,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
*result = NULL;
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,6 +392,9 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
|
|||||||
ssize_t result = 0;
|
ssize_t result = 0;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (!adev->smc_rreg)
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
if (size & 0x3 || *pos & 0x3)
|
if (size & 0x3 || *pos & 0x3)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -431,6 +434,9 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
|
|||||||
ssize_t result = 0;
|
ssize_t result = 0;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (!adev->smc_wreg)
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
if (size & 0x3 || *pos & 0x3)
|
if (size & 0x3 || *pos & 0x3)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream)
|
|||||||
for (i = 0; i < MAX_PIPES; i++) {
|
for (i = 0; i < MAX_PIPES; i++) {
|
||||||
struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
|
struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
|
||||||
|
|
||||||
if (res_ctx->pipe_ctx[i].stream != stream)
|
if (res_ctx->pipe_ctx[i].stream != stream || !tg)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return tg->funcs->get_frame_count(tg);
|
return tg->funcs->get_frame_count(tg);
|
||||||
@ -551,7 +551,7 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
|
|||||||
for (i = 0; i < MAX_PIPES; i++) {
|
for (i = 0; i < MAX_PIPES; i++) {
|
||||||
struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
|
struct timing_generator *tg = res_ctx->pipe_ctx[i].stream_res.tg;
|
||||||
|
|
||||||
if (res_ctx->pipe_ctx[i].stream != stream)
|
if (res_ctx->pipe_ctx[i].stream != stream || !tg)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
tg->funcs->get_scanoutpos(tg,
|
tg->funcs->get_scanoutpos(tg,
|
||||||
|
@ -78,7 +78,7 @@ typedef struct _ATOM_PPLIB_THERMALCONTROLLER
|
|||||||
typedef struct _ATOM_PPLIB_STATE
|
typedef struct _ATOM_PPLIB_STATE
|
||||||
{
|
{
|
||||||
UCHAR ucNonClockStateIndex;
|
UCHAR ucNonClockStateIndex;
|
||||||
UCHAR ucClockStateIndices[1]; // variable-sized
|
UCHAR ucClockStateIndices[]; // variable-sized
|
||||||
} ATOM_PPLIB_STATE;
|
} ATOM_PPLIB_STATE;
|
||||||
|
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ typedef struct _ATOM_PPLIB_STATE_V2
|
|||||||
/**
|
/**
|
||||||
* Driver will read the first ucNumDPMLevels in this array
|
* Driver will read the first ucNumDPMLevels in this array
|
||||||
*/
|
*/
|
||||||
UCHAR clockInfoIndex[1];
|
UCHAR clockInfoIndex[];
|
||||||
} ATOM_PPLIB_STATE_V2;
|
} ATOM_PPLIB_STATE_V2;
|
||||||
|
|
||||||
typedef struct _StateArray{
|
typedef struct _StateArray{
|
||||||
|
@ -164,7 +164,7 @@ typedef struct _ATOM_Tonga_State {
|
|||||||
typedef struct _ATOM_Tonga_State_Array {
|
typedef struct _ATOM_Tonga_State_Array {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Tonga_State entries[1]; /* Dynamically allocate entries. */
|
ATOM_Tonga_State entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Tonga_State_Array;
|
} ATOM_Tonga_State_Array;
|
||||||
|
|
||||||
typedef struct _ATOM_Tonga_MCLK_Dependency_Record {
|
typedef struct _ATOM_Tonga_MCLK_Dependency_Record {
|
||||||
@ -179,7 +179,7 @@ typedef struct _ATOM_Tonga_MCLK_Dependency_Record {
|
|||||||
typedef struct _ATOM_Tonga_MCLK_Dependency_Table {
|
typedef struct _ATOM_Tonga_MCLK_Dependency_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Tonga_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Tonga_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Tonga_MCLK_Dependency_Table;
|
} ATOM_Tonga_MCLK_Dependency_Table;
|
||||||
|
|
||||||
typedef struct _ATOM_Tonga_SCLK_Dependency_Record {
|
typedef struct _ATOM_Tonga_SCLK_Dependency_Record {
|
||||||
@ -194,7 +194,7 @@ typedef struct _ATOM_Tonga_SCLK_Dependency_Record {
|
|||||||
typedef struct _ATOM_Tonga_SCLK_Dependency_Table {
|
typedef struct _ATOM_Tonga_SCLK_Dependency_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Tonga_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Tonga_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Tonga_SCLK_Dependency_Table;
|
} ATOM_Tonga_SCLK_Dependency_Table;
|
||||||
|
|
||||||
typedef struct _ATOM_Polaris_SCLK_Dependency_Record {
|
typedef struct _ATOM_Polaris_SCLK_Dependency_Record {
|
||||||
@ -210,7 +210,7 @@ typedef struct _ATOM_Polaris_SCLK_Dependency_Record {
|
|||||||
typedef struct _ATOM_Polaris_SCLK_Dependency_Table {
|
typedef struct _ATOM_Polaris_SCLK_Dependency_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Polaris_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Polaris_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Polaris_SCLK_Dependency_Table;
|
} ATOM_Polaris_SCLK_Dependency_Table;
|
||||||
|
|
||||||
typedef struct _ATOM_Tonga_PCIE_Record {
|
typedef struct _ATOM_Tonga_PCIE_Record {
|
||||||
@ -222,7 +222,7 @@ typedef struct _ATOM_Tonga_PCIE_Record {
|
|||||||
typedef struct _ATOM_Tonga_PCIE_Table {
|
typedef struct _ATOM_Tonga_PCIE_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Tonga_PCIE_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Tonga_PCIE_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Tonga_PCIE_Table;
|
} ATOM_Tonga_PCIE_Table;
|
||||||
|
|
||||||
typedef struct _ATOM_Polaris10_PCIE_Record {
|
typedef struct _ATOM_Polaris10_PCIE_Record {
|
||||||
@ -235,7 +235,7 @@ typedef struct _ATOM_Polaris10_PCIE_Record {
|
|||||||
typedef struct _ATOM_Polaris10_PCIE_Table {
|
typedef struct _ATOM_Polaris10_PCIE_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Polaris10_PCIE_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Polaris10_PCIE_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Polaris10_PCIE_Table;
|
} ATOM_Polaris10_PCIE_Table;
|
||||||
|
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ typedef struct _ATOM_Tonga_MM_Dependency_Record {
|
|||||||
typedef struct _ATOM_Tonga_MM_Dependency_Table {
|
typedef struct _ATOM_Tonga_MM_Dependency_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Tonga_MM_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Tonga_MM_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Tonga_MM_Dependency_Table;
|
} ATOM_Tonga_MM_Dependency_Table;
|
||||||
|
|
||||||
typedef struct _ATOM_Tonga_Voltage_Lookup_Record {
|
typedef struct _ATOM_Tonga_Voltage_Lookup_Record {
|
||||||
@ -265,7 +265,7 @@ typedef struct _ATOM_Tonga_Voltage_Lookup_Record {
|
|||||||
typedef struct _ATOM_Tonga_Voltage_Lookup_Table {
|
typedef struct _ATOM_Tonga_Voltage_Lookup_Table {
|
||||||
UCHAR ucRevId;
|
UCHAR ucRevId;
|
||||||
UCHAR ucNumEntries; /* Number of entries. */
|
UCHAR ucNumEntries; /* Number of entries. */
|
||||||
ATOM_Tonga_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries. */
|
ATOM_Tonga_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries. */
|
||||||
} ATOM_Tonga_Voltage_Lookup_Table;
|
} ATOM_Tonga_Voltage_Lookup_Table;
|
||||||
|
|
||||||
typedef struct _ATOM_Tonga_Fan_Table {
|
typedef struct _ATOM_Tonga_Fan_Table {
|
||||||
|
@ -1171,7 +1171,7 @@ int komeda_build_display_data_flow(struct komeda_crtc *kcrtc,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
komeda_pipeline_unbound_components(struct komeda_pipeline *pipe,
|
komeda_pipeline_unbound_components(struct komeda_pipeline *pipe,
|
||||||
struct komeda_pipeline_state *new)
|
struct komeda_pipeline_state *new)
|
||||||
{
|
{
|
||||||
@ -1190,8 +1190,12 @@ komeda_pipeline_unbound_components(struct komeda_pipeline *pipe,
|
|||||||
c = komeda_pipeline_get_component(pipe, id);
|
c = komeda_pipeline_get_component(pipe, id);
|
||||||
c_st = komeda_component_get_state_and_set_user(c,
|
c_st = komeda_component_get_state_and_set_user(c,
|
||||||
drm_st, NULL, new->crtc);
|
drm_st, NULL, new->crtc);
|
||||||
|
if (PTR_ERR(c_st) == -EDEADLK)
|
||||||
|
return -EDEADLK;
|
||||||
WARN_ON(IS_ERR(c_st));
|
WARN_ON(IS_ERR(c_st));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* release unclaimed pipeline resource */
|
/* release unclaimed pipeline resource */
|
||||||
@ -1213,9 +1217,8 @@ int komeda_release_unclaimed_resources(struct komeda_pipeline *pipe,
|
|||||||
if (WARN_ON(IS_ERR_OR_NULL(st)))
|
if (WARN_ON(IS_ERR_OR_NULL(st)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
komeda_pipeline_unbound_components(pipe, st);
|
return komeda_pipeline_unbound_components(pipe, st);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void komeda_pipeline_disable(struct komeda_pipeline *pipe,
|
void komeda_pipeline_disable(struct komeda_pipeline *pipe,
|
||||||
|
@ -350,6 +350,7 @@
|
|||||||
|
|
||||||
#define USB_VENDOR_ID_DELL 0x413c
|
#define USB_VENDOR_ID_DELL 0x413c
|
||||||
#define USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE 0x301a
|
#define USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE 0x301a
|
||||||
|
#define USB_DEVICE_ID_DELL_PRO_WIRELESS_KM5221W 0x4503
|
||||||
|
|
||||||
#define USB_VENDOR_ID_DELORME 0x1163
|
#define USB_VENDOR_ID_DELORME 0x1163
|
||||||
#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
|
#define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100
|
||||||
|
@ -66,6 +66,7 @@ static const struct hid_device_id hid_quirks[] = {
|
|||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_PRO_WIRELESS_KM5221W), HID_QUIRK_ALWAYS_POLL },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC), HID_QUIRK_NOGET },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_2NES2SNES), HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_2NES2SNES), HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_4NES4SNES), HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_4NES4SNES), HID_QUIRK_MULTI_INPUT },
|
||||||
|
@ -723,15 +723,11 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
|
|||||||
return i801_check_post(priv, status);
|
return i801_check_post(priv, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i <= len; i++) {
|
if (len == 1 && read_write == I2C_SMBUS_READ)
|
||||||
if (i == len && read_write == I2C_SMBUS_READ)
|
|
||||||
smbcmd |= SMBHSTCNT_LAST_BYTE;
|
smbcmd |= SMBHSTCNT_LAST_BYTE;
|
||||||
outb_p(smbcmd, SMBHSTCNT(priv));
|
outb_p(smbcmd | SMBHSTCNT_START, SMBHSTCNT(priv));
|
||||||
|
|
||||||
if (i == 1)
|
|
||||||
outb_p(inb(SMBHSTCNT(priv)) | SMBHSTCNT_START,
|
|
||||||
SMBHSTCNT(priv));
|
|
||||||
|
|
||||||
|
for (i = 1; i <= len; i++) {
|
||||||
status = i801_wait_byte_done(priv);
|
status = i801_wait_byte_done(priv);
|
||||||
if (status)
|
if (status)
|
||||||
goto exit;
|
goto exit;
|
||||||
@ -754,9 +750,12 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
|
|||||||
data->block[0] = len;
|
data->block[0] = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retrieve/store value in SMBBLKDAT */
|
if (read_write == I2C_SMBUS_READ) {
|
||||||
if (read_write == I2C_SMBUS_READ)
|
|
||||||
data->block[i] = inb_p(SMBBLKDAT(priv));
|
data->block[i] = inb_p(SMBBLKDAT(priv));
|
||||||
|
if (i == len - 1)
|
||||||
|
outb_p(smbcmd | SMBHSTCNT_LAST_BYTE, SMBHSTCNT(priv));
|
||||||
|
}
|
||||||
|
|
||||||
if (read_write == I2C_SMBUS_WRITE && i+1 <= len)
|
if (read_write == I2C_SMBUS_WRITE && i+1 <= len)
|
||||||
outb_p(data->block[i+1], SMBBLKDAT(priv));
|
outb_p(data->block[i+1], SMBBLKDAT(priv));
|
||||||
|
|
||||||
|
@ -202,6 +202,11 @@ static int p2wi_probe(struct platform_device *pdev)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clk_freq == 0) {
|
||||||
|
dev_err(dev, "clock-frequency is set to 0 in DT\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (of_get_child_count(np) > 1) {
|
if (of_get_child_count(np) > 1) {
|
||||||
dev_err(dev, "P2WI only supports one slave device\n");
|
dev_err(dev, "P2WI only supports one slave device\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -29,7 +29,7 @@ int i2c_dev_irq_from_resources(const struct resource *resources,
|
|||||||
*/
|
*/
|
||||||
static inline bool i2c_in_atomic_xfer_mode(void)
|
static inline bool i2c_in_atomic_xfer_mode(void)
|
||||||
{
|
{
|
||||||
return system_state > SYSTEM_RUNNING && irqs_disabled();
|
return system_state > SYSTEM_RUNNING && !preemptible();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap)
|
static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap)
|
||||||
|
@ -189,7 +189,7 @@
|
|||||||
#define SLV_STATUS1_HJ_DIS BIT(18)
|
#define SLV_STATUS1_HJ_DIS BIT(18)
|
||||||
#define SLV_STATUS1_MR_DIS BIT(17)
|
#define SLV_STATUS1_MR_DIS BIT(17)
|
||||||
#define SLV_STATUS1_PROT_ERR BIT(16)
|
#define SLV_STATUS1_PROT_ERR BIT(16)
|
||||||
#define SLV_STATUS1_DA(x) (((s) & GENMASK(15, 9)) >> 9)
|
#define SLV_STATUS1_DA(s) (((s) & GENMASK(15, 9)) >> 9)
|
||||||
#define SLV_STATUS1_HAS_DA BIT(8)
|
#define SLV_STATUS1_HAS_DA BIT(8)
|
||||||
#define SLV_STATUS1_DDR_RX_FULL BIT(7)
|
#define SLV_STATUS1_DDR_RX_FULL BIT(7)
|
||||||
#define SLV_STATUS1_DDR_TX_FULL BIT(6)
|
#define SLV_STATUS1_DDR_TX_FULL BIT(6)
|
||||||
@ -1580,13 +1580,13 @@ static int cdns_i3c_master_probe(struct platform_device *pdev)
|
|||||||
/* Device ID0 is reserved to describe this master. */
|
/* Device ID0 is reserved to describe this master. */
|
||||||
master->maxdevs = CONF_STATUS0_DEVS_NUM(val);
|
master->maxdevs = CONF_STATUS0_DEVS_NUM(val);
|
||||||
master->free_rr_slots = GENMASK(master->maxdevs, 1);
|
master->free_rr_slots = GENMASK(master->maxdevs, 1);
|
||||||
|
master->caps.ibirfifodepth = CONF_STATUS0_IBIR_DEPTH(val);
|
||||||
|
master->caps.cmdrfifodepth = CONF_STATUS0_CMDR_DEPTH(val);
|
||||||
|
|
||||||
val = readl(master->regs + CONF_STATUS1);
|
val = readl(master->regs + CONF_STATUS1);
|
||||||
master->caps.cmdfifodepth = CONF_STATUS1_CMD_DEPTH(val);
|
master->caps.cmdfifodepth = CONF_STATUS1_CMD_DEPTH(val);
|
||||||
master->caps.rxfifodepth = CONF_STATUS1_RX_DEPTH(val);
|
master->caps.rxfifodepth = CONF_STATUS1_RX_DEPTH(val);
|
||||||
master->caps.txfifodepth = CONF_STATUS1_TX_DEPTH(val);
|
master->caps.txfifodepth = CONF_STATUS1_TX_DEPTH(val);
|
||||||
master->caps.ibirfifodepth = CONF_STATUS0_IBIR_DEPTH(val);
|
|
||||||
master->caps.cmdrfifodepth = CONF_STATUS0_CMDR_DEPTH(val);
|
|
||||||
|
|
||||||
spin_lock_init(&master->ibi.lock);
|
spin_lock_init(&master->ibi.lock);
|
||||||
master->ibi.num_slots = CONF_STATUS1_IBI_HW_RES(val);
|
master->ibi.num_slots = CONF_STATUS1_IBI_HW_RES(val);
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/bitfield.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
@ -261,12 +262,6 @@ static u32 extract_speed(u16 linkstat)
|
|||||||
return speed;
|
return speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return the PCIe link speed from the given link status */
|
|
||||||
static u32 extract_width(u16 linkstat)
|
|
||||||
{
|
|
||||||
return (linkstat & PCI_EXP_LNKSTA_NLW) >> PCI_EXP_LNKSTA_NLW_SHIFT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* read the link status and set dd->{lbus_width,lbus_speed,lbus_info} */
|
/* read the link status and set dd->{lbus_width,lbus_speed,lbus_info} */
|
||||||
static void update_lbus_info(struct hfi1_devdata *dd)
|
static void update_lbus_info(struct hfi1_devdata *dd)
|
||||||
{
|
{
|
||||||
@ -279,7 +274,7 @@ static void update_lbus_info(struct hfi1_devdata *dd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dd->lbus_width = extract_width(linkstat);
|
dd->lbus_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, linkstat);
|
||||||
dd->lbus_speed = extract_speed(linkstat);
|
dd->lbus_speed = extract_speed(linkstat);
|
||||||
snprintf(dd->lbus_info, sizeof(dd->lbus_info),
|
snprintf(dd->lbus_info, sizeof(dd->lbus_info),
|
||||||
"PCIe,%uMHz,x%u", dd->lbus_speed, dd->lbus_width);
|
"PCIe,%uMHz,x%u", dd->lbus_speed, dd->lbus_width);
|
||||||
|
@ -248,6 +248,7 @@ int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
put_device(&dev->dev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
put_device(&mdev->dev);
|
mcb_free_dev(mdev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/bitfield.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <media/i2c/adv7604.h>
|
#include <media/i2c/adv7604.h>
|
||||||
#include <media/i2c/adv7842.h>
|
#include <media/i2c/adv7842.h>
|
||||||
@ -210,17 +211,17 @@ void cobalt_pcie_status_show(struct cobalt *cobalt)
|
|||||||
pcie_capability_read_word(pci_dev, PCI_EXP_LNKSTA, &stat);
|
pcie_capability_read_word(pci_dev, PCI_EXP_LNKSTA, &stat);
|
||||||
cobalt_info("PCIe link capability 0x%08x: %s per lane and %u lanes\n",
|
cobalt_info("PCIe link capability 0x%08x: %s per lane and %u lanes\n",
|
||||||
capa, get_link_speed(capa),
|
capa, get_link_speed(capa),
|
||||||
(capa & PCI_EXP_LNKCAP_MLW) >> 4);
|
FIELD_GET(PCI_EXP_LNKCAP_MLW, capa));
|
||||||
cobalt_info("PCIe link control 0x%04x\n", ctrl);
|
cobalt_info("PCIe link control 0x%04x\n", ctrl);
|
||||||
cobalt_info("PCIe link status 0x%04x: %s per lane and %u lanes\n",
|
cobalt_info("PCIe link status 0x%04x: %s per lane and %u lanes\n",
|
||||||
stat, get_link_speed(stat),
|
stat, get_link_speed(stat),
|
||||||
(stat & PCI_EXP_LNKSTA_NLW) >> 4);
|
FIELD_GET(PCI_EXP_LNKSTA_NLW, stat));
|
||||||
|
|
||||||
/* Bus */
|
/* Bus */
|
||||||
pcie_capability_read_dword(pci_bus_dev, PCI_EXP_LNKCAP, &capa);
|
pcie_capability_read_dword(pci_bus_dev, PCI_EXP_LNKCAP, &capa);
|
||||||
cobalt_info("PCIe bus link capability 0x%08x: %s per lane and %u lanes\n",
|
cobalt_info("PCIe bus link capability 0x%08x: %s per lane and %u lanes\n",
|
||||||
capa, get_link_speed(capa),
|
capa, get_link_speed(capa),
|
||||||
(capa & PCI_EXP_LNKCAP_MLW) >> 4);
|
FIELD_GET(PCI_EXP_LNKCAP_MLW, capa));
|
||||||
|
|
||||||
/* Slot */
|
/* Slot */
|
||||||
pcie_capability_read_dword(pci_dev, PCI_EXP_SLTCAP, &capa);
|
pcie_capability_read_dword(pci_dev, PCI_EXP_SLTCAP, &capa);
|
||||||
@ -239,7 +240,7 @@ static unsigned pcie_link_get_lanes(struct cobalt *cobalt)
|
|||||||
if (!pci_is_pcie(pci_dev))
|
if (!pci_is_pcie(pci_dev))
|
||||||
return 0;
|
return 0;
|
||||||
pcie_capability_read_word(pci_dev, PCI_EXP_LNKSTA, &link);
|
pcie_capability_read_word(pci_dev, PCI_EXP_LNKSTA, &link);
|
||||||
return (link & PCI_EXP_LNKSTA_NLW) >> 4;
|
return FIELD_GET(PCI_EXP_LNKSTA_NLW, link);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned pcie_bus_link_get_lanes(struct cobalt *cobalt)
|
static unsigned pcie_bus_link_get_lanes(struct cobalt *cobalt)
|
||||||
@ -250,7 +251,7 @@ static unsigned pcie_bus_link_get_lanes(struct cobalt *cobalt)
|
|||||||
if (!pci_is_pcie(pci_dev))
|
if (!pci_is_pcie(pci_dev))
|
||||||
return 0;
|
return 0;
|
||||||
pcie_capability_read_dword(pci_dev, PCI_EXP_LNKCAP, &link);
|
pcie_capability_read_dword(pci_dev, PCI_EXP_LNKCAP, &link);
|
||||||
return (link & PCI_EXP_LNKCAP_MLW) >> 4;
|
return FIELD_GET(PCI_EXP_LNKCAP_MLW, link);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void msi_config_show(struct cobalt *cobalt, struct pci_dev *pci_dev)
|
static void msi_config_show(struct cobalt *cobalt, struct pci_dev *pci_dev)
|
||||||
|
@ -350,7 +350,7 @@ session_get_prop_buf_req(struct hfi_msg_session_property_info_pkt *pkt,
|
|||||||
memcpy(&bufreq[idx], buf_req, sizeof(*bufreq));
|
memcpy(&bufreq[idx], buf_req, sizeof(*bufreq));
|
||||||
idx++;
|
idx++;
|
||||||
|
|
||||||
if (idx > HFI_BUFFER_TYPE_MAX)
|
if (idx >= HFI_BUFFER_TYPE_MAX)
|
||||||
return HFI_ERR_SESSION_INVALID_PARAMETER;
|
return HFI_ERR_SESSION_INVALID_PARAMETER;
|
||||||
|
|
||||||
req_bytes -= sizeof(struct hfi_buffer_requirements);
|
req_bytes -= sizeof(struct hfi_buffer_requirements);
|
||||||
|
@ -19,6 +19,9 @@ static void init_codecs(struct venus_core *core)
|
|||||||
struct venus_caps *caps = core->caps, *cap;
|
struct venus_caps *caps = core->caps, *cap;
|
||||||
unsigned long bit;
|
unsigned long bit;
|
||||||
|
|
||||||
|
if (hweight_long(core->dec_codecs) + hweight_long(core->enc_codecs) > MAX_CODEC_NUM)
|
||||||
|
return;
|
||||||
|
|
||||||
for_each_set_bit(bit, &core->dec_codecs, MAX_CODEC_NUM) {
|
for_each_set_bit(bit, &core->dec_codecs, MAX_CODEC_NUM) {
|
||||||
cap = &caps[core->codecs_count++];
|
cap = &caps[core->codecs_count++];
|
||||||
cap->codec = BIT(bit);
|
cap->codec = BIT(bit);
|
||||||
@ -86,6 +89,9 @@ static void fill_profile_level(struct venus_caps *cap, const void *data,
|
|||||||
{
|
{
|
||||||
const struct hfi_profile_level *pl = data;
|
const struct hfi_profile_level *pl = data;
|
||||||
|
|
||||||
|
if (cap->num_pl + num >= HFI_MAX_PROFILE_COUNT)
|
||||||
|
return;
|
||||||
|
|
||||||
memcpy(&cap->pl[cap->num_pl], pl, num * sizeof(*pl));
|
memcpy(&cap->pl[cap->num_pl], pl, num * sizeof(*pl));
|
||||||
cap->num_pl += num;
|
cap->num_pl += num;
|
||||||
}
|
}
|
||||||
@ -111,6 +117,9 @@ fill_caps(struct venus_caps *cap, const void *data, unsigned int num)
|
|||||||
{
|
{
|
||||||
const struct hfi_capability *caps = data;
|
const struct hfi_capability *caps = data;
|
||||||
|
|
||||||
|
if (cap->num_caps + num >= MAX_CAP_ENTRIES)
|
||||||
|
return;
|
||||||
|
|
||||||
memcpy(&cap->caps[cap->num_caps], caps, num * sizeof(*caps));
|
memcpy(&cap->caps[cap->num_caps], caps, num * sizeof(*caps));
|
||||||
cap->num_caps += num;
|
cap->num_caps += num;
|
||||||
}
|
}
|
||||||
@ -137,6 +146,9 @@ static void fill_raw_fmts(struct venus_caps *cap, const void *fmts,
|
|||||||
{
|
{
|
||||||
const struct raw_formats *formats = fmts;
|
const struct raw_formats *formats = fmts;
|
||||||
|
|
||||||
|
if (cap->num_fmts + num_fmts >= MAX_FMT_ENTRIES)
|
||||||
|
return;
|
||||||
|
|
||||||
memcpy(&cap->fmts[cap->num_fmts], formats, num_fmts * sizeof(*formats));
|
memcpy(&cap->fmts[cap->num_fmts], formats, num_fmts * sizeof(*formats));
|
||||||
cap->num_fmts += num_fmts;
|
cap->num_fmts += num_fmts;
|
||||||
}
|
}
|
||||||
@ -159,6 +171,9 @@ parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data)
|
|||||||
rawfmts[i].buftype = fmt->buffer_type;
|
rawfmts[i].buftype = fmt->buffer_type;
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
if (i >= MAX_FMT_ENTRIES)
|
||||||
|
return;
|
||||||
|
|
||||||
if (pinfo->num_planes > MAX_PLANES)
|
if (pinfo->num_planes > MAX_PLANES)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -206,6 +206,11 @@ static int venus_write_queue(struct venus_hfi_device *hdev,
|
|||||||
|
|
||||||
new_wr_idx = wr_idx + dwords;
|
new_wr_idx = wr_idx + dwords;
|
||||||
wr_ptr = (u32 *)(queue->qmem.kva + (wr_idx << 2));
|
wr_ptr = (u32 *)(queue->qmem.kva + (wr_idx << 2));
|
||||||
|
|
||||||
|
if (wr_ptr < (u32 *)queue->qmem.kva ||
|
||||||
|
wr_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size - sizeof(*wr_ptr)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (new_wr_idx < qsize) {
|
if (new_wr_idx < qsize) {
|
||||||
memcpy(wr_ptr, packet, dwords << 2);
|
memcpy(wr_ptr, packet, dwords << 2);
|
||||||
} else {
|
} else {
|
||||||
@ -273,6 +278,11 @@ static int venus_read_queue(struct venus_hfi_device *hdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
rd_ptr = (u32 *)(queue->qmem.kva + (rd_idx << 2));
|
rd_ptr = (u32 *)(queue->qmem.kva + (rd_idx << 2));
|
||||||
|
|
||||||
|
if (rd_ptr < (u32 *)queue->qmem.kva ||
|
||||||
|
rd_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size - sizeof(*rd_ptr)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
dwords = *rd_ptr >> 2;
|
dwords = *rd_ptr >> 2;
|
||||||
if (!dwords)
|
if (!dwords)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -145,7 +145,7 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
|
|||||||
rds->ta = alt;
|
rds->ta = alt;
|
||||||
rds->ms = true;
|
rds->ms = true;
|
||||||
snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
|
snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
|
||||||
freq / 16, ((freq & 0xf) * 10) / 16);
|
(freq / 16) % 1000000, (((freq & 0xf) * 10) / 16) % 10);
|
||||||
if (alt)
|
if (alt)
|
||||||
strscpy(rds->radiotext,
|
strscpy(rds->radiotext,
|
||||||
" The Radio Data System can switch between different Radio Texts ",
|
" The Radio Data System can switch between different Radio Texts ",
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
#define SHARP_UNIT 40000 /* ns */
|
#define SHARP_UNIT 40000 /* ns */
|
||||||
#define SHARP_BIT_PULSE (8 * SHARP_UNIT) /* 320us */
|
#define SHARP_BIT_PULSE (8 * SHARP_UNIT) /* 320us */
|
||||||
#define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT) /* 1ms (680us space) */
|
#define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT) /* 1ms (680us space) */
|
||||||
#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680ms space) */
|
#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680us space) */
|
||||||
|
#define SHARP_BIT_0_SPACE (17 * SHARP_UNIT) /* 680us space */
|
||||||
|
#define SHARP_BIT_1_SPACE (42 * SHARP_UNIT) /* 1680us space */
|
||||||
#define SHARP_ECHO_SPACE (1000 * SHARP_UNIT) /* 40 ms */
|
#define SHARP_ECHO_SPACE (1000 * SHARP_UNIT) /* 40 ms */
|
||||||
#define SHARP_TRAILER_SPACE (125 * SHARP_UNIT) /* 5 ms (even longer) */
|
#define SHARP_TRAILER_SPACE (125 * SHARP_UNIT) /* 5 ms (even longer) */
|
||||||
|
|
||||||
@ -168,8 +170,8 @@ static const struct ir_raw_timings_pd ir_sharp_timings = {
|
|||||||
.header_pulse = 0,
|
.header_pulse = 0,
|
||||||
.header_space = 0,
|
.header_space = 0,
|
||||||
.bit_pulse = SHARP_BIT_PULSE,
|
.bit_pulse = SHARP_BIT_PULSE,
|
||||||
.bit_space[0] = SHARP_BIT_0_PERIOD,
|
.bit_space[0] = SHARP_BIT_0_SPACE,
|
||||||
.bit_space[1] = SHARP_BIT_1_PERIOD,
|
.bit_space[1] = SHARP_BIT_1_SPACE,
|
||||||
.trailer_pulse = SHARP_BIT_PULSE,
|
.trailer_pulse = SHARP_BIT_PULSE,
|
||||||
.trailer_space = SHARP_ECHO_SPACE,
|
.trailer_space = SHARP_ECHO_SPACE,
|
||||||
.msb_first = 1,
|
.msb_first = 1,
|
||||||
|
@ -292,6 +292,10 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_kfree_raw;
|
goto out_kfree_raw;
|
||||||
|
|
||||||
|
/* drop trailing space */
|
||||||
|
if (!(ret % 2))
|
||||||
|
count = ret - 1;
|
||||||
|
else
|
||||||
count = ret;
|
count = ret;
|
||||||
|
|
||||||
txbuf = kmalloc_array(count, sizeof(unsigned int), GFP_KERNEL);
|
txbuf = kmalloc_array(count, sizeof(unsigned int), GFP_KERNEL);
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/sched/signal.h>
|
#include <linux/sched/signal.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
#include "gspca.h"
|
#include "gspca.h"
|
||||||
|
|
||||||
@ -1027,6 +1028,8 @@ static int set_flicker(struct gspca_dev *gspca_dev, int on, int apply)
|
|||||||
sd->params.exposure.expMode = 2;
|
sd->params.exposure.expMode = 2;
|
||||||
sd->exposure_status = EXPOSURE_NORMAL;
|
sd->exposure_status = EXPOSURE_NORMAL;
|
||||||
}
|
}
|
||||||
|
if (sd->params.exposure.gain >= BITS_PER_TYPE(currentexp))
|
||||||
|
return -EINVAL;
|
||||||
currentexp = currentexp << sd->params.exposure.gain;
|
currentexp = currentexp << sd->params.exposure.gain;
|
||||||
sd->params.exposure.gain = 0;
|
sd->params.exposure.gain = 0;
|
||||||
/* round down current exposure to nearest value */
|
/* round down current exposure to nearest value */
|
||||||
|
@ -803,7 +803,6 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
|
|||||||
|
|
||||||
cmd_cfg |= FIELD_PREP(CMD_CFG_CMD_INDEX_MASK, cmd->opcode);
|
cmd_cfg |= FIELD_PREP(CMD_CFG_CMD_INDEX_MASK, cmd->opcode);
|
||||||
cmd_cfg |= CMD_CFG_OWNER; /* owned by CPU */
|
cmd_cfg |= CMD_CFG_OWNER; /* owned by CPU */
|
||||||
cmd_cfg |= CMD_CFG_ERROR; /* stop in case of error */
|
|
||||||
|
|
||||||
meson_mmc_set_response_bits(cmd, &cmd_cfg);
|
meson_mmc_set_response_bits(cmd, &cmd_cfg);
|
||||||
|
|
||||||
|
@ -2318,6 +2318,7 @@ static int vub300_probe(struct usb_interface *interface,
|
|||||||
vub300->read_only =
|
vub300->read_only =
|
||||||
(0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
|
(0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
|
retval = -EINVAL;
|
||||||
goto error5;
|
goto error5;
|
||||||
}
|
}
|
||||||
usb_set_intfdata(interface, vub300);
|
usb_set_intfdata(interface, vub300);
|
||||||
|
@ -1144,6 +1144,10 @@ static void bond_compute_features(struct bonding *bond)
|
|||||||
static void bond_setup_by_slave(struct net_device *bond_dev,
|
static void bond_setup_by_slave(struct net_device *bond_dev,
|
||||||
struct net_device *slave_dev)
|
struct net_device *slave_dev)
|
||||||
{
|
{
|
||||||
|
bool was_up = !!(bond_dev->flags & IFF_UP);
|
||||||
|
|
||||||
|
dev_close(bond_dev);
|
||||||
|
|
||||||
bond_dev->header_ops = slave_dev->header_ops;
|
bond_dev->header_ops = slave_dev->header_ops;
|
||||||
|
|
||||||
bond_dev->type = slave_dev->type;
|
bond_dev->type = slave_dev->type;
|
||||||
@ -1158,6 +1162,8 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
|
|||||||
bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
|
bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST);
|
||||||
bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
|
bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP);
|
||||||
}
|
}
|
||||||
|
if (was_up)
|
||||||
|
dev_open(bond_dev, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On bonding slaves other than the currently active slave, suppress
|
/* On bonding slaves other than the currently active slave, suppress
|
||||||
|
@ -32,7 +32,7 @@ static int lan9303_mdio_write(void *ctx, uint32_t reg, uint32_t val)
|
|||||||
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
|
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
|
||||||
|
|
||||||
reg <<= 2; /* reg num to offset */
|
reg <<= 2; /* reg num to offset */
|
||||||
mutex_lock(&sw_dev->device->bus->mdio_lock);
|
mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||||
lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff);
|
lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff);
|
||||||
lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff);
|
lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff);
|
||||||
mutex_unlock(&sw_dev->device->bus->mdio_lock);
|
mutex_unlock(&sw_dev->device->bus->mdio_lock);
|
||||||
@ -50,7 +50,7 @@ static int lan9303_mdio_read(void *ctx, uint32_t reg, uint32_t *val)
|
|||||||
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
|
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
|
||||||
|
|
||||||
reg <<= 2; /* reg num to offset */
|
reg <<= 2; /* reg num to offset */
|
||||||
mutex_lock(&sw_dev->device->bus->mdio_lock);
|
mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||||
*val = lan9303_mdio_real_read(sw_dev->device, reg);
|
*val = lan9303_mdio_real_read(sw_dev->device, reg);
|
||||||
*val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16);
|
*val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16);
|
||||||
mutex_unlock(&sw_dev->device->bus->mdio_lock);
|
mutex_unlock(&sw_dev->device->bus->mdio_lock);
|
||||||
|
@ -432,8 +432,8 @@ static const struct gmac_max_framelen gmac_maxlens[] = {
|
|||||||
.val = CONFIG0_MAXLEN_1536,
|
.val = CONFIG0_MAXLEN_1536,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.max_l3_len = 1542,
|
.max_l3_len = 1548,
|
||||||
.val = CONFIG0_MAXLEN_1542,
|
.val = CONFIG0_MAXLEN_1548,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.max_l3_len = 9212,
|
.max_l3_len = 9212,
|
||||||
@ -1152,6 +1152,7 @@ static int gmac_map_tx_bufs(struct net_device *netdev, struct sk_buff *skb,
|
|||||||
dma_addr_t mapping;
|
dma_addr_t mapping;
|
||||||
unsigned short mtu;
|
unsigned short mtu;
|
||||||
void *buffer;
|
void *buffer;
|
||||||
|
int ret;
|
||||||
|
|
||||||
mtu = ETH_HLEN;
|
mtu = ETH_HLEN;
|
||||||
mtu += netdev->mtu;
|
mtu += netdev->mtu;
|
||||||
@ -1166,9 +1167,30 @@ static int gmac_map_tx_bufs(struct net_device *netdev, struct sk_buff *skb,
|
|||||||
word3 |= mtu;
|
word3 |= mtu;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skb->ip_summed != CHECKSUM_NONE) {
|
if (skb->len >= ETH_FRAME_LEN) {
|
||||||
|
/* Hardware offloaded checksumming isn't working on frames
|
||||||
|
* bigger than 1514 bytes. A hypothesis about this is that the
|
||||||
|
* checksum buffer is only 1518 bytes, so when the frames get
|
||||||
|
* bigger they get truncated, or the last few bytes get
|
||||||
|
* overwritten by the FCS.
|
||||||
|
*
|
||||||
|
* Just use software checksumming and bypass on bigger frames.
|
||||||
|
*/
|
||||||
|
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||||
|
ret = skb_checksum_help(skb);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
word1 |= TSS_BYPASS_BIT;
|
||||||
|
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||||
int tcp = 0;
|
int tcp = 0;
|
||||||
|
|
||||||
|
/* We do not switch off the checksumming on non TCP/UDP
|
||||||
|
* frames: as is shown from tests, the checksumming engine
|
||||||
|
* is smart enough to see that a frame is not actually TCP
|
||||||
|
* or UDP and then just pass it through without any changes
|
||||||
|
* to the frame.
|
||||||
|
*/
|
||||||
if (skb->protocol == htons(ETH_P_IP)) {
|
if (skb->protocol == htons(ETH_P_IP)) {
|
||||||
word1 |= TSS_IP_CHKSUM_BIT;
|
word1 |= TSS_IP_CHKSUM_BIT;
|
||||||
tcp = ip_hdr(skb)->protocol == IPPROTO_TCP;
|
tcp = ip_hdr(skb)->protocol == IPPROTO_TCP;
|
||||||
@ -1993,15 +2015,6 @@ static int gmac_change_mtu(struct net_device *netdev, int new_mtu)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static netdev_features_t gmac_fix_features(struct net_device *netdev,
|
|
||||||
netdev_features_t features)
|
|
||||||
{
|
|
||||||
if (netdev->mtu + ETH_HLEN + VLAN_HLEN > MTU_SIZE_BIT_MASK)
|
|
||||||
features &= ~GMAC_OFFLOAD_FEATURES;
|
|
||||||
|
|
||||||
return features;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int gmac_set_features(struct net_device *netdev,
|
static int gmac_set_features(struct net_device *netdev,
|
||||||
netdev_features_t features)
|
netdev_features_t features)
|
||||||
{
|
{
|
||||||
@ -2222,7 +2235,6 @@ static const struct net_device_ops gmac_351x_ops = {
|
|||||||
.ndo_set_mac_address = gmac_set_mac_address,
|
.ndo_set_mac_address = gmac_set_mac_address,
|
||||||
.ndo_get_stats64 = gmac_get_stats64,
|
.ndo_get_stats64 = gmac_get_stats64,
|
||||||
.ndo_change_mtu = gmac_change_mtu,
|
.ndo_change_mtu = gmac_change_mtu,
|
||||||
.ndo_fix_features = gmac_fix_features,
|
|
||||||
.ndo_set_features = gmac_set_features,
|
.ndo_set_features = gmac_set_features,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2476,11 +2488,12 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
netdev->hw_features = GMAC_OFFLOAD_FEATURES;
|
netdev->hw_features = GMAC_OFFLOAD_FEATURES;
|
||||||
netdev->features |= GMAC_OFFLOAD_FEATURES | NETIF_F_GRO;
|
netdev->features |= GMAC_OFFLOAD_FEATURES | NETIF_F_GRO;
|
||||||
/* We can handle jumbo frames up to 10236 bytes so, let's accept
|
/* We can receive jumbo frames up to 10236 bytes but only
|
||||||
* payloads of 10236 bytes minus VLAN and ethernet header
|
* transmit 2047 bytes so, let's accept payloads of 2047
|
||||||
|
* bytes minus VLAN and ethernet header
|
||||||
*/
|
*/
|
||||||
netdev->min_mtu = ETH_MIN_MTU;
|
netdev->min_mtu = ETH_MIN_MTU;
|
||||||
netdev->max_mtu = 10236 - VLAN_ETH_HLEN;
|
netdev->max_mtu = MTU_SIZE_BIT_MASK - VLAN_ETH_HLEN;
|
||||||
|
|
||||||
port->freeq_refill = 0;
|
port->freeq_refill = 0;
|
||||||
netif_napi_add(netdev, &port->napi, gmac_napi_poll,
|
netif_napi_add(netdev, &port->napi, gmac_napi_poll,
|
||||||
|
@ -502,7 +502,7 @@ union gmac_txdesc_3 {
|
|||||||
#define SOF_BIT 0x80000000
|
#define SOF_BIT 0x80000000
|
||||||
#define EOF_BIT 0x40000000
|
#define EOF_BIT 0x40000000
|
||||||
#define EOFIE_BIT BIT(29)
|
#define EOFIE_BIT BIT(29)
|
||||||
#define MTU_SIZE_BIT_MASK 0x1fff
|
#define MTU_SIZE_BIT_MASK 0x7ff /* Max MTU 2047 bytes */
|
||||||
|
|
||||||
/* GMAC Tx Descriptor */
|
/* GMAC Tx Descriptor */
|
||||||
struct gmac_txdesc {
|
struct gmac_txdesc {
|
||||||
@ -787,7 +787,7 @@ union gmac_config0 {
|
|||||||
#define CONFIG0_MAXLEN_1536 0
|
#define CONFIG0_MAXLEN_1536 0
|
||||||
#define CONFIG0_MAXLEN_1518 1
|
#define CONFIG0_MAXLEN_1518 1
|
||||||
#define CONFIG0_MAXLEN_1522 2
|
#define CONFIG0_MAXLEN_1522 2
|
||||||
#define CONFIG0_MAXLEN_1542 3
|
#define CONFIG0_MAXLEN_1548 3
|
||||||
#define CONFIG0_MAXLEN_9k 4 /* 9212 */
|
#define CONFIG0_MAXLEN_9k 4 /* 9212 */
|
||||||
#define CONFIG0_MAXLEN_10k 5 /* 10236 */
|
#define CONFIG0_MAXLEN_10k 5 /* 10236 */
|
||||||
#define CONFIG0_MAXLEN_1518__6 6
|
#define CONFIG0_MAXLEN_1518__6 6
|
||||||
|
@ -3773,7 +3773,7 @@ static int hns3_init_mac_addr(struct net_device *netdev, bool init)
|
|||||||
{
|
{
|
||||||
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
||||||
struct hnae3_handle *h = priv->ae_handle;
|
struct hnae3_handle *h = priv->ae_handle;
|
||||||
u8 mac_addr_temp[ETH_ALEN];
|
u8 mac_addr_temp[ETH_ALEN] = {0};
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (h->ae_algo->ops->get_mac_addr && init) {
|
if (h->ae_algo->ops->get_mac_addr && init) {
|
||||||
|
@ -55,7 +55,7 @@ mlx5_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,
|
|||||||
u32 running_fw, stored_fw;
|
u32 running_fw, stored_fw;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = devlink_info_driver_name_put(req, DRIVER_NAME);
|
err = devlink_info_driver_name_put(req, KBUILD_MODNAME);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
@ -290,9 +290,6 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
|
|||||||
if (err)
|
if (err)
|
||||||
goto destroy_neigh_entry;
|
goto destroy_neigh_entry;
|
||||||
|
|
||||||
e->encap_size = ipv4_encap_size;
|
|
||||||
e->encap_header = encap_header;
|
|
||||||
|
|
||||||
if (!(nud_state & NUD_VALID)) {
|
if (!(nud_state & NUD_VALID)) {
|
||||||
neigh_event_send(n, NULL);
|
neigh_event_send(n, NULL);
|
||||||
/* the encap entry will be made valid on neigh update event
|
/* the encap entry will be made valid on neigh update event
|
||||||
@ -309,6 +306,8 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
|
|||||||
goto destroy_neigh_entry;
|
goto destroy_neigh_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e->encap_size = ipv4_encap_size;
|
||||||
|
e->encap_header = encap_header;
|
||||||
e->flags |= MLX5_ENCAP_ENTRY_VALID;
|
e->flags |= MLX5_ENCAP_ENTRY_VALID;
|
||||||
mlx5e_rep_queue_neigh_stats_work(netdev_priv(out_dev));
|
mlx5e_rep_queue_neigh_stats_work(netdev_priv(out_dev));
|
||||||
neigh_release(n);
|
neigh_release(n);
|
||||||
@ -408,9 +407,6 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
|
|||||||
if (err)
|
if (err)
|
||||||
goto destroy_neigh_entry;
|
goto destroy_neigh_entry;
|
||||||
|
|
||||||
e->encap_size = ipv6_encap_size;
|
|
||||||
e->encap_header = encap_header;
|
|
||||||
|
|
||||||
if (!(nud_state & NUD_VALID)) {
|
if (!(nud_state & NUD_VALID)) {
|
||||||
neigh_event_send(n, NULL);
|
neigh_event_send(n, NULL);
|
||||||
/* the encap entry will be made valid on neigh update event
|
/* the encap entry will be made valid on neigh update event
|
||||||
@ -428,6 +424,8 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
|
|||||||
goto destroy_neigh_entry;
|
goto destroy_neigh_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e->encap_size = ipv6_encap_size;
|
||||||
|
e->encap_header = encap_header;
|
||||||
e->flags |= MLX5_ENCAP_ENTRY_VALID;
|
e->flags |= MLX5_ENCAP_ENTRY_VALID;
|
||||||
mlx5e_rep_queue_neigh_stats_work(netdev_priv(out_dev));
|
mlx5e_rep_queue_neigh_stats_work(netdev_priv(out_dev));
|
||||||
neigh_release(n);
|
neigh_release(n);
|
||||||
|
@ -40,9 +40,7 @@ void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
|
|||||||
{
|
{
|
||||||
struct mlx5_core_dev *mdev = priv->mdev;
|
struct mlx5_core_dev *mdev = priv->mdev;
|
||||||
|
|
||||||
strlcpy(drvinfo->driver, DRIVER_NAME, sizeof(drvinfo->driver));
|
strlcpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
|
||||||
strlcpy(drvinfo->version, DRIVER_VERSION,
|
|
||||||
sizeof(drvinfo->version));
|
|
||||||
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
|
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
|
||||||
"%d.%d.%04d (%.16s)",
|
"%d.%d.%04d (%.16s)",
|
||||||
fw_rev_maj(mdev), fw_rev_min(mdev), fw_rev_sub(mdev),
|
fw_rev_maj(mdev), fw_rev_min(mdev), fw_rev_sub(mdev),
|
||||||
|
@ -71,14 +71,17 @@ static void mlx5e_rep_get_drvinfo(struct net_device *dev,
|
|||||||
{
|
{
|
||||||
struct mlx5e_priv *priv = netdev_priv(dev);
|
struct mlx5e_priv *priv = netdev_priv(dev);
|
||||||
struct mlx5_core_dev *mdev = priv->mdev;
|
struct mlx5_core_dev *mdev = priv->mdev;
|
||||||
|
int count;
|
||||||
|
|
||||||
strlcpy(drvinfo->driver, mlx5e_rep_driver_name,
|
strlcpy(drvinfo->driver, mlx5e_rep_driver_name,
|
||||||
sizeof(drvinfo->driver));
|
sizeof(drvinfo->driver));
|
||||||
strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
|
count = snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
|
||||||
|
"%d.%d.%04d (%.16s)", fw_rev_maj(mdev),
|
||||||
|
fw_rev_min(mdev), fw_rev_sub(mdev), mdev->board_id);
|
||||||
|
if (count == sizeof(drvinfo->fw_version))
|
||||||
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
|
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
|
||||||
"%d.%d.%04d (%.16s)",
|
"%d.%d.%04d", fw_rev_maj(mdev),
|
||||||
fw_rev_maj(mdev), fw_rev_min(mdev),
|
fw_rev_min(mdev), fw_rev_sub(mdev));
|
||||||
fw_rev_sub(mdev), mdev->board_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mlx5e_uplink_rep_get_drvinfo(struct net_device *dev,
|
static void mlx5e_uplink_rep_get_drvinfo(struct net_device *dev,
|
||||||
|
@ -39,7 +39,7 @@ static void mlx5i_get_drvinfo(struct net_device *dev,
|
|||||||
struct mlx5e_priv *priv = mlx5i_epriv(dev);
|
struct mlx5e_priv *priv = mlx5i_epriv(dev);
|
||||||
|
|
||||||
mlx5e_ethtool_get_drvinfo(priv, drvinfo);
|
mlx5e_ethtool_get_drvinfo(priv, drvinfo);
|
||||||
strlcpy(drvinfo->driver, DRIVER_NAME "[ib_ipoib]",
|
strlcpy(drvinfo->driver, KBUILD_MODNAME "[ib_ipoib]",
|
||||||
sizeof(drvinfo->driver));
|
sizeof(drvinfo->driver));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,6 @@
|
|||||||
MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>");
|
MODULE_AUTHOR("Eli Cohen <eli@mellanox.com>");
|
||||||
MODULE_DESCRIPTION("Mellanox 5th generation network adapters (ConnectX series) core driver");
|
MODULE_DESCRIPTION("Mellanox 5th generation network adapters (ConnectX series) core driver");
|
||||||
MODULE_LICENSE("Dual BSD/GPL");
|
MODULE_LICENSE("Dual BSD/GPL");
|
||||||
MODULE_VERSION(DRIVER_VERSION);
|
|
||||||
|
|
||||||
unsigned int mlx5_core_debug_mask;
|
unsigned int mlx5_core_debug_mask;
|
||||||
module_param_named(debug_mask, mlx5_core_debug_mask, uint, 0644);
|
module_param_named(debug_mask, mlx5_core_debug_mask, uint, 0644);
|
||||||
@ -222,7 +221,7 @@ static void mlx5_set_driver_version(struct mlx5_core_dev *dev)
|
|||||||
strncat(string, ",", remaining_size);
|
strncat(string, ",", remaining_size);
|
||||||
|
|
||||||
remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
|
remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
|
||||||
strncat(string, DRIVER_NAME, remaining_size);
|
strncat(string, KBUILD_MODNAME, remaining_size);
|
||||||
|
|
||||||
remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
|
remaining_size = max_t(int, 0, driver_ver_sz - strlen(string));
|
||||||
strncat(string, ",", remaining_size);
|
strncat(string, ",", remaining_size);
|
||||||
@ -307,7 +306,7 @@ static int request_bar(struct pci_dev *pdev)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pci_request_regions(pdev, DRIVER_NAME);
|
err = pci_request_regions(pdev, KBUILD_MODNAME);
|
||||||
if (err)
|
if (err)
|
||||||
dev_err(&pdev->dev, "Couldn't get PCI resources, aborting\n");
|
dev_err(&pdev->dev, "Couldn't get PCI resources, aborting\n");
|
||||||
|
|
||||||
@ -1618,7 +1617,7 @@ void mlx5_recover_device(struct mlx5_core_dev *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct pci_driver mlx5_core_driver = {
|
static struct pci_driver mlx5_core_driver = {
|
||||||
.name = DRIVER_NAME,
|
.name = KBUILD_MODNAME,
|
||||||
.id_table = mlx5_core_pci_table,
|
.id_table = mlx5_core_pci_table,
|
||||||
.probe = init_one,
|
.probe = init_one,
|
||||||
.remove = remove_one,
|
.remove = remove_one,
|
||||||
@ -1644,6 +1643,9 @@ static int __init mlx5_init(void)
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
WARN_ONCE(strcmp(MLX5_ADEV_NAME, KBUILD_MODNAME),
|
||||||
|
"mlx5_core name not in sync with kernel module name");
|
||||||
|
|
||||||
get_random_bytes(&sw_owner_id, sizeof(sw_owner_id));
|
get_random_bytes(&sw_owner_id, sizeof(sw_owner_id));
|
||||||
|
|
||||||
mlx5_core_verify_params();
|
mlx5_core_verify_params();
|
||||||
|
@ -43,9 +43,6 @@
|
|||||||
#include <linux/mlx5/fs.h>
|
#include <linux/mlx5/fs.h>
|
||||||
#include <linux/mlx5/driver.h>
|
#include <linux/mlx5/driver.h>
|
||||||
|
|
||||||
#define DRIVER_NAME "mlx5_core"
|
|
||||||
#define DRIVER_VERSION "5.0-0"
|
|
||||||
|
|
||||||
extern uint mlx5_core_debug_mask;
|
extern uint mlx5_core_debug_mask;
|
||||||
|
|
||||||
#define mlx5_core_dbg(__dev, format, ...) \
|
#define mlx5_core_dbg(__dev, format, ...) \
|
||||||
|
@ -4292,9 +4292,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
|
|||||||
rx_mode &= ~AcceptMulticast;
|
rx_mode &= ~AcceptMulticast;
|
||||||
} else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
|
} else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
|
||||||
dev->flags & IFF_ALLMULTI ||
|
dev->flags & IFF_ALLMULTI ||
|
||||||
tp->mac_version == RTL_GIGA_MAC_VER_35 ||
|
tp->mac_version == RTL_GIGA_MAC_VER_35) {
|
||||||
tp->mac_version == RTL_GIGA_MAC_VER_46 ||
|
|
||||||
tp->mac_version == RTL_GIGA_MAC_VER_48) {
|
|
||||||
/* accept all multicasts */
|
/* accept all multicasts */
|
||||||
} else if (netdev_mc_empty(dev)) {
|
} else if (netdev_mc_empty(dev)) {
|
||||||
rx_mode &= ~AcceptMulticast;
|
rx_mode &= ~AcceptMulticast;
|
||||||
|
@ -3440,6 +3440,55 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
|
|||||||
stmmac_set_rx_tail_ptr(priv, priv->ioaddr, rx_q->rx_tail_addr, queue);
|
stmmac_set_rx_tail_ptr(priv, priv->ioaddr, rx_q->rx_tail_addr, queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned int stmmac_rx_buf1_len(struct stmmac_priv *priv,
|
||||||
|
struct dma_desc *p,
|
||||||
|
int status, unsigned int len)
|
||||||
|
{
|
||||||
|
int ret, coe = priv->hw->rx_csum;
|
||||||
|
unsigned int plen = 0, hlen = 0;
|
||||||
|
|
||||||
|
/* Not first descriptor, buffer is always zero */
|
||||||
|
if (priv->sph && len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* First descriptor, get split header length */
|
||||||
|
ret = stmmac_get_rx_header_len(priv, p, &hlen);
|
||||||
|
if (priv->sph && hlen) {
|
||||||
|
priv->xstats.rx_split_hdr_pkt_n++;
|
||||||
|
return hlen;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* First descriptor, not last descriptor and not split header */
|
||||||
|
if (status & rx_not_ls)
|
||||||
|
return priv->dma_buf_sz;
|
||||||
|
|
||||||
|
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
||||||
|
|
||||||
|
/* First descriptor and last descriptor and not split header */
|
||||||
|
return min_t(unsigned int, priv->dma_buf_sz, plen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
|
||||||
|
struct dma_desc *p,
|
||||||
|
int status, unsigned int len)
|
||||||
|
{
|
||||||
|
int coe = priv->hw->rx_csum;
|
||||||
|
unsigned int plen = 0;
|
||||||
|
|
||||||
|
/* Not split header, buffer is not available */
|
||||||
|
if (!priv->sph)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* Not last descriptor */
|
||||||
|
if (status & rx_not_ls)
|
||||||
|
return priv->dma_buf_sz;
|
||||||
|
|
||||||
|
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
||||||
|
|
||||||
|
/* Last descriptor */
|
||||||
|
return plen - len;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stmmac_rx - manage the receive process
|
* stmmac_rx - manage the receive process
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
@ -3469,11 +3518,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
stmmac_display_ring(priv, rx_head, DMA_RX_SIZE, true);
|
stmmac_display_ring(priv, rx_head, DMA_RX_SIZE, true);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
unsigned int hlen = 0, prev_len = 0;
|
unsigned int buf1_len = 0, buf2_len = 0;
|
||||||
enum pkt_hash_types hash_type;
|
enum pkt_hash_types hash_type;
|
||||||
struct stmmac_rx_buffer *buf;
|
struct stmmac_rx_buffer *buf;
|
||||||
struct dma_desc *np, *p;
|
struct dma_desc *np, *p;
|
||||||
unsigned int sec_len;
|
|
||||||
int entry;
|
int entry;
|
||||||
u32 hash;
|
u32 hash;
|
||||||
|
|
||||||
@ -3488,11 +3536,12 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
read_again:
|
||||||
if (count >= limit)
|
if (count >= limit)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
read_again:
|
buf1_len = 0;
|
||||||
sec_len = 0;
|
buf2_len = 0;
|
||||||
entry = next_entry;
|
entry = next_entry;
|
||||||
buf = &rx_q->buf_pool[entry];
|
buf = &rx_q->buf_pool[entry];
|
||||||
|
|
||||||
@ -3517,7 +3566,6 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
np = rx_q->dma_rx + next_entry;
|
np = rx_q->dma_rx + next_entry;
|
||||||
|
|
||||||
prefetch(np);
|
prefetch(np);
|
||||||
prefetch(page_address(buf->page));
|
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
stmmac_rx_extended_status(priv, &priv->dev->stats,
|
stmmac_rx_extended_status(priv, &priv->dev->stats,
|
||||||
@ -3534,17 +3582,21 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
goto read_again;
|
goto read_again;
|
||||||
if (unlikely(error)) {
|
if (unlikely(error)) {
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
|
skb = NULL;
|
||||||
count++;
|
count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Buffer is good. Go on. */
|
/* Buffer is good. Go on. */
|
||||||
|
|
||||||
if (likely(status & rx_not_ls)) {
|
prefetch(page_address(buf->page));
|
||||||
len += priv->dma_buf_sz;
|
if (buf->sec_page)
|
||||||
} else {
|
prefetch(page_address(buf->sec_page));
|
||||||
prev_len = len;
|
|
||||||
len = stmmac_get_rx_frame_len(priv, p, coe);
|
buf1_len = stmmac_rx_buf1_len(priv, p, status, len);
|
||||||
|
len += buf1_len;
|
||||||
|
buf2_len = stmmac_rx_buf2_len(priv, p, status, len);
|
||||||
|
len += buf2_len;
|
||||||
|
|
||||||
/* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
|
/* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
|
||||||
* Type frames (LLC/LLC-SNAP)
|
* Type frames (LLC/LLC-SNAP)
|
||||||
@ -3554,49 +3606,37 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
* stripped manually.
|
* stripped manually.
|
||||||
*/
|
*/
|
||||||
if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
|
if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
|
||||||
unlikely(status != llc_snap))
|
unlikely(status != llc_snap)) {
|
||||||
|
if (buf2_len)
|
||||||
|
buf2_len -= ETH_FCS_LEN;
|
||||||
|
else
|
||||||
|
buf1_len -= ETH_FCS_LEN;
|
||||||
|
|
||||||
len -= ETH_FCS_LEN;
|
len -= ETH_FCS_LEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
int ret = stmmac_get_rx_header_len(priv, p, &hlen);
|
skb = napi_alloc_skb(&ch->rx_napi, buf1_len);
|
||||||
|
|
||||||
if (priv->sph && !ret && (hlen > 0)) {
|
|
||||||
sec_len = len;
|
|
||||||
if (!(status & rx_not_ls))
|
|
||||||
sec_len = sec_len - hlen;
|
|
||||||
len = hlen;
|
|
||||||
|
|
||||||
prefetch(page_address(buf->sec_page));
|
|
||||||
priv->xstats.rx_split_hdr_pkt_n++;
|
|
||||||
}
|
|
||||||
|
|
||||||
skb = napi_alloc_skb(&ch->rx_napi, len);
|
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
priv->dev->stats.rx_dropped++;
|
priv->dev->stats.rx_dropped++;
|
||||||
count++;
|
count++;
|
||||||
continue;
|
goto drain_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
dma_sync_single_for_cpu(priv->device, buf->addr, len,
|
dma_sync_single_for_cpu(priv->device, buf->addr,
|
||||||
DMA_FROM_DEVICE);
|
buf1_len, DMA_FROM_DEVICE);
|
||||||
skb_copy_to_linear_data(skb, page_address(buf->page),
|
skb_copy_to_linear_data(skb, page_address(buf->page),
|
||||||
len);
|
buf1_len);
|
||||||
skb_put(skb, len);
|
skb_put(skb, buf1_len);
|
||||||
|
|
||||||
/* Data payload copied into SKB, page ready for recycle */
|
/* Data payload copied into SKB, page ready for recycle */
|
||||||
page_pool_recycle_direct(rx_q->page_pool, buf->page);
|
page_pool_recycle_direct(rx_q->page_pool, buf->page);
|
||||||
buf->page = NULL;
|
buf->page = NULL;
|
||||||
} else {
|
} else if (buf1_len) {
|
||||||
unsigned int buf_len = len - prev_len;
|
|
||||||
|
|
||||||
if (likely(status & rx_not_ls))
|
|
||||||
buf_len = priv->dma_buf_sz;
|
|
||||||
|
|
||||||
dma_sync_single_for_cpu(priv->device, buf->addr,
|
dma_sync_single_for_cpu(priv->device, buf->addr,
|
||||||
buf_len, DMA_FROM_DEVICE);
|
buf1_len, DMA_FROM_DEVICE);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->page, 0, buf_len,
|
buf->page, 0, buf1_len,
|
||||||
priv->dma_buf_sz);
|
priv->dma_buf_sz);
|
||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
@ -3604,22 +3644,23 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
buf->page = NULL;
|
buf->page = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sec_len > 0) {
|
if (buf2_len) {
|
||||||
dma_sync_single_for_cpu(priv->device, buf->sec_addr,
|
dma_sync_single_for_cpu(priv->device, buf->sec_addr,
|
||||||
sec_len, DMA_FROM_DEVICE);
|
buf2_len, DMA_FROM_DEVICE);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->sec_page, 0, sec_len,
|
buf->sec_page, 0, buf2_len,
|
||||||
priv->dma_buf_sz);
|
priv->dma_buf_sz);
|
||||||
|
|
||||||
len += sec_len;
|
|
||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
||||||
buf->sec_page = NULL;
|
buf->sec_page = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drain_data:
|
||||||
if (likely(status & rx_not_ls))
|
if (likely(status & rx_not_ls))
|
||||||
goto read_again;
|
goto read_again;
|
||||||
|
if (!skb)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Got entire packet into SKB. Finish it. */
|
/* Got entire packet into SKB. Finish it. */
|
||||||
|
|
||||||
@ -3637,13 +3678,14 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
|||||||
|
|
||||||
skb_record_rx_queue(skb, queue);
|
skb_record_rx_queue(skb, queue);
|
||||||
napi_gro_receive(&ch->rx_napi, skb);
|
napi_gro_receive(&ch->rx_napi, skb);
|
||||||
|
skb = NULL;
|
||||||
|
|
||||||
priv->dev->stats.rx_packets++;
|
priv->dev->stats.rx_packets++;
|
||||||
priv->dev->stats.rx_bytes += len;
|
priv->dev->stats.rx_bytes += len;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status & rx_not_ls) {
|
if (status & rx_not_ls || skb) {
|
||||||
rx_q->state_saved = true;
|
rx_q->state_saved = true;
|
||||||
rx_q->state.skb = skb;
|
rx_q->state.skb = skb;
|
||||||
rx_q->state.error = error;
|
rx_q->state.error = error;
|
||||||
|
@ -412,7 +412,7 @@ struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port, void *lyr3h,
|
|||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ipvlan_process_v4_outbound(struct sk_buff *skb)
|
static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
const struct iphdr *ip4h = ip_hdr(skb);
|
const struct iphdr *ip4h = ip_hdr(skb);
|
||||||
struct net_device *dev = skb->dev;
|
struct net_device *dev = skb->dev;
|
||||||
@ -454,13 +454,11 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_IPV6)
|
#if IS_ENABLED(CONFIG_IPV6)
|
||||||
static int ipvlan_process_v6_outbound(struct sk_buff *skb)
|
|
||||||
|
static noinline_for_stack int
|
||||||
|
ipvlan_route_v6_outbound(struct net_device *dev, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||||
struct net_device *dev = skb->dev;
|
|
||||||
struct net *net = dev_net(dev);
|
|
||||||
struct dst_entry *dst;
|
|
||||||
int err, ret = NET_XMIT_DROP;
|
|
||||||
struct flowi6 fl6 = {
|
struct flowi6 fl6 = {
|
||||||
.flowi6_oif = dev->ifindex,
|
.flowi6_oif = dev->ifindex,
|
||||||
.daddr = ip6h->daddr,
|
.daddr = ip6h->daddr,
|
||||||
@ -470,27 +468,38 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
|
|||||||
.flowi6_mark = skb->mark,
|
.flowi6_mark = skb->mark,
|
||||||
.flowi6_proto = ip6h->nexthdr,
|
.flowi6_proto = ip6h->nexthdr,
|
||||||
};
|
};
|
||||||
|
struct dst_entry *dst;
|
||||||
|
int err;
|
||||||
|
|
||||||
dst = ip6_route_output(net, NULL, &fl6);
|
dst = ip6_route_output(dev_net(dev), NULL, &fl6);
|
||||||
if (dst->error) {
|
err = dst->error;
|
||||||
ret = dst->error;
|
if (err) {
|
||||||
dst_release(dst);
|
dst_release(dst);
|
||||||
goto err;
|
return err;
|
||||||
}
|
}
|
||||||
skb_dst_set(skb, dst);
|
skb_dst_set(skb, dst);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ipvlan_process_v6_outbound(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
struct net_device *dev = skb->dev;
|
||||||
|
int err, ret = NET_XMIT_DROP;
|
||||||
|
|
||||||
|
err = ipvlan_route_v6_outbound(dev, skb);
|
||||||
|
if (unlikely(err)) {
|
||||||
|
dev->stats.tx_errors++;
|
||||||
|
kfree_skb(skb);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
|
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
|
||||||
|
|
||||||
err = ip6_local_out(net, skb->sk, skb);
|
err = ip6_local_out(dev_net(dev), skb->sk, skb);
|
||||||
if (unlikely(net_xmit_eval(err)))
|
if (unlikely(net_xmit_eval(err)))
|
||||||
dev->stats.tx_errors++;
|
dev->stats.tx_errors++;
|
||||||
else
|
else
|
||||||
ret = NET_XMIT_SUCCESS;
|
ret = NET_XMIT_SUCCESS;
|
||||||
goto out;
|
|
||||||
err:
|
|
||||||
dev->stats.tx_errors++;
|
|
||||||
kfree_skb(skb);
|
|
||||||
out:
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -765,7 +765,7 @@ static void macvlan_change_rx_flags(struct net_device *dev, int change)
|
|||||||
if (dev->flags & IFF_UP) {
|
if (dev->flags & IFF_UP) {
|
||||||
if (change & IFF_ALLMULTI)
|
if (change & IFF_ALLMULTI)
|
||||||
dev_set_allmulti(lowerdev, dev->flags & IFF_ALLMULTI ? 1 : -1);
|
dev_set_allmulti(lowerdev, dev->flags & IFF_ALLMULTI ? 1 : -1);
|
||||||
if (change & IFF_PROMISC)
|
if (!macvlan_passthru(vlan->port) && change & IFF_PROMISC)
|
||||||
dev_set_promiscuity(lowerdev,
|
dev_set_promiscuity(lowerdev,
|
||||||
dev->flags & IFF_PROMISC ? 1 : -1);
|
dev->flags & IFF_PROMISC ? 1 : -1);
|
||||||
|
|
||||||
|
@ -463,6 +463,10 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
|
|||||||
case PPPIOCSMRU:
|
case PPPIOCSMRU:
|
||||||
if (get_user(val, (int __user *) argp))
|
if (get_user(val, (int __user *) argp))
|
||||||
break;
|
break;
|
||||||
|
if (val > U16_MAX) {
|
||||||
|
err = -EINVAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (val < PPP_MRU)
|
if (val < PPP_MRU)
|
||||||
val = PPP_MRU;
|
val = PPP_MRU;
|
||||||
ap->mru = val;
|
ap->mru = val;
|
||||||
@ -698,7 +702,7 @@ ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
|
|||||||
|
|
||||||
/* strip address/control field if present */
|
/* strip address/control field if present */
|
||||||
p = skb->data;
|
p = skb->data;
|
||||||
if (p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) {
|
if (skb->len >= 2 && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) {
|
||||||
/* chop off address/control */
|
/* chop off address/control */
|
||||||
if (skb->len < 3)
|
if (skb->len < 3)
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -1138,7 +1138,7 @@ void ath10k_debug_get_et_strings(struct ieee80211_hw *hw,
|
|||||||
u32 sset, u8 *data)
|
u32 sset, u8 *data)
|
||||||
{
|
{
|
||||||
if (sset == ETH_SS_STATS)
|
if (sset == ETH_SS_STATS)
|
||||||
memcpy(data, *ath10k_gstrings_stats,
|
memcpy(data, ath10k_gstrings_stats,
|
||||||
sizeof(ath10k_gstrings_stats));
|
sizeof(ath10k_gstrings_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -821,12 +821,20 @@ static void ath10k_snoc_hif_get_default_pipe(struct ath10k *ar,
|
|||||||
|
|
||||||
static inline void ath10k_snoc_irq_disable(struct ath10k *ar)
|
static inline void ath10k_snoc_irq_disable(struct ath10k *ar)
|
||||||
{
|
{
|
||||||
ath10k_ce_disable_interrupts(ar);
|
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
|
||||||
|
int id;
|
||||||
|
|
||||||
|
for (id = 0; id < CE_COUNT_MAX; id++)
|
||||||
|
disable_irq(ar_snoc->ce_irqs[id].irq_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ath10k_snoc_irq_enable(struct ath10k *ar)
|
static inline void ath10k_snoc_irq_enable(struct ath10k *ar)
|
||||||
{
|
{
|
||||||
ath10k_ce_enable_interrupts(ar);
|
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
|
||||||
|
int id;
|
||||||
|
|
||||||
|
for (id = 0; id < CE_COUNT_MAX; id++)
|
||||||
|
enable_irq(ar_snoc->ce_irqs[id].irq_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ath10k_snoc_rx_pipe_cleanup(struct ath10k_snoc_pipe *snoc_pipe)
|
static void ath10k_snoc_rx_pipe_cleanup(struct ath10k_snoc_pipe *snoc_pipe)
|
||||||
@ -1042,6 +1050,8 @@ static int ath10k_snoc_hif_power_up(struct ath10k *ar,
|
|||||||
goto err_free_rri;
|
goto err_free_rri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ath10k_ce_enable_interrupts(ar);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_free_rri:
|
err_free_rri:
|
||||||
@ -1196,8 +1206,8 @@ static int ath10k_snoc_request_irq(struct ath10k *ar)
|
|||||||
|
|
||||||
for (id = 0; id < CE_COUNT_MAX; id++) {
|
for (id = 0; id < CE_COUNT_MAX; id++) {
|
||||||
ret = request_irq(ar_snoc->ce_irqs[id].irq_line,
|
ret = request_irq(ar_snoc->ce_irqs[id].irq_line,
|
||||||
ath10k_snoc_per_engine_handler, 0,
|
ath10k_snoc_per_engine_handler,
|
||||||
ce_name[id], ar);
|
IRQF_NO_AUTOEN, ce_name[id], ar);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ath10k_err(ar,
|
ath10k_err(ar,
|
||||||
"failed to register IRQ handler for CE %d: %d",
|
"failed to register IRQ handler for CE %d: %d",
|
||||||
|
@ -1284,7 +1284,7 @@ void ath9k_get_et_strings(struct ieee80211_hw *hw,
|
|||||||
u32 sset, u8 *data)
|
u32 sset, u8 *data)
|
||||||
{
|
{
|
||||||
if (sset == ETH_SS_STATS)
|
if (sset == ETH_SS_STATS)
|
||||||
memcpy(data, *ath9k_gstrings_stats,
|
memcpy(data, ath9k_gstrings_stats,
|
||||||
sizeof(ath9k_gstrings_stats));
|
sizeof(ath9k_gstrings_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
|
|||||||
u32 sset, u8 *data)
|
u32 sset, u8 *data)
|
||||||
{
|
{
|
||||||
if (sset == ETH_SS_STATS)
|
if (sset == ETH_SS_STATS)
|
||||||
memcpy(data, *ath9k_htc_gstrings_stats,
|
memcpy(data, ath9k_htc_gstrings_stats,
|
||||||
sizeof(ath9k_htc_gstrings_stats));
|
sizeof(ath9k_htc_gstrings_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,16 +529,20 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
|
|||||||
flags |= IWL_TX_FLAGS_ENCRYPT_DIS;
|
flags |= IWL_TX_FLAGS_ENCRYPT_DIS;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For data packets rate info comes from the fw. Only
|
* For data and mgmt packets rate info comes from the fw. Only
|
||||||
* set rate/antenna during connection establishment or in case
|
* set rate/antenna for injected frames with fixed rate, or
|
||||||
* no station is given.
|
* when no sta is given.
|
||||||
*/
|
*/
|
||||||
if (!sta || !ieee80211_is_data(hdr->frame_control) ||
|
if (unlikely(!sta ||
|
||||||
mvmsta->sta_state < IEEE80211_STA_AUTHORIZED) {
|
info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT)) {
|
||||||
flags |= IWL_TX_FLAGS_CMD_RATE;
|
flags |= IWL_TX_FLAGS_CMD_RATE;
|
||||||
rate_n_flags =
|
rate_n_flags =
|
||||||
iwl_mvm_get_tx_rate_n_flags(mvm, info, sta,
|
iwl_mvm_get_tx_rate_n_flags(mvm, info, sta,
|
||||||
hdr->frame_control);
|
hdr->frame_control);
|
||||||
|
} else if (!ieee80211_is_data(hdr->frame_control) ||
|
||||||
|
mvmsta->sta_state < IEEE80211_STA_AUTHORIZED) {
|
||||||
|
/* These are important frames */
|
||||||
|
flags |= IWL_TX_FLAGS_HIGH_PRI;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mvm->trans->trans_cfg->device_family >=
|
if (mvm->trans->trans_cfg->device_family >=
|
||||||
|
@ -2450,7 +2450,7 @@ static void mac80211_hwsim_get_et_strings(struct ieee80211_hw *hw,
|
|||||||
u32 sset, u8 *data)
|
u32 sset, u8 *data)
|
||||||
{
|
{
|
||||||
if (sset == ETH_SS_STATS)
|
if (sset == ETH_SS_STATS)
|
||||||
memcpy(data, *mac80211_hwsim_gstrings_stats,
|
memcpy(data, mac80211_hwsim_gstrings_stats,
|
||||||
sizeof(mac80211_hwsim_gstrings_stats));
|
sizeof(mac80211_hwsim_gstrings_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1181,7 +1181,7 @@ static const struct of_device_id ks_pcie_of_match[] = {
|
|||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init ks_pcie_probe(struct platform_device *pdev)
|
static int ks_pcie_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
const struct dw_pcie_host_ops *host_ops;
|
const struct dw_pcie_host_ops *host_ops;
|
||||||
const struct dw_pcie_ep_ops *ep_ops;
|
const struct dw_pcie_ep_ops *ep_ops;
|
||||||
@ -1407,7 +1407,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __exit ks_pcie_remove(struct platform_device *pdev)
|
static int ks_pcie_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct keystone_pcie *ks_pcie = platform_get_drvdata(pdev);
|
struct keystone_pcie *ks_pcie = platform_get_drvdata(pdev);
|
||||||
struct device_link **link = ks_pcie->link;
|
struct device_link **link = ks_pcie->link;
|
||||||
@ -1423,9 +1423,9 @@ static int __exit ks_pcie_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver ks_pcie_driver __refdata = {
|
static struct platform_driver ks_pcie_driver = {
|
||||||
.probe = ks_pcie_probe,
|
.probe = ks_pcie_probe,
|
||||||
.remove = __exit_p(ks_pcie_remove),
|
.remove = ks_pcie_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "keystone-pcie",
|
.name = "keystone-pcie",
|
||||||
.of_match_table = of_match_ptr(ks_pcie_of_match),
|
.of_match_table = of_match_ptr(ks_pcie_of_match),
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
* Author: Vidya Sagar <vidyas@nvidia.com>
|
* Author: Vidya Sagar <vidyas@nvidia.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/bitfield.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
@ -321,8 +322,7 @@ static void apply_bad_link_workaround(struct pcie_port *pp)
|
|||||||
*/
|
*/
|
||||||
val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA);
|
val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA);
|
||||||
if (val & PCI_EXP_LNKSTA_LBMS) {
|
if (val & PCI_EXP_LNKSTA_LBMS) {
|
||||||
current_link_width = (val & PCI_EXP_LNKSTA_NLW) >>
|
current_link_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, val);
|
||||||
PCI_EXP_LNKSTA_NLW_SHIFT;
|
|
||||||
if (pcie->init_link_width > current_link_width) {
|
if (pcie->init_link_width > current_link_width) {
|
||||||
dev_warn(pci->dev, "PCIe link is bad, width reduced\n");
|
dev_warn(pci->dev, "PCIe link is bad, width reduced\n");
|
||||||
val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base +
|
val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base +
|
||||||
@ -596,8 +596,7 @@ static void tegra_pcie_enable_system_interrupts(struct pcie_port *pp)
|
|||||||
|
|
||||||
val_w = dw_pcie_readw_dbi(&pcie->pci, pcie->pcie_cap_base +
|
val_w = dw_pcie_readw_dbi(&pcie->pci, pcie->pcie_cap_base +
|
||||||
PCI_EXP_LNKSTA);
|
PCI_EXP_LNKSTA);
|
||||||
pcie->init_link_width = (val_w & PCI_EXP_LNKSTA_NLW) >>
|
pcie->init_link_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, val_w);
|
||||||
PCI_EXP_LNKSTA_NLW_SHIFT;
|
|
||||||
|
|
||||||
val_w = dw_pcie_readw_dbi(&pcie->pci, pcie->pcie_cap_base +
|
val_w = dw_pcie_readw_dbi(&pcie->pci, pcie->pcie_cap_base +
|
||||||
PCI_EXP_LNKCTL);
|
PCI_EXP_LNKCTL);
|
||||||
@ -773,7 +772,7 @@ static void tegra_pcie_prepare_host(struct pcie_port *pp)
|
|||||||
/* Configure Max lane width from DT */
|
/* Configure Max lane width from DT */
|
||||||
val = dw_pcie_readl_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKCAP);
|
val = dw_pcie_readl_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKCAP);
|
||||||
val &= ~PCI_EXP_LNKCAP_MLW;
|
val &= ~PCI_EXP_LNKCAP_MLW;
|
||||||
val |= (pcie->num_lanes << PCI_EXP_LNKSTA_NLW_SHIFT);
|
val |= FIELD_PREP(PCI_EXP_LNKCAP_MLW, pcie->num_lanes);
|
||||||
dw_pcie_writel_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKCAP, val);
|
dw_pcie_writel_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKCAP, val);
|
||||||
|
|
||||||
config_gen3_gen4_eq_presets(pcie);
|
config_gen3_gen4_eq_presets(pcie);
|
||||||
|
@ -909,7 +909,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
|
|||||||
{
|
{
|
||||||
int acpi_state, d_max;
|
int acpi_state, d_max;
|
||||||
|
|
||||||
if (pdev->no_d3cold)
|
if (pdev->no_d3cold || !pdev->d3cold_allowed)
|
||||||
d_max = ACPI_STATE_D3_HOT;
|
d_max = ACPI_STATE_D3_HOT;
|
||||||
else
|
else
|
||||||
d_max = ACPI_STATE_D3_COLD;
|
d_max = ACPI_STATE_D3_COLD;
|
||||||
|
@ -517,10 +517,7 @@ static ssize_t d3cold_allowed_store(struct device *dev,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
pdev->d3cold_allowed = !!val;
|
pdev->d3cold_allowed = !!val;
|
||||||
if (pdev->d3cold_allowed)
|
pci_bridge_d3_update(pdev);
|
||||||
pci_d3cold_enable(pdev);
|
|
||||||
else
|
|
||||||
pci_d3cold_disable(pdev);
|
|
||||||
|
|
||||||
pm_runtime_resume(dev);
|
pm_runtime_resume(dev);
|
||||||
|
|
||||||
|
@ -9699,6 +9699,7 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {
|
|||||||
* Individual addressing is broken on models that expose the
|
* Individual addressing is broken on models that expose the
|
||||||
* primary battery as BAT1.
|
* primary battery as BAT1.
|
||||||
*/
|
*/
|
||||||
|
TPACPI_Q_LNV('8', 'F', true), /* Thinkpad X120e */
|
||||||
TPACPI_Q_LNV('J', '7', true), /* B5400 */
|
TPACPI_Q_LNV('J', '7', true), /* B5400 */
|
||||||
TPACPI_Q_LNV('J', 'I', true), /* Thinkpad 11e */
|
TPACPI_Q_LNV('J', 'I', true), /* Thinkpad 11e */
|
||||||
TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */
|
TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */
|
||||||
|
@ -443,7 +443,8 @@ ssize_t ptp_read(struct posix_clock *pc,
|
|||||||
|
|
||||||
for (i = 0; i < cnt; i++) {
|
for (i = 0; i < cnt; i++) {
|
||||||
event[i] = queue->buf[queue->head];
|
event[i] = queue->buf[queue->head];
|
||||||
queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
|
/* Paired with READ_ONCE() in queue_cnt() */
|
||||||
|
WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&queue->lock, flags);
|
spin_unlock_irqrestore(&queue->lock, flags);
|
||||||
|
@ -55,10 +55,11 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue,
|
|||||||
dst->t.sec = seconds;
|
dst->t.sec = seconds;
|
||||||
dst->t.nsec = remainder;
|
dst->t.nsec = remainder;
|
||||||
|
|
||||||
|
/* Both WRITE_ONCE() are paired with READ_ONCE() in queue_cnt() */
|
||||||
if (!queue_free(queue))
|
if (!queue_free(queue))
|
||||||
queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
|
WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
|
||||||
|
|
||||||
queue->tail = (queue->tail + 1) % PTP_MAX_TIMESTAMPS;
|
WRITE_ONCE(queue->tail, (queue->tail + 1) % PTP_MAX_TIMESTAMPS);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&queue->lock, flags);
|
spin_unlock_irqrestore(&queue->lock, flags);
|
||||||
}
|
}
|
||||||
|
@ -55,9 +55,13 @@ struct ptp_clock {
|
|||||||
* that a writer might concurrently increment the tail does not
|
* that a writer might concurrently increment the tail does not
|
||||||
* matter, since the queue remains nonempty nonetheless.
|
* matter, since the queue remains nonempty nonetheless.
|
||||||
*/
|
*/
|
||||||
static inline int queue_cnt(struct timestamp_event_queue *q)
|
static inline int queue_cnt(const struct timestamp_event_queue *q)
|
||||||
{
|
{
|
||||||
int cnt = q->tail - q->head;
|
/*
|
||||||
|
* Paired with WRITE_ONCE() in enqueue_external_timestamp(),
|
||||||
|
* ptp_read(), extts_fifo_show().
|
||||||
|
*/
|
||||||
|
int cnt = READ_ONCE(q->tail) - READ_ONCE(q->head);
|
||||||
return cnt < 0 ? PTP_MAX_TIMESTAMPS + cnt : cnt;
|
return cnt < 0 ? PTP_MAX_TIMESTAMPS + cnt : cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,8 @@ static ssize_t extts_fifo_show(struct device *dev,
|
|||||||
qcnt = queue_cnt(queue);
|
qcnt = queue_cnt(queue);
|
||||||
if (qcnt) {
|
if (qcnt) {
|
||||||
event = queue->buf[queue->head];
|
event = queue->buf[queue->head];
|
||||||
queue->head = (queue->head + 1) % PTP_MAX_TIMESTAMPS;
|
/* Paired with READ_ONCE() in queue_cnt() */
|
||||||
|
WRITE_ONCE(queue->head, (queue->head + 1) % PTP_MAX_TIMESTAMPS);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&queue->lock, flags);
|
spin_unlock_irqrestore(&queue->lock, flags);
|
||||||
|
|
||||||
|
@ -238,6 +238,12 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
|
|||||||
}
|
}
|
||||||
mutex_lock(&lport->disc.disc_mutex);
|
mutex_lock(&lport->disc.disc_mutex);
|
||||||
lport->ptp_rdata = fc_rport_create(lport, remote_fid);
|
lport->ptp_rdata = fc_rport_create(lport, remote_fid);
|
||||||
|
if (!lport->ptp_rdata) {
|
||||||
|
printk(KERN_WARNING "libfc: Failed to setup lport 0x%x\n",
|
||||||
|
lport->port_id);
|
||||||
|
mutex_unlock(&lport->disc.disc_mutex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
kref_get(&lport->ptp_rdata->kref);
|
kref_get(&lport->ptp_rdata->kref);
|
||||||
lport->ptp_rdata->ids.port_name = remote_wwpn;
|
lport->ptp_rdata->ids.port_name = remote_wwpn;
|
||||||
lport->ptp_rdata->ids.node_name = remote_wwnn;
|
lport->ptp_rdata->ids.node_name = remote_wwnn;
|
||||||
|
@ -252,13 +252,13 @@ u32 megasas_readl(struct megasas_instance *instance,
|
|||||||
* Fusion registers could intermittently return all zeroes.
|
* Fusion registers could intermittently return all zeroes.
|
||||||
* This behavior is transient in nature and subsequent reads will
|
* This behavior is transient in nature and subsequent reads will
|
||||||
* return valid value. As a workaround in driver, retry readl for
|
* return valid value. As a workaround in driver, retry readl for
|
||||||
* upto three times until a non-zero value is read.
|
* up to thirty times until a non-zero value is read.
|
||||||
*/
|
*/
|
||||||
if (instance->adapter_type == AERO_SERIES) {
|
if (instance->adapter_type == AERO_SERIES) {
|
||||||
do {
|
do {
|
||||||
ret_val = readl(addr);
|
ret_val = readl(addr);
|
||||||
i++;
|
i++;
|
||||||
} while (ret_val == 0 && i < 3);
|
} while (ret_val == 0 && i < 30);
|
||||||
return ret_val;
|
return ret_val;
|
||||||
} else {
|
} else {
|
||||||
return readl(addr);
|
return readl(addr);
|
||||||
|
@ -587,7 +587,7 @@ static int __init xen_hvc_init(void)
|
|||||||
ops = &dom0_hvc_ops;
|
ops = &dom0_hvc_ops;
|
||||||
r = xen_initial_domain_console_init();
|
r = xen_initial_domain_console_init();
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
goto register_fe;
|
||||||
info = vtermno_to_xencons(HVC_COOKIE);
|
info = vtermno_to_xencons(HVC_COOKIE);
|
||||||
} else {
|
} else {
|
||||||
ops = &domU_hvc_ops;
|
ops = &domU_hvc_ops;
|
||||||
@ -596,7 +596,7 @@ static int __init xen_hvc_init(void)
|
|||||||
else
|
else
|
||||||
r = xen_pv_console_init();
|
r = xen_pv_console_init();
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
goto register_fe;
|
||||||
|
|
||||||
info = vtermno_to_xencons(HVC_COOKIE);
|
info = vtermno_to_xencons(HVC_COOKIE);
|
||||||
info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
|
info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
|
||||||
@ -621,6 +621,7 @@ static int __init xen_hvc_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = 0;
|
r = 0;
|
||||||
|
register_fe:
|
||||||
#ifdef CONFIG_HVC_XEN_FRONTEND
|
#ifdef CONFIG_HVC_XEN_FRONTEND
|
||||||
r = xenbus_register_frontend(&xencons_driver);
|
r = xenbus_register_frontend(&xencons_driver);
|
||||||
#endif
|
#endif
|
||||||
|
@ -371,10 +371,14 @@ static void meson_uart_set_termios(struct uart_port *port,
|
|||||||
else
|
else
|
||||||
val |= AML_UART_STOP_BIT_1SB;
|
val |= AML_UART_STOP_BIT_1SB;
|
||||||
|
|
||||||
if (cflags & CRTSCTS)
|
if (cflags & CRTSCTS) {
|
||||||
|
if (port->flags & UPF_HARD_FLOW)
|
||||||
val &= ~AML_UART_TWO_WIRE_EN;
|
val &= ~AML_UART_TWO_WIRE_EN;
|
||||||
else
|
else
|
||||||
|
termios->c_cflag &= ~CRTSCTS;
|
||||||
|
} else {
|
||||||
val |= AML_UART_TWO_WIRE_EN;
|
val |= AML_UART_TWO_WIRE_EN;
|
||||||
|
}
|
||||||
|
|
||||||
writel(val, port->membase + AML_UART_CONTROL);
|
writel(val, port->membase + AML_UART_CONTROL);
|
||||||
|
|
||||||
@ -665,15 +669,19 @@ static int meson_uart_probe_clocks(struct platform_device *pdev,
|
|||||||
|
|
||||||
static int meson_uart_probe(struct platform_device *pdev)
|
static int meson_uart_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct resource *res_mem, *res_irq;
|
struct resource *res_mem;
|
||||||
struct uart_port *port;
|
struct uart_port *port;
|
||||||
|
u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int id = -1;
|
int irq;
|
||||||
|
bool has_rtscts;
|
||||||
|
|
||||||
if (pdev->dev.of_node)
|
if (pdev->dev.of_node)
|
||||||
pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
|
pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
|
||||||
|
|
||||||
if (pdev->id < 0) {
|
if (pdev->id < 0) {
|
||||||
|
int id;
|
||||||
|
|
||||||
for (id = AML_UART_PORT_OFFSET; id < AML_UART_PORT_NUM; id++) {
|
for (id = AML_UART_PORT_OFFSET; id < AML_UART_PORT_NUM; id++) {
|
||||||
if (!meson_ports[id]) {
|
if (!meson_ports[id]) {
|
||||||
pdev->id = id;
|
pdev->id = id;
|
||||||
@ -689,9 +697,12 @@ static int meson_uart_probe(struct platform_device *pdev)
|
|||||||
if (!res_mem)
|
if (!res_mem)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
irq = platform_get_irq(pdev, 0);
|
||||||
if (!res_irq)
|
if (irq < 0)
|
||||||
return -ENODEV;
|
return irq;
|
||||||
|
|
||||||
|
of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
|
||||||
|
has_rtscts = of_property_read_bool(pdev->dev.of_node, "uart-has-rtscts");
|
||||||
|
|
||||||
if (meson_ports[pdev->id]) {
|
if (meson_ports[pdev->id]) {
|
||||||
dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
|
dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
|
||||||
@ -714,14 +725,16 @@ static int meson_uart_probe(struct platform_device *pdev)
|
|||||||
port->iotype = UPIO_MEM;
|
port->iotype = UPIO_MEM;
|
||||||
port->mapbase = res_mem->start;
|
port->mapbase = res_mem->start;
|
||||||
port->mapsize = resource_size(res_mem);
|
port->mapsize = resource_size(res_mem);
|
||||||
port->irq = res_irq->start;
|
port->irq = irq;
|
||||||
port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
|
port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
|
||||||
|
if (has_rtscts)
|
||||||
|
port->flags |= UPF_HARD_FLOW;
|
||||||
port->dev = &pdev->dev;
|
port->dev = &pdev->dev;
|
||||||
port->line = pdev->id;
|
port->line = pdev->id;
|
||||||
port->type = PORT_MESON;
|
port->type = PORT_MESON;
|
||||||
port->x_char = 0;
|
port->x_char = 0;
|
||||||
port->ops = &meson_uart_ops;
|
port->ops = &meson_uart_ops;
|
||||||
port->fifosize = 64;
|
port->fifosize = fifosize;
|
||||||
|
|
||||||
meson_ports[pdev->id] = port;
|
meson_ports[pdev->id] = port;
|
||||||
platform_set_drvdata(pdev, port);
|
platform_set_drvdata(pdev, port);
|
||||||
|
@ -587,18 +587,22 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
name = kstrdup(dev_name(&vdev->dev), GFP_KERNEL);
|
name = kstrdup(dev_name(&vdev->dev), GFP_KERNEL);
|
||||||
|
if (!name) {
|
||||||
|
rv = -ENOMEM;
|
||||||
|
goto free_port;
|
||||||
|
}
|
||||||
|
|
||||||
rv = vio_driver_init(&port->vio, vdev, VDEV_CONSOLE_CON, vcc_versions,
|
rv = vio_driver_init(&port->vio, vdev, VDEV_CONSOLE_CON, vcc_versions,
|
||||||
ARRAY_SIZE(vcc_versions), NULL, name);
|
ARRAY_SIZE(vcc_versions), NULL, name);
|
||||||
if (rv)
|
if (rv)
|
||||||
goto free_port;
|
goto free_name;
|
||||||
|
|
||||||
port->vio.debug = vcc_dbg_vio;
|
port->vio.debug = vcc_dbg_vio;
|
||||||
vcc_ldc_cfg.debug = vcc_dbg_ldc;
|
vcc_ldc_cfg.debug = vcc_dbg_ldc;
|
||||||
|
|
||||||
rv = vio_ldc_alloc(&port->vio, &vcc_ldc_cfg, port);
|
rv = vio_ldc_alloc(&port->vio, &vcc_ldc_cfg, port);
|
||||||
if (rv)
|
if (rv)
|
||||||
goto free_port;
|
goto free_name;
|
||||||
|
|
||||||
spin_lock_init(&port->lock);
|
spin_lock_init(&port->lock);
|
||||||
|
|
||||||
@ -632,6 +636,11 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||||||
goto unreg_tty;
|
goto unreg_tty;
|
||||||
}
|
}
|
||||||
port->domain = kstrdup(domain, GFP_KERNEL);
|
port->domain = kstrdup(domain, GFP_KERNEL);
|
||||||
|
if (!port->domain) {
|
||||||
|
rv = -ENOMEM;
|
||||||
|
goto unreg_tty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mdesc_release(hp);
|
mdesc_release(hp);
|
||||||
|
|
||||||
@ -661,8 +670,9 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||||||
vcc_table_remove(port->index);
|
vcc_table_remove(port->index);
|
||||||
free_ldc:
|
free_ldc:
|
||||||
vio_ldc_free(&port->vio);
|
vio_ldc_free(&port->vio);
|
||||||
free_port:
|
free_name:
|
||||||
kfree(name);
|
kfree(name);
|
||||||
|
free_port:
|
||||||
kfree(port);
|
kfree(port);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -1435,7 +1435,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
|
|||||||
struct usb_composite_dev *cdev = c->cdev;
|
struct usb_composite_dev *cdev = c->cdev;
|
||||||
struct f_ncm *ncm = func_to_ncm(f);
|
struct f_ncm *ncm = func_to_ncm(f);
|
||||||
struct usb_string *us;
|
struct usb_string *us;
|
||||||
int status;
|
int status = 0;
|
||||||
struct usb_ep *ep;
|
struct usb_ep *ep;
|
||||||
struct f_ncm_opts *ncm_opts;
|
struct f_ncm_opts *ncm_opts;
|
||||||
|
|
||||||
@ -1453,22 +1453,17 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
|
|||||||
f->os_desc_table[0].os_desc = &ncm_opts->ncm_os_desc;
|
f->os_desc_table[0].os_desc = &ncm_opts->ncm_os_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* in drivers/usb/gadget/configfs.c:configfs_composite_bind()
|
|
||||||
* configurations are bound in sequence with list_for_each_entry,
|
|
||||||
* in each configuration its functions are bound in sequence
|
|
||||||
* with list_for_each_entry, so we assume no race condition
|
|
||||||
* with regard to ncm_opts->bound access
|
|
||||||
*/
|
|
||||||
if (!ncm_opts->bound) {
|
|
||||||
mutex_lock(&ncm_opts->lock);
|
mutex_lock(&ncm_opts->lock);
|
||||||
gether_set_gadget(ncm_opts->net, cdev->gadget);
|
gether_set_gadget(ncm_opts->net, cdev->gadget);
|
||||||
|
if (!ncm_opts->bound)
|
||||||
status = gether_register_netdev(ncm_opts->net);
|
status = gether_register_netdev(ncm_opts->net);
|
||||||
mutex_unlock(&ncm_opts->lock);
|
mutex_unlock(&ncm_opts->lock);
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
ncm_opts->bound = true;
|
ncm_opts->bound = true;
|
||||||
}
|
|
||||||
us = usb_gstrings_attach(cdev, ncm_strings,
|
us = usb_gstrings_attach(cdev, ncm_strings,
|
||||||
ARRAY_SIZE(ncm_string_defs));
|
ARRAY_SIZE(ncm_string_defs));
|
||||||
if (IS_ERR(us)) {
|
if (IS_ERR(us)) {
|
||||||
|
@ -491,7 +491,9 @@ static void lateeoi_list_add(struct irq_info *info)
|
|||||||
|
|
||||||
spin_lock_irqsave(&eoi->eoi_list_lock, flags);
|
spin_lock_irqsave(&eoi->eoi_list_lock, flags);
|
||||||
|
|
||||||
if (list_empty(&eoi->eoi_list)) {
|
elem = list_first_entry_or_null(&eoi->eoi_list, struct irq_info,
|
||||||
|
eoi_list);
|
||||||
|
if (!elem || info->eoi_time < elem->eoi_time) {
|
||||||
list_add(&info->eoi_list, &eoi->eoi_list);
|
list_add(&info->eoi_list, &eoi->eoi_list);
|
||||||
mod_delayed_work_on(info->eoi_cpu, system_wq,
|
mod_delayed_work_on(info->eoi_cpu, system_wq,
|
||||||
&eoi->delayed, delay);
|
&eoi->delayed, delay);
|
||||||
|
@ -324,9 +324,6 @@ int btrfs_delalloc_reserve_metadata(struct btrfs_inode *inode, u64 num_bytes)
|
|||||||
} else {
|
} else {
|
||||||
if (current->journal_info)
|
if (current->journal_info)
|
||||||
flush = BTRFS_RESERVE_FLUSH_LIMIT;
|
flush = BTRFS_RESERVE_FLUSH_LIMIT;
|
||||||
|
|
||||||
if (btrfs_transaction_in_commit(fs_info))
|
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delalloc_lock)
|
if (delalloc_lock)
|
||||||
|
@ -76,8 +76,8 @@ struct key_type cifs_spnego_key_type = {
|
|||||||
* strlen(";sec=ntlmsspi") */
|
* strlen(";sec=ntlmsspi") */
|
||||||
#define MAX_MECH_STR_LEN 13
|
#define MAX_MECH_STR_LEN 13
|
||||||
|
|
||||||
/* strlen of "host=" */
|
/* strlen of ";host=" */
|
||||||
#define HOST_KEY_LEN 5
|
#define HOST_KEY_LEN 6
|
||||||
|
|
||||||
/* strlen of ";ip4=" or ";ip6=" */
|
/* strlen of ";ip4=" or ";ip6=" */
|
||||||
#define IP_KEY_LEN 5
|
#define IP_KEY_LEN 5
|
||||||
|
@ -67,6 +67,11 @@ extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
|
|||||||
static inline int
|
static inline int
|
||||||
ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
|
ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
|
||||||
{
|
{
|
||||||
|
/* usually, the umask is applied by posix_acl_create(), but if
|
||||||
|
ext4 ACL support is disabled at compile time, we need to do
|
||||||
|
it here, because posix_acl_create() will never be called */
|
||||||
|
inode->i_mode &= ~current_umask();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_EXT4_FS_POSIX_ACL */
|
#endif /* CONFIG_EXT4_FS_POSIX_ACL */
|
||||||
|
@ -1348,8 +1348,8 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count_reserved)
|
if (count_reserved)
|
||||||
count_rsvd(inode, lblk, orig_es.es_len - len1 - len2,
|
count_rsvd(inode, orig_es.es_lblk + len1,
|
||||||
&orig_es, &rc);
|
orig_es.es_len - len1 - len2, &orig_es, &rc);
|
||||||
goto out_get_reserved;
|
goto out_get_reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,13 +572,8 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
|
|||||||
if (meta_bg == 0 && !ext4_bg_has_super(sb, group))
|
if (meta_bg == 0 && !ext4_bg_has_super(sb, group))
|
||||||
goto handle_itb;
|
goto handle_itb;
|
||||||
|
|
||||||
if (meta_bg == 1) {
|
if (meta_bg == 1)
|
||||||
ext4_group_t first_group;
|
|
||||||
first_group = ext4_meta_bg_first_group(sb, group);
|
|
||||||
if (first_group != group + 1 &&
|
|
||||||
first_group != group + EXT4_DESC_PER_BLOCK(sb) - 1)
|
|
||||||
goto handle_itb;
|
goto handle_itb;
|
||||||
}
|
|
||||||
|
|
||||||
block = start + ext4_bg_has_super(sb, group);
|
block = start + ext4_bg_has_super(sb, group);
|
||||||
/* Copy all of the GDT blocks into the backup in this group */
|
/* Copy all of the GDT blocks into the backup in this group */
|
||||||
@ -1565,6 +1560,8 @@ static int ext4_flex_group_add(struct super_block *sb,
|
|||||||
int gdb_num_end = ((group + flex_gd->count - 1) /
|
int gdb_num_end = ((group + flex_gd->count - 1) /
|
||||||
EXT4_DESC_PER_BLOCK(sb));
|
EXT4_DESC_PER_BLOCK(sb));
|
||||||
int meta_bg = ext4_has_feature_meta_bg(sb);
|
int meta_bg = ext4_has_feature_meta_bg(sb);
|
||||||
|
sector_t padding_blocks = meta_bg ? 0 : sbi->s_sbh->b_blocknr -
|
||||||
|
ext4_group_first_block_no(sb, 0);
|
||||||
sector_t old_gdb = 0;
|
sector_t old_gdb = 0;
|
||||||
|
|
||||||
update_backups(sb, ext4_group_first_block_no(sb, 0),
|
update_backups(sb, ext4_group_first_block_no(sb, 0),
|
||||||
@ -1576,8 +1573,8 @@ static int ext4_flex_group_add(struct super_block *sb,
|
|||||||
gdb_num);
|
gdb_num);
|
||||||
if (old_gdb == gdb_bh->b_blocknr)
|
if (old_gdb == gdb_bh->b_blocknr)
|
||||||
continue;
|
continue;
|
||||||
update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data,
|
update_backups(sb, gdb_bh->b_blocknr - padding_blocks,
|
||||||
gdb_bh->b_size, meta_bg);
|
gdb_bh->b_data, gdb_bh->b_size, meta_bg);
|
||||||
old_gdb = gdb_bh->b_blocknr;
|
old_gdb = gdb_bh->b_blocknr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1938,9 +1935,7 @@ static int ext4_convert_meta_bg(struct super_block *sb, struct inode *inode)
|
|||||||
|
|
||||||
errout:
|
errout:
|
||||||
ret = ext4_journal_stop(handle);
|
ret = ext4_journal_stop(handle);
|
||||||
if (!err)
|
return err ? err : ret;
|
||||||
err = ret;
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
invalid_resize_inode:
|
invalid_resize_inode:
|
||||||
ext4_error(sb, "corrupted/inconsistent resize inode");
|
ext4_error(sb, "corrupted/inconsistent resize inode");
|
||||||
|
@ -431,6 +431,17 @@ static int qd_check_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd,
|
|||||||
(sync_gen && (qd->qd_sync_gen >= *sync_gen)))
|
(sync_gen && (qd->qd_sync_gen >= *sync_gen)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If qd_change is 0 it means a pending quota change was negated.
|
||||||
|
* We should not sync it, but we still have a qd reference and slot
|
||||||
|
* reference taken by gfs2_quota_change -> do_qc that need to be put.
|
||||||
|
*/
|
||||||
|
if (!qd->qd_change && test_and_clear_bit(QDF_CHANGE, &qd->qd_flags)) {
|
||||||
|
slot_put(qd);
|
||||||
|
qd_put(qd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!lockref_get_not_dead(&qd->qd_lockref))
|
if (!lockref_get_not_dead(&qd->qd_lockref))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -247,6 +247,8 @@ int jbd2_journal_recover(journal_t *journal)
|
|||||||
journal_superblock_t * sb;
|
journal_superblock_t * sb;
|
||||||
|
|
||||||
struct recovery_info info;
|
struct recovery_info info;
|
||||||
|
errseq_t wb_err;
|
||||||
|
struct address_space *mapping;
|
||||||
|
|
||||||
memset(&info, 0, sizeof(info));
|
memset(&info, 0, sizeof(info));
|
||||||
sb = journal->j_superblock;
|
sb = journal->j_superblock;
|
||||||
@ -264,6 +266,9 @@ int jbd2_journal_recover(journal_t *journal)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wb_err = 0;
|
||||||
|
mapping = journal->j_fs_dev->bd_inode->i_mapping;
|
||||||
|
errseq_check_and_advance(&mapping->wb_err, &wb_err);
|
||||||
err = do_one_pass(journal, &info, PASS_SCAN);
|
err = do_one_pass(journal, &info, PASS_SCAN);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = do_one_pass(journal, &info, PASS_REVOKE);
|
err = do_one_pass(journal, &info, PASS_REVOKE);
|
||||||
@ -282,6 +287,9 @@ int jbd2_journal_recover(journal_t *journal)
|
|||||||
|
|
||||||
jbd2_journal_clear_revoke(journal);
|
jbd2_journal_clear_revoke(journal);
|
||||||
err2 = sync_blockdev(journal->j_fs_dev);
|
err2 = sync_blockdev(journal->j_fs_dev);
|
||||||
|
if (!err)
|
||||||
|
err = err2;
|
||||||
|
err2 = errseq_check_and_advance(&mapping->wb_err, &wb_err);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = err2;
|
err = err2;
|
||||||
/* Make sure all replayed data is on permanent storage */
|
/* Make sure all replayed data is on permanent storage */
|
||||||
|
@ -87,7 +87,7 @@ static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
|
|||||||
static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
|
static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
|
||||||
static int dbFindBits(u32 word, int l2nb);
|
static int dbFindBits(u32 word, int l2nb);
|
||||||
static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
|
static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
|
||||||
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx);
|
static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl);
|
||||||
static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
|
static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
|
||||||
int nblocks);
|
int nblocks);
|
||||||
static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
|
static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
|
||||||
@ -180,7 +180,8 @@ int dbMount(struct inode *ipbmap)
|
|||||||
bmp->db_nfree = le64_to_cpu(dbmp_le->dn_nfree);
|
bmp->db_nfree = le64_to_cpu(dbmp_le->dn_nfree);
|
||||||
|
|
||||||
bmp->db_l2nbperpage = le32_to_cpu(dbmp_le->dn_l2nbperpage);
|
bmp->db_l2nbperpage = le32_to_cpu(dbmp_le->dn_l2nbperpage);
|
||||||
if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE) {
|
if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE ||
|
||||||
|
bmp->db_l2nbperpage < 0) {
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto err_release_metapage;
|
goto err_release_metapage;
|
||||||
}
|
}
|
||||||
@ -194,6 +195,12 @@ int dbMount(struct inode *ipbmap)
|
|||||||
bmp->db_maxlevel = le32_to_cpu(dbmp_le->dn_maxlevel);
|
bmp->db_maxlevel = le32_to_cpu(dbmp_le->dn_maxlevel);
|
||||||
bmp->db_maxag = le32_to_cpu(dbmp_le->dn_maxag);
|
bmp->db_maxag = le32_to_cpu(dbmp_le->dn_maxag);
|
||||||
bmp->db_agpref = le32_to_cpu(dbmp_le->dn_agpref);
|
bmp->db_agpref = le32_to_cpu(dbmp_le->dn_agpref);
|
||||||
|
if (bmp->db_maxag >= MAXAG || bmp->db_maxag < 0 ||
|
||||||
|
bmp->db_agpref >= MAXAG || bmp->db_agpref < 0) {
|
||||||
|
err = -EINVAL;
|
||||||
|
goto err_release_metapage;
|
||||||
|
}
|
||||||
|
|
||||||
bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel);
|
bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel);
|
||||||
bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight);
|
bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight);
|
||||||
bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
|
bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
|
||||||
@ -1778,7 +1785,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
|
|||||||
* dbFindLeaf() returns the index of the leaf at which
|
* dbFindLeaf() returns the index of the leaf at which
|
||||||
* free space was found.
|
* free space was found.
|
||||||
*/
|
*/
|
||||||
rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx);
|
rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx, true);
|
||||||
|
|
||||||
/* release the buffer.
|
/* release the buffer.
|
||||||
*/
|
*/
|
||||||
@ -2025,7 +2032,7 @@ dbAllocDmapLev(struct bmap * bmp,
|
|||||||
* free space. if sufficient free space is found, dbFindLeaf()
|
* free space. if sufficient free space is found, dbFindLeaf()
|
||||||
* returns the index of the leaf at which free space was found.
|
* returns the index of the leaf at which free space was found.
|
||||||
*/
|
*/
|
||||||
if (dbFindLeaf((dmtree_t *) & dp->tree, l2nb, &leafidx))
|
if (dbFindLeaf((dmtree_t *) &dp->tree, l2nb, &leafidx, false))
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
|
|
||||||
if (leafidx < 0)
|
if (leafidx < 0)
|
||||||
@ -2985,14 +2992,18 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval)
|
|||||||
* leafidx - return pointer to be set to the index of the leaf
|
* leafidx - return pointer to be set to the index of the leaf
|
||||||
* describing at least l2nb free blocks if sufficient
|
* describing at least l2nb free blocks if sufficient
|
||||||
* free blocks are found.
|
* free blocks are found.
|
||||||
|
* is_ctl - determines if the tree is of type ctl
|
||||||
*
|
*
|
||||||
* RETURN VALUES:
|
* RETURN VALUES:
|
||||||
* 0 - success
|
* 0 - success
|
||||||
* -ENOSPC - insufficient free blocks.
|
* -ENOSPC - insufficient free blocks.
|
||||||
*/
|
*/
|
||||||
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)
|
static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl)
|
||||||
{
|
{
|
||||||
int ti, n = 0, k, x = 0;
|
int ti, n = 0, k, x = 0;
|
||||||
|
int max_size;
|
||||||
|
|
||||||
|
max_size = is_ctl ? CTLTREESIZE : TREESIZE;
|
||||||
|
|
||||||
/* first check the root of the tree to see if there is
|
/* first check the root of the tree to see if there is
|
||||||
* sufficient free space.
|
* sufficient free space.
|
||||||
@ -3013,6 +3024,8 @@ static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)
|
|||||||
/* sufficient free space found. move to the next
|
/* sufficient free space found. move to the next
|
||||||
* level (or quit if this is the last level).
|
* level (or quit if this is the last level).
|
||||||
*/
|
*/
|
||||||
|
if (x + n > max_size)
|
||||||
|
return -ENOSPC;
|
||||||
if (l2nb <= tp->dmt_stree[x + n])
|
if (l2nb <= tp->dmt_stree[x + n])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1322,7 +1322,7 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp)
|
|||||||
int diAlloc(struct inode *pip, bool dir, struct inode *ip)
|
int diAlloc(struct inode *pip, bool dir, struct inode *ip)
|
||||||
{
|
{
|
||||||
int rc, ino, iagno, addext, extno, bitno, sword;
|
int rc, ino, iagno, addext, extno, bitno, sword;
|
||||||
int nwords, rem, i, agno;
|
int nwords, rem, i, agno, dn_numag;
|
||||||
u32 mask, inosmap, extsmap;
|
u32 mask, inosmap, extsmap;
|
||||||
struct inode *ipimap;
|
struct inode *ipimap;
|
||||||
struct metapage *mp;
|
struct metapage *mp;
|
||||||
@ -1358,6 +1358,9 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
|
|||||||
|
|
||||||
/* get the ag number of this iag */
|
/* get the ag number of this iag */
|
||||||
agno = BLKTOAG(JFS_IP(pip)->agstart, JFS_SBI(pip->i_sb));
|
agno = BLKTOAG(JFS_IP(pip)->agstart, JFS_SBI(pip->i_sb));
|
||||||
|
dn_numag = JFS_SBI(pip->i_sb)->bmap->db_numag;
|
||||||
|
if (agno < 0 || agno > dn_numag)
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
if (atomic_read(&JFS_SBI(pip->i_sb)->bmap->db_active[agno])) {
|
if (atomic_read(&JFS_SBI(pip->i_sb)->bmap->db_active[agno])) {
|
||||||
/*
|
/*
|
||||||
|
@ -5369,7 +5369,7 @@ static void nfs4_proc_write_setup(struct nfs_pgio_header *hdr,
|
|||||||
|
|
||||||
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
|
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
|
||||||
nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0, 0);
|
nfs4_init_sequence(&hdr->args.seq_args, &hdr->res.seq_res, 0, 0);
|
||||||
nfs4_state_protect_write(server->nfs_client, clnt, msg, hdr);
|
nfs4_state_protect_write(hdr->ds_clp ? hdr->ds_clp : server->nfs_client, clnt, msg, hdr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nfs4_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data)
|
static void nfs4_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data)
|
||||||
@ -5410,7 +5410,8 @@ static void nfs4_proc_commit_setup(struct nfs_commit_data *data, struct rpc_mess
|
|||||||
data->res.server = server;
|
data->res.server = server;
|
||||||
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
|
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
|
||||||
nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, 0);
|
nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, 0);
|
||||||
nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_COMMIT, clnt, msg);
|
nfs4_state_protect(data->ds_clp ? data->ds_clp : server->nfs_client,
|
||||||
|
NFS_SP4_MACH_CRED_COMMIT, clnt, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _nfs4_proc_commit(struct file *dst, struct nfs_commitargs *args,
|
static int _nfs4_proc_commit(struct file *dst, struct nfs_commitargs *args,
|
||||||
|
@ -2571,7 +2571,7 @@ static int client_opens_release(struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
/* XXX: alternatively, we could get/drop in seq start/stop */
|
/* XXX: alternatively, we could get/drop in seq start/stop */
|
||||||
drop_client(clp);
|
drop_client(clp);
|
||||||
return 0;
|
return seq_release(inode, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations client_states_fops = {
|
static const struct file_operations client_states_fops = {
|
||||||
|
@ -2388,6 +2388,20 @@ static int vfs_setup_quota_inode(struct inode *inode, int type)
|
|||||||
if (sb_has_quota_loaded(sb, type))
|
if (sb_has_quota_loaded(sb, type))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Quota files should never be encrypted. They should be thought of as
|
||||||
|
* filesystem metadata, not user data. New-style internal quota files
|
||||||
|
* cannot be encrypted by users anyway, but old-style external quota
|
||||||
|
* files could potentially be incorrectly created in an encrypted
|
||||||
|
* directory, hence this explicit check. Some reasons why encrypted
|
||||||
|
* quota files don't work include: (1) some filesystems that support
|
||||||
|
* encryption don't handle it in their quota_read and quota_write, and
|
||||||
|
* (2) cleaning up encrypted quota files at unmount would need special
|
||||||
|
* consideration, as quota files are cleaned up later than user files.
|
||||||
|
*/
|
||||||
|
if (IS_ENCRYPTED(inode))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
dqopt->files[type] = igrab(inode);
|
dqopt->files[type] = igrab(inode);
|
||||||
if (!dqopt->files[type])
|
if (!dqopt->files[type])
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
#include <linux/ptp_clock_kernel.h>
|
#include <linux/ptp_clock_kernel.h>
|
||||||
#include <net/devlink.h>
|
#include <net/devlink.h>
|
||||||
|
|
||||||
|
#define MLX5_ADEV_NAME "mlx5_core"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MLX5_BOARD_ID_LEN = 64,
|
MLX5_BOARD_ID_LEN = 64,
|
||||||
};
|
};
|
||||||
|
@ -44,8 +44,8 @@ struct pwm_args {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PWMF_REQUESTED = 1 << 0,
|
PWMF_REQUESTED = 0,
|
||||||
PWMF_EXPORTED = 1 << 1,
|
PWMF_EXPORTED = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -341,6 +341,7 @@ enum {
|
|||||||
EVENT_FILE_FL_TRIGGER_COND_BIT,
|
EVENT_FILE_FL_TRIGGER_COND_BIT,
|
||||||
EVENT_FILE_FL_PID_FILTER_BIT,
|
EVENT_FILE_FL_PID_FILTER_BIT,
|
||||||
EVENT_FILE_FL_WAS_ENABLED_BIT,
|
EVENT_FILE_FL_WAS_ENABLED_BIT,
|
||||||
|
EVENT_FILE_FL_FREED_BIT,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -357,6 +358,7 @@ enum {
|
|||||||
* TRIGGER_COND - When set, one or more triggers has an associated filter
|
* TRIGGER_COND - When set, one or more triggers has an associated filter
|
||||||
* PID_FILTER - When set, the event is filtered based on pid
|
* PID_FILTER - When set, the event is filtered based on pid
|
||||||
* WAS_ENABLED - Set when enabled to know to clear trace on module removal
|
* WAS_ENABLED - Set when enabled to know to clear trace on module removal
|
||||||
|
* FREED - File descriptor is freed, all fields should be considered invalid
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
EVENT_FILE_FL_ENABLED = (1 << EVENT_FILE_FL_ENABLED_BIT),
|
EVENT_FILE_FL_ENABLED = (1 << EVENT_FILE_FL_ENABLED_BIT),
|
||||||
@ -370,6 +372,7 @@ enum {
|
|||||||
EVENT_FILE_FL_TRIGGER_COND = (1 << EVENT_FILE_FL_TRIGGER_COND_BIT),
|
EVENT_FILE_FL_TRIGGER_COND = (1 << EVENT_FILE_FL_TRIGGER_COND_BIT),
|
||||||
EVENT_FILE_FL_PID_FILTER = (1 << EVENT_FILE_FL_PID_FILTER_BIT),
|
EVENT_FILE_FL_PID_FILTER = (1 << EVENT_FILE_FL_PID_FILTER_BIT),
|
||||||
EVENT_FILE_FL_WAS_ENABLED = (1 << EVENT_FILE_FL_WAS_ENABLED_BIT),
|
EVENT_FILE_FL_WAS_ENABLED = (1 << EVENT_FILE_FL_WAS_ENABLED_BIT),
|
||||||
|
EVENT_FILE_FL_FREED = (1 << EVENT_FILE_FL_FREED_BIT),
|
||||||
};
|
};
|
||||||
|
|
||||||
struct trace_event_file {
|
struct trace_event_file {
|
||||||
@ -398,6 +401,7 @@ struct trace_event_file {
|
|||||||
* caching and such. Which is mostly OK ;-)
|
* caching and such. Which is mostly OK ;-)
|
||||||
*/
|
*/
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
atomic_t ref; /* ref count for opened files */
|
||||||
atomic_t sm_ref; /* soft-mode reference counter */
|
atomic_t sm_ref; /* soft-mode reference counter */
|
||||||
atomic_t tm_ref; /* trigger-mode reference counter */
|
atomic_t tm_ref; /* trigger-mode reference counter */
|
||||||
};
|
};
|
||||||
|
@ -371,7 +371,8 @@ struct nft_set_ops {
|
|||||||
int (*init)(const struct nft_set *set,
|
int (*init)(const struct nft_set *set,
|
||||||
const struct nft_set_desc *desc,
|
const struct nft_set_desc *desc,
|
||||||
const struct nlattr * const nla[]);
|
const struct nlattr * const nla[]);
|
||||||
void (*destroy)(const struct nft_set *set);
|
void (*destroy)(const struct nft_ctx *ctx,
|
||||||
|
const struct nft_set *set);
|
||||||
void (*gc_init)(const struct nft_set *set);
|
void (*gc_init)(const struct nft_set *set);
|
||||||
|
|
||||||
unsigned int elemsize;
|
unsigned int elemsize;
|
||||||
@ -401,6 +402,7 @@ void nft_unregister_set(struct nft_set_type *type);
|
|||||||
*
|
*
|
||||||
* @list: table set list node
|
* @list: table set list node
|
||||||
* @bindings: list of set bindings
|
* @bindings: list of set bindings
|
||||||
|
* @refs: internal refcounting for async set destruction
|
||||||
* @table: table this set belongs to
|
* @table: table this set belongs to
|
||||||
* @net: netnamespace this set belongs to
|
* @net: netnamespace this set belongs to
|
||||||
* @name: name of the set
|
* @name: name of the set
|
||||||
@ -427,6 +429,7 @@ void nft_unregister_set(struct nft_set_type *type);
|
|||||||
struct nft_set {
|
struct nft_set {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
struct list_head bindings;
|
struct list_head bindings;
|
||||||
|
refcount_t refs;
|
||||||
struct nft_table *table;
|
struct nft_table *table;
|
||||||
possible_net_t net;
|
possible_net_t net;
|
||||||
char *name;
|
char *name;
|
||||||
@ -445,7 +448,8 @@ struct nft_set {
|
|||||||
unsigned char *udata;
|
unsigned char *udata;
|
||||||
/* runtime data below here */
|
/* runtime data below here */
|
||||||
const struct nft_set_ops *ops ____cacheline_aligned;
|
const struct nft_set_ops *ops ____cacheline_aligned;
|
||||||
u16 flags:14,
|
u16 flags:13,
|
||||||
|
dead:1,
|
||||||
genmask:2;
|
genmask:2;
|
||||||
u8 klen;
|
u8 klen;
|
||||||
u8 dlen;
|
u8 dlen;
|
||||||
@ -463,6 +467,11 @@ static inline void *nft_set_priv(const struct nft_set *set)
|
|||||||
return (void *)set->data;
|
return (void *)set->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool nft_set_gc_is_pending(const struct nft_set *s)
|
||||||
|
{
|
||||||
|
return refcount_read(&s->refs) != 1;
|
||||||
|
}
|
||||||
|
|
||||||
static inline struct nft_set *nft_set_container_of(const void *priv)
|
static inline struct nft_set *nft_set_container_of(const void *priv)
|
||||||
{
|
{
|
||||||
return (void *)priv - offsetof(struct nft_set, data);
|
return (void *)priv - offsetof(struct nft_set, data);
|
||||||
@ -665,62 +674,8 @@ void *nft_set_elem_init(const struct nft_set *set,
|
|||||||
u64 timeout, u64 expiration, gfp_t gfp);
|
u64 timeout, u64 expiration, gfp_t gfp);
|
||||||
void nft_set_elem_destroy(const struct nft_set *set, void *elem,
|
void nft_set_elem_destroy(const struct nft_set *set, void *elem,
|
||||||
bool destroy_expr);
|
bool destroy_expr);
|
||||||
|
void nf_tables_set_elem_destroy(const struct nft_ctx *ctx,
|
||||||
/**
|
const struct nft_set *set, void *elem);
|
||||||
* struct nft_set_gc_batch_head - nf_tables set garbage collection batch
|
|
||||||
*
|
|
||||||
* @rcu: rcu head
|
|
||||||
* @set: set the elements belong to
|
|
||||||
* @cnt: count of elements
|
|
||||||
*/
|
|
||||||
struct nft_set_gc_batch_head {
|
|
||||||
struct rcu_head rcu;
|
|
||||||
const struct nft_set *set;
|
|
||||||
unsigned int cnt;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NFT_SET_GC_BATCH_SIZE ((PAGE_SIZE - \
|
|
||||||
sizeof(struct nft_set_gc_batch_head)) / \
|
|
||||||
sizeof(void *))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* struct nft_set_gc_batch - nf_tables set garbage collection batch
|
|
||||||
*
|
|
||||||
* @head: GC batch head
|
|
||||||
* @elems: garbage collection elements
|
|
||||||
*/
|
|
||||||
struct nft_set_gc_batch {
|
|
||||||
struct nft_set_gc_batch_head head;
|
|
||||||
void *elems[NFT_SET_GC_BATCH_SIZE];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct nft_set_gc_batch *nft_set_gc_batch_alloc(const struct nft_set *set,
|
|
||||||
gfp_t gfp);
|
|
||||||
void nft_set_gc_batch_release(struct rcu_head *rcu);
|
|
||||||
|
|
||||||
static inline void nft_set_gc_batch_complete(struct nft_set_gc_batch *gcb)
|
|
||||||
{
|
|
||||||
if (gcb != NULL)
|
|
||||||
call_rcu(&gcb->head.rcu, nft_set_gc_batch_release);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct nft_set_gc_batch *
|
|
||||||
nft_set_gc_batch_check(const struct nft_set *set, struct nft_set_gc_batch *gcb,
|
|
||||||
gfp_t gfp)
|
|
||||||
{
|
|
||||||
if (gcb != NULL) {
|
|
||||||
if (gcb->head.cnt + 1 < ARRAY_SIZE(gcb->elems))
|
|
||||||
return gcb;
|
|
||||||
nft_set_gc_batch_complete(gcb);
|
|
||||||
}
|
|
||||||
return nft_set_gc_batch_alloc(set, gfp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void nft_set_gc_batch_add(struct nft_set_gc_batch *gcb,
|
|
||||||
void *elem)
|
|
||||||
{
|
|
||||||
gcb->elems[gcb->head.cnt++] = elem;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct nft_expr_ops;
|
struct nft_expr_ops;
|
||||||
/**
|
/**
|
||||||
@ -1348,39 +1303,30 @@ static inline void nft_set_elem_change_active(const struct net *net,
|
|||||||
|
|
||||||
#endif /* IS_ENABLED(CONFIG_NF_TABLES) */
|
#endif /* IS_ENABLED(CONFIG_NF_TABLES) */
|
||||||
|
|
||||||
/*
|
#define NFT_SET_ELEM_DEAD_MASK (1 << 2)
|
||||||
* We use a free bit in the genmask field to indicate the element
|
|
||||||
* is busy, meaning it is currently being processed either by
|
|
||||||
* the netlink API or GC.
|
|
||||||
*
|
|
||||||
* Even though the genmask is only a single byte wide, this works
|
|
||||||
* because the extension structure if fully constant once initialized,
|
|
||||||
* so there are no non-atomic write accesses unless it is already
|
|
||||||
* marked busy.
|
|
||||||
*/
|
|
||||||
#define NFT_SET_ELEM_BUSY_MASK (1 << 2)
|
|
||||||
|
|
||||||
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
#if defined(__LITTLE_ENDIAN_BITFIELD)
|
||||||
#define NFT_SET_ELEM_BUSY_BIT 2
|
#define NFT_SET_ELEM_DEAD_BIT 2
|
||||||
#elif defined(__BIG_ENDIAN_BITFIELD)
|
#elif defined(__BIG_ENDIAN_BITFIELD)
|
||||||
#define NFT_SET_ELEM_BUSY_BIT (BITS_PER_LONG - BITS_PER_BYTE + 2)
|
#define NFT_SET_ELEM_DEAD_BIT (BITS_PER_LONG - BITS_PER_BYTE + 2)
|
||||||
#else
|
#else
|
||||||
#error
|
#error
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int nft_set_elem_mark_busy(struct nft_set_ext *ext)
|
static inline void nft_set_elem_dead(struct nft_set_ext *ext)
|
||||||
{
|
{
|
||||||
unsigned long *word = (unsigned long *)ext;
|
unsigned long *word = (unsigned long *)ext;
|
||||||
|
|
||||||
BUILD_BUG_ON(offsetof(struct nft_set_ext, genmask) != 0);
|
BUILD_BUG_ON(offsetof(struct nft_set_ext, genmask) != 0);
|
||||||
return test_and_set_bit(NFT_SET_ELEM_BUSY_BIT, word);
|
set_bit(NFT_SET_ELEM_DEAD_BIT, word);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void nft_set_elem_clear_busy(struct nft_set_ext *ext)
|
static inline int nft_set_elem_is_dead(const struct nft_set_ext *ext)
|
||||||
{
|
{
|
||||||
unsigned long *word = (unsigned long *)ext;
|
unsigned long *word = (unsigned long *)ext;
|
||||||
|
|
||||||
clear_bit(NFT_SET_ELEM_BUSY_BIT, word);
|
BUILD_BUG_ON(offsetof(struct nft_set_ext, genmask) != 0);
|
||||||
|
return test_bit(NFT_SET_ELEM_DEAD_BIT, word);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1446,13 +1392,10 @@ struct nft_trans_chain {
|
|||||||
|
|
||||||
struct nft_trans_table {
|
struct nft_trans_table {
|
||||||
bool update;
|
bool update;
|
||||||
bool enable;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define nft_trans_table_update(trans) \
|
#define nft_trans_table_update(trans) \
|
||||||
(((struct nft_trans_table *)trans->data)->update)
|
(((struct nft_trans_table *)trans->data)->update)
|
||||||
#define nft_trans_table_enable(trans) \
|
|
||||||
(((struct nft_trans_table *)trans->data)->enable)
|
|
||||||
|
|
||||||
struct nft_trans_elem {
|
struct nft_trans_elem {
|
||||||
struct nft_set *set;
|
struct nft_set *set;
|
||||||
@ -1487,6 +1430,35 @@ struct nft_trans_flowtable {
|
|||||||
#define nft_trans_flowtable(trans) \
|
#define nft_trans_flowtable(trans) \
|
||||||
(((struct nft_trans_flowtable *)trans->data)->flowtable)
|
(((struct nft_trans_flowtable *)trans->data)->flowtable)
|
||||||
|
|
||||||
|
#define NFT_TRANS_GC_BATCHCOUNT 256
|
||||||
|
|
||||||
|
struct nft_trans_gc {
|
||||||
|
struct list_head list;
|
||||||
|
struct net *net;
|
||||||
|
struct nft_set *set;
|
||||||
|
u32 seq;
|
||||||
|
u16 count;
|
||||||
|
void *priv[NFT_TRANS_GC_BATCHCOUNT];
|
||||||
|
struct rcu_head rcu;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nft_trans_gc *nft_trans_gc_alloc(struct nft_set *set,
|
||||||
|
unsigned int gc_seq, gfp_t gfp);
|
||||||
|
void nft_trans_gc_destroy(struct nft_trans_gc *trans);
|
||||||
|
|
||||||
|
struct nft_trans_gc *nft_trans_gc_queue_async(struct nft_trans_gc *gc,
|
||||||
|
unsigned int gc_seq, gfp_t gfp);
|
||||||
|
void nft_trans_gc_queue_async_done(struct nft_trans_gc *gc);
|
||||||
|
|
||||||
|
struct nft_trans_gc *nft_trans_gc_queue_sync(struct nft_trans_gc *gc, gfp_t gfp);
|
||||||
|
void nft_trans_gc_queue_sync_done(struct nft_trans_gc *trans);
|
||||||
|
|
||||||
|
void nft_trans_gc_elem_add(struct nft_trans_gc *gc, void *priv);
|
||||||
|
|
||||||
|
void nft_setelem_data_deactivate(const struct net *net,
|
||||||
|
const struct nft_set *set,
|
||||||
|
struct nft_set_elem *elem);
|
||||||
|
|
||||||
int __init nft_chain_filter_init(void);
|
int __init nft_chain_filter_init(void);
|
||||||
void nft_chain_filter_fini(void);
|
void nft_chain_filter_fini(void);
|
||||||
|
|
||||||
@ -1507,6 +1479,7 @@ struct nftables_pernet {
|
|||||||
struct mutex commit_mutex;
|
struct mutex commit_mutex;
|
||||||
unsigned int base_seq;
|
unsigned int base_seq;
|
||||||
u8 validate_state;
|
u8 validate_state;
|
||||||
|
unsigned int gc_seq;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _NET_NF_TABLES_H */
|
#endif /* _NET_NF_TABLES_H */
|
||||||
|
@ -1799,21 +1799,33 @@ static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
|
|||||||
/* sk_tx_queue_mapping accept only upto a 16-bit value */
|
/* sk_tx_queue_mapping accept only upto a 16-bit value */
|
||||||
if (WARN_ON_ONCE((unsigned short)tx_queue >= USHRT_MAX))
|
if (WARN_ON_ONCE((unsigned short)tx_queue >= USHRT_MAX))
|
||||||
return;
|
return;
|
||||||
sk->sk_tx_queue_mapping = tx_queue;
|
/* Paired with READ_ONCE() in sk_tx_queue_get() and
|
||||||
|
* other WRITE_ONCE() because socket lock might be not held.
|
||||||
|
*/
|
||||||
|
WRITE_ONCE(sk->sk_tx_queue_mapping, tx_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NO_QUEUE_MAPPING USHRT_MAX
|
#define NO_QUEUE_MAPPING USHRT_MAX
|
||||||
|
|
||||||
static inline void sk_tx_queue_clear(struct sock *sk)
|
static inline void sk_tx_queue_clear(struct sock *sk)
|
||||||
{
|
{
|
||||||
sk->sk_tx_queue_mapping = NO_QUEUE_MAPPING;
|
/* Paired with READ_ONCE() in sk_tx_queue_get() and
|
||||||
|
* other WRITE_ONCE() because socket lock might be not held.
|
||||||
|
*/
|
||||||
|
WRITE_ONCE(sk->sk_tx_queue_mapping, NO_QUEUE_MAPPING);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int sk_tx_queue_get(const struct sock *sk)
|
static inline int sk_tx_queue_get(const struct sock *sk)
|
||||||
{
|
{
|
||||||
if (sk && sk->sk_tx_queue_mapping != NO_QUEUE_MAPPING)
|
if (sk) {
|
||||||
return sk->sk_tx_queue_mapping;
|
/* Paired with WRITE_ONCE() in sk_tx_queue_clear()
|
||||||
|
* and sk_tx_queue_set().
|
||||||
|
*/
|
||||||
|
int val = READ_ONCE(sk->sk_tx_queue_mapping);
|
||||||
|
|
||||||
|
if (val != NO_QUEUE_MAPPING)
|
||||||
|
return val;
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1946,7 +1958,7 @@ static inline void dst_negative_advice(struct sock *sk)
|
|||||||
if (ndst != dst) {
|
if (ndst != dst) {
|
||||||
rcu_assign_pointer(sk->sk_dst_cache, ndst);
|
rcu_assign_pointer(sk->sk_dst_cache, ndst);
|
||||||
sk_tx_queue_clear(sk);
|
sk_tx_queue_clear(sk);
|
||||||
sk->sk_dst_pending_confirm = 0;
|
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1957,7 +1969,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)
|
|||||||
struct dst_entry *old_dst;
|
struct dst_entry *old_dst;
|
||||||
|
|
||||||
sk_tx_queue_clear(sk);
|
sk_tx_queue_clear(sk);
|
||||||
sk->sk_dst_pending_confirm = 0;
|
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||||
old_dst = rcu_dereference_protected(sk->sk_dst_cache,
|
old_dst = rcu_dereference_protected(sk->sk_dst_cache,
|
||||||
lockdep_sock_is_held(sk));
|
lockdep_sock_is_held(sk));
|
||||||
rcu_assign_pointer(sk->sk_dst_cache, dst);
|
rcu_assign_pointer(sk->sk_dst_cache, dst);
|
||||||
@ -1970,7 +1982,7 @@ sk_dst_set(struct sock *sk, struct dst_entry *dst)
|
|||||||
struct dst_entry *old_dst;
|
struct dst_entry *old_dst;
|
||||||
|
|
||||||
sk_tx_queue_clear(sk);
|
sk_tx_queue_clear(sk);
|
||||||
sk->sk_dst_pending_confirm = 0;
|
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||||
old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst);
|
old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst);
|
||||||
dst_release(old_dst);
|
dst_release(old_dst);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user