···25252626- vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock27272828-- kvm->arch.mmu_lock is an rwlock. kvm->arch.tdp_mmu_pages_lock is2929- taken inside kvm->arch.mmu_lock, and cannot be taken without already3030- holding kvm->arch.mmu_lock (typically with ``read_lock``, otherwise3131- there's no need to take kvm->arch.tdp_mmu_pages_lock at all).2828+- kvm->arch.mmu_lock is an rwlock. kvm->arch.tdp_mmu_pages_lock and2929+ kvm->arch.mmu_unsync_pages_lock are taken inside kvm->arch.mmu_lock, and3030+ cannot be taken without already holding kvm->arch.mmu_lock (typically with3131+ ``read_lock`` for the TDP MMU, thus the need for additional spinlocks).32323333Everything else is a leaf: no other lock is taken inside the critical3434sections.
···7070 unsigned long __pad[4]; /* Maintain 16 byte interrupt stack alignment */7171 };7272#endif7373+#if defined(CONFIG_PPC32) && defined(CONFIG_BOOKE)7474+ struct { /* Must be a multiple of 16 bytes */7575+ unsigned long mas0;7676+ unsigned long mas1;7777+ unsigned long mas2;7878+ unsigned long mas3;7979+ unsigned long mas6;8080+ unsigned long mas7;8181+ unsigned long srr0;8282+ unsigned long srr1;8383+ unsigned long csrr0;8484+ unsigned long csrr1;8585+ unsigned long dsrr0;8686+ unsigned long dsrr1;8787+ };8888+#endif7389};7490#endif7591
···292292 if (user_mode(regs))293293 return 0;294294295295- if (!(regs->msr & MSR_IR) || !(regs->msr & MSR_DR))295295+ if (!IS_ENABLED(CONFIG_BOOKE) &&296296+ (!(regs->msr & MSR_IR) || !(regs->msr & MSR_DR)))296297 return 0;297298298299 /*
+1-1
arch/powerpc/kernel/sysfs.c
···11671167 * CPU. For instance, the boot cpu might never be valid11681168 * for hotplugging.11691169 */11701170- if (smp_ops->cpu_offline_self)11701170+ if (smp_ops && smp_ops->cpu_offline_self)11711171 c->hotpluggable = 1;11721172#endif11731173
···11041104 _exception(SIGTRAP, regs, TRAP_UNK, 0);11051105}1106110611071107-DEFINE_INTERRUPT_HANDLER(single_step_exception)11071107+static void __single_step_exception(struct pt_regs *regs)11081108{11091109 clear_single_step(regs);11101110 clear_br_trace(regs);···11211121 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);11221122}1123112311241124+DEFINE_INTERRUPT_HANDLER(single_step_exception)11251125+{11261126+ __single_step_exception(regs);11271127+}11281128+11241129/*11251130 * After we have successfully emulated an instruction, we have to11261131 * check if the instruction was being single-stepped, and if so,···11351130static void emulate_single_step(struct pt_regs *regs)11361131{11371132 if (single_stepping(regs))11381138- single_step_exception(regs);11331133+ __single_step_exception(regs);11391134}1140113511411136static inline int __parse_fpscr(unsigned long fpscr)
+3-2
arch/powerpc/platforms/pseries/setup.c
···539539 * H_CPU_BEHAV_FAVOUR_SECURITY_H could be set only if540540 * H_CPU_BEHAV_FAVOUR_SECURITY is.541541 */542542- if (!(result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY))542542+ if (!(result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)) {543543 security_ftr_clear(SEC_FTR_FAVOUR_SECURITY);544544- else if (result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY_H)544544+ pseries_security_flavor = 0;545545+ } else if (result->behaviour & H_CPU_BEHAV_FAVOUR_SECURITY_H)545546 pseries_security_flavor = 1;546547 else547548 pseries_security_flavor = 2;
+24-11
arch/powerpc/sysdev/xive/common.c
···6767static struct xive_ipi_desc {6868 unsigned int irq;6969 char name[16];7070+ atomic_t started;7071} *xive_ipis;71727273/*···11211120 .alloc = xive_ipi_irq_domain_alloc,11221121};1123112211241124-static int __init xive_request_ipi(void)11231123+static int __init xive_init_ipis(void)11251124{11261125 struct fwnode_handle *fwnode;11271126 struct irq_domain *ipi_domain;···11451144 struct xive_ipi_desc *xid = &xive_ipis[node];11461145 struct xive_ipi_alloc_info info = { node };1147114611481148- /* Skip nodes without CPUs */11491149- if (cpumask_empty(cpumask_of_node(node)))11501150- continue;11511151-11521147 /*11531148 * Map one IPI interrupt per node for all cpus of that node.11541149 * Since the HW interrupt number doesn't have any meaning,···11561159 xid->irq = ret;1157116011581161 snprintf(xid->name, sizeof(xid->name), "IPI-%d", node);11591159-11601160- ret = request_irq(xid->irq, xive_muxed_ipi_action,11611161- IRQF_PERCPU | IRQF_NO_THREAD, xid->name, NULL);11621162-11631163- WARN(ret < 0, "Failed to request IPI %d: %d\n", xid->irq, ret);11641162 }1165116311661164 return ret;···11671175out_free_fwnode:11681176 irq_domain_free_fwnode(fwnode);11691177out:11781178+ return ret;11791179+}11801180+11811181+static int __init xive_request_ipi(unsigned int cpu)11821182+{11831183+ struct xive_ipi_desc *xid = &xive_ipis[early_cpu_to_node(cpu)];11841184+ int ret;11851185+11861186+ if (atomic_inc_return(&xid->started) > 1)11871187+ return 0;11881188+11891189+ ret = request_irq(xid->irq, xive_muxed_ipi_action,11901190+ IRQF_PERCPU | IRQF_NO_THREAD,11911191+ xid->name, NULL);11921192+11931193+ WARN(ret < 0, "Failed to request IPI %d: %d\n", xid->irq, ret);11701194 return ret;11711195}11721196···11991191 /* Check if we are already setup */12001192 if (xc->hw_ipi != XIVE_BAD_IRQ)12011193 return 0;11941194+11951195+ /* Register the IPI */11961196+ xive_request_ipi(cpu);1202119712031198 /* Grab an IPI from the backend, this will populate xc->hw_ipi */12041199 if (xive_ops->get_ipi(cpu, xc))···12421231 if (xc->hw_ipi == XIVE_BAD_IRQ)12431232 return;1244123312341234+ /* TODO: clear IPI mapping */12351235+12451236 /* Mask the IPI */12461237 xive_do_source_set_mask(&xc->ipi_data, true);12471238···12661253 smp_ops->cause_ipi = xive_cause_ipi;1267125412681255 /* Register the IPI */12691269- xive_request_ipi();12561256+ xive_init_ipis();1270125712711258 /* Allocate and setup IPI for the boot CPU */12721259 xive_setup_cpu_ipi(smp_processor_id());
···197197 * if end of dram is equal to maximum addressable memory. For 64-bit198198 * kernel, this problem can't happen here as the end of the virtual199199 * address space is occupied by the kernel mapping then this check must200200- * be done in create_kernel_page_table.200200+ * be done as soon as the kernel mapping base address is determined.201201 */202202 max_mapped_addr = __pa(~(ulong)0);203203 if (max_mapped_addr == (phys_ram_end - 1))
+7
arch/x86/include/asm/kvm_host.h
···10381038 struct list_head lpage_disallowed_mmu_pages;10391039 struct kvm_page_track_notifier_node mmu_sp_tracker;10401040 struct kvm_page_track_notifier_head track_notifier_head;10411041+ /*10421042+ * Protects marking pages unsync during page faults, as TDP MMU page10431043+ * faults only take mmu_lock for read. For simplicity, the unsync10441044+ * pages lock is always taken when marking pages unsync regardless of10451045+ * whether mmu_lock is held for read or write.10461046+ */10471047+ spinlock_t mmu_unsync_pages_lock;1041104810421049 struct list_head assigned_dev_head;10431050 struct iommu_domain *iommu_domain;
···5858 * The quirk bit is not set in this case.5959 * - The new vector is the same as the old vector6060 * - The old vector is MANAGED_IRQ_SHUTDOWN_VECTOR (interrupt starts up)6161+ * - The interrupt is not yet started up6162 * - The new destination CPU is the same as the old destination CPU6263 */6364 if (!irqd_msi_nomask_quirk(irqd) ||6465 cfg->vector == old_cfg.vector ||6566 old_cfg.vector == MANAGED_IRQ_SHUTDOWN_VECTOR ||6767+ !irqd_is_started(irqd) ||6668 cfg->dest_apicid == old_cfg.dest_apicid) {6769 irq_msi_update_msg(irqd, cfg);6870 return ret;···152150 .irq_ack = irq_chip_ack_parent,153151 .irq_retrigger = irq_chip_retrigger_hierarchy,154152 .irq_set_affinity = msi_set_affinity,155155- .flags = IRQCHIP_SKIP_SET_WAKE,153153+ .flags = IRQCHIP_SKIP_SET_WAKE |154154+ IRQCHIP_AFFINITY_PRE_STARTUP,156155};157156158157int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,···222219 .irq_mask = pci_msi_mask_irq,223220 .irq_ack = irq_chip_ack_parent,224221 .irq_retrigger = irq_chip_retrigger_hierarchy,225225- .flags = IRQCHIP_SKIP_SET_WAKE,222222+ .flags = IRQCHIP_SKIP_SET_WAKE |223223+ IRQCHIP_AFFINITY_PRE_STARTUP,226224};227225228226static struct msi_domain_info pci_msi_ir_domain_info = {···277273 .irq_retrigger = irq_chip_retrigger_hierarchy,278274 .irq_compose_msi_msg = dmar_msi_compose_msg,279275 .irq_write_msi_msg = dmar_msi_write_msg,280280- .flags = IRQCHIP_SKIP_SET_WAKE,276276+ .flags = IRQCHIP_SKIP_SET_WAKE |277277+ IRQCHIP_AFFINITY_PRE_STARTUP,281278};282279283280static int dmar_msi_init(struct irq_domain *domain,
+13-14
arch/x86/kernel/cpu/resctrl/monitor.c
···285285 return chunks >>= shift;286286}287287288288-static int __mon_event_count(u32 rmid, struct rmid_read *rr)288288+static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)289289{290290 struct mbm_state *m;291291 u64 chunks, tval;292292293293 tval = __rmid_read(rmid, rr->evtid);294294 if (tval & (RMID_VAL_ERROR | RMID_VAL_UNAVAIL)) {295295- rr->val = tval;296296- return -EINVAL;295295+ return tval;297296 }298297 switch (rr->evtid) {299298 case QOS_L3_OCCUP_EVENT_ID:···304305 case QOS_L3_MBM_LOCAL_EVENT_ID:305306 m = &rr->d->mbm_local[rmid];306307 break;307307- default:308308- /*309309- * Code would never reach here because310310- * an invalid event id would fail the __rmid_read.311311- */312312- return -EINVAL;313308 }314309315310 if (rr->first) {···354361 struct rdtgroup *rdtgrp, *entry;355362 struct rmid_read *rr = info;356363 struct list_head *head;364364+ u64 ret_val;357365358366 rdtgrp = rr->rgrp;359367360360- if (__mon_event_count(rdtgrp->mon.rmid, rr))361361- return;368368+ ret_val = __mon_event_count(rdtgrp->mon.rmid, rr);362369363370 /*364364- * For Ctrl groups read data from child monitor groups.371371+ * For Ctrl groups read data from child monitor groups and372372+ * add them together. Count events which are read successfully.373373+ * Discard the rmid_read's reporting errors.365374 */366375 head = &rdtgrp->mon.crdtgrp_list;367376368377 if (rdtgrp->type == RDTCTRL_GROUP) {369378 list_for_each_entry(entry, head, mon.crdtgrp_list) {370370- if (__mon_event_count(entry->mon.rmid, rr))371371- return;379379+ if (__mon_event_count(entry->mon.rmid, rr) == 0)380380+ ret_val = 0;372381 }373382 }383383+384384+ /* Report error if none of rmid_reads are successful */385385+ if (ret_val)386386+ rr->val = ret_val;374387}375388376389/*
···25352535int mmu_try_to_unsync_pages(struct kvm_vcpu *vcpu, gfn_t gfn, bool can_unsync)25362536{25372537 struct kvm_mmu_page *sp;25382538+ bool locked = false;2538253925392540 /*25402541 * Force write-protection if the page is being tracked. Note, the page···25582557 if (sp->unsync)25592558 continue;2560255925602560+ /*25612561+ * TDP MMU page faults require an additional spinlock as they25622562+ * run with mmu_lock held for read, not write, and the unsync25632563+ * logic is not thread safe. Take the spinklock regardless of25642564+ * the MMU type to avoid extra conditionals/parameters, there's25652565+ * no meaningful penalty if mmu_lock is held for write.25662566+ */25672567+ if (!locked) {25682568+ locked = true;25692569+ spin_lock(&vcpu->kvm->arch.mmu_unsync_pages_lock);25702570+25712571+ /*25722572+ * Recheck after taking the spinlock, a different vCPU25732573+ * may have since marked the page unsync. A false25742574+ * positive on the unprotected check above is not25752575+ * possible as clearing sp->unsync _must_ hold mmu_lock25762576+ * for write, i.e. unsync cannot transition from 0->125772577+ * while this CPU holds mmu_lock for read (or write).25782578+ */25792579+ if (READ_ONCE(sp->unsync))25802580+ continue;25812581+ }25822582+25612583 WARN_ON(sp->role.level != PG_LEVEL_4K);25622584 kvm_unsync_page(vcpu, sp);25632585 }25862586+ if (locked)25872587+ spin_unlock(&vcpu->kvm->arch.mmu_unsync_pages_lock);2564258825652589 /*25662590 * We need to ensure that the marking of unsync pages is visible···55625536void kvm_mmu_init_vm(struct kvm *kvm)55635537{55645538 struct kvm_page_track_notifier_node *node = &kvm->arch.mmu_sp_tracker;55395539+55405540+ spin_lock_init(&kvm->arch.mmu_unsync_pages_lock);5565554155665542 if (!kvm_mmu_init_tdp_mmu(kvm))55675543 /*
+24-11
arch/x86/kvm/mmu/tdp_mmu.c
···4343 if (!kvm->arch.tdp_mmu_enabled)4444 return;45454646+ WARN_ON(!list_empty(&kvm->arch.tdp_mmu_pages));4647 WARN_ON(!list_empty(&kvm->arch.tdp_mmu_roots));47484849 /*···8281void kvm_tdp_mmu_put_root(struct kvm *kvm, struct kvm_mmu_page *root,8382 bool shared)8483{8585- gfn_t max_gfn = 1ULL << (shadow_phys_bits - PAGE_SHIFT);8686-8784 kvm_lockdep_assert_mmu_lock_held(kvm, shared);88858986 if (!refcount_dec_and_test(&root->tdp_mmu_root_count))···9394 list_del_rcu(&root->link);9495 spin_unlock(&kvm->arch.tdp_mmu_pages_lock);95969696- zap_gfn_range(kvm, root, 0, max_gfn, false, false, shared);9797+ zap_gfn_range(kvm, root, 0, -1ull, false, false, shared);97989899 call_rcu(&root->rcu_head, tdp_mmu_free_sp_rcu_callback);99100}···723724 gfn_t start, gfn_t end, bool can_yield, bool flush,724725 bool shared)725726{727727+ gfn_t max_gfn_host = 1ULL << (shadow_phys_bits - PAGE_SHIFT);728728+ bool zap_all = (start == 0 && end >= max_gfn_host);726729 struct tdp_iter iter;730730+731731+ /*732732+ * No need to try to step down in the iterator when zapping all SPTEs,733733+ * zapping the top-level non-leaf SPTEs will recurse on their children.734734+ */735735+ int min_level = zap_all ? root->role.level : PG_LEVEL_4K;736736+737737+ /*738738+ * Bound the walk at host.MAXPHYADDR, guest accesses beyond that will739739+ * hit a #PF(RSVD) and never get to an EPT Violation/Misconfig / #NPF,740740+ * and so KVM will never install a SPTE for such addresses.741741+ */742742+ end = min(end, max_gfn_host);727743728744 kvm_lockdep_assert_mmu_lock_held(kvm, shared);729745730746 rcu_read_lock();731747732732- tdp_root_for_each_pte(iter, root, start, end) {748748+ for_each_tdp_pte_min_level(iter, root->spt, root->role.level,749749+ min_level, start, end) {733750retry:734751 if (can_yield &&735752 tdp_mmu_iter_cond_resched(kvm, &iter, flush, shared)) {···759744 /*760745 * If this is a non-last-level SPTE that covers a larger range761746 * than should be zapped, continue, and zap the mappings at a762762- * lower level.747747+ * lower level, except when zapping all SPTEs.763748 */764764- if ((iter.gfn < start ||749749+ if (!zap_all &&750750+ (iter.gfn < start ||765751 iter.gfn + KVM_PAGES_PER_HPAGE(iter.level) > end) &&766752 !is_last_spte(iter.old_spte, iter.level))767753 continue;···810794811795void kvm_tdp_mmu_zap_all(struct kvm *kvm)812796{813813- gfn_t max_gfn = 1ULL << (shadow_phys_bits - PAGE_SHIFT);814797 bool flush = false;815798 int i;816799817800 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++)818818- flush = kvm_tdp_mmu_zap_gfn_range(kvm, i, 0, max_gfn,801801+ flush = kvm_tdp_mmu_zap_gfn_range(kvm, i, 0, -1ull,819802 flush, false);820803821804 if (flush)···853838 */854839void kvm_tdp_mmu_zap_invalidated_roots(struct kvm *kvm)855840{856856- gfn_t max_gfn = 1ULL << (shadow_phys_bits - PAGE_SHIFT);857841 struct kvm_mmu_page *next_root;858842 struct kvm_mmu_page *root;859843 bool flush = false;···868854869855 rcu_read_unlock();870856871871- flush = zap_gfn_range(kvm, root, 0, max_gfn, true, flush,872872- true);857857+ flush = zap_gfn_range(kvm, root, 0, -1ull, true, flush, true);873858874859 /*875860 * Put the reference acquired in
···10101111/^GNU objdump/ {1212 verstr = ""1313+ gsub(/\(.*\)/, "");1314 for (i = 3; i <= NF; i++)1415 if (match($(i), "^[0-9]")) {1516 verstr = $(i);
-6
block/Kconfig.iosched
···99 help1010 MQ version of the deadline IO scheduler.11111212-config MQ_IOSCHED_DEADLINE_CGROUP1313- tristate1414- default y1515- depends on MQ_IOSCHED_DEADLINE1616- depends on BLK_CGROUP1717-1812config MQ_IOSCHED_KYBER1913 tristate "Kyber I/O scheduler"2014 default y
···818818{819819 struct nbd_cmd *cmd = blk_mq_rq_to_pdu(req);820820821821+ /* don't abort one completed request */822822+ if (blk_mq_request_completed(req))823823+ return true;824824+821825 mutex_lock(&cmd->lock);822826 cmd->status = BLK_STS_IOERR;823827 mutex_unlock(&cmd->lock);···20082004{20092005 mutex_lock(&nbd->config_lock);20102006 nbd_disconnect(nbd);20112011- nbd_clear_sock(nbd);20122012- mutex_unlock(&nbd->config_lock);20072007+ sock_shutdown(nbd);20132008 /*20142009 * Make sure recv thread has finished, so it does not drop the last20152010 * config ref and try to destroy the workqueue from inside the work20162016- * queue.20112011+ * queue. And this also ensure that we can safely call nbd_clear_que()20122012+ * to cancel the inflight I/Os.20172013 */20182014 if (nbd->recv_workq)20192015 flush_workqueue(nbd->recv_workq);20162016+ nbd_clear_que(nbd);20172017+ nbd->task_setup = NULL;20182018+ mutex_unlock(&nbd->config_lock);20192019+20202020 if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,20212021 &nbd->config->runtime_flags))20222022 nbd_config_put(nbd);
+33-6
drivers/block/virtio_blk.c
···692692static unsigned int virtblk_queue_depth;693693module_param_named(queue_depth, virtblk_queue_depth, uint, 0444);694694695695+static int virtblk_validate(struct virtio_device *vdev)696696+{697697+ u32 blk_size;698698+699699+ if (!vdev->config->get) {700700+ dev_err(&vdev->dev, "%s failure: config access disabled\n",701701+ __func__);702702+ return -EINVAL;703703+ }704704+705705+ if (!virtio_has_feature(vdev, VIRTIO_BLK_F_BLK_SIZE))706706+ return 0;707707+708708+ blk_size = virtio_cread32(vdev,709709+ offsetof(struct virtio_blk_config, blk_size));710710+711711+ if (blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE)712712+ __virtio_clear_bit(vdev, VIRTIO_BLK_F_BLK_SIZE);713713+714714+ return 0;715715+}716716+695717static int virtblk_probe(struct virtio_device *vdev)696718{697719 struct virtio_blk *vblk;···724702 u16 min_io_size;725703 u8 physical_block_exp, alignment_offset;726704 unsigned int queue_depth;727727-728728- if (!vdev->config->get) {729729- dev_err(&vdev->dev, "%s failure: config access disabled\n",730730- __func__);731731- return -EINVAL;732732- }733705734706 err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),735707 GFP_KERNEL);···839823 else840824 blk_size = queue_logical_block_size(q);841825826826+ if (unlikely(blk_size < SECTOR_SIZE || blk_size > PAGE_SIZE)) {827827+ dev_err(&vdev->dev,828828+ "block size is changed unexpectedly, now is %u\n",829829+ blk_size);830830+ err = -EINVAL;831831+ goto err_cleanup_disk;832832+ }833833+842834 /* Use topology information if available */843835 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_TOPOLOGY,844836 struct virtio_blk_config, physical_block_exp,···905881 device_add_disk(&vdev->dev, vblk->disk, virtblk_attr_groups);906882 return 0;907883884884+err_cleanup_disk:885885+ blk_cleanup_disk(vblk->disk);908886out_free_tags:909887 blk_mq_free_tag_set(&vblk->tag_set);910888out_free_vq:···1009983 .driver.name = KBUILD_MODNAME,1010984 .driver.owner = THIS_MODULE,1011985 .id_table = id_table,986986+ .validate = virtblk_validate,1012987 .probe = virtblk_probe,1013988 .remove = virtblk_remove,1014989 .config_changed = virtblk_config_changed,
···3535}36363737/*3838- * Although relocatable kernels can fix up the misalignment with respect to3939- * MIN_KIMG_ALIGN, the resulting virtual text addresses are subtly out of4040- * sync with those recorded in the vmlinux when kaslr is disabled but the4141- * image required relocation anyway. Therefore retain 2M alignment unless4242- * KASLR is in use.3838+ * Distro versions of GRUB may ignore the BSS allocation entirely (i.e., fail3939+ * to provide space, and fail to zero it). Check for this condition by double4040+ * checking that the first and the last byte of the image are covered by the4141+ * same EFI memory map entry.4342 */4444-static u64 min_kimg_align(void)4343+static bool check_image_region(u64 base, u64 size)4544{4646- return efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN;4545+ unsigned long map_size, desc_size, buff_size;4646+ efi_memory_desc_t *memory_map;4747+ struct efi_boot_memmap map;4848+ efi_status_t status;4949+ bool ret = false;5050+ int map_offset;5151+5252+ map.map = &memory_map;5353+ map.map_size = &map_size;5454+ map.desc_size = &desc_size;5555+ map.desc_ver = NULL;5656+ map.key_ptr = NULL;5757+ map.buff_size = &buff_size;5858+5959+ status = efi_get_memory_map(&map);6060+ if (status != EFI_SUCCESS)6161+ return false;6262+6363+ for (map_offset = 0; map_offset < map_size; map_offset += desc_size) {6464+ efi_memory_desc_t *md = (void *)memory_map + map_offset;6565+ u64 end = md->phys_addr + md->num_pages * EFI_PAGE_SIZE;6666+6767+ /*6868+ * Find the region that covers base, and return whether6969+ * it covers base+size bytes.7070+ */7171+ if (base >= md->phys_addr && base < end) {7272+ ret = (base + size) <= end;7373+ break;7474+ }7575+ }7676+7777+ efi_bs_call(free_pool, memory_map);7878+7979+ return ret;4780}48814982efi_status_t handle_kernel_image(unsigned long *image_addr,···8855 efi_status_t status;8956 unsigned long kernel_size, kernel_memsize = 0;9057 u32 phys_seed = 0;5858+5959+ /*6060+ * Although relocatable kernels can fix up the misalignment with6161+ * respect to MIN_KIMG_ALIGN, the resulting virtual text addresses are6262+ * subtly out of sync with those recorded in the vmlinux when kaslr is6363+ * disabled but the image required relocation anyway. Therefore retain6464+ * 2M alignment if KASLR was explicitly disabled, even if it was not6565+ * going to be activated to begin with.6666+ */6767+ u64 min_kimg_align = efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN;91689269 if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {9370 if (!efi_nokaslr) {···11976 if (image->image_base != _text)12077 efi_err("FIRMWARE BUG: efi_loaded_image_t::image_base has bogus value\n");121787979+ if (!IS_ALIGNED((u64)_text, EFI_KIMG_ALIGN))8080+ efi_err("FIRMWARE BUG: kernel image not aligned on %ldk boundary\n",8181+ EFI_KIMG_ALIGN >> 10);8282+12283 kernel_size = _edata - _text;12384 kernel_memsize = kernel_size + (_end - _edata);12485 *reserve_size = kernel_memsize;···13285 * If KASLR is enabled, and we have some randomness available,13386 * locate the kernel at a randomized offset in physical memory.13487 */135135- status = efi_random_alloc(*reserve_size, min_kimg_align(),8888+ status = efi_random_alloc(*reserve_size, min_kimg_align,13689 reserve_addr, phys_seed);9090+ if (status != EFI_SUCCESS)9191+ efi_warn("efi_random_alloc() failed: 0x%lx\n", status);13792 } else {13893 status = EFI_OUT_OF_RESOURCES;13994 }1409514196 if (status != EFI_SUCCESS) {142142- if (IS_ALIGNED((u64)_text, min_kimg_align())) {9797+ if (!check_image_region((u64)_text, kernel_memsize)) {9898+ efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n");9999+ } else if (IS_ALIGNED((u64)_text, min_kimg_align)) {143100 /*144101 * Just execute from wherever we were loaded by the145102 * UEFI PE/COFF loader if the alignment is suitable.···154103 }155104156105 status = efi_allocate_pages_aligned(*reserve_size, reserve_addr,157157- ULONG_MAX, min_kimg_align());106106+ ULONG_MAX, min_kimg_align);158107159108 if (status != EFI_SUCCESS) {160109 efi_err("Failed to relocate kernel\n");
···664664665665 adc_period = adc->auto_conversion_period;666666 for (i = 0; i < 16; ++i) {667667- if (((1000 * (1 << i)) / 32) < adc_period)668668- continue;667667+ if (((1000 * (1 << i)) / 32) >= adc_period)668668+ break;669669 }670670 if (i > 0)671671 i--;
-1
drivers/iio/adc/ti-ads7950.c
···568568 st->ring_xfer.tx_buf = &st->tx_buf[0];569569 st->ring_xfer.rx_buf = &st->rx_buf[0];570570 /* len will be set later */571571- st->ring_xfer.cs_change = true;572571573572 spi_message_add_tail(&st->ring_xfer, &st->ring_msg);574573
+4-2
drivers/iio/humidity/hdc100x.c
···2525#include <linux/iio/trigger_consumer.h>2626#include <linux/iio/triggered_buffer.h>27272828+#include <linux/time.h>2929+2830#define HDC100X_REG_TEMP 0x002931#define HDC100X_REG_HUMIDITY 0x013032···168166 struct iio_chan_spec const *chan)169167{170168 struct i2c_client *client = data->client;171171- int delay = data->adc_int_us[chan->address];169169+ int delay = data->adc_int_us[chan->address] + 1*USEC_PER_MSEC;172170 int ret;173171 __be16 val;174172···318316 struct iio_dev *indio_dev = pf->indio_dev;319317 struct hdc100x_data *data = iio_priv(indio_dev);320318 struct i2c_client *client = data->client;321321- int delay = data->adc_int_us[0] + data->adc_int_us[1];319319+ int delay = data->adc_int_us[0] + data->adc_int_us[1] + 2*USEC_PER_MSEC;322320 int ret;323321324322 /* dual read starts at temp register */
+1-2
drivers/iio/imu/adis.c
···411411 int ret;412412413413 /* check if the device has rst pin low */414414- gpio = devm_gpiod_get_optional(&adis->spi->dev, "reset", GPIOD_ASIS);414414+ gpio = devm_gpiod_get_optional(&adis->spi->dev, "reset", GPIOD_OUT_HIGH);415415 if (IS_ERR(gpio))416416 return PTR_ERR(gpio);417417418418 if (gpio) {419419- gpiod_set_value_cansleep(gpio, 1);420419 msleep(10);421420 /* bring device out of reset */422421 gpiod_set_value_cansleep(gpio, 0);
···52525353 /* Kick start the NAPI context so that receiving will start */5454 err = ixgbe_xsk_wakeup(adapter->netdev, qid, XDP_WAKEUP_RX);5555- if (err)5555+ if (err) {5656+ clear_bit(qid, adapter->af_xdp_zc_qps);5757+ xsk_pool_dma_unmap(pool, IXGBE_RX_DMA_ATTR);5658 return err;5959+ }5760 }58615962 return 0;
···64646565int ipc_chnl_cfg_get(struct ipc_chnl_cfg *chnl_cfg, int index)6666{6767- int array_size = ARRAY_SIZE(modem_cfg);6868-6969- if (index >= array_size) {7070- pr_err("index: %d and array_size %d", index, array_size);6767+ if (index >= ARRAY_SIZE(modem_cfg)) {6868+ pr_err("index: %d and array size %zu", index,6969+ ARRAY_SIZE(modem_cfg));7170 return -ECHRNG;7271 }7372
+11-6
drivers/nvdimm/namespace_devs.c
···2527252725282528static int init_active_labels(struct nd_region *nd_region)25292529{25302530- int i;25302530+ int i, rc = 0;2531253125322532 for (i = 0; i < nd_region->ndr_mappings; i++) {25332533 struct nd_mapping *nd_mapping = &nd_region->mapping[i];···25462546 else if (test_bit(NDD_LABELING, &nvdimm->flags))25472547 /* fail, labels needed to disambiguate dpa */;25482548 else25492549- return 0;25492549+ continue;2550255025512551 dev_err(&nd_region->dev, "%s: is %s, failing probe\n",25522552 dev_name(&nd_mapping->nvdimm->dev),25532553 test_bit(NDD_LOCKED, &nvdimm->flags)25542554 ? "locked" : "disabled");25552555- return -ENXIO;25552555+ rc = -ENXIO;25562556+ goto out;25562557 }25572558 nd_mapping->ndd = ndd;25582559 atomic_inc(&nvdimm->busy);···25872586 break;25882587 }2589258825902590- if (i < nd_region->ndr_mappings) {25892589+ if (i < nd_region->ndr_mappings)25902590+ rc = -ENOMEM;25912591+25922592+out:25932593+ if (rc) {25912594 deactivate_labels(nd_region);25922592- return -ENOMEM;25952595+ return rc;25932596 }2594259725952598 return devm_add_action_or_reset(&nd_region->dev, deactivate_labels,25962596- nd_region);25992599+ nd_region);25972600}2598260125992602int nd_region_register_namespaces(struct nd_region *nd_region, int *err)
+78-49
drivers/pci/msi.c
···143143 * reliably as devices without an INTx disable bit will then generate a144144 * level IRQ which will never be cleared.145145 */146146-u32 __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)146146+void __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)147147{148148- u32 mask_bits = desc->masked;148148+ raw_spinlock_t *lock = &desc->dev->msi_lock;149149+ unsigned long flags;149150150151 if (pci_msi_ignore_mask || !desc->msi_attrib.maskbit)151151- return 0;152152+ return;152153153153- mask_bits &= ~mask;154154- mask_bits |= flag;154154+ raw_spin_lock_irqsave(lock, flags);155155+ desc->masked &= ~mask;156156+ desc->masked |= flag;155157 pci_write_config_dword(msi_desc_to_pci_dev(desc), desc->mask_pos,156156- mask_bits);157157-158158- return mask_bits;158158+ desc->masked);159159+ raw_spin_unlock_irqrestore(lock, flags);159160}160161161162static void msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)162163{163163- desc->masked = __pci_msi_desc_mask_irq(desc, mask, flag);164164+ __pci_msi_desc_mask_irq(desc, mask, flag);164165}165166166167static void __iomem *pci_msix_desc_addr(struct msi_desc *desc)···290289 /* Don't touch the hardware now */291290 } else if (entry->msi_attrib.is_msix) {292291 void __iomem *base = pci_msix_desc_addr(entry);292292+ bool unmasked = !(entry->masked & PCI_MSIX_ENTRY_CTRL_MASKBIT);293293294294 if (!base)295295 goto skip;296296297297+ /*298298+ * The specification mandates that the entry is masked299299+ * when the message is modified:300300+ *301301+ * "If software changes the Address or Data value of an302302+ * entry while the entry is unmasked, the result is303303+ * undefined."304304+ */305305+ if (unmasked)306306+ __pci_msix_desc_mask_irq(entry, PCI_MSIX_ENTRY_CTRL_MASKBIT);307307+297308 writel(msg->address_lo, base + PCI_MSIX_ENTRY_LOWER_ADDR);298309 writel(msg->address_hi, base + PCI_MSIX_ENTRY_UPPER_ADDR);299310 writel(msg->data, base + PCI_MSIX_ENTRY_DATA);311311+312312+ if (unmasked)313313+ __pci_msix_desc_mask_irq(entry, 0);314314+315315+ /* Ensure that the writes are visible in the device */316316+ readl(base + PCI_MSIX_ENTRY_DATA);300317 } else {301318 int pos = dev->msi_cap;302319 u16 msgctl;···335316 pci_write_config_word(dev, pos + PCI_MSI_DATA_32,336317 msg->data);337318 }319319+ /* Ensure that the writes are visible in the device */320320+ pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &msgctl);338321 }339322340323skip:···657636 /* Configure MSI capability structure */658637 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);659638 if (ret) {660660- msi_mask_irq(entry, mask, ~mask);639639+ msi_mask_irq(entry, mask, 0);661640 free_msi_irqs(dev);662641 return ret;663642 }664643665644 ret = msi_verify_entries(dev);666645 if (ret) {667667- msi_mask_irq(entry, mask, ~mask);646646+ msi_mask_irq(entry, mask, 0);668647 free_msi_irqs(dev);669648 return ret;670649 }671650672651 ret = populate_msi_sysfs(dev);673652 if (ret) {674674- msi_mask_irq(entry, mask, ~mask);653653+ msi_mask_irq(entry, mask, 0);675654 free_msi_irqs(dev);676655 return ret;677656 }···712691{713692 struct irq_affinity_desc *curmsk, *masks = NULL;714693 struct msi_desc *entry;694694+ void __iomem *addr;715695 int ret, i;716696 int vec_count = pci_msix_vec_count(dev);717697···733711734712 entry->msi_attrib.is_msix = 1;735713 entry->msi_attrib.is_64 = 1;714714+736715 if (entries)737716 entry->msi_attrib.entry_nr = entries[i].entry;738717 else···745722 entry->msi_attrib.default_irq = dev->irq;746723 entry->mask_base = base;747724725725+ addr = pci_msix_desc_addr(entry);726726+ if (addr)727727+ entry->masked = readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL);728728+748729 list_add_tail(&entry->list, dev_to_msi_list(&dev->dev));749730 if (masks)750731 curmsk++;···759732 return ret;760733}761734762762-static void msix_program_entries(struct pci_dev *dev,763763- struct msix_entry *entries)735735+static void msix_update_entries(struct pci_dev *dev, struct msix_entry *entries)764736{765737 struct msi_desc *entry;766766- int i = 0;767767- void __iomem *desc_addr;768738769739 for_each_pci_msi_entry(entry, dev) {770770- if (entries)771771- entries[i++].vector = entry->irq;772772-773773- desc_addr = pci_msix_desc_addr(entry);774774- if (desc_addr)775775- entry->masked = readl(desc_addr +776776- PCI_MSIX_ENTRY_VECTOR_CTRL);777777- else778778- entry->masked = 0;779779-780780- msix_mask_irq(entry, 1);740740+ if (entries) {741741+ entries->vector = entry->irq;742742+ entries++;743743+ }781744 }745745+}746746+747747+static void msix_mask_all(void __iomem *base, int tsize)748748+{749749+ u32 ctrl = PCI_MSIX_ENTRY_CTRL_MASKBIT;750750+ int i;751751+752752+ for (i = 0; i < tsize; i++, base += PCI_MSIX_ENTRY_SIZE)753753+ writel(ctrl, base + PCI_MSIX_ENTRY_VECTOR_CTRL);782754}783755784756/**···794768static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,795769 int nvec, struct irq_affinity *affd)796770{797797- int ret;798798- u16 control;799771 void __iomem *base;772772+ int ret, tsize;773773+ u16 control;800774801801- /* Ensure MSI-X is disabled while it is set up */802802- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);775775+ /*776776+ * Some devices require MSI-X to be enabled before the MSI-X777777+ * registers can be accessed. Mask all the vectors to prevent778778+ * interrupts coming in before they're fully set up.779779+ */780780+ pci_msix_clear_and_set_ctrl(dev, 0, PCI_MSIX_FLAGS_MASKALL |781781+ PCI_MSIX_FLAGS_ENABLE);803782804783 pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &control);805784 /* Request & Map MSI-X table region */806806- base = msix_map_region(dev, msix_table_size(control));807807- if (!base)808808- return -ENOMEM;785785+ tsize = msix_table_size(control);786786+ base = msix_map_region(dev, tsize);787787+ if (!base) {788788+ ret = -ENOMEM;789789+ goto out_disable;790790+ }791791+792792+ /* Ensure that all table entries are masked. */793793+ msix_mask_all(base, tsize);809794810795 ret = msix_setup_entries(dev, base, entries, nvec, affd);811796 if (ret)812812- return ret;797797+ goto out_disable;813798814799 ret = pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);815800 if (ret)···831794 if (ret)832795 goto out_free;833796834834- /*835835- * Some devices require MSI-X to be enabled before we can touch the836836- * MSI-X registers. We need to mask all the vectors to prevent837837- * interrupts coming in before they're fully set up.838838- */839839- pci_msix_clear_and_set_ctrl(dev, 0,840840- PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE);841841-842842- msix_program_entries(dev, entries);797797+ msix_update_entries(dev, entries);843798844799 ret = populate_msi_sysfs(dev);845800 if (ret)···864835865836out_free:866837 free_msi_irqs(dev);838838+839839+out_disable:840840+ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);867841868842 return ret;869843}···962930963931 /* Return the device with MSI unmasked as initial states */964932 mask = msi_mask(desc->msi_attrib.multi_cap);965965- /* Keep cached state to be restored */966966- __pci_msi_desc_mask_irq(desc, mask, ~mask);933933+ msi_mask_irq(desc, mask, 0);967934968935 /* Restore dev->irq to its default pin-assertion IRQ */969936 dev->irq = desc->msi_attrib.default_irq;···10471016 }1048101710491018 /* Return the device with MSI-X masked as initial states */10501050- for_each_pci_msi_entry(entry, dev) {10511051- /* Keep cached states to be restored */10191019+ for_each_pci_msi_entry(entry, dev)10521020 __pci_msix_desc_mask_irq(entry, 1);10531053- }1054102110551022 pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);10561023 pci_intx_for_msi(dev, 1);
···950950 return ret;951951952952 pdata->pclk = devm_clk_get_optional(dev, "pclk");953953- if (!IS_ERR(pdata->pclk))954954- clk_prepare_enable(pdata->pclk);953953+ if (!IS_ERR(pdata->pclk)) {954954+ ret = clk_prepare_enable(pdata->pclk);955955+ if (ret)956956+ goto disable_clk;957957+ }955958956959 pdata->sysctl_map =957960 syscon_regmap_lookup_by_phandle_args(np,958961 "canaan,k210-sysctl-power",959962 1, &pdata->power_offset);960960- if (IS_ERR(pdata->sysctl_map))961961- return PTR_ERR(pdata->sysctl_map);963963+ if (IS_ERR(pdata->sysctl_map)) {964964+ ret = PTR_ERR(pdata->sysctl_map);965965+ goto disable_pclk;966966+ }962967963968 k210_fpioa_init_ties(pdata);964969965970 pdata->pctl = pinctrl_register(&k210_pinctrl_desc, dev, (void *)pdata);966966- if (IS_ERR(pdata->pctl))967967- return PTR_ERR(pdata->pctl);971971+ if (IS_ERR(pdata->pctl)) {972972+ ret = PTR_ERR(pdata->pctl);973973+ goto disable_pclk;974974+ }968975969976 return 0;977977+978978+disable_pclk:979979+ clk_disable_unprepare(pdata->pclk);980980+disable_clk:981981+ clk_disable_unprepare(pdata->clk);982982+983983+ return ret;970984}971985972986static const struct of_device_id k210_fpioa_dt_ids[] = {
+31-32
drivers/pinctrl/qcom/Kconfig
···13131414config PINCTRL_APQ80641515 tristate "Qualcomm APQ8064 pin controller driver"1616- depends on GPIOLIB && OF1616+ depends on OF1717 depends on PINCTRL_MSM1818 help1919 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···21212222config PINCTRL_APQ80842323 tristate "Qualcomm APQ8084 pin controller driver"2424- depends on GPIOLIB && OF2424+ depends on OF2525 depends on PINCTRL_MSM2626 help2727 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···29293030config PINCTRL_IPQ40193131 tristate "Qualcomm IPQ4019 pin controller driver"3232- depends on GPIOLIB && OF3232+ depends on OF3333 depends on PINCTRL_MSM3434 help3535 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···37373838config PINCTRL_IPQ80643939 tristate "Qualcomm IPQ8064 pin controller driver"4040- depends on GPIOLIB && OF4040+ depends on OF4141 depends on PINCTRL_MSM4242 help4343 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···45454646config PINCTRL_IPQ80744747 tristate "Qualcomm Technologies, Inc. IPQ8074 pin controller driver"4848- depends on GPIOLIB && OF4848+ depends on OF4949 depends on PINCTRL_MSM5050 help5151 This is the pinctrl, pinmux, pinconf and gpiolib driver for···55555656config PINCTRL_IPQ60185757 tristate "Qualcomm Technologies, Inc. IPQ6018 pin controller driver"5858- depends on GPIOLIB && OF5858+ depends on OF5959 depends on PINCTRL_MSM6060 help6161 This is the pinctrl, pinmux, pinconf and gpiolib driver for···65656666config PINCTRL_MSM82266767 tristate "Qualcomm 8226 pin controller driver"6868- depends on GPIOLIB && OF6868+ depends on OF6969 depends on PINCTRL_MSM7070 help7171 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···74747575config PINCTRL_MSM86607676 tristate "Qualcomm 8660 pin controller driver"7777- depends on GPIOLIB && OF7777+ depends on OF7878 depends on PINCTRL_MSM7979 help8080 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···82828383config PINCTRL_MSM89608484 tristate "Qualcomm 8960 pin controller driver"8585- depends on GPIOLIB && OF8585+ depends on OF8686 depends on PINCTRL_MSM8787 help8888 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···90909191config PINCTRL_MDM96159292 tristate "Qualcomm 9615 pin controller driver"9393- depends on GPIOLIB && OF9393+ depends on OF9494 depends on PINCTRL_MSM9595 help9696 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···98989999config PINCTRL_MSM8X74100100 tristate "Qualcomm 8x74 pin controller driver"101101- depends on GPIOLIB && OF101101+ depends on OF102102 depends on PINCTRL_MSM103103 help104104 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···106106107107config PINCTRL_MSM8916108108 tristate "Qualcomm 8916 pin controller driver"109109- depends on GPIOLIB && OF109109+ depends on OF110110 depends on PINCTRL_MSM111111 help112112 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···114114115115config PINCTRL_MSM8953116116 tristate "Qualcomm 8953 pin controller driver"117117- depends on GPIOLIB && OF117117+ depends on OF118118 depends on PINCTRL_MSM119119 help120120 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···124124125125config PINCTRL_MSM8976126126 tristate "Qualcomm 8976 pin controller driver"127127- depends on GPIOLIB && OF127127+ depends on OF128128 depends on PINCTRL_MSM129129 help130130 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···134134135135config PINCTRL_MSM8994136136 tristate "Qualcomm 8994 pin controller driver"137137- depends on GPIOLIB && OF137137+ depends on OF138138 depends on PINCTRL_MSM139139 help140140 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···143143144144config PINCTRL_MSM8996145145 tristate "Qualcomm MSM8996 pin controller driver"146146- depends on GPIOLIB && OF146146+ depends on OF147147 depends on PINCTRL_MSM148148 help149149 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···151151152152config PINCTRL_MSM8998153153 tristate "Qualcomm MSM8998 pin controller driver"154154- depends on GPIOLIB && OF154154+ depends on OF155155 depends on PINCTRL_MSM156156 help157157 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···159159160160config PINCTRL_QCS404161161 tristate "Qualcomm QCS404 pin controller driver"162162- depends on GPIOLIB && OF162162+ depends on OF163163 depends on PINCTRL_MSM164164 help165165 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···167167168168config PINCTRL_QDF2XXX169169 tristate "Qualcomm Technologies QDF2xxx pin controller driver"170170- depends on GPIOLIB && ACPI170170+ depends on ACPI171171 depends on PINCTRL_MSM172172 help173173 This is the GPIO driver for the TLMM block found on the···175175176176config PINCTRL_QCOM_SPMI_PMIC177177 tristate "Qualcomm SPMI PMIC pin controller driver"178178- depends on GPIOLIB && OF && SPMI178178+ depends on OF && SPMI179179 select REGMAP_SPMI180180 select PINMUX181181 select PINCONF···190190191191config PINCTRL_QCOM_SSBI_PMIC192192 tristate "Qualcomm SSBI PMIC pin controller driver"193193- depends on GPIOLIB && OF193193+ depends on OF194194 select PINMUX195195 select PINCONF196196 select GENERIC_PINCONF···204204205205config PINCTRL_SC7180206206 tristate "Qualcomm Technologies Inc SC7180 pin controller driver"207207- depends on GPIOLIB && OF207207+ depends on OF208208 depends on PINCTRL_MSM209209 help210210 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···213213214214config PINCTRL_SC7280215215 tristate "Qualcomm Technologies Inc SC7280 pin controller driver"216216- depends on GPIOLIB && OF216216+ depends on OF217217 depends on PINCTRL_MSM218218 help219219 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···222222223223config PINCTRL_SC8180X224224 tristate "Qualcomm Technologies Inc SC8180x pin controller driver"225225- depends on GPIOLIB && (OF || ACPI)225225+ depends on (OF || ACPI)226226 depends on PINCTRL_MSM227227 help228228 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···231231232232config PINCTRL_SDM660233233 tristate "Qualcomm Technologies Inc SDM660 pin controller driver"234234- depends on GPIOLIB && OF234234+ depends on OF235235 depends on PINCTRL_MSM236236 help237237 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···240240241241config PINCTRL_SDM845242242 tristate "Qualcomm Technologies Inc SDM845 pin controller driver"243243- depends on GPIOLIB && (OF || ACPI)243243+ depends on (OF || ACPI)244244 depends on PINCTRL_MSM245245 help246246 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···249249250250config PINCTRL_SDX55251251 tristate "Qualcomm Technologies Inc SDX55 pin controller driver"252252- depends on GPIOLIB && OF252252+ depends on OF253253 depends on PINCTRL_MSM254254 help255255 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···258258259259config PINCTRL_SM6125260260 tristate "Qualcomm Technologies Inc SM6125 pin controller driver"261261- depends on GPIOLIB && OF261261+ depends on OF262262 depends on PINCTRL_MSM263263 help264264 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···267267268268config PINCTRL_SM8150269269 tristate "Qualcomm Technologies Inc SM8150 pin controller driver"270270- depends on GPIOLIB && OF270270+ depends on OF271271 depends on PINCTRL_MSM272272 help273273 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···276276277277config PINCTRL_SM8250278278 tristate "Qualcomm Technologies Inc SM8250 pin controller driver"279279- depends on GPIOLIB && OF279279+ depends on OF280280 depends on PINCTRL_MSM281281 help282282 This is the pinctrl, pinmux, pinconf and gpiolib driver for the···285285286286config PINCTRL_SM8350287287 tristate "Qualcomm Technologies Inc SM8350 pin controller driver"288288- depends on GPIOLIB && OF289289- select PINCTRL_MSM288288+ depends on PINCTRL_MSM290289 help291290 This is the pinctrl, pinmux, pinconf and gpiolib driver for the292291 Qualcomm Technologies Inc TLMM block found on the Qualcomm
+5-3
drivers/pinctrl/sunxi/pinctrl-sunxi.c
···12191219 }1220122012211221 /*12221222- * We suppose that we won't have any more functions than pins,12231223- * we'll reallocate that later anyway12221222+ * Find an upper bound for the maximum number of functions: in12231223+ * the worst case we have gpio_in, gpio_out, irq and up to four12241224+ * special functions per pin, plus one entry for the sentinel.12251225+ * We'll reallocate that later anyway.12241226 */12251225- pctl->functions = kcalloc(pctl->ngroups,12271227+ pctl->functions = kcalloc(4 * pctl->ngroups + 4,12261228 sizeof(*pctl->functions),12271229 GFP_KERNEL);12281230 if (!pctl->functions)
···140140 }}141141142142static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {143143+ DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M S2H V2"),143144 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE"),144145 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE V2"),145146 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 GAMING X V2"),···148147 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M DS3H"),149148 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z390 I AORUS PRO WIFI-CF"),150149 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 AORUS ELITE"),150150+ DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 GAMING X"),151151 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 I AORUS PRO WIFI"),152152 DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 UD"),153153 { }
+2-1
drivers/ptp/Kconfig
···103103config PTP_1588_CLOCK_PCH104104 tristate "Intel PCH EG20T as PTP clock"105105 depends on X86_32 || COMPILE_TEST106106- depends on HAS_IOMEM && NET106106+ depends on HAS_IOMEM && PCI107107+ depends on NET107108 depends on PTP_1588_CLOCK108109 help109110 This driver adds support for using the PCH EG20T as a PTP
···614614 long pinned;615615 int ret = 0;616616617617- if (msg->iova < v->range.first ||617617+ if (msg->iova < v->range.first || !msg->size ||618618+ msg->iova > U64_MAX - msg->size + 1 ||618619 msg->iova + msg->size - 1 > v->range.last)619620 return -EINVAL;620621
+8-2
drivers/vhost/vhost.c
···735735 (sz + VHOST_PAGE_SIZE * 8 - 1) / VHOST_PAGE_SIZE / 8);736736}737737738738+/* Make sure 64 bit math will not overflow. */738739static bool vhost_overflow(u64 uaddr, u64 size)739740{740740- /* Make sure 64 bit math will not overflow. */741741- return uaddr > ULONG_MAX || size > ULONG_MAX || uaddr > ULONG_MAX - size;741741+ if (uaddr > ULONG_MAX || size > ULONG_MAX)742742+ return true;743743+744744+ if (!size)745745+ return false;746746+747747+ return uaddr > ULONG_MAX - size + 1;742748}743749744750/* Caller should have vq mutex and device mutex. */
+1-1
drivers/vhost/vringh.c
···359359 iov = wiov;360360 else {361361 iov = riov;362362- if (unlikely(wiov && wiov->i)) {362362+ if (unlikely(wiov && wiov->used)) {363363 vringh_bad("Readable desc %p after writable",364364 &descs[i]);365365 err = -EINVAL;
+1
drivers/virtio/virtio.c
···355355 virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);356356357357 INIT_LIST_HEAD(&dev->vqs);358358+ spin_lock_init(&dev->vqs_list_lock);358359359360 /*360361 * device_add() causes the bus infrastructure to look for a matching
+7
drivers/virtio/virtio_pci_common.c
···576576 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);577577 struct device *dev = get_device(&vp_dev->vdev.dev);578578579579+ /*580580+ * Device is marked broken on surprise removal so that virtio upper581581+ * layers can abort any ongoing operation.582582+ */583583+ if (!pci_device_is_present(pci_dev))584584+ virtio_break_device(&vp_dev->vdev);585585+579586 pci_disable_sriov(pci_dev);580587581588 unregister_virtio_device(&vp_dev->vdev);
···151151 if (!name)152152 return NULL;153153154154+ if (index >= vdpa->nvqs)155155+ return ERR_PTR(-ENOENT);156156+154157 /* Queue shouldn't already be set up. */155158 if (ops->get_vq_ready(vdpa, index))156159 return ERR_PTR(-ENOENT);
+15-7
drivers/xen/events/events_base.c
···198198199199static DEFINE_PER_CPU(unsigned int, irq_epoch);200200201201-static void clear_evtchn_to_irq_row(unsigned row)201201+static void clear_evtchn_to_irq_row(int *evtchn_row)202202{203203 unsigned col;204204205205 for (col = 0; col < EVTCHN_PER_ROW; col++)206206- WRITE_ONCE(evtchn_to_irq[row][col], -1);206206+ WRITE_ONCE(evtchn_row[col], -1);207207}208208209209static void clear_evtchn_to_irq_all(void)···213213 for (row = 0; row < EVTCHN_ROW(xen_evtchn_max_channels()); row++) {214214 if (evtchn_to_irq[row] == NULL)215215 continue;216216- clear_evtchn_to_irq_row(row);216216+ clear_evtchn_to_irq_row(evtchn_to_irq[row]);217217 }218218}219219···221221{222222 unsigned row;223223 unsigned col;224224+ int *evtchn_row;224225225226 if (evtchn >= xen_evtchn_max_channels())226227 return -EINVAL;···234233 if (irq == -1)235234 return 0;236235237237- evtchn_to_irq[row] = (int *)get_zeroed_page(GFP_KERNEL);238238- if (evtchn_to_irq[row] == NULL)236236+ evtchn_row = (int *) __get_free_pages(GFP_KERNEL, 0);237237+ if (evtchn_row == NULL)239238 return -ENOMEM;240239241241- clear_evtchn_to_irq_row(row);240240+ clear_evtchn_to_irq_row(evtchn_row);241241+242242+ /*243243+ * We've prepared an empty row for the mapping. If a different244244+ * thread was faster inserting it, we can drop ours.245245+ */246246+ if (cmpxchg(&evtchn_to_irq[row], NULL, evtchn_row) != NULL)247247+ free_page((unsigned long) evtchn_row);242248 }243249244250 WRITE_ONCE(evtchn_to_irq[row][col], irq);···10171009int xen_bind_pirq_gsi_to_irq(unsigned gsi,10181010 unsigned pirq, int shareable, char *name)10191011{10201020- int irq = -1;10121012+ int irq;10211013 struct physdev_irq irq_op;10221014 int ret;10231015
+8-2
fs/btrfs/inode.c
···92269226 bool dest_log_pinned = false;92279227 bool need_abort = false;9228922892299229- /* we only allow rename subvolume link between subvolumes */92309230- if (old_ino != BTRFS_FIRST_FREE_OBJECTID && root != dest)92299229+ /*92309230+ * For non-subvolumes allow exchange only within one subvolume, in the92319231+ * same inode namespace. Two subvolumes (represented as directory) can92329232+ * be exchanged as they're a logical link and have a fixed inode number.92339233+ */92349234+ if (root != dest &&92359235+ (old_ino != BTRFS_FIRST_FREE_OBJECTID ||92369236+ new_ino != BTRFS_FIRST_FREE_OBJECTID))92319237 return -EXDEV;9232923892339239 /* close the race window with snapshot create/destroy ioctl */
+5
fs/cifs/cifsglob.h
···16111611 int ttl;16121612};1613161316141614+struct file_list {16151615+ struct list_head list;16161616+ struct cifsFileInfo *cfile;16171617+};16181618+16141619/*16151620 * common struct for holding inode info when searching for or updating an16161621 * inode with new info
+1-1
fs/cifs/dir.c
···100100 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)101101 pplen = cifs_sb->prepath ? strlen(cifs_sb->prepath) + 1 : 0;102102103103- s = dentry_path_raw(direntry, page, PAGE_SIZE);103103+ s = dentry_path_raw(direntry, page, PATH_MAX);104104 if (IS_ERR(s))105105 return s;106106 if (!s[1]) // for root we want "", not "/"
+17-18
fs/cifs/file.c
···4848484848494849oplock_break_ack:48504850 /*48514851+ * When oplock break is received and there are no active48524852+ * file handles but cached, then schedule deferred close immediately.48534853+ * So, new open will not use cached handle.48544854+ */48554855+ spin_lock(&CIFS_I(inode)->deferred_lock);48564856+ is_deferred = cifs_is_deferred_close(cfile, &dclose);48574857+ spin_unlock(&CIFS_I(inode)->deferred_lock);48584858+ if (is_deferred &&48594859+ cfile->deferred_close_scheduled &&48604860+ delayed_work_pending(&cfile->deferred)) {48614861+ if (cancel_delayed_work(&cfile->deferred)) {48624862+ _cifsFileInfo_put(cfile, false, false);48634863+ goto oplock_break_done;48644864+ }48654865+ }48664866+ /*48514867 * releasing stale oplock after recent reconnect of smb session using48524868 * a now incorrect file handle is not a data integrity issue but do48534869 * not bother sending an oplock release if session to server still is···48744858 cinode);48754859 cifs_dbg(FYI, "Oplock release rc = %d\n", rc);48764860 }48774877- /*48784878- * When oplock break is received and there are no active48794879- * file handles but cached, then schedule deferred close immediately.48804880- * So, new open will not use cached handle.48814881- */48824882- spin_lock(&CIFS_I(inode)->deferred_lock);48834883- is_deferred = cifs_is_deferred_close(cfile, &dclose);48844884- if (is_deferred &&48854885- cfile->deferred_close_scheduled &&48864886- delayed_work_pending(&cfile->deferred)) {48874887- /*48884888- * If there is no pending work, mod_delayed_work queues new work.48894889- * So, Increase the ref count to avoid use-after-free.48904890- */48914891- if (!mod_delayed_work(deferredclose_wq, &cfile->deferred, 0))48924892- cifsFileInfo_get(cfile);48934893- }48944894- spin_unlock(&CIFS_I(inode)->deferred_lock);48614861+oplock_break_done:48954862 _cifsFileInfo_put(cfile, false /* do not wait for ourself */, false);48964863 cifs_done_oplock_break(cinode);48974864}
+17-2
fs/cifs/inode.c
···16251625 goto unlink_out;16261626 }1627162716281628- cifs_close_all_deferred_files(tcon);16281628+ cifs_close_deferred_file(CIFS_I(inode));16291629 if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &16301630 le64_to_cpu(tcon->fsUnixInfo.Capability))) {16311631 rc = CIFSPOSIXDelFile(xid, tcon, full_path,···20842084 FILE_UNIX_BASIC_INFO *info_buf_target;20852085 unsigned int xid;20862086 int rc, tmprc;20872087+ int retry_count = 0;2087208820882089 if (flags & ~RENAME_NOREPLACE)20892090 return -EINVAL;···21142113 goto cifs_rename_exit;21152114 }2116211521172117- cifs_close_all_deferred_files(tcon);21162116+ cifs_close_deferred_file(CIFS_I(d_inode(source_dentry)));21172117+ if (d_inode(target_dentry) != NULL)21182118+ cifs_close_deferred_file(CIFS_I(d_inode(target_dentry)));21192119+21182120 rc = cifs_do_rename(xid, source_dentry, from_name, target_dentry,21192121 to_name);21222122+21232123+ if (rc == -EACCES) {21242124+ while (retry_count < 3) {21252125+ cifs_close_all_deferred_files(tcon);21262126+ rc = cifs_do_rename(xid, source_dentry, from_name, target_dentry,21272127+ to_name);21282128+ if (rc != -EACCES)21292129+ break;21302130+ retry_count++;21312131+ }21322132+ }2120213321212134 /*21222135 * No-replace is the natural behavior for CIFS, so skip unlink hacks.
+39-11
fs/cifs/misc.c
···723723cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode)724724{725725 struct cifsFileInfo *cfile = NULL;726726- struct cifs_deferred_close *dclose;726726+ struct file_list *tmp_list, *tmp_next_list;727727+ struct list_head file_head;727728729729+ if (cifs_inode == NULL)730730+ return;731731+732732+ INIT_LIST_HEAD(&file_head);733733+ spin_lock(&cifs_inode->open_file_lock);728734 list_for_each_entry(cfile, &cifs_inode->openFileList, flist) {729729- spin_lock(&cifs_inode->deferred_lock);730730- if (cifs_is_deferred_close(cfile, &dclose))731731- mod_delayed_work(deferredclose_wq, &cfile->deferred, 0);732732- spin_unlock(&cifs_inode->deferred_lock);735735+ if (delayed_work_pending(&cfile->deferred)) {736736+ if (cancel_delayed_work(&cfile->deferred)) {737737+ tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);738738+ if (tmp_list == NULL)739739+ continue;740740+ tmp_list->cfile = cfile;741741+ list_add_tail(&tmp_list->list, &file_head);742742+ }743743+ }744744+ }745745+ spin_unlock(&cifs_inode->open_file_lock);746746+747747+ list_for_each_entry_safe(tmp_list, tmp_next_list, &file_head, list) {748748+ _cifsFileInfo_put(tmp_list->cfile, true, false);749749+ list_del(&tmp_list->list);750750+ kfree(tmp_list);733751 }734752}735753···756738{757739 struct cifsFileInfo *cfile;758740 struct list_head *tmp;741741+ struct file_list *tmp_list, *tmp_next_list;742742+ struct list_head file_head;759743744744+ INIT_LIST_HEAD(&file_head);760745 spin_lock(&tcon->open_file_lock);761746 list_for_each(tmp, &tcon->openFileList) {762747 cfile = list_entry(tmp, struct cifsFileInfo, tlist);763748 if (delayed_work_pending(&cfile->deferred)) {764764- /*765765- * If there is no pending work, mod_delayed_work queues new work.766766- * So, Increase the ref count to avoid use-after-free.767767- */768768- if (!mod_delayed_work(deferredclose_wq, &cfile->deferred, 0))769769- cifsFileInfo_get(cfile);749749+ if (cancel_delayed_work(&cfile->deferred)) {750750+ tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);751751+ if (tmp_list == NULL)752752+ continue;753753+ tmp_list->cfile = cfile;754754+ list_add_tail(&tmp_list->list, &file_head);755755+ }770756 }771757 }772758 spin_unlock(&tcon->open_file_lock);759759+760760+ list_for_each_entry_safe(tmp_list, tmp_next_list, &file_head, list) {761761+ _cifsFileInfo_put(tmp_list->cfile, true, false);762762+ list_del(&tmp_list->list);763763+ kfree(tmp_list);764764+ }773765}774766775767/* parses DFS refferal V3 structure
···7878#include <linux/task_work.h>7979#include <linux/pagemap.h>8080#include <linux/io_uring.h>8181+#include <linux/tracehook.h>81828283#define CREATE_TRACE_POINTS8384#include <trace/events/io_uring.h>···15001499 all_flushed = list_empty(&ctx->cq_overflow_list);15011500 if (all_flushed) {15021501 clear_bit(0, &ctx->check_cq_overflow);15031503- ctx->rings->sq_flags &= ~IORING_SQ_CQ_OVERFLOW;15021502+ WRITE_ONCE(ctx->rings->sq_flags,15031503+ ctx->rings->sq_flags & ~IORING_SQ_CQ_OVERFLOW);15041504 }1505150515061506 if (posted)···15801578 }15811579 if (list_empty(&ctx->cq_overflow_list)) {15821580 set_bit(0, &ctx->check_cq_overflow);15831583- ctx->rings->sq_flags |= IORING_SQ_CQ_OVERFLOW;15811581+ WRITE_ONCE(ctx->rings->sq_flags,15821582+ ctx->rings->sq_flags | IORING_SQ_CQ_OVERFLOW);15831583+15841584 }15851585 ocqe->cqe.user_data = user_data;15861586 ocqe->cqe.res = res;···2226222222272223static inline bool io_run_task_work(void)22282224{22292229- if (current->task_works) {22252225+ if (test_thread_flag(TIF_NOTIFY_SIGNAL) || current->task_works) {22302226 __set_current_state(TASK_RUNNING);22312231- task_work_run();22272227+ tracehook_notify_signal();22322228 return true;22332229 }22342230···68076803{68086804 /* Tell userspace we may need a wakeup call */68096805 spin_lock_irq(&ctx->completion_lock);68106810- ctx->rings->sq_flags |= IORING_SQ_NEED_WAKEUP;68066806+ WRITE_ONCE(ctx->rings->sq_flags,68076807+ ctx->rings->sq_flags | IORING_SQ_NEED_WAKEUP);68116808 spin_unlock_irq(&ctx->completion_lock);68126809}6813681068146811static inline void io_ring_clear_wakeup_flag(struct io_ring_ctx *ctx)68156812{68166813 spin_lock_irq(&ctx->completion_lock);68176817- ctx->rings->sq_flags &= ~IORING_SQ_NEED_WAKEUP;68146814+ WRITE_ONCE(ctx->rings->sq_flags,68156815+ ctx->rings->sq_flags & ~IORING_SQ_NEED_WAKEUP);68186816 spin_unlock_irq(&ctx->completion_lock);68196817}68206818···71387132 return table;71397133}7140713471417141-static inline void io_rsrc_ref_lock(struct io_ring_ctx *ctx)71427142-{71437143- spin_lock_bh(&ctx->rsrc_ref_lock);71447144-}71457145-71467146-static inline void io_rsrc_ref_unlock(struct io_ring_ctx *ctx)71477147-{71487148- spin_unlock_bh(&ctx->rsrc_ref_lock);71497149-}71507150-71517135static void io_rsrc_node_destroy(struct io_rsrc_node *ref_node)71527136{71537137 percpu_ref_exit(&ref_node->refs);···71547158 struct io_rsrc_node *rsrc_node = ctx->rsrc_node;7155715971567160 rsrc_node->rsrc_data = data_to_kill;71577157- io_rsrc_ref_lock(ctx);71617161+ spin_lock_irq(&ctx->rsrc_ref_lock);71587162 list_add_tail(&rsrc_node->node, &ctx->rsrc_ref_list);71597159- io_rsrc_ref_unlock(ctx);71637163+ spin_unlock_irq(&ctx->rsrc_ref_lock);7160716471617165 atomic_inc(&data_to_kill->refs);71627166 percpu_ref_kill(&rsrc_node->refs);···71957199 /* kill initial ref, already quiesced if zero */71967200 if (atomic_dec_and_test(&data->refs))71977201 break;72027202+ mutex_unlock(&ctx->uring_lock);71987203 flush_delayed_work(&ctx->rsrc_put_work);71997204 ret = wait_for_completion_interruptible(&data->done);72007200- if (!ret)72057205+ if (!ret) {72067206+ mutex_lock(&ctx->uring_lock);72017207 break;72087208+ }7202720972037210 atomic_inc(&data->refs);72047211 /* wait for all works potentially completing data->done */72057212 flush_delayed_work(&ctx->rsrc_put_work);72067213 reinit_completion(&data->done);7207721472087208- mutex_unlock(&ctx->uring_lock);72097215 ret = io_run_task_work_sig();72107216 mutex_lock(&ctx->uring_lock);72117217 } while (ret >= 0);···76667668{76677669 struct io_rsrc_node *node = container_of(ref, struct io_rsrc_node, refs);76687670 struct io_ring_ctx *ctx = node->rsrc_data->ctx;76717671+ unsigned long flags;76697672 bool first_add = false;7670767376717671- io_rsrc_ref_lock(ctx);76747674+ spin_lock_irqsave(&ctx->rsrc_ref_lock, flags);76727675 node->done = true;7673767676747677 while (!list_empty(&ctx->rsrc_ref_list)) {···76817682 list_del(&node->node);76827683 first_add |= llist_add(&node->llist, &ctx->rsrc_put_llist);76837684 }76847684- io_rsrc_ref_unlock(ctx);76857685+ spin_unlock_irqrestore(&ctx->rsrc_ref_lock, flags);7685768676867687 if (first_add)76877688 mod_delayed_work(system_wq, &ctx->rsrc_put_work, HZ);···86528653 mutex_unlock(&ctx->uring_lock);86538654}8654865586558655-static bool io_wait_rsrc_data(struct io_rsrc_data *data)86568656+static void io_wait_rsrc_data(struct io_rsrc_data *data)86568657{86578657- if (!data)86588658- return false;86598659- if (!atomic_dec_and_test(&data->refs))86588658+ if (data && !atomic_dec_and_test(&data->refs))86608659 wait_for_completion(&data->done);86618661- return true;86628660}8663866186648662static void io_ring_ctx_free(struct io_ring_ctx *ctx)···86678671 ctx->mm_account = NULL;86688672 }8669867386748674+ /* __io_rsrc_put_work() may need uring_lock to progress, wait w/o it */86758675+ io_wait_rsrc_data(ctx->buf_data);86768676+ io_wait_rsrc_data(ctx->file_data);86778677+86708678 mutex_lock(&ctx->uring_lock);86718671- if (io_wait_rsrc_data(ctx->buf_data))86798679+ if (ctx->buf_data)86728680 __io_sqe_buffers_unregister(ctx);86738673- if (io_wait_rsrc_data(ctx->file_data))86818681+ if (ctx->file_data)86748682 __io_sqe_files_unregister(ctx);86758683 if (ctx->rings)86768684 __io_cqring_overflow_flush(ctx, true);
+9-6
fs/pipe.c
···444444#endif445445446446 /*447447- * Epoll nonsensically wants a wakeup whether the pipe448448- * was already empty or not.449449- *450447 * If it wasn't empty we try to merge new data into451448 * the last buffer.452449 *···452455 * spanning multiple pages.453456 */454457 head = pipe->head;455455- was_empty = true;458458+ was_empty = pipe_empty(head, pipe->tail);456459 chars = total_len & (PAGE_SIZE-1);457457- if (chars && !pipe_empty(head, pipe->tail)) {460460+ if (chars && !was_empty) {458461 unsigned int mask = pipe->ring_size - 1;459462 struct pipe_buffer *buf = &pipe->bufs[(head - 1) & mask];460463 int offset = buf->offset + buf->len;···587590 * This is particularly important for small writes, because of588591 * how (for example) the GNU make jobserver uses small writes to589592 * wake up pending jobs593593+ *594594+ * Epoll nonsensically wants a wakeup whether the pipe595595+ * was already empty or not.590596 */591591- if (was_empty) {597597+ if (was_empty || pipe->poll_usage) {592598 wake_up_interruptible_sync_poll(&pipe->rd_wait, EPOLLIN | EPOLLRDNORM);593599 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);594600 }···653653 __poll_t mask;654654 struct pipe_inode_info *pipe = filp->private_data;655655 unsigned int head, tail;656656+657657+ /* Epoll has some historical nasty semantics, this enables them */658658+ pipe->poll_usage = 1;656659657660 /*658661 * Reading pipe state only -- no need for acquiring the semaphore.
+2
include/linux/device.h
···407407 * @em_pd: device's energy model performance domain408408 * @pins: For device pin management.409409 * See Documentation/driver-api/pin-control.rst for details.410410+ * @msi_lock: Lock to protect MSI mask cache and mask register410411 * @msi_list: Hosts MSI descriptors411412 * @msi_domain: The generic MSI domain this device is using.412413 * @numa_node: NUMA node this device is close to.···507506 struct dev_pin_info *pins;508507#endif509508#ifdef CONFIG_GENERIC_MSI_IRQ509509+ raw_spinlock_t msi_lock;510510 struct list_head msi_list;511511#endif512512#ifdef CONFIG_DMA_OPS
+2
include/linux/irq.h
···569569 * IRQCHIP_SUPPORTS_NMI: Chip can deliver NMIs, only for root irqchips570570 * IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND: Invokes __enable_irq()/__disable_irq() for wake irqs571571 * in the suspend path if they are in disabled state572572+ * IRQCHIP_AFFINITY_PRE_STARTUP: Default affinity update before startup572573 */573574enum {574575 IRQCHIP_SET_TYPE_MASKED = (1 << 0),···582581 IRQCHIP_SUPPORTS_LEVEL_MSI = (1 << 7),583582 IRQCHIP_SUPPORTS_NMI = (1 << 8),584583 IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND = (1 << 9),584584+ IRQCHIP_AFFINITY_PRE_STARTUP = (1 << 10),585585};586586587587#include <linux/irqdesc.h>
···4848 * @files: number of struct file referring this pipe (protected by ->i_lock)4949 * @r_counter: reader counter5050 * @w_counter: writer counter5151+ * @poll_usage: is this pipe used for epoll, which has crazy wakeups?5152 * @fasync_readers: reader side fasync5253 * @fasync_writers: writer side fasync5354 * @bufs: the circular array of pipe buffers···7170 unsigned int files;7271 unsigned int r_counter;7372 unsigned int w_counter;7373+ unsigned int poll_usage;7474 struct page *tmp_page;7575 struct fasync_struct *fasync_readers;7676 struct fasync_struct *fasync_writers;
+11
include/linux/vdpa.h
···277277 const struct vdpa_config_ops *config,278278 size_t size, const char *name);279279280280+/**281281+ * vdpa_alloc_device - allocate and initilaize a vDPA device282282+ *283283+ * @dev_struct: the type of the parent structure284284+ * @member: the name of struct vdpa_device within the @dev_struct285285+ * @parent: the parent device286286+ * @config: the bus operations that is supported by this device287287+ * @name: name of the vdpa device288288+ *289289+ * Return allocated data structure or ERR_PTR upon error290290+ */280291#define vdpa_alloc_device(dev_struct, member, parent, config, name) \281292 container_of(__vdpa_alloc_device( \282293 parent, config, \
···319319 if (flow_offload_has_one_action(action))320320 return true;321321322322- if (action) {323323- flow_action_for_each(i, action_entry, action) {324324- if (i && action_entry->hw_stats != last_hw_stats) {325325- NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");326326- return false;327327- }328328- last_hw_stats = action_entry->hw_stats;322322+ flow_action_for_each(i, action_entry, action) {323323+ if (i && action_entry->hw_stats != last_hw_stats) {324324+ NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");325325+ return false;329326 }327327+ last_hw_stats = action_entry->hw_stats;330328 }331329 return true;332330}
+7-2
init/main.c
···397397 return 0;398398}399399400400+static int __init warn_bootconfig(char *str)401401+{402402+ /* The 'bootconfig' has been handled by bootconfig_params(). */403403+ return 0;404404+}405405+400406static void __init setup_boot_config(void)401407{402408 static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata;···481475 pr_warn("WARNING: 'bootconfig' found on the kernel command line but CONFIG_BOOT_CONFIG is not set.\n");482476 return 0;483477}484484-early_param("bootconfig", warn_bootconfig);485485-486478#endif479479+early_param("bootconfig", warn_bootconfig);487480488481/* Change NUL term back to "=", to make "param" the whole string. */489482static void __init repair_env_string(char *param, char *val)
···265265 } else {266266 switch (__irq_startup_managed(desc, aff, force)) {267267 case IRQ_STARTUP_NORMAL:268268+ if (d->chip->flags & IRQCHIP_AFFINITY_PRE_STARTUP)269269+ irq_setup_affinity(desc);268270 ret = __irq_startup(desc);269269- irq_setup_affinity(desc);271271+ if (!(d->chip->flags & IRQCHIP_AFFINITY_PRE_STARTUP))272272+ irq_setup_affinity(desc);270273 break;271274 case IRQ_STARTUP_MANAGED:272275 irq_do_set_affinity(d, aff, false);
+8-5
kernel/irq/msi.c
···476476 return 0;477477478478cleanup:479479- for_each_msi_vector(desc, i, dev) {480480- irq_data = irq_domain_get_irq_data(domain, i);481481- if (irqd_is_activated(irq_data))482482- irq_domain_deactivate_irq(irq_data);483483- }484479 msi_domain_free_irqs(domain, dev);485480 return ret;486481}···500505501506void __msi_domain_free_irqs(struct irq_domain *domain, struct device *dev)502507{508508+ struct irq_data *irq_data;503509 struct msi_desc *desc;510510+ int i;511511+512512+ for_each_msi_vector(desc, i, dev) {513513+ irq_data = irq_domain_get_irq_data(domain, i);514514+ if (irqd_is_activated(irq_data))515515+ irq_domain_deactivate_irq(irq_data);516516+ }504517505518 for_each_msi_entry(desc, dev) {506519 /*
+5
kernel/irq/timings.c
···453453 */454454 index = irq_timings_interval_index(interval);455455456456+ if (index > PREDICTION_BUFFER_SIZE - 1) {457457+ irqs->count = 0;458458+ return;459459+ }460460+456461 /*457462 * Store the index as an element of the pattern in another458463 * circular array.
+1-1
kernel/locking/rtmutex.c
···343343rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter,344344 enum rtmutex_chainwalk chwalk)345345{346346- if (IS_ENABLED(CONFIG_DEBUG_RT_MUTEX))346346+ if (IS_ENABLED(CONFIG_DEBUG_RT_MUTEXES))347347 return waiter != NULL;348348 return chwalk == RT_MUTEX_FULL_CHAINWALK;349349}
+5
kernel/trace/Kconfig
···219219 depends on DYNAMIC_FTRACE_WITH_REGS220220 depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS221221222222+config DYNAMIC_FTRACE_WITH_ARGS223223+ def_bool y224224+ depends on DYNAMIC_FTRACE225225+ depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS226226+222227config FUNCTION_PROFILER223228 bool "Kernel function profiler"224229 depends on FUNCTION_TRACER
···13891389 event_triggers_post_call(file, tt);13901390}1391139113921392-/**13931393- * event_trigger_unlock_commit_regs - handle triggers and finish event commit13941394- * @file: The file pointer associated with the event13951395- * @buffer: The ring buffer that the event is being written to13961396- * @event: The event meta data in the ring buffer13971397- * @entry: The event itself13981398- * @trace_ctx: The tracing context flags.13991399- *14001400- * This is a helper function to handle triggers that require data14011401- * from the event itself. It also tests the event against filters and14021402- * if the event is soft disabled and should be discarded.14031403- *14041404- * Same as event_trigger_unlock_commit() but calls14051405- * trace_buffer_unlock_commit_regs() instead of trace_buffer_unlock_commit().14061406- */14071407-static inline void14081408-event_trigger_unlock_commit_regs(struct trace_event_file *file,14091409- struct trace_buffer *buffer,14101410- struct ring_buffer_event *event,14111411- void *entry, unsigned int trace_ctx,14121412- struct pt_regs *regs)14131413-{14141414- enum event_trigger_type tt = ETT_NONE;14151415-14161416- if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))14171417- trace_buffer_unlock_commit_regs(file->tr, buffer, event,14181418- trace_ctx, regs);14191419-14201420- if (tt)14211421- event_triggers_post_call(file, tt);14221422-}14231423-14241392#define FILTER_PRED_INVALID ((unsigned short)-1)14251393#define FILTER_PRED_IS_RIGHT (1 << 15)14261394#define FILTER_PRED_FOLD (1 << 15)
+2
kernel/trace/trace_events_hist.c
···34303430 event = data->match_data.event;34313431 }3432343234333433+ if (!event)34343434+ goto free;34333435 /*34343436 * At this point, we're looking at a field on another34353437 * event. Because we can't modify a hist trigger on
···1919 */2020int devmem_is_allowed(unsigned long pfn)2121{2222- if (iomem_is_exclusive(pfn << PAGE_SHIFT))2222+ if (iomem_is_exclusive(PFN_PHYS(pfn)))2323 return 0;2424 if (!page_is_ram(pfn))2525 return 1;
+5-2
mm/gup.c
···15581558 gup_flags |= FOLL_WRITE;1559155915601560 /*15611561- * See check_vma_flags(): Will return -EFAULT on incompatible mappings15621562- * or with insufficient permissions.15611561+ * We want to report -EINVAL instead of -EFAULT for any permission15621562+ * problems or incompatible mappings.15631563 */15641564+ if (check_vma_flags(vma, gup_flags))15651565+ return -EINVAL;15661566+15641567 return __get_user_pages(mm, start, nr_pages, gup_flags,15651568 NULL, NULL, locked);15661569}
···576576 unsigned int length)577577{578578 metadata_access_enable();579579- print_hex_dump(level, kasan_reset_tag(text), DUMP_PREFIX_ADDRESS,580580- 16, 1, addr, length, 1);579579+ print_hex_dump(level, text, DUMP_PREFIX_ADDRESS,580580+ 16, 1, kasan_reset_tag((void *)addr), length, 1);581581 metadata_access_disable();582582}583583···14001400static int __init setup_slub_debug(char *str)14011401{14021402 slab_flags_t flags;14031403+ slab_flags_t global_flags;14031404 char *saved_str;14041405 char *slab_list;14051406 bool global_slub_debug_changed = false;14061407 bool slab_list_specified = false;1407140814081408- slub_debug = DEBUG_DEFAULT_FLAGS;14091409+ global_flags = DEBUG_DEFAULT_FLAGS;14091410 if (*str++ != '=' || !*str)14101411 /*14111412 * No options specified. Switch on full debugging.···14181417 str = parse_slub_debug_flags(str, &flags, &slab_list, true);1419141814201419 if (!slab_list) {14211421- slub_debug = flags;14201420+ global_flags = flags;14221421 global_slub_debug_changed = true;14231422 } else {14241423 slab_list_specified = true;···1427142614281427 /*14291428 * For backwards compatibility, a single list of flags with list of14301430- * slabs means debugging is only enabled for those slabs, so the global14311431- * slub_debug should be 0. We can extended that to multiple lists as14291429+ * slabs means debugging is only changed for those slabs, so the global14301430+ * slub_debug should be unchanged (0 or DEBUG_DEFAULT_FLAGS, depending14311431+ * on CONFIG_SLUB_DEBUG_ON). We can extended that to multiple lists as14321432 * long as there is no option specifying flags without a slab list.14331433 */14341434 if (slab_list_specified) {14351435 if (!global_slub_debug_changed)14361436- slub_debug = 0;14361436+ global_flags = slub_debug;14371437 slub_debug_string = saved_str;14381438 }14391439out:14401440+ slub_debug = global_flags;14401441 if (slub_debug != 0 || slub_debug_string)14411442 static_branch_enable(&slub_debug_enabled);14421443 else···32393236 struct kmem_cache *s;32403237};3241323832423242-static inline void free_nonslab_page(struct page *page)32393239+static inline void free_nonslab_page(struct page *page, void *object)32433240{32443241 unsigned int order = compound_order(page);3245324232463243 VM_BUG_ON_PAGE(!PageCompound(page), page);32473247- kfree_hook(page_address(page));32443244+ kfree_hook(object);32483245 mod_lruvec_page_state(page, NR_SLAB_UNRECLAIMABLE_B, -(PAGE_SIZE << order));32493246 __free_pages(page, order);32503247}···32853282 if (!s) {32863283 /* Handle kalloc'ed objects */32873284 if (unlikely(!PageSlab(page))) {32883288- free_nonslab_page(page);32853285+ free_nonslab_page(page, object);32893286 p[size] = NULL; /* mark object processed */32903287 return size;32913288 }···4261425842624259 page = virt_to_head_page(x);42634260 if (unlikely(!PageSlab(page))) {42644264- free_nonslab_page(page);42614261+ free_nonslab_page(page, object);42654262 return;42664263 }42674264 slab_free(page->slab_cache, page, object, NULL, 1, _RET_IP_);
+2
net/mac80211/main.c
···260260 flush_work(&local->radar_detected_work);261261262262 rtnl_lock();263263+ /* we might do interface manipulations, so need both */264264+ wiphy_lock(local->hw.wiphy);263265264266 WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),265267 "%s called with hardware scan in progress\n", __func__);
+3-7
net/mptcp/options.c
···885885 return subflow->mp_capable;886886 }887887888888- if (mp_opt->dss && mp_opt->use_ack) {888888+ if ((mp_opt->dss && mp_opt->use_ack) ||889889+ (mp_opt->add_addr && !mp_opt->echo)) {889890 /* subflows are fully established as soon as we get any890890- * additional ack.891891+ * additional ack, including ADD_ADDR.891892 */892893 subflow->fully_established = 1;893894 WRITE_ONCE(msk->fully_established, true);894895 goto fully_established;895895- }896896-897897- if (mp_opt->add_addr) {898898- WRITE_ONCE(msk->fully_established, true);899899- return true;900896 }901897902898 /* If the first established packet does not contain MP_CAPABLE + data
+12-32
net/mptcp/pm_netlink.c
···12971297 return 0;12981298}1299129913001300-struct addr_entry_release_work {13011301- struct rcu_work rwork;13021302- struct mptcp_pm_addr_entry *entry;13031303-};13041304-13051305-static void mptcp_pm_release_addr_entry(struct work_struct *work)13001300+/* caller must ensure the RCU grace period is already elapsed */13011301+static void __mptcp_pm_release_addr_entry(struct mptcp_pm_addr_entry *entry)13061302{13071307- struct addr_entry_release_work *w;13081308- struct mptcp_pm_addr_entry *entry;13091309-13101310- w = container_of(to_rcu_work(work), struct addr_entry_release_work, rwork);13111311- entry = w->entry;13121312- if (entry) {13131313- if (entry->lsk)13141314- sock_release(entry->lsk);13151315- kfree(entry);13161316- }13171317- kfree(w);13181318-}13191319-13201320-static void mptcp_pm_free_addr_entry(struct mptcp_pm_addr_entry *entry)13211321-{13221322- struct addr_entry_release_work *w;13231323-13241324- w = kmalloc(sizeof(*w), GFP_ATOMIC);13251325- if (w) {13261326- INIT_RCU_WORK(&w->rwork, mptcp_pm_release_addr_entry);13271327- w->entry = entry;13281328- queue_rcu_work(system_wq, &w->rwork);13291329- }13031303+ if (entry->lsk)13041304+ sock_release(entry->lsk);13051305+ kfree(entry);13301306}1331130713321308static int mptcp_nl_remove_id_zero_address(struct net *net,···13821406 spin_unlock_bh(&pernet->lock);1383140713841408 mptcp_nl_remove_subflow_and_signal_addr(sock_net(skb->sk), &entry->addr);13851385- mptcp_pm_free_addr_entry(entry);14091409+ synchronize_rcu();14101410+ __mptcp_pm_release_addr_entry(entry);1386141113871412 return ret;13881413}···14361459 }14371460}1438146114621462+/* caller must ensure the RCU grace period is already elapsed */14391463static void __flush_addrs(struct list_head *list)14401464{14411465 while (!list_empty(list)) {···14451467 cur = list_entry(list->next,14461468 struct mptcp_pm_addr_entry, list);14471469 list_del_rcu(&cur->list);14481448- mptcp_pm_free_addr_entry(cur);14701470+ __mptcp_pm_release_addr_entry(cur);14491471 }14501472}14511473···14691491 bitmap_zero(pernet->id_bitmap, MAX_ADDR_ID + 1);14701492 spin_unlock_bh(&pernet->lock);14711493 mptcp_nl_remove_addrs_list(sock_net(skb->sk), &free_list);14941494+ synchronize_rcu();14721495 __flush_addrs(&free_list);14731496 return 0;14741497}···20812102 struct pm_nl_pernet *pernet = net_generic(net, pm_nl_pernet_id);2082210320832104 /* net is removed from namespace list, can't race with20842084- * other modifiers21052105+ * other modifiers, also netns core already waited for a21062106+ * RCU grace period.20852107 */20862108 __flush_addrs(&pernet->local_addr_list);20872109 }
···131131 cpu_relax();132132 }133133134134- ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_len,134134+ ret = ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_dma_len,135135 &off, PAGE_SIZE);136136- if (unlikely(ret != ibmr->sg_len))136136+ if (unlikely(ret != ibmr->sg_dma_len))137137 return ret < 0 ? ret : -EINVAL;138138139139 if (cmpxchg(&frmr->fr_state,
+1-1
net/sched/sch_cake.c
···720720skip_hash:721721 if (flow_override)722722 flow_hash = flow_override - 1;723723- else if (use_skbhash)723723+ else if (use_skbhash && (flow_mode & CAKE_FLOW_FLOWS))724724 flow_hash = skb->hash;725725 if (host_override) {726726 dsthost_hash = host_override - 1;
+1-1
net/tipc/socket.c
···1518151815191519 if (unlikely(syn && !rc)) {15201520 tipc_set_sk_state(sk, TIPC_CONNECTING);15211521- if (timeout) {15211521+ if (dlen && timeout) {15221522 timeout = msecs_to_jiffies(timeout);15231523 tipc_wait_for_connect(sock, &timeout);15241524 }
+8-1
sound/firewire/oxfw/oxfw-stream.c
···153153 struct cmp_connection *conn;154154 enum cmp_direction c_dir;155155 enum amdtp_stream_direction s_dir;156156- unsigned int flags = CIP_UNAWARE_SYT;156156+ unsigned int flags = 0;157157 int err;158158159159 if (!(oxfw->quirks & SND_OXFW_QUIRK_BLOCKING_TRANSMISSION))160160 flags |= CIP_NONBLOCKING;161161 else162162 flags |= CIP_BLOCKING;163163+164164+ // OXFW 970/971 has no function to generate playback timing according to the sequence165165+ // of value in syt field, thus the packet should include NO_INFO value in the field.166166+ // However, some models just ignore data blocks in packet with NO_INFO for audio data167167+ // processing.168168+ if (!(oxfw->quirks & SND_OXFW_QUIRK_IGNORE_NO_INFO_PACKET))169169+ flags |= CIP_UNAWARE_SYT;163170164171 if (stream == &oxfw->tx_stream) {165172 conn = &oxfw->out_conn;
+4-2
sound/firewire/oxfw/oxfw.c
···159159 return snd_oxfw_scs1x_add(oxfw);160160 }161161162162- if (entry->vendor_id == OUI_APOGEE && entry->model_id == MODEL_DUET_FW)163163- oxfw->quirks |= SND_OXFW_QUIRK_BLOCKING_TRANSMISSION;162162+ if (entry->vendor_id == OUI_APOGEE && entry->model_id == MODEL_DUET_FW) {163163+ oxfw->quirks |= SND_OXFW_QUIRK_BLOCKING_TRANSMISSION |164164+ SND_OXFW_QUIRK_IGNORE_NO_INFO_PACKET;165165+ }164166165167 /*166168 * TASCAM FireOne has physical control and requires a pair of additional
+5
sound/firewire/oxfw/oxfw.h
···4242 SND_OXFW_QUIRK_BLOCKING_TRANSMISSION = 0x04,4343 // Stanton SCS1.d and SCS1.m support unique transaction.4444 SND_OXFW_QUIRK_SCS_TRANSACTION = 0x08,4545+ // Apogee Duet FireWire ignores data blocks in packet with NO_INFO for audio data4646+ // processing, while output level meter moves. Any value in syt field of packet takes4747+ // the device to process audio data even if the value is invalid in a point of4848+ // IEC 61883-1/6.4949+ SND_OXFW_QUIRK_IGNORE_NO_INFO_PACKET = 0x10,4550};46514752/* This is an arbitrary number for convinience. */
+7-3
sound/pci/hda/hda_generic.c
···34603460 struct hda_gen_spec *spec = codec->spec;34613461 const struct hda_input_mux *imux;34623462 struct nid_path *path;34633463- int i, adc_idx, err = 0;34633463+ int i, adc_idx, ret, err = 0;3464346434653465 imux = &spec->input_mux;34663466 adc_idx = kcontrol->id.index;···34703470 if (!path || !path->ctls[type])34713471 continue;34723472 kcontrol->private_value = path->ctls[type];34733473- err = func(kcontrol, ucontrol);34743474- if (err < 0)34733473+ ret = func(kcontrol, ucontrol);34743474+ if (ret < 0) {34753475+ err = ret;34753476 break;34773477+ }34783478+ if (ret > 0)34793479+ err = 1;34763480 }34773481 mutex_unlock(&codec->control_mutex);34783482 if (err >= 0 && spec->cap_sync_hook)
···131131 writes = reads = offset = 0;132132133133 while (insize || write_left) {134134- unsigned long had_reads;135135- int got_comp;134134+ int had_reads, got_comp;136135137136 /*138137 * Queue up as many reads as we can···173174 if (!got_comp) {174175 ret = io_uring_wait_cqe(ring, &cqe);175176 got_comp = 1;176176- } else177177+ } else {177178 ret = io_uring_peek_cqe(ring, &cqe);179179+ if (ret == -EAGAIN) {180180+ cqe = NULL;181181+ ret = 0;182182+ }183183+ }178184 if (ret < 0) {179185 fprintf(stderr, "io_uring_peek_cqe: %s\n",180186 strerror(-ret));···198194 fprintf(stderr, "cqe failed: %s\n",199195 strerror(-cqe->res));200196 return 1;201201- } else if ((size_t) cqe->res != data->iov.iov_len) {197197+ } else if (cqe->res != data->iov.iov_len) {202198 /* Short read/write, adjust and requeue */203199 data->iov.iov_base += cqe->res;204200 data->iov.iov_len -= cqe->res;···223219 }224220 io_uring_cqe_seen(ring, cqe);225221 }222222+ }223223+224224+ /* wait out pending writes */225225+ while (writes) {226226+ struct io_data *data;227227+228228+ ret = io_uring_wait_cqe(ring, &cqe);229229+ if (ret) {230230+ fprintf(stderr, "wait_cqe=%d\n", ret);231231+ return 1;232232+ }233233+ if (cqe->res < 0) {234234+ fprintf(stderr, "write res=%d\n", cqe->res);235235+ return 1;236236+ }237237+ data = io_uring_cqe_get_data(cqe);238238+ free(data);239239+ writes--;240240+ io_uring_cqe_seen(ring, cqe);226241 }227242228243 return 0;
+1-1
tools/testing/nvdimm/test/nfit.c
···434434 dev_dbg(dev, "%s: transition out verify\n", __func__);435435 fw->state = FW_STATE_UPDATED;436436 fw->missed_activate = false;437437- /* fall through */437437+ fallthrough;438438 case FW_STATE_UPDATED:439439 nd_cmd->status = 0;440440 /* bogus test version */