This is the 5.10.70 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmFVcUcACgkQONu9yGCS aT4/Mw//b3IUn6Vy0r8Jc6MsU16U+UY0Rb6o8X6J5V7PXMI2RuHIf6+AXm4CDLPZ jpsgaPB3nSYUz63+b699kB6IZiUTbij8r0O/Yjy1p2/Z6HoDgSOX8WvU25kTO697 MWxZT25Nj8sZzigPuXw1zy1ioZCdeGlRGXrDAoeZt8OL8TMd78eSLISYNQYv38L6 Sg3TbtumEwjfZe3FeyzPA82Qc1jlsZ2ViKJ+E/BC74TJ9DBS5K+uMUzDwDyJEIaB MwswdjvQIbK5cN+uux6Ok3v4/6/bIKeouYkpLnQvnNtIrn8hk8FXO6OamU6XwTGl oI26Hu5mjL2WecHvpQJCcn6h8L0w/dMfQPg2b/m1gJ5l58NJobFS3Uy1bMaGlJic L1K2ZFPHQd+CR9Lvz/umiXqaBgL2K4QKKi28TrWxMgKatrMeip3Lo8krxNuxm0/Z VpJIsOajWkgf3n5HuQ/zfFGl+YUcjtBUqxO+WR3ocTLlN3kcG6ZjEMxHPK8VYmIr Yp4s+WyU7uRlGhSy6UpWI78AHcijx5WKS5n25ZI56VJRi38Qxgb3Q+EZ6vlpJuvh yTCgvjwi4FzLWXeYRR/RXpwzvwS8t5TKJT355ufjqZaAtQk/vE27deFdQs6B7Hqy 17KvN8UjycbWKUXX/zM1CcU6ikXgj/h+q3+kAe99kldpEphjpMs= =vyz1 -----END PGP SIGNATURE----- Merge 5.10.70 into android12-5.10-lts Changes in 5.10.70 PCI: aardvark: Increase polling delay to 1.5s while waiting for PIO response ocfs2: drop acl cache for directories too mm: fix uninitialized use in overcommit_policy_handler usb: gadget: r8a66597: fix a loop in set_feature() usb: dwc2: gadget: Fix ISOC flow for BDMA and Slave usb: dwc2: gadget: Fix ISOC transfer complete handling for DDMA usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned() cifs: fix incorrect check for null pointer in header_assemble xen/x86: fix PV trap handling on secondary processors usb-storage: Add quirk for ScanLogic SL11R-IDE older than 2.6c USB: serial: cp210x: add ID for GW Instek GDM-834x Digital Multimeter USB: cdc-acm: fix minor-number release Revert "USB: bcma: Add a check for devm_gpiod_get" binder: make sure fd closes complete staging: greybus: uart: fix tty use after free Re-enable UAS for LaCie Rugged USB3-FW with fk quirk usb: dwc3: core: balance phy init and exit usb: core: hcd: Add support for deferring roothub registration USB: serial: mos7840: remove duplicated 0xac24 device ID USB: serial: option: add Telit LN920 compositions USB: serial: option: remove duplicate USB device ID USB: serial: option: add device id for Foxconn T99W265 mcb: fix error handling in mcb_alloc_bus() erofs: fix up erofs_lookup tracepoint btrfs: prevent __btrfs_dump_space_info() to underflow its free space xhci: Set HCD flag to defer primary roothub registration serial: 8250: 8250_omap: Fix RX_LVL register offset serial: mvebu-uart: fix driver's tx_empty callback scsi: sd_zbc: Ensure buffer size is aligned to SECTOR_SIZE drm/amd/pm: Update intermediate power state for SI net: hso: fix muxed tty registration comedi: Fix memory leak in compat_insnlist() afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation afs: Fix updating of i_blocks on file/dir extension platform/x86/intel: punit_ipc: Drop wrong use of ACPI_PTR() enetc: Fix illegal access when reading affinity_hint enetc: Fix uninitialized struct dim_sample field usage bnxt_en: Fix TX timeout when TX ring size is set to the smallest net: hns3: fix change RSS 'hfunc' ineffective issue net: hns3: check queue id range before using net/smc: add missing error check in smc_clc_prfx_set() net/smc: fix 'workqueue leaked lock' in smc_conn_abort_work net: dsa: don't allocate the slave_mii_bus using devres net: dsa: realtek: register the MDIO bus under devres kselftest/arm64: signal: Add SVE to the set of features we can check for kselftest/arm64: signal: Skip tests if required features are missing s390/qeth: fix NULL deref in qeth_clear_working_pool_list() gpio: uniphier: Fix void functions to remove return value qed: rdma - don't wait for resources under hw error recovery flow net/mlx4_en: Don't allow aRFS for encapsulated packets atlantic: Fix issue in the pm resume flow. scsi: iscsi: Adjust iface sysfs attr detection scsi: target: Fix the pgr/alua_support_store functions tty: synclink_gt, drop unneeded forward declarations tty: synclink_gt: rename a conflicting function name fpga: machxo2-spi: Return an error on failure fpga: machxo2-spi: Fix missing error code in machxo2_write_complete() nvme-tcp: fix incorrect h2cdata pdu offset accounting treewide: Change list_sort to use const pointers nvme: keep ctrl->namespaces ordered thermal/core: Potential buffer overflow in thermal_build_list_of_policies() cifs: fix a sign extension bug scsi: qla2xxx: Restore initiator in dual mode scsi: lpfc: Use correct scnprintf() limit irqchip/goldfish-pic: Select GENERIC_IRQ_CHIP to fix build irqchip/gic-v3-its: Fix potential VPE leak on error md: fix a lock order reversal in md_alloc x86/asm: Add a missing __iomem annotation in enqcmds() x86/asm: Fix SETZ size enqcmds() build failure io_uring: put provided buffer meta data under memcg accounting blktrace: Fix uaf in blk_trace access after removing by sysfs net: phylink: Update SFP selected interface on advertising changes net: macb: fix use after free on rmmod net: stmmac: allow CSR clock of 300MHz blk-mq: avoid to iterate over stale request m68k: Double cast io functions to unsigned long ipv6: delay fib6_sernum increase in fib6_add cpufreq: intel_pstate: Override parameters if HWP forced by BIOS bpf: Add oversize check before call kvcalloc() xen/balloon: use a kernel thread instead a workqueue nvme-multipath: fix ANA state updates when a namespace is not present nvme-rdma: destroy cm id before destroy qp to avoid use after free sparc32: page align size in arch_dma_alloc amd/display: downgrade validation failure log level block: check if a profile is actually registered in blk_integrity_unregister block: flush the integrity workqueue in blk_integrity_unregister blk-cgroup: fix UAF by grabbing blkcg lock before destroying blkg pd compiler.h: Introduce absolute_pointer macro net: i825xx: Use absolute_pointer for memcpy from fixed memory location sparc: avoid stringop-overread errors qnx4: avoid stringop-overread errors parisc: Use absolute_pointer() to define PAGE0 arm64: Mark __stack_chk_guard as __ro_after_init alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile net: 6pack: Fix tx timeout and slot time spi: Fix tegra20 build with CONFIG_PM=n EDAC/synopsys: Fix wrong value type assignment for edac_mode EDAC/dmc520: Assign the proper type to dimm->edac_mode thermal/drivers/int340x: Do not set a wrong tcc offset on resume USB: serial: cp210x: fix dropped characters with CP2102 xen/balloon: fix balloon kthread freezing qnx4: work around gcc false positive warning bug Linux 5.10.70 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I0be3ab08ab5dd724a79c5c5ff8e49c18d2666193
This commit is contained in:
commit
d69751309b
140 changed files with 862 additions and 593 deletions
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 69
|
||||
SUBLEVEL = 70
|
||||
EXTRAVERSION =
|
||||
NAME = Dare mighty things
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ extern inline void set_hae(unsigned long new_hae)
|
|||
* Change virtual addresses to physical addresses and vv.
|
||||
*/
|
||||
#ifdef USE_48_BIT_KSEG
|
||||
static inline unsigned long virt_to_phys(void *address)
|
||||
static inline unsigned long virt_to_phys(volatile void *address)
|
||||
{
|
||||
return (unsigned long)address - IDENT_ADDR;
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ static inline void * phys_to_virt(unsigned long address)
|
|||
return (void *) (address + IDENT_ADDR);
|
||||
}
|
||||
#else
|
||||
static inline unsigned long virt_to_phys(void *address)
|
||||
static inline unsigned long virt_to_phys(volatile void *address)
|
||||
{
|
||||
unsigned long phys = (unsigned long)address;
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ static inline void * phys_to_virt(unsigned long address)
|
|||
extern unsigned long __direct_map_base;
|
||||
extern unsigned long __direct_map_size;
|
||||
|
||||
static inline unsigned long __deprecated virt_to_bus(void *address)
|
||||
static inline unsigned long __deprecated virt_to_bus(volatile void *address)
|
||||
{
|
||||
unsigned long phys = virt_to_phys(address);
|
||||
unsigned long bus = phys + __direct_map_base;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
#if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_STACKPROTECTOR_PER_TASK)
|
||||
#include <linux/stackprotector.h>
|
||||
unsigned long __stack_chk_guard __read_mostly;
|
||||
unsigned long __stack_chk_guard __ro_after_init;
|
||||
EXPORT_SYMBOL(__stack_chk_guard);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2190,8 +2190,8 @@ static int vgic_its_restore_ite(struct vgic_its *its, u32 event_id,
|
|||
return offset;
|
||||
}
|
||||
|
||||
static int vgic_its_ite_cmp(void *priv, struct list_head *a,
|
||||
struct list_head *b)
|
||||
static int vgic_its_ite_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct its_ite *itea = container_of(a, struct its_ite, ite_list);
|
||||
struct its_ite *iteb = container_of(b, struct its_ite, ite_list);
|
||||
|
|
@ -2329,8 +2329,8 @@ static int vgic_its_restore_dte(struct vgic_its *its, u32 id,
|
|||
return offset;
|
||||
}
|
||||
|
||||
static int vgic_its_device_cmp(void *priv, struct list_head *a,
|
||||
struct list_head *b)
|
||||
static int vgic_its_device_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct its_device *deva = container_of(a, struct its_device, dev_list);
|
||||
struct its_device *devb = container_of(b, struct its_device, dev_list);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,8 @@ static struct kvm_vcpu *vgic_target_oracle(struct vgic_irq *irq)
|
|||
* Return negative if "a" sorts before "b", 0 to preserve order, and positive
|
||||
* to sort "b" before "a".
|
||||
*/
|
||||
static int vgic_irq_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int vgic_irq_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct vgic_irq *irqa = container_of(a, struct vgic_irq, ap_list);
|
||||
struct vgic_irq *irqb = container_of(b, struct vgic_irq, ap_list);
|
||||
|
|
|
|||
|
|
@ -17,21 +17,21 @@
|
|||
* two accesses to memory, which may be undesirable for some devices.
|
||||
*/
|
||||
#define in_8(addr) \
|
||||
({ u8 __v = (*(__force volatile u8 *) (addr)); __v; })
|
||||
({ u8 __v = (*(__force volatile u8 *) (unsigned long)(addr)); __v; })
|
||||
#define in_be16(addr) \
|
||||
({ u16 __v = (*(__force volatile u16 *) (addr)); __v; })
|
||||
({ u16 __v = (*(__force volatile u16 *) (unsigned long)(addr)); __v; })
|
||||
#define in_be32(addr) \
|
||||
({ u32 __v = (*(__force volatile u32 *) (addr)); __v; })
|
||||
({ u32 __v = (*(__force volatile u32 *) (unsigned long)(addr)); __v; })
|
||||
#define in_le16(addr) \
|
||||
({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (addr)); __v; })
|
||||
({ u16 __v = le16_to_cpu(*(__force volatile __le16 *) (unsigned long)(addr)); __v; })
|
||||
#define in_le32(addr) \
|
||||
({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (addr)); __v; })
|
||||
({ u32 __v = le32_to_cpu(*(__force volatile __le32 *) (unsigned long)(addr)); __v; })
|
||||
|
||||
#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b))
|
||||
#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w))
|
||||
#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l))
|
||||
#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (addr)) = cpu_to_le16(w))
|
||||
#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
|
||||
#define out_8(addr,b) (void)((*(__force volatile u8 *) (unsigned long)(addr)) = (b))
|
||||
#define out_be16(addr,w) (void)((*(__force volatile u16 *) (unsigned long)(addr)) = (w))
|
||||
#define out_be32(addr,l) (void)((*(__force volatile u32 *) (unsigned long)(addr)) = (l))
|
||||
#define out_le16(addr,w) (void)((*(__force volatile __le16 *) (unsigned long)(addr)) = cpu_to_le16(w))
|
||||
#define out_le32(addr,l) (void)((*(__force volatile __le32 *) (unsigned long)(addr)) = cpu_to_le32(l))
|
||||
|
||||
#define raw_inb in_8
|
||||
#define raw_inw in_be16
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ extern int npmem_ranges;
|
|||
#include <asm-generic/getorder.h>
|
||||
#include <asm/pdc.h>
|
||||
|
||||
#define PAGE0 ((struct zeropage *)__PAGE_OFFSET)
|
||||
#define PAGE0 ((struct zeropage *)absolute_pointer(__PAGE_OFFSET))
|
||||
|
||||
/* DEFINITION OF THE ZERO-PAGE (PAG0) */
|
||||
/* based on work by Jason Eckhardt (jason@equator.com) */
|
||||
|
|
|
|||
|
|
@ -356,7 +356,9 @@ err_nomem:
|
|||
void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
||||
dma_addr_t dma_addr, unsigned long attrs)
|
||||
{
|
||||
if (!sparc_dma_free_resource(cpu_addr, PAGE_ALIGN(size)))
|
||||
size = PAGE_ALIGN(size);
|
||||
|
||||
if (!sparc_dma_free_resource(cpu_addr, size))
|
||||
return;
|
||||
|
||||
dma_make_coherent(dma_addr, size);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ struct mdesc_hdr {
|
|||
u32 node_sz; /* node block size */
|
||||
u32 name_sz; /* name block size */
|
||||
u32 data_sz; /* data block size */
|
||||
char data[];
|
||||
} __attribute__((aligned(16)));
|
||||
|
||||
struct mdesc_elem {
|
||||
|
|
@ -612,7 +613,7 @@ EXPORT_SYMBOL(mdesc_get_node_info);
|
|||
|
||||
static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
|
||||
{
|
||||
return (struct mdesc_elem *) (mdesc + 1);
|
||||
return (struct mdesc_elem *) mdesc->data;
|
||||
}
|
||||
|
||||
static void *name_block(struct mdesc_hdr *mdesc)
|
||||
|
|
|
|||
|
|
@ -286,8 +286,8 @@ static inline void movdir64b(void *dst, const void *src)
|
|||
static inline int enqcmds(void __iomem *dst, const void *src)
|
||||
{
|
||||
const struct { char _[64]; } *__src = src;
|
||||
struct { char _[64]; } *__dst = dst;
|
||||
int zf;
|
||||
struct { char _[64]; } __iomem *__dst = dst;
|
||||
bool zf;
|
||||
|
||||
/*
|
||||
* ENQCMDS %(rdx), rax
|
||||
|
|
|
|||
|
|
@ -736,8 +736,8 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
|
|||
preempt_enable();
|
||||
}
|
||||
|
||||
static void xen_convert_trap_info(const struct desc_ptr *desc,
|
||||
struct trap_info *traps)
|
||||
static unsigned xen_convert_trap_info(const struct desc_ptr *desc,
|
||||
struct trap_info *traps, bool full)
|
||||
{
|
||||
unsigned in, out, count;
|
||||
|
||||
|
|
@ -747,17 +747,18 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
|
|||
for (in = out = 0; in < count; in++) {
|
||||
gate_desc *entry = (gate_desc *)(desc->address) + in;
|
||||
|
||||
if (cvt_gate_to_trap(in, entry, &traps[out]))
|
||||
if (cvt_gate_to_trap(in, entry, &traps[out]) || full)
|
||||
out++;
|
||||
}
|
||||
traps[out].address = 0;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void xen_copy_trap_info(struct trap_info *traps)
|
||||
{
|
||||
const struct desc_ptr *desc = this_cpu_ptr(&idt_desc);
|
||||
|
||||
xen_convert_trap_info(desc, traps);
|
||||
xen_convert_trap_info(desc, traps, true);
|
||||
}
|
||||
|
||||
/* Load a new IDT into Xen. In principle this can be per-CPU, so we
|
||||
|
|
@ -767,6 +768,7 @@ static void xen_load_idt(const struct desc_ptr *desc)
|
|||
{
|
||||
static DEFINE_SPINLOCK(lock);
|
||||
static struct trap_info traps[257];
|
||||
unsigned out;
|
||||
|
||||
trace_xen_cpu_load_idt(desc);
|
||||
|
||||
|
|
@ -774,7 +776,8 @@ static void xen_load_idt(const struct desc_ptr *desc)
|
|||
|
||||
memcpy(this_cpu_ptr(&idt_desc), desc, sizeof(idt_desc));
|
||||
|
||||
xen_convert_trap_info(desc, traps);
|
||||
out = xen_convert_trap_info(desc, traps, false);
|
||||
memset(&traps[out], 0, sizeof(traps[0]));
|
||||
|
||||
xen_mc_flush();
|
||||
if (HYPERVISOR_set_trap_table(traps))
|
||||
|
|
|
|||
|
|
@ -1391,10 +1391,14 @@ enomem:
|
|||
/* alloc failed, nothing's initialized yet, free everything */
|
||||
spin_lock_irq(&q->queue_lock);
|
||||
list_for_each_entry(blkg, &q->blkg_list, q_node) {
|
||||
struct blkcg *blkcg = blkg->blkcg;
|
||||
|
||||
spin_lock(&blkcg->lock);
|
||||
if (blkg->pd[pol->plid]) {
|
||||
pol->pd_free_fn(blkg->pd[pol->plid]);
|
||||
blkg->pd[pol->plid] = NULL;
|
||||
}
|
||||
spin_unlock(&blkcg->lock);
|
||||
}
|
||||
spin_unlock_irq(&q->queue_lock);
|
||||
ret = -ENOMEM;
|
||||
|
|
@ -1426,12 +1430,16 @@ void blkcg_deactivate_policy(struct request_queue *q,
|
|||
__clear_bit(pol->plid, q->blkcg_pols);
|
||||
|
||||
list_for_each_entry(blkg, &q->blkg_list, q_node) {
|
||||
struct blkcg *blkcg = blkg->blkcg;
|
||||
|
||||
spin_lock(&blkcg->lock);
|
||||
if (blkg->pd[pol->plid]) {
|
||||
if (pol->pd_offline_fn)
|
||||
pol->pd_offline_fn(blkg->pd[pol->plid]);
|
||||
pol->pd_free_fn(blkg->pd[pol->plid]);
|
||||
blkg->pd[pol->plid] = NULL;
|
||||
}
|
||||
spin_unlock(&blkcg->lock);
|
||||
}
|
||||
|
||||
spin_unlock_irq(&q->queue_lock);
|
||||
|
|
|
|||
|
|
@ -426,8 +426,15 @@ EXPORT_SYMBOL(blk_integrity_register);
|
|||
*/
|
||||
void blk_integrity_unregister(struct gendisk *disk)
|
||||
{
|
||||
struct blk_integrity *bi = &disk->queue->integrity;
|
||||
|
||||
if (!bi->profile)
|
||||
return;
|
||||
|
||||
/* ensure all bios are off the integrity workqueue */
|
||||
blk_flush_integrity();
|
||||
blk_queue_flag_clear(QUEUE_FLAG_STABLE_WRITES, disk->queue);
|
||||
memset(&disk->queue->integrity, 0, sizeof(struct blk_integrity));
|
||||
memset(bi, 0, sizeof(*bi));
|
||||
}
|
||||
EXPORT_SYMBOL(blk_integrity_unregister);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ void blk_mq_sched_restart(struct blk_mq_hw_ctx *hctx)
|
|||
blk_mq_run_hw_queue(hctx, true);
|
||||
}
|
||||
|
||||
static int sched_rq_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int sched_rq_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct request *rqa = container_of(a, struct request, queuelist);
|
||||
struct request *rqb = container_of(b, struct request, queuelist);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ static struct request *blk_mq_find_and_get_req(struct blk_mq_tags *tags,
|
|||
|
||||
spin_lock_irqsave(&tags->lock, flags);
|
||||
rq = tags->rqs[bitnr];
|
||||
if (!rq || !refcount_inc_not_zero(&rq->ref))
|
||||
if (!rq || rq->tag != bitnr || !refcount_inc_not_zero(&rq->ref))
|
||||
rq = NULL;
|
||||
spin_unlock_irqrestore(&tags->lock, flags);
|
||||
return rq;
|
||||
|
|
|
|||
|
|
@ -1924,7 +1924,8 @@ void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
|
|||
spin_unlock(&ctx->lock);
|
||||
}
|
||||
|
||||
static int plug_rq_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int plug_rq_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct request *rqa = container_of(a, struct request, queuelist);
|
||||
struct request *rqb = container_of(b, struct request, queuelist);
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,8 @@ static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int nfit_mem_cmp(void *priv, struct list_head *_a, struct list_head *_b)
|
||||
static int nfit_mem_cmp(void *priv, const struct list_head *_a,
|
||||
const struct list_head *_b)
|
||||
{
|
||||
struct nfit_mem *a = container_of(_a, typeof(*a), list);
|
||||
struct nfit_mem *b = container_of(_b, typeof(*b), list);
|
||||
|
|
|
|||
|
|
@ -558,7 +558,8 @@ static bool hmat_update_best(u8 type, u32 value, u32 *best)
|
|||
return updated;
|
||||
}
|
||||
|
||||
static int initiator_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int initiator_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct memory_initiator *ia;
|
||||
struct memory_initiator *ib;
|
||||
|
|
|
|||
|
|
@ -1977,6 +1977,7 @@ static void binder_deferred_fd_close(int fd)
|
|||
}
|
||||
|
||||
static void binder_transaction_buffer_release(struct binder_proc *proc,
|
||||
struct binder_thread *thread,
|
||||
struct binder_buffer *buffer,
|
||||
binder_size_t failed_at,
|
||||
bool is_failure)
|
||||
|
|
@ -2136,8 +2137,16 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
|
|||
&proc->alloc, &fd, buffer,
|
||||
offset, sizeof(fd));
|
||||
WARN_ON(err);
|
||||
if (!err)
|
||||
if (!err) {
|
||||
binder_deferred_fd_close(fd);
|
||||
/*
|
||||
* Need to make sure the thread goes
|
||||
* back to userspace to complete the
|
||||
* deferred close
|
||||
*/
|
||||
if (thread)
|
||||
thread->looper_need_return = true;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
|
|
@ -3256,7 +3265,7 @@ err_bad_parent:
|
|||
err_copy_data_failed:
|
||||
binder_free_txn_fixups(t);
|
||||
trace_binder_transaction_failed_buffer_release(t->buffer);
|
||||
binder_transaction_buffer_release(target_proc, t->buffer,
|
||||
binder_transaction_buffer_release(target_proc, NULL, t->buffer,
|
||||
buffer_offset, true);
|
||||
if (target_node)
|
||||
binder_dec_node_tmpref(target_node);
|
||||
|
|
@ -3335,7 +3344,9 @@ err_invalid_target_handle:
|
|||
* Cleanup buffer and free it.
|
||||
*/
|
||||
static void
|
||||
binder_free_buf(struct binder_proc *proc, struct binder_buffer *buffer)
|
||||
binder_free_buf(struct binder_proc *proc,
|
||||
struct binder_thread *thread,
|
||||
struct binder_buffer *buffer)
|
||||
{
|
||||
binder_inner_proc_lock(proc);
|
||||
if (buffer->transaction) {
|
||||
|
|
@ -3363,7 +3374,7 @@ binder_free_buf(struct binder_proc *proc, struct binder_buffer *buffer)
|
|||
binder_node_inner_unlock(buf_node);
|
||||
}
|
||||
trace_binder_transaction_buffer_release(buffer);
|
||||
binder_transaction_buffer_release(proc, buffer, 0, false);
|
||||
binder_transaction_buffer_release(proc, thread, buffer, 0, false);
|
||||
binder_alloc_free_buf(&proc->alloc, buffer);
|
||||
}
|
||||
|
||||
|
|
@ -3557,7 +3568,7 @@ static int binder_thread_write(struct binder_proc *proc,
|
|||
proc->pid, thread->pid, (u64)data_ptr,
|
||||
buffer->debug_id,
|
||||
buffer->transaction ? "active" : "finished");
|
||||
binder_free_buf(proc, buffer);
|
||||
binder_free_buf(proc, thread, buffer);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -4251,7 +4262,7 @@ retry:
|
|||
buffer->transaction = NULL;
|
||||
binder_cleanup_transaction(t, "fd fixups failed",
|
||||
BR_FAILED_REPLY);
|
||||
binder_free_buf(proc, buffer);
|
||||
binder_free_buf(proc, thread, buffer);
|
||||
binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
|
||||
"%d:%d %stransaction %d fd fixups failed %d/%d, line %d\n",
|
||||
proc->pid, thread->pid,
|
||||
|
|
|
|||
|
|
@ -503,8 +503,8 @@ static int ti_sci_scan_clocks_from_fw(struct sci_clk_provider *provider)
|
|||
|
||||
#else
|
||||
|
||||
static int _cmp_sci_clk_list(void *priv, struct list_head *a,
|
||||
struct list_head *b)
|
||||
static int _cmp_sci_clk_list(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct sci_clk *ca = container_of(a, struct sci_clk, node);
|
||||
struct sci_clk *cb = container_of(b, struct sci_clk, node);
|
||||
|
|
|
|||
|
|
@ -3035,11 +3035,15 @@ static int __init intel_pstate_init(void)
|
|||
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
|
||||
return -ENODEV;
|
||||
|
||||
if (no_load)
|
||||
return -ENODEV;
|
||||
|
||||
id = x86_match_cpu(hwp_support_ids);
|
||||
if (id) {
|
||||
bool hwp_forced = intel_pstate_hwp_is_enabled();
|
||||
|
||||
if (hwp_forced)
|
||||
pr_info("HWP enabled by BIOS\n");
|
||||
else if (no_load)
|
||||
return -ENODEV;
|
||||
|
||||
copy_cpu_funcs(&core_funcs);
|
||||
/*
|
||||
* Avoid enabling HWP for processors without EPP support,
|
||||
|
|
@ -3049,8 +3053,7 @@ static int __init intel_pstate_init(void)
|
|||
* If HWP is enabled already, though, there is no choice but to
|
||||
* deal with it.
|
||||
*/
|
||||
if ((!no_hwp && boot_cpu_has(X86_FEATURE_HWP_EPP)) ||
|
||||
intel_pstate_hwp_is_enabled()) {
|
||||
if ((!no_hwp && boot_cpu_has(X86_FEATURE_HWP_EPP)) || hwp_forced) {
|
||||
hwp_active++;
|
||||
hwp_mode_bdw = id->driver_data;
|
||||
intel_pstate.attr = hwp_cpufreq_attrs;
|
||||
|
|
@ -3061,7 +3064,11 @@ static int __init intel_pstate_init(void)
|
|||
|
||||
goto hwp_cpu_matched;
|
||||
}
|
||||
pr_info("HWP not enabled\n");
|
||||
} else {
|
||||
if (no_load)
|
||||
return -ENODEV;
|
||||
|
||||
id = x86_match_cpu(intel_pstate_cpu_ids);
|
||||
if (!id) {
|
||||
pr_info("CPU model not supported\n");
|
||||
|
|
@ -3138,10 +3145,9 @@ static int __init intel_pstate_setup(char *str)
|
|||
else if (!strcmp(str, "passive"))
|
||||
default_driver = &intel_cpufreq;
|
||||
|
||||
if (!strcmp(str, "no_hwp")) {
|
||||
pr_info("HWP disabled\n");
|
||||
if (!strcmp(str, "no_hwp"))
|
||||
no_hwp = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(str, "force"))
|
||||
force_load = 1;
|
||||
if (!strcmp(str, "hwp_only"))
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ static void dmc520_init_csrow(struct mem_ctl_info *mci)
|
|||
dimm->grain = pvt->mem_width_in_bytes;
|
||||
dimm->dtype = dt;
|
||||
dimm->mtype = mt;
|
||||
dimm->edac_mode = EDAC_FLAG_SECDED;
|
||||
dimm->edac_mode = EDAC_SECDED;
|
||||
dimm->nr_pages = pages_per_rank / csi->nr_channels;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -782,7 +782,7 @@ static void init_csrows(struct mem_ctl_info *mci)
|
|||
|
||||
for (j = 0; j < csi->nr_channels; j++) {
|
||||
dimm = csi->channels[j]->dimm;
|
||||
dimm->edac_mode = EDAC_FLAG_SECDED;
|
||||
dimm->edac_mode = EDAC_SECDED;
|
||||
dimm->mtype = p_data->get_mtype(priv->baseaddr);
|
||||
dimm->nr_pages = (size >> PAGE_SHIFT) / csi->nr_channels;
|
||||
dimm->grain = SYNPS_EDAC_ERR_GRAIN;
|
||||
|
|
|
|||
|
|
@ -225,8 +225,10 @@ static int machxo2_write_init(struct fpga_manager *mgr,
|
|||
goto fail;
|
||||
|
||||
get_status(spi, &status);
|
||||
if (test_bit(FAIL, &status))
|
||||
if (test_bit(FAIL, &status)) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
dump_status_reg(&status);
|
||||
|
||||
spi_message_init(&msg);
|
||||
|
|
@ -313,6 +315,7 @@ static int machxo2_write_complete(struct fpga_manager *mgr,
|
|||
dump_status_reg(&status);
|
||||
if (!test_bit(DONE, &status)) {
|
||||
machxo2_cleanup(mgr);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -335,6 +338,7 @@ static int machxo2_write_complete(struct fpga_manager *mgr,
|
|||
break;
|
||||
if (++refreshloop == MACHXO2_MAX_REFRESH_LOOP) {
|
||||
machxo2_cleanup(mgr);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
} while (1);
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ static void uniphier_gpio_irq_mask(struct irq_data *data)
|
|||
|
||||
uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, 0);
|
||||
|
||||
return irq_chip_mask_parent(data);
|
||||
irq_chip_mask_parent(data);
|
||||
}
|
||||
|
||||
static void uniphier_gpio_irq_unmask(struct irq_data *data)
|
||||
|
|
@ -194,7 +194,7 @@ static void uniphier_gpio_irq_unmask(struct irq_data *data)
|
|||
|
||||
uniphier_gpio_reg_update(priv, UNIPHIER_GPIO_IRQ_EN, mask, mask);
|
||||
|
||||
return irq_chip_unmask_parent(data);
|
||||
irq_chip_unmask_parent(data);
|
||||
}
|
||||
|
||||
static int uniphier_gpio_irq_set_type(struct irq_data *data, unsigned int type)
|
||||
|
|
|
|||
|
|
@ -8962,7 +8962,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
|
|||
goto fail;
|
||||
status = dc_validate_global_state(dc, dm_state->context, false);
|
||||
if (status != DC_OK) {
|
||||
DC_LOG_WARNING("DC global validation failure: %s (%d)",
|
||||
drm_dbg_atomic(dev,
|
||||
"DC global validation failure: %s (%d)",
|
||||
dc_status_to_str(status), status);
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -6870,6 +6870,8 @@ static int si_dpm_enable(struct amdgpu_device *adev)
|
|||
si_enable_auto_throttle_source(adev, AMDGPU_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
|
||||
si_thermal_start_thermal_controller(adev);
|
||||
|
||||
ni_update_current_ps(adev, boot_ps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1290,7 +1290,8 @@ EXPORT_SYMBOL(drm_mode_prune_invalid);
|
|||
* Negative if @lh_a is better than @lh_b, zero if they're equivalent, or
|
||||
* positive if @lh_b is better than @lh_a.
|
||||
*/
|
||||
static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head *lh_b)
|
||||
static int drm_mode_compare(void *priv, const struct list_head *lh_a,
|
||||
const struct list_head *lh_b)
|
||||
{
|
||||
struct drm_display_mode *a = list_entry(lh_a, struct drm_display_mode, head);
|
||||
struct drm_display_mode *b = list_entry(lh_b, struct drm_display_mode, head);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ static const u8 uabi_classes[] = {
|
|||
[VIDEO_ENHANCEMENT_CLASS] = I915_ENGINE_CLASS_VIDEO_ENHANCE,
|
||||
};
|
||||
|
||||
static int engine_cmp(void *priv, struct list_head *A, struct list_head *B)
|
||||
static int engine_cmp(void *priv, const struct list_head *A,
|
||||
const struct list_head *B)
|
||||
{
|
||||
const struct intel_engine_cs *a =
|
||||
container_of((struct rb_node *)A, typeof(*a), uabi_node);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ struct diff_mmio {
|
|||
|
||||
/* Compare two diff_mmio items. */
|
||||
static int mmio_offset_compare(void *priv,
|
||||
struct list_head *a, struct list_head *b)
|
||||
const struct list_head *a, const struct list_head *b)
|
||||
{
|
||||
struct diff_mmio *ma;
|
||||
struct diff_mmio *mb;
|
||||
|
|
|
|||
|
|
@ -1075,7 +1075,8 @@ static int igt_ppgtt_shrink_boom(void *arg)
|
|||
return exercise_ppgtt(arg, shrink_boom);
|
||||
}
|
||||
|
||||
static int sort_holes(void *priv, struct list_head *A, struct list_head *B)
|
||||
static int sort_holes(void *priv, const struct list_head *A,
|
||||
const struct list_head *B)
|
||||
{
|
||||
struct drm_mm_node *a = list_entry(A, typeof(*a), hole_stack);
|
||||
struct drm_mm_node *b = list_entry(B, typeof(*b), hole_stack);
|
||||
|
|
|
|||
|
|
@ -394,8 +394,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cmp_size_smaller_first(void *priv, struct list_head *a,
|
||||
struct list_head *b)
|
||||
static int cmp_size_smaller_first(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct radeon_bo_list *la = list_entry(a, struct radeon_bo_list, tv.head);
|
||||
struct radeon_bo_list *lb = list_entry(b, struct radeon_bo_list, tv.head);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ usnic_uiom_interval_node_alloc(long int start, long int last, int ref_cnt,
|
|||
return interval;
|
||||
}
|
||||
|
||||
static int interval_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int interval_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct usnic_uiom_interval_node *node_a, *node_b;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ struct bcm_voter {
|
|||
u32 tcs_wait;
|
||||
};
|
||||
|
||||
static int cmp_vcd(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int cmp_vcd(void *priv, const struct list_head *a, const struct list_head *b)
|
||||
{
|
||||
const struct qcom_icc_bcm *bcm_a =
|
||||
list_entry(a, struct qcom_icc_bcm, list);
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ config MESON_IRQ_GPIO
|
|||
config GOLDFISH_PIC
|
||||
bool "Goldfish programmable interrupt controller"
|
||||
depends on MIPS && (GOLDFISH || COMPILE_TEST)
|
||||
select GENERIC_IRQ_CHIP
|
||||
select IRQ_DOMAIN
|
||||
help
|
||||
Say yes here to enable Goldfish interrupt controller driver used
|
||||
|
|
|
|||
|
|
@ -4493,7 +4493,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
|
|||
|
||||
if (err) {
|
||||
if (i > 0)
|
||||
its_vpe_irq_domain_free(domain, virq, i - 1);
|
||||
its_vpe_irq_domain_free(domain, virq, i);
|
||||
|
||||
its_lpi_free(bitmap, base, nr_ids);
|
||||
its_free_prop_table(vprop_page);
|
||||
|
|
|
|||
|
|
@ -277,8 +277,8 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
|
|||
|
||||
bus_nr = ida_simple_get(&mcb_ida, 0, 0, GFP_KERNEL);
|
||||
if (bus_nr < 0) {
|
||||
rc = bus_nr;
|
||||
goto err_free;
|
||||
kfree(bus);
|
||||
return ERR_PTR(bus_nr);
|
||||
}
|
||||
|
||||
bus->bus_nr = bus_nr;
|
||||
|
|
@ -293,12 +293,12 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
|
|||
dev_set_name(&bus->dev, "mcb:%d", bus_nr);
|
||||
rc = device_add(&bus->dev);
|
||||
if (rc)
|
||||
goto err_free;
|
||||
goto err_put;
|
||||
|
||||
return bus;
|
||||
err_free:
|
||||
put_device(carrier);
|
||||
kfree(bus);
|
||||
|
||||
err_put:
|
||||
put_device(&bus->dev);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mcb_alloc_bus, MCB);
|
||||
|
|
|
|||
|
|
@ -5759,10 +5759,6 @@ static int md_alloc(dev_t dev, char *name)
|
|||
disk->flags |= GENHD_FL_EXT_DEVT;
|
||||
disk->events |= DISK_EVENT_MEDIA_CHANGE;
|
||||
mddev->gendisk = disk;
|
||||
/* As soon as we call add_disk(), another thread could get
|
||||
* through to md_open, so make sure it doesn't get too far
|
||||
*/
|
||||
mutex_lock(&mddev->open_mutex);
|
||||
add_disk(disk);
|
||||
|
||||
error = kobject_add(&mddev->kobj, &disk_to_dev(disk)->kobj, "%s", "md");
|
||||
|
|
@ -5777,7 +5773,6 @@ static int md_alloc(dev_t dev, char *name)
|
|||
if (mddev->kobj.sd &&
|
||||
sysfs_create_group(&mddev->kobj, &md_bitmap_group))
|
||||
pr_debug("pointless warning\n");
|
||||
mutex_unlock(&mddev->open_mutex);
|
||||
abort:
|
||||
mutex_unlock(&disks_mutex);
|
||||
if (!error && mddev->kobj.sd) {
|
||||
|
|
|
|||
|
|
@ -953,7 +953,8 @@ static void dispatch_bio_list(struct bio_list *tmp)
|
|||
submit_bio_noacct(bio);
|
||||
}
|
||||
|
||||
static int cmp_stripe(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int cmp_stripe(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
const struct r5pending_data *da = list_entry(a,
|
||||
struct r5pending_data, sibling);
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ static void sram_free_partitions(struct sram_dev *sram)
|
|||
}
|
||||
}
|
||||
|
||||
static int sram_reserve_cmp(void *priv, struct list_head *a,
|
||||
struct list_head *b)
|
||||
static int sram_reserve_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct sram_reserve *ra = list_entry(a, struct sram_reserve, list);
|
||||
struct sram_reserve *rb = list_entry(b, struct sram_reserve, list);
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ int realtek_smi_setup_mdio(struct realtek_smi *smi)
|
|||
smi->slave_mii_bus->parent = smi->dev;
|
||||
smi->ds->slave_mii_bus = smi->slave_mii_bus;
|
||||
|
||||
ret = of_mdiobus_register(smi->slave_mii_bus, mdio_np);
|
||||
ret = devm_of_mdiobus_register(smi->dev, smi->slave_mii_bus, mdio_np);
|
||||
if (ret) {
|
||||
dev_err(smi->dev, "unable to register MDIO bus %s\n",
|
||||
smi->slave_mii_bus->id);
|
||||
|
|
|
|||
|
|
@ -419,13 +419,13 @@ static int atl_resume_common(struct device *dev, bool deep)
|
|||
if (deep) {
|
||||
/* Reinitialize Nic/Vecs objects */
|
||||
aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol);
|
||||
|
||||
ret = aq_nic_init(nic);
|
||||
if (ret)
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
if (netif_running(nic->ndev)) {
|
||||
ret = aq_nic_init(nic);
|
||||
if (ret)
|
||||
goto err_exit;
|
||||
|
||||
ret = aq_nic_start(nic);
|
||||
if (ret)
|
||||
goto err_exit;
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ static bool bnxt_txr_netif_try_stop_queue(struct bnxt *bp,
|
|||
* netif_tx_queue_stopped().
|
||||
*/
|
||||
smp_mb();
|
||||
if (bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh) {
|
||||
if (bnxt_tx_avail(bp, txr) >= bp->tx_wake_thresh) {
|
||||
netif_tx_wake_queue(txq);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -717,7 +717,7 @@ next_tx_int:
|
|||
smp_mb();
|
||||
|
||||
if (unlikely(netif_tx_queue_stopped(txq)) &&
|
||||
bnxt_tx_avail(bp, txr) > bp->tx_wake_thresh &&
|
||||
bnxt_tx_avail(bp, txr) >= bp->tx_wake_thresh &&
|
||||
READ_ONCE(txr->dev_state) != BNXT_DEV_STATE_CLOSING)
|
||||
netif_tx_wake_queue(txq);
|
||||
}
|
||||
|
|
@ -2300,7 +2300,7 @@ static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
|
|||
if (TX_CMP_TYPE(txcmp) == CMP_TYPE_TX_L2_CMP) {
|
||||
tx_pkts++;
|
||||
/* return full budget so NAPI will complete. */
|
||||
if (unlikely(tx_pkts > bp->tx_wake_thresh)) {
|
||||
if (unlikely(tx_pkts >= bp->tx_wake_thresh)) {
|
||||
rx_pkts = budget;
|
||||
raw_cons = NEXT_RAW_CMP(raw_cons);
|
||||
if (budget)
|
||||
|
|
@ -3431,7 +3431,7 @@ static int bnxt_init_tx_rings(struct bnxt *bp)
|
|||
u16 i;
|
||||
|
||||
bp->tx_wake_thresh = max_t(int, bp->tx_ring_size / 2,
|
||||
MAX_SKB_FRAGS + 1);
|
||||
BNXT_MIN_TX_DESC_CNT);
|
||||
|
||||
for (i = 0; i < bp->tx_nr_rings; i++) {
|
||||
struct bnxt_tx_ring_info *txr = &bp->tx_ring[i];
|
||||
|
|
|
|||
|
|
@ -611,6 +611,11 @@ struct nqe_cn {
|
|||
#define BNXT_MAX_RX_JUM_DESC_CNT (RX_DESC_CNT * MAX_RX_AGG_PAGES - 1)
|
||||
#define BNXT_MAX_TX_DESC_CNT (TX_DESC_CNT * MAX_TX_PAGES - 1)
|
||||
|
||||
/* Minimum TX BDs for a TX packet with MAX_SKB_FRAGS + 1. We need one extra
|
||||
* BD because the first TX BD is always a long BD.
|
||||
*/
|
||||
#define BNXT_MIN_TX_DESC_CNT (MAX_SKB_FRAGS + 2)
|
||||
|
||||
#define RX_RING(x) (((x) & ~(RX_DESC_CNT - 1)) >> (BNXT_PAGE_SHIFT - 4))
|
||||
#define RX_IDX(x) ((x) & (RX_DESC_CNT - 1))
|
||||
|
||||
|
|
|
|||
|
|
@ -780,7 +780,7 @@ static int bnxt_set_ringparam(struct net_device *dev,
|
|||
|
||||
if ((ering->rx_pending > BNXT_MAX_RX_DESC_CNT) ||
|
||||
(ering->tx_pending > BNXT_MAX_TX_DESC_CNT) ||
|
||||
(ering->tx_pending <= MAX_SKB_FRAGS))
|
||||
(ering->tx_pending < BNXT_MIN_TX_DESC_CNT))
|
||||
return -EINVAL;
|
||||
|
||||
if (netif_running(dev))
|
||||
|
|
|
|||
|
|
@ -111,9 +111,9 @@ static void macb_remove(struct pci_dev *pdev)
|
|||
struct platform_device *plat_dev = pci_get_drvdata(pdev);
|
||||
struct macb_platform_data *plat_data = dev_get_platdata(&plat_dev->dev);
|
||||
|
||||
platform_device_unregister(plat_dev);
|
||||
clk_unregister(plat_data->pclk);
|
||||
clk_unregister(plat_data->hclk);
|
||||
platform_device_unregister(plat_dev);
|
||||
}
|
||||
|
||||
static const struct pci_device_id dev_id_table[] = {
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ static void enetc_rx_dim_work(struct work_struct *w)
|
|||
|
||||
static void enetc_rx_net_dim(struct enetc_int_vector *v)
|
||||
{
|
||||
struct dim_sample dim_sample;
|
||||
struct dim_sample dim_sample = {};
|
||||
|
||||
v->comp_cnt++;
|
||||
|
||||
|
|
@ -1320,7 +1320,6 @@ static void enetc_clear_bdrs(struct enetc_ndev_priv *priv)
|
|||
static int enetc_setup_irqs(struct enetc_ndev_priv *priv)
|
||||
{
|
||||
struct pci_dev *pdev = priv->si->pdev;
|
||||
cpumask_t cpu_mask;
|
||||
int i, j, err;
|
||||
|
||||
for (i = 0; i < priv->bdr_int_num; i++) {
|
||||
|
|
@ -1349,9 +1348,7 @@ static int enetc_setup_irqs(struct enetc_ndev_priv *priv)
|
|||
|
||||
enetc_wr(hw, ENETC_SIMSITRV(idx), entry);
|
||||
}
|
||||
cpumask_clear(&cpu_mask);
|
||||
cpumask_set_cpu(i % num_online_cpus(), &cpu_mask);
|
||||
irq_set_affinity_hint(irq, &cpu_mask);
|
||||
irq_set_affinity_hint(irq, get_cpu_mask(i % num_online_cpus()));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -4377,6 +4377,24 @@ static int hclge_get_rss(struct hnae3_handle *handle, u32 *indir,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int hclge_parse_rss_hfunc(struct hclge_vport *vport, const u8 hfunc,
|
||||
u8 *hash_algo)
|
||||
{
|
||||
switch (hfunc) {
|
||||
case ETH_RSS_HASH_TOP:
|
||||
*hash_algo = HCLGE_RSS_HASH_ALGO_TOEPLITZ;
|
||||
return 0;
|
||||
case ETH_RSS_HASH_XOR:
|
||||
*hash_algo = HCLGE_RSS_HASH_ALGO_SIMPLE;
|
||||
return 0;
|
||||
case ETH_RSS_HASH_NO_CHANGE:
|
||||
*hash_algo = vport->rss_algo;
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int hclge_set_rss(struct hnae3_handle *handle, const u32 *indir,
|
||||
const u8 *key, const u8 hfunc)
|
||||
{
|
||||
|
|
@ -4385,30 +4403,27 @@ static int hclge_set_rss(struct hnae3_handle *handle, const u32 *indir,
|
|||
u8 hash_algo;
|
||||
int ret, i;
|
||||
|
||||
ret = hclge_parse_rss_hfunc(vport, hfunc, &hash_algo);
|
||||
if (ret) {
|
||||
dev_err(&hdev->pdev->dev, "invalid hfunc type %u\n", hfunc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Set the RSS Hash Key if specififed by the user */
|
||||
if (key) {
|
||||
switch (hfunc) {
|
||||
case ETH_RSS_HASH_TOP:
|
||||
hash_algo = HCLGE_RSS_HASH_ALGO_TOEPLITZ;
|
||||
break;
|
||||
case ETH_RSS_HASH_XOR:
|
||||
hash_algo = HCLGE_RSS_HASH_ALGO_SIMPLE;
|
||||
break;
|
||||
case ETH_RSS_HASH_NO_CHANGE:
|
||||
hash_algo = vport->rss_algo;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = hclge_set_rss_algo_key(hdev, hash_algo, key);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Update the shadow RSS key with user specified qids */
|
||||
memcpy(vport->rss_hash_key, key, HCLGE_RSS_KEY_SIZE);
|
||||
vport->rss_algo = hash_algo;
|
||||
} else {
|
||||
ret = hclge_set_rss_algo_key(hdev, hash_algo,
|
||||
vport->rss_hash_key);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
vport->rss_algo = hash_algo;
|
||||
|
||||
/* Update the shadow RSS table with user specified qids */
|
||||
for (i = 0; i < HCLGE_RSS_IND_TBL_SIZE; i++)
|
||||
|
|
|
|||
|
|
@ -581,9 +581,17 @@ static void hclge_get_queue_id_in_pf(struct hclge_vport *vport,
|
|||
struct hclge_mbx_vf_to_pf_cmd *mbx_req,
|
||||
struct hclge_respond_to_vf_msg *resp_msg)
|
||||
{
|
||||
struct hnae3_handle *handle = &vport->nic;
|
||||
struct hclge_dev *hdev = vport->back;
|
||||
u16 queue_id, qid_in_pf;
|
||||
|
||||
memcpy(&queue_id, mbx_req->msg.data, sizeof(queue_id));
|
||||
if (queue_id >= handle->kinfo.num_tqps) {
|
||||
dev_err(&hdev->pdev->dev, "Invalid queue id(%u) from VF %u\n",
|
||||
queue_id, mbx_req->mbx_src_vfid);
|
||||
return;
|
||||
}
|
||||
|
||||
qid_in_pf = hclge_covert_handle_qid_global(&vport->nic, queue_id);
|
||||
memcpy(resp_msg->data, &qid_in_pf, sizeof(qid_in_pf));
|
||||
resp_msg->len = sizeof(qid_in_pf);
|
||||
|
|
|
|||
|
|
@ -785,40 +785,56 @@ static int hclgevf_get_rss(struct hnae3_handle *handle, u32 *indir, u8 *key,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int hclgevf_parse_rss_hfunc(struct hclgevf_dev *hdev, const u8 hfunc,
|
||||
u8 *hash_algo)
|
||||
{
|
||||
switch (hfunc) {
|
||||
case ETH_RSS_HASH_TOP:
|
||||
*hash_algo = HCLGEVF_RSS_HASH_ALGO_TOEPLITZ;
|
||||
return 0;
|
||||
case ETH_RSS_HASH_XOR:
|
||||
*hash_algo = HCLGEVF_RSS_HASH_ALGO_SIMPLE;
|
||||
return 0;
|
||||
case ETH_RSS_HASH_NO_CHANGE:
|
||||
*hash_algo = hdev->rss_cfg.hash_algo;
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int hclgevf_set_rss(struct hnae3_handle *handle, const u32 *indir,
|
||||
const u8 *key, const u8 hfunc)
|
||||
{
|
||||
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
|
||||
struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg;
|
||||
u8 hash_algo;
|
||||
int ret, i;
|
||||
|
||||
if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
|
||||
ret = hclgevf_parse_rss_hfunc(hdev, hfunc, &hash_algo);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Set the RSS Hash Key if specififed by the user */
|
||||
if (key) {
|
||||
switch (hfunc) {
|
||||
case ETH_RSS_HASH_TOP:
|
||||
rss_cfg->hash_algo =
|
||||
HCLGEVF_RSS_HASH_ALGO_TOEPLITZ;
|
||||
break;
|
||||
case ETH_RSS_HASH_XOR:
|
||||
rss_cfg->hash_algo =
|
||||
HCLGEVF_RSS_HASH_ALGO_SIMPLE;
|
||||
break;
|
||||
case ETH_RSS_HASH_NO_CHANGE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = hclgevf_set_rss_algo_key(hdev, rss_cfg->hash_algo,
|
||||
key);
|
||||
if (ret)
|
||||
ret = hclgevf_set_rss_algo_key(hdev, hash_algo, key);
|
||||
if (ret) {
|
||||
dev_err(&hdev->pdev->dev,
|
||||
"invalid hfunc type %u\n", hfunc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Update the shadow RSS key with user specified qids */
|
||||
memcpy(rss_cfg->rss_hash_key, key,
|
||||
HCLGEVF_RSS_KEY_SIZE);
|
||||
} else {
|
||||
ret = hclgevf_set_rss_algo_key(hdev, hash_algo,
|
||||
rss_cfg->rss_hash_key);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
rss_cfg->hash_algo = hash_algo;
|
||||
}
|
||||
|
||||
/* update the shadow RSS table with user specified qids */
|
||||
|
|
|
|||
|
|
@ -1155,7 +1155,7 @@ struct net_device * __init i82596_probe(int unit)
|
|||
err = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
memcpy(eth_addr, (void *) 0xfffc1f2c, ETH_ALEN); /* YUCK! Get addr from NOVRAM */
|
||||
memcpy(eth_addr, absolute_pointer(0xfffc1f2c), ETH_ALEN); /* YUCK! Get addr from NOVRAM */
|
||||
dev->base_addr = MVME_I596_BASE;
|
||||
dev->irq = (unsigned) MVME16x_IRQ_I596;
|
||||
goto found;
|
||||
|
|
|
|||
|
|
@ -372,6 +372,9 @@ mlx4_en_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
|
|||
int nhoff = skb_network_offset(skb);
|
||||
int ret = 0;
|
||||
|
||||
if (skb->encapsulation)
|
||||
return -EPROTONOSUPPORT;
|
||||
|
||||
if (skb->protocol != htons(ETH_P_IP))
|
||||
return -EPROTONOSUPPORT;
|
||||
|
||||
|
|
|
|||
|
|
@ -1297,6 +1297,14 @@ qed_iwarp_wait_cid_map_cleared(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap)
|
|||
prev_weight = weight;
|
||||
|
||||
while (weight) {
|
||||
/* If the HW device is during recovery, all resources are
|
||||
* immediately reset without receiving a per-cid indication
|
||||
* from HW. In this case we don't expect the cid_map to be
|
||||
* cleared.
|
||||
*/
|
||||
if (p_hwfn->cdev->recov_in_prog)
|
||||
return 0;
|
||||
|
||||
msleep(QED_IWARP_MAX_CID_CLEAN_TIME);
|
||||
|
||||
weight = bitmap_weight(bmap->bitmap, bmap->max_count);
|
||||
|
|
|
|||
|
|
@ -77,6 +77,14 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
|
|||
* Beyond the added delay we clear the bitmap anyway.
|
||||
*/
|
||||
while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) {
|
||||
/* If the HW device is during recovery, all resources are
|
||||
* immediately reset without receiving a per-cid indication
|
||||
* from HW. In this case we don't expect the cid bitmap to be
|
||||
* cleared.
|
||||
*/
|
||||
if (p_hwfn->cdev->recov_in_prog)
|
||||
return;
|
||||
|
||||
msleep(100);
|
||||
if (wait_count++ > 20) {
|
||||
DP_NOTICE(p_hwfn, "cid bitmap wait timed out\n");
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv)
|
|||
priv->clk_csr = STMMAC_CSR_100_150M;
|
||||
else if ((clk_rate >= CSR_F_150M) && (clk_rate < CSR_F_250M))
|
||||
priv->clk_csr = STMMAC_CSR_150_250M;
|
||||
else if ((clk_rate >= CSR_F_250M) && (clk_rate < CSR_F_300M))
|
||||
else if ((clk_rate >= CSR_F_250M) && (clk_rate <= CSR_F_300M))
|
||||
priv->clk_csr = STMMAC_CSR_250_300M;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@
|
|||
#define SIXP_DAMA_OFF 0
|
||||
|
||||
/* default level 2 parameters */
|
||||
#define SIXP_TXDELAY (HZ/4) /* in 1 s */
|
||||
#define SIXP_TXDELAY 25 /* 250 ms */
|
||||
#define SIXP_PERSIST 50 /* in 256ths */
|
||||
#define SIXP_SLOTTIME (HZ/10) /* in 1 s */
|
||||
#define SIXP_SLOTTIME 10 /* 100 ms */
|
||||
#define SIXP_INIT_RESYNC_TIMEOUT (3*HZ/2) /* in 1 s */
|
||||
#define SIXP_RESYNC_TIMEOUT 5*HZ /* in 1 s */
|
||||
|
||||
|
|
|
|||
|
|
@ -1493,6 +1493,32 @@ int phylink_ethtool_ksettings_set(struct phylink *pl,
|
|||
if (config.an_enabled && phylink_is_empty_linkmode(config.advertising))
|
||||
return -EINVAL;
|
||||
|
||||
/* If this link is with an SFP, ensure that changes to advertised modes
|
||||
* also cause the associated interface to be selected such that the
|
||||
* link can be configured correctly.
|
||||
*/
|
||||
if (pl->sfp_port && pl->sfp_bus) {
|
||||
config.interface = sfp_select_interface(pl->sfp_bus,
|
||||
config.advertising);
|
||||
if (config.interface == PHY_INTERFACE_MODE_NA) {
|
||||
phylink_err(pl,
|
||||
"selection of interface failed, advertisement %*pb\n",
|
||||
__ETHTOOL_LINK_MODE_MASK_NBITS,
|
||||
config.advertising);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Revalidate with the selected interface */
|
||||
linkmode_copy(support, pl->supported);
|
||||
if (phylink_validate(pl, support, &config)) {
|
||||
phylink_err(pl, "validation of %s/%s with support %*pb failed\n",
|
||||
phylink_an_mode_str(pl->cur_link_an_mode),
|
||||
phy_modes(config.interface),
|
||||
__ETHTOOL_LINK_MODE_MASK_NBITS, support);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_lock(&pl->state_mutex);
|
||||
pl->link_config.speed = config.speed;
|
||||
pl->link_config.duplex = config.duplex;
|
||||
|
|
@ -2072,7 +2098,9 @@ static int phylink_sfp_config(struct phylink *pl, u8 mode,
|
|||
if (phy_interface_mode_is_8023z(iface) && pl->phydev)
|
||||
return -EINVAL;
|
||||
|
||||
changed = !linkmode_equal(pl->supported, support);
|
||||
changed = !linkmode_equal(pl->supported, support) ||
|
||||
!linkmode_equal(pl->link_config.advertising,
|
||||
config.advertising);
|
||||
if (changed) {
|
||||
linkmode_copy(pl->supported, support);
|
||||
linkmode_copy(pl->link_config.advertising, config.advertising);
|
||||
|
|
|
|||
|
|
@ -2721,14 +2721,14 @@ struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface,
|
|||
|
||||
serial = kzalloc(sizeof(*serial), GFP_KERNEL);
|
||||
if (!serial)
|
||||
goto exit;
|
||||
goto err_free_dev;
|
||||
|
||||
hso_dev->port_data.dev_serial = serial;
|
||||
serial->parent = hso_dev;
|
||||
|
||||
if (hso_serial_common_create
|
||||
(serial, 1, CTRL_URB_RX_SIZE, CTRL_URB_TX_SIZE))
|
||||
goto exit;
|
||||
goto err_free_serial;
|
||||
|
||||
serial->tx_data_length--;
|
||||
serial->write_data = hso_mux_serial_write_data;
|
||||
|
|
@ -2744,11 +2744,9 @@ struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface,
|
|||
/* done, return it */
|
||||
return hso_dev;
|
||||
|
||||
exit:
|
||||
if (serial) {
|
||||
tty_unregister_device(tty_drv, serial->minor);
|
||||
kfree(serial);
|
||||
}
|
||||
err_free_serial:
|
||||
kfree(serial);
|
||||
err_free_dev:
|
||||
kfree(hso_dev);
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/list_sort.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/pr.h>
|
||||
|
|
@ -3801,14 +3800,6 @@ out_unlock:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int ns_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
{
|
||||
struct nvme_ns *nsa = container_of(a, struct nvme_ns, list);
|
||||
struct nvme_ns *nsb = container_of(b, struct nvme_ns, list);
|
||||
|
||||
return nsa->head->ns_id - nsb->head->ns_id;
|
||||
}
|
||||
|
||||
struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid)
|
||||
{
|
||||
struct nvme_ns *ns, *ret = NULL;
|
||||
|
|
@ -3829,6 +3820,22 @@ struct nvme_ns *nvme_find_get_ns(struct nvme_ctrl *ctrl, unsigned nsid)
|
|||
}
|
||||
EXPORT_SYMBOL_NS_GPL(nvme_find_get_ns, NVME_TARGET_PASSTHRU);
|
||||
|
||||
/*
|
||||
* Add the namespace to the controller list while keeping the list ordered.
|
||||
*/
|
||||
static void nvme_ns_add_to_ctrl_list(struct nvme_ns *ns)
|
||||
{
|
||||
struct nvme_ns *tmp;
|
||||
|
||||
list_for_each_entry_reverse(tmp, &ns->ctrl->namespaces, list) {
|
||||
if (tmp->head->ns_id < ns->head->ns_id) {
|
||||
list_add(&ns->list, &tmp->list);
|
||||
return;
|
||||
}
|
||||
}
|
||||
list_add(&ns->list, &ns->ctrl->namespaces);
|
||||
}
|
||||
|
||||
static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
|
||||
struct nvme_ns_ids *ids)
|
||||
{
|
||||
|
|
@ -3888,9 +3895,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
|
|||
}
|
||||
|
||||
down_write(&ctrl->namespaces_rwsem);
|
||||
list_add_tail(&ns->list, &ctrl->namespaces);
|
||||
nvme_ns_add_to_ctrl_list(ns);
|
||||
up_write(&ctrl->namespaces_rwsem);
|
||||
|
||||
nvme_get_ctrl(ctrl);
|
||||
|
||||
device_add_disk(ctrl->device, ns->disk, nvme_ns_id_attr_groups);
|
||||
|
|
@ -4159,10 +4165,6 @@ static void nvme_scan_work(struct work_struct *work)
|
|||
if (nvme_scan_ns_list(ctrl) != 0)
|
||||
nvme_scan_ns_sequential(ctrl);
|
||||
mutex_unlock(&ctrl->scan_lock);
|
||||
|
||||
down_write(&ctrl->namespaces_rwsem);
|
||||
list_sort(NULL, &ctrl->namespaces, ns_cmp);
|
||||
up_write(&ctrl->namespaces_rwsem);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -509,14 +509,17 @@ static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
|
|||
|
||||
down_read(&ctrl->namespaces_rwsem);
|
||||
list_for_each_entry(ns, &ctrl->namespaces, list) {
|
||||
unsigned nsid = le32_to_cpu(desc->nsids[n]);
|
||||
|
||||
unsigned nsid;
|
||||
again:
|
||||
nsid = le32_to_cpu(desc->nsids[n]);
|
||||
if (ns->head->ns_id < nsid)
|
||||
continue;
|
||||
if (ns->head->ns_id == nsid)
|
||||
nvme_update_ns_ana_state(desc, ns);
|
||||
if (++n == nr_nsids)
|
||||
break;
|
||||
if (ns->head->ns_id > nsid)
|
||||
goto again;
|
||||
}
|
||||
up_read(&ctrl->namespaces_rwsem);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -655,8 +655,8 @@ static void nvme_rdma_free_queue(struct nvme_rdma_queue *queue)
|
|||
if (!test_and_clear_bit(NVME_RDMA_Q_ALLOCATED, &queue->flags))
|
||||
return;
|
||||
|
||||
nvme_rdma_destroy_queue_ib(queue);
|
||||
rdma_destroy_id(queue->cm_id);
|
||||
nvme_rdma_destroy_queue_ib(queue);
|
||||
mutex_destroy(&queue->queue_lock);
|
||||
}
|
||||
|
||||
|
|
@ -1823,14 +1823,10 @@ static int nvme_rdma_conn_established(struct nvme_rdma_queue *queue)
|
|||
for (i = 0; i < queue->queue_size; i++) {
|
||||
ret = nvme_rdma_post_recv(queue, &queue->rsp_ring[i]);
|
||||
if (ret)
|
||||
goto out_destroy_queue_ib;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out_destroy_queue_ib:
|
||||
nvme_rdma_destroy_queue_ib(queue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int nvme_rdma_conn_rejected(struct nvme_rdma_queue *queue,
|
||||
|
|
@ -1924,14 +1920,10 @@ static int nvme_rdma_route_resolved(struct nvme_rdma_queue *queue)
|
|||
if (ret) {
|
||||
dev_err(ctrl->ctrl.device,
|
||||
"rdma_connect_locked failed (%d).\n", ret);
|
||||
goto out_destroy_queue_ib;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out_destroy_queue_ib:
|
||||
nvme_rdma_destroy_queue_ib(queue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id,
|
||||
|
|
@ -1962,8 +1954,6 @@ static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id,
|
|||
case RDMA_CM_EVENT_ROUTE_ERROR:
|
||||
case RDMA_CM_EVENT_CONNECT_ERROR:
|
||||
case RDMA_CM_EVENT_UNREACHABLE:
|
||||
nvme_rdma_destroy_queue_ib(queue);
|
||||
fallthrough;
|
||||
case RDMA_CM_EVENT_ADDR_ERROR:
|
||||
dev_dbg(queue->ctrl->ctrl.device,
|
||||
"CM error event %d\n", ev->event);
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ static int nvme_tcp_setup_h2c_data_pdu(struct nvme_tcp_request *req,
|
|||
cpu_to_le32(data->hdr.hlen + hdgst + req->pdu_len + ddgst);
|
||||
data->ttag = pdu->ttag;
|
||||
data->command_id = nvme_cid(rq);
|
||||
data->data_offset = cpu_to_le32(req->data_sent);
|
||||
data->data_offset = pdu->r2t_offset;
|
||||
data->data_length = cpu_to_le32(req->pdu_len);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -937,7 +937,15 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
|
|||
nvme_tcp_ddgst_update(queue->snd_hash, page,
|
||||
offset, ret);
|
||||
|
||||
/* fully successful last write*/
|
||||
/*
|
||||
* update the request iterator except for the last payload send
|
||||
* in the request where we don't want to modify it as we may
|
||||
* compete with the RX path completing the request.
|
||||
*/
|
||||
if (req->data_sent + ret < req->data_len)
|
||||
nvme_tcp_advance_req(req, ret);
|
||||
|
||||
/* fully successful last send in current PDU */
|
||||
if (last && ret == len) {
|
||||
if (queue->data_digest) {
|
||||
nvme_tcp_ddgst_final(queue->snd_hash,
|
||||
|
|
@ -949,7 +957,6 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
nvme_tcp_advance_req(req, ret);
|
||||
}
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -345,7 +345,8 @@ static int cdns_pcie_host_bar_config(struct cdns_pcie_rc *rc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cdns_pcie_host_dma_ranges_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int cdns_pcie_host_dma_ranges_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct resource_entry *entry1, *entry2;
|
||||
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@
|
|||
(PCIE_CONF_BUS(bus) | PCIE_CONF_DEV(PCI_SLOT(devfn)) | \
|
||||
PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where))
|
||||
|
||||
#define PIO_RETRY_CNT 500
|
||||
#define PIO_RETRY_CNT 750000 /* 1.5 s */
|
||||
#define PIO_RETRY_DELAY 2 /* 2 us*/
|
||||
|
||||
#define LINK_WAIT_MAX_RETRIES 10
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
* which provide mailbox interface for power management usage.
|
||||
*/
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
|
|
@ -319,7 +318,7 @@ static struct platform_driver intel_punit_ipc_driver = {
|
|||
.remove = intel_punit_ipc_remove,
|
||||
.driver = {
|
||||
.name = "intel_punit_ipc",
|
||||
.acpi_match_table = ACPI_PTR(punit_ipc_acpi_ids),
|
||||
.acpi_match_table = punit_ipc_acpi_ids,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -210,6 +210,9 @@ static void qeth_clear_working_pool_list(struct qeth_card *card)
|
|||
&card->qdio.in_buf_pool.entry_list, list)
|
||||
list_del(&pool_entry->list);
|
||||
|
||||
if (!queue)
|
||||
return;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(queue->bufs); i++)
|
||||
queue->bufs[i].pool_entry = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6005,7 +6005,8 @@ lpfc_sg_seg_cnt_show(struct device *dev, struct device_attribute *attr,
|
|||
len = scnprintf(buf, PAGE_SIZE, "SGL sz: %d total SGEs: %d\n",
|
||||
phba->cfg_sg_dma_buf_size, phba->cfg_total_seg_cnt);
|
||||
|
||||
len += scnprintf(buf + len, PAGE_SIZE, "Cfg: %d SCSI: %d NVME: %d\n",
|
||||
len += scnprintf(buf + len, PAGE_SIZE - len,
|
||||
"Cfg: %d SCSI: %d NVME: %d\n",
|
||||
phba->cfg_sg_seg_cnt, phba->cfg_scsi_seg_cnt,
|
||||
phba->cfg_nvme_seg_cnt);
|
||||
return len;
|
||||
|
|
|
|||
|
|
@ -6934,7 +6934,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
|
|||
return 0;
|
||||
break;
|
||||
case QLA2XXX_INI_MODE_DUAL:
|
||||
if (!qla_dual_mode_enabled(vha))
|
||||
if (!qla_dual_mode_enabled(vha) &&
|
||||
!qla_ini_mode_enabled(vha))
|
||||
return 0;
|
||||
break;
|
||||
case QLA2XXX_INI_MODE_ENABLED:
|
||||
|
|
|
|||
|
|
@ -442,9 +442,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
|
|||
struct iscsi_transport *t = iface->transport;
|
||||
int param = -1;
|
||||
|
||||
if (attr == &dev_attr_iface_enabled.attr)
|
||||
param = ISCSI_NET_PARAM_IFACE_ENABLE;
|
||||
else if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
|
||||
if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
|
||||
param = ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO;
|
||||
else if (attr == &dev_attr_iface_header_digest.attr)
|
||||
param = ISCSI_IFACE_PARAM_HDRDGST_EN;
|
||||
|
|
@ -484,7 +482,9 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
|
|||
if (param != -1)
|
||||
return t->attr_is_visible(ISCSI_IFACE_PARAM, param);
|
||||
|
||||
if (attr == &dev_attr_iface_vlan_id.attr)
|
||||
if (attr == &dev_attr_iface_enabled.attr)
|
||||
param = ISCSI_NET_PARAM_IFACE_ENABLE;
|
||||
else if (attr == &dev_attr_iface_vlan_id.attr)
|
||||
param = ISCSI_NET_PARAM_VLAN_ID;
|
||||
else if (attr == &dev_attr_iface_vlan_priority.attr)
|
||||
param = ISCSI_NET_PARAM_VLAN_PRIORITY;
|
||||
|
|
|
|||
|
|
@ -155,8 +155,8 @@ static void *sd_zbc_alloc_report_buffer(struct scsi_disk *sdkp,
|
|||
|
||||
/*
|
||||
* Report zone buffer size should be at most 64B times the number of
|
||||
* zones requested plus the 64B reply header, but should be at least
|
||||
* SECTOR_SIZE for ATA devices.
|
||||
* zones requested plus the 64B reply header, but should be aligned
|
||||
* to SECTOR_SIZE for ATA devices.
|
||||
* Make sure that this size does not exceed the hardware capabilities.
|
||||
* Furthermore, since the report zone command cannot be split, make
|
||||
* sure that the allocated buffer can always be mapped by limiting the
|
||||
|
|
@ -175,7 +175,7 @@ static void *sd_zbc_alloc_report_buffer(struct scsi_disk *sdkp,
|
|||
*buflen = bufsize;
|
||||
return buf;
|
||||
}
|
||||
bufsize >>= 1;
|
||||
bufsize = rounddown(bufsize >> 1, SECTOR_SIZE);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -454,7 +454,8 @@ struct rx_ranges {
|
|||
u8 *end;
|
||||
};
|
||||
|
||||
static int rx_ranges_cmp(void *priv, struct list_head *a, struct list_head *b)
|
||||
static int rx_ranges_cmp(void *priv, const struct list_head *a,
|
||||
const struct list_head *b)
|
||||
{
|
||||
struct rx_ranges *rx_a = list_entry(a, struct rx_ranges, list);
|
||||
struct rx_ranges *rx_b = list_entry(b, struct rx_ranges, list);
|
||||
|
|
|
|||
|
|
@ -1201,7 +1201,7 @@ static int tegra_slink_resume(struct device *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int tegra_slink_runtime_suspend(struct device *dev)
|
||||
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_master *master = dev_get_drvdata(dev);
|
||||
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
|
||||
|
|
@ -1213,7 +1213,7 @@ static int tegra_slink_runtime_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int tegra_slink_runtime_resume(struct device *dev)
|
||||
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_master *master = dev_get_drvdata(dev);
|
||||
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
|
||||
|
|
|
|||
|
|
@ -3090,6 +3090,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
|
|||
mutex_lock(&dev->mutex);
|
||||
rc = do_insnlist_ioctl(dev, insns, insnlist32.n_insns, file);
|
||||
mutex_unlock(&dev->mutex);
|
||||
kfree(insns);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -778,6 +778,17 @@ out:
|
|||
gbphy_runtime_put_autosuspend(gb_tty->gbphy_dev);
|
||||
}
|
||||
|
||||
static void gb_tty_port_destruct(struct tty_port *port)
|
||||
{
|
||||
struct gb_tty *gb_tty = container_of(port, struct gb_tty, port);
|
||||
|
||||
if (gb_tty->minor != GB_NUM_MINORS)
|
||||
release_minor(gb_tty);
|
||||
kfifo_free(&gb_tty->write_fifo);
|
||||
kfree(gb_tty->buffer);
|
||||
kfree(gb_tty);
|
||||
}
|
||||
|
||||
static const struct tty_operations gb_ops = {
|
||||
.install = gb_tty_install,
|
||||
.open = gb_tty_open,
|
||||
|
|
@ -803,6 +814,7 @@ static const struct tty_port_operations gb_port_ops = {
|
|||
.dtr_rts = gb_tty_dtr_rts,
|
||||
.activate = gb_tty_port_activate,
|
||||
.shutdown = gb_tty_port_shutdown,
|
||||
.destruct = gb_tty_port_destruct,
|
||||
};
|
||||
|
||||
static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
||||
|
|
@ -815,17 +827,11 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
int retval;
|
||||
int minor;
|
||||
|
||||
gb_tty = kzalloc(sizeof(*gb_tty), GFP_KERNEL);
|
||||
if (!gb_tty)
|
||||
return -ENOMEM;
|
||||
|
||||
connection = gb_connection_create(gbphy_dev->bundle,
|
||||
le16_to_cpu(gbphy_dev->cport_desc->id),
|
||||
gb_uart_request_handler);
|
||||
if (IS_ERR(connection)) {
|
||||
retval = PTR_ERR(connection);
|
||||
goto exit_tty_free;
|
||||
}
|
||||
if (IS_ERR(connection))
|
||||
return PTR_ERR(connection);
|
||||
|
||||
max_payload = gb_operation_get_payload_size_max(connection);
|
||||
if (max_payload < sizeof(struct gb_uart_send_data_request)) {
|
||||
|
|
@ -833,13 +839,23 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
goto exit_connection_destroy;
|
||||
}
|
||||
|
||||
gb_tty = kzalloc(sizeof(*gb_tty), GFP_KERNEL);
|
||||
if (!gb_tty) {
|
||||
retval = -ENOMEM;
|
||||
goto exit_connection_destroy;
|
||||
}
|
||||
|
||||
tty_port_init(&gb_tty->port);
|
||||
gb_tty->port.ops = &gb_port_ops;
|
||||
gb_tty->minor = GB_NUM_MINORS;
|
||||
|
||||
gb_tty->buffer_payload_max = max_payload -
|
||||
sizeof(struct gb_uart_send_data_request);
|
||||
|
||||
gb_tty->buffer = kzalloc(gb_tty->buffer_payload_max, GFP_KERNEL);
|
||||
if (!gb_tty->buffer) {
|
||||
retval = -ENOMEM;
|
||||
goto exit_connection_destroy;
|
||||
goto exit_put_port;
|
||||
}
|
||||
|
||||
INIT_WORK(&gb_tty->tx_work, gb_uart_tx_write_work);
|
||||
|
|
@ -847,7 +863,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
retval = kfifo_alloc(&gb_tty->write_fifo, GB_UART_WRITE_FIFO_SIZE,
|
||||
GFP_KERNEL);
|
||||
if (retval)
|
||||
goto exit_buf_free;
|
||||
goto exit_put_port;
|
||||
|
||||
gb_tty->credits = GB_UART_FIRMWARE_CREDITS;
|
||||
init_completion(&gb_tty->credits_complete);
|
||||
|
|
@ -861,7 +877,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
} else {
|
||||
retval = minor;
|
||||
}
|
||||
goto exit_kfifo_free;
|
||||
goto exit_put_port;
|
||||
}
|
||||
|
||||
gb_tty->minor = minor;
|
||||
|
|
@ -870,9 +886,6 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
init_waitqueue_head(&gb_tty->wioctl);
|
||||
mutex_init(&gb_tty->mutex);
|
||||
|
||||
tty_port_init(&gb_tty->port);
|
||||
gb_tty->port.ops = &gb_port_ops;
|
||||
|
||||
gb_tty->connection = connection;
|
||||
gb_tty->gbphy_dev = gbphy_dev;
|
||||
gb_connection_set_data(connection, gb_tty);
|
||||
|
|
@ -880,7 +893,7 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
|
||||
retval = gb_connection_enable_tx(connection);
|
||||
if (retval)
|
||||
goto exit_release_minor;
|
||||
goto exit_put_port;
|
||||
|
||||
send_control(gb_tty, gb_tty->ctrlout);
|
||||
|
||||
|
|
@ -907,16 +920,10 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
|||
|
||||
exit_connection_disable:
|
||||
gb_connection_disable(connection);
|
||||
exit_release_minor:
|
||||
release_minor(gb_tty);
|
||||
exit_kfifo_free:
|
||||
kfifo_free(&gb_tty->write_fifo);
|
||||
exit_buf_free:
|
||||
kfree(gb_tty->buffer);
|
||||
exit_put_port:
|
||||
tty_port_put(&gb_tty->port);
|
||||
exit_connection_destroy:
|
||||
gb_connection_destroy(connection);
|
||||
exit_tty_free:
|
||||
kfree(gb_tty);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -947,15 +954,10 @@ static void gb_uart_remove(struct gbphy_device *gbphy_dev)
|
|||
gb_connection_disable_rx(connection);
|
||||
tty_unregister_device(gb_tty_driver, gb_tty->minor);
|
||||
|
||||
/* FIXME - free transmit / receive buffers */
|
||||
|
||||
gb_connection_disable(connection);
|
||||
tty_port_destroy(&gb_tty->port);
|
||||
gb_connection_destroy(connection);
|
||||
release_minor(gb_tty);
|
||||
kfifo_free(&gb_tty->write_fifo);
|
||||
kfree(gb_tty->buffer);
|
||||
kfree(gb_tty);
|
||||
|
||||
tty_port_put(&gb_tty->port);
|
||||
}
|
||||
|
||||
static int gb_tty_init(void)
|
||||
|
|
|
|||
|
|
@ -1110,20 +1110,24 @@ static ssize_t alua_support_store(struct config_item *item,
|
|||
{
|
||||
struct se_dev_attrib *da = to_attrib(item);
|
||||
struct se_device *dev = da->da_dev;
|
||||
bool flag;
|
||||
bool flag, oldflag;
|
||||
int ret;
|
||||
|
||||
ret = strtobool(page, &flag);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
oldflag = !(dev->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_ALUA);
|
||||
if (flag == oldflag)
|
||||
return count;
|
||||
|
||||
if (!(dev->transport->transport_flags_changeable &
|
||||
TRANSPORT_FLAG_PASSTHROUGH_ALUA)) {
|
||||
pr_err("dev[%p]: Unable to change SE Device alua_support:"
|
||||
" alua_support has fixed value\n", dev);
|
||||
return -EINVAL;
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
ret = strtobool(page, &flag);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (flag)
|
||||
dev->transport_flags &= ~TRANSPORT_FLAG_PASSTHROUGH_ALUA;
|
||||
else
|
||||
|
|
@ -1145,20 +1149,24 @@ static ssize_t pgr_support_store(struct config_item *item,
|
|||
{
|
||||
struct se_dev_attrib *da = to_attrib(item);
|
||||
struct se_device *dev = da->da_dev;
|
||||
bool flag;
|
||||
bool flag, oldflag;
|
||||
int ret;
|
||||
|
||||
ret = strtobool(page, &flag);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
oldflag = !(dev->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_PGR);
|
||||
if (flag == oldflag)
|
||||
return count;
|
||||
|
||||
if (!(dev->transport->transport_flags_changeable &
|
||||
TRANSPORT_FLAG_PASSTHROUGH_PGR)) {
|
||||
pr_err("dev[%p]: Unable to change SE Device pgr_support:"
|
||||
" pgr_support has fixed value\n", dev);
|
||||
return -EINVAL;
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
ret = strtobool(page, &flag);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (flag)
|
||||
dev->transport_flags &= ~TRANSPORT_FLAG_PASSTHROUGH_PGR;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ static int tcc_offset_update(unsigned int tcc)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int tcc_offset_save;
|
||||
static int tcc_offset_save = -1;
|
||||
|
||||
static ssize_t tcc_offset_degree_celsius_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf,
|
||||
|
|
@ -709,7 +709,8 @@ static int proc_thermal_resume(struct device *dev)
|
|||
proc_dev = dev_get_drvdata(dev);
|
||||
proc_thermal_read_ppcc(proc_dev);
|
||||
|
||||
tcc_offset_update(tcc_offset_save);
|
||||
if (tcc_offset_save >= 0)
|
||||
tcc_offset_update(tcc_offset_save);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,15 +226,14 @@ int thermal_build_list_of_policies(char *buf)
|
|||
{
|
||||
struct thermal_governor *pos;
|
||||
ssize_t count = 0;
|
||||
ssize_t size = PAGE_SIZE;
|
||||
|
||||
mutex_lock(&thermal_governor_lock);
|
||||
|
||||
list_for_each_entry(pos, &thermal_governor_list, governor_list) {
|
||||
size = PAGE_SIZE - count;
|
||||
count += scnprintf(buf + count, size, "%s ", pos->name);
|
||||
count += scnprintf(buf + count, PAGE_SIZE - count, "%s ",
|
||||
pos->name);
|
||||
}
|
||||
count += scnprintf(buf + count, size, "\n");
|
||||
count += scnprintf(buf + count, PAGE_SIZE - count, "\n");
|
||||
|
||||
mutex_unlock(&thermal_governor_lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@
|
|||
#define UART_OMAP_EFR2_TIMEOUT_BEHAVE BIT(6)
|
||||
|
||||
/* RX FIFO occupancy indicator */
|
||||
#define UART_OMAP_RX_LVL 0x64
|
||||
#define UART_OMAP_RX_LVL 0x19
|
||||
|
||||
struct omap8250_priv {
|
||||
int line;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ static unsigned int mvebu_uart_tx_empty(struct uart_port *port)
|
|||
st = readl(port->membase + UART_STAT);
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
||||
return (st & STAT_TX_FIFO_EMP) ? TIOCSER_TEMT : 0;
|
||||
return (st & STAT_TX_EMP) ? TIOCSER_TEMT : 0;
|
||||
}
|
||||
|
||||
static unsigned int mvebu_uart_get_mctrl(struct uart_port *port)
|
||||
|
|
|
|||
|
|
@ -137,37 +137,14 @@ MODULE_PARM_DESC(maxframe, "Maximum frame size used by device (4096 to 65535)");
|
|||
*/
|
||||
static struct tty_driver *serial_driver;
|
||||
|
||||
static int open(struct tty_struct *tty, struct file * filp);
|
||||
static void close(struct tty_struct *tty, struct file * filp);
|
||||
static void hangup(struct tty_struct *tty);
|
||||
static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
|
||||
|
||||
static int write(struct tty_struct *tty, const unsigned char *buf, int count);
|
||||
static int put_char(struct tty_struct *tty, unsigned char ch);
|
||||
static void send_xchar(struct tty_struct *tty, char ch);
|
||||
static void wait_until_sent(struct tty_struct *tty, int timeout);
|
||||
static int write_room(struct tty_struct *tty);
|
||||
static void flush_chars(struct tty_struct *tty);
|
||||
static void flush_buffer(struct tty_struct *tty);
|
||||
static void tx_hold(struct tty_struct *tty);
|
||||
static void tx_release(struct tty_struct *tty);
|
||||
|
||||
static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
|
||||
static int chars_in_buffer(struct tty_struct *tty);
|
||||
static void throttle(struct tty_struct * tty);
|
||||
static void unthrottle(struct tty_struct * tty);
|
||||
static int set_break(struct tty_struct *tty, int break_state);
|
||||
|
||||
/*
|
||||
* generic HDLC support and callbacks
|
||||
* generic HDLC support
|
||||
*/
|
||||
#if SYNCLINK_GENERIC_HDLC
|
||||
#define dev_to_port(D) (dev_to_hdlc(D)->priv)
|
||||
static void hdlcdev_tx_done(struct slgt_info *info);
|
||||
static void hdlcdev_rx(struct slgt_info *info, char *buf, int size);
|
||||
static int hdlcdev_init(struct slgt_info *info);
|
||||
static void hdlcdev_exit(struct slgt_info *info);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -186,9 +163,6 @@ struct cond_wait {
|
|||
wait_queue_entry_t wait;
|
||||
unsigned int data;
|
||||
};
|
||||
static void init_cond_wait(struct cond_wait *w, unsigned int data);
|
||||
static void add_cond_wait(struct cond_wait **head, struct cond_wait *w);
|
||||
static void remove_cond_wait(struct cond_wait **head, struct cond_wait *w);
|
||||
static void flush_cond_wait(struct cond_wait **head);
|
||||
|
||||
/*
|
||||
|
|
@ -443,12 +417,8 @@ static void shutdown(struct slgt_info *info);
|
|||
static void program_hw(struct slgt_info *info);
|
||||
static void change_params(struct slgt_info *info);
|
||||
|
||||
static int register_test(struct slgt_info *info);
|
||||
static int irq_test(struct slgt_info *info);
|
||||
static int loopback_test(struct slgt_info *info);
|
||||
static int adapter_test(struct slgt_info *info);
|
||||
|
||||
static void reset_adapter(struct slgt_info *info);
|
||||
static void reset_port(struct slgt_info *info);
|
||||
static void async_mode(struct slgt_info *info);
|
||||
static void sync_mode(struct slgt_info *info);
|
||||
|
|
@ -457,41 +427,23 @@ static void rx_stop(struct slgt_info *info);
|
|||
static void rx_start(struct slgt_info *info);
|
||||
static void reset_rbufs(struct slgt_info *info);
|
||||
static void free_rbufs(struct slgt_info *info, unsigned int first, unsigned int last);
|
||||
static void rdma_reset(struct slgt_info *info);
|
||||
static bool rx_get_frame(struct slgt_info *info);
|
||||
static bool rx_get_buf(struct slgt_info *info);
|
||||
|
||||
static void tx_start(struct slgt_info *info);
|
||||
static void tx_stop(struct slgt_info *info);
|
||||
static void tx_set_idle(struct slgt_info *info);
|
||||
static unsigned int free_tbuf_count(struct slgt_info *info);
|
||||
static unsigned int tbuf_bytes(struct slgt_info *info);
|
||||
static void reset_tbufs(struct slgt_info *info);
|
||||
static void tdma_reset(struct slgt_info *info);
|
||||
static bool tx_load(struct slgt_info *info, const char *buf, unsigned int count);
|
||||
|
||||
static void get_signals(struct slgt_info *info);
|
||||
static void set_signals(struct slgt_info *info);
|
||||
static void enable_loopback(struct slgt_info *info);
|
||||
static void get_gtsignals(struct slgt_info *info);
|
||||
static void set_gtsignals(struct slgt_info *info);
|
||||
static void set_rate(struct slgt_info *info, u32 data_rate);
|
||||
|
||||
static int bh_action(struct slgt_info *info);
|
||||
static void bh_handler(struct work_struct *work);
|
||||
static void bh_transmit(struct slgt_info *info);
|
||||
static void isr_serial(struct slgt_info *info);
|
||||
static void isr_rdma(struct slgt_info *info);
|
||||
static void isr_txeom(struct slgt_info *info, unsigned short status);
|
||||
static void isr_tdma(struct slgt_info *info);
|
||||
|
||||
static int alloc_dma_bufs(struct slgt_info *info);
|
||||
static void free_dma_bufs(struct slgt_info *info);
|
||||
static int alloc_desc(struct slgt_info *info);
|
||||
static void free_desc(struct slgt_info *info);
|
||||
static int alloc_bufs(struct slgt_info *info, struct slgt_desc *bufs, int count);
|
||||
static void free_bufs(struct slgt_info *info, struct slgt_desc *bufs, int count);
|
||||
|
||||
static int alloc_tmp_rbuf(struct slgt_info *info);
|
||||
static void free_tmp_rbuf(struct slgt_info *info);
|
||||
|
||||
static void tx_timeout(struct timer_list *t);
|
||||
static void rx_timeout(struct timer_list *t);
|
||||
|
|
@ -509,10 +461,6 @@ static int tx_abort(struct slgt_info *info);
|
|||
static int rx_enable(struct slgt_info *info, int enable);
|
||||
static int modem_input_wait(struct slgt_info *info,int arg);
|
||||
static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr);
|
||||
static int tiocmget(struct tty_struct *tty);
|
||||
static int tiocmset(struct tty_struct *tty,
|
||||
unsigned int set, unsigned int clear);
|
||||
static int set_break(struct tty_struct *tty, int break_state);
|
||||
static int get_interface(struct slgt_info *info, int __user *if_mode);
|
||||
static int set_interface(struct slgt_info *info, int if_mode);
|
||||
static int set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio);
|
||||
|
|
@ -526,9 +474,6 @@ static int set_xctrl(struct slgt_info *info, int if_mode);
|
|||
/*
|
||||
* driver functions
|
||||
*/
|
||||
static void add_device(struct slgt_info *info);
|
||||
static void device_init(int adapter_num, struct pci_dev *pdev);
|
||||
static int claim_resources(struct slgt_info *info);
|
||||
static void release_resources(struct slgt_info *info);
|
||||
|
||||
/*
|
||||
|
|
@ -776,7 +721,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
|||
if ((old_termios->c_cflag & CBAUD) && !C_BAUD(tty)) {
|
||||
info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
}
|
||||
|
||||
|
|
@ -786,7 +731,7 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
|||
if (!C_CRTSCTS(tty) || !tty_throttled(tty))
|
||||
info->signals |= SerialSignal_RTS;
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
}
|
||||
|
||||
|
|
@ -1237,7 +1182,7 @@ static inline void line_info(struct seq_file *m, struct slgt_info *info)
|
|||
|
||||
/* output current serial signal states */
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
|
||||
stat_buf[0] = 0;
|
||||
|
|
@ -1337,7 +1282,7 @@ static void throttle(struct tty_struct * tty)
|
|||
if (C_CRTSCTS(tty)) {
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
info->signals &= ~SerialSignal_RTS;
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
}
|
||||
}
|
||||
|
|
@ -1362,7 +1307,7 @@ static void unthrottle(struct tty_struct * tty)
|
|||
if (C_CRTSCTS(tty)) {
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
info->signals |= SerialSignal_RTS;
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
}
|
||||
}
|
||||
|
|
@ -1533,7 +1478,7 @@ static int hdlcdev_open(struct net_device *dev)
|
|||
|
||||
/* inform generic HDLC layer of current DCD status */
|
||||
spin_lock_irqsave(&info->lock, flags);
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock, flags);
|
||||
if (info->signals & SerialSignal_DCD)
|
||||
netif_carrier_on(dev);
|
||||
|
|
@ -2287,7 +2232,7 @@ static void isr_txeom(struct slgt_info *info, unsigned short status)
|
|||
if (info->params.mode != MGSL_MODE_ASYNC && info->drop_rts_on_tx_done) {
|
||||
info->signals &= ~SerialSignal_RTS;
|
||||
info->drop_rts_on_tx_done = false;
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
}
|
||||
|
||||
#if SYNCLINK_GENERIC_HDLC
|
||||
|
|
@ -2452,7 +2397,7 @@ static void shutdown(struct slgt_info *info)
|
|||
|
||||
if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) {
|
||||
info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
}
|
||||
|
||||
flush_cond_wait(&info->gpio_wait_q);
|
||||
|
|
@ -2480,7 +2425,7 @@ static void program_hw(struct slgt_info *info)
|
|||
else
|
||||
async_mode(info);
|
||||
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
|
||||
info->dcd_chkcount = 0;
|
||||
info->cts_chkcount = 0;
|
||||
|
|
@ -2488,7 +2433,7 @@ static void program_hw(struct slgt_info *info)
|
|||
info->dsr_chkcount = 0;
|
||||
|
||||
slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR | IRQ_RI);
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
|
||||
if (info->netcount ||
|
||||
(info->port.tty && info->port.tty->termios.c_cflag & CREAD))
|
||||
|
|
@ -2732,7 +2677,7 @@ static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr)
|
|||
spin_lock_irqsave(&info->lock,flags);
|
||||
|
||||
/* return immediately if state matches requested events */
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
s = info->signals;
|
||||
|
||||
events = mask &
|
||||
|
|
@ -3150,7 +3095,7 @@ static int tiocmget(struct tty_struct *tty)
|
|||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
|
||||
result = ((info->signals & SerialSignal_RTS) ? TIOCM_RTS:0) +
|
||||
|
|
@ -3189,7 +3134,7 @@ static int tiocmset(struct tty_struct *tty,
|
|||
info->signals &= ~SerialSignal_DTR;
|
||||
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3200,7 +3145,7 @@ static int carrier_raised(struct tty_port *port)
|
|||
struct slgt_info *info = container_of(port, struct slgt_info, port);
|
||||
|
||||
spin_lock_irqsave(&info->lock,flags);
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
return (info->signals & SerialSignal_DCD) ? 1 : 0;
|
||||
}
|
||||
|
|
@ -3215,7 +3160,7 @@ static void dtr_rts(struct tty_port *port, int on)
|
|||
info->signals |= SerialSignal_RTS | SerialSignal_DTR;
|
||||
else
|
||||
info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
spin_unlock_irqrestore(&info->lock,flags);
|
||||
}
|
||||
|
||||
|
|
@ -4018,10 +3963,10 @@ static void tx_start(struct slgt_info *info)
|
|||
|
||||
if (info->params.mode != MGSL_MODE_ASYNC) {
|
||||
if (info->params.flags & HDLC_FLAG_AUTO_RTS) {
|
||||
get_signals(info);
|
||||
get_gtsignals(info);
|
||||
if (!(info->signals & SerialSignal_RTS)) {
|
||||
info->signals |= SerialSignal_RTS;
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
info->drop_rts_on_tx_done = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -4075,7 +4020,7 @@ static void reset_port(struct slgt_info *info)
|
|||
rx_stop(info);
|
||||
|
||||
info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
|
||||
set_signals(info);
|
||||
set_gtsignals(info);
|
||||
|
||||
slgt_irq_off(info, IRQ_ALL | IRQ_MASTER);
|
||||
}
|
||||
|
|
@ -4497,7 +4442,7 @@ static void tx_set_idle(struct slgt_info *info)
|
|||
/*
|
||||
* get state of V24 status (input) signals
|
||||
*/
|
||||
static void get_signals(struct slgt_info *info)
|
||||
static void get_gtsignals(struct slgt_info *info)
|
||||
{
|
||||
unsigned short status = rd_reg16(info, SSR);
|
||||
|
||||
|
|
@ -4559,7 +4504,7 @@ static void msc_set_vcr(struct slgt_info *info)
|
|||
/*
|
||||
* set state of V24 control (output) signals
|
||||
*/
|
||||
static void set_signals(struct slgt_info *info)
|
||||
static void set_gtsignals(struct slgt_info *info)
|
||||
{
|
||||
unsigned char val = rd_reg8(info, VCR);
|
||||
if (info->signals & SerialSignal_DTR)
|
||||
|
|
|
|||
|
|
@ -726,7 +726,8 @@ static void acm_port_destruct(struct tty_port *port)
|
|||
{
|
||||
struct acm *acm = container_of(port, struct acm, port);
|
||||
|
||||
acm_release_minor(acm);
|
||||
if (acm->minor != ACM_MINOR_INVALID)
|
||||
acm_release_minor(acm);
|
||||
usb_put_intf(acm->control);
|
||||
kfree(acm->country_codes);
|
||||
kfree(acm);
|
||||
|
|
@ -1343,8 +1344,10 @@ made_compressed_probe:
|
|||
usb_get_intf(acm->control); /* undone in destruct() */
|
||||
|
||||
minor = acm_alloc_minor(acm);
|
||||
if (minor < 0)
|
||||
if (minor < 0) {
|
||||
acm->minor = ACM_MINOR_INVALID;
|
||||
goto alloc_fail1;
|
||||
}
|
||||
|
||||
acm->minor = minor;
|
||||
acm->dev = usb_dev;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
#define ACM_TTY_MAJOR 166
|
||||
#define ACM_TTY_MINORS 256
|
||||
|
||||
#define ACM_MINOR_INVALID ACM_TTY_MINORS
|
||||
|
||||
/*
|
||||
* Requests.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2640,6 +2640,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
|
|||
{
|
||||
int retval;
|
||||
struct usb_device *rhdev;
|
||||
struct usb_hcd *shared_hcd;
|
||||
|
||||
if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
|
||||
hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
|
||||
|
|
@ -2796,13 +2797,26 @@ int usb_add_hcd(struct usb_hcd *hcd,
|
|||
goto err_hcd_driver_start;
|
||||
}
|
||||
|
||||
/* starting here, usbcore will pay attention to this root hub */
|
||||
retval = register_root_hub(hcd);
|
||||
if (retval != 0)
|
||||
goto err_register_root_hub;
|
||||
/* starting here, usbcore will pay attention to the shared HCD roothub */
|
||||
shared_hcd = hcd->shared_hcd;
|
||||
if (!usb_hcd_is_primary_hcd(hcd) && shared_hcd && HCD_DEFER_RH_REGISTER(shared_hcd)) {
|
||||
retval = register_root_hub(shared_hcd);
|
||||
if (retval != 0)
|
||||
goto err_register_root_hub;
|
||||
|
||||
if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
|
||||
usb_hcd_poll_rh_status(hcd);
|
||||
if (shared_hcd->uses_new_polling && HCD_POLL_RH(shared_hcd))
|
||||
usb_hcd_poll_rh_status(shared_hcd);
|
||||
}
|
||||
|
||||
/* starting here, usbcore will pay attention to this root hub */
|
||||
if (!HCD_DEFER_RH_REGISTER(hcd)) {
|
||||
retval = register_root_hub(hcd);
|
||||
if (retval != 0)
|
||||
goto err_register_root_hub;
|
||||
|
||||
if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
|
||||
usb_hcd_poll_rh_status(hcd);
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
|
|
@ -2845,6 +2859,7 @@ EXPORT_SYMBOL_GPL(usb_add_hcd);
|
|||
void usb_remove_hcd(struct usb_hcd *hcd)
|
||||
{
|
||||
struct usb_device *rhdev = hcd->self.root_hub;
|
||||
bool rh_registered;
|
||||
|
||||
dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);
|
||||
|
||||
|
|
@ -2855,6 +2870,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
|
|||
|
||||
dev_dbg(hcd->self.controller, "roothub graceful disconnect\n");
|
||||
spin_lock_irq (&hcd_root_hub_lock);
|
||||
rh_registered = hcd->rh_registered;
|
||||
hcd->rh_registered = 0;
|
||||
spin_unlock_irq (&hcd_root_hub_lock);
|
||||
|
||||
|
|
@ -2864,7 +2880,8 @@ void usb_remove_hcd(struct usb_hcd *hcd)
|
|||
cancel_work_sync(&hcd->died_work);
|
||||
|
||||
mutex_lock(&usb_bus_idr_lock);
|
||||
usb_disconnect(&rhdev); /* Sets rhdev to NULL */
|
||||
if (rh_registered)
|
||||
usb_disconnect(&rhdev); /* Sets rhdev to NULL */
|
||||
mutex_unlock(&usb_bus_idr_lock);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -115,10 +115,16 @@ static inline bool using_desc_dma(struct dwc2_hsotg *hsotg)
|
|||
*/
|
||||
static inline void dwc2_gadget_incr_frame_num(struct dwc2_hsotg_ep *hs_ep)
|
||||
{
|
||||
struct dwc2_hsotg *hsotg = hs_ep->parent;
|
||||
u16 limit = DSTS_SOFFN_LIMIT;
|
||||
|
||||
if (hsotg->gadget.speed != USB_SPEED_HIGH)
|
||||
limit >>= 3;
|
||||
|
||||
hs_ep->target_frame += hs_ep->interval;
|
||||
if (hs_ep->target_frame > DSTS_SOFFN_LIMIT) {
|
||||
if (hs_ep->target_frame > limit) {
|
||||
hs_ep->frame_overrun = true;
|
||||
hs_ep->target_frame &= DSTS_SOFFN_LIMIT;
|
||||
hs_ep->target_frame &= limit;
|
||||
} else {
|
||||
hs_ep->frame_overrun = false;
|
||||
}
|
||||
|
|
@ -136,10 +142,16 @@ static inline void dwc2_gadget_incr_frame_num(struct dwc2_hsotg_ep *hs_ep)
|
|||
*/
|
||||
static inline void dwc2_gadget_dec_frame_num_by_one(struct dwc2_hsotg_ep *hs_ep)
|
||||
{
|
||||
struct dwc2_hsotg *hsotg = hs_ep->parent;
|
||||
u16 limit = DSTS_SOFFN_LIMIT;
|
||||
|
||||
if (hsotg->gadget.speed != USB_SPEED_HIGH)
|
||||
limit >>= 3;
|
||||
|
||||
if (hs_ep->target_frame)
|
||||
hs_ep->target_frame -= 1;
|
||||
else
|
||||
hs_ep->target_frame = DSTS_SOFFN_LIMIT;
|
||||
hs_ep->target_frame = limit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1018,6 +1030,12 @@ static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep)
|
|||
dwc2_writel(hsotg, ctrl, depctl);
|
||||
}
|
||||
|
||||
static bool dwc2_gadget_target_frame_elapsed(struct dwc2_hsotg_ep *hs_ep);
|
||||
static void dwc2_hsotg_complete_request(struct dwc2_hsotg *hsotg,
|
||||
struct dwc2_hsotg_ep *hs_ep,
|
||||
struct dwc2_hsotg_req *hs_req,
|
||||
int result);
|
||||
|
||||
/**
|
||||
* dwc2_hsotg_start_req - start a USB request from an endpoint's queue
|
||||
* @hsotg: The controller state.
|
||||
|
|
@ -1170,14 +1188,19 @@ static void dwc2_hsotg_start_req(struct dwc2_hsotg *hsotg,
|
|||
}
|
||||
}
|
||||
|
||||
if (hs_ep->isochronous && hs_ep->interval == 1) {
|
||||
hs_ep->target_frame = dwc2_hsotg_read_frameno(hsotg);
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
|
||||
if (hs_ep->target_frame & 0x1)
|
||||
ctrl |= DXEPCTL_SETODDFR;
|
||||
else
|
||||
ctrl |= DXEPCTL_SETEVENFR;
|
||||
if (hs_ep->isochronous) {
|
||||
if (!dwc2_gadget_target_frame_elapsed(hs_ep)) {
|
||||
if (hs_ep->interval == 1) {
|
||||
if (hs_ep->target_frame & 0x1)
|
||||
ctrl |= DXEPCTL_SETODDFR;
|
||||
else
|
||||
ctrl |= DXEPCTL_SETEVENFR;
|
||||
}
|
||||
ctrl |= DXEPCTL_CNAK;
|
||||
} else {
|
||||
dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, -ENODATA);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ctrl |= DXEPCTL_EPENA; /* ensure ep enabled */
|
||||
|
|
@ -1325,12 +1348,16 @@ static bool dwc2_gadget_target_frame_elapsed(struct dwc2_hsotg_ep *hs_ep)
|
|||
u32 target_frame = hs_ep->target_frame;
|
||||
u32 current_frame = hsotg->frame_number;
|
||||
bool frame_overrun = hs_ep->frame_overrun;
|
||||
u16 limit = DSTS_SOFFN_LIMIT;
|
||||
|
||||
if (hsotg->gadget.speed != USB_SPEED_HIGH)
|
||||
limit >>= 3;
|
||||
|
||||
if (!frame_overrun && current_frame >= target_frame)
|
||||
return true;
|
||||
|
||||
if (frame_overrun && current_frame >= target_frame &&
|
||||
((current_frame - target_frame) < DSTS_SOFFN_LIMIT / 2))
|
||||
((current_frame - target_frame) < limit / 2))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
@ -1713,11 +1740,9 @@ static struct dwc2_hsotg_req *get_ep_head(struct dwc2_hsotg_ep *hs_ep)
|
|||
*/
|
||||
static void dwc2_gadget_start_next_request(struct dwc2_hsotg_ep *hs_ep)
|
||||
{
|
||||
u32 mask;
|
||||
struct dwc2_hsotg *hsotg = hs_ep->parent;
|
||||
int dir_in = hs_ep->dir_in;
|
||||
struct dwc2_hsotg_req *hs_req;
|
||||
u32 epmsk_reg = dir_in ? DIEPMSK : DOEPMSK;
|
||||
|
||||
if (!list_empty(&hs_ep->queue)) {
|
||||
hs_req = get_ep_head(hs_ep);
|
||||
|
|
@ -1733,9 +1758,6 @@ static void dwc2_gadget_start_next_request(struct dwc2_hsotg_ep *hs_ep)
|
|||
} else {
|
||||
dev_dbg(hsotg->dev, "%s: No more ISOC-OUT requests\n",
|
||||
__func__);
|
||||
mask = dwc2_readl(hsotg, epmsk_reg);
|
||||
mask |= DOEPMSK_OUTTKNEPDISMSK;
|
||||
dwc2_writel(hsotg, mask, epmsk_reg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2305,19 +2327,6 @@ static void dwc2_hsotg_ep0_zlp(struct dwc2_hsotg *hsotg, bool dir_in)
|
|||
dwc2_hsotg_program_zlp(hsotg, hsotg->eps_out[0]);
|
||||
}
|
||||
|
||||
static void dwc2_hsotg_change_ep_iso_parity(struct dwc2_hsotg *hsotg,
|
||||
u32 epctl_reg)
|
||||
{
|
||||
u32 ctrl;
|
||||
|
||||
ctrl = dwc2_readl(hsotg, epctl_reg);
|
||||
if (ctrl & DXEPCTL_EOFRNUM)
|
||||
ctrl |= DXEPCTL_SETEVENFR;
|
||||
else
|
||||
ctrl |= DXEPCTL_SETODDFR;
|
||||
dwc2_writel(hsotg, ctrl, epctl_reg);
|
||||
}
|
||||
|
||||
/*
|
||||
* dwc2_gadget_get_xfersize_ddma - get transferred bytes amount from desc
|
||||
* @hs_ep - The endpoint on which transfer went
|
||||
|
|
@ -2438,20 +2447,11 @@ static void dwc2_hsotg_handle_outdone(struct dwc2_hsotg *hsotg, int epnum)
|
|||
dwc2_hsotg_ep0_zlp(hsotg, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Slave mode OUT transfers do not go through XferComplete so
|
||||
* adjust the ISOC parity here.
|
||||
*/
|
||||
if (!using_dma(hsotg)) {
|
||||
if (hs_ep->isochronous && hs_ep->interval == 1)
|
||||
dwc2_hsotg_change_ep_iso_parity(hsotg, DOEPCTL(epnum));
|
||||
else if (hs_ep->isochronous && hs_ep->interval > 1)
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
}
|
||||
|
||||
/* Set actual frame number for completed transfers */
|
||||
if (!using_desc_dma(hsotg) && hs_ep->isochronous)
|
||||
req->frame_number = hsotg->frame_number;
|
||||
if (!using_desc_dma(hsotg) && hs_ep->isochronous) {
|
||||
req->frame_number = hs_ep->target_frame;
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
}
|
||||
|
||||
dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, result);
|
||||
}
|
||||
|
|
@ -2765,6 +2765,12 @@ static void dwc2_hsotg_complete_in(struct dwc2_hsotg *hsotg,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Set actual frame number for completed transfers */
|
||||
if (!using_desc_dma(hsotg) && hs_ep->isochronous) {
|
||||
hs_req->req.frame_number = hs_ep->target_frame;
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
}
|
||||
|
||||
dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0);
|
||||
}
|
||||
|
||||
|
|
@ -2825,23 +2831,18 @@ static void dwc2_gadget_handle_ep_disabled(struct dwc2_hsotg_ep *hs_ep)
|
|||
|
||||
dwc2_hsotg_txfifo_flush(hsotg, hs_ep->fifo_index);
|
||||
|
||||
if (hs_ep->isochronous) {
|
||||
dwc2_hsotg_complete_in(hsotg, hs_ep);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((epctl & DXEPCTL_STALL) && (epctl & DXEPCTL_EPTYPE_BULK)) {
|
||||
int dctl = dwc2_readl(hsotg, DCTL);
|
||||
|
||||
dctl |= DCTL_CGNPINNAK;
|
||||
dwc2_writel(hsotg, dctl, DCTL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (dctl & DCTL_GOUTNAKSTS) {
|
||||
dctl |= DCTL_CGOUTNAK;
|
||||
dwc2_writel(hsotg, dctl, DCTL);
|
||||
if (dctl & DCTL_GOUTNAKSTS) {
|
||||
dctl |= DCTL_CGOUTNAK;
|
||||
dwc2_writel(hsotg, dctl, DCTL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hs_ep->isochronous)
|
||||
|
|
@ -2862,8 +2863,6 @@ static void dwc2_gadget_handle_ep_disabled(struct dwc2_hsotg_ep *hs_ep)
|
|||
/* Update current frame number value. */
|
||||
hsotg->frame_number = dwc2_hsotg_read_frameno(hsotg);
|
||||
} while (dwc2_gadget_target_frame_elapsed(hs_ep));
|
||||
|
||||
dwc2_gadget_start_next_request(hs_ep);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2880,8 +2879,8 @@ static void dwc2_gadget_handle_ep_disabled(struct dwc2_hsotg_ep *hs_ep)
|
|||
static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep)
|
||||
{
|
||||
struct dwc2_hsotg *hsotg = ep->parent;
|
||||
struct dwc2_hsotg_req *hs_req;
|
||||
int dir_in = ep->dir_in;
|
||||
u32 doepmsk;
|
||||
|
||||
if (dir_in || !ep->isochronous)
|
||||
return;
|
||||
|
|
@ -2895,28 +2894,39 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ep->interval > 1 &&
|
||||
ep->target_frame == TARGET_FRAME_INITIAL) {
|
||||
if (ep->target_frame == TARGET_FRAME_INITIAL) {
|
||||
u32 ctrl;
|
||||
|
||||
ep->target_frame = hsotg->frame_number;
|
||||
dwc2_gadget_incr_frame_num(ep);
|
||||
if (ep->interval > 1) {
|
||||
ctrl = dwc2_readl(hsotg, DOEPCTL(ep->index));
|
||||
if (ep->target_frame & 0x1)
|
||||
ctrl |= DXEPCTL_SETODDFR;
|
||||
else
|
||||
ctrl |= DXEPCTL_SETEVENFR;
|
||||
|
||||
ctrl = dwc2_readl(hsotg, DOEPCTL(ep->index));
|
||||
if (ep->target_frame & 0x1)
|
||||
ctrl |= DXEPCTL_SETODDFR;
|
||||
else
|
||||
ctrl |= DXEPCTL_SETEVENFR;
|
||||
|
||||
dwc2_writel(hsotg, ctrl, DOEPCTL(ep->index));
|
||||
dwc2_writel(hsotg, ctrl, DOEPCTL(ep->index));
|
||||
}
|
||||
}
|
||||
|
||||
dwc2_gadget_start_next_request(ep);
|
||||
doepmsk = dwc2_readl(hsotg, DOEPMSK);
|
||||
doepmsk &= ~DOEPMSK_OUTTKNEPDISMSK;
|
||||
dwc2_writel(hsotg, doepmsk, DOEPMSK);
|
||||
while (dwc2_gadget_target_frame_elapsed(ep)) {
|
||||
hs_req = get_ep_head(ep);
|
||||
if (hs_req)
|
||||
dwc2_hsotg_complete_request(hsotg, ep, hs_req, -ENODATA);
|
||||
|
||||
dwc2_gadget_incr_frame_num(ep);
|
||||
/* Update current frame number value. */
|
||||
hsotg->frame_number = dwc2_hsotg_read_frameno(hsotg);
|
||||
}
|
||||
|
||||
if (!ep->req)
|
||||
dwc2_gadget_start_next_request(ep);
|
||||
|
||||
}
|
||||
|
||||
static void dwc2_hsotg_ep_stop_xfr(struct dwc2_hsotg *hsotg,
|
||||
struct dwc2_hsotg_ep *hs_ep);
|
||||
|
||||
/**
|
||||
* dwc2_gadget_handle_nak - handle NAK interrupt
|
||||
* @hs_ep: The endpoint on which interrupt is asserted.
|
||||
|
|
@ -2934,7 +2944,9 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep)
|
|||
static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep)
|
||||
{
|
||||
struct dwc2_hsotg *hsotg = hs_ep->parent;
|
||||
struct dwc2_hsotg_req *hs_req;
|
||||
int dir_in = hs_ep->dir_in;
|
||||
u32 ctrl;
|
||||
|
||||
if (!dir_in || !hs_ep->isochronous)
|
||||
return;
|
||||
|
|
@ -2976,13 +2988,29 @@ static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep)
|
|||
|
||||
dwc2_writel(hsotg, ctrl, DIEPCTL(hs_ep->index));
|
||||
}
|
||||
|
||||
dwc2_hsotg_complete_request(hsotg, hs_ep,
|
||||
get_ep_head(hs_ep), 0);
|
||||
}
|
||||
|
||||
if (!using_desc_dma(hsotg))
|
||||
if (using_desc_dma(hsotg))
|
||||
return;
|
||||
|
||||
ctrl = dwc2_readl(hsotg, DIEPCTL(hs_ep->index));
|
||||
if (ctrl & DXEPCTL_EPENA)
|
||||
dwc2_hsotg_ep_stop_xfr(hsotg, hs_ep);
|
||||
else
|
||||
dwc2_hsotg_txfifo_flush(hsotg, hs_ep->fifo_index);
|
||||
|
||||
while (dwc2_gadget_target_frame_elapsed(hs_ep)) {
|
||||
hs_req = get_ep_head(hs_ep);
|
||||
if (hs_req)
|
||||
dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, -ENODATA);
|
||||
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
/* Update current frame number value. */
|
||||
hsotg->frame_number = dwc2_hsotg_read_frameno(hsotg);
|
||||
}
|
||||
|
||||
if (!hs_ep->req)
|
||||
dwc2_gadget_start_next_request(hs_ep);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3038,21 +3066,15 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
|
|||
|
||||
/* In DDMA handle isochronous requests separately */
|
||||
if (using_desc_dma(hsotg) && hs_ep->isochronous) {
|
||||
/* XferCompl set along with BNA */
|
||||
if (!(ints & DXEPINT_BNAINTR))
|
||||
dwc2_gadget_complete_isoc_request_ddma(hs_ep);
|
||||
dwc2_gadget_complete_isoc_request_ddma(hs_ep);
|
||||
} else if (dir_in) {
|
||||
/*
|
||||
* We get OutDone from the FIFO, so we only
|
||||
* need to look at completing IN requests here
|
||||
* if operating slave mode
|
||||
*/
|
||||
if (hs_ep->isochronous && hs_ep->interval > 1)
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
|
||||
dwc2_hsotg_complete_in(hsotg, hs_ep);
|
||||
if (ints & DXEPINT_NAKINTRPT)
|
||||
ints &= ~DXEPINT_NAKINTRPT;
|
||||
if (!hs_ep->isochronous || !(ints & DXEPINT_NAKINTRPT))
|
||||
dwc2_hsotg_complete_in(hsotg, hs_ep);
|
||||
|
||||
if (idx == 0 && !hs_ep->req)
|
||||
dwc2_hsotg_enqueue_setup(hsotg);
|
||||
|
|
@ -3061,10 +3083,8 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
|
|||
* We're using DMA, we need to fire an OutDone here
|
||||
* as we ignore the RXFIFO.
|
||||
*/
|
||||
if (hs_ep->isochronous && hs_ep->interval > 1)
|
||||
dwc2_gadget_incr_frame_num(hs_ep);
|
||||
|
||||
dwc2_hsotg_handle_outdone(hsotg, idx);
|
||||
if (!hs_ep->isochronous || !(ints & DXEPINT_OUTTKNEPDIS))
|
||||
dwc2_hsotg_handle_outdone(hsotg, idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4083,6 +4103,7 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep,
|
|||
mask |= DIEPMSK_NAKMSK;
|
||||
dwc2_writel(hsotg, mask, DIEPMSK);
|
||||
} else {
|
||||
epctrl |= DXEPCTL_SNAK;
|
||||
mask = dwc2_readl(hsotg, DOEPMSK);
|
||||
mask |= DOEPMSK_OUTTKNEPDISMSK;
|
||||
dwc2_writel(hsotg, mask, DOEPMSK);
|
||||
|
|
|
|||
|
|
@ -264,19 +264,6 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
|
|||
{
|
||||
u32 reg;
|
||||
int retries = 1000;
|
||||
int ret;
|
||||
|
||||
usb_phy_init(dwc->usb2_phy);
|
||||
usb_phy_init(dwc->usb3_phy);
|
||||
ret = phy_init(dwc->usb2_generic_phy);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = phy_init(dwc->usb3_generic_phy);
|
||||
if (ret < 0) {
|
||||
phy_exit(dwc->usb2_generic_phy);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* We're resetting only the device side because, if we're in host mode,
|
||||
|
|
@ -310,9 +297,6 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
|
|||
udelay(1);
|
||||
} while (--retries);
|
||||
|
||||
phy_exit(dwc->usb3_generic_phy);
|
||||
phy_exit(dwc->usb2_generic_phy);
|
||||
|
||||
return -ETIMEDOUT;
|
||||
|
||||
done:
|
||||
|
|
@ -982,9 +966,21 @@ static int dwc3_core_init(struct dwc3 *dwc)
|
|||
dwc->phys_ready = true;
|
||||
}
|
||||
|
||||
usb_phy_init(dwc->usb2_phy);
|
||||
usb_phy_init(dwc->usb3_phy);
|
||||
ret = phy_init(dwc->usb2_generic_phy);
|
||||
if (ret < 0)
|
||||
goto err0a;
|
||||
|
||||
ret = phy_init(dwc->usb3_generic_phy);
|
||||
if (ret < 0) {
|
||||
phy_exit(dwc->usb2_generic_phy);
|
||||
goto err0a;
|
||||
}
|
||||
|
||||
ret = dwc3_core_soft_reset(dwc);
|
||||
if (ret)
|
||||
goto err0a;
|
||||
goto err1;
|
||||
|
||||
if (hw_mode == DWC3_GHWPARAMS0_MODE_DRD &&
|
||||
!DWC3_VER_IS_WITHIN(DWC3, ANY, 194A)) {
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@ static void set_feature(struct r8a66597 *r8a66597, struct usb_ctrlrequest *ctrl)
|
|||
do {
|
||||
tmp = r8a66597_read(r8a66597, INTSTS0) & CTSQ;
|
||||
udelay(1);
|
||||
} while (tmp != CS_IDST || timeout-- > 0);
|
||||
} while (tmp != CS_IDST && timeout-- > 0);
|
||||
|
||||
if (tmp == CS_IDST)
|
||||
r8a66597_bset(r8a66597,
|
||||
|
|
|
|||
|
|
@ -406,12 +406,9 @@ static int bcma_hcd_probe(struct bcma_device *core)
|
|||
return -ENOMEM;
|
||||
usb_dev->core = core;
|
||||
|
||||
if (core->dev.of_node) {
|
||||
if (core->dev.of_node)
|
||||
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
|
||||
GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(usb_dev->gpio_desc))
|
||||
return PTR_ERR(usb_dev->gpio_desc);
|
||||
}
|
||||
|
||||
switch (core->id.id) {
|
||||
case BCMA_CORE_USB20_HOST:
|
||||
|
|
|
|||
|
|
@ -692,6 +692,7 @@ int xhci_run(struct usb_hcd *hcd)
|
|||
if (ret)
|
||||
xhci_free_command(xhci, command);
|
||||
}
|
||||
set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags);
|
||||
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
|
||||
"Finished xhci_run for USB2 roothub");
|
||||
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ tusb_fifo_write_unaligned(void __iomem *fifo, const u8 *buf, u16 len)
|
|||
}
|
||||
if (len > 0) {
|
||||
/* Write the rest 1 - 3 bytes to FIFO */
|
||||
val = 0;
|
||||
memcpy(&val, buf, len);
|
||||
musb_writel(fifo, 0, val);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ static const struct usb_device_id id_table[] = {
|
|||
{ USB_DEVICE(0x1FB9, 0x0602) }, /* Lake Shore Model 648 Magnet Power Supply */
|
||||
{ USB_DEVICE(0x1FB9, 0x0700) }, /* Lake Shore Model 737 VSM Controller */
|
||||
{ USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */
|
||||
{ USB_DEVICE(0x2184, 0x0030) }, /* GW Instek GDM-834x Digital Multimeter */
|
||||
{ USB_DEVICE(0x2626, 0xEA60) }, /* Aruba Networks 7xxx USB Serial Console */
|
||||
{ USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
|
||||
{ USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */
|
||||
|
|
@ -260,6 +261,7 @@ struct cp210x_serial_private {
|
|||
speed_t min_speed;
|
||||
speed_t max_speed;
|
||||
bool use_actual_rate;
|
||||
bool no_event_mode;
|
||||
};
|
||||
|
||||
enum cp210x_event_state {
|
||||
|
|
@ -1331,12 +1333,16 @@ static void cp210x_change_speed(struct tty_struct *tty,
|
|||
|
||||
static void cp210x_enable_event_mode(struct usb_serial_port *port)
|
||||
{
|
||||
struct cp210x_serial_private *priv = usb_get_serial_data(port->serial);
|
||||
struct cp210x_port_private *port_priv = usb_get_serial_port_data(port);
|
||||
int ret;
|
||||
|
||||
if (port_priv->event_mode)
|
||||
return;
|
||||
|
||||
if (priv->no_event_mode)
|
||||
return;
|
||||
|
||||
port_priv->event_state = ES_DATA;
|
||||
port_priv->event_mode = true;
|
||||
|
||||
|
|
@ -2086,6 +2092,46 @@ static void cp210x_init_max_speed(struct usb_serial *serial)
|
|||
priv->use_actual_rate = use_actual_rate;
|
||||
}
|
||||
|
||||
static void cp2102_determine_quirks(struct usb_serial *serial)
|
||||
{
|
||||
struct cp210x_serial_private *priv = usb_get_serial_data(serial);
|
||||
u8 *buf;
|
||||
int ret;
|
||||
|
||||
buf = kmalloc(2, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return;
|
||||
/*
|
||||
* Some (possibly counterfeit) CP2102 do not support event-insertion
|
||||
* mode and respond differently to malformed vendor requests.
|
||||
* Specifically, they return one instead of two bytes when sent a
|
||||
* two-byte part-number request.
|
||||
*/
|
||||
ret = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
|
||||
CP210X_VENDOR_SPECIFIC, REQTYPE_DEVICE_TO_HOST,
|
||||
CP210X_GET_PARTNUM, 0, buf, 2, USB_CTRL_GET_TIMEOUT);
|
||||
if (ret == 1) {
|
||||
dev_dbg(&serial->interface->dev,
|
||||
"device does not support event-insertion mode\n");
|
||||
priv->no_event_mode = true;
|
||||
}
|
||||
|
||||
kfree(buf);
|
||||
}
|
||||
|
||||
static void cp210x_determine_quirks(struct usb_serial *serial)
|
||||
{
|
||||
struct cp210x_serial_private *priv = usb_get_serial_data(serial);
|
||||
|
||||
switch (priv->partnum) {
|
||||
case CP210X_PARTNUM_CP2102:
|
||||
cp2102_determine_quirks(serial);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int cp210x_attach(struct usb_serial *serial)
|
||||
{
|
||||
int result;
|
||||
|
|
@ -2106,6 +2152,7 @@ static int cp210x_attach(struct usb_serial *serial)
|
|||
|
||||
usb_set_serial_data(serial, priv);
|
||||
|
||||
cp210x_determine_quirks(serial);
|
||||
cp210x_init_max_speed(serial);
|
||||
|
||||
result = cp210x_gpio_init(serial);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@
|
|||
#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02
|
||||
#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
|
||||
#define BANDB_DEVICE_ID_USOPTL4_4P 0xBC03
|
||||
#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24
|
||||
|
||||
/* Interrupt Routine Defines */
|
||||
|
||||
|
|
@ -186,7 +185,6 @@ static const struct usb_device_id id_table[] = {
|
|||
{ USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P) },
|
||||
{ USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4) },
|
||||
{ USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P) },
|
||||
{ USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4) },
|
||||
{} /* terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, id_table);
|
||||
|
|
|
|||
|
|
@ -1205,6 +1205,14 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1060, 0xff), /* Telit LN920 (rmnet) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1061, 0xff), /* Telit LN920 (MBIM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1062, 0xff), /* Telit LN920 (RNDIS) */
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1063, 0xff), /* Telit LN920 (ECM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
|
||||
|
|
@ -1650,7 +1658,6 @@ static const struct usb_device_id option_ids[] = {
|
|||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff),
|
||||
.driver_info = RSVD(1) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff),
|
||||
|
|
@ -2068,6 +2075,8 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
|
||||
{ USB_DEVICE(0x0489, 0xe0b5), /* Foxconn T77W968 ESIM */
|
||||
.driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0db, 0xff), /* Foxconn T99W265 MBIM */
|
||||
.driver_info = RSVD(3) },
|
||||
{ USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */
|
||||
.driver_info = RSVD(4) | RSVD(5) | RSVD(6) },
|
||||
{ USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */
|
||||
|
|
|
|||
|
|
@ -416,9 +416,16 @@ UNUSUAL_DEV( 0x04cb, 0x0100, 0x0000, 0x2210,
|
|||
USB_SC_UFI, USB_PR_DEVICE, NULL, US_FL_FIX_INQUIRY | US_FL_SINGLE_LUN),
|
||||
|
||||
/*
|
||||
* Reported by Ondrej Zary <linux@rainbow-software.org>
|
||||
* Reported by Ondrej Zary <linux@zary.sk>
|
||||
* The device reports one sector more and breaks when that sector is accessed
|
||||
* Firmwares older than 2.6c (the latest one and the only that claims Linux
|
||||
* support) have also broken tag handling
|
||||
*/
|
||||
UNUSUAL_DEV( 0x04ce, 0x0002, 0x0000, 0x026b,
|
||||
"ScanLogic",
|
||||
"SL11R-IDE",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_FIX_CAPACITY | US_FL_BULK_IGNORE_TAG),
|
||||
UNUSUAL_DEV( 0x04ce, 0x0002, 0x026c, 0x026c,
|
||||
"ScanLogic",
|
||||
"SL11R-IDE",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ UNUSUAL_DEV(0x059f, 0x1061, 0x0000, 0x9999,
|
|||
"LaCie",
|
||||
"Rugged USB3-FW",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_IGNORE_UAS),
|
||||
US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME),
|
||||
|
||||
/*
|
||||
* Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/cred.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/pagemap.h>
|
||||
|
|
@ -115,7 +117,7 @@ static struct ctl_table xen_root[] = {
|
|||
#define EXTENT_ORDER (fls(XEN_PFN_PER_PAGE) - 1)
|
||||
|
||||
/*
|
||||
* balloon_process() state:
|
||||
* balloon_thread() state:
|
||||
*
|
||||
* BP_DONE: done or nothing to do,
|
||||
* BP_WAIT: wait to be rescheduled,
|
||||
|
|
@ -130,6 +132,8 @@ enum bp_state {
|
|||
BP_ECANCELED
|
||||
};
|
||||
|
||||
/* Main waiting point for xen-balloon thread. */
|
||||
static DECLARE_WAIT_QUEUE_HEAD(balloon_thread_wq);
|
||||
|
||||
static DEFINE_MUTEX(balloon_mutex);
|
||||
|
||||
|
|
@ -144,10 +148,6 @@ static xen_pfn_t frame_list[PAGE_SIZE / sizeof(xen_pfn_t)];
|
|||
static LIST_HEAD(ballooned_pages);
|
||||
static DECLARE_WAIT_QUEUE_HEAD(balloon_wq);
|
||||
|
||||
/* Main work function, always executed in process context. */
|
||||
static void balloon_process(struct work_struct *work);
|
||||
static DECLARE_DELAYED_WORK(balloon_worker, balloon_process);
|
||||
|
||||
/* When ballooning out (allocating memory to return to Xen) we don't really
|
||||
want the kernel to try too hard since that can trigger the oom killer. */
|
||||
#define GFP_BALLOON \
|
||||
|
|
@ -366,7 +366,7 @@ static void xen_online_page(struct page *page, unsigned int order)
|
|||
static int xen_memory_notifier(struct notifier_block *nb, unsigned long val, void *v)
|
||||
{
|
||||
if (val == MEM_ONLINE)
|
||||
schedule_delayed_work(&balloon_worker, 0);
|
||||
wake_up(&balloon_thread_wq);
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
|
@ -491,18 +491,43 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
|
|||
}
|
||||
|
||||
/*
|
||||
* As this is a work item it is guaranteed to run as a single instance only.
|
||||
* Stop waiting if either state is not BP_EAGAIN and ballooning action is
|
||||
* needed, or if the credit has changed while state is BP_EAGAIN.
|
||||
*/
|
||||
static bool balloon_thread_cond(enum bp_state state, long credit)
|
||||
{
|
||||
if (state != BP_EAGAIN)
|
||||
credit = 0;
|
||||
|
||||
return current_credit() != credit || kthread_should_stop();
|
||||
}
|
||||
|
||||
/*
|
||||
* As this is a kthread it is guaranteed to run as a single instance only.
|
||||
* We may of course race updates of the target counts (which are protected
|
||||
* by the balloon lock), or with changes to the Xen hard limit, but we will
|
||||
* recover from these in time.
|
||||
*/
|
||||
static void balloon_process(struct work_struct *work)
|
||||
static int balloon_thread(void *unused)
|
||||
{
|
||||
enum bp_state state = BP_DONE;
|
||||
long credit;
|
||||
unsigned long timeout;
|
||||
|
||||
set_freezable();
|
||||
for (;;) {
|
||||
if (state == BP_EAGAIN)
|
||||
timeout = balloon_stats.schedule_delay * HZ;
|
||||
else
|
||||
timeout = 3600 * HZ;
|
||||
credit = current_credit();
|
||||
|
||||
wait_event_freezable_timeout(balloon_thread_wq,
|
||||
balloon_thread_cond(state, credit), timeout);
|
||||
|
||||
if (kthread_should_stop())
|
||||
return 0;
|
||||
|
||||
do {
|
||||
mutex_lock(&balloon_mutex);
|
||||
|
||||
credit = current_credit();
|
||||
|
|
@ -529,12 +554,7 @@ static void balloon_process(struct work_struct *work)
|
|||
mutex_unlock(&balloon_mutex);
|
||||
|
||||
cond_resched();
|
||||
|
||||
} while (credit && state == BP_DONE);
|
||||
|
||||
/* Schedule more work if there is some still to be done. */
|
||||
if (state == BP_EAGAIN)
|
||||
schedule_delayed_work(&balloon_worker, balloon_stats.schedule_delay * HZ);
|
||||
}
|
||||
}
|
||||
|
||||
/* Resets the Xen limit, sets new target, and kicks off processing. */
|
||||
|
|
@ -542,7 +562,7 @@ void balloon_set_new_target(unsigned long target)
|
|||
{
|
||||
/* No need for lock. Not read-modify-write updates. */
|
||||
balloon_stats.target_pages = target;
|
||||
schedule_delayed_work(&balloon_worker, 0);
|
||||
wake_up(&balloon_thread_wq);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(balloon_set_new_target);
|
||||
|
||||
|
|
@ -647,7 +667,7 @@ void free_xenballooned_pages(int nr_pages, struct page **pages)
|
|||
|
||||
/* The balloon may be too large now. Shrink it if needed. */
|
||||
if (current_credit())
|
||||
schedule_delayed_work(&balloon_worker, 0);
|
||||
wake_up(&balloon_thread_wq);
|
||||
|
||||
mutex_unlock(&balloon_mutex);
|
||||
}
|
||||
|
|
@ -679,6 +699,8 @@ static void __init balloon_add_region(unsigned long start_pfn,
|
|||
|
||||
static int __init balloon_init(void)
|
||||
{
|
||||
struct task_struct *task;
|
||||
|
||||
if (!xen_domain())
|
||||
return -ENODEV;
|
||||
|
||||
|
|
@ -722,6 +744,12 @@ static int __init balloon_init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
task = kthread_run(balloon_thread, NULL, "xen-balloon");
|
||||
if (IS_ERR(task)) {
|
||||
pr_err("xen-balloon thread could not be started, ballooning will not work!\n");
|
||||
return PTR_ERR(task);
|
||||
}
|
||||
|
||||
/* Init the xen-balloon driver. */
|
||||
xen_balloon_init();
|
||||
|
||||
|
|
|
|||
46
fs/afs/dir.c
46
fs/afs/dir.c
|
|
@ -997,9 +997,9 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
|
|||
*/
|
||||
static int afs_d_revalidate_rcu(struct dentry *dentry)
|
||||
{
|
||||
struct afs_vnode *dvnode, *vnode;
|
||||
struct afs_vnode *dvnode;
|
||||
struct dentry *parent;
|
||||
struct inode *dir, *inode;
|
||||
struct inode *dir;
|
||||
long dir_version, de_version;
|
||||
|
||||
_enter("%p", dentry);
|
||||
|
|
@ -1029,18 +1029,6 @@ static int afs_d_revalidate_rcu(struct dentry *dentry)
|
|||
return -ECHILD;
|
||||
}
|
||||
|
||||
/* Check to see if the vnode referred to by the dentry still
|
||||
* has a callback.
|
||||
*/
|
||||
if (d_really_is_positive(dentry)) {
|
||||
inode = d_inode_rcu(dentry);
|
||||
if (inode) {
|
||||
vnode = AFS_FS_I(inode);
|
||||
if (!afs_check_validity(vnode))
|
||||
return -ECHILD;
|
||||
}
|
||||
}
|
||||
|
||||
return 1; /* Still valid */
|
||||
}
|
||||
|
||||
|
|
@ -1076,17 +1064,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
|||
if (IS_ERR(key))
|
||||
key = NULL;
|
||||
|
||||
if (d_really_is_positive(dentry)) {
|
||||
inode = d_inode(dentry);
|
||||
if (inode) {
|
||||
vnode = AFS_FS_I(inode);
|
||||
afs_validate(vnode, key);
|
||||
if (test_bit(AFS_VNODE_DELETED, &vnode->flags))
|
||||
goto out_bad;
|
||||
}
|
||||
}
|
||||
|
||||
/* lock down the parent dentry so we can peer at it */
|
||||
/* Hold the parent dentry so we can peer at it */
|
||||
parent = dget_parent(dentry);
|
||||
dir = AFS_FS_I(d_inode(parent));
|
||||
|
||||
|
|
@ -1095,7 +1073,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
|||
|
||||
if (test_bit(AFS_VNODE_DELETED, &dir->flags)) {
|
||||
_debug("%pd: parent dir deleted", dentry);
|
||||
goto out_bad_parent;
|
||||
goto not_found;
|
||||
}
|
||||
|
||||
/* We only need to invalidate a dentry if the server's copy changed
|
||||
|
|
@ -1121,12 +1099,12 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
|||
case 0:
|
||||
/* the filename maps to something */
|
||||
if (d_really_is_negative(dentry))
|
||||
goto out_bad_parent;
|
||||
goto not_found;
|
||||
inode = d_inode(dentry);
|
||||
if (is_bad_inode(inode)) {
|
||||
printk("kAFS: afs_d_revalidate: %pd2 has bad inode\n",
|
||||
dentry);
|
||||
goto out_bad_parent;
|
||||
goto not_found;
|
||||
}
|
||||
|
||||
vnode = AFS_FS_I(inode);
|
||||
|
|
@ -1148,9 +1126,6 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
|||
dentry, fid.unique,
|
||||
vnode->fid.unique,
|
||||
vnode->vfs_inode.i_generation);
|
||||
write_seqlock(&vnode->cb_lock);
|
||||
set_bit(AFS_VNODE_DELETED, &vnode->flags);
|
||||
write_sequnlock(&vnode->cb_lock);
|
||||
goto not_found;
|
||||
}
|
||||
goto out_valid;
|
||||
|
|
@ -1165,7 +1140,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
|
|||
default:
|
||||
_debug("failed to iterate dir %pd: %d",
|
||||
parent, ret);
|
||||
goto out_bad_parent;
|
||||
goto not_found;
|
||||
}
|
||||
|
||||
out_valid:
|
||||
|
|
@ -1176,16 +1151,9 @@ out_valid_noupdate:
|
|||
_leave(" = 1 [valid]");
|
||||
return 1;
|
||||
|
||||
/* the dirent, if it exists, now points to a different vnode */
|
||||
not_found:
|
||||
spin_lock(&dentry->d_lock);
|
||||
dentry->d_flags |= DCACHE_NFSFS_RENAMED;
|
||||
spin_unlock(&dentry->d_lock);
|
||||
|
||||
out_bad_parent:
|
||||
_debug("dropping dentry %pd2", dentry);
|
||||
dput(parent);
|
||||
out_bad:
|
||||
key_put(key);
|
||||
|
||||
_leave(" = 0 [bad]");
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ void afs_edit_dir_add(struct afs_vnode *vnode,
|
|||
if (b == nr_blocks) {
|
||||
_debug("init %u", b);
|
||||
afs_edit_init_block(meta, block, b);
|
||||
i_size_write(&vnode->vfs_inode, (b + 1) * AFS_DIR_BLOCK_SIZE);
|
||||
afs_set_i_size(vnode, (b + 1) * AFS_DIR_BLOCK_SIZE);
|
||||
}
|
||||
|
||||
/* Only lower dir pages have a counter in the header. */
|
||||
|
|
@ -297,7 +297,7 @@ void afs_edit_dir_add(struct afs_vnode *vnode,
|
|||
new_directory:
|
||||
afs_edit_init_block(meta, meta, 0);
|
||||
i_size = AFS_DIR_BLOCK_SIZE;
|
||||
i_size_write(&vnode->vfs_inode, i_size);
|
||||
afs_set_i_size(vnode, i_size);
|
||||
slot = AFS_DIR_RESV_BLOCKS0;
|
||||
page = page0;
|
||||
block = meta;
|
||||
|
|
|
|||
|
|
@ -53,16 +53,6 @@ static noinline void dump_vnode(struct afs_vnode *vnode, struct afs_vnode *paren
|
|||
dump_stack();
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the file size and block count. Estimate the number of 512 bytes blocks
|
||||
* used, rounded up to nearest 1K for consistency with other AFS clients.
|
||||
*/
|
||||
static void afs_set_i_size(struct afs_vnode *vnode, u64 size)
|
||||
{
|
||||
i_size_write(&vnode->vfs_inode, size);
|
||||
vnode->vfs_inode.i_blocks = ((size + 1023) >> 10) << 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialise an inode from the vnode status.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1573,6 +1573,16 @@ static inline void afs_update_dentry_version(struct afs_operation *op,
|
|||
(void *)(unsigned long)dir_vp->scb.status.data_version;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the file size and block count. Estimate the number of 512 bytes blocks
|
||||
* used, rounded up to nearest 1K for consistency with other AFS clients.
|
||||
*/
|
||||
static inline void afs_set_i_size(struct afs_vnode *vnode, u64 size)
|
||||
{
|
||||
i_size_write(&vnode->vfs_inode, size);
|
||||
vnode->vfs_inode.i_blocks = ((size + 1023) >> 10) << 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a conflicting operation on a directory that we just unlinked from.
|
||||
* If someone managed to sneak a link or an unlink in on the file we just
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ int afs_write_end(struct file *file, struct address_space *mapping,
|
|||
write_seqlock(&vnode->cb_lock);
|
||||
i_size = i_size_read(&vnode->vfs_inode);
|
||||
if (maybe_i_size > i_size)
|
||||
i_size_write(&vnode->vfs_inode, maybe_i_size);
|
||||
afs_set_i_size(vnode, maybe_i_size);
|
||||
write_sequnlock(&vnode->cb_lock);
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue