···1009100910101010 (*) Check call still alive.1011101110121012- u32 rxrpc_kernel_check_life(struct socket *sock,10131013- struct rxrpc_call *call);10121012+ bool rxrpc_kernel_check_life(struct socket *sock,10131013+ struct rxrpc_call *call,10141014+ u32 *_life);10141015 void rxrpc_kernel_probe_life(struct socket *sock,10151016 struct rxrpc_call *call);1016101710171017- The first function returns a number that is updated when ACKs are received10181018- from the peer (notably including PING RESPONSE ACKs which we can elicit by10191019- sending PING ACKs to see if the call still exists on the server). The10201020- caller should compare the numbers of two calls to see if the call is still10211021- alive after waiting for a suitable interval.10181018+ The first function passes back in *_life a number that is updated when10191019+ ACKs are received from the peer (notably including PING RESPONSE ACKs10201020+ which we can elicit by sending PING ACKs to see if the call still exists10211021+ on the server). The caller should compare the numbers of two calls to see10221022+ if the call is still alive after waiting for a suitable interval. It also10231023+ returns true as long as the call hasn't yet reached the completed state.1022102410231025 This allows the caller to work out if the server is still contactable and10241026 if the call is still alive on the server while waiting for the server to
+15-2
MAINTAINERS
···1013910139F: Documentation/devicetree/bindings/mfd/atmel-usart.txt10140101401014110141MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER1014210142-M: Woojung Huh <Woojung.Huh@microchip.com>1014210142+M: Woojung Huh <woojung.huh@microchip.com>1014310143M: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>1014410144L: netdev@vger.kernel.org1014510145S: Maintained···1650316503F: include/linux/virtio_console.h1650416504F: include/uapi/linux/virtio_console.h16505165051650616506-VIRTIO CORE, NET AND BLOCK DRIVERS1650616506+VIRTIO CORE AND NET DRIVERS1650716507M: "Michael S. Tsirkin" <mst@redhat.com>1650816508M: Jason Wang <jasowang@redhat.com>1650916509L: virtualization@lists.linux-foundation.org···1651716517F: include/uapi/linux/virtio_*.h1651816518F: drivers/crypto/virtio/1651916519F: mm/balloon_compaction.c1652016520+1652116521+VIRTIO BLOCK AND SCSI DRIVERS1652216522+M: "Michael S. Tsirkin" <mst@redhat.com>1652316523+M: Jason Wang <jasowang@redhat.com>1652416524+R: Paolo Bonzini <pbonzini@redhat.com>1652516525+R: Stefan Hajnoczi <stefanha@redhat.com>1652616526+L: virtualization@lists.linux-foundation.org1652716527+S: Maintained1652816528+F: drivers/block/virtio_blk.c1652916529+F: drivers/scsi/virtio_scsi.c1653016530+F: include/uapi/linux/virtio_blk.h1653116531+F: include/uapi/linux/virtio_scsi.h1653216532+F: drivers/vhost/scsi.c16520165331652116534VIRTIO CRYPTO DRIVER1652216535M: Gonglei <arei.gonglei@huawei.com>
···107107 trampoline = get_plt_entry(addr, mod->arch.ftrace_trampoline);108108 if (!plt_entries_equal(mod->arch.ftrace_trampoline,109109 &trampoline)) {110110- if (!plt_entries_equal(mod->arch.ftrace_trampoline,111111- &(struct plt_entry){})) {110110+ if (plt_entry_is_initialized(mod->arch.ftrace_trampoline)) {112111 pr_err("ftrace: far branches to multiple entry points unsupported inside a single module\n");113112 return -EINVAL;114113 }
+9-6
arch/arm64/kernel/traps.c
···102102void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)103103{104104 struct stackframe frame;105105- int skip;105105+ int skip = 0;106106107107 pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk);108108+109109+ if (regs) {110110+ if (user_mode(regs))111111+ return;112112+ skip = 1;113113+ }108114109115 if (!tsk)110116 tsk = current;···132126 frame.graph = 0;133127#endif134128135135- skip = !!regs;136129 printk("Call trace:\n");137130 do {138131 /* skip until specified stack frame */···181176 return ret;182177183178 print_modules();184184- __show_regs(regs);185179 pr_emerg("Process %.*s (pid: %d, stack limit = 0x%p)\n",186180 TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk),187181 end_of_stack(tsk));182182+ show_regs(regs);188183189189- if (!user_mode(regs)) {190190- dump_backtrace(regs, tsk);184184+ if (!user_mode(regs))191185 dump_instr(KERN_EMERG, regs);192192- }193186194187 return ret;195188}
···656656 ld r4,PACA_EXSLB+EX_DAR(r13)657657 std r4,_DAR(r1)658658 addi r3,r1,STACK_FRAME_OVERHEAD659659+BEGIN_MMU_FTR_SECTION660660+ /* HPT case, do SLB fault */659661 bl do_slb_fault660662 cmpdi r3,0661663 bne- 1f662664 b fast_exception_return6636651: /* Error case */666666+MMU_FTR_SECTION_ELSE667667+ /* Radix case, access is outside page table range */668668+ li r3,-EFAULT669669+ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)664670 std r3,RESULT(r1)665671 bl save_nvgprs666672 RECONCILE_IRQ_STATE(r10, r11)···711705 EXCEPTION_PROLOG_COMMON(0x480, PACA_EXSLB)712706 ld r4,_NIP(r1)713707 addi r3,r1,STACK_FRAME_OVERHEAD708708+BEGIN_MMU_FTR_SECTION709709+ /* HPT case, do SLB fault */714710 bl do_slb_fault715711 cmpdi r3,0716712 bne- 1f717713 b fast_exception_return7187141: /* Error case */715715+MMU_FTR_SECTION_ELSE716716+ /* Radix case, access is outside page table range */717717+ li r3,-EFAULT718718+ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)719719 std r3,RESULT(r1)720720 bl save_nvgprs721721 RECONCILE_IRQ_STATE(r10, r11)
-8
arch/powerpc/kernel/head_32.S
···851851 tophys(r4,r2)852852 addi r4,r4,THREAD /* phys address of our thread_struct */853853 mtspr SPRN_SPRG_THREAD,r4854854-#ifdef CONFIG_PPC_RTAS855855- li r3,0856856- stw r3, RTAS_SP(r4) /* 0 => not in RTAS */857857-#endif858854 lis r4, (swapper_pg_dir - PAGE_OFFSET)@h859855 ori r4, r4, (swapper_pg_dir - PAGE_OFFSET)@l860856 mtspr SPRN_SPRG_PGDIR, r4···937941 tophys(r4,r2)938942 addi r4,r4,THREAD /* init task's THREAD */939943 mtspr SPRN_SPRG_THREAD,r4940940-#ifdef CONFIG_PPC_RTAS941941- li r3,0942942- stw r3, RTAS_SP(r4) /* 0 => not in RTAS */943943-#endif944944 lis r4, (swapper_pg_dir - PAGE_OFFSET)@h945945 ori r4, r4, (swapper_pg_dir - PAGE_OFFSET)@l946946 mtspr SPRN_SPRG_PGDIR, r4
+1-1
arch/powerpc/kernel/vdso32/gettimeofday.S
···9898 * can be used, r7 contains NSEC_PER_SEC.9999 */100100101101- lwz r5,WTOM_CLOCK_SEC(r9)101101+ lwz r5,(WTOM_CLOCK_SEC+LOPART)(r9)102102 lwz r6,WTOM_CLOCK_NSEC(r9)103103104104 /* We now have our offset in r5,r6. We create a fake dependency
+84
arch/riscv/configs/rv32_defconfig
···11+CONFIG_SYSVIPC=y22+CONFIG_POSIX_MQUEUE=y33+CONFIG_IKCONFIG=y44+CONFIG_IKCONFIG_PROC=y55+CONFIG_CGROUPS=y66+CONFIG_CGROUP_SCHED=y77+CONFIG_CFS_BANDWIDTH=y88+CONFIG_CGROUP_BPF=y99+CONFIG_NAMESPACES=y1010+CONFIG_USER_NS=y1111+CONFIG_CHECKPOINT_RESTORE=y1212+CONFIG_BLK_DEV_INITRD=y1313+CONFIG_EXPERT=y1414+CONFIG_BPF_SYSCALL=y1515+CONFIG_ARCH_RV32I=y1616+CONFIG_SMP=y1717+CONFIG_MODULES=y1818+CONFIG_MODULE_UNLOAD=y1919+CONFIG_NET=y2020+CONFIG_PACKET=y2121+CONFIG_UNIX=y2222+CONFIG_INET=y2323+CONFIG_IP_MULTICAST=y2424+CONFIG_IP_ADVANCED_ROUTER=y2525+CONFIG_IP_PNP=y2626+CONFIG_IP_PNP_DHCP=y2727+CONFIG_IP_PNP_BOOTP=y2828+CONFIG_IP_PNP_RARP=y2929+CONFIG_NETLINK_DIAG=y3030+CONFIG_PCI=y3131+CONFIG_PCIEPORTBUS=y3232+CONFIG_PCI_HOST_GENERIC=y3333+CONFIG_PCIE_XILINX=y3434+CONFIG_DEVTMPFS=y3535+CONFIG_BLK_DEV_LOOP=y3636+CONFIG_VIRTIO_BLK=y3737+CONFIG_BLK_DEV_SD=y3838+CONFIG_BLK_DEV_SR=y3939+CONFIG_ATA=y4040+CONFIG_SATA_AHCI=y4141+CONFIG_SATA_AHCI_PLATFORM=y4242+CONFIG_NETDEVICES=y4343+CONFIG_VIRTIO_NET=y4444+CONFIG_MACB=y4545+CONFIG_E1000E=y4646+CONFIG_R8169=y4747+CONFIG_MICROSEMI_PHY=y4848+CONFIG_INPUT_MOUSEDEV=y4949+CONFIG_SERIAL_8250=y5050+CONFIG_SERIAL_8250_CONSOLE=y5151+CONFIG_SERIAL_OF_PLATFORM=y5252+CONFIG_SERIAL_EARLYCON_RISCV_SBI=y5353+CONFIG_HVC_RISCV_SBI=y5454+# CONFIG_PTP_1588_CLOCK is not set5555+CONFIG_DRM=y5656+CONFIG_DRM_RADEON=y5757+CONFIG_FRAMEBUFFER_CONSOLE=y5858+CONFIG_USB=y5959+CONFIG_USB_XHCI_HCD=y6060+CONFIG_USB_XHCI_PLATFORM=y6161+CONFIG_USB_EHCI_HCD=y6262+CONFIG_USB_EHCI_HCD_PLATFORM=y6363+CONFIG_USB_OHCI_HCD=y6464+CONFIG_USB_OHCI_HCD_PLATFORM=y6565+CONFIG_USB_STORAGE=y6666+CONFIG_USB_UAS=y6767+CONFIG_VIRTIO_MMIO=y6868+CONFIG_SIFIVE_PLIC=y6969+CONFIG_EXT4_FS=y7070+CONFIG_EXT4_FS_POSIX_ACL=y7171+CONFIG_AUTOFS4_FS=y7272+CONFIG_MSDOS_FS=y7373+CONFIG_VFAT_FS=y7474+CONFIG_TMPFS=y7575+CONFIG_TMPFS_POSIX_ACL=y7676+CONFIG_NFS_FS=y7777+CONFIG_NFS_V4=y7878+CONFIG_NFS_V4_1=y7979+CONFIG_NFS_V4_2=y8080+CONFIG_ROOT_NFS=y8181+CONFIG_CRYPTO_USER_API_HASH=y8282+CONFIG_CRYPTO_DEV_VIRTIO=y8383+CONFIG_PRINTK_TIME=y8484+# CONFIG_RCU_TRACE is not set
+8
arch/riscv/mm/init.c
···121121 */122122 memblock_reserve(reg->base, vmlinux_end - reg->base);123123 mem_size = min(reg->size, (phys_addr_t)-PAGE_OFFSET);124124+125125+ /*126126+ * Remove memblock from the end of usable area to the127127+ * end of region128128+ */129129+ if (reg->base + mem_size < end)130130+ memblock_remove(reg->base + mem_size,131131+ end - reg->base - mem_size);124132 }125133 }126134 BUG_ON(mem_size == 0);
+11-9
arch/sparc/kernel/pci_sun4v.c
···7373 p->npages = 0;7474}75757676+static inline bool iommu_use_atu(struct iommu *iommu, u64 mask)7777+{7878+ return iommu->atu && mask > DMA_BIT_MASK(32);7979+}8080+7681/* Interrupts must be disabled. */7782static long iommu_batch_flush(struct iommu_batch *p, u64 mask)7883{···9792 prot &= (HV_PCI_MAP_ATTR_READ | HV_PCI_MAP_ATTR_WRITE);98939994 while (npages != 0) {100100- if (mask <= DMA_BIT_MASK(32) || !pbm->iommu->atu) {9595+ if (!iommu_use_atu(pbm->iommu, mask)) {10196 num = pci_sun4v_iommu_map(devhandle,10297 HV_PCI_TSBID(0, entry),10398 npages,···184179 unsigned long flags, order, first_page, npages, n;185180 unsigned long prot = 0;186181 struct iommu *iommu;187187- struct atu *atu;188182 struct iommu_map_table *tbl;189183 struct page *page;190184 void *ret;···209205 memset((char *)first_page, 0, PAGE_SIZE << order);210206211207 iommu = dev->archdata.iommu;212212- atu = iommu->atu;213213-214208 mask = dev->coherent_dma_mask;215215- if (mask <= DMA_BIT_MASK(32) || !atu)209209+ if (!iommu_use_atu(iommu, mask))216210 tbl = &iommu->tbl;217211 else218218- tbl = &atu->tbl;212212+ tbl = &iommu->atu->tbl;219213220214 entry = iommu_tbl_range_alloc(dev, tbl, npages, NULL,221215 (unsigned long)(-1), 0);···335333 atu = iommu->atu;336334 devhandle = pbm->devhandle;337335338338- if (dvma <= DMA_BIT_MASK(32)) {336336+ if (!iommu_use_atu(iommu, dvma)) {339337 tbl = &iommu->tbl;340338 iotsb_num = 0; /* we don't care for legacy iommu */341339 } else {···376374 npages >>= IO_PAGE_SHIFT;377375378376 mask = *dev->dma_mask;379379- if (mask <= DMA_BIT_MASK(32))377377+ if (!iommu_use_atu(iommu, mask))380378 tbl = &iommu->tbl;381379 else382380 tbl = &atu->tbl;···512510 IO_PAGE_SIZE) >> IO_PAGE_SHIFT;513511514512 mask = *dev->dma_mask;515515- if (mask <= DMA_BIT_MASK(32))513513+ if (!iommu_use_atu(iommu, mask))516514 tbl = &iommu->tbl;517515 else518516 tbl = &atu->tbl;
+135-5
arch/x86/events/amd/core.c
···33#include <linux/types.h>44#include <linux/init.h>55#include <linux/slab.h>66+#include <linux/delay.h>67#include <asm/apicdef.h>88+#include <asm/nmi.h>79810#include "../perf_event.h"1111+1212+static DEFINE_PER_CPU(unsigned int, perf_nmi_counter);9131014static __initconst const u64 amd_hw_cache_event_ids1115 [PERF_COUNT_HW_CACHE_MAX]···433429 }434430}435431432432+/*433433+ * When a PMC counter overflows, an NMI is used to process the event and434434+ * reset the counter. NMI latency can result in the counter being updated435435+ * before the NMI can run, which can result in what appear to be spurious436436+ * NMIs. This function is intended to wait for the NMI to run and reset437437+ * the counter to avoid possible unhandled NMI messages.438438+ */439439+#define OVERFLOW_WAIT_COUNT 50440440+441441+static void amd_pmu_wait_on_overflow(int idx)442442+{443443+ unsigned int i;444444+ u64 counter;445445+446446+ /*447447+ * Wait for the counter to be reset if it has overflowed. This loop448448+ * should exit very, very quickly, but just in case, don't wait449449+ * forever...450450+ */451451+ for (i = 0; i < OVERFLOW_WAIT_COUNT; i++) {452452+ rdmsrl(x86_pmu_event_addr(idx), counter);453453+ if (counter & (1ULL << (x86_pmu.cntval_bits - 1)))454454+ break;455455+456456+ /* Might be in IRQ context, so can't sleep */457457+ udelay(1);458458+ }459459+}460460+461461+static void amd_pmu_disable_all(void)462462+{463463+ struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);464464+ int idx;465465+466466+ x86_pmu_disable_all();467467+468468+ /*469469+ * This shouldn't be called from NMI context, but add a safeguard here470470+ * to return, since if we're in NMI context we can't wait for an NMI471471+ * to reset an overflowed counter value.472472+ */473473+ if (in_nmi())474474+ return;475475+476476+ /*477477+ * Check each counter for overflow and wait for it to be reset by the478478+ * NMI if it has overflowed. This relies on the fact that all active479479+ * counters are always enabled when this function is caled and480480+ * ARCH_PERFMON_EVENTSEL_INT is always set.481481+ */482482+ for (idx = 0; idx < x86_pmu.num_counters; idx++) {483483+ if (!test_bit(idx, cpuc->active_mask))484484+ continue;485485+486486+ amd_pmu_wait_on_overflow(idx);487487+ }488488+}489489+490490+static void amd_pmu_disable_event(struct perf_event *event)491491+{492492+ x86_pmu_disable_event(event);493493+494494+ /*495495+ * This can be called from NMI context (via x86_pmu_stop). The counter496496+ * may have overflowed, but either way, we'll never see it get reset497497+ * by the NMI if we're already in the NMI. And the NMI latency support498498+ * below will take care of any pending NMI that might have been499499+ * generated by the overflow.500500+ */501501+ if (in_nmi())502502+ return;503503+504504+ amd_pmu_wait_on_overflow(event->hw.idx);505505+}506506+507507+/*508508+ * Because of NMI latency, if multiple PMC counters are active or other sources509509+ * of NMIs are received, the perf NMI handler can handle one or more overflowed510510+ * PMC counters outside of the NMI associated with the PMC overflow. If the NMI511511+ * doesn't arrive at the LAPIC in time to become a pending NMI, then the kernel512512+ * back-to-back NMI support won't be active. This PMC handler needs to take into513513+ * account that this can occur, otherwise this could result in unknown NMI514514+ * messages being issued. Examples of this is PMC overflow while in the NMI515515+ * handler when multiple PMCs are active or PMC overflow while handling some516516+ * other source of an NMI.517517+ *518518+ * Attempt to mitigate this by using the number of active PMCs to determine519519+ * whether to return NMI_HANDLED if the perf NMI handler did not handle/reset520520+ * any PMCs. The per-CPU perf_nmi_counter variable is set to a minimum of the521521+ * number of active PMCs or 2. The value of 2 is used in case an NMI does not522522+ * arrive at the LAPIC in time to be collapsed into an already pending NMI.523523+ */524524+static int amd_pmu_handle_irq(struct pt_regs *regs)525525+{526526+ struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);527527+ int active, handled;528528+529529+ /*530530+ * Obtain the active count before calling x86_pmu_handle_irq() since531531+ * it is possible that x86_pmu_handle_irq() may make a counter532532+ * inactive (through x86_pmu_stop).533533+ */534534+ active = __bitmap_weight(cpuc->active_mask, X86_PMC_IDX_MAX);535535+536536+ /* Process any counter overflows */537537+ handled = x86_pmu_handle_irq(regs);538538+539539+ /*540540+ * If a counter was handled, record the number of possible remaining541541+ * NMIs that can occur.542542+ */543543+ if (handled) {544544+ this_cpu_write(perf_nmi_counter,545545+ min_t(unsigned int, 2, active));546546+547547+ return handled;548548+ }549549+550550+ if (!this_cpu_read(perf_nmi_counter))551551+ return NMI_DONE;552552+553553+ this_cpu_dec(perf_nmi_counter);554554+555555+ return NMI_HANDLED;556556+}557557+436558static struct event_constraint *437559amd_get_event_constraints(struct cpu_hw_events *cpuc, int idx,438560 struct perf_event *event)···751621752622static __initconst const struct x86_pmu amd_pmu = {753623 .name = "AMD",754754- .handle_irq = x86_pmu_handle_irq,755755- .disable_all = x86_pmu_disable_all,624624+ .handle_irq = amd_pmu_handle_irq,625625+ .disable_all = amd_pmu_disable_all,756626 .enable_all = x86_pmu_enable_all,757627 .enable = x86_pmu_enable_event,758758- .disable = x86_pmu_disable_event,628628+ .disable = amd_pmu_disable_event,759629 .hw_config = amd_pmu_hw_config,760630 .schedule_events = x86_schedule_events,761631 .eventsel = MSR_K7_EVNTSEL0,···862732 cpuc->perf_ctr_virt_mask = 0;863733864734 /* Reload all events */865865- x86_pmu_disable_all();735735+ amd_pmu_disable_all();866736 x86_pmu_enable_all(0);867737}868738EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);···880750 cpuc->perf_ctr_virt_mask = AMD64_EVENTSEL_HOSTONLY;881751882752 /* Reload all events */883883- x86_pmu_disable_all();753753+ amd_pmu_disable_all();884754 x86_pmu_enable_all(0);885755}886756EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
+3-10
arch/x86/events/core.c
···13491349 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);13501350 struct hw_perf_event *hwc = &event->hw;1351135113521352- if (__test_and_clear_bit(hwc->idx, cpuc->active_mask)) {13521352+ if (test_bit(hwc->idx, cpuc->active_mask)) {13531353 x86_pmu.disable(event);13541354+ __clear_bit(hwc->idx, cpuc->active_mask);13541355 cpuc->events[hwc->idx] = NULL;13551356 WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED);13561357 hwc->state |= PERF_HES_STOPPED;···14481447 apic_write(APIC_LVTPC, APIC_DM_NMI);1449144814501449 for (idx = 0; idx < x86_pmu.num_counters; idx++) {14511451- if (!test_bit(idx, cpuc->active_mask)) {14521452- /*14531453- * Though we deactivated the counter some cpus14541454- * might still deliver spurious interrupts still14551455- * in flight. Catch them:14561456- */14571457- if (__test_and_clear_bit(idx, cpuc->running))14581458- handled++;14501450+ if (!test_bit(idx, cpuc->active_mask))14591451 continue;14601460- }1461145214621453 event = cpuc->events[idx];14631454
+7-1
arch/x86/events/intel/core.c
···31853185 return ret;3186318631873187 if (event->attr.precise_ip) {31883188- if (!event->attr.freq) {31883188+ if (!(event->attr.freq || event->attr.wakeup_events)) {31893189 event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;31903190 if (!(event->attr.sample_type &31913191 ~intel_pmu_large_pebs_flags(event)))···35743574 intel_pmu_lbr_reset();3575357535763576 cpuc->lbr_sel = NULL;35773577+35783578+ if (x86_pmu.flags & PMU_FL_TFA) {35793579+ WARN_ON_ONCE(cpuc->tfa_shadow);35803580+ cpuc->tfa_shadow = ~0ULL;35813581+ intel_set_tfa(cpuc, false);35823582+ }3577358335783584 if (x86_pmu.version > 1)35793585 flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
+18-23
arch/x86/include/asm/bitops.h
···3636 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).3737 */38383939-#define BITOP_ADDR(x) "+m" (*(volatile long *) (x))3939+#define RLONG_ADDR(x) "m" (*(volatile long *) (x))4040+#define WBYTE_ADDR(x) "+m" (*(volatile char *) (x))40414141-#define ADDR BITOP_ADDR(addr)4242+#define ADDR RLONG_ADDR(addr)42434344/*4445 * We do the locked ops that don't return the old value as4546 * a mask operation on a byte.4647 */4748#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr))4848-#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3))4949+#define CONST_MASK_ADDR(nr, addr) WBYTE_ADDR((void *)(addr) + ((nr)>>3))4950#define CONST_MASK(nr) (1 << ((nr) & 7))50515152/**···7473 : "memory");7574 } else {7675 asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0"7777- : BITOP_ADDR(addr) : "Ir" (nr) : "memory");7676+ : : RLONG_ADDR(addr), "Ir" (nr) : "memory");7877 }7978}8079···8988 */9089static __always_inline void __set_bit(long nr, volatile unsigned long *addr)9190{9292- asm volatile(__ASM_SIZE(bts) " %1,%0" : ADDR : "Ir" (nr) : "memory");9191+ asm volatile(__ASM_SIZE(bts) " %1,%0" : : ADDR, "Ir" (nr) : "memory");9392}94939594/**···111110 : "iq" ((u8)~CONST_MASK(nr)));112111 } else {113112 asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0"114114- : BITOP_ADDR(addr)115115- : "Ir" (nr));113113+ : : RLONG_ADDR(addr), "Ir" (nr) : "memory");116114 }117115}118116···131131132132static __always_inline void __clear_bit(long nr, volatile unsigned long *addr)133133{134134- asm volatile(__ASM_SIZE(btr) " %1,%0" : ADDR : "Ir" (nr));134134+ asm volatile(__ASM_SIZE(btr) " %1,%0" : : ADDR, "Ir" (nr) : "memory");135135}136136137137static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr)···139139 bool negative;140140 asm volatile(LOCK_PREFIX "andb %2,%1"141141 CC_SET(s)142142- : CC_OUT(s) (negative), ADDR142142+ : CC_OUT(s) (negative), WBYTE_ADDR(addr)143143 : "ir" ((char) ~(1 << nr)) : "memory");144144 return negative;145145}···155155 * __clear_bit() is non-atomic and implies release semantics before the memory156156 * operation. It can be used for an unlock if no other CPUs can concurrently157157 * modify other bits in the word.158158- *159159- * No memory barrier is required here, because x86 cannot reorder stores past160160- * older loads. Same principle as spin_unlock.161158 */162159static __always_inline void __clear_bit_unlock(long nr, volatile unsigned long *addr)163160{164164- barrier();165161 __clear_bit(nr, addr);166162}167163···172176 */173177static __always_inline void __change_bit(long nr, volatile unsigned long *addr)174178{175175- asm volatile(__ASM_SIZE(btc) " %1,%0" : ADDR : "Ir" (nr));179179+ asm volatile(__ASM_SIZE(btc) " %1,%0" : : ADDR, "Ir" (nr) : "memory");176180}177181178182/**···192196 : "iq" ((u8)CONST_MASK(nr)));193197 } else {194198 asm volatile(LOCK_PREFIX __ASM_SIZE(btc) " %1,%0"195195- : BITOP_ADDR(addr)196196- : "Ir" (nr));199199+ : : RLONG_ADDR(addr), "Ir" (nr) : "memory");197200 }198201}199202···237242238243 asm(__ASM_SIZE(bts) " %2,%1"239244 CC_SET(c)240240- : CC_OUT(c) (oldbit), ADDR241241- : "Ir" (nr));245245+ : CC_OUT(c) (oldbit)246246+ : ADDR, "Ir" (nr) : "memory");242247 return oldbit;243248}244249···277282278283 asm volatile(__ASM_SIZE(btr) " %2,%1"279284 CC_SET(c)280280- : CC_OUT(c) (oldbit), ADDR281281- : "Ir" (nr));285285+ : CC_OUT(c) (oldbit)286286+ : ADDR, "Ir" (nr) : "memory");282287 return oldbit;283288}284289···289294290295 asm volatile(__ASM_SIZE(btc) " %2,%1"291296 CC_SET(c)292292- : CC_OUT(c) (oldbit), ADDR293293- : "Ir" (nr) : "memory");297297+ : CC_OUT(c) (oldbit)298298+ : ADDR, "Ir" (nr) : "memory");294299295300 return oldbit;296301}···321326 asm volatile(__ASM_SIZE(bt) " %2,%1"322327 CC_SET(c)323328 : CC_OUT(c) (oldbit)324324- : "m" (*(unsigned long *)addr), "Ir" (nr));329329+ : "m" (*(unsigned long *)addr), "Ir" (nr) : "memory");325330326331 return oldbit;327332}
···20072007 * aggregate version in order to make the slab shrinker20082008 * faster20092009 */20102010-static inline void kvm_mod_used_mmu_pages(struct kvm *kvm, int nr)20102010+static inline void kvm_mod_used_mmu_pages(struct kvm *kvm, unsigned long nr)20112011{20122012 kvm->arch.n_used_mmu_pages += nr;20132013 percpu_counter_add(&kvm_total_used_mmu_pages, nr);···22382238 struct list_head *invalid_list,22392239 bool remote_flush)22402240{22412241- if (!remote_flush && !list_empty(invalid_list))22412241+ if (!remote_flush && list_empty(invalid_list))22422242 return false;2243224322442244 if (!list_empty(invalid_list))···27632763 * Changing the number of mmu pages allocated to the vm27642764 * Note: if goal_nr_mmu_pages is too small, you will get dead lock27652765 */27662766-void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int goal_nr_mmu_pages)27662766+void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned long goal_nr_mmu_pages)27672767{27682768 LIST_HEAD(invalid_list);27692769···60316031/*60326032 * Calculate mmu pages needed for kvm.60336033 */60346034-unsigned int kvm_mmu_calculate_default_mmu_pages(struct kvm *kvm)60346034+unsigned long kvm_mmu_calculate_default_mmu_pages(struct kvm *kvm)60356035{60366036- unsigned int nr_mmu_pages;60376037- unsigned int nr_pages = 0;60366036+ unsigned long nr_mmu_pages;60376037+ unsigned long nr_pages = 0;60386038 struct kvm_memslots *slots;60396039 struct kvm_memory_slot *memslot;60406040 int i;···60476047 }6048604860496049 nr_mmu_pages = nr_pages * KVM_PERMILLE_MMU_PAGES / 1000;60506050- nr_mmu_pages = max(nr_mmu_pages,60516051- (unsigned int) KVM_MIN_ALLOC_MMU_PAGES);60506050+ nr_mmu_pages = max(nr_mmu_pages, KVM_MIN_ALLOC_MMU_PAGES);6052605160536052 return nr_mmu_pages;60546053}
+1-1
arch/x86/kvm/mmu.h
···6464int kvm_handle_page_fault(struct kvm_vcpu *vcpu, u64 error_code,6565 u64 fault_address, char *insn, int insn_len);66666767-static inline unsigned int kvm_mmu_available_pages(struct kvm *kvm)6767+static inline unsigned long kvm_mmu_available_pages(struct kvm *kvm)6868{6969 if (kvm->arch.n_max_mmu_pages > kvm->arch.n_used_mmu_pages)7070 return kvm->arch.n_max_mmu_pages -
···28732873 /*28742874 * If translation failed, VM entry will fail because28752875 * prepare_vmcs02 set VIRTUAL_APIC_PAGE_ADDR to -1ull.28762876- * Failing the vm entry is _not_ what the processor28772877- * does but it's basically the only possibility we28782878- * have. We could still enter the guest if CR8 load28792879- * exits are enabled, CR8 store exits are enabled, and28802880- * virtualize APIC access is disabled; in this case28812881- * the processor would never use the TPR shadow and we28822882- * could simply clear the bit from the execution28832883- * control. But such a configuration is useless, so28842884- * let's keep the code simple.28852876 */28862877 if (!is_error_page(page)) {28872878 vmx->nested.virtual_apic_page = page;28882879 hpa = page_to_phys(vmx->nested.virtual_apic_page);28892880 vmcs_write64(VIRTUAL_APIC_PAGE_ADDR, hpa);28812881+ } else if (nested_cpu_has(vmcs12, CPU_BASED_CR8_LOAD_EXITING) &&28822882+ nested_cpu_has(vmcs12, CPU_BASED_CR8_STORE_EXITING) &&28832883+ !nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) {28842884+ /*28852885+ * The processor will never use the TPR shadow, simply28862886+ * clear the bit from the execution control. Such a28872887+ * configuration is useless, but it happens in tests.28882888+ * For any other configuration, failing the vm entry is28892889+ * _not_ what the processor does but it's basically the28902890+ * only possibility we have.28912891+ */28922892+ vmcs_clear_bits(CPU_BASED_VM_EXEC_CONTROL,28932893+ CPU_BASED_TPR_SHADOW);28942894+ } else {28952895+ printk("bad virtual-APIC page address\n");28962896+ dump_vmcs();28902897 }28912898 }28922899···37963789 vmx_set_cr4(vcpu, vmcs_readl(CR4_READ_SHADOW));3797379037983791 nested_ept_uninit_mmu_context(vcpu);37993799- vcpu->arch.cr3 = vmcs_readl(GUEST_CR3);38003800- __set_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail);37923792+37933793+ /*37943794+ * This is only valid if EPT is in use, otherwise the vmcs01 GUEST_CR337953795+ * points to shadow pages! Fortunately we only get here after a WARN_ON37963796+ * if EPT is disabled, so a VMabort is perfectly fine.37973797+ */37983798+ if (enable_ept) {37993799+ vcpu->arch.cr3 = vmcs_readl(GUEST_CR3);38003800+ __set_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail);38013801+ } else {38023802+ nested_vmx_abort(vcpu, VMX_ABORT_VMCS_CORRUPTED);38033803+ }3801380438023805 /*38033806 * Use ept_save_pdptrs(vcpu) to load the MMU's cached PDPTRs···57545737__init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *))57555738{57565739 int i;57405740+57415741+ /*57425742+ * Without EPT it is not possible to restore L1's CR3 and PDPTR on57435743+ * VMfail, because they are not available in vmcs01. Just always57445744+ * use hardware checks.57455745+ */57465746+ if (!enable_ept)57475747+ nested_early_check = 1;5757574857585749 if (!cpu_has_vmx_shadow_vmcs())57595750 enable_shadow_vmcs = 0;
···28222822 bfq_remove_request(q, rq);28232823}2824282428252825-static void __bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq)28252825+static bool __bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq)28262826{28272827 /*28282828 * If this bfqq is shared between multiple processes, check···28552855 /*28562856 * All in-service entities must have been properly deactivated28572857 * or requeued before executing the next function, which28582858- * resets all in-service entites as no more in service.28582858+ * resets all in-service entities as no more in service. This28592859+ * may cause bfqq to be freed. If this happens, the next28602860+ * function returns true.28592861 */28602860- __bfq_bfqd_reset_in_service(bfqd);28622862+ return __bfq_bfqd_reset_in_service(bfqd);28612863}2862286428632865/**···32643262 bool slow;32653263 unsigned long delta = 0;32663264 struct bfq_entity *entity = &bfqq->entity;32673267- int ref;3268326532693266 /*32703267 * Check whether the process is slow (see bfq_bfqq_is_slow).···33483347 * reason.33493348 */33503349 __bfq_bfqq_recalc_budget(bfqd, bfqq, reason);33513351- ref = bfqq->ref;33523352- __bfq_bfqq_expire(bfqd, bfqq);33533353-33543354- if (ref == 1) /* bfqq is gone, no more actions on it */33503350+ if (__bfq_bfqq_expire(bfqd, bfqq))33513351+ /* bfqq is gone, no more actions on it */33553352 return;3356335333573354 bfqq->injected_service = 0;
···16051605 return bfqq;16061606}1607160716081608-void __bfq_bfqd_reset_in_service(struct bfq_data *bfqd)16081608+/* returns true if the in-service queue gets freed */16091609+bool __bfq_bfqd_reset_in_service(struct bfq_data *bfqd)16091610{16101611 struct bfq_queue *in_serv_bfqq = bfqd->in_service_queue;16111612 struct bfq_entity *in_serv_entity = &in_serv_bfqq->entity;···16301629 * service tree either, then release the service reference to16311630 * the queue it represents (taken with bfq_get_entity).16321631 */16331633- if (!in_serv_entity->on_st)16321632+ if (!in_serv_entity->on_st) {16331633+ /*16341634+ * If no process is referencing in_serv_bfqq any16351635+ * longer, then the service reference may be the only16361636+ * reference to the queue. If this is the case, then16371637+ * bfqq gets freed here.16381638+ */16391639+ int ref = in_serv_bfqq->ref;16341640 bfq_put_queue(in_serv_bfqq);16411641+ if (ref == 1)16421642+ return true;16431643+ }16441644+16451645+ return false;16351646}1636164716371648void bfq_deactivate_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq,
···8282 div = _get_table_val(meson_parm_read(clk->map, &pll_div->val),8383 meson_parm_read(clk->map, &pll_div->sel));8484 if (!div || !div->divider) {8585- pr_info("%s: Invalid config value for vid_pll_div\n", __func__);8686- return parent_rate;8585+ pr_debug("%s: Invalid config value for vid_pll_div\n", __func__);8686+ return 0;8787 }88888989 return DIV_ROUND_UP_ULL(parent_rate * div->multiplier, div->divider);
+11-3
drivers/clk/x86/clk-pmc-atom.c
···165165};166166167167static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,168168- void __iomem *base,168168+ const struct pmc_clk_data *pmc_data,169169 const char **parent_names,170170 int num_parents)171171{···184184 init.num_parents = num_parents;185185186186 pclk->hw.init = &init;187187- pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;187187+ pclk->reg = pmc_data->base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;188188 spin_lock_init(&pclk->lock);189189+190190+ /*191191+ * On some systems, the pmc_plt_clocks already enabled by the192192+ * firmware are being marked as critical to avoid them being193193+ * gated by the clock framework.194194+ */195195+ if (pmc_data->critical && plt_clk_is_enabled(&pclk->hw))196196+ init.flags |= CLK_IS_CRITICAL;189197190198 ret = devm_clk_hw_register(&pdev->dev, &pclk->hw);191199 if (ret) {···340332 return PTR_ERR(parent_names);341333342334 for (i = 0; i < PMC_CLK_NUM; i++) {343343- data->clks[i] = plt_clk_register(pdev, i, pmc_data->base,335335+ data->clks[i] = plt_clk_register(pdev, i, pmc_data,344336 parent_names, data->nparents);345337 if (IS_ERR(data->clks[i])) {346338 err = PTR_ERR(data->clks[i]);
+9-4
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
···31733173 break;3174317431753175 if (fence) {31763176- r = dma_fence_wait_timeout(fence, false, tmo);31763176+ tmo = dma_fence_wait_timeout(fence, false, tmo);31773177 dma_fence_put(fence);31783178 fence = next;31793179- if (r <= 0)31793179+ if (tmo == 0) {31803180+ r = -ETIMEDOUT;31803181 break;31823182+ } else if (tmo < 0) {31833183+ r = tmo;31843184+ break;31853185+ }31813186 } else {31823187 fence = next;31833188 }···31933188 tmo = dma_fence_wait_timeout(fence, false, tmo);31943189 dma_fence_put(fence);3195319031963196- if (r <= 0 || tmo <= 0) {31973197- DRM_ERROR("recover vram bo from shadow failed\n");31913191+ if (r < 0 || tmo <= 0) {31923192+ DRM_ERROR("recover vram bo from shadow failed, r is %ld, tmo is %ld\n", r, tmo);31983193 return -EIO;31993194 }32003195
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
···3535#include "amdgpu_trace.h"36363737#define AMDGPU_IB_TEST_TIMEOUT msecs_to_jiffies(1000)3838+#define AMDGPU_IB_TEST_GFX_XGMI_TIMEOUT msecs_to_jiffies(2000)38393940/*4041 * IB···345344 * cost waiting for it coming back under RUNTIME only346345 */347346 tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT;347347+ } else if (adev->gmc.xgmi.hive_id) {348348+ tmo_gfx = AMDGPU_IB_TEST_GFX_XGMI_TIMEOUT;348349 }349350350351 for (i = 0; i < adev->num_rings; ++i) {
···10371037}10381038EXPORT_SYMBOL_GPL(dw_hdmi_phy_i2c_write);1039103910401040+/* Filter out invalid setups to avoid configuring SCDC and scrambling */10411041+static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi)10421042+{10431043+ struct drm_display_info *display = &hdmi->connector.display_info;10441044+10451045+ /* Completely disable SCDC support for older controllers */10461046+ if (hdmi->version < 0x200a)10471047+ return false;10481048+10491049+ /* Disable if SCDC is not supported, or if an HF-VSDB block is absent */10501050+ if (!display->hdmi.scdc.supported ||10511051+ !display->hdmi.scdc.scrambling.supported)10521052+ return false;10531053+10541054+ /*10551055+ * Disable if display only support low TMDS rates and scrambling10561056+ * for low rates is not supported either10571057+ */10581058+ if (!display->hdmi.scdc.scrambling.low_rates &&10591059+ display->max_tmds_clock <= 340000)10601060+ return false;10611061+10621062+ return true;10631063+}10641064+10401065/*10411066 * HDMI2.0 Specifies the following procedure for High TMDS Bit Rates:10421067 * - The Source shall suspend transmission of the TMDS clock and data···10801055 unsigned long mtmdsclock = hdmi->hdmi_data.video_mode.mtmdsclock;1081105610821057 /* Control for TMDS Bit Period/TMDS Clock-Period Ratio */10831083- if (hdmi->connector.display_info.hdmi.scdc.supported) {10581058+ if (dw_hdmi_support_scdc(hdmi)) {10841059 if (mtmdsclock > HDMI14_MAX_TMDSCLK)10851060 drm_scdc_set_high_tmds_clock_ratio(hdmi->ddc, 1);10861061 else···1604157916051580 /* Set up HDMI_FC_INVIDCONF */16061581 inv_val = (hdmi->hdmi_data.hdcp_enable ||16071607- vmode->mtmdsclock > HDMI14_MAX_TMDSCLK ||16081608- hdmi_info->scdc.scrambling.low_rates ?15821582+ (dw_hdmi_support_scdc(hdmi) &&15831583+ (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK ||15841584+ hdmi_info->scdc.scrambling.low_rates)) ?16091585 HDMI_FC_INVIDCONF_HDCP_KEEPOUT_ACTIVE :16101586 HDMI_FC_INVIDCONF_HDCP_KEEPOUT_INACTIVE);16111587···16721646 }1673164716741648 /* Scrambling Control */16751675- if (hdmi_info->scdc.supported) {16491649+ if (dw_hdmi_support_scdc(hdmi)) {16761650 if (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK ||16771651 hdmi_info->scdc.scrambling.low_rates) {16781652 /*
+2-3
drivers/gpu/drm/drm_atomic_helper.c
···10341034 funcs->atomic_disable(crtc, old_crtc_state);10351035 else if (funcs->disable)10361036 funcs->disable(crtc);10371037- else10371037+ else if (funcs->dpms)10381038 funcs->dpms(crtc, DRM_MODE_DPMS_OFF);1039103910401040 if (!(dev->irq_enabled && dev->num_crtcs))···12771277 if (new_crtc_state->enable) {12781278 DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n",12791279 crtc->base.id, crtc->name);12801280-12811280 if (funcs->atomic_enable)12821281 funcs->atomic_enable(crtc, old_crtc_state);12831283- else12821282+ else if (funcs->commit)12841283 funcs->commit(crtc);12851284 }12861285 }
···20752075 intel_aux_power_domain(dig_port);20762076}2077207720782078-static u64 intel_ddi_get_power_domains(struct intel_encoder *encoder,20792079- struct intel_crtc_state *crtc_state)20782078+static void intel_ddi_get_power_domains(struct intel_encoder *encoder,20792079+ struct intel_crtc_state *crtc_state)20802080{20812081 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);20822082 struct intel_digital_port *dig_port;20832083- u64 domains;2084208320852084 /*20862085 * TODO: Add support for MST encoders. Atm, the following should never···20872088 * hook.20882089 */20892090 if (WARN_ON(intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)))20902090- return 0;20912091+ return;2091209220922093 dig_port = enc_to_dig_port(&encoder->base);20932093- domains = BIT_ULL(dig_port->ddi_io_power_domain);20942094+ intel_display_power_get(dev_priv, dig_port->ddi_io_power_domain);2094209520952096 /*20962097 * AUX power is only needed for (e)DP mode, and for HDMI mode on TC···20982099 */20992100 if (intel_crtc_has_dp_encoder(crtc_state) ||21002101 intel_port_is_tc(dev_priv, encoder->port))21012101- domains |= BIT_ULL(intel_ddi_main_link_aux_domain(dig_port));21022102+ intel_display_power_get(dev_priv,21032103+ intel_ddi_main_link_aux_domain(dig_port));2102210421032105 /*21042106 * VDSC power is needed when DSC is enabled21052107 */21062108 if (crtc_state->dsc_params.compression_enable)21072107- domains |= BIT_ULL(intel_dsc_power_domain(crtc_state));21082108-21092109- return domains;21092109+ intel_display_power_get(dev_priv,21102110+ intel_dsc_power_domain(crtc_state));21102111}2111211221122113void intel_ddi_enable_pipe_clock(const struct intel_crtc_state *crtc_state)···28242825 return;28252826 }28262827 /*28272827- * DSI ports should have their DDI clock ungated when disabled28282828- * and gated when enabled.28282828+ * For DSI we keep the ddi clocks gated28292829+ * except during enable/disable sequence.28292830 */28302830- ddi_clk_needed = !encoder->base.crtc;28312831+ ddi_clk_needed = false;28312832 }2832283328332834 val = I915_READ(DPCLKA_CFGCR0_ICL);
···18591859 return -EINVAL;18601860}1861186118621862-/* Optimize link config in order: max bpp, min lanes, min clock */18631863-static int18641864-intel_dp_compute_link_config_fast(struct intel_dp *intel_dp,18651865- struct intel_crtc_state *pipe_config,18661866- const struct link_config_limits *limits)18671867-{18681868- struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;18691869- int bpp, clock, lane_count;18701870- int mode_rate, link_clock, link_avail;18711871-18721872- for (bpp = limits->max_bpp; bpp >= limits->min_bpp; bpp -= 2 * 3) {18731873- mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,18741874- bpp);18751875-18761876- for (lane_count = limits->min_lane_count;18771877- lane_count <= limits->max_lane_count;18781878- lane_count <<= 1) {18791879- for (clock = limits->min_clock; clock <= limits->max_clock; clock++) {18801880- link_clock = intel_dp->common_rates[clock];18811881- link_avail = intel_dp_max_data_rate(link_clock,18821882- lane_count);18831883-18841884- if (mode_rate <= link_avail) {18851885- pipe_config->lane_count = lane_count;18861886- pipe_config->pipe_bpp = bpp;18871887- pipe_config->port_clock = link_clock;18881888-18891889- return 0;18901890- }18911891- }18921892- }18931893- }18941894-18951895- return -EINVAL;18961896-}18971897-18981862static int intel_dp_dsc_compute_bpp(struct intel_dp *intel_dp, u8 dsc_max_bpc)18991863{19001864 int i, num_bpc;···19952031 limits.min_bpp = 6 * 3;19962032 limits.max_bpp = intel_dp_compute_bpp(intel_dp, pipe_config);1997203319981998- if (intel_dp_is_edp(intel_dp) && intel_dp->edp_dpcd[0] < DP_EDP_14) {20342034+ if (intel_dp_is_edp(intel_dp)) {19992035 /*20002036 * Use the maximum clock and number of lanes the eDP panel20012001- * advertizes being capable of. The eDP 1.3 and earlier panels20022002- * are generally designed to support only a single clock and20032003- * lane configuration, and typically these values correspond to20042004- * the native resolution of the panel. With eDP 1.4 rate select20052005- * and DSC, this is decreasingly the case, and we need to be20062006- * able to select less than maximum link config.20372037+ * advertizes being capable of. The panels are generally20382038+ * designed to support only a single clock and lane20392039+ * configuration, and typically these values correspond to the20402040+ * native resolution of the panel.20072041 */20082042 limits.min_lane_count = limits.max_lane_count;20092043 limits.min_clock = limits.max_clock;···20152053 intel_dp->common_rates[limits.max_clock],20162054 limits.max_bpp, adjusted_mode->crtc_clock);2017205520182018- if (intel_dp_is_edp(intel_dp))20192019- /*20202020- * Optimize for fast and narrow. eDP 1.3 section 3.3 and eDP 1.420212021- * section A.1: "It is recommended that the minimum number of20222022- * lanes be used, using the minimum link rate allowed for that20232023- * lane configuration."20242024- *20252025- * Note that we use the max clock and lane count for eDP 1.3 and20262026- * earlier, and fast vs. wide is irrelevant.20272027- */20282028- ret = intel_dp_compute_link_config_fast(intel_dp, pipe_config,20292029- &limits);20302030- else20312031- /* Optimize for slow and wide. */20322032- ret = intel_dp_compute_link_config_wide(intel_dp, pipe_config,20332033- &limits);20562056+ /*20572057+ * Optimize for slow and wide. This is the place to add alternative20582058+ * optimization policy.20592059+ */20602060+ ret = intel_dp_compute_link_config_wide(intel_dp, pipe_config, &limits);2034206120352062 /* enable compression if the mode doesn't fit available BW */20362063 DRM_DEBUG_KMS("Force DSC en = %d\n", intel_dp->force_dsc_en);
+6-4
drivers/gpu/drm/i915/intel_drv.h
···270270 * be set correctly before calling this function. */271271 void (*get_config)(struct intel_encoder *,272272 struct intel_crtc_state *pipe_config);273273- /* Returns a mask of power domains that need to be referenced as part274274- * of the hardware state readout code. */275275- u64 (*get_power_domains)(struct intel_encoder *encoder,276276- struct intel_crtc_state *crtc_state);273273+ /*274274+ * Acquires the power domains needed for an active encoder during275275+ * hardware state readout.276276+ */277277+ void (*get_power_domains)(struct intel_encoder *encoder,278278+ struct intel_crtc_state *crtc_state);277279 /*278280 * Called during system suspend after all pending requests for the279281 * encoder are flushed (for example for DP AUX transactions) and
+24
drivers/gpu/drm/i915/vlv_dsi.c
···256256 mutex_unlock(&dev_priv->sb_lock);257257}258258259259+static int bdw_get_pipemisc_bpp(struct intel_crtc *crtc)260260+{261261+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);262262+ u32 tmp;263263+264264+ tmp = I915_READ(PIPEMISC(crtc->pipe));265265+266266+ switch (tmp & PIPEMISC_DITHER_BPC_MASK) {267267+ case PIPEMISC_DITHER_6_BPC:268268+ return 18;269269+ case PIPEMISC_DITHER_8_BPC:270270+ return 24;271271+ case PIPEMISC_DITHER_10_BPC:272272+ return 30;273273+ case PIPEMISC_DITHER_12_BPC:274274+ return 36;275275+ default:276276+ MISSING_CASE(tmp);277277+ return 0;278278+ }279279+}280280+259281static int intel_dsi_compute_config(struct intel_encoder *encoder,260282 struct intel_crtc_state *pipe_config,261283 struct drm_connector_state *conn_state)···10921070 fmt = I915_READ(MIPI_DSI_FUNC_PRG(port)) & VID_MODE_FORMAT_MASK;10931071 bpp = mipi_dsi_pixel_format_to_bpp(10941072 pixel_format_from_register_bits(fmt));10731073+10741074+ pipe_config->pipe_bpp = bdw_get_pipemisc_bpp(crtc);1095107510961076 /* Enable Frame time stamo based scanline reporting */10971077 adjusted_mode->private_flags |=
+3-5
drivers/gpu/drm/mediatek/mtk_dpi.c
···662662static unsigned int mt2701_calculate_factor(int clock)663663{664664 if (clock <= 64000)665665- return 16;666666- else if (clock <= 128000)667667- return 8;668668- else if (clock <= 256000)669665 return 4;670670- else666666+ else if (clock <= 128000)671667 return 2;668668+ else669669+ return 1;672670}673671674672static const struct mtk_dpi_conf mt8173_conf = {
···14801480 if (IS_ERR(regmap))14811481 ret = PTR_ERR(regmap);14821482 if (ret) {14831483- ret = PTR_ERR(regmap);14841483 dev_err(dev,14851484 "Failed to get system configuration registers: %d\n",14861485 ret);···15151516 of_node_put(remote);1516151715171518 hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);15191519+ of_node_put(i2c_np);15181520 if (!hdmi->ddc_adpt) {15191521 dev_err(dev, "Failed to get ddc i2c adapter by node\n");15201522 return -EINVAL;
···175175 REG_FLD_MOD(core->base, HDMI_CORE_SYS_INTR_UNMASK4, 0, 3, 3);176176 hdmi_wp_clear_irqenable(core->wp, HDMI_IRQ_CORE);177177 hdmi_wp_set_irqstatus(core->wp, HDMI_IRQ_CORE);178178+ REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0);178179 hdmi4_core_disable(core);179180 return 0;180181 }···183182 if (err)184183 return err;185184185185+ /*186186+ * Initialize CEC clock divider: CEC needs 2MHz clock hence187187+ * set the divider to 24 to get 48/24=2MHz clock188188+ */189189+ REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0x18, 5, 0);190190+186191 /* Clear TX FIFO */187192 if (!hdmi_cec_clear_tx_fifo(adap)) {188193 pr_err("cec-%s: could not clear TX FIFO\n", adap->name);189189- return -EIO;194194+ err = -EIO;195195+ goto err_disable_clk;190196 }191197192198 /* Clear RX FIFO */193199 if (!hdmi_cec_clear_rx_fifo(adap)) {194200 pr_err("cec-%s: could not clear RX FIFO\n", adap->name);195195- return -EIO;201201+ err = -EIO;202202+ goto err_disable_clk;196203 }197204198205 /* Clear CEC interrupts */···245236 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_1, temp);246237 }247238 return 0;239239+240240+err_disable_clk:241241+ REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0);242242+ hdmi4_core_disable(core);243243+244244+ return err;248245}249246250247static int hdmi_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)···348333 return ret;349334 core->wp = wp;350335351351- /*352352- * Initialize CEC clock divider: CEC needs 2MHz clock hence353353- * set the devider to 24 to get 48/24=2MHz clock354354- */355355- REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0x18, 5, 0);336336+ /* Disable clock initially, hdmi_cec_adap_enable() manages it */337337+ REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0);356338357339 ret = cec_register_adapter(core->adap, &pdev->dev);358340 if (ret < 0) {
+1-1
drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
···708708 else709709 acore.i2s_cfg.justification = HDMI_AUDIO_JUSTIFY_RIGHT;710710 /*711711- * The I2S input word length is twice the lenght given in the IEC-60958711711+ * The I2S input word length is twice the length given in the IEC-60958712712 * status word. If the word size is greater than713713 * 20 bits, increment by one.714714 */
+7-2
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
···4848sun8i_dw_hdmi_mode_valid_h6(struct drm_connector *connector,4949 const struct drm_display_mode *mode)5050{5151- /* This is max for HDMI 2.0b (4K@60Hz) */5252- if (mode->clock > 594000)5151+ /*5252+ * Controller support maximum of 594 MHz, which correlates to5353+ * 4K@60Hz 4:4:4 or RGB. However, for frequencies greater than5454+ * 340 MHz scrambling has to be enabled. Because scrambling is5555+ * not yet implemented, just limit to 340 MHz for now.5656+ */5757+ if (mode->clock > 340000)5358 return MODE_CLOCK_HIGH;54595560 return MODE_OK;
+3-2
drivers/gpu/drm/sun4i/sun8i_tcon_top.c
···227227228228err_unregister_gates:229229 for (i = 0; i < CLK_NUM; i++)230230- if (clk_data->hws[i])230230+ if (!IS_ERR_OR_NULL(clk_data->hws[i]))231231 clk_hw_unregister_gate(clk_data->hws[i]);232232 clk_disable_unprepare(tcon_top->bus);233233err_assert_reset:···245245246246 of_clk_del_provider(dev->of_node);247247 for (i = 0; i < CLK_NUM; i++)248248- clk_hw_unregister_gate(clk_data->hws[i]);248248+ if (clk_data->hws[i])249249+ clk_hw_unregister_gate(clk_data->hws[i]);249250250251 clk_disable_unprepare(tcon_top->bus);251252 reset_control_assert(tcon_top->rst);
···1323213232 int total_contexts;1323313233 int ret;1323413234 unsigned ngroups;1323513235- int qos_rmt_count;1323513235+ int rmt_count;1323613236 int user_rmt_reduced;1323713237 u32 n_usr_ctxts;1323813238 u32 send_contexts = chip_send_contexts(dd);···1329413294 n_usr_ctxts = rcv_contexts - total_contexts;1329513295 }13296132961329713297- /* each user context requires an entry in the RMT */1329813298- qos_rmt_count = qos_rmt_entries(dd, NULL, NULL);1329913299- if (qos_rmt_count + n_usr_ctxts > NUM_MAP_ENTRIES) {1330013300- user_rmt_reduced = NUM_MAP_ENTRIES - qos_rmt_count;1329713297+ /*1329813298+ * The RMT entries are currently allocated as shown below:1329913299+ * 1. QOS (0 to 128 entries);1330013300+ * 2. FECN for PSM (num_user_contexts + num_vnic_contexts);1330113301+ * 3. VNIC (num_vnic_contexts).1330213302+ * It should be noted that PSM FECN oversubscribe num_vnic_contexts1330313303+ * entries of RMT because both VNIC and PSM could allocate any receive1330413304+ * context between dd->first_dyn_alloc_text and dd->num_rcv_contexts,1330513305+ * and PSM FECN must reserve an RMT entry for each possible PSM receive1330613306+ * context.1330713307+ */1330813308+ rmt_count = qos_rmt_entries(dd, NULL, NULL) + (num_vnic_contexts * 2);1330913309+ if (rmt_count + n_usr_ctxts > NUM_MAP_ENTRIES) {1331013310+ user_rmt_reduced = NUM_MAP_ENTRIES - rmt_count;1330113311 dd_dev_err(dd,1330213312 "RMT size is reducing the number of user receive contexts from %u to %d\n",1330313313 n_usr_ctxts,···1429514285 u64 reg;1429614286 int i, idx, regoff, regidx;1429714287 u8 offset;1428814288+ u32 total_cnt;14298142891429914290 /* there needs to be enough room in the map table */1430014300- if (rmt->used + dd->num_user_contexts >= NUM_MAP_ENTRIES) {1429114291+ total_cnt = dd->num_rcv_contexts - dd->first_dyn_alloc_ctxt;1429214292+ if (rmt->used + total_cnt >= NUM_MAP_ENTRIES) {1430114293 dd_dev_err(dd, "User FECN handling disabled - too many user contexts allocated\n");1430214294 return;1430314295 }···1435314341 /* add rule 1 */1435414342 add_rsm_rule(dd, RSM_INS_FECN, &rrd);14355143431435614356- rmt->used += dd->num_user_contexts;1434414344+ rmt->used += total_cnt;1435714345}14358143461435914347/* Initialize RSM for VNIC */
···30883088 update_ack_queue(qp, next);30893089 }30903090 e = &qp->s_ack_queue[qp->r_head_ack_queue];30913091- if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {30913091+ if (e->rdma_sge.mr) {30923092 rvt_put_mr(e->rdma_sge.mr);30933093 e->rdma_sge.mr = NULL;30943094 }···31663166 update_ack_queue(qp, next);31673167 }31683168 e = &qp->s_ack_queue[qp->r_head_ack_queue];31693169- if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {31693169+ if (e->rdma_sge.mr) {31703170 rvt_put_mr(e->rdma_sge.mr);31713171 e->rdma_sge.mr = NULL;31723172 }
+8-23
drivers/infiniband/hw/hfi1/tid_rdma.c
···50175017 make_tid_rdma_ack(qp, ohdr, ps))50185018 return 1;5019501950205020- if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_SEND_OK)) {50215021- if (!(ib_rvt_state_ops[qp->state] & RVT_FLUSH_SEND))50225022- goto bail;50235023- /* We are in the error state, flush the work request. */50245024- if (qp->s_last == READ_ONCE(qp->s_head))50255025- goto bail;50265026- /* If DMAs are in progress, we can't flush immediately. */50275027- if (iowait_sdma_pending(&priv->s_iowait)) {50285028- qp->s_flags |= RVT_S_WAIT_DMA;50295029- goto bail;50305030- }50315031- clear_ahg(qp);50325032- wqe = rvt_get_swqe_ptr(qp, qp->s_last);50335033- hfi1_trdma_send_complete(qp, wqe, qp->s_last != qp->s_acked ?50345034- IB_WC_SUCCESS : IB_WC_WR_FLUSH_ERR);50355035- /* will get called again */50365036- goto done_free_tx;50375037- }50205020+ /*50215021+ * Bail out if we can't send data.50225022+ * Be reminded that this check must been done after the call to50235023+ * make_tid_rdma_ack() because the responding QP could be in50245024+ * RTR state where it can send TID RDMA ACK, not TID RDMA WRITE DATA.50255025+ */50265026+ if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_SEND_OK))50275027+ goto bail;5038502850395029 if (priv->s_flags & RVT_S_WAIT_ACK)50405030 goto bail;···51345144 hfi1_make_ruc_header(qp, ohdr, (opcode << 24), bth1, bth2,51355145 middle, ps);51365146 return 1;51375137-done_free_tx:51385138- hfi1_put_txreq(ps->s_txreq);51395139- ps->s_txreq = NULL;51405140- return 1;51415141-51425147bail:51435148 hfi1_put_txreq(ps->s_txreq);51445149bail_no_tx:
···797797 sdhci_reset(host, mask);798798}799799800800+#define CMD_ERR_MASK (SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX |\801801+ SDHCI_INT_TIMEOUT)802802+#define CMD_MASK (CMD_ERR_MASK | SDHCI_INT_RESPONSE)803803+804804+static u32 sdhci_omap_irq(struct sdhci_host *host, u32 intmask)805805+{806806+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);807807+ struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host);808808+809809+ if (omap_host->is_tuning && host->cmd && !host->data_early &&810810+ (intmask & CMD_ERR_MASK)) {811811+812812+ /*813813+ * Since we are not resetting data lines during tuning814814+ * operation, data error or data complete interrupts815815+ * might still arrive. Mark this request as a failure816816+ * but still wait for the data interrupt817817+ */818818+ if (intmask & SDHCI_INT_TIMEOUT)819819+ host->cmd->error = -ETIMEDOUT;820820+ else821821+ host->cmd->error = -EILSEQ;822822+823823+ host->cmd = NULL;824824+825825+ /*826826+ * Sometimes command error interrupts and command complete827827+ * interrupt will arrive together. Clear all command related828828+ * interrupts here.829829+ */830830+ sdhci_writel(host, intmask & CMD_MASK, SDHCI_INT_STATUS);831831+ intmask &= ~CMD_MASK;832832+ }833833+834834+ return intmask;835835+}836836+800837static struct sdhci_ops sdhci_omap_ops = {801838 .set_clock = sdhci_omap_set_clock,802839 .set_power = sdhci_omap_set_power,···844807 .platform_send_init_74_clocks = sdhci_omap_init_74_clocks,845808 .reset = sdhci_omap_reset,846809 .set_uhs_signaling = sdhci_omap_set_uhs_signaling,810810+ .irq = sdhci_omap_irq,847811};848812849813static int sdhci_omap_set_capabilities(struct sdhci_omap_host *omap_host)
+5-1
drivers/net/bonding/bond_main.c
···32133213 return NOTIFY_DONE;3214321432153215 if (event_dev->flags & IFF_MASTER) {32163216+ int ret;32173217+32163218 netdev_dbg(event_dev, "IFF_MASTER\n");32173217- return bond_master_netdev_event(event, event_dev);32193219+ ret = bond_master_netdev_event(event, event_dev);32203220+ if (ret != NOTIFY_DONE)32213221+ return ret;32183222 }3219322332203224 if (event_dev->flags & IFF_SLAVE) {
+1-1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
···957957 bnx2x_sample_bulletin(bp);958958959959 if (bp->shadow_bulletin.content.valid_bitmap & 1 << VLAN_VALID) {960960- BNX2X_ERR("Hypervisor will dicline the request, avoiding\n");960960+ BNX2X_ERR("Hypervisor will decline the request, avoiding\n");961961 rc = -EINVAL;962962 goto out;963963 }
+20-2
drivers/net/ethernet/cavium/thunder/nicvf_main.c
···3232#define DRV_NAME "nicvf"3333#define DRV_VERSION "1.0"34343535+/* NOTE: Packets bigger than 1530 are split across multiple pages and XDP needs3636+ * the buffer to be contiguous. Allow XDP to be set up only if we don't exceed3737+ * this value, keeping headroom for the 14 byte Ethernet header and two3838+ * VLAN tags (for QinQ)3939+ */4040+#define MAX_XDP_MTU (1530 - ETH_HLEN - VLAN_HLEN * 2)4141+3542/* Supported devices */3643static const struct pci_device_id nicvf_id_table[] = {3744 { PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM,···15891582 struct nicvf *nic = netdev_priv(netdev);15901583 int orig_mtu = netdev->mtu;1591158415851585+ /* For now just support only the usual MTU sized frames,15861586+ * plus some headroom for VLAN, QinQ.15871587+ */15881588+ if (nic->xdp_prog && new_mtu > MAX_XDP_MTU) {15891589+ netdev_warn(netdev, "Jumbo frames not yet supported with XDP, current MTU %d.\n",15901590+ netdev->mtu);15911591+ return -EINVAL;15921592+ }15931593+15921594 netdev->mtu = new_mtu;1593159515941596 if (!netif_running(netdev))···18461830 bool bpf_attached = false;18471831 int ret = 0;1848183218491849- /* For now just support only the usual MTU sized frames */18501850- if (prog && (dev->mtu > 1500)) {18331833+ /* For now just support only the usual MTU sized frames,18341834+ * plus some headroom for VLAN, QinQ.18351835+ */18361836+ if (prog && dev->mtu > MAX_XDP_MTU) {18511837 netdev_warn(dev, "Jumbo frames not yet supported with XDP, current MTU %d.\n",18521838 dev->mtu);18531839 return -EOPNOTSUPP;
+21-9
drivers/net/ethernet/freescale/fec_main.c
···18401840 int ret;1841184118421842 if (enable) {18431843- ret = clk_prepare_enable(fep->clk_ahb);18441844- if (ret)18451845- return ret;18461846-18471843 ret = clk_prepare_enable(fep->clk_enet_out);18481844 if (ret)18491849- goto failed_clk_enet_out;18451845+ return ret;1850184618511847 if (fep->clk_ptp) {18521848 mutex_lock(&fep->ptp_clk_mutex);···1862186618631867 phy_reset_after_clk_enable(ndev->phydev);18641868 } else {18651865- clk_disable_unprepare(fep->clk_ahb);18661869 clk_disable_unprepare(fep->clk_enet_out);18671870 if (fep->clk_ptp) {18681871 mutex_lock(&fep->ptp_clk_mutex);···18801885failed_clk_ptp:18811886 if (fep->clk_enet_out)18821887 clk_disable_unprepare(fep->clk_enet_out);18831883-failed_clk_enet_out:18841884- clk_disable_unprepare(fep->clk_ahb);1885188818861889 return ret;18871890}···34633470 ret = clk_prepare_enable(fep->clk_ipg);34643471 if (ret)34653472 goto failed_clk_ipg;34733473+ ret = clk_prepare_enable(fep->clk_ahb);34743474+ if (ret)34753475+ goto failed_clk_ahb;3466347634673477 fep->reg_phy = devm_regulator_get_optional(&pdev->dev, "phy");34683478 if (!IS_ERR(fep->reg_phy)) {···35593563 pm_runtime_put(&pdev->dev);35603564 pm_runtime_disable(&pdev->dev);35613565failed_regulator:35663566+ clk_disable_unprepare(fep->clk_ahb);35673567+failed_clk_ahb:35683568+ clk_disable_unprepare(fep->clk_ipg);35623569failed_clk_ipg:35633570 fec_enet_clk_enable(ndev, false);35643571failed_clk:···36853686 struct net_device *ndev = dev_get_drvdata(dev);36863687 struct fec_enet_private *fep = netdev_priv(ndev);3687368836893689+ clk_disable_unprepare(fep->clk_ahb);36883690 clk_disable_unprepare(fep->clk_ipg);3689369136903692 return 0;···36953695{36963696 struct net_device *ndev = dev_get_drvdata(dev);36973697 struct fec_enet_private *fep = netdev_priv(ndev);36983698+ int ret;3698369936993699- return clk_prepare_enable(fep->clk_ipg);37003700+ ret = clk_prepare_enable(fep->clk_ahb);37013701+ if (ret)37023702+ return ret;37033703+ ret = clk_prepare_enable(fep->clk_ipg);37043704+ if (ret)37053705+ goto failed_clk_ipg;37063706+37073707+ return 0;37083708+37093709+failed_clk_ipg:37103710+ clk_disable_unprepare(fep->clk_ahb);37113711+ return ret;37003712}3701371337023714static const struct dev_pm_ops fec_pm_ops = {
+25-7
drivers/net/ethernet/ibm/ibmvnic.c
···37583758{37593759 struct device *dev = &adapter->vdev->dev;37603760 struct ibmvnic_query_ip_offload_buffer *buf = &adapter->ip_offload_buf;37613761+ netdev_features_t old_hw_features = 0;37613762 union ibmvnic_crq crq;37623763 int i;37633764···38343833 adapter->ip_offload_ctrl.large_rx_ipv4 = 0;38353834 adapter->ip_offload_ctrl.large_rx_ipv6 = 0;3836383538373837- adapter->netdev->features = NETIF_F_SG | NETIF_F_GSO;38363836+ if (adapter->state != VNIC_PROBING) {38373837+ old_hw_features = adapter->netdev->hw_features;38383838+ adapter->netdev->hw_features = 0;38393839+ }38403840+38413841+ adapter->netdev->hw_features = NETIF_F_SG | NETIF_F_GSO | NETIF_F_GRO;3838384238393843 if (buf->tcp_ipv4_chksum || buf->udp_ipv4_chksum)38403840- adapter->netdev->features |= NETIF_F_IP_CSUM;38443844+ adapter->netdev->hw_features |= NETIF_F_IP_CSUM;3841384538423846 if (buf->tcp_ipv6_chksum || buf->udp_ipv6_chksum)38433843- adapter->netdev->features |= NETIF_F_IPV6_CSUM;38473847+ adapter->netdev->hw_features |= NETIF_F_IPV6_CSUM;3844384838453849 if ((adapter->netdev->features &38463850 (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)))38473847- adapter->netdev->features |= NETIF_F_RXCSUM;38513851+ adapter->netdev->hw_features |= NETIF_F_RXCSUM;3848385238493853 if (buf->large_tx_ipv4)38503850- adapter->netdev->features |= NETIF_F_TSO;38543854+ adapter->netdev->hw_features |= NETIF_F_TSO;38513855 if (buf->large_tx_ipv6)38523852- adapter->netdev->features |= NETIF_F_TSO6;38563856+ adapter->netdev->hw_features |= NETIF_F_TSO6;3853385738543854- adapter->netdev->hw_features |= adapter->netdev->features;38583858+ if (adapter->state == VNIC_PROBING) {38593859+ adapter->netdev->features |= adapter->netdev->hw_features;38603860+ } else if (old_hw_features != adapter->netdev->hw_features) {38613861+ netdev_features_t tmp = 0;38623862+38633863+ /* disable features no longer supported */38643864+ adapter->netdev->features &= adapter->netdev->hw_features;38653865+ /* turn on features now supported if previously enabled */38663866+ tmp = (old_hw_features ^ adapter->netdev->hw_features) &38673867+ adapter->netdev->hw_features;38683868+ adapter->netdev->features |=38693869+ tmp & adapter->netdev->wanted_features;38703870+ }3855387138563872 memset(&crq, 0, sizeof(crq));38573873 crq.control_ip_offload.first = IBMVNIC_CRQ_CMD;
···17681768 struct mlx5e_channel *c;17691769 int i;1770177017711771- if (!test_bit(MLX5E_STATE_OPENED, &priv->state))17711771+ if (!test_bit(MLX5E_STATE_OPENED, &priv->state) ||17721772+ priv->channels.params.xdp_prog)17721773 return 0;1773177417741775 for (i = 0; i < channels->num; i++) {
+16-5
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
···952952 if (params->rx_dim_enabled)953953 __set_bit(MLX5E_RQ_STATE_AM, &c->rq.state);954954955955- if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_NO_CSUM_COMPLETE))955955+ /* We disable csum_complete when XDP is enabled since956956+ * XDP programs might manipulate packets which will render957957+ * skb->checksum incorrect.958958+ */959959+ if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_NO_CSUM_COMPLETE) || c->xdp)956960 __set_bit(MLX5E_RQ_STATE_NO_CSUM_COMPLETE, &c->rq.state);957961958962 return 0;···29602956 return 0;29612957}2962295829592959+int mlx5e_safe_reopen_channels(struct mlx5e_priv *priv)29602960+{29612961+ struct mlx5e_channels new_channels = {};29622962+29632963+ new_channels.params = priv->channels.params;29642964+ return mlx5e_safe_switch_channels(priv, &new_channels, NULL);29652965+}29662966+29632967void mlx5e_timestamp_init(struct mlx5e_priv *priv)29642968{29652969 priv->tstamp.tx_type = HWTSTAMP_TX_OFF;···41984186 if (!report_failed)41994187 goto unlock;4200418842014201- mlx5e_close_locked(priv->netdev);42024202- err = mlx5e_open_locked(priv->netdev);41894189+ err = mlx5e_safe_reopen_channels(priv);42034190 if (err)42044191 netdev_err(priv->netdev,42054205- "mlx5e_open_locked failed recovering from a tx_timeout, err(%d).\n",41924192+ "mlx5e_safe_reopen_channels failed recovering from a tx_timeout, err(%d).\n",42064193 err);4207419442084195unlock:···45894578{45904579 enum mlx5e_traffic_types tt;4591458045924592- rss_params->hfunc = ETH_RSS_HASH_XOR;45814581+ rss_params->hfunc = ETH_RSS_HASH_TOP;45934582 netdev_rss_key_fill(rss_params->toeplitz_hash_key,45944583 sizeof(rss_params->toeplitz_hash_key));45954584 mlx5e_build_default_indir_rqt(rss_params->indirection_rqt,
···68046804 /* A RIF is not created for macvlan netdevs. Their MAC is used to68056805 * populate the FDB68066806 */68076807- if (netif_is_macvlan(dev))68076807+ if (netif_is_macvlan(dev) || netif_is_l3_master(dev))68086808 return 0;6809680968106810 for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) {
···431431 u8 num_pf_rls;432432};433433434434+#define QED_OVERFLOW_BIT 1435435+434436struct qed_db_recovery_info {435437 struct list_head list;436438437439 /* Lock to protect the doorbell recovery mechanism list */438440 spinlock_t lock;441441+ bool dorq_attn;439442 u32 db_recovery_counter;443443+ unsigned long overflow;440444};441445442446struct storm_stats {···927923928924/* doorbell recovery mechanism */929925void qed_db_recovery_dp(struct qed_hwfn *p_hwfn);930930-void qed_db_recovery_execute(struct qed_hwfn *p_hwfn,931931- enum qed_db_rec_exec db_exec);926926+void qed_db_recovery_execute(struct qed_hwfn *p_hwfn);932927bool qed_edpm_enabled(struct qed_hwfn *p_hwfn);933928934929/* Other Linux specific common definitions */
+33-50
drivers/net/ethernet/qlogic/qed/qed_dev.c
···102102103103/* Doorbell address sanity (address within doorbell bar range) */104104static bool qed_db_rec_sanity(struct qed_dev *cdev,105105- void __iomem *db_addr, void *db_data)105105+ void __iomem *db_addr,106106+ enum qed_db_rec_width db_width,107107+ void *db_data)106108{109109+ u32 width = (db_width == DB_REC_WIDTH_32B) ? 32 : 64;110110+107111 /* Make sure doorbell address is within the doorbell bar */108112 if (db_addr < cdev->doorbells ||109109- (u8 __iomem *)db_addr >113113+ (u8 __iomem *)db_addr + width >110114 (u8 __iomem *)cdev->doorbells + cdev->db_size) {111115 WARN(true,112116 "Illegal doorbell address: %p. Legal range for doorbell addresses is [%p..%p]\n",···163159 }164160165161 /* Sanitize doorbell address */166166- if (!qed_db_rec_sanity(cdev, db_addr, db_data))162162+ if (!qed_db_rec_sanity(cdev, db_addr, db_width, db_data))167163 return -EINVAL;168164169165 /* Obtain hwfn from doorbell address */···208204 QED_MSG_IOV, "db recovery - skipping VF doorbell\n");209205 return 0;210206 }211211-212212- /* Sanitize doorbell address */213213- if (!qed_db_rec_sanity(cdev, db_addr, db_data))214214- return -EINVAL;215207216208 /* Obtain hwfn from doorbell address */217209 p_hwfn = qed_db_rec_find_hwfn(cdev, db_addr);···300300301301/* Ring the doorbell of a single doorbell recovery entry */302302static void qed_db_recovery_ring(struct qed_hwfn *p_hwfn,303303- struct qed_db_recovery_entry *db_entry,304304- enum qed_db_rec_exec db_exec)303303+ struct qed_db_recovery_entry *db_entry)305304{306306- if (db_exec != DB_REC_ONCE) {307307- /* Print according to width */308308- if (db_entry->db_width == DB_REC_WIDTH_32B) {309309- DP_VERBOSE(p_hwfn, QED_MSG_SPQ,310310- "%s doorbell address %p data %x\n",311311- db_exec == DB_REC_DRY_RUN ?312312- "would have rung" : "ringing",313313- db_entry->db_addr,314314- *(u32 *)db_entry->db_data);315315- } else {316316- DP_VERBOSE(p_hwfn, QED_MSG_SPQ,317317- "%s doorbell address %p data %llx\n",318318- db_exec == DB_REC_DRY_RUN ?319319- "would have rung" : "ringing",320320- db_entry->db_addr,321321- *(u64 *)(db_entry->db_data));322322- }305305+ /* Print according to width */306306+ if (db_entry->db_width == DB_REC_WIDTH_32B) {307307+ DP_VERBOSE(p_hwfn, QED_MSG_SPQ,308308+ "ringing doorbell address %p data %x\n",309309+ db_entry->db_addr,310310+ *(u32 *)db_entry->db_data);311311+ } else {312312+ DP_VERBOSE(p_hwfn, QED_MSG_SPQ,313313+ "ringing doorbell address %p data %llx\n",314314+ db_entry->db_addr,315315+ *(u64 *)(db_entry->db_data));323316 }324317325318 /* Sanity */326319 if (!qed_db_rec_sanity(p_hwfn->cdev, db_entry->db_addr,327327- db_entry->db_data))320320+ db_entry->db_width, db_entry->db_data))328321 return;329322330323 /* Flush the write combined buffer. Since there are multiple doorbelling···327334 wmb();328335329336 /* Ring the doorbell */330330- if (db_exec == DB_REC_REAL_DEAL || db_exec == DB_REC_ONCE) {331331- if (db_entry->db_width == DB_REC_WIDTH_32B)332332- DIRECT_REG_WR(db_entry->db_addr,333333- *(u32 *)(db_entry->db_data));334334- else335335- DIRECT_REG_WR64(db_entry->db_addr,336336- *(u64 *)(db_entry->db_data));337337- }337337+ if (db_entry->db_width == DB_REC_WIDTH_32B)338338+ DIRECT_REG_WR(db_entry->db_addr,339339+ *(u32 *)(db_entry->db_data));340340+ else341341+ DIRECT_REG_WR64(db_entry->db_addr,342342+ *(u64 *)(db_entry->db_data));338343339344 /* Flush the write combined buffer. Next doorbell may come from a340345 * different entity to the same address...···341350}342351343352/* Traverse the doorbell recovery entry list and ring all the doorbells */344344-void qed_db_recovery_execute(struct qed_hwfn *p_hwfn,345345- enum qed_db_rec_exec db_exec)353353+void qed_db_recovery_execute(struct qed_hwfn *p_hwfn)346354{347355 struct qed_db_recovery_entry *db_entry = NULL;348356349349- if (db_exec != DB_REC_ONCE) {350350- DP_NOTICE(p_hwfn,351351- "Executing doorbell recovery. Counter was %d\n",352352- p_hwfn->db_recovery_info.db_recovery_counter);357357+ DP_NOTICE(p_hwfn, "Executing doorbell recovery. Counter was %d\n",358358+ p_hwfn->db_recovery_info.db_recovery_counter);353359354354- /* Track amount of times recovery was executed */355355- p_hwfn->db_recovery_info.db_recovery_counter++;356356- }360360+ /* Track amount of times recovery was executed */361361+ p_hwfn->db_recovery_info.db_recovery_counter++;357362358363 /* Protect the list */359364 spin_lock_bh(&p_hwfn->db_recovery_info.lock);360365 list_for_each_entry(db_entry,361361- &p_hwfn->db_recovery_info.list, list_entry) {362362- qed_db_recovery_ring(p_hwfn, db_entry, db_exec);363363- if (db_exec == DB_REC_ONCE)364364- break;365365- }366366-366366+ &p_hwfn->db_recovery_info.list, list_entry)367367+ qed_db_recovery_ring(p_hwfn, db_entry);367368 spin_unlock_bh(&p_hwfn->db_recovery_info.lock);368369}369370
+64-21
drivers/net/ethernet/qlogic/qed/qed_int.c
···378378 u32 count = QED_DB_REC_COUNT;379379 u32 usage = 1;380380381381+ /* Flush any pending (e)dpms as they may never arrive */382382+ qed_wr(p_hwfn, p_ptt, DORQ_REG_DPM_FORCE_ABORT, 0x1);383383+381384 /* wait for usage to zero or count to run out. This is necessary since382385 * EDPM doorbell transactions can take multiple 64b cycles, and as such383386 * can "split" over the pci. Possibly, the doorbell drop can happen with···409406410407int qed_db_rec_handler(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)411408{412412- u32 overflow;409409+ u32 attn_ovfl, cur_ovfl;413410 int rc;414411415415- overflow = qed_rd(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY);416416- DP_NOTICE(p_hwfn, "PF Overflow sticky 0x%x\n", overflow);417417- if (!overflow) {418418- qed_db_recovery_execute(p_hwfn, DB_REC_ONCE);412412+ attn_ovfl = test_and_clear_bit(QED_OVERFLOW_BIT,413413+ &p_hwfn->db_recovery_info.overflow);414414+ cur_ovfl = qed_rd(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY);415415+ if (!cur_ovfl && !attn_ovfl)419416 return 0;420420- }421417422422- if (qed_edpm_enabled(p_hwfn)) {418418+ DP_NOTICE(p_hwfn, "PF Overflow sticky: attn %u current %u\n",419419+ attn_ovfl, cur_ovfl);420420+421421+ if (cur_ovfl && !p_hwfn->db_bar_no_edpm) {423422 rc = qed_db_rec_flush_queue(p_hwfn, p_ptt);424423 if (rc)425424 return rc;426425 }427426428428- /* Flush any pending (e)dpm as they may never arrive */429429- qed_wr(p_hwfn, p_ptt, DORQ_REG_DPM_FORCE_ABORT, 0x1);430430-431427 /* Release overflow sticky indication (stop silently dropping everything) */432428 qed_wr(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY, 0x0);433429434430 /* Repeat all last doorbells (doorbell drop recovery) */435435- qed_db_recovery_execute(p_hwfn, DB_REC_REAL_DEAL);431431+ qed_db_recovery_execute(p_hwfn);436432437433 return 0;438434}439435440440-static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn)436436+static void qed_dorq_attn_overflow(struct qed_hwfn *p_hwfn)437437+{438438+ struct qed_ptt *p_ptt = p_hwfn->p_dpc_ptt;439439+ u32 overflow;440440+ int rc;441441+442442+ overflow = qed_rd(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY);443443+ if (!overflow)444444+ goto out;445445+446446+ /* Run PF doorbell recovery in next periodic handler */447447+ set_bit(QED_OVERFLOW_BIT, &p_hwfn->db_recovery_info.overflow);448448+449449+ if (!p_hwfn->db_bar_no_edpm) {450450+ rc = qed_db_rec_flush_queue(p_hwfn, p_ptt);451451+ if (rc)452452+ goto out;453453+ }454454+455455+ qed_wr(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY, 0x0);456456+out:457457+ /* Schedule the handler even if overflow was not detected */458458+ qed_periodic_db_rec_start(p_hwfn);459459+}460460+461461+static int qed_dorq_attn_int_sts(struct qed_hwfn *p_hwfn)441462{442463 u32 int_sts, first_drop_reason, details, address, all_drops_reason;443464 struct qed_ptt *p_ptt = p_hwfn->p_dpc_ptt;444444- int rc;445445-446446- int_sts = qed_rd(p_hwfn, p_ptt, DORQ_REG_INT_STS);447447- DP_NOTICE(p_hwfn->cdev, "DORQ attention. int_sts was %x\n", int_sts);448465449466 /* int_sts may be zero since all PFs were interrupted for doorbell450467 * overflow but another one already handled it. Can abort here. If451468 * This PF also requires overflow recovery we will be interrupted again.452469 * The masked almost full indication may also be set. Ignoring.453470 */471471+ int_sts = qed_rd(p_hwfn, p_ptt, DORQ_REG_INT_STS);454472 if (!(int_sts & ~DORQ_REG_INT_STS_DORQ_FIFO_AFULL))455473 return 0;474474+475475+ DP_NOTICE(p_hwfn->cdev, "DORQ attention. int_sts was %x\n", int_sts);456476457477 /* check if db_drop or overflow happened */458478 if (int_sts & (DORQ_REG_INT_STS_DB_DROP |···503477 GET_FIELD(details, QED_DORQ_ATTENTION_SIZE) * 4,504478 first_drop_reason, all_drops_reason);505479506506- rc = qed_db_rec_handler(p_hwfn, p_ptt);507507- qed_periodic_db_rec_start(p_hwfn);508508- if (rc)509509- return rc;510510-511480 /* Clear the doorbell drop details and prepare for next drop */512481 qed_wr(p_hwfn, p_ptt, DORQ_REG_DB_DROP_DETAILS_REL, 0);513482···526505 DP_INFO(p_hwfn, "DORQ fatal attention\n");527506528507 return -EINVAL;508508+}509509+510510+static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn)511511+{512512+ p_hwfn->db_recovery_info.dorq_attn = true;513513+ qed_dorq_attn_overflow(p_hwfn);514514+515515+ return qed_dorq_attn_int_sts(p_hwfn);516516+}517517+518518+static void qed_dorq_attn_handler(struct qed_hwfn *p_hwfn)519519+{520520+ if (p_hwfn->db_recovery_info.dorq_attn)521521+ goto out;522522+523523+ /* Call DORQ callback if the attention was missed */524524+ qed_dorq_attn_cb(p_hwfn);525525+out:526526+ p_hwfn->db_recovery_info.dorq_attn = false;529527}530528531529/* Instead of major changes to the data-structure, we have a some 'special'···11191079 }11201080 }11211081 }10821082+10831083+ /* Handle missed DORQ attention */10841084+ qed_dorq_attn_handler(p_hwfn);1122108511231086 /* Clear IGU indication for the deasserted bits */11241087 DIRECT_REG_WR((u8 __iomem *)p_hwfn->regview +
+2-2
drivers/net/ethernet/qlogic/qed/qed_int.h
···192192193193/**194194 * @brief - Doorbell Recovery handler.195195- * Run DB_REAL_DEAL doorbell recovery in case of PF overflow196196- * (and flush DORQ if needed), otherwise run DB_REC_ONCE.195195+ * Run doorbell recovery in case of PF overflow (and flush DORQ if196196+ * needed).197197 *198198 * @param p_hwfn199199 * @param p_ptt
···16141614 if (!range) {16151615 IWL_ERR(fwrt, "Failed to fill region header: id=%d, type=%d\n",16161616 le32_to_cpu(reg->region_id), type);16171617+ memset(*data, 0, le32_to_cpu((*data)->len));16171618 return;16181619 }16191620···16241623 if (range_size < 0) {16251624 IWL_ERR(fwrt, "Failed to dump region: id=%d, type=%d\n",16261625 le32_to_cpu(reg->region_id), type);16261626+ memset(*data, 0, le32_to_cpu((*data)->len));16271627 return;16281628 }16291629 range = range + range_size;···1809180718101808 trigger = fwrt->dump.active_trigs[id].trig;1811180918121812- size = sizeof(*dump_file);18131813- size += iwl_fw_ini_get_trigger_len(fwrt, trigger);18141814-18101810+ size = iwl_fw_ini_get_trigger_len(fwrt, trigger);18151811 if (!size)18161812 return NULL;18131813+18141814+ size += sizeof(*dump_file);1817181518181816 dump_file = vzalloc(size);18191817 if (!dump_file)···19441942 iwl_dump_error_desc->len = 0;1945194319461944 ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc, false, 0);19471947- if (ret) {19451945+ if (ret)19481946 kfree(iwl_dump_error_desc);19491949- } else {19501950- set_bit(STATUS_FW_WAIT_DUMP, &fwrt->trans->status);19511951-19521952- /* trigger nmi to halt the fw */19531953- iwl_force_nmi(fwrt->trans);19541954- }19471947+ else19481948+ iwl_trans_sync_nmi(fwrt->trans);1955194919561950 return ret;19571951}···2487248924882490void iwl_fwrt_stop_device(struct iwl_fw_runtime *fwrt)24892491{24902490- /* if the wait event timeout elapses instead of wake up then24912491- * the driver did not receive NMI interrupt and can not assume the FW24922492- * is halted24932493- */24942494- int ret = wait_event_timeout(fwrt->trans->fw_halt_waitq,24952495- !test_bit(STATUS_FW_WAIT_DUMP,24962496- &fwrt->trans->status),24972497- msecs_to_jiffies(2000));24982498- if (!ret) {24992499- /* failed to receive NMI interrupt, assuming the FW is stuck */25002500- set_bit(STATUS_FW_ERROR, &fwrt->trans->status);25012501-25022502- clear_bit(STATUS_FW_WAIT_DUMP, &fwrt->trans->status);25032503- }25042504-25052505- /* Assuming the op mode mutex is held at this point */25062492 iwl_fw_dbg_collect_sync(fwrt);2507249325082494 iwl_trans_stop_device(fwrt->trans);
···338338 * are sent339339 * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent340340 * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation341341- * @STATUS_FW_WAIT_DUMP: if set, wait until cleared before collecting dump342341 */343342enum iwl_trans_status {344343 STATUS_SYNC_HCMD_ACTIVE,···350351 STATUS_TRANS_GOING_IDLE,351352 STATUS_TRANS_IDLE,352353 STATUS_TRANS_DEAD,353353- STATUS_FW_WAIT_DUMP,354354};355355356356static inline int···616618 struct iwl_trans_dump_data *(*dump_data)(struct iwl_trans *trans,617619 u32 dump_mask);618620 void (*debugfs_cleanup)(struct iwl_trans *trans);621621+ void (*sync_nmi)(struct iwl_trans *trans);619622};620623621624/**···830831 u32 lmac_error_event_table[2];831832 u32 umac_error_event_table;832833 unsigned int error_event_table_tlv_status;833833- wait_queue_head_t fw_halt_waitq;834834835835 /* pointer to trans specific struct */836836 /*Ensure that this pointer will always be aligned to sizeof pointer */···12371239 /* prevent double restarts due to the same erroneous FW */12381240 if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status))12391241 iwl_op_mode_nic_error(trans->op_mode);12421242+}1240124312411241- if (test_and_clear_bit(STATUS_FW_WAIT_DUMP, &trans->status))12421242- wake_up(&trans->fw_halt_waitq);12431243-12441244+static inline void iwl_trans_sync_nmi(struct iwl_trans *trans)12451245+{12461246+ if (trans->ops->sync_nmi)12471247+ trans->ops->sync_nmi(trans);12441248}1245124912461250/*****************************************************
+22-49
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
···2714271427152715 iwl_mvm_mac_ctxt_remove(mvm, vif);2716271627172717- kfree(mvmvif->ap_wep_key);27182718- mvmvif->ap_wep_key = NULL;27192719-27202717 mutex_unlock(&mvm->mutex);27212718}27222719···31803183 ret = iwl_mvm_update_sta(mvm, vif, sta);31813184 } else if (old_state == IEEE80211_STA_ASSOC &&31823185 new_state == IEEE80211_STA_AUTHORIZED) {31833183- /* if wep is used, need to set the key for the station now */31843184- if (vif->type == NL80211_IFTYPE_AP && mvmvif->ap_wep_key) {31853185- mvm_sta->wep_key =31863186- kmemdup(mvmvif->ap_wep_key,31873187- sizeof(*mvmvif->ap_wep_key) +31883188- mvmvif->ap_wep_key->keylen,31893189- GFP_KERNEL);31903190- if (!mvm_sta->wep_key) {31913191- ret = -ENOMEM;31923192- goto out_unlock;31933193- }31943194-31953195- ret = iwl_mvm_set_sta_key(mvm, vif, sta,31963196- mvm_sta->wep_key,31973197- STA_KEY_IDX_INVALID);31983198- } else {31993199- ret = 0;32003200- }31863186+ ret = 0;3201318732023188 /* we don't support TDLS during DCM */32033189 if (iwl_mvm_phy_ctx_count(mvm) > 1)···32223242 NL80211_TDLS_DISABLE_LINK);32233243 }3224324432253225- /* Remove STA key if this is an AP using WEP */32263226- if (vif->type == NL80211_IFTYPE_AP && mvmvif->ap_wep_key) {32273227- int rm_ret = iwl_mvm_remove_sta_key(mvm, vif, sta,32283228- mvm_sta->wep_key);32293229-32303230- if (!ret)32313231- ret = rm_ret;32323232- kfree(mvm_sta->wep_key);32333233- mvm_sta->wep_key = NULL;32343234- }32353235-32363245 if (unlikely(ret &&32373246 test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,32383247 &mvm->status)))···32583289 struct ieee80211_sta *sta, u32 changed)32593290{32603291 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);32923292+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);32933293+32943294+ if (changed & (IEEE80211_RC_BW_CHANGED |32953295+ IEEE80211_RC_SUPP_RATES_CHANGED |32963296+ IEEE80211_RC_NSS_CHANGED))32973297+ iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band,32983298+ true);3261329932623300 if (vif->type == NL80211_IFTYPE_STATION &&32633301 changed & IEEE80211_RC_NSS_CHANGED)···34153439 break;34163440 case WLAN_CIPHER_SUITE_WEP40:34173441 case WLAN_CIPHER_SUITE_WEP104:34183418- if (vif->type == NL80211_IFTYPE_AP) {34193419- struct iwl_mvm_vif *mvmvif =34203420- iwl_mvm_vif_from_mac80211(vif);34213421-34223422- mvmvif->ap_wep_key = kmemdup(key,34233423- sizeof(*key) + key->keylen,34243424- GFP_KERNEL);34253425- if (!mvmvif->ap_wep_key)34263426- return -ENOMEM;34273427- }34283428-34293429- if (vif->type != NL80211_IFTYPE_STATION)34303430- return 0;34313431- break;34423442+ if (vif->type == NL80211_IFTYPE_STATION)34433443+ break;34443444+ if (iwl_mvm_has_new_tx_api(mvm))34453445+ return -EOPNOTSUPP;34463446+ /* support HW crypto on TX */34473447+ return 0;34323448 default:34333449 /* currently FW supports only one optional cipher scheme */34343450 if (hw->n_cipher_schemes &&···35083540 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset);35093541 if (ret) {35103542 IWL_WARN(mvm, "set key failed\n");35433543+ key->hw_key_idx = STA_KEY_IDX_INVALID;35113544 /*35123545 * can't add key for RX, but we don't need it35133513- * in the device for TX so still return 035463546+ * in the device for TX so still return 0,35473547+ * unless we have new TX API where we cannot35483548+ * put key material into the TX_CMD35143549 */35153515- key->hw_key_idx = STA_KEY_IDX_INVALID;35163516- ret = 0;35503550+ if (iwl_mvm_has_new_tx_api(mvm))35513551+ ret = -EOPNOTSUPP;35523552+ else35533553+ ret = 0;35173554 }3518355535193556 break;
···88 * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved.99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH1010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH1111- * Copyright(c) 2018 Intel Corporation1111+ * Copyright(c) 2018 - 2019 Intel Corporation1212 *1313 * This program is free software; you can redistribute it and/or modify1414 * it under the terms of version 2 of the GNU General Public License as···3131 * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved.3232 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH3333 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH3434- * Copyright(c) 2018 Intel Corporation3434+ * Copyright(c) 2018 - 2019 Intel Corporation3535 * All rights reserved.3636 *3737 * Redistribution and use in source and binary forms, with or without···1399139914001400 iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid);14011401 list_del_init(&mvmtxq->list);14021402+ local_bh_disable();14021403 iwl_mvm_mac_itxq_xmit(mvm->hw, txq);14041404+ local_bh_enable();14031405 }1404140614051407 mutex_unlock(&mvm->mutex);···23352333 iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg,23362334 timeout);2337233523382338- if (mvmvif->ap_wep_key) {23392339- u8 key_offset = iwl_mvm_set_fw_key_idx(mvm);23402340-23412341- __set_bit(key_offset, mvm->fw_key_table);23422342-23432343- if (key_offset == STA_KEY_IDX_INVALID)23442344- return -ENOSPC;23452345-23462346- ret = iwl_mvm_send_sta_key(mvm, mvmvif->mcast_sta.sta_id,23472347- mvmvif->ap_wep_key, true, 0, NULL, 0,23482348- key_offset, 0);23492349- if (ret)23502350- return ret;23512351- }23522352-23532336 return 0;23542337}23552338···24052418 iwl_mvm_flush_sta(mvm, &mvmvif->mcast_sta, true, 0);2406241924072420 iwl_mvm_disable_txq(mvm, NULL, mvmvif->cab_queue, 0, 0);24082408-24092409- if (mvmvif->ap_wep_key) {24102410- int i;24112411-24122412- if (!__test_and_clear_bit(mvmvif->ap_wep_key->hw_key_idx,24132413- mvm->fw_key_table)) {24142414- IWL_ERR(mvm, "offset %d not used in fw key table.\n",24152415- mvmvif->ap_wep_key->hw_key_idx);24162416- return -ENOENT;24172417- }24182418-24192419- /* track which key was deleted last */24202420- for (i = 0; i < STA_KEY_MAX_NUM; i++) {24212421- if (mvm->fw_key_deleted[i] < U8_MAX)24222422- mvm->fw_key_deleted[i]++;24232423- }24242424- mvm->fw_key_deleted[mvmvif->ap_wep_key->hw_key_idx] = 0;24252425- ret = __iwl_mvm_remove_sta_key(mvm, mvmvif->mcast_sta.sta_id,24262426- mvmvif->ap_wep_key, true);24272427- if (ret)24282428- return ret;24292429- }2430242124312422 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->mcast_sta.sta_id);24322423 if (ret)
+2-5
drivers/net/wireless/intel/iwlwifi/mvm/sta.h
···88 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.99 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH1010 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH1111- * Copyright(c) 2018 Intel Corporation1111+ * Copyright(c) 2018 - 2019 Intel Corporation1212 *1313 * This program is free software; you can redistribute it and/or modify1414 * it under the terms of version 2 of the GNU General Public License as···3131 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.3232 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH3333 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH3434- * Copyright(c) 2018 Intel Corporation3434+ * Copyright(c) 2018 - 2019 Intel Corporation3535 * All rights reserved.3636 *3737 * Redistribution and use in source and binary forms, with or without···394394 * the BA window. To be used for UAPSD only.395395 * @ptk_pn: per-queue PTK PN data structures396396 * @dup_data: per queue duplicate packet detection data397397- * @wep_key: used in AP mode. Is a duplicate of the WEP key.398397 * @deferred_traffic_tid_map: indication bitmap of deferred traffic per-TID399398 * @tx_ant: the index of the antenna to use for data tx to this station. Only400399 * used during connection establishment (e.g. for the 4 way handshake···424425 struct ieee80211_vif *vif;425426 struct iwl_mvm_key_pn __rcu *ptk_pn[4];426427 struct iwl_mvm_rxq_dup_data *dup_data;427427-428428- struct ieee80211_key_conf *wep_key;429428430429 u8 reserved_queue;431430
···26442644 enum nl80211_band band;26452645 const struct ieee80211_ops *ops = &mac80211_hwsim_ops;26462646 struct net *net;26472647- int idx;26472647+ int idx, i;26482648 int n_limits = 0;2649264926502650 if (WARN_ON(param->channels > 1 && !param->use_chanctx))···27682768 goto failed_hw;27692769 }2770277027712771+ data->if_combination.max_interfaces = 0;27722772+ for (i = 0; i < n_limits; i++)27732773+ data->if_combination.max_interfaces +=27742774+ data->if_limits[i].max;27752775+27712776 data->if_combination.n_limits = n_limits;27722772- data->if_combination.max_interfaces = 2048;27732777 data->if_combination.limits = data->if_limits;2774277827752775- hw->wiphy->iface_combinations = &data->if_combination;27762776- hw->wiphy->n_iface_combinations = 1;27792779+ /*27802780+ * If we actually were asked to support combinations,27812781+ * advertise them - if there's only a single thing like27822782+ * only IBSS then don't advertise it as combinations.27832783+ */27842784+ if (data->if_combination.max_interfaces > 1) {27852785+ hw->wiphy->iface_combinations = &data->if_combination;27862786+ hw->wiphy->n_iface_combinations = 1;27872787+ }2777278827782789 if (param->ciphers) {27792790 memcpy(data->ciphers, param->ciphers,
···642642 rt2x00dev->intf_associated--;643643644644 rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);645645-646646- clear_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);647645 }648648-649649- /*650650- * Check for access point which do not support 802.11e . We have to651651- * generate data frames sequence number in S/W for such AP, because652652- * of H/W bug.653653- */654654- if (changes & BSS_CHANGED_QOS && !bss_conf->qos)655655- set_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags);656646657647 /*658648 * When the erp information has changed, we should perform
+9-6
drivers/net/wireless/ralink/rt2x00/rt2x00queue.c
···201201 if (!rt2x00_has_cap_flag(rt2x00dev, REQUIRE_SW_SEQNO)) {202202 /*203203 * rt2800 has a H/W (or F/W) bug, device incorrectly increase204204- * seqno on retransmited data (non-QOS) frames. To workaround205205- * the problem let's generate seqno in software if QOS is206206- * disabled.204204+ * seqno on retransmitted data (non-QOS) and management frames.205205+ * To workaround the problem let's generate seqno in software.206206+ * Except for beacons which are transmitted periodically by H/W207207+ * hence hardware has to assign seqno for them.207208 */208208- if (test_bit(CONFIG_QOS_DISABLED, &rt2x00dev->flags))209209- __clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);210210- else209209+ if (ieee80211_is_beacon(hdr->frame_control)) {210210+ __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);211211 /* H/W will generate sequence number */212212 return;213213+ }214214+215215+ __clear_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);213216 }214217215218 /*
···18451845 memset(queue, 0, sizeof(*queue));18461846 queue->ctrl = ctrl;18471847 queue->qnum = idx;18481848- atomic_set(&queue->csn, 1);18481848+ atomic_set(&queue->csn, 0);18491849 queue->dev = ctrl->dev;1850185018511851 if (idx > 0)···18871887 */1888188818891889 queue->connection_id = 0;18901890- atomic_set(&queue->csn, 1);18901890+ atomic_set(&queue->csn, 0);18911891}1892189218931893static void···21832183{21842184 struct nvme_fc_cmd_iu *cmdiu = &op->cmd_iu;21852185 struct nvme_command *sqe = &cmdiu->sqe;21862186- u32 csn;21872186 int ret, opstate;2188218721892188 /*···2197219821982199 /* format the FC-NVME CMD IU and fcp_req */21992200 cmdiu->connection_id = cpu_to_be64(queue->connection_id);22002200- csn = atomic_inc_return(&queue->csn);22012201- cmdiu->csn = cpu_to_be32(csn);22022201 cmdiu->data_len = cpu_to_be32(data_len);22032202 switch (io_dir) {22042203 case NVMEFC_FCP_WRITE:···22542257 if (!(op->flags & FCOP_FLAGS_AEN))22552258 blk_mq_start_request(op->rq);2256225922602260+ cmdiu->csn = cpu_to_be32(atomic_inc_return(&queue->csn));22572261 ret = ctrl->lport->ops->fcp_io(&ctrl->lport->localport,22582262 &ctrl->rport->remoteport,22592263 queue->lldd_handle, &op->fcp_req);2260226422612265 if (ret) {22662266+ /*22672267+ * If the lld fails to send the command is there an issue with22682268+ * the csn value? If the command that fails is the Connect,22692269+ * no - as the connection won't be live. If it is a command22702270+ * post-connect, it's possible a gap in csn may be created.22712271+ * Does this matter? As Linux initiators don't send fused22722272+ * commands, no. The gap would exist, but as there's nothing22732273+ * that depends on csn order to be delivered on the target22742274+ * side, it shouldn't hurt. It would be difficult for a22752275+ * target to even detect the csn gap as it has no idea when the22762276+ * cmd with the csn was supposed to arrive.22772277+ */22622278 opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE);22632279 __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate);22642280
···115115 * removed from the slot/adapter.116116 */117117 msleep(1000);118118+119119+ /* Ignore link or presence changes caused by power off */120120+ atomic_and(~(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC),121121+ &ctrl->pending_events);118122 }119123120124 /* turn off Green LED */
···793793794794 /* We need to know how many queues before we allocate. */795795 num_queues = virtscsi_config_get(vdev, num_queues) ? : 1;796796+ num_queues = min_t(unsigned int, nr_cpu_ids, num_queues);796797797798 num_targets = virtscsi_config_get(vdev, max_target) + 1;798799
···255255 for (i = 0; i < vp_dev->msix_used_vectors; ++i)256256 free_irq(pci_irq_vector(vp_dev->pci_dev, i), vp_dev);257257258258- for (i = 0; i < vp_dev->msix_vectors; i++)259259- if (vp_dev->msix_affinity_masks[i])260260- free_cpumask_var(vp_dev->msix_affinity_masks[i]);258258+ if (vp_dev->msix_affinity_masks) {259259+ for (i = 0; i < vp_dev->msix_vectors; i++)260260+ if (vp_dev->msix_affinity_masks[i])261261+ free_cpumask_var(vp_dev->msix_affinity_masks[i]);262262+ }261263262264 if (vp_dev->msix_enabled) {263265 /* Disable the vector used for configuration */
···307307 struct blkdev_dio *dio = bio->bi_private;308308 bool should_dirty = dio->should_dirty;309309310310- if (dio->multi_bio && !atomic_dec_and_test(&dio->ref)) {311311- if (bio->bi_status && !dio->bio.bi_status)312312- dio->bio.bi_status = bio->bi_status;313313- } else {310310+ if (bio->bi_status && !dio->bio.bi_status)311311+ dio->bio.bi_status = bio->bi_status;312312+313313+ if (!dio->multi_bio || atomic_dec_and_test(&dio->ref)) {314314 if (!dio->is_sync) {315315 struct kiocb *iocb = dio->iocb;316316 ssize_t ret;
+10
fs/btrfs/ioctl.c
···501501 if (!capable(CAP_SYS_ADMIN))502502 return -EPERM;503503504504+ /*505505+ * If the fs is mounted with nologreplay, which requires it to be506506+ * mounted in RO mode as well, we can not allow discard on free space507507+ * inside block groups, because log trees refer to extents that are not508508+ * pinned in a block group's free space cache (pinning the extents is509509+ * precisely the first phase of replaying a log tree).510510+ */511511+ if (btrfs_test_opt(fs_info, NOLOGREPLAY))512512+ return -EROFS;513513+504514 rcu_read_lock();505515 list_for_each_entry_rcu(device, &fs_info->fs_devices->devices,506516 dev_list) {
+4-4
fs/btrfs/props.c
···366366367367static int prop_compression_validate(const char *value, size_t len)368368{369369- if (!strncmp("lzo", value, len))369369+ if (!strncmp("lzo", value, 3))370370 return 0;371371- else if (!strncmp("zlib", value, len))371371+ else if (!strncmp("zlib", value, 4))372372 return 0;373373- else if (!strncmp("zstd", value, len))373373+ else if (!strncmp("zstd", value, 4))374374 return 0;375375376376 return -EINVAL;···396396 btrfs_set_fs_incompat(fs_info, COMPRESS_LZO);397397 } else if (!strncmp("zlib", value, 4)) {398398 type = BTRFS_COMPRESS_ZLIB;399399- } else if (!strncmp("zstd", value, len)) {399399+ } else if (!strncmp("zstd", value, 4)) {400400 type = BTRFS_COMPRESS_ZSTD;401401 btrfs_set_fs_incompat(fs_info, COMPRESS_ZSTD);402402 } else {
···20412041 memcpy(sap, &data->addr, sizeof(data->addr));20422042 args->nfs_server.addrlen = sizeof(data->addr);20432043 args->nfs_server.port = ntohs(data->addr.sin_port);20442044- if (!nfs_verify_server_address(sap))20442044+ if (sap->sa_family != AF_INET ||20452045+ !nfs_verify_server_address(sap))20452046 goto out_no_address;2046204720472048 if (!(data->flags & NFS_MOUNT_TCP))
+2-2
fs/pipe.c
···188188 * in the tee() system call, when we duplicate the buffers in one189189 * pipe into another.190190 */191191-void generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)191191+bool generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)192192{193193- get_page(buf->page);193193+ return try_get_page(buf->page);194194}195195EXPORT_SYMBOL(generic_pipe_buf_get);196196
+10-2
fs/splice.c
···15931593 * Get a reference to this pipe buffer,15941594 * so we can copy the contents over.15951595 */15961596- pipe_buf_get(ipipe, ibuf);15961596+ if (!pipe_buf_get(ipipe, ibuf)) {15971597+ if (ret == 0)15981598+ ret = -EFAULT;15991599+ break;16001600+ }15971601 *obuf = *ibuf;1598160215991603 /*···16711667 * Get a reference to this pipe buffer,16721668 * so we can copy the contents over.16731669 */16741674- pipe_buf_get(ipipe, ibuf);16701670+ if (!pipe_buf_get(ipipe, ibuf)) {16711671+ if (ret == 0)16721672+ ret = -EFAULT;16731673+ break;16741674+ }1675167516761676 obuf = opipe->bufs + nbuf;16771677 *obuf = *ibuf;
+4
include/drm/drm_modeset_helper_vtables.h
···418418 * Drivers can use the @old_crtc_state input parameter if the operations419419 * needed to enable the CRTC don't depend solely on the new state but420420 * also on the transition between the old state and the new state.421421+ *422422+ * This function is optional.421423 */422424 void (*atomic_enable)(struct drm_crtc *crtc,423425 struct drm_crtc_state *old_crtc_state);···443441 * parameter @old_crtc_state which could be used to access the old444442 * state. Atomic drivers should consider to use this one instead445443 * of @disable.444444+ *445445+ * This function is optional.446446 */447447 void (*atomic_disable)(struct drm_crtc *crtc,448448 struct drm_crtc_state *old_crtc_state);
+18
include/dt-bindings/clock/sifive-fu540-prci.h
···11+/* SPDX-License-Identifier: GPL-2.0 */22+/*33+ * Copyright (C) 2018-2019 SiFive, Inc.44+ * Wesley Terpstra55+ * Paul Walmsley66+ */77+88+#ifndef __DT_BINDINGS_CLOCK_SIFIVE_FU540_PRCI_H99+#define __DT_BINDINGS_CLOCK_SIFIVE_FU540_PRCI_H1010+1111+/* Clock indexes for use by Device Tree data and the PRCI driver */1212+1313+#define PRCI_CLK_COREPLL 01414+#define PRCI_CLK_DDRPLL 11515+#define PRCI_CLK_GEMGXLPLL 21616+#define PRCI_CLK_TLCLK 31717+1818+#endif
+12-8
include/linux/bio.h
···120120 return bio->bi_vcnt >= bio->bi_max_vecs;121121}122122123123-#define mp_bvec_for_each_segment(bv, bvl, i, iter_all) \124124- for (bv = bvec_init_iter_all(&iter_all); \125125- (iter_all.done < (bvl)->bv_len) && \126126- (mp_bvec_next_segment((bvl), &iter_all), 1); \127127- iter_all.done += bv->bv_len, i += 1)123123+static inline bool bio_next_segment(const struct bio *bio,124124+ struct bvec_iter_all *iter)125125+{126126+ if (iter->idx >= bio->bi_vcnt)127127+ return false;128128+129129+ bvec_advance(&bio->bi_io_vec[iter->idx], iter);130130+ return true;131131+}128132129133/*130134 * drivers should _never_ use the all version - the bio may have been split131135 * before it got to the driver and the driver won't own all of it132136 */133133-#define bio_for_each_segment_all(bvl, bio, i, iter_all) \134134- for (i = 0, iter_all.idx = 0; iter_all.idx < (bio)->bi_vcnt; iter_all.idx++) \135135- mp_bvec_for_each_segment(bvl, &((bio)->bi_io_vec[iter_all.idx]), i, iter_all)137137+#define bio_for_each_segment_all(bvl, bio, i, iter) \138138+ for (i = 0, bvl = bvec_init_iter_all(&iter); \139139+ bio_next_segment((bio), &iter); i++)136140137141static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,138142 unsigned bytes)
···2828#include <linux/irqbypass.h>2929#include <linux/swait.h>3030#include <linux/refcount.h>3131+#include <linux/nospec.h>3132#include <asm/signal.h>32333334#include <linux/kvm.h>···514513515514static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)516515{517517- /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case518518- * the caller has read kvm->online_vcpus before (as is the case519519- * for kvm_for_each_vcpu, for example).520520- */516516+ int num_vcpus = atomic_read(&kvm->online_vcpus);517517+ i = array_index_nospec(i, num_vcpus);518518+519519+ /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu. */521520 smp_rmb();522521 return kvm->vcpus[i];523522}···601600602601static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id)603602{603603+ as_id = array_index_nospec(as_id, KVM_ADDRESS_SPACE_NUM);604604 return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu,605605 lockdep_is_held(&kvm->slots_lock) ||606606 !refcount_read(&kvm->users_count));
+14-1
include/linux/mm.h
···966966}967967#endif /* CONFIG_DEV_PAGEMAP_OPS */968968969969+/* 127: arbitrary random number, small enough to assemble well */970970+#define page_ref_zero_or_close_to_overflow(page) \971971+ ((unsigned int) page_ref_count(page) + 127u <= 127u)972972+969973static inline void get_page(struct page *page)970974{971975 page = compound_head(page);···977973 * Getting a normal page or the head of a compound page978974 * requires to already have an elevated page->_refcount.979975 */980980- VM_BUG_ON_PAGE(page_ref_count(page) <= 0, page);976976+ VM_BUG_ON_PAGE(page_ref_zero_or_close_to_overflow(page), page);981977 page_ref_inc(page);978978+}979979+980980+static inline __must_check bool try_get_page(struct page *page)981981+{982982+ page = compound_head(page);983983+ if (WARN_ON_ONCE(page_ref_count(page) <= 0))984984+ return false;985985+ page_ref_inc(page);986986+ return true;982987}983988984989static inline void put_page(struct page *page)
+3
include/linux/netdevice.h
···14981498 * @IFF_FAILOVER: device is a failover master device14991499 * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device15001500 * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device15011501+ * @IFF_LIVE_RENAME_OK: rename is allowed while device is up and running15011502 */15021503enum netdev_priv_flags {15031504 IFF_802_1Q_VLAN = 1<<0,···15311530 IFF_FAILOVER = 1<<27,15321531 IFF_FAILOVER_SLAVE = 1<<28,15331532 IFF_L3MDEV_RX_HANDLER = 1<<29,15331533+ IFF_LIVE_RENAME_OK = 1<<30,15341534};1535153515361536#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN···15631561#define IFF_FAILOVER IFF_FAILOVER15641562#define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE15651563#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER15641564+#define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK1566156515671566/**15681567 * struct net_device - The DEVICE structure.
···101101 /*102102 * Get a reference to the pipe buffer.103103 */104104- void (*get)(struct pipe_inode_info *, struct pipe_buffer *);104104+ bool (*get)(struct pipe_inode_info *, struct pipe_buffer *);105105};106106107107/**108108 * pipe_buf_get - get a reference to a pipe_buffer109109 * @pipe: the pipe that the buffer belongs to110110 * @buf: the buffer to get a reference to111111+ *112112+ * Return: %true if the reference was successfully obtained.111113 */112112-static inline void pipe_buf_get(struct pipe_inode_info *pipe,114114+static inline __must_check bool pipe_buf_get(struct pipe_inode_info *pipe,113115 struct pipe_buffer *buf)114116{115115- buf->ops->get(pipe, buf);117117+ return buf->ops->get(pipe, buf);116118}117119118120/**···173171void free_pipe_info(struct pipe_inode_info *);174172175173/* Generic pipe buffer ops functions */176176-void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);174174+bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);177175int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);178176int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);179177void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
+3
include/linux/platform_data/x86/clk-pmc-atom.h
···3535 *3636 * @base: PMC clock register base offset3737 * @clks: pointer to set of registered clocks, typically 0..53838+ * @critical: flag to indicate if firmware enabled pmc_plt_clks3939+ * should be marked as critial or not3840 */3941struct pmc_clk_data {4042 void __iomem *base;4143 const struct pmc_clk *clks;4444+ bool critical;4245};43464447#endif /* __PLATFORM_DATA_X86_CLK_PMC_ATOM_H */
···6363/*6464 * Creates a virtqueue and allocates the descriptor ring. If6565 * may_reduce_num is set, then this may allocate a smaller ring than6666- * expected. The caller should query virtqueue_get_ring_size to learn6666+ * expected. The caller should query virtqueue_get_vring_size to learn6767 * the actual size of the ring.6868 */6969struct virtqueue *vring_create_virtqueue(unsigned int index,
···71837183#define wiphy_info(wiphy, format, args...) \71847184 dev_info(&(wiphy)->dev, format, ##args)7185718571867186+#define wiphy_err_ratelimited(wiphy, format, args...) \71877187+ dev_err_ratelimited(&(wiphy)->dev, format, ##args)71887188+#define wiphy_warn_ratelimited(wiphy, format, args...) \71897189+ dev_warn_ratelimited(&(wiphy)->dev, format, ##args)71907190+71867191#define wiphy_debug(wiphy, format, args...) \71877192 wiphy_printk(KERN_DEBUG, wiphy, format, ##args)71887193
+38-33
include/net/mac80211.h
···62316231 * @hw: pointer as obtained from ieee80211_alloc_hw()62326232 * @ac: AC number to return packets from.62336233 *62346234- * Should only be called between calls to ieee80211_txq_schedule_start()62356235- * and ieee80211_txq_schedule_end().62366234 * Returns the next txq if successful, %NULL if no queue is eligible. If a txq62376235 * is returned, it should be returned with ieee80211_return_txq() after the62386236 * driver has finished scheduling it.···62386240struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac);6239624162406242/**62416241- * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()62426242- *62436243- * @hw: pointer as obtained from ieee80211_alloc_hw()62446244- * @txq: pointer obtained from station or virtual interface62456245- *62466246- * Should only be called between calls to ieee80211_txq_schedule_start()62476247- * and ieee80211_txq_schedule_end().62486248- */62496249-void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq);62506250-62516251-/**62526252- * ieee80211_txq_schedule_start - acquire locks for safe scheduling of an AC62436243+ * ieee80211_txq_schedule_start - start new scheduling round for TXQs62536244 *62546245 * @hw: pointer as obtained from ieee80211_alloc_hw()62556246 * @ac: AC number to acquire locks for62566247 *62576257- * Acquire locks needed to schedule TXQs from the given AC. Should be called62586258- * before ieee80211_next_txq() or ieee80211_return_txq().62486248+ * Should be called before ieee80211_next_txq() or ieee80211_return_txq().62496249+ * The driver must not call multiple TXQ scheduling rounds concurrently.62596250 */62606260-void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)62616261- __acquires(txq_lock);62516251+void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac);6262625262636263-/**62646264- * ieee80211_txq_schedule_end - release locks for safe scheduling of an AC62656265- *62666266- * @hw: pointer as obtained from ieee80211_alloc_hw()62676267- * @ac: AC number to acquire locks for62686268- *62696269- * Release locks previously acquired by ieee80211_txq_schedule_end().62706270- */62716271-void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)62726272- __releases(txq_lock);62536253+/* (deprecated) */62546254+static inline void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)62556255+{62566256+}62576257+62586258+void __ieee80211_schedule_txq(struct ieee80211_hw *hw,62596259+ struct ieee80211_txq *txq, bool force);6273626062746261/**62756262 * ieee80211_schedule_txq - schedule a TXQ for transmission···62626279 * @hw: pointer as obtained from ieee80211_alloc_hw()62636280 * @txq: pointer obtained from station or virtual interface62646281 *62656265- * Schedules a TXQ for transmission if it is not already scheduled. Takes a62666266- * lock, which means it must *not* be called between62676267- * ieee80211_txq_schedule_start() and ieee80211_txq_schedule_end()62826282+ * Schedules a TXQ for transmission if it is not already scheduled,62836283+ * even if mac80211 does not have any packets buffered.62846284+ *62856285+ * The driver may call this function if it has buffered packets for62866286+ * this TXQ internally.62686287 */62696269-void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)62706270- __acquires(txq_lock) __releases(txq_lock);62886288+static inline void62896289+ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)62906290+{62916291+ __ieee80211_schedule_txq(hw, txq, true);62926292+}62936293+62946294+/**62956295+ * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()62966296+ *62976297+ * @hw: pointer as obtained from ieee80211_alloc_hw()62986298+ * @txq: pointer obtained from station or virtual interface62996299+ * @force: schedule txq even if mac80211 does not have any buffered packets.63006300+ *63016301+ * The driver may set force=true if it has buffered packets for this TXQ63026302+ * internally.63036303+ */63046304+static inline void63056305+ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq,63066306+ bool force)63076307+{63086308+ __ieee80211_schedule_txq(hw, txq, force);63096309+}6271631062726311/**62736312 * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit
···20912091 * @p: poll_table20922092 *20932093 * See the comments in the wq_has_sleeper function.20942094- *20952095- * Do not derive sock from filp->private_data here. An SMC socket establishes20962096- * an internal TCP socket that is used in the fallback case. All socket20972097- * operations on the SMC socket are then forwarded to the TCP socket. In case of20982098- * poll, the filp->private_data pointer references the SMC socket because the20992099- * TCP socket has no file assigned.21002094 */21012095static inline void sock_poll_wait(struct file *filp, struct socket *sock,21022096 poll_table *p)
···802802 int probe_order;803803 int remove_order;804804805805- /* signal if the module handling the component cannot be removed */806806- unsigned int ignore_module_refcount:1;805805+ /*806806+ * signal if the module handling the component should not be removed807807+ * if a pcm is open. Setting this would prevent the module808808+ * refcount being incremented in probe() but allow it be incremented809809+ * when a pcm is opened and decremented when it is closed.810810+ */811811+ unsigned int module_get_upon_open:1;807812808813 /* bits */809814 unsigned int idle_bias_on:1;···1087108210881083 struct mutex mutex;10891084 struct mutex dapm_mutex;10851085+10861086+ spinlock_t dpcm_lock;1090108710911088 bool instantiated;10921089 bool topology_shortname_created;
···20092009 event->pmu->del(event, 0);20102010 event->oncpu = -1;2011201120122012- if (event->pending_disable) {20132013- event->pending_disable = 0;20122012+ if (READ_ONCE(event->pending_disable) >= 0) {20132013+ WRITE_ONCE(event->pending_disable, -1);20142014 state = PERF_EVENT_STATE_OFF;20152015 }20162016 perf_event_set_state(event, state);···2198219821992199void perf_event_disable_inatomic(struct perf_event *event)22002200{22012201- event->pending_disable = 1;22012201+ WRITE_ONCE(event->pending_disable, smp_processor_id());22022202+ /* can fail, see perf_pending_event_disable() */22022203 irq_work_queue(&event->pending);22032204}22042205···58115810 }58125811}5813581258135813+static void perf_pending_event_disable(struct perf_event *event)58145814+{58155815+ int cpu = READ_ONCE(event->pending_disable);58165816+58175817+ if (cpu < 0)58185818+ return;58195819+58205820+ if (cpu == smp_processor_id()) {58215821+ WRITE_ONCE(event->pending_disable, -1);58225822+ perf_event_disable_local(event);58235823+ return;58245824+ }58255825+58265826+ /*58275827+ * CPU-A CPU-B58285828+ *58295829+ * perf_event_disable_inatomic()58305830+ * @pending_disable = CPU-A;58315831+ * irq_work_queue();58325832+ *58335833+ * sched-out58345834+ * @pending_disable = -1;58355835+ *58365836+ * sched-in58375837+ * perf_event_disable_inatomic()58385838+ * @pending_disable = CPU-B;58395839+ * irq_work_queue(); // FAILS58405840+ *58415841+ * irq_work_run()58425842+ * perf_pending_event()58435843+ *58445844+ * But the event runs on CPU-B and wants disabling there.58455845+ */58465846+ irq_work_queue_on(&event->pending, cpu);58475847+}58485848+58145849static void perf_pending_event(struct irq_work *entry)58155850{58165816- struct perf_event *event = container_of(entry,58175817- struct perf_event, pending);58515851+ struct perf_event *event = container_of(entry, struct perf_event, pending);58185852 int rctx;5819585358205854 rctx = perf_swevent_get_recursion_context();···58585822 * and we won't recurse 'further'.58595823 */5860582458615861- if (event->pending_disable) {58625862- event->pending_disable = 0;58635863- perf_event_disable_local(event);58645864- }58255825+ perf_pending_event_disable(event);5865582658665827 if (event->pending_wakeup) {58675828 event->pending_wakeup = 0;···102691023610270102371027110238 init_waitqueue_head(&event->waitq);1023910239+ event->pending_disable = -1;1027210240 init_irq_work(&event->pending, perf_pending_event);10273102411027410242 mutex_init(&event->mmap_mutex);
+2-2
kernel/events/ring_buffer.c
···392392 * store that will be enabled on successful return393393 */394394 if (!handle->size) { /* A, matches D */395395- event->pending_disable = 1;395395+ event->pending_disable = smp_processor_id();396396 perf_output_wakeup(handle);397397 local_set(&rb->aux_nest, 0);398398 goto err_put;···480480481481 if (wakeup) {482482 if (handle->aux_flags & PERF_AUX_FLAG_TRUNCATED)483483- handle->event->pending_disable = 1;483483+ handle->event->pending_disable = smp_processor_id();484484 perf_output_wakeup(handle);485485 }486486
+4
kernel/irq/chip.c
···14491449int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on)14501450{14511451 data = data->parent_data;14521452+14531453+ if (data->chip->flags & IRQCHIP_SKIP_SET_WAKE)14541454+ return 0;14551455+14521456 if (data->chip->irq_set_wake)14531457 return data->chip->irq_set_wake(data, on);14541458
···196196/* note: already called with rcu_read_lock */197197static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)198198{199199- struct net_bridge_port *p = br_port_get_rcu(skb->dev);200200-201199 __br_handle_local_finish(skb);202200203203- BR_INPUT_SKB_CB(skb)->brdev = p->br->dev;204204- br_pass_frame_up(skb);205205- return 0;201201+ /* return 1 to signal the okfn() was called so it's ok to use the skb */202202+ return 1;206203}207204208205static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb)···330333 goto forward;331334 }332335333333- /* Deliver packet to local host only */334334- NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, dev_net(skb->dev),335335- NULL, skb, skb->dev, NULL, br_handle_local_finish);336336- return RX_HANDLER_CONSUMED;336336+ /* The else clause should be hit when nf_hook():337337+ * - returns < 0 (drop/error)338338+ * - returns = 0 (stolen/nf_queue)339339+ * Thus return 1 from the okfn() to signal the skb is ok to pass340340+ */341341+ if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN,342342+ dev_net(skb->dev), NULL, skb, skb->dev, NULL,343343+ br_handle_local_finish) == 1) {344344+ return RX_HANDLER_PASS;345345+ } else {346346+ return RX_HANDLER_CONSUMED;347347+ }337348 }338349339350forward:
···11841184 BUG_ON(!dev_net(dev));1185118511861186 net = dev_net(dev);11871187- if (dev->flags & IFF_UP)11871187+11881188+ /* Some auto-enslaved devices e.g. failover slaves are11891189+ * special, as userspace might rename the device after11901190+ * the interface had been brought up and running since11911191+ * the point kernel initiated auto-enslavement. Allow11921192+ * live name change even when these slave devices are11931193+ * up and running.11941194+ *11951195+ * Typically, users of these auto-enslaving devices11961196+ * don't actually care about slave name change, as11971197+ * they are supposed to operate on master interface11981198+ * directly.11991199+ */12001200+ if (dev->flags & IFF_UP &&12011201+ likely(!(dev->priv_flags & IFF_LIVE_RENAME_OK)))11881202 return -EBUSY;1189120311901204 write_seqcount_begin(&devnet_rename_seq);
···44624462 * Only binding to IP is supported.44634463 */44644464 err = -EINVAL;44654465+ if (addr_len < offsetofend(struct sockaddr, sa_family))44664466+ return err;44654467 if (addr->sa_family == AF_INET) {44664468 if (addr_len < sizeof(struct sockaddr_in))44674469 return err;
···2331233123322332 rcu_read_lock();23332333 from = rcu_dereference(rt6->from);23342334+ if (!from) {23352335+ rcu_read_unlock();23362336+ return;23372337+ }23342338 nrt6 = ip6_rt_cache_alloc(from, daddr, saddr);23352339 if (nrt6) {23362340 rt6_do_update_pmtu(nrt6, mtu);
+2
net/ipv6/udp.c
···10451045static int udpv6_pre_connect(struct sock *sk, struct sockaddr *uaddr,10461046 int addr_len)10471047{10481048+ if (addr_len < offsetofend(struct sockaddr, sa_family))10491049+ return -EINVAL;10481050 /* The following checks are replicated from __ip6_datagram_connect()10491051 * and intended to prevent BPF program called below from accessing10501052 * bytes that are out of the bound specified by user in addr_len.
···167167 * The driver doesn't know anything about VLAN interfaces.168168 * Hence, don't send GTKs for VLAN interfaces to the driver.169169 */170170- if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE))170170+ if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) {171171+ ret = 1;171172 goto out_unsupported;173173+ }172174 }173175174176 ret = drv_set_key(key->local, SET_KEY, sdata,···215213 /* all of these we can do in software - if driver can */216214 if (ret == 1)217215 return 0;218218- if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL)) {219219- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)220220- return 0;216216+ if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL))221217 return -EINVAL;222222- }223218 return 0;224219 default:225220 return -EINVAL;
+1-1
net/mac80211/mesh_pathtbl.c
···2323static u32 mesh_table_hash(const void *addr, u32 len, u32 seed)2424{2525 /* Use last four bytes of hw addr as hash index */2626- return jhash_1word(*(u32 *)(addr+2), seed);2626+ return jhash_1word(__get_unaligned_cpu32((u8 *)addr + 2), seed);2727}28282929static const struct rhashtable_params mesh_rht_params = {
+9-1
net/mac80211/rx.c
···15681568 return;1569156915701570 for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {15711571- if (txq_has_queue(sta->sta.txq[tid]))15711571+ struct ieee80211_txq *txq = sta->sta.txq[tid];15721572+ struct txq_info *txqi = to_txq_info(txq);15731573+15741574+ spin_lock(&local->active_txq_lock[txq->ac]);15751575+ if (!list_empty(&txqi->schedule_order))15761576+ list_del_init(&txqi->schedule_order);15771577+ spin_unlock(&local->active_txq_lock[txq->ac]);15781578+15791579+ if (txq_has_queue(txq))15721580 set_bit(tid, &sta->txq_buffered_tids);15731581 else15741582 clear_bit(tid, &sta->txq_buffered_tids);
···32213221 u8 max_subframes = sta->sta.max_amsdu_subframes;32223222 int max_frags = local->hw.max_tx_fragments;32233223 int max_amsdu_len = sta->sta.max_amsdu_len;32243224+ int orig_truesize;32243225 __be16 len;32253226 void *data;32263227 bool ret = false;···32623261 if (!head || skb_is_gso(head))32633262 goto out;3264326332643264+ orig_truesize = head->truesize;32653265 orig_len = head->len;3266326632673267 if (skb->len + head->len > max_amsdu_len)···33203318 *frag_tail = skb;3321331933223320out_recalc:33213321+ fq->memory_usage += head->truesize - orig_truesize;33233322 if (head->len != orig_len) {33243323 flow->backlog += head->len - orig_len;33253324 tin->backlog_bytes += head->len - orig_len;···36493646struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)36503647{36513648 struct ieee80211_local *local = hw_to_local(hw);36493649+ struct ieee80211_txq *ret = NULL;36523650 struct txq_info *txqi = NULL;3653365136543654- lockdep_assert_held(&local->active_txq_lock[ac]);36523652+ spin_lock_bh(&local->active_txq_lock[ac]);3655365336563654 begin:36573655 txqi = list_first_entry_or_null(&local->active_txqs[ac],36583656 struct txq_info,36593657 schedule_order);36603658 if (!txqi)36613661- return NULL;36593659+ goto out;3662366036633661 if (txqi->txq.sta) {36643662 struct sta_info *sta = container_of(txqi->txq.sta,···367636723677367336783674 if (txqi->schedule_round == local->schedule_round[ac])36793679- return NULL;36753675+ goto out;3680367636813677 list_del_init(&txqi->schedule_order);36823678 txqi->schedule_round = local->schedule_round[ac];36833683- return &txqi->txq;36793679+ ret = &txqi->txq;36803680+36813681+out:36823682+ spin_unlock_bh(&local->active_txq_lock[ac]);36833683+ return ret;36843684}36853685EXPORT_SYMBOL(ieee80211_next_txq);3686368636873687-void ieee80211_return_txq(struct ieee80211_hw *hw,36883688- struct ieee80211_txq *txq)36873687+void __ieee80211_schedule_txq(struct ieee80211_hw *hw,36883688+ struct ieee80211_txq *txq,36893689+ bool force)36893690{36903691 struct ieee80211_local *local = hw_to_local(hw);36913692 struct txq_info *txqi = to_txq_info(txq);3692369336933693- lockdep_assert_held(&local->active_txq_lock[txq->ac]);36943694+ spin_lock_bh(&local->active_txq_lock[txq->ac]);3694369536953696 if (list_empty(&txqi->schedule_order) &&36963696- (!skb_queue_empty(&txqi->frags) || txqi->tin.backlog_packets)) {36973697+ (force || !skb_queue_empty(&txqi->frags) ||36983698+ txqi->tin.backlog_packets)) {36973699 /* If airtime accounting is active, always enqueue STAs at the36983700 * head of the list to ensure that they only get moved to the36993701 * back by the airtime DRR scheduler once they have a negative···37163706 list_add_tail(&txqi->schedule_order,37173707 &local->active_txqs[txq->ac]);37183708 }37193719-}37203720-EXPORT_SYMBOL(ieee80211_return_txq);3721370937223722-void ieee80211_schedule_txq(struct ieee80211_hw *hw,37233723- struct ieee80211_txq *txq)37243724- __acquires(txq_lock) __releases(txq_lock)37253725-{37263726- struct ieee80211_local *local = hw_to_local(hw);37273727-37283728- spin_lock_bh(&local->active_txq_lock[txq->ac]);37293729- ieee80211_return_txq(hw, txq);37303710 spin_unlock_bh(&local->active_txq_lock[txq->ac]);37313711}37323732-EXPORT_SYMBOL(ieee80211_schedule_txq);37123712+EXPORT_SYMBOL(__ieee80211_schedule_txq);3733371337343714bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,37353715 struct ieee80211_txq *txq)···37293729 struct sta_info *sta;37303730 u8 ac = txq->ac;3731373137323732- lockdep_assert_held(&local->active_txq_lock[ac]);37323732+ spin_lock_bh(&local->active_txq_lock[ac]);3733373337343734 if (!txqi->txq.sta)37353735 goto out;···3759375937603760 sta->airtime[ac].deficit += sta->airtime_weight;37613761 list_move_tail(&txqi->schedule_order, &local->active_txqs[ac]);37623762+ spin_unlock_bh(&local->active_txq_lock[ac]);3762376337633764 return false;37643765out:37653766 if (!list_empty(&txqi->schedule_order))37663767 list_del_init(&txqi->schedule_order);37683768+ spin_unlock_bh(&local->active_txq_lock[ac]);3767376937683770 return true;37693771}37703772EXPORT_SYMBOL(ieee80211_txq_may_transmit);3771377337723774void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)37733773- __acquires(txq_lock)37743775{37753776 struct ieee80211_local *local = hw_to_local(hw);3776377737773778 spin_lock_bh(&local->active_txq_lock[ac]);37783779 local->schedule_round[ac]++;37793779-}37803780-EXPORT_SYMBOL(ieee80211_txq_schedule_start);37813781-37823782-void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)37833783- __releases(txq_lock)37843784-{37853785- struct ieee80211_local *local = hw_to_local(hw);37863786-37873780 spin_unlock_bh(&local->active_txq_lock[ac]);37883781}37893789-EXPORT_SYMBOL(ieee80211_txq_schedule_end);37823782+EXPORT_SYMBOL(ieee80211_txq_schedule_start);3790378337913784void __ieee80211_subif_start_xmit(struct sk_buff *skb,37923785 struct net_device *dev,
+2-1
net/netlink/af_netlink.c
···988988 struct netlink_sock *nlk = nlk_sk(sk);989989 struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr;990990 int err = 0;991991- unsigned long groups = nladdr->nl_groups;991991+ unsigned long groups;992992 bool bound;993993994994 if (addr_len < sizeof(struct sockaddr_nl))···996996997997 if (nladdr->nl_family != AF_NETLINK)998998 return -EINVAL;999999+ groups = nladdr->nl_groups;999100010001001 /* Only superuser is allowed to listen multicasts */10011002 if (groups) {
+54-22
net/netrom/af_netrom.c
···13921392 int i;13931393 int rc = proto_register(&nr_proto, 0);1394139413951395- if (rc != 0)13961396- goto out;13951395+ if (rc)13961396+ return rc;1397139713981398 if (nr_ndevs > 0x7fffffff/sizeof(struct net_device *)) {13991399- printk(KERN_ERR "NET/ROM: nr_proto_init - nr_ndevs parameter to large\n");14001400- return -1;13991399+ pr_err("NET/ROM: %s - nr_ndevs parameter too large\n",14001400+ __func__);14011401+ rc = -EINVAL;14021402+ goto unregister_proto;14011403 }1402140414031405 dev_nr = kcalloc(nr_ndevs, sizeof(struct net_device *), GFP_KERNEL);14041404- if (dev_nr == NULL) {14051405- printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n");14061406- return -1;14061406+ if (!dev_nr) {14071407+ pr_err("NET/ROM: %s - unable to allocate device array\n",14081408+ __func__);14091409+ rc = -ENOMEM;14101410+ goto unregister_proto;14071411 }1408141214091413 for (i = 0; i < nr_ndevs; i++) {···14171413 sprintf(name, "nr%d", i);14181414 dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, nr_setup);14191415 if (!dev) {14201420- printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n");14161416+ rc = -ENOMEM;14211417 goto fail;14221418 }1423141914241420 dev->base_addr = i;14251425- if (register_netdev(dev)) {14261426- printk(KERN_ERR "NET/ROM: nr_proto_init - unable to register network device\n");14211421+ rc = register_netdev(dev);14221422+ if (rc) {14271423 free_netdev(dev);14281424 goto fail;14291425 }···14311427 dev_nr[i] = dev;14321428 }1433142914341434- if (sock_register(&nr_family_ops)) {14351435- printk(KERN_ERR "NET/ROM: nr_proto_init - unable to register socket family\n");14301430+ rc = sock_register(&nr_family_ops);14311431+ if (rc)14361432 goto fail;14371437- }1438143314391439- register_netdevice_notifier(&nr_dev_notifier);14341434+ rc = register_netdevice_notifier(&nr_dev_notifier);14351435+ if (rc)14361436+ goto out_sock;1440143714411438 ax25_register_pid(&nr_pid);14421439 ax25_linkfail_register(&nr_linkfail_notifier);1443144014441441#ifdef CONFIG_SYSCTL14451445- nr_register_sysctl();14421442+ rc = nr_register_sysctl();14431443+ if (rc)14441444+ goto out_sysctl;14461445#endif1447144614481447 nr_loopback_init();1449144814501450- proc_create_seq("nr", 0444, init_net.proc_net, &nr_info_seqops);14511451- proc_create_seq("nr_neigh", 0444, init_net.proc_net, &nr_neigh_seqops);14521452- proc_create_seq("nr_nodes", 0444, init_net.proc_net, &nr_node_seqops);14531453-out:14541454- return rc;14491449+ rc = -ENOMEM;14501450+ if (!proc_create_seq("nr", 0444, init_net.proc_net, &nr_info_seqops))14511451+ goto proc_remove1;14521452+ if (!proc_create_seq("nr_neigh", 0444, init_net.proc_net,14531453+ &nr_neigh_seqops))14541454+ goto proc_remove2;14551455+ if (!proc_create_seq("nr_nodes", 0444, init_net.proc_net,14561456+ &nr_node_seqops))14571457+ goto proc_remove3;14581458+14591459+ return 0;14601460+14611461+proc_remove3:14621462+ remove_proc_entry("nr_neigh", init_net.proc_net);14631463+proc_remove2:14641464+ remove_proc_entry("nr", init_net.proc_net);14651465+proc_remove1:14661466+14671467+ nr_loopback_clear();14681468+ nr_rt_free();14691469+14701470+#ifdef CONFIG_SYSCTL14711471+ nr_unregister_sysctl();14721472+out_sysctl:14731473+#endif14741474+ ax25_linkfail_release(&nr_linkfail_notifier);14751475+ ax25_protocol_release(AX25_P_NETROM);14761476+ unregister_netdevice_notifier(&nr_dev_notifier);14771477+out_sock:14781478+ sock_unregister(PF_NETROM);14551479fail:14561480 while (--i >= 0) {14571481 unregister_netdev(dev_nr[i]);14581482 free_netdev(dev_nr[i]);14591483 }14601484 kfree(dev_nr);14851485+unregister_proto:14611486 proto_unregister(&nr_proto);14621462- rc = -1;14631463- goto out;14871487+ return rc;14641488}1465148914661490module_init(nr_proto_init);
···543543 struct rds_sock *rs = rds_sk_to_rs(sk);544544 int ret = 0;545545546546+ if (addr_len < offsetofend(struct sockaddr, sa_family))547547+ return -EINVAL;548548+546549 lock_sock(sk);547550548551 switch (uaddr->sa_family) {
+2
net/rds/bind.c
···173173 /* We allow an RDS socket to be bound to either IPv4 or IPv6174174 * address.175175 */176176+ if (addr_len < offsetofend(struct sockaddr, sa_family))177177+ return -EINVAL;176178 if (uaddr->sa_family == AF_INET) {177179 struct sockaddr_in *sin = (struct sockaddr_in *)uaddr;178180
+11-6
net/rxrpc/af_rxrpc.c
···135135 struct sockaddr_rxrpc *srx = (struct sockaddr_rxrpc *)saddr;136136 struct rxrpc_local *local;137137 struct rxrpc_sock *rx = rxrpc_sk(sock->sk);138138- u16 service_id = srx->srx_service;138138+ u16 service_id;139139 int ret;140140141141 _enter("%p,%p,%d", rx, saddr, len);···143143 ret = rxrpc_validate_address(rx, srx, len);144144 if (ret < 0)145145 goto error;146146+ service_id = srx->srx_service;146147147148 lock_sock(&rx->sk);148149···371370 * rxrpc_kernel_check_life - Check to see whether a call is still alive372371 * @sock: The socket the call is on373372 * @call: The call to check373373+ * @_life: Where to store the life value374374 *375375 * Allow a kernel service to find out whether a call is still alive - ie. we're376376- * getting ACKs from the server. Returns a number representing the life state377377- * which can be compared to that returned by a previous call.376376+ * getting ACKs from the server. Passes back in *_life a number representing377377+ * the life state which can be compared to that returned by a previous call and378378+ * return true if the call is still alive.378379 *379380 * If the life state stalls, rxrpc_kernel_probe_life() should be called and380381 * then 2RTT waited.381382 */382382-u32 rxrpc_kernel_check_life(const struct socket *sock,383383- const struct rxrpc_call *call)383383+bool rxrpc_kernel_check_life(const struct socket *sock,384384+ const struct rxrpc_call *call,385385+ u32 *_life)384386{385385- return call->acks_latest;387387+ *_life = call->acks_latest;388388+ return call->state != RXRPC_CALL_COMPLETE;386389}387390EXPORT_SYMBOL(rxrpc_kernel_check_life);388391
+1
net/rxrpc/ar-internal.h
···654654 u8 ackr_reason; /* reason to ACK */655655 u16 ackr_skew; /* skew on packet being ACK'd */656656 rxrpc_serial_t ackr_serial; /* serial of packet being ACK'd */657657+ rxrpc_serial_t ackr_first_seq; /* first sequence number received */657658 rxrpc_seq_t ackr_prev_seq; /* previous sequence number received */658659 rxrpc_seq_t ackr_consumed; /* Highest packet shown consumed */659660 rxrpc_seq_t ackr_seen; /* Highest packet shown seen */
···837837 u8 acks[RXRPC_MAXACKS];838838 } buf;839839 rxrpc_serial_t acked_serial;840840- rxrpc_seq_t first_soft_ack, hard_ack;840840+ rxrpc_seq_t first_soft_ack, hard_ack, prev_pkt;841841 int nr_acks, offset, ioffset;842842843843 _enter("");···851851852852 acked_serial = ntohl(buf.ack.serial);853853 first_soft_ack = ntohl(buf.ack.firstPacket);854854+ prev_pkt = ntohl(buf.ack.previousPacket);854855 hard_ack = first_soft_ack - 1;855856 nr_acks = buf.ack.nAcks;856857 summary.ack_reason = (buf.ack.reason < RXRPC_ACK__INVALID ?857858 buf.ack.reason : RXRPC_ACK__INVALID);858859859860 trace_rxrpc_rx_ack(call, sp->hdr.serial, acked_serial,860860- first_soft_ack, ntohl(buf.ack.previousPacket),861861+ first_soft_ack, prev_pkt,861862 summary.ack_reason, nr_acks);862863863864 if (buf.ack.reason == RXRPC_ACK_PING_RESPONSE)···879878 rxrpc_propose_ack_respond_to_ack);880879 }881880882882- /* Discard any out-of-order or duplicate ACKs. */883883- if (before_eq(sp->hdr.serial, call->acks_latest))881881+ /* Discard any out-of-order or duplicate ACKs (outside lock). */882882+ if (before(first_soft_ack, call->ackr_first_seq) ||883883+ before(prev_pkt, call->ackr_prev_seq))884884 return;885885886886 buf.info.rxMTU = 0;···892890893891 spin_lock(&call->input_lock);894892895895- /* Discard any out-of-order or duplicate ACKs. */896896- if (before_eq(sp->hdr.serial, call->acks_latest))893893+ /* Discard any out-of-order or duplicate ACKs (inside lock). */894894+ if (before(first_soft_ack, call->ackr_first_seq) ||895895+ before(prev_pkt, call->ackr_prev_seq))897896 goto out;898897 call->acks_latest_ts = skb->tstamp;899898 call->acks_latest = sp->hdr.serial;899899+900900+ call->ackr_first_seq = first_soft_ack;901901+ call->ackr_prev_seq = prev_pkt;900902901903 /* Parse rwind and mtu sizes if provided. */902904 if (buf.info.rxMTU)
+5
net/rxrpc/peer_event.c
···157157158158 _enter("%p{%d}", sk, local->debug_id);159159160160+ /* Clear the outstanding error value on the socket so that it doesn't161161+ * cause kernel_sendmsg() to return it later.162162+ */163163+ sock_error(sk);164164+160165 skb = sock_dequeue_err_skb(sk);161166 if (!skb) {162167 _leave("UDP socket errqueue empty");
+12-9
net/rxrpc/sendmsg.c
···152152}153153154154/*155155- * Queue a DATA packet for transmission, set the resend timeout and send the156156- * packet immediately155155+ * Queue a DATA packet for transmission, set the resend timeout and send156156+ * the packet immediately. Returns the error from rxrpc_send_data_packet()157157+ * in case the caller wants to do something with it.157158 */158158-static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call,159159- struct sk_buff *skb, bool last,160160- rxrpc_notify_end_tx_t notify_end_tx)159159+static int rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call,160160+ struct sk_buff *skb, bool last,161161+ rxrpc_notify_end_tx_t notify_end_tx)161162{162163 struct rxrpc_skb_priv *sp = rxrpc_skb(skb);163164 unsigned long now;···251250252251out:253252 rxrpc_free_skb(skb, rxrpc_skb_tx_freed);254254- _leave("");253253+ _leave(" = %d", ret);254254+ return ret;255255}256256257257/*···425423 if (ret < 0)426424 goto out;427425428428- rxrpc_queue_packet(rx, call, skb,429429- !msg_data_left(msg) && !more,430430- notify_end_tx);426426+ ret = rxrpc_queue_packet(rx, call, skb,427427+ !msg_data_left(msg) && !more,428428+ notify_end_tx);429429+ /* Should check for failure here */431430 skb = NULL;432431 }433432 } while (msg_data_left(msg) > 0);
+2-1
net/sctp/socket.c
···48504850 }4851485148524852 /* Validate addr_len before calling common connect/connectx routine. */48534853- af = sctp_get_af_specific(addr->sa_family);48534853+ af = addr_len < offsetofend(struct sockaddr, sa_family) ? NULL :48544854+ sctp_get_af_specific(addr->sa_family);48544855 if (!af || addr_len < af->sockaddr_len) {48554856 err = -EINVAL;48564857 } else {
+39-19
net/smc/af_smc.c
···165165166166 if (sk->sk_state == SMC_CLOSED) {167167 if (smc->clcsock) {168168- mutex_lock(&smc->clcsock_release_lock);169169- sock_release(smc->clcsock);170170- smc->clcsock = NULL;171171- mutex_unlock(&smc->clcsock_release_lock);168168+ release_sock(sk);169169+ smc_clcsock_release(smc);170170+ lock_sock(sk);172171 }173172 if (!smc->use_fallback)174173 smc_conn_free(&smc->conn);···443444 link->peer_mtu = clc->qp_mtu;444445}445446447447+static void smc_switch_to_fallback(struct smc_sock *smc)448448+{449449+ smc->use_fallback = true;450450+ if (smc->sk.sk_socket && smc->sk.sk_socket->file) {451451+ smc->clcsock->file = smc->sk.sk_socket->file;452452+ smc->clcsock->file->private_data = smc->clcsock;453453+ }454454+}455455+446456/* fall back during connect */447457static int smc_connect_fallback(struct smc_sock *smc, int reason_code)448458{449449- smc->use_fallback = true;459459+ smc_switch_to_fallback(smc);450460 smc->fallback_rsn = reason_code;451461 smc_copy_sock_settings_to_clc(smc);452462 smc->connect_nonblock = 0;···788780 smc->sk.sk_err = -rc;789781790782out:791791- if (smc->sk.sk_err)792792- smc->sk.sk_state_change(&smc->sk);793793- else794794- smc->sk.sk_write_space(&smc->sk);783783+ if (!sock_flag(&smc->sk, SOCK_DEAD)) {784784+ if (smc->sk.sk_err) {785785+ smc->sk.sk_state_change(&smc->sk);786786+ } else { /* allow polling before and after fallback decision */787787+ smc->clcsock->sk->sk_write_space(smc->clcsock->sk);788788+ smc->sk.sk_write_space(&smc->sk);789789+ }790790+ }795791 release_sock(&smc->sk);796792}797793···879867 if (rc < 0)880868 lsk->sk_err = -rc;881869 if (rc < 0 || lsk->sk_state == SMC_CLOSED) {870870+ new_sk->sk_prot->unhash(new_sk);882871 if (new_clcsock)883872 sock_release(new_clcsock);884873 new_sk->sk_state = SMC_CLOSED;885874 sock_set_flag(new_sk, SOCK_DEAD);886886- new_sk->sk_prot->unhash(new_sk);887875 sock_put(new_sk); /* final */888876 *new_smc = NULL;889877 goto out;···934922935923 smc_accept_unlink(new_sk);936924 if (new_sk->sk_state == SMC_CLOSED) {925925+ new_sk->sk_prot->unhash(new_sk);937926 if (isk->clcsock) {938927 sock_release(isk->clcsock);939928 isk->clcsock = NULL;940929 }941941- new_sk->sk_prot->unhash(new_sk);942930 sock_put(new_sk); /* final */943931 continue;944932 }945945- if (new_sock)933933+ if (new_sock) {946934 sock_graft(new_sk, new_sock);935935+ if (isk->use_fallback) {936936+ smc_sk(new_sk)->clcsock->file = new_sock->file;937937+ isk->clcsock->file->private_data = isk->clcsock;938938+ }939939+ }947940 return new_sk;948941 }949942 return NULL;···968951 sock_set_flag(sk, SOCK_DEAD);969952 sk->sk_shutdown |= SHUTDOWN_MASK;970953 }954954+ sk->sk_prot->unhash(sk);971955 if (smc->clcsock) {972956 struct socket *tcp;973957···984966 smc_conn_free(&smc->conn);985967 }986968 release_sock(sk);987987- sk->sk_prot->unhash(sk);988969 sock_put(sk); /* final sock_put */989970}990971···10491032 struct smc_sock *lsmc = new_smc->listen_smc;10501033 struct sock *newsmcsk = &new_smc->sk;1051103410521052- lock_sock_nested(&lsmc->sk, SINGLE_DEPTH_NESTING);10531035 if (lsmc->sk.sk_state == SMC_LISTEN) {10361036+ lock_sock_nested(&lsmc->sk, SINGLE_DEPTH_NESTING);10541037 smc_accept_enqueue(&lsmc->sk, newsmcsk);10381038+ release_sock(&lsmc->sk);10551039 } else { /* no longer listening */10561040 smc_close_non_accepted(newsmcsk);10571041 }10581058- release_sock(&lsmc->sk);1059104210601043 /* Wake up accept */10611044 lsmc->sk.sk_data_ready(&lsmc->sk);···10991082 return;11001083 }11011084 smc_conn_free(&new_smc->conn);11021102- new_smc->use_fallback = true;10851085+ smc_switch_to_fallback(new_smc);11031086 new_smc->fallback_rsn = reason_code;11041087 if (reason_code && reason_code != SMC_CLC_DECL_PEERDECL) {11051088 if (smc_clc_send_decline(new_smc, reason_code) < 0) {···12371220 u8 buf[SMC_CLC_MAX_LEN];12381221 int rc = 0;1239122212231223+ if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN)12241224+ return smc_listen_out_err(new_smc);12251225+12401226 if (new_smc->use_fallback) {12411227 smc_listen_out_connected(new_smc);12421228 return;···1247122712481228 /* check if peer is smc capable */12491229 if (!tcp_sk(newclcsock->sk)->syn_smc) {12501250- new_smc->use_fallback = true;12301230+ smc_switch_to_fallback(new_smc);12511231 new_smc->fallback_rsn = SMC_CLC_DECL_PEERNOSMC;12521232 smc_listen_out_connected(new_smc);12531233 return;···1527150715281508 if (msg->msg_flags & MSG_FASTOPEN) {15291509 if (sk->sk_state == SMC_INIT) {15301530- smc->use_fallback = true;15101510+ smc_switch_to_fallback(smc);15311511 smc->fallback_rsn = SMC_CLC_DECL_OPTUNSUPP;15321512 } else {15331513 rc = -EINVAL;···17321712 case TCP_FASTOPEN_NO_COOKIE:17331713 /* option not supported by SMC */17341714 if (sk->sk_state == SMC_INIT) {17351735- smc->use_fallback = true;17151715+ smc_switch_to_fallback(smc);17361716 smc->fallback_rsn = SMC_CLC_DECL_OPTUNSUPP;17371717 } else {17381718 if (!smc->use_fallback)
+21-4
net/smc/smc_close.c
···21212222#define SMC_CLOSE_WAIT_LISTEN_CLCSOCK_TIME (5 * HZ)23232424+/* release the clcsock that is assigned to the smc_sock */2525+void smc_clcsock_release(struct smc_sock *smc)2626+{2727+ struct socket *tcp;2828+2929+ if (smc->listen_smc && current_work() != &smc->smc_listen_work)3030+ cancel_work_sync(&smc->smc_listen_work);3131+ mutex_lock(&smc->clcsock_release_lock);3232+ if (smc->clcsock) {3333+ tcp = smc->clcsock;3434+ smc->clcsock = NULL;3535+ sock_release(tcp);3636+ }3737+ mutex_unlock(&smc->clcsock_release_lock);3838+}3939+2440static void smc_close_cleanup_listen(struct sock *parent)2541{2642 struct sock *sk;···337321 close_work);338322 struct smc_sock *smc = container_of(conn, struct smc_sock, conn);339323 struct smc_cdc_conn_state_flags *rxflags;324324+ bool release_clcsock = false;340325 struct sock *sk = &smc->sk;341326 int old_state;342327···417400 if ((sk->sk_state == SMC_CLOSED) &&418401 (sock_flag(sk, SOCK_DEAD) || !sk->sk_socket)) {419402 smc_conn_free(conn);420420- if (smc->clcsock) {421421- sock_release(smc->clcsock);422422- smc->clcsock = NULL;423423- }403403+ if (smc->clcsock)404404+ release_clcsock = true;424405 }425406 }426407 release_sock(sk);408408+ if (release_clcsock)409409+ smc_clcsock_release(smc);427410 sock_put(sk); /* sock_hold done by schedulers of close_work */428411}429412
···140140 /* We are going to append to the frags_list of head.141141 * Need to unshare the frag_list.142142 */143143- if (skb_has_frag_list(head)) {144144- err = skb_unclone(head, GFP_ATOMIC);145145- if (err) {146146- STRP_STATS_INCR(strp->stats.mem_fail);147147- desc->error = err;148148- return 0;149149- }143143+ err = skb_unclone(head, GFP_ATOMIC);144144+ if (err) {145145+ STRP_STATS_INCR(strp->stats.mem_fail);146146+ desc->error = err;147147+ return 0;150148 }151149152150 if (unlikely(skb_shinfo(head)->frag_list)) {
···9090 /* Flush Receives, then wait for deferred Reply work9191 * to complete.9292 */9393- ib_drain_qp(ia->ri_id->qp);9393+ ib_drain_rq(ia->ri_id->qp);9494 drain_workqueue(buf->rb_completion_wq);95959696 /* Deferred Reply processing might have scheduled
+2
net/tipc/link.c
···876876 __skb_queue_head_init(&list);877877878878 l->in_session = false;879879+ /* Force re-synch of peer session number before establishing */880880+ l->peer_session--;879881 l->session++;880882 l->mtu = l->advertised_mtu;881883
+2-1
net/tipc/name_table.c
···909909 for (; i < TIPC_NAMETBL_SIZE; i++) {910910 head = &tn->nametbl->services[i];911911912912- if (*last_type) {912912+ if (*last_type ||913913+ (!i && *last_key && (*last_lower == *last_key))) {913914 service = tipc_service_find(net, *last_type);914915 if (!service)915916 return -EPIPE;
···20652065 /* Free up un-sent records in tx_list. First, free20662066 * the partially sent record if any at head of tx_list.20672067 */20682068- if (tls_ctx->partially_sent_record) {20692069- struct scatterlist *sg = tls_ctx->partially_sent_record;20702070-20712071- while (1) {20722072- put_page(sg_page(sg));20732073- sk_mem_uncharge(sk, sg->length);20742074-20752075- if (sg_is_last(sg))20762076- break;20772077- sg++;20782078- }20792079-20802080- tls_ctx->partially_sent_record = NULL;20812081-20682068+ if (tls_free_partial_record(sk, tls_ctx)) {20822069 rec = list_first_entry(&ctx->tx_list,20832070 struct tls_rec, list);20842071 list_del(&rec->list);
···190190 /* copy subelement as we need to change its content to191191 * mark an ie after it is processed.192192 */193193- sub_copy = kmalloc(subie_len, gfp);193193+ sub_copy = kmemdup(subelement, subie_len, gfp);194194 if (!sub_copy)195195 return 0;196196- memcpy(sub_copy, subelement, subie_len);197196198197 pos = &new_ie[0];199198
+4-2
net/wireless/util.c
···12201220 else if (rate->bw == RATE_INFO_BW_HE_RU &&12211221 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_26)12221222 result = rates_26[rate->he_gi];12231223- else if (WARN(1, "invalid HE MCS: bw:%d, ru:%d\n",12241224- rate->bw, rate->he_ru_alloc))12231223+ else {12241224+ WARN(1, "invalid HE MCS: bw:%d, ru:%d\n",12251225+ rate->bw, rate->he_ru_alloc);12251226 return 0;12271227+ }1226122812271229 /* now scale to the appropriate MCS */12281230 tmp = result;
+48-1
security/apparmor/lsm.c
···13361336bool aa_g_paranoid_load = true;13371337module_param_named(paranoid_load, aa_g_paranoid_load, aabool, S_IRUGO);1338133813391339+static int param_get_aaintbool(char *buffer, const struct kernel_param *kp);13401340+static int param_set_aaintbool(const char *val, const struct kernel_param *kp);13411341+#define param_check_aaintbool param_check_int13421342+static const struct kernel_param_ops param_ops_aaintbool = {13431343+ .set = param_set_aaintbool,13441344+ .get = param_get_aaintbool13451345+};13391346/* Boot time disable flag */13401347static int apparmor_enabled __lsm_ro_after_init = 1;13411341-module_param_named(enabled, apparmor_enabled, int, 0444);13481348+module_param_named(enabled, apparmor_enabled, aaintbool, 0444);1342134913431350static int __init apparmor_enabled_setup(char *str)13441351{···14181411 if (apparmor_initialized && !policy_view_capable(NULL))14191412 return -EPERM;14201413 return param_get_uint(buffer, kp);14141414+}14151415+14161416+/* Can only be set before AppArmor is initialized (i.e. on boot cmdline). */14171417+static int param_set_aaintbool(const char *val, const struct kernel_param *kp)14181418+{14191419+ struct kernel_param kp_local;14201420+ bool value;14211421+ int error;14221422+14231423+ if (apparmor_initialized)14241424+ return -EPERM;14251425+14261426+ /* Create local copy, with arg pointing to bool type. */14271427+ value = !!*((int *)kp->arg);14281428+ memcpy(&kp_local, kp, sizeof(kp_local));14291429+ kp_local.arg = &value;14301430+14311431+ error = param_set_bool(val, &kp_local);14321432+ if (!error)14331433+ *((int *)kp->arg) = *((bool *)kp_local.arg);14341434+ return error;14351435+}14361436+14371437+/*14381438+ * To avoid changing /sys/module/apparmor/parameters/enabled from Y/N to14391439+ * 1/0, this converts the "int that is actually bool" back to bool for14401440+ * display in the /sys filesystem, while keeping it "int" for the LSM14411441+ * infrastructure.14421442+ */14431443+static int param_get_aaintbool(char *buffer, const struct kernel_param *kp)14441444+{14451445+ struct kernel_param kp_local;14461446+ bool value;14471447+14481448+ /* Create local copy, with arg pointing to bool type. */14491449+ value = !!*((int *)kp->arg);14501450+ memcpy(&kp_local, kp, sizeof(kp_local));14511451+ kp_local.arg = &value;14521452+14531453+ return param_get_bool(buffer, &kp_local);14211454}1422145514231456static int param_get_audit(char *buffer, const struct kernel_param *kp)
+3-3
sound/core/seq/seq_clientmgr.c
···1252125212531253 /* fill the info fields */12541254 if (client_info->name[0])12551255- strlcpy(client->name, client_info->name, sizeof(client->name));12551255+ strscpy(client->name, client_info->name, sizeof(client->name));1256125612571257 client->filter = client_info->filter;12581258 client->event_lost = client_info->event_lost;···15301530 /* set queue name */15311531 if (!info->name[0])15321532 snprintf(info->name, sizeof(info->name), "Queue-%d", q->queue);15331533- strlcpy(q->name, info->name, sizeof(q->name));15331533+ strscpy(q->name, info->name, sizeof(q->name));15341534 snd_use_lock_free(&q->use_lock);1535153515361536 return 0;···15921592 queuefree(q);15931593 return -EPERM;15941594 }15951595- strlcpy(q->name, info->name, sizeof(q->name));15951595+ strscpy(q->name, info->name, sizeof(q->name));15961596 queuefree(q);1597159715981598 return 0;
···11511151 tristate "WCD9335 Codec"11521152 depends on SLIMBUS11531153 select REGMAP_SLIMBUS11541154+ select REGMAP_IRQ11541155 help11551156 The WCD9335 is a standalone Hi-Fi audio CODEC IC, supports11561157 Qualcomm Technologies, Inc. (QTI) multimedia solutions,
+1
sound/soc/codecs/ab8500-codec.c
···21292129 dev_err(dai->component->dev,21302130 "%s: ERROR: The device is either a master or a slave.\n",21312131 __func__);21322132+ /* fall through */21322133 default:21332134 dev_err(dai->component->dev,21342135 "%s: ERROR: Unsupporter master mask 0x%x\n",
···4343 struct clk *mclk;4444 struct snd_soc_jack jack;4545 bool ts3a227e_present;4646+ int quirks;4647};47484849static int platform_clock_control(struct snd_soc_dapm_widget *w,···5453 struct snd_soc_dai *codec_dai;5554 struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);5655 int ret;5656+5757+ /* See the comment in snd_cht_mc_probe() */5858+ if (ctx->quirks & QUIRK_PMC_PLT_CLK_0)5959+ return 0;57605861 codec_dai = snd_soc_card_get_codec_dai(card, CHT_CODEC_DAI);5962 if (!codec_dai) {···227222 dev_err(runtime->dev,228223 "jack detection gpios not added, error %d\n", ret);229224 }225225+226226+ /* See the comment in snd_cht_mc_probe() */227227+ if (ctx->quirks & QUIRK_PMC_PLT_CLK_0)228228+ return 0;230229231230 /*232231 * The firmware might enable the clock at···432423 const char *mclk_name;433424 struct snd_soc_acpi_mach *mach;434425 const char *platform_name;435435- int quirks = 0;436436-437437- dmi_id = dmi_first_match(cht_max98090_quirk_table);438438- if (dmi_id)439439- quirks = (unsigned long)dmi_id->driver_data;440426441427 drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);442428 if (!drv)443429 return -ENOMEM;430430+431431+ dmi_id = dmi_first_match(cht_max98090_quirk_table);432432+ if (dmi_id)433433+ drv->quirks = (unsigned long)dmi_id->driver_data;444434445435 drv->ts3a227e_present = acpi_dev_found("104C227E");446436 if (!drv->ts3a227e_present) {···466458 snd_soc_card_cht.dev = &pdev->dev;467459 snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);468460469469- if (quirks & QUIRK_PMC_PLT_CLK_0)461461+ if (drv->quirks & QUIRK_PMC_PLT_CLK_0)470462 mclk_name = "pmc_plt_clk_0";471463 else472464 mclk_name = "pmc_plt_clk_3";···479471 return PTR_ERR(drv->mclk);480472 }481473474474+ /*475475+ * Boards which have the MAX98090's clk connected to clk_0 do not seem476476+ * to like it if we muck with the clock. If we disable the clock when477477+ * it is unused we get "max98090 i2c-193C9890:00: PLL unlocked" errors478478+ * and the PLL never seems to lock again.479479+ * So for these boards we enable it here once and leave it at that.480480+ */481481+ if (drv->quirks & QUIRK_PMC_PLT_CLK_0) {482482+ ret_val = clk_prepare_enable(drv->mclk);483483+ if (ret_val < 0) {484484+ dev_err(&pdev->dev, "MCLK enable error: %d\n", ret_val);485485+ return ret_val;486486+ }487487+ }488488+482489 ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);483490 if (ret_val) {484491 dev_err(&pdev->dev,···504481 return ret_val;505482}506483484484+static int snd_cht_mc_remove(struct platform_device *pdev)485485+{486486+ struct snd_soc_card *card = platform_get_drvdata(pdev);487487+ struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);488488+489489+ if (ctx->quirks & QUIRK_PMC_PLT_CLK_0)490490+ clk_disable_unprepare(ctx->mclk);491491+492492+ return 0;493493+}494494+507495static struct platform_driver snd_cht_mc_driver = {508496 .driver = {509497 .name = "cht-bsw-max98090",510498 },511499 .probe = snd_cht_mc_probe,500500+ .remove = snd_cht_mc_remove,512501};513502514503module_platform_driver(snd_cht_mc_driver)
···605605 int m_sel_id = mck_div[mck_id].m_sel_id;606606 int div_clk_id = mck_div[mck_id].div_clk_id;607607608608+ /* i2s5 mck not support */609609+ if (mck_id == MT8183_I2S5_MCK)610610+ return;611611+608612 clk_disable_unprepare(afe_priv->clk[div_clk_id]);609613 if (m_sel_id >= 0)610614 clk_disable_unprepare(afe_priv->clk[m_sel_id]);
···9191 return ret;92929393 /*9494- * We add 1 to the rclk_freq value in order to avoid too low clock9494+ * We add 2 to the rclk_freq value in order to avoid too low clock9595 * frequency values due to the EPLL output frequency not being exact9696 * multiple of the audio sampling rate.9797 */9898- rclk_freq = params_rate(params) * rfs + 1;9898+ rclk_freq = params_rate(params) * rfs + 2;9999100100 ret = clk_set_rate(priv->sclk_i2s, rclk_freq);101101 if (ret < 0)
···947947 snd_soc_dapm_free(snd_soc_component_get_dapm(component));948948 soc_cleanup_component_debugfs(component);949949 component->card = NULL;950950- if (!component->driver->ignore_module_refcount)950950+ if (!component->driver->module_get_upon_open)951951 module_put(component->dev->driver->owner);952952}953953···13811381 return 0;13821382 }1383138313841384- if (!component->driver->ignore_module_refcount &&13841384+ if (!component->driver->module_get_upon_open &&13851385 !try_module_get(component->dev->driver->owner))13861386 return -ENODEV;13871387···2797279727982798 ret = soc_init_dai_link(card, link);27992799 if (ret) {28002800+ soc_cleanup_platform(card);28002801 dev_err(card->dev, "ASoC: failed to init link %s\n",28012802 link->name);28022803 mutex_unlock(&client_mutex);···28202819 card->instantiated = 0;28212820 mutex_init(&card->mutex);28222821 mutex_init(&card->dapm_mutex);28222822+ spin_lock_init(&card->dpcm_lock);2823282328242824 return snd_soc_bind_card(card);28252825}
+11
sound/soc/soc-dapm.c
···36503650 case snd_soc_dapm_dac:36513651 case snd_soc_dapm_aif_in:36523652 case snd_soc_dapm_pga:36533653+ case snd_soc_dapm_buffer:36543654+ case snd_soc_dapm_scheduler:36553655+ case snd_soc_dapm_effect:36563656+ case snd_soc_dapm_src:36573657+ case snd_soc_dapm_asrc:36583658+ case snd_soc_dapm_encoder:36593659+ case snd_soc_dapm_decoder:36533660 case snd_soc_dapm_out_drv:36543661 case snd_soc_dapm_micbias:36553662 case snd_soc_dapm_line:···39643957 int count;3965395839663959 devm_kfree(card->dev, (void *)*private_value);39603960+39613961+ if (!w_param_text)39623962+ return;39633963+39673964 for (count = 0 ; count < num_params; count++)39683965 devm_kfree(card->dev, (void *)w_param_text[count]);39693966 devm_kfree(card->dev, w_param_text);
+55-11
sound/soc/soc-pcm.c
···1515#include <linux/delay.h>1616#include <linux/pinctrl/consumer.h>1717#include <linux/pm_runtime.h>1818+#include <linux/module.h>1819#include <linux/slab.h>1920#include <linux/workqueue.h>2021#include <linux/export.h>···464463 continue;465464466465 component->driver->ops->close(substream);466466+467467+ if (component->driver->module_get_upon_open)468468+ module_put(component->dev->driver->owner);467469 }468470469471 return 0;···516512 if (!component->driver->ops ||517513 !component->driver->ops->open)518514 continue;515515+516516+ if (component->driver->module_get_upon_open &&517517+ !try_module_get(component->dev->driver->owner)) {518518+ ret = -ENODEV;519519+ goto module_err;520520+ }519521520522 ret = component->driver->ops->open(substream);521523 if (ret < 0) {···638628639629component_err:640630 soc_pcm_components_close(substream, component);641641-631631+module_err:642632 if (cpu_dai->driver->ops->shutdown)643633 cpu_dai->driver->ops->shutdown(substream, cpu_dai);644634out:···964954 codec_params = *params;965955966956 /* fixup params based on TDM slot masks */967967- if (codec_dai->tx_mask)957957+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&958958+ codec_dai->tx_mask)968959 soc_pcm_codec_params_fixup(&codec_params,969960 codec_dai->tx_mask);970970- if (codec_dai->rx_mask)961961+962962+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE &&963963+ codec_dai->rx_mask)971964 soc_pcm_codec_params_fixup(&codec_params,972965 codec_dai->rx_mask);973966···12261213 struct snd_soc_pcm_runtime *be, int stream)12271214{12281215 struct snd_soc_dpcm *dpcm;12161216+ unsigned long flags;1229121712301218 /* only add new dpcms */12311219 for_each_dpcm_be(fe, stream, dpcm) {···12421228 dpcm->fe = fe;12431229 be->dpcm[stream].runtime = fe->dpcm[stream].runtime;12441230 dpcm->state = SND_SOC_DPCM_LINK_STATE_NEW;12311231+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);12451232 list_add(&dpcm->list_be, &fe->dpcm[stream].be_clients);12461233 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients);12341234+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);1247123512481236 dev_dbg(fe->dev, "connected new DPCM %s path %s %s %s\n",12491237 stream ? "capture" : "playback", fe->dai_link->name,···12911275void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)12921276{12931277 struct snd_soc_dpcm *dpcm, *d;12781278+ unsigned long flags;1294127912951280 for_each_dpcm_be_safe(fe, stream, dpcm, d) {12961281 dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n",···13111294#ifdef CONFIG_DEBUG_FS13121295 debugfs_remove(dpcm->debugfs_state);13131296#endif12971297+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);13141298 list_del(&dpcm->list_be);13151299 list_del(&dpcm->list_fe);13001300+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);13161301 kfree(dpcm);13171302 }13181303}···15661547void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream)15671548{15681549 struct snd_soc_dpcm *dpcm;15501550+ unsigned long flags;1569155115521552+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);15701553 for_each_dpcm_be(fe, stream, dpcm)15711554 dpcm->be->dpcm[stream].runtime_update =15721555 SND_SOC_DPCM_UPDATE_NO;15561556+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);15731557}1574155815751559static void dpcm_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe,···19211899 struct snd_soc_pcm_runtime *be = dpcm->be;19221900 struct snd_pcm_substream *be_substream =19231901 snd_soc_dpcm_get_substream(be, stream);19241924- struct snd_soc_pcm_runtime *rtd = be_substream->private_data;19021902+ struct snd_soc_pcm_runtime *rtd;19251903 struct snd_soc_dai *codec_dai;19261904 int i;1927190519061906+ /* A backend may not have the requested substream */19071907+ if (!be_substream)19081908+ continue;19091909+19101910+ rtd = be_substream->private_data;19281911 if (rtd->dai_link->be_hw_params_fixup)19291912 continue;19301913···25982571 struct snd_soc_dpcm *dpcm;25992572 enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];26002573 int ret;25742574+ unsigned long flags;2601257526022576 dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n",26032577 stream ? "capture" : "playback", fe->dai_link->name);···26682640 dpcm_be_dai_shutdown(fe, stream);26692641disconnect:26702642 /* disconnect any non started BEs */26432643+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);26712644 for_each_dpcm_be(fe, stream, dpcm) {26722645 struct snd_soc_pcm_runtime *be = dpcm->be;26732646 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)26742647 dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;26752648 }26492649+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);2676265026772651 return ret;26782652}···32513221{32523222 struct snd_soc_dpcm *dpcm;32533223 int state;32243224+ int ret = 1;32253225+ unsigned long flags;3254322632273227+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);32553228 for_each_dpcm_fe(be, stream, dpcm) {3256322932573230 if (dpcm->fe == fe)···32633230 state = dpcm->fe->dpcm[stream].state;32643231 if (state == SND_SOC_DPCM_STATE_START ||32653232 state == SND_SOC_DPCM_STATE_PAUSED ||32663266- state == SND_SOC_DPCM_STATE_SUSPEND)32673267- return 0;32333233+ state == SND_SOC_DPCM_STATE_SUSPEND) {32343234+ ret = 0;32353235+ break;32363236+ }32683237 }32383238+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);3269323932703240 /* it's safe to free/stop this BE DAI */32713271- return 1;32413241+ return ret;32723242}32733243EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_free_stop);32743244···32843248{32853249 struct snd_soc_dpcm *dpcm;32863250 int state;32513251+ int ret = 1;32523252+ unsigned long flags;3287325332543254+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);32883255 for_each_dpcm_fe(be, stream, dpcm) {3289325632903257 if (dpcm->fe == fe)···32973258 if (state == SND_SOC_DPCM_STATE_START ||32983259 state == SND_SOC_DPCM_STATE_PAUSED ||32993260 state == SND_SOC_DPCM_STATE_SUSPEND ||33003300- state == SND_SOC_DPCM_STATE_PREPARE)33013301- return 0;32613261+ state == SND_SOC_DPCM_STATE_PREPARE) {32623262+ ret = 0;32633263+ break;32643264+ }33023265 }32663266+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);3303326733043268 /* it's safe to change hw_params */33053305- return 1;32693269+ return ret;33063270}33073271EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params);33083272···33443302 struct snd_pcm_hw_params *params = &fe->dpcm[stream].hw_params;33453303 struct snd_soc_dpcm *dpcm;33463304 ssize_t offset = 0;33053305+ unsigned long flags;3347330633483307 /* FE state */33493308 offset += snprintf(buf + offset, size - offset,···33723329 goto out;33733330 }3374333133323332+ spin_lock_irqsave(&fe->card->dpcm_lock, flags);33753333 for_each_dpcm_be(fe, stream, dpcm) {33763334 struct snd_soc_pcm_runtime *be = dpcm->be;33773335 params = &dpcm->hw_params;···33933349 params_channels(params),33943350 params_rate(params));33953351 }33963396-33523352+ spin_unlock_irqrestore(&fe->card->dpcm_lock, flags);33973353out:33983354 return offset;33993355}
···991010#include <linux/clk.h>1111#include <linux/module.h>1212+#include <linux/mutex.h>1213#include <linux/platform_device.h>1314#include <linux/slab.h>1415···3837 /* PCM buffer */3938 unsigned char *pcm_buff;4039 unsigned int pos;4040+4141+ struct mutex lock; /* protect against race condition on iio state */4142};42434344static const struct snd_pcm_hardware stm32_adfsdm_pcm_hw = {···6562{6663 struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);67646565+ mutex_lock(&priv->lock);6866 if (priv->iio_active) {6967 iio_channel_stop_all_cb(priv->iio_cb);7068 priv->iio_active = false;7169 }7070+ mutex_unlock(&priv->lock);7271}73727473static int stm32_adfsdm_dai_prepare(struct snd_pcm_substream *substream,···7974 struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);8075 int ret;81767777+ mutex_lock(&priv->lock);7878+ if (priv->iio_active) {7979+ iio_channel_stop_all_cb(priv->iio_cb);8080+ priv->iio_active = false;8181+ }8282+8283 ret = iio_write_channel_attribute(priv->iio_ch,8384 substream->runtime->rate, 0,8485 IIO_CHAN_INFO_SAMP_FREQ);8586 if (ret < 0) {8687 dev_err(dai->dev, "%s: Failed to set %d sampling rate\n",8788 __func__, substream->runtime->rate);8888- return ret;8989+ goto out;8990 }90919192 if (!priv->iio_active) {···10291 dev_err(dai->dev, "%s: IIO channel start failed (%d)\n",10392 __func__, ret);10493 }9494+9595+out:9696+ mutex_unlock(&priv->lock);1059710698 return ret;10799}···305291static int stm32_adfsdm_probe(struct platform_device *pdev)306292{307293 struct stm32_adfsdm_priv *priv;294294+ struct snd_soc_component *component;308295 int ret;309296310297 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);···314299315300 priv->dev = &pdev->dev;316301 priv->dai_drv = stm32_adfsdm_dai;302302+ mutex_init(&priv->lock);317303318304 dev_set_drvdata(&pdev->dev, priv);319305···333317 if (IS_ERR(priv->iio_cb))334318 return PTR_ERR(priv->iio_cb);335319336336- ret = devm_snd_soc_register_component(&pdev->dev,337337- &stm32_adfsdm_soc_platform,338338- NULL, 0);320320+ component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL);321321+ if (!component)322322+ return -ENOMEM;323323+#ifdef CONFIG_DEBUG_FS324324+ component->debugfs_prefix = "pcm";325325+#endif326326+327327+ ret = snd_soc_add_component(&pdev->dev, component,328328+ &stm32_adfsdm_soc_platform, NULL, 0);339329 if (ret < 0)340330 dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",341331 __func__);342332343333 return ret;334334+}335335+336336+static int stm32_adfsdm_remove(struct platform_device *pdev)337337+{338338+ snd_soc_unregister_component(&pdev->dev);339339+340340+ return 0;344341}345342346343static struct platform_driver stm32_adfsdm_driver = {···362333 .of_match_table = stm32_adfsdm_of_match,363334 },364335 .probe = stm32_adfsdm_probe,336336+ .remove = stm32_adfsdm_remove,365337};366338367339module_platform_driver(stm32_adfsdm_driver);
+1-2
sound/soc/stm/stm32_i2s.c
···281281 case STM32_I2S_CFG2_REG:282282 case STM32_I2S_IER_REG:283283 case STM32_I2S_SR_REG:284284- case STM32_I2S_TXDR_REG:285284 case STM32_I2S_RXDR_REG:286285 case STM32_I2S_CGFR_REG:287286 return true;···292293static bool stm32_i2s_volatile_reg(struct device *dev, unsigned int reg)293294{294295 switch (reg) {295295- case STM32_I2S_TXDR_REG:296296+ case STM32_I2S_SR_REG:296297 case STM32_I2S_RXDR_REG:297298 return true;298299 default:
+5-3
sound/soc/stm/stm32_sai.c
···105105 if (!pdev) {106106 dev_err(&sai_client->pdev->dev,107107 "Device not found for node %pOFn\n", np_provider);108108+ of_node_put(np_provider);108109 return -ENODEV;109110 }110111···114113 dev_err(&sai_client->pdev->dev,115114 "SAI sync provider data not found\n");116115 ret = -EINVAL;117117- goto out_put_dev;116116+ goto error;118117 }119118120119 /* Configure sync client */121120 ret = stm32_sai_sync_conf_client(sai_client, synci);122121 if (ret < 0)123123- goto out_put_dev;122122+ goto error;124123125124 /* Configure sync provider */126125 ret = stm32_sai_sync_conf_provider(sai_provider, synco);127126128128-out_put_dev:127127+error:129128 put_device(&pdev->dev);129129+ of_node_put(np_provider);130130 return ret;131131}132132
+86-28
sound/soc/stm/stm32_sai_sub.c
···7070#define SAI_IEC60958_STATUS_BYTES 2471717272#define SAI_MCLK_NAME_LEN 327373+#define SAI_RATE_11K 1102573747475/**7576 * struct stm32_sai_sub_data - private data of SAI sub block (block A or B)···101100 * @slot_mask: rx or tx active slots mask. set at init or at runtime102101 * @data_size: PCM data width. corresponds to PCM substream width.103102 * @spdif_frm_cnt: S/PDIF playback frame counter104104- * @snd_aes_iec958: iec958 data103103+ * @iec958: iec958 data105104 * @ctrl_lock: control lock105105+ * @irq_lock: prevent race condition with IRQ106106 */107107struct stm32_sai_sub_data {108108 struct platform_device *pdev;···135133 unsigned int spdif_frm_cnt;136134 struct snd_aes_iec958 iec958;137135 struct mutex ctrl_lock; /* protect resources accessed by controls */136136+ spinlock_t irq_lock; /* used to prevent race condition with IRQ */138137};139138140139enum stm32_sai_fifo_th {···310307 return ret;311308}312309310310+static int stm32_sai_set_parent_clock(struct stm32_sai_sub_data *sai,311311+ unsigned int rate)312312+{313313+ struct platform_device *pdev = sai->pdev;314314+ struct clk *parent_clk = sai->pdata->clk_x8k;315315+ int ret;316316+317317+ if (!(rate % SAI_RATE_11K))318318+ parent_clk = sai->pdata->clk_x11k;319319+320320+ ret = clk_set_parent(sai->sai_ck, parent_clk);321321+ if (ret)322322+ dev_err(&pdev->dev, " Error %d setting sai_ck parent clock. %s",323323+ ret, ret == -EBUSY ?324324+ "Active stream rates conflict\n" : "\n");325325+326326+ return ret;327327+}328328+313329static long stm32_sai_mclk_round_rate(struct clk_hw *hw, unsigned long rate,314330 unsigned long *prate)315331{···496474 status = SNDRV_PCM_STATE_XRUN;497475 }498476499499- if (status != SNDRV_PCM_STATE_RUNNING)477477+ spin_lock(&sai->irq_lock);478478+ if (status != SNDRV_PCM_STATE_RUNNING && sai->substream)500479 snd_pcm_stop_xrun(sai->substream);480480+ spin_unlock(&sai->irq_lock);501481502482 return IRQ_HANDLED;503483}···510486 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);511487 int ret;512488513513- if (dir == SND_SOC_CLOCK_OUT) {489489+ if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) {514490 ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,515491 SAI_XCR1_NODIV,516492 (unsigned int)~SAI_XCR1_NODIV);517493 if (ret < 0)518494 return ret;519495496496+ /* If master clock is used, set parent clock now */497497+ ret = stm32_sai_set_parent_clock(sai, freq);498498+ if (ret)499499+ return ret;500500+501501+ ret = clk_set_rate_exclusive(sai->sai_mclk, freq);502502+ if (ret) {503503+ dev_err(cpu_dai->dev,504504+ ret == -EBUSY ?505505+ "Active streams have incompatible rates" :506506+ "Could not set mclk rate\n");507507+ return ret;508508+ }509509+520510 dev_dbg(cpu_dai->dev, "SAI MCLK frequency is %uHz\n", freq);521511 sai->mclk_rate = freq;522522-523523- if (sai->sai_mclk) {524524- ret = clk_set_rate_exclusive(sai->sai_mclk,525525- sai->mclk_rate);526526- if (ret) {527527- dev_err(cpu_dai->dev,528528- "Could not set mclk rate\n");529529- return ret;530530- }531531- }532512 }533513534514 return 0;···707679{708680 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);709681 int imr, cr2, ret;682682+ unsigned long flags;710683684684+ spin_lock_irqsave(&sai->irq_lock, flags);711685 sai->substream = substream;686686+ spin_unlock_irqrestore(&sai->irq_lock, flags);687687+688688+ if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {689689+ snd_pcm_hw_constraint_mask64(substream->runtime,690690+ SNDRV_PCM_HW_PARAM_FORMAT,691691+ SNDRV_PCM_FMTBIT_S32_LE);692692+ snd_pcm_hw_constraint_single(substream->runtime,693693+ SNDRV_PCM_HW_PARAM_CHANNELS, 2);694694+ }712695713696 ret = clk_prepare_enable(sai->sai_ck);714697 if (ret < 0) {···937898 struct snd_pcm_hw_params *params)938899{939900 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);940940- int div = 0;901901+ int div = 0, cr1 = 0;941902 int sai_clk_rate, mclk_ratio, den;942903 unsigned int rate = params_rate(params);904904+ int ret;943905944944- if (!(rate % 11025))945945- clk_set_parent(sai->sai_ck, sai->pdata->clk_x11k);946946- else947947- clk_set_parent(sai->sai_ck, sai->pdata->clk_x8k);906906+ if (!sai->sai_mclk) {907907+ ret = stm32_sai_set_parent_clock(sai, rate);908908+ if (ret)909909+ return ret;910910+ }948911 sai_clk_rate = clk_get_rate(sai->sai_ck);949912950913 if (STM_SAI_IS_F4(sai->pdata)) {···984943 } else {985944 if (sai->mclk_rate) {986945 mclk_ratio = sai->mclk_rate / rate;987987- if ((mclk_ratio != 512) &&988988- (mclk_ratio != 256)) {946946+ if (mclk_ratio == 512) {947947+ cr1 = SAI_XCR1_OSR;948948+ } else if (mclk_ratio != 256) {989949 dev_err(cpu_dai->dev,990950 "Wrong mclk ratio %d\n",991951 mclk_ratio);992952 return -EINVAL;993953 }954954+955955+ regmap_update_bits(sai->regmap,956956+ STM_SAI_CR1_REGX,957957+ SAI_XCR1_OSR, cr1);958958+994959 div = stm32_sai_get_clk_div(sai, sai_clk_rate,995960 sai->mclk_rate);996961 if (div < 0)···10981051 struct snd_soc_dai *cpu_dai)10991052{11001053 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);10541054+ unsigned long flags;1101105511021056 regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0);1103105711041058 regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, SAI_XCR1_NODIV,11051059 SAI_XCR1_NODIV);1106106010611061+ /* Release mclk rate only if rate was actually set */10621062+ if (sai->mclk_rate) {10631063+ clk_rate_exclusive_put(sai->sai_mclk);10641064+ sai->mclk_rate = 0;10651065+ }10661066+11071067 clk_disable_unprepare(sai->sai_ck);1108106811091109- clk_rate_exclusive_put(sai->sai_mclk);11101110-10691069+ spin_lock_irqsave(&sai->irq_lock, flags);11111070 sai->substream = NULL;10711071+ spin_unlock_irqrestore(&sai->irq_lock, flags);11121072}1113107311141074static int stm32_sai_pcm_new(struct snd_soc_pcm_runtime *rtd,11151075 struct snd_soc_dai *cpu_dai)11161076{11171077 struct stm32_sai_sub_data *sai = dev_get_drvdata(cpu_dai->dev);10781078+ struct snd_kcontrol_new knew = iec958_ctls;1118107911191080 if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {11201081 dev_dbg(&sai->pdev->dev, "%s: register iec controls", __func__);11211121- return snd_ctl_add(rtd->pcm->card,11221122- snd_ctl_new1(&iec958_ctls, sai));10821082+ knew.device = rtd->pcm->device;10831083+ return snd_ctl_add(rtd->pcm->card, snd_ctl_new1(&knew, sai));11231084 }1124108511251086 return 0;···11361081static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai)11371082{11381083 struct stm32_sai_sub_data *sai = dev_get_drvdata(cpu_dai->dev);11391139- int cr1 = 0, cr1_mask;10841084+ int cr1 = 0, cr1_mask, ret;1140108511411086 sai->cpu_dai = cpu_dai;11421087···11661111 /* Configure synchronization */11671112 if (sai->sync == SAI_SYNC_EXTERNAL) {11681113 /* Configure synchro client and provider */11691169- sai->pdata->set_sync(sai->pdata, sai->np_sync_provider,11701170- sai->synco, sai->synci);11141114+ ret = sai->pdata->set_sync(sai->pdata, sai->np_sync_provider,11151115+ sai->synco, sai->synci);11161116+ if (ret)11171117+ return ret;11711118 }1172111911731120 cr1_mask |= SAI_XCR1_SYNCEN_MASK;···14491392 if (!sai->cpu_dai_drv)14501393 return -ENOMEM;1451139414521452- sai->cpu_dai_drv->name = dev_name(&pdev->dev);14531395 if (STM_SAI_IS_PLAYBACK(sai)) {14541396 memcpy(sai->cpu_dai_drv, &stm32_sai_playback_dai,14551397 sizeof(stm32_sai_playback_dai));···14581402 sizeof(stm32_sai_capture_dai));14591403 sai->cpu_dai_drv->capture.stream_name = sai->cpu_dai_drv->name;14601404 }14051405+ sai->cpu_dai_drv->name = dev_name(&pdev->dev);1461140614621407 return 0;14631408}···1481142414821425 sai->pdev = pdev;14831426 mutex_init(&sai->ctrl_lock);14271427+ spin_lock_init(&sai->irq_lock);14841428 platform_set_drvdata(pdev, sai);1485142914861430 sai->pdata = dev_get_drvdata(pdev->dev.parent);
+1-1
sound/xen/xen_snd_front_alsa.c
···441441{442442 int i;443443444444- stream->buffer = alloc_pages_exact(stream->buffer_sz, GFP_KERNEL);444444+ stream->buffer = alloc_pages_exact(buffer_sz, GFP_KERNEL);445445 if (!stream->buffer)446446 return -ENOMEM;447447
+4-28
tools/io_uring/io_uring-bench.c
···3232#include "liburing.h"3333#include "barrier.h"34343535-#ifndef IOCQE_FLAG_CACHEHIT3636-#define IOCQE_FLAG_CACHEHIT (1U << 0)3737-#endif3838-3935#define min(a, b) ((a < b) ? (a) : (b))40364137struct io_sq_ring {···8185 unsigned long reaps;8286 unsigned long done;8387 unsigned long calls;8484- unsigned long cachehit, cachemiss;8588 volatile int finish;86898790 __s32 *fds;···265270 return -1;266271 }267272 }268268- if (cqe->flags & IOCQE_FLAG_CACHEHIT)269269- s->cachehit++;270270- else271271- s->cachemiss++;272273 reaped++;273274 head++;274275 } while (1);···480489int main(int argc, char *argv[])481490{482491 struct submitter *s = &submitters[0];483483- unsigned long done, calls, reap, cache_hit, cache_miss;492492+ unsigned long done, calls, reap;484493 int err, i, flags, fd;485494 char *fdepths;486495 void *ret;···560569 pthread_create(&s->thread, NULL, submitter_fn, s);561570562571 fdepths = malloc(8 * s->nr_files);563563- cache_hit = cache_miss = reap = calls = done = 0;572572+ reap = calls = done = 0;564573 do {565574 unsigned long this_done = 0;566575 unsigned long this_reap = 0;567576 unsigned long this_call = 0;568568- unsigned long this_cache_hit = 0;569569- unsigned long this_cache_miss = 0;570577 unsigned long rpc = 0, ipc = 0;571571- double hit = 0.0;572578573579 sleep(1);574580 this_done += s->done;575581 this_call += s->calls;576582 this_reap += s->reaps;577577- this_cache_hit += s->cachehit;578578- this_cache_miss += s->cachemiss;579579- if (this_cache_hit && this_cache_miss) {580580- unsigned long hits, total;581581-582582- hits = this_cache_hit - cache_hit;583583- total = hits + this_cache_miss - cache_miss;584584- hit = (double) hits / (double) total;585585- hit *= 100.0;586586- }587583 if (this_call - calls) {588584 rpc = (this_done - done) / (this_call - calls);589585 ipc = (this_reap - reap) / (this_call - calls);590586 } else591587 rpc = ipc = -1;592588 file_depths(fdepths);593593- printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (%s), Cachehit=%0.2f%%\n",589589+ printf("IOPS=%lu, IOS/call=%ld/%ld, inflight=%u (%s)\n",594590 this_done - done, rpc, ipc, s->inflight,595595- fdepths, hit);591591+ fdepths);596592 done = this_done;597593 calls = this_call;598594 reap = this_reap;599599- cache_hit = s->cachehit;600600- cache_miss = s->cachemiss;601595 } while (!finish);602596603597 pthread_join(s->thread, &ret);
+1
tools/objtool/check.c
···165165 "fortify_panic",166166 "usercopy_abort",167167 "machine_real_restart",168168+ "rewind_stack_do_exit",168169 };169170170171 if (func->bind == STB_WEAK)
···11111212ALL_TESTS="1313 rif_set_addr_test1414+ rif_vrf_set_addr_test1415 rif_inherit_bridge_addr_test1516 rif_non_inherit_bridge_addr_test1617 vlan_interface_deletion_test···98979998 ip link set dev $swp2 addr $swp2_mac10099 ip link set dev $swp1 addr $swp1_mac100100+}101101+102102+rif_vrf_set_addr_test()103103+{104104+ # Test that it is possible to set an IP address on a VRF upper despite105105+ # its random MAC address.106106+ RET=0107107+108108+ ip link add name vrf-test type vrf table 10109109+ ip link set dev $swp1 master vrf-test110110+111111+ ip -4 address add 192.0.2.1/24 dev vrf-test112112+ check_err $? "failed to set IPv4 address on VRF"113113+ ip -6 address add 2001:db8:1::1/64 dev vrf-test114114+ check_err $? "failed to set IPv6 address on VRF"115115+116116+ log_test "RIF - setting IP address on VRF"117117+118118+ ip link del dev vrf-test101119}102120103121rif_inherit_bridge_addr_test()
···10301030 nested_size, sizeof(state->nested_));10311031 }1032103210331033+ /*10341034+ * When KVM exits to userspace with KVM_EXIT_IO, KVM guarantees10351035+ * guest state is consistent only after userspace re-enters the10361036+ * kernel with KVM_RUN. Complete IO prior to migrating state10371037+ * to a new VM.10381038+ */10391039+ vcpu_run_complete_io(vm, vcpuid);10401040+10331041 nmsrs = kvm_get_num_msrs(vm);10341042 list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0]));10351043 list->nmsrs = nmsrs;···11011093 struct vcpu *vcpu = vcpu_find(vm, vcpuid);11021094 int r;1103109511041104- if (state->nested.size) {11051105- r = ioctl(vcpu->fd, KVM_SET_NESTED_STATE, &state->nested);11061106- TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_NESTED_STATE, r: %i",11071107- r);11081108- }11091109-11101096 r = ioctl(vcpu->fd, KVM_SET_XSAVE, &state->xsave);11111097 TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_XSAVE, r: %i",11121098 r);···11321130 r = ioctl(vcpu->fd, KVM_SET_REGS, &state->regs);11331131 TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_REGS, r: %i",11341132 r);11331133+11341134+ if (state->nested.size) {11351135+ r = ioctl(vcpu->fd, KVM_SET_NESTED_STATE, &state->nested);11361136+ TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_NESTED_STATE, r: %i",11371137+ r);11381138+ }11351139}
+3-2
tools/testing/selftests/kvm/x86_64/evmcs_test.c
···123123 stage, run->exit_reason,124124 exit_reason_str(run->exit_reason));125125126126- memset(®s1, 0, sizeof(regs1));127127- vcpu_regs_get(vm, VCPU_ID, ®s1);128126 switch (get_ucall(vm, VCPU_ID, &uc)) {129127 case UCALL_ABORT:130128 TEST_ASSERT(false, "%s at %s:%d", (const char *)uc.args[0],···142144 stage, (ulong)uc.args[1]);143145144146 state = vcpu_save_state(vm, VCPU_ID);147147+ memset(®s1, 0, sizeof(regs1));148148+ vcpu_regs_get(vm, VCPU_ID, ®s1);149149+145150 kvm_vm_release(vm);146151147152 /* Restore state in a new VM. */
···134134135135 struct kvm_cpuid_entry2 *entry = kvm_get_supported_cpuid_entry(1);136136137137- if (!kvm_check_cap(KVM_CAP_IMMEDIATE_EXIT)) {138138- fprintf(stderr, "immediate_exit not available, skipping test\n");139139- exit(KSFT_SKIP);140140- }141141-142137 /* Create VM */143138 vm = vm_create_default(VCPU_ID, 0, guest_code);144139 vcpu_set_cpuid(vm, VCPU_ID, kvm_get_supported_cpuid());···174179 uc.args[1] == stage, "Unexpected register values vmexit #%lx, got %lx",175180 stage, (ulong)uc.args[1]);176181177177- /*178178- * When KVM exits to userspace with KVM_EXIT_IO, KVM guarantees179179- * guest state is consistent only after userspace re-enters the180180- * kernel with KVM_RUN. Complete IO prior to migrating state181181- * to a new VM.182182- */183183- vcpu_run_complete_io(vm, VCPU_ID);184184-182182+ state = vcpu_save_state(vm, VCPU_ID);185183 memset(®s1, 0, sizeof(regs1));186184 vcpu_regs_get(vm, VCPU_ID, ®s1);187185188188- state = vcpu_save_state(vm, VCPU_ID);189186 kvm_vm_release(vm);190187191188 /* Restore state in a new VM. */
+40-54
tools/testing/selftests/net/fib_tests.sh
···607607 return $rc608608}609609610610+check_expected()611611+{612612+ local out="$1"613613+ local expected="$2"614614+ local rc=0615615+616616+ [ "${out}" = "${expected}" ] && return 0617617+618618+ if [ -z "${out}" ]; then619619+ if [ "$VERBOSE" = "1" ]; then620620+ printf "\nNo route entry found\n"621621+ printf "Expected:\n"622622+ printf " ${expected}\n"623623+ fi624624+ return 1625625+ fi626626+627627+ # tricky way to convert output to 1-line without ip's628628+ # messy '\'; this drops all extra white space629629+ out=$(echo ${out})630630+ if [ "${out}" != "${expected}" ]; then631631+ rc=1632632+ if [ "${VERBOSE}" = "1" ]; then633633+ printf " Unexpected route entry. Have:\n"634634+ printf " ${out}\n"635635+ printf " Expected:\n"636636+ printf " ${expected}\n\n"637637+ fi638638+ fi639639+640640+ return $rc641641+}642642+610643# add route for a prefix, flushing any existing routes first611644# expected to be the first step of a test612645add_route6()···687654 pfx=$1688655689656 out=$($IP -6 ro ls match ${pfx} | sed -e 's/ pref medium//')690690- [ "${out}" = "${expected}" ] && return 0691691-692692- if [ -z "${out}" ]; then693693- if [ "$VERBOSE" = "1" ]; then694694- printf "\nNo route entry found\n"695695- printf "Expected:\n"696696- printf " ${expected}\n"697697- fi698698- return 1699699- fi700700-701701- # tricky way to convert output to 1-line without ip's702702- # messy '\'; this drops all extra white space703703- out=$(echo ${out})704704- if [ "${out}" != "${expected}" ]; then705705- rc=1706706- if [ "${VERBOSE}" = "1" ]; then707707- printf " Unexpected route entry. Have:\n"708708- printf " ${out}\n"709709- printf " Expected:\n"710710- printf " ${expected}\n\n"711711- fi712712- fi713713-714714- return $rc657657+ check_expected "${out}" "${expected}"715658}716659717660route_cleanup()···737728 ip -netns ns2 addr add 172.16.103.2/24 dev veth4738729 ip -netns ns2 addr add 172.16.104.1/24 dev dummy1739730740740- set +ex731731+ set +e741732}742733743734# assumption is that basic add of a single path route works···972963 run_cmd "$IP li set dev dummy2 down"973964 rc=$?974965 if [ $rc -eq 0 ]; then975975- check_route6 ""966966+ out=$($IP -6 ro ls match 2001:db8:104::/64)967967+ check_expected "${out}" ""976968 rc=$?977969 fi978970 log_test $rc 0 "Prefix route removed on link down"···11041094 local pfx11051095 local expected="$1"11061096 local out11071107- local rc=01108109711091098 set -- $expected11101099 pfx=$111111100 [ "${pfx}" = "unreachable" ] && pfx=$21112110111131102 out=$($IP ro ls match ${pfx})11141114- [ "${out}" = "${expected}" ] && return 011151115-11161116- if [ -z "${out}" ]; then11171117- if [ "$VERBOSE" = "1" ]; then11181118- printf "\nNo route entry found\n"11191119- printf "Expected:\n"11201120- printf " ${expected}\n"11211121- fi11221122- return 111231123- fi11241124-11251125- # tricky way to convert output to 1-line without ip's11261126- # messy '\'; this drops all extra white space11271127- out=$(echo ${out})11281128- if [ "${out}" != "${expected}" ]; then11291129- rc=111301130- if [ "${VERBOSE}" = "1" ]; then11311131- printf " Unexpected route entry. Have:\n"11321132- printf " ${out}\n"11331133- printf " Expected:\n"11341134- printf " ${expected}\n\n"11351135- fi11361136- fi11371137-11381138- return $rc11031103+ check_expected "${out}" "${expected}"11391104}1140110511411106# assumption is that basic add of a single path route works···13751390 run_cmd "$IP li set dev dummy2 down"13761391 rc=$?13771392 if [ $rc -eq 0 ]; then13781378- check_route ""13931393+ out=$($IP ro ls match 172.16.104.0/24)13941394+ check_expected "${out}" ""13791395 rc=$?13801396 fi13811397 log_test $rc 0 "Prefix route removed on link down"
+3-2
virt/kvm/irqchip.c
···144144{145145 struct kvm_kernel_irq_routing_entry *ei;146146 int r;147147+ u32 gsi = array_index_nospec(ue->gsi, KVM_MAX_IRQ_ROUTES);147148148149 /*149150 * Do not allow GSI to be mapped to the same irqchip more than once.150151 * Allow only one to one mapping between GSI and non-irqchip routing.151152 */152152- hlist_for_each_entry(ei, &rt->map[ue->gsi], link)153153+ hlist_for_each_entry(ei, &rt->map[gsi], link)153154 if (ei->type != KVM_IRQ_ROUTING_IRQCHIP ||154155 ue->type != KVM_IRQ_ROUTING_IRQCHIP ||155156 ue->u.irqchip.irqchip == ei->irqchip.irqchip)156157 return -EINVAL;157158158158- e->gsi = ue->gsi;159159+ e->gsi = gsi;159160 e->type = ue->type;160161 r = kvm_set_routing_entry(kvm, e, ue);161162 if (r)
+4-2
virt/kvm/kvm_main.c
···29772977 struct kvm_device_ops *ops = NULL;29782978 struct kvm_device *dev;29792979 bool test = cd->flags & KVM_CREATE_DEVICE_TEST;29802980+ int type;29802981 int ret;2981298229822983 if (cd->type >= ARRAY_SIZE(kvm_device_ops_table))29832984 return -ENODEV;2984298529852985- ops = kvm_device_ops_table[cd->type];29862986+ type = array_index_nospec(cd->type, ARRAY_SIZE(kvm_device_ops_table));29872987+ ops = kvm_device_ops_table[type];29862988 if (ops == NULL)29872989 return -ENODEV;29882990···29992997 dev->kvm = kvm;3000299830012999 mutex_lock(&kvm->lock);30023002- ret = ops->create(dev, cd->type);30003000+ ret = ops->create(dev, type);30033001 if (ret < 0) {30043002 mutex_unlock(&kvm->lock);30053003 kfree(dev);