···247247bias-pull-up - pull up the pin248248bias-pull-down - pull down the pin249249bias-pull-pin-default - use pin-default pull state250250-bi-directional - pin supports simultaneous input/output operations251250drive-push-pull - drive actively high and low252251drive-open-drain - drive with open drain253252drive-open-source - drive with open source···259260power-source - select between different power supplies260261low-power-enable - enable low power mode261262low-power-disable - disable low power mode262262-output-enable - enable output on pin regardless of output value263263output-low - set the pin to output mode with low level264264output-high - set the pin to output mode with high level265265slew-rate - set the slew rate
···191191 return NULL;192192193193 root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node);194194- if (!root_ops)194194+ if (!root_ops) {195195+ kfree(ri);195196 return NULL;197197+ }196198197199 ri->cfg = pci_acpi_setup_ecam_mapping(root);198200 if (!ri->cfg) {
+6
arch/frv/include/asm/timex.h
···1616#define vxtime_lock() do {} while (0)1717#define vxtime_unlock() do {} while (0)18181919+/* This attribute is used in include/linux/jiffies.h alongside with2020+ * __cacheline_aligned_in_smp. It is assumed that __cacheline_aligned_in_smp2121+ * for frv does not contain another section specification.2222+ */2323+#define __jiffy_arch_data __attribute__((__section__(".data")))2424+1925#endif2026
···1495149514961496static void cancel_hv_timer(struct kvm_lapic *apic)14971497{14981498+ preempt_disable();14981499 kvm_x86_ops->cancel_hv_timer(apic->vcpu);14991500 apic->lapic_timer.hv_timer_in_use = false;15011501+ preempt_enable();15001502}1501150315021504static bool start_hv_timer(struct kvm_lapic *apic)···19361934 for (i = 0; i < KVM_APIC_LVT_NUM; i++)19371935 kvm_lapic_set_reg(apic, APIC_LVTT + 0x10 * i, APIC_LVT_MASKED);19381936 apic_update_lvtt(apic);19391939- if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))19371937+ if (kvm_vcpu_is_reset_bsp(vcpu) &&19381938+ kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))19401939 kvm_lapic_set_reg(apic, APIC_LVT0,19411940 SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));19421941 apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));
+12-14
arch/x86/kvm/svm.c
···18071807 * AMD's VMCB does not have an explicit unusable field, so emulate it18081808 * for cross vendor migration purposes by "not present"18091809 */18101810- var->unusable = !var->present || (var->type == 0);18101810+ var->unusable = !var->present;1811181118121812 switch (seg) {18131813 case VCPU_SREG_TR:···18401840 */18411841 if (var->unusable)18421842 var->db = 0;18431843+ /* This is symmetric with svm_set_segment() */18431844 var->dpl = to_svm(vcpu)->vmcb->save.cpl;18441845 break;18451846 }···19811980 s->base = var->base;19821981 s->limit = var->limit;19831982 s->selector = var->selector;19841984- if (var->unusable)19851985- s->attrib = 0;19861986- else {19871987- s->attrib = (var->type & SVM_SELECTOR_TYPE_MASK);19881988- s->attrib |= (var->s & 1) << SVM_SELECTOR_S_SHIFT;19891989- s->attrib |= (var->dpl & 3) << SVM_SELECTOR_DPL_SHIFT;19901990- s->attrib |= (var->present & 1) << SVM_SELECTOR_P_SHIFT;19911991- s->attrib |= (var->avl & 1) << SVM_SELECTOR_AVL_SHIFT;19921992- s->attrib |= (var->l & 1) << SVM_SELECTOR_L_SHIFT;19931993- s->attrib |= (var->db & 1) << SVM_SELECTOR_DB_SHIFT;19941994- s->attrib |= (var->g & 1) << SVM_SELECTOR_G_SHIFT;19951995- }19831983+ s->attrib = (var->type & SVM_SELECTOR_TYPE_MASK);19841984+ s->attrib |= (var->s & 1) << SVM_SELECTOR_S_SHIFT;19851985+ s->attrib |= (var->dpl & 3) << SVM_SELECTOR_DPL_SHIFT;19861986+ s->attrib |= ((var->present & 1) && !var->unusable) << SVM_SELECTOR_P_SHIFT;19871987+ s->attrib |= (var->avl & 1) << SVM_SELECTOR_AVL_SHIFT;19881988+ s->attrib |= (var->l & 1) << SVM_SELECTOR_L_SHIFT;19891989+ s->attrib |= (var->db & 1) << SVM_SELECTOR_DB_SHIFT;19901990+ s->attrib |= (var->g & 1) << SVM_SELECTOR_G_SHIFT;1996199119971992 /*19981993 * This is always accurate, except if SYSRET returned to a segment···19972000 * would entail passing the CPL to userspace and back.19982001 */19992002 if (seg == VCPU_SREG_SS)20002000- svm->vmcb->save.cpl = (s->attrib >> SVM_SELECTOR_DPL_SHIFT) & 3;20032003+ /* This is symmetric with svm_get_segment() */20042004+ svm->vmcb->save.cpl = (var->dpl & 3);2001200520022006 mark_dirty(svm->vmcb, VMCB_SEG);20032007}
+62-85
arch/x86/kvm/vmx.c
···69146914 return 0;69156915}6916691669176917-/*69186918- * This function performs the various checks including69196919- * - if it's 4KB aligned69206920- * - No bits beyond the physical address width are set69216921- * - Returns 0 on success or else 169226922- * (Intel SDM Section 30.3)69236923- */69246924-static int nested_vmx_check_vmptr(struct kvm_vcpu *vcpu, int exit_reason,69256925- gpa_t *vmpointer)69176917+static int nested_vmx_get_vmptr(struct kvm_vcpu *vcpu, gpa_t *vmpointer)69266918{69276919 gva_t gva;69286928- gpa_t vmptr;69296920 struct x86_exception e;69306930- struct page *page;69316931- struct vcpu_vmx *vmx = to_vmx(vcpu);69326932- int maxphyaddr = cpuid_maxphyaddr(vcpu);6933692169346922 if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),69356923 vmcs_read32(VMX_INSTRUCTION_INFO), false, &gva))69366924 return 1;6937692569386938- if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, &vmptr,69396939- sizeof(vmptr), &e)) {69266926+ if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, vmpointer,69276927+ sizeof(*vmpointer), &e)) {69406928 kvm_inject_page_fault(vcpu, &e);69416929 return 1;69426930 }6943693169446944- switch (exit_reason) {69456945- case EXIT_REASON_VMON:69466946- /*69476947- * SDM 3: 24.11.569486948- * The first 4 bytes of VMXON region contain the supported69496949- * VMCS revision identifier69506950- *69516951- * Note - IA32_VMX_BASIC[48] will never be 169526952- * for the nested case;69536953- * which replaces physical address width with 3269546954- *69556955- */69566956- if (!PAGE_ALIGNED(vmptr) || (vmptr >> maxphyaddr)) {69576957- nested_vmx_failInvalid(vcpu);69586958- return kvm_skip_emulated_instruction(vcpu);69596959- }69606960-69616961- page = nested_get_page(vcpu, vmptr);69626962- if (page == NULL) {69636963- nested_vmx_failInvalid(vcpu);69646964- return kvm_skip_emulated_instruction(vcpu);69656965- }69666966- if (*(u32 *)kmap(page) != VMCS12_REVISION) {69676967- kunmap(page);69686968- nested_release_page_clean(page);69696969- nested_vmx_failInvalid(vcpu);69706970- return kvm_skip_emulated_instruction(vcpu);69716971- }69726972- kunmap(page);69736973- nested_release_page_clean(page);69746974- vmx->nested.vmxon_ptr = vmptr;69756975- break;69766976- case EXIT_REASON_VMCLEAR:69776977- if (!PAGE_ALIGNED(vmptr) || (vmptr >> maxphyaddr)) {69786978- nested_vmx_failValid(vcpu,69796979- VMXERR_VMCLEAR_INVALID_ADDRESS);69806980- return kvm_skip_emulated_instruction(vcpu);69816981- }69826982-69836983- if (vmptr == vmx->nested.vmxon_ptr) {69846984- nested_vmx_failValid(vcpu,69856985- VMXERR_VMCLEAR_VMXON_POINTER);69866986- return kvm_skip_emulated_instruction(vcpu);69876987- }69886988- break;69896989- case EXIT_REASON_VMPTRLD:69906990- if (!PAGE_ALIGNED(vmptr) || (vmptr >> maxphyaddr)) {69916991- nested_vmx_failValid(vcpu,69926992- VMXERR_VMPTRLD_INVALID_ADDRESS);69936993- return kvm_skip_emulated_instruction(vcpu);69946994- }69956995-69966996- if (vmptr == vmx->nested.vmxon_ptr) {69976997- nested_vmx_failValid(vcpu,69986998- VMXERR_VMPTRLD_VMXON_POINTER);69996999- return kvm_skip_emulated_instruction(vcpu);70007000- }70017001- break;70027002- default:70037003- return 1; /* shouldn't happen */70047004- }70057005-70067006- if (vmpointer)70077007- *vmpointer = vmptr;70086932 return 0;70096933}70106934···69907066static int handle_vmon(struct kvm_vcpu *vcpu)69917067{69927068 int ret;70697069+ gpa_t vmptr;70707070+ struct page *page;69937071 struct vcpu_vmx *vmx = to_vmx(vcpu);69947072 const u64 VMXON_NEEDED_FEATURES = FEATURE_CONTROL_LOCKED69957073 | FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;···70217095 return 1;70227096 }7023709770247024- if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMON, NULL))70987098+ if (nested_vmx_get_vmptr(vcpu, &vmptr))70257099 return 1;70267026-71007100+71017101+ /*71027102+ * SDM 3: 24.11.571037103+ * The first 4 bytes of VMXON region contain the supported71047104+ * VMCS revision identifier71057105+ *71067106+ * Note - IA32_VMX_BASIC[48] will never be 1 for the nested case;71077107+ * which replaces physical address width with 3271087108+ */71097109+ if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) {71107110+ nested_vmx_failInvalid(vcpu);71117111+ return kvm_skip_emulated_instruction(vcpu);71127112+ }71137113+71147114+ page = nested_get_page(vcpu, vmptr);71157115+ if (page == NULL) {71167116+ nested_vmx_failInvalid(vcpu);71177117+ return kvm_skip_emulated_instruction(vcpu);71187118+ }71197119+ if (*(u32 *)kmap(page) != VMCS12_REVISION) {71207120+ kunmap(page);71217121+ nested_release_page_clean(page);71227122+ nested_vmx_failInvalid(vcpu);71237123+ return kvm_skip_emulated_instruction(vcpu);71247124+ }71257125+ kunmap(page);71267126+ nested_release_page_clean(page);71277127+71287128+ vmx->nested.vmxon_ptr = vmptr;70277129 ret = enter_vmx_operation(vcpu);70287130 if (ret)70297131 return ret;···71677213 if (!nested_vmx_check_permission(vcpu))71687214 return 1;7169721571707170- if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMCLEAR, &vmptr))72167216+ if (nested_vmx_get_vmptr(vcpu, &vmptr))71717217 return 1;72187218+72197219+ if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) {72207220+ nested_vmx_failValid(vcpu, VMXERR_VMCLEAR_INVALID_ADDRESS);72217221+ return kvm_skip_emulated_instruction(vcpu);72227222+ }72237223+72247224+ if (vmptr == vmx->nested.vmxon_ptr) {72257225+ nested_vmx_failValid(vcpu, VMXERR_VMCLEAR_VMXON_POINTER);72267226+ return kvm_skip_emulated_instruction(vcpu);72277227+ }7172722871737229 if (vmptr == vmx->nested.current_vmptr)71747230 nested_release_vmcs12(vmx);···75097545 if (!nested_vmx_check_permission(vcpu))75107546 return 1;7511754775127512- if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMPTRLD, &vmptr))75487548+ if (nested_vmx_get_vmptr(vcpu, &vmptr))75137549 return 1;75507550+75517551+ if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) {75527552+ nested_vmx_failValid(vcpu, VMXERR_VMPTRLD_INVALID_ADDRESS);75537553+ return kvm_skip_emulated_instruction(vcpu);75547554+ }75557555+75567556+ if (vmptr == vmx->nested.vmxon_ptr) {75577557+ nested_vmx_failValid(vcpu, VMXERR_VMPTRLD_VMXON_POINTER);75587558+ return kvm_skip_emulated_instruction(vcpu);75597559+ }7514756075157561 if (vmx->nested.current_vmptr != vmptr) {75167562 struct vmcs12 *new_vmcs12;···78877913{78887914 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);78897915 int cr = exit_qualification & 15;78907890- int reg = (exit_qualification >> 8) & 15;78917891- unsigned long val = kvm_register_readl(vcpu, reg);79167916+ int reg;79177917+ unsigned long val;7892791878937919 switch ((exit_qualification >> 4) & 3) {78947920 case 0: /* mov to cr */79217921+ reg = (exit_qualification >> 8) & 15;79227922+ val = kvm_register_readl(vcpu, reg);78957923 switch (cr) {78967924 case 0:78977925 if (vmcs12->cr0_guest_host_mask &···79487972 * lmsw can change bits 1..3 of cr0, and only set bit 0 of79497973 * cr0. Other attempted changes are ignored, with no exit.79507974 */79757975+ val = (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f;79517976 if (vmcs12->cr0_guest_host_mask & 0xe &79527977 (val ^ vmcs12->cr0_read_shadow))79537978 return true;
+5-2
arch/x86/kvm/x86.c
···83948394 if (vcpu->arch.pv.pv_unhalted)83958395 return true;8396839683978397- if (atomic_read(&vcpu->arch.nmi_queued))83978397+ if (kvm_test_request(KVM_REQ_NMI, vcpu) ||83988398+ (vcpu->arch.nmi_pending &&83998399+ kvm_x86_ops->nmi_allowed(vcpu)))83988400 return true;8399840184008400- if (kvm_test_request(KVM_REQ_SMI, vcpu))84028402+ if (kvm_test_request(KVM_REQ_SMI, vcpu) ||84038403+ (vcpu->arch.smi_pending && !is_smm(vcpu)))84018404 return true;8402840584038406 if (kvm_arch_interrupt_allowed(vcpu) &&
+3-6
arch/x86/mm/pat.c
···6565}6666early_param("nopat", nopat);67676868-static bool __read_mostly __pat_initialized = false;6969-7068bool pat_enabled(void)7169{7272- return __pat_initialized;7070+ return !!__pat_enabled;7371}7472EXPORT_SYMBOL_GPL(pat_enabled);7573···225227 }226228227229 wrmsrl(MSR_IA32_CR_PAT, pat);228228- __pat_initialized = true;229230230231 __init_cache_modes(pat);231232}232233233234static void pat_ap_init(u64 pat)234235{235235- if (!this_cpu_has(X86_FEATURE_PAT)) {236236+ if (!boot_cpu_has(X86_FEATURE_PAT)) {236237 /*237238 * If this happens we are on a secondary CPU, but switched to238239 * PAT on the boot CPU. We have no way to undo PAT.···306309 u64 pat;307310 struct cpuinfo_x86 *c = &boot_cpu_data;308311309309- if (!__pat_enabled) {312312+ if (!pat_enabled()) {310313 init_cache_modes();311314 return;312315 }
+4-2
arch/x86/platform/efi/efi.c
···828828829829 /*830830 * We don't do virtual mode, since we don't do runtime services, on831831- * non-native EFI831831+ * non-native EFI. With efi=old_map, we don't do runtime services in832832+ * kexec kernel because in the initial boot something else might833833+ * have been mapped at these virtual addresses.832834 */833833- if (!efi_is_native()) {835835+ if (!efi_is_native() || efi_enabled(EFI_OLD_MEMMAP)) {834836 efi_memmap_unmap();835837 clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);836838 return;
+71-8
arch/x86/platform/efi/efi_64.c
···71717272pgd_t * __init efi_call_phys_prolog(void)7373{7474- unsigned long vaddress;7575- pgd_t *save_pgd;7474+ unsigned long vaddr, addr_pgd, addr_p4d, addr_pud;7575+ pgd_t *save_pgd, *pgd_k, *pgd_efi;7676+ p4d_t *p4d, *p4d_k, *p4d_efi;7777+ pud_t *pud;76787779 int pgd;7878- int n_pgds;8080+ int n_pgds, i, j;79818082 if (!efi_enabled(EFI_OLD_MEMMAP)) {8183 save_pgd = (pgd_t *)read_cr3();···9088 n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);9189 save_pgd = kmalloc_array(n_pgds, sizeof(*save_pgd), GFP_KERNEL);92909191+ /*9292+ * Build 1:1 identity mapping for efi=old_map usage. Note that9393+ * PAGE_OFFSET is PGDIR_SIZE aligned when KASLR is disabled, while9494+ * it is PUD_SIZE ALIGNED with KASLR enabled. So for a given physical9595+ * address X, the pud_index(X) != pud_index(__va(X)), we can only copy9696+ * PUD entry of __va(X) to fill in pud entry of X to build 1:1 mapping.9797+ * This means here we can only reuse the PMD tables of the direct mapping.9898+ */9399 for (pgd = 0; pgd < n_pgds; pgd++) {9494- save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);9595- vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);9696- set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));100100+ addr_pgd = (unsigned long)(pgd * PGDIR_SIZE);101101+ vaddr = (unsigned long)__va(pgd * PGDIR_SIZE);102102+ pgd_efi = pgd_offset_k(addr_pgd);103103+ save_pgd[pgd] = *pgd_efi;104104+105105+ p4d = p4d_alloc(&init_mm, pgd_efi, addr_pgd);106106+ if (!p4d) {107107+ pr_err("Failed to allocate p4d table!\n");108108+ goto out;109109+ }110110+111111+ for (i = 0; i < PTRS_PER_P4D; i++) {112112+ addr_p4d = addr_pgd + i * P4D_SIZE;113113+ p4d_efi = p4d + p4d_index(addr_p4d);114114+115115+ pud = pud_alloc(&init_mm, p4d_efi, addr_p4d);116116+ if (!pud) {117117+ pr_err("Failed to allocate pud table!\n");118118+ goto out;119119+ }120120+121121+ for (j = 0; j < PTRS_PER_PUD; j++) {122122+ addr_pud = addr_p4d + j * PUD_SIZE;123123+124124+ if (addr_pud > (max_pfn << PAGE_SHIFT))125125+ break;126126+127127+ vaddr = (unsigned long)__va(addr_pud);128128+129129+ pgd_k = pgd_offset_k(vaddr);130130+ p4d_k = p4d_offset(pgd_k, vaddr);131131+ pud[j] = *pud_offset(p4d_k, vaddr);132132+ }133133+ }97134 }98135out:99136 __flush_tlb_all();···145104 /*146105 * After the lock is released, the original page table is restored.147106 */148148- int pgd_idx;107107+ int pgd_idx, i;149108 int nr_pgds;109109+ pgd_t *pgd;110110+ p4d_t *p4d;111111+ pud_t *pud;150112151113 if (!efi_enabled(EFI_OLD_MEMMAP)) {152114 write_cr3((unsigned long)save_pgd);···159115160116 nr_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);161117162162- for (pgd_idx = 0; pgd_idx < nr_pgds; pgd_idx++)118118+ for (pgd_idx = 0; pgd_idx < nr_pgds; pgd_idx++) {119119+ pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE);163120 set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]);121121+122122+ if (!(pgd_val(*pgd) & _PAGE_PRESENT))123123+ continue;124124+125125+ for (i = 0; i < PTRS_PER_P4D; i++) {126126+ p4d = p4d_offset(pgd,127127+ pgd_idx * PGDIR_SIZE + i * P4D_SIZE);128128+129129+ if (!(p4d_val(*p4d) & _PAGE_PRESENT))130130+ continue;131131+132132+ pud = (pud_t *)p4d_page_vaddr(*p4d);133133+ pud_free(&init_mm, pud);134134+ }135135+136136+ p4d = (p4d_t *)pgd_page_vaddr(*pgd);137137+ p4d_free(&init_mm, p4d);138138+ }164139165140 kfree(save_pgd);166141
+3
arch/x86/platform/efi/quirks.c
···360360 free_bootmem_late(start, size);361361 }362362363363+ if (!num_entries)364364+ return;365365+363366 new_size = efi.memmap.desc_size * num_entries;364367 new_phys = efi_memmap_alloc(num_entries);365368 if (!new_phys) {
···3838static const int cfq_hist_divisor = 4;39394040/*4141- * offset from end of service tree4141+ * offset from end of queue service tree for idle class4242 */4343#define CFQ_IDLE_DELAY (NSEC_PER_SEC / 5)4444+/* offset from end of group service tree under time slice mode */4545+#define CFQ_SLICE_MODE_GROUP_DELAY (NSEC_PER_SEC / 5)4646+/* offset from end of group service under IOPS mode */4747+#define CFQ_IOPS_MODE_GROUP_DELAY (HZ / 5)44484549/*4650 * below this threshold, we consider thinktime immediate···13661362 cfqg->vfraction = max_t(unsigned, vfr, 1);13671363}1368136413651365+static inline u64 cfq_get_cfqg_vdisktime_delay(struct cfq_data *cfqd)13661366+{13671367+ if (!iops_mode(cfqd))13681368+ return CFQ_SLICE_MODE_GROUP_DELAY;13691369+ else13701370+ return CFQ_IOPS_MODE_GROUP_DELAY;13711371+}13721372+13691373static void13701374cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg)13711375{···13931381 n = rb_last(&st->rb);13941382 if (n) {13951383 __cfqg = rb_entry_cfqg(n);13961396- cfqg->vdisktime = __cfqg->vdisktime + CFQ_IDLE_DELAY;13841384+ cfqg->vdisktime = __cfqg->vdisktime +13851385+ cfq_get_cfqg_vdisktime_delay(cfqd);13971386 } else13981387 cfqg->vdisktime = st->min_vdisktime;13991388 cfq_group_service_tree_add(st, cfqg);
-4
drivers/acpi/acpica/tbutils.c
···418418419419 table_desc->validation_count++;420420 if (table_desc->validation_count == 0) {421421- ACPI_ERROR((AE_INFO,422422- "Table %p, Validation count is zero after increment\n",423423- table_desc));424421 table_desc->validation_count--;425425- return_ACPI_STATUS(AE_LIMIT);426422 }427423428424 *out_table = table_desc->pointer;
···24682468 if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&24692469 list_empty(&cpufreq_policy_list)) {24702470 /* if all ->init() calls failed, unregister */24712471+ ret = -ENODEV;24712472 pr_debug("%s: No CPU initialized for driver %s\n", __func__,24722473 driver_data->name);24732474 goto err_if_unreg;
···709709710710static struct phm_master_table_item711711vega10_thermal_start_thermal_controller_master_list[] = {712712- {NULL, tf_vega10_thermal_initialize},713713- {NULL, tf_vega10_thermal_set_temperature_range},714714- {NULL, tf_vega10_thermal_enable_alert},712712+ { .tableFunction = tf_vega10_thermal_initialize },713713+ { .tableFunction = tf_vega10_thermal_set_temperature_range },714714+ { .tableFunction = tf_vega10_thermal_enable_alert },715715/* We should restrict performance levels to low before we halt the SMC.716716 * On the other hand we are still in boot state when we do this717717 * so it would be pointless.718718 * If this assumption changes we have to revisit this table.719719 */720720- {NULL, tf_vega10_thermal_setup_fan_table},721721- {NULL, tf_vega10_thermal_start_smc_fan_control},722722- {NULL, NULL}720720+ { .tableFunction = tf_vega10_thermal_setup_fan_table },721721+ { .tableFunction = tf_vega10_thermal_start_smc_fan_control },722722+ { }723723};724724725725static struct phm_master_table_header···731731732732static struct phm_master_table_item733733vega10_thermal_set_temperature_range_master_list[] = {734734- {NULL, tf_vega10_thermal_disable_alert},735735- {NULL, tf_vega10_thermal_set_temperature_range},736736- {NULL, tf_vega10_thermal_enable_alert},737737- {NULL, NULL}734734+ { .tableFunction = tf_vega10_thermal_disable_alert },735735+ { .tableFunction = tf_vega10_thermal_set_temperature_range },736736+ { .tableFunction = tf_vega10_thermal_enable_alert },737737+ { }738738};739739740740struct phm_master_table_header
+83
drivers/gpu/drm/drm_dp_helper.c
···12081208 return 0;12091209}12101210EXPORT_SYMBOL(drm_dp_stop_crc);12111211+12121212+struct dpcd_quirk {12131213+ u8 oui[3];12141214+ bool is_branch;12151215+ u32 quirks;12161216+};12171217+12181218+#define OUI(first, second, third) { (first), (second), (third) }12191219+12201220+static const struct dpcd_quirk dpcd_quirk_list[] = {12211221+ /* Analogix 7737 needs reduced M and N at HBR2 link rates */12221222+ { OUI(0x00, 0x22, 0xb9), true, BIT(DP_DPCD_QUIRK_LIMITED_M_N) },12231223+};12241224+12251225+#undef OUI12261226+12271227+/*12281228+ * Get a bit mask of DPCD quirks for the sink/branch device identified by12291229+ * ident. The quirk data is shared but it's up to the drivers to act on the12301230+ * data.12311231+ *12321232+ * For now, only the OUI (first three bytes) is used, but this may be extended12331233+ * to device identification string and hardware/firmware revisions later.12341234+ */12351235+static u3212361236+drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch)12371237+{12381238+ const struct dpcd_quirk *quirk;12391239+ u32 quirks = 0;12401240+ int i;12411241+12421242+ for (i = 0; i < ARRAY_SIZE(dpcd_quirk_list); i++) {12431243+ quirk = &dpcd_quirk_list[i];12441244+12451245+ if (quirk->is_branch != is_branch)12461246+ continue;12471247+12481248+ if (memcmp(quirk->oui, ident->oui, sizeof(ident->oui)) != 0)12491249+ continue;12501250+12511251+ quirks |= quirk->quirks;12521252+ }12531253+12541254+ return quirks;12551255+}12561256+12571257+/**12581258+ * drm_dp_read_desc - read sink/branch descriptor from DPCD12591259+ * @aux: DisplayPort AUX channel12601260+ * @desc: Device decriptor to fill from DPCD12611261+ * @is_branch: true for branch devices, false for sink devices12621262+ *12631263+ * Read DPCD 0x400 (sink) or 0x500 (branch) into @desc. Also debug log the12641264+ * identification.12651265+ *12661266+ * Returns 0 on success or a negative error code on failure.12671267+ */12681268+int drm_dp_read_desc(struct drm_dp_aux *aux, struct drm_dp_desc *desc,12691269+ bool is_branch)12701270+{12711271+ struct drm_dp_dpcd_ident *ident = &desc->ident;12721272+ unsigned int offset = is_branch ? DP_BRANCH_OUI : DP_SINK_OUI;12731273+ int ret, dev_id_len;12741274+12751275+ ret = drm_dp_dpcd_read(aux, offset, ident, sizeof(*ident));12761276+ if (ret < 0)12771277+ return ret;12781278+12791279+ desc->quirks = drm_dp_get_quirks(ident, is_branch);12801280+12811281+ dev_id_len = strnlen(ident->device_id, sizeof(ident->device_id));12821282+12831283+ DRM_DEBUG_KMS("DP %s: OUI %*phD dev-ID %*pE HW-rev %d.%d SW-rev %d.%d quirks 0x%04x\n",12841284+ is_branch ? "branch" : "sink",12851285+ (int)sizeof(ident->oui), ident->oui,12861286+ dev_id_len, ident->device_id,12871287+ ident->hw_rev >> 4, ident->hw_rev & 0xf,12881288+ ident->sw_major_rev, ident->sw_minor_rev,12891289+ desc->quirks);12901290+12911291+ return 0;12921292+}12931293+EXPORT_SYMBOL(drm_dp_read_desc);
···160160 * drm framework doesn't support multiple irq yet.161161 * we can refer to the crtc to current hardware interrupt occurred through162162 * this pipe value.163163- * @enabled: if the crtc is enabled or not164164- * @event: vblank event that is currently queued for flip165165- * @wait_update: wait all pending planes updates to finish166166- * @pending_update: number of pending plane updates in this crtc167163 * @ops: pointer to callbacks for exynos drm specific functionality168164 * @ctx: A pointer to the crtc's implementation specific context165165+ * @pipe_clk: A pointer to the crtc's pipeline clock.169166 */170167struct exynos_drm_crtc {171168 struct drm_crtc base;
+9-17
drivers/gpu/drm/exynos/exynos_drm_dsi.c
···16331633{16341634 struct device *dev = dsi->dev;16351635 struct device_node *node = dev->of_node;16361636- struct device_node *ep;16371636 int ret;1638163716391638 ret = exynos_dsi_of_read_u32(node, "samsung,pll-clock-frequency",···16401641 if (ret < 0)16411642 return ret;1642164316431643- ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);16441644- if (!ep) {16451645- dev_err(dev, "no output port with endpoint specified\n");16461646- return -EINVAL;16471647- }16481648-16491649- ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",16441644+ ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",16501645 &dsi->burst_clk_rate);16511646 if (ret < 0)16521652- goto end;16471647+ return ret;1653164816541654- ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",16491649+ ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",16551650 &dsi->esc_clk_rate);16561651 if (ret < 0)16571657- goto end;16581658-16591659- of_node_put(ep);16521652+ return ret;1660165316611654 dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_OUT, 0);16621655 if (!dsi->bridge_node)16631656 return -EINVAL;1664165716651665-end:16661666- of_node_put(ep);16671667-16681668- return ret;16581658+ return 0;16691659}1670166016711661static int exynos_dsi_bind(struct device *dev, struct device *master,···1805181718061818static int exynos_dsi_remove(struct platform_device *pdev)18071819{18201820+ struct exynos_dsi *dsi = platform_get_drvdata(pdev);18211821+18221822+ of_node_put(dsi->bridge_node);18231823+18081824 pm_runtime_disable(&pdev->dev);1809182518101826 component_del(&pdev->dev, &exynos_dsi_component_ops);
···1272127212731273 dev_priv->ipc_enabled = false;1274127412751275- /* Everything is in place, we can now relax! */12761276- DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",12771277- driver.name, driver.major, driver.minor, driver.patchlevel,12781278- driver.date, pci_name(pdev), dev_priv->drm.primary->index);12791275 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG))12801276 DRM_INFO("DRM_I915_DEBUG enabled\n");12811277 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
+2-1
drivers/gpu/drm/i915/i915_drv.h
···562562563563void intel_link_compute_m_n(int bpp, int nlanes,564564 int pixel_clock, int link_clock,565565- struct intel_link_m_n *m_n);565565+ struct intel_link_m_n *m_n,566566+ bool reduce_m_n);566567567568/* Interface history:568569 *
+1-1
drivers/gpu/drm/i915/i915_gem_gtt.c
···23132313 appgtt->base.allocate_va_range) {23142314 ret = appgtt->base.allocate_va_range(&appgtt->base,23152315 vma->node.start,23162316- vma->node.size);23162316+ vma->size);23172317 if (ret)23182318 goto err_pages;23192319 }
-5
drivers/gpu/drm/i915/i915_gem_shrinker.c
···5959 return;60606161 mutex_unlock(&dev->struct_mutex);6262-6363- /* expedite the RCU grace period to free some request slabs */6464- synchronize_rcu_expedited();6562}66636764static bool any_vma_pinned(struct drm_i915_gem_object *obj)···270273 I915_SHRINK_UNBOUND |271274 I915_SHRINK_ACTIVE);272275 intel_runtime_pm_put(dev_priv);273273-274274- synchronize_rcu(); /* wait for our earlier RCU delayed slab frees */275276276277 return freed;277278}
···8280828082818281/* MIPI DSI registers */8282828282838283-#define _MIPI_PORT(port, a, c) ((port) ? c : a) /* ports A and C only */82838283+#define _MIPI_PORT(port, a, c) (((port) == PORT_A) ? a : c) /* ports A and C only */82848284#define _MMIO_MIPI(port, a, c) _MMIO(_MIPI_PORT(port, a, c))8285828582868286#define MIPIO_TXESC_CLK_DIV1 _MMIO(0x160004)
+14-8
drivers/gpu/drm/i915/intel_display.c
···61016101 pipe_config->fdi_lanes = lane;6102610261036103 intel_link_compute_m_n(pipe_config->pipe_bpp, lane, fdi_dotclock,61046104- link_bw, &pipe_config->fdi_m_n);61046104+ link_bw, &pipe_config->fdi_m_n, false);6105610561066106 ret = ironlake_check_fdi_lanes(dev, intel_crtc->pipe, pipe_config);61076107 if (ret == -EINVAL && pipe_config->pipe_bpp > 6*3) {···62776277}6278627862796279static void compute_m_n(unsigned int m, unsigned int n,62806280- uint32_t *ret_m, uint32_t *ret_n)62806280+ uint32_t *ret_m, uint32_t *ret_n,62816281+ bool reduce_m_n)62816282{62826283 /*62836284 * Reduce M/N as much as possible without loss in precision. Several DP···62866285 * values. The passed in values are more likely to have the least62876286 * significant bits zero than M after rounding below, so do this first.62886287 */62896289- while ((m & 1) == 0 && (n & 1) == 0) {62906290- m >>= 1;62916291- n >>= 1;62886288+ if (reduce_m_n) {62896289+ while ((m & 1) == 0 && (n & 1) == 0) {62906290+ m >>= 1;62916291+ n >>= 1;62926292+ }62926293 }6293629462946295 *ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);···63016298void63026299intel_link_compute_m_n(int bits_per_pixel, int nlanes,63036300 int pixel_clock, int link_clock,63046304- struct intel_link_m_n *m_n)63016301+ struct intel_link_m_n *m_n,63026302+ bool reduce_m_n)63056303{63066304 m_n->tu = 64;6307630563086306 compute_m_n(bits_per_pixel * pixel_clock,63096307 link_clock * nlanes * 8,63106310- &m_n->gmch_m, &m_n->gmch_n);63086308+ &m_n->gmch_m, &m_n->gmch_n,63096309+ reduce_m_n);6311631063126311 compute_m_n(pixel_clock, link_clock,63136313- &m_n->link_m, &m_n->link_n);63126312+ &m_n->link_m, &m_n->link_n,63136313+ reduce_m_n);63146314}6315631563166316static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
···758758 struct msm_gem_object *msm_obj;759759 bool use_vram = false;760760761761+ WARN_ON(!mutex_is_locked(&dev->struct_mutex));762762+761763 switch (flags & MSM_BO_CACHE_MASK) {762764 case MSM_BO_UNCACHED:763765 case MSM_BO_CACHED:···855853856854 size = PAGE_ALIGN(dmabuf->size);857855856856+ /* Take mutex so we can modify the inactive list in msm_gem_new_impl */857857+ mutex_lock(&dev->struct_mutex);858858 ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, &obj);859859+ mutex_unlock(&dev->struct_mutex);860860+859861 if (ret)860862 goto fail;861863
···410410 if (!in_fence)411411 return -EINVAL;412412413413- /* TODO if we get an array-fence due to userspace merging multiple414414- * fences, we need a way to determine if all the backing fences415415- * are from our own context..413413+ /*414414+ * Wait if the fence is from a foreign context, or if the fence415415+ * array contains any fence from a foreign context.416416 */417417-418418- if (in_fence->context != gpu->fctx->context) {417417+ if (!dma_fence_match_context(in_fence, gpu->fctx->context)) {419418 ret = dma_fence_wait(in_fence, true);420419 if (ret)421420 return ret;···495496 goto out;496497 }497498498498- if ((submit_cmd.size + submit_cmd.submit_offset) >=499499- msm_obj->base.size) {499499+ if (!submit_cmd.size ||500500+ ((submit_cmd.size + submit_cmd.submit_offset) >501501+ msm_obj->base.size)) {500502 DRM_ERROR("invalid cmdstream size: %u\n", submit_cmd.size);501503 ret = -EINVAL;502504 goto out;
+2-2
drivers/gpu/drm/msm/msm_gpu.c
···549549 gpu->grp_clks[i] = get_clock(dev, name);550550551551 /* Remember the key clocks that we need to control later */552552- if (!strcmp(name, "core"))552552+ if (!strcmp(name, "core") || !strcmp(name, "core_clk"))553553 gpu->core_clk = gpu->grp_clks[i];554554- else if (!strcmp(name, "rbbmtimer"))554554+ else if (!strcmp(name, "rbbmtimer") || !strcmp(name, "rbbmtimer_clk"))555555 gpu->rbbmtimer_clk = gpu->grp_clks[i];556556557557 ++i;
+4-2
drivers/hid/Kconfig
···275275 - Trio Linker Plus II276276277277config HID_ELECOM278278- tristate "ELECOM BM084 bluetooth mouse"278278+ tristate "ELECOM HID devices"279279 depends on HID280280 ---help---281281- Support for the ELECOM BM084 (bluetooth mouse).281281+ Support for ELECOM devices:282282+ - BM084 Bluetooth Mouse283283+ - DEFT Trackball (Wired and wireless)282284283285config HID_ELO284286 tristate "ELO USB 4000/4500 touchscreen"
···15711571{15721572 unsigned char *data = wacom->data;1573157315741574- if (wacom->pen_input)15741574+ if (wacom->pen_input) {15751575 dev_dbg(wacom->pen_input->dev.parent,15761576 "%s: received report #%d\n", __func__, data[0]);15771577- else if (wacom->touch_input)15771577+15781578+ if (len == WACOM_PKGLEN_PENABLED ||15791579+ data[0] == WACOM_REPORT_PENABLED)15801580+ return wacom_tpc_pen(wacom);15811581+ }15821582+ else if (wacom->touch_input) {15781583 dev_dbg(wacom->touch_input->dev.parent,15791584 "%s: received report #%d\n", __func__, data[0]);1580158515811581- switch (len) {15821582- case WACOM_PKGLEN_TPC1FG:15831583- return wacom_tpc_single_touch(wacom, len);15841584-15851585- case WACOM_PKGLEN_TPC2FG:15861586- return wacom_tpc_mt_touch(wacom);15871587-15881588- case WACOM_PKGLEN_PENABLED:15891589- return wacom_tpc_pen(wacom);15901590-15911591- default:15921592- switch (data[0]) {15931593- case WACOM_REPORT_TPC1FG:15941594- case WACOM_REPORT_TPCHID:15951595- case WACOM_REPORT_TPCST:15961596- case WACOM_REPORT_TPC1FGE:15861586+ switch (len) {15871587+ case WACOM_PKGLEN_TPC1FG:15971588 return wacom_tpc_single_touch(wacom, len);1598158915991599- case WACOM_REPORT_TPCMT:16001600- case WACOM_REPORT_TPCMT2:16011601- return wacom_mt_touch(wacom);15901590+ case WACOM_PKGLEN_TPC2FG:15911591+ return wacom_tpc_mt_touch(wacom);1602159216031603- case WACOM_REPORT_PENABLED:16041604- return wacom_tpc_pen(wacom);15931593+ default:15941594+ switch (data[0]) {15951595+ case WACOM_REPORT_TPC1FG:15961596+ case WACOM_REPORT_TPCHID:15971597+ case WACOM_REPORT_TPCST:15981598+ case WACOM_REPORT_TPC1FGE:15991599+ return wacom_tpc_single_touch(wacom, len);16001600+16011601+ case WACOM_REPORT_TPCMT:16021602+ case WACOM_REPORT_TPCMT2:16031603+ return wacom_mt_touch(wacom);16041604+16051605+ }16051606 }16061607 }16071608
+1
drivers/hwmon/Kconfig
···343343344344config SENSORS_ASPEED345345 tristate "ASPEED AST2400/AST2500 PWM and Fan tach driver"346346+ select REGMAP346347 help347348 This driver provides support for ASPEED AST2400/AST2500 PWM348349 and Fan Tacho controllers.
···169169int ib_sa_init(void);170170void ib_sa_cleanup(void);171171172172+int ibnl_init(void);173173+void ibnl_cleanup(void);174174+175175+/**176176+ * Check if there are any listeners to the netlink group177177+ * @group: the netlink group ID178178+ * Returns 0 on success or a negative for no listeners.179179+ */180180+int ibnl_chk_listeners(unsigned int group);181181+172182int ib_nl_handle_resolve_resp(struct sk_buff *skb,173183 struct netlink_callback *cb);174184int ib_nl_handle_set_timeout(struct sk_buff *skb,
···63126312 }63136313}6314631463156315-static void write_global_credit(struct hfi1_devdata *dd,63166316- u8 vau, u16 total, u16 shared)63156315+/*63166316+ * Set up allocation unit vaulue.63176317+ */63186318+void set_up_vau(struct hfi1_devdata *dd, u8 vau)63176319{63186318- write_csr(dd, SEND_CM_GLOBAL_CREDIT,63196319- ((u64)total <<63206320- SEND_CM_GLOBAL_CREDIT_TOTAL_CREDIT_LIMIT_SHIFT) |63216321- ((u64)shared <<63226322- SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_SHIFT) |63236323- ((u64)vau << SEND_CM_GLOBAL_CREDIT_AU_SHIFT));63206320+ u64 reg = read_csr(dd, SEND_CM_GLOBAL_CREDIT);63216321+63226322+ /* do not modify other values in the register */63236323+ reg &= ~SEND_CM_GLOBAL_CREDIT_AU_SMASK;63246324+ reg |= (u64)vau << SEND_CM_GLOBAL_CREDIT_AU_SHIFT;63256325+ write_csr(dd, SEND_CM_GLOBAL_CREDIT, reg);63246326}6325632763266328/*63276329 * Set up initial VL15 credits of the remote. Assumes the rest of63286328- * the CM credit registers are zero from a previous global or credit reset .63306330+ * the CM credit registers are zero from a previous global or credit reset.63316331+ * Shared limit for VL15 will always be 0.63296332 */63306330-void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf)63336333+void set_up_vl15(struct hfi1_devdata *dd, u16 vl15buf)63316334{63326332- /* leave shared count at zero for both global and VL15 */63336333- write_global_credit(dd, vau, vl15buf, 0);63356335+ u64 reg = read_csr(dd, SEND_CM_GLOBAL_CREDIT);63366336+63376337+ /* set initial values for total and shared credit limit */63386338+ reg &= ~(SEND_CM_GLOBAL_CREDIT_TOTAL_CREDIT_LIMIT_SMASK |63396339+ SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_SMASK);63406340+63416341+ /*63426342+ * Set total limit to be equal to VL15 credits.63436343+ * Leave shared limit at 0.63446344+ */63456345+ reg |= (u64)vl15buf << SEND_CM_GLOBAL_CREDIT_TOTAL_CREDIT_LIMIT_SHIFT;63466346+ write_csr(dd, SEND_CM_GLOBAL_CREDIT, reg);6334634763356348 write_csr(dd, SEND_CM_CREDIT_VL15, (u64)vl15buf63366349 << SEND_CM_CREDIT_VL15_DEDICATED_LIMIT_VL_SHIFT);···63616348 for (i = 0; i < TXE_NUM_DATA_VL; i++)63626349 write_csr(dd, SEND_CM_CREDIT_VL + (8 * i), 0);63636350 write_csr(dd, SEND_CM_CREDIT_VL15, 0);63646364- write_global_credit(dd, 0, 0, 0);63516351+ write_csr(dd, SEND_CM_GLOBAL_CREDIT, 0);63656352 /* reset the CM block */63666353 pio_send_control(dd, PSC_CM_RESET);63546354+ /* reset cached value */63556355+ dd->vl15buf_cached = 0;63676356}6368635763696358/* convert a vCU to a CU */···68546839{68556840 struct hfi1_pportdata *ppd = container_of(work, struct hfi1_pportdata,68566841 link_up_work);68426842+ struct hfi1_devdata *dd = ppd->dd;68436843+68576844 set_link_state(ppd, HLS_UP_INIT);6858684568596846 /* cache the read of DC_LCB_STS_ROUND_TRIP_LTP_CNT */68606860- read_ltp_rtt(ppd->dd);68476847+ read_ltp_rtt(dd);68616848 /*68626849 * OPA specifies that certain counters are cleared on a transition68636850 * to link up, so do that.68646851 */68656865- clear_linkup_counters(ppd->dd);68526852+ clear_linkup_counters(dd);68666853 /*68676854 * And (re)set link up default values.68686855 */68696856 set_linkup_defaults(ppd);6870685768586858+ /*68596859+ * Set VL15 credits. Use cached value from verify cap interrupt.68606860+ * In case of quick linkup or simulator, vl15 value will be set by68616861+ * handle_linkup_change. VerifyCap interrupt handler will not be68626862+ * called in those scenarios.68636863+ */68646864+ if (!(quick_linkup || dd->icode == ICODE_FUNCTIONAL_SIMULATOR))68656865+ set_up_vl15(dd, dd->vl15buf_cached);68666866+68716867 /* enforce link speed enabled */68726868 if ((ppd->link_speed_active & ppd->link_speed_enabled) == 0) {68736869 /* oops - current speed is not enabled, bounce */68746874- dd_dev_err(ppd->dd,68706870+ dd_dev_err(dd,68756871 "Link speed active 0x%x is outside enabled 0x%x, downing link\n",68766872 ppd->link_speed_active, ppd->link_speed_enabled);68776873 set_link_down_reason(ppd, OPA_LINKDOWN_REASON_SPEED_POLICY, 0,···73837357 */73847358 if (vau == 0)73857359 vau = 1;73867386- set_up_vl15(dd, vau, vl15buf);73607360+ set_up_vau(dd, vau);73617361+73627362+ /*73637363+ * Set VL15 credits to 0 in global credit register. Cache remote VL1573647364+ * credits value and wait for link-up interrupt ot set it.73657365+ */73667366+ set_up_vl15(dd, 0);73677367+ dd->vl15buf_cached = vl15buf;7387736873887369 /* set up the LCB CRC mode */73897370 crc_mask = ppd->port_crc_mode_enabled & partner_supported_crc;
···10451045 /* initial vl15 credits to use */10461046 u16 vl15_init;1047104710481048+ /*10491049+ * Cached value for vl15buf, read during verify cap interrupt. VL1510501050+ * credits are to be kept at 0 and set when handling the link-up10511051+ * interrupt. This removes the possibility of receiving VL15 MAD10521052+ * packets before this HFI is ready.10531053+ */10541054+ u16 vl15buf_cached;10551055+10481056 /* Misc small ints */10491057 u8 n_krcv_queues;10501058 u8 qos_shift;···16061598int fm_get_table(struct hfi1_pportdata *ppd, int which, void *t);16071599int fm_set_table(struct hfi1_pportdata *ppd, int which, void *t);1608160016091609-void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf);16011601+void set_up_vau(struct hfi1_devdata *dd, u8 vau);16021602+void set_up_vl15(struct hfi1_devdata *dd, u16 vl15buf);16101603void reset_link_credits(struct hfi1_devdata *dd);16111604void assign_remote_cm_au_table(struct hfi1_devdata *dd, u8 vcu);16121605
+2-1
drivers/infiniband/hw/hfi1/intr.c
···130130 * the remote values. Both sides must be using the values.131131 */132132 if (quick_linkup || dd->icode == ICODE_FUNCTIONAL_SIMULATOR) {133133- set_up_vl15(dd, dd->vau, dd->vl15_init);133133+ set_up_vau(dd, dd->vau);134134+ set_up_vl15(dd, dd->vl15_init);134135 assign_remote_cm_au_table(dd, dd->vcu);135136 }136137
+2-2
drivers/infiniband/hw/hfi1/pcie.c
···207207 /*208208 * Save BARs and command to rewrite after device reset.209209 */210210- dd->pcibar0 = addr;211211- dd->pcibar1 = addr >> 32;210210+ pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);211211+ pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);212212 pci_read_config_dword(dd->pcidev, PCI_ROM_ADDRESS, &dd->pci_rom);213213 pci_read_config_word(dd->pcidev, PCI_COMMAND, &dd->pci_command);214214 pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVCTL, &dd->pcie_devctl);
+4-1
drivers/infiniband/hw/hfi1/rc.c
···21592159 ret = hfi1_rvt_get_rwqe(qp, 1);21602160 if (ret < 0)21612161 goto nack_op_err;21622162- if (!ret)21622162+ if (!ret) {21632163+ /* peer will send again */21642164+ rvt_put_ss(&qp->r_sge);21632165 goto rnr_nak;21662166+ }21642167 wc.ex.imm_data = ohdr->u.rc.imm_data;21652168 wc.wc_flags = IB_WC_WITH_IMM;21662169 goto send_last;
···256256 return 0;257257}258258259259+#ifdef CONFIG_ACPI260260+static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,261261+ struct platform_device *pdev)262262+{263263+ unsigned long long hrv = 0;264264+ acpi_status status;265265+266266+ if (IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY) &&267267+ axp20x_pek->axp20x->variant == AXP288_ID) {268268+ status = acpi_evaluate_integer(ACPI_HANDLE(pdev->dev.parent),269269+ "_HRV", NULL, &hrv);270270+ if (ACPI_FAILURE(status))271271+ dev_err(&pdev->dev, "Failed to get PMIC hardware revision\n");272272+273273+ /*274274+ * On Cherry Trail platforms (hrv == 3), do not register the275275+ * input device if there is an "INTCFD9" or "ACPI0011" gpio276276+ * button ACPI device, as that handles the power button too,277277+ * and otherwise we end up reporting all presses twice.278278+ */279279+ if (hrv == 3 && (acpi_dev_present("INTCFD9", NULL, -1) ||280280+ acpi_dev_present("ACPI0011", NULL, -1)))281281+ return false;282282+283283+ }284284+285285+ return true;286286+}287287+#else288288+static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,289289+ struct platform_device *pdev)290290+{291291+ return true;292292+}293293+#endif294294+259295static int axp20x_pek_probe(struct platform_device *pdev)260296{261297 struct axp20x_pek *axp20x_pek;···304268305269 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);306270307307- /*308308- * Do not register the input device if there is an "INTCFD9"309309- * gpio button ACPI device, that handles the power button too,310310- * and otherwise we end up reporting all presses twice.311311- */312312- if (!acpi_dev_found("INTCFD9") ||313313- !IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY)) {271271+ if (axp20x_pek_should_register_input(axp20x_pek, pdev)) {314272 error = axp20x_pek_probe_input_device(axp20x_pek, pdev);315273 if (error)316274 return error;
+28-9
drivers/input/mouse/synaptics.c
···176176 NULL177177};178178179179+static const char * const forcepad_pnp_ids[] = {180180+ "SYN300D",181181+ "SYN3014",182182+ NULL183183+};184184+179185/*180186 * Send a command to the synpatics touchpad by special commands181187 */···403397{404398 int error;405399400400+ memset(info, 0, sizeof(*info));401401+406402 error = synaptics_identify(psmouse, info);407403 if (error)408404 return error;···486478 1264, 5675, 1171, 4688487479 },488480 { }489489-};490490-491491-/* This list has been kindly provided by Synaptics. */492492-static const char * const forcepad_pnp_ids[] = {493493- "SYN300D",494494- "SYN3014",495495- NULL496481};497482498483/*****************************************************************************···16881687 SYNAPTICS_INTERTOUCH_ON,16891688};1690168916911691-static int synaptics_intertouch = SYNAPTICS_INTERTOUCH_NOT_SET;16901690+static int synaptics_intertouch = IS_ENABLED(CONFIG_RMI4_SMB) ?16911691+ SYNAPTICS_INTERTOUCH_NOT_SET : SYNAPTICS_INTERTOUCH_OFF;16921692module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644);16931693MODULE_PARM_DESC(synaptics_intertouch, "Use a secondary bus for the Synaptics device.");16941694···1739173717401738 if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) {17411739 if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) &&17421742- !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids))17401740+ !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids)) {17411741+17421742+ if (!psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids))17431743+ psmouse_info(psmouse,17441744+ "Your touchpad (%s) says it can support a different bus. "17451745+ "If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.\n",17461746+ psmouse->ps2dev.serio->firmware_id);17471747+17431748 return -ENXIO;17491749+ }17441750 }1745175117461752 psmouse_info(psmouse, "Trying to set up SMBus access\n");···18201810 }1821181118221812 if (SYN_CAP_INTERTOUCH(info.ext_cap_0c)) {18131813+ if ((!IS_ENABLED(CONFIG_RMI4_SMB) ||18141814+ !IS_ENABLED(CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS)) &&18151815+ /* Forcepads need F21, which is not ready */18161816+ !psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) {18171817+ psmouse_warn(psmouse,18181818+ "The touchpad can support a better bus than the too old PS/2 protocol. "18191819+ "Make sure MOUSE_PS2_SYNAPTICS_SMBUS and RMI4_SMB are enabled to get a better touchpad experience.\n");18201820+ }18211821+18231822 error = synaptics_setup_intertouch(psmouse, &info, true);18241823 if (!error)18251824 return PSMOUSE_SYNAPTICS_SMBUS;
···17101710 }1711171117121712 /*17131713- * Try to avoid low memory issues when a device is suspended.17131713+ * Use __GFP_HIGH to avoid low memory issues when a device is17141714+ * suspended and the ioctl is needed to resume it.17141715 * Use kmalloc() rather than vmalloc() when we can.17151716 */17161717 dmi = NULL;17171718 noio_flag = memalloc_noio_save();17181718- dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL);17191719+ dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL | __GFP_HIGH);17191720 memalloc_noio_restore(noio_flag);1720172117211722 if (!dmi) {
···5555 * byte 1 for other packets in the page (PKT_N, for N > 0)5656 * ERR_COUNT_PKT_N is the max error count over all but the first packet.5757 */5858-#define DECODE_OK_PKT_0(v) ((v) & BIT(7))5959-#define DECODE_OK_PKT_N(v) ((v) & BIT(15))6058#define ERR_COUNT_PKT_0(v) (((v) >> 0) & 0x3f)6159#define ERR_COUNT_PKT_N(v) (((v) >> 8) & 0x3f)6060+#define DECODE_FAIL_PKT_0(v) (((v) & BIT(7)) == 0)6161+#define DECODE_FAIL_PKT_N(v) (((v) & BIT(15)) == 0)62626363/* Offsets relative to pbus_base */6464#define PBUS_CS_CTRL 0x83c···193193 chip->ecc.strength);194194 if (res < 0)195195 mtd->ecc_stats.failed++;196196+ else197197+ mtd->ecc_stats.corrected += res;196198197199 bitflips = max(res, bitflips);198200 buf += pkt_size;···204202 return bitflips;205203}206204207207-static int decode_error_report(struct tango_nfc *nfc)205205+static int decode_error_report(struct nand_chip *chip)208206{209207 u32 status, res;208208+ struct mtd_info *mtd = nand_to_mtd(chip);209209+ struct tango_nfc *nfc = to_tango_nfc(chip->controller);210210211211 status = readl_relaxed(nfc->reg_base + NFC_XFER_STATUS);212212 if (status & PAGE_IS_EMPTY)···216212217213 res = readl_relaxed(nfc->mem_base + ERROR_REPORT);218214219219- if (DECODE_OK_PKT_0(res) && DECODE_OK_PKT_N(res))220220- return max(ERR_COUNT_PKT_0(res), ERR_COUNT_PKT_N(res));215215+ if (DECODE_FAIL_PKT_0(res) || DECODE_FAIL_PKT_N(res))216216+ return -EBADMSG;221217222222- return -EBADMSG;218218+ /* ERR_COUNT_PKT_N is max, not sum, but that's all we have */219219+ mtd->ecc_stats.corrected +=220220+ ERR_COUNT_PKT_0(res) + ERR_COUNT_PKT_N(res);221221+222222+ return max(ERR_COUNT_PKT_0(res), ERR_COUNT_PKT_N(res));223223}224224225225static void tango_dma_callback(void *arg)···290282 if (err)291283 return err;292284293293- res = decode_error_report(nfc);285285+ res = decode_error_report(chip);294286 if (res < 0) {295287 chip->ecc.read_oob_raw(mtd, chip, page);296288 res = check_erased_page(chip, buf);···671663 { .compatible = "sigma,smp8758-nand" },672664 { /* sentinel */ }673665};666666+MODULE_DEVICE_TABLE(of, tango_nand_ids);674667675668static struct platform_driver tango_nand_driver = {676669 .probe = tango_nand_probe,
+11
drivers/perf/arm_pmu_acpi.c
···2929 return -EINVAL;30303131 gsi = gicc->performance_interrupt;3232+3333+ /*3434+ * Per the ACPI spec, the MADT cannot describe a PMU that doesn't3535+ * have an interrupt. QEMU advertises this by using a GSI of zero,3636+ * which is not known to be valid on any hardware despite being3737+ * valid per the spec. Take the pragmatic approach and reject a3838+ * GSI of zero for now.3939+ */4040+ if (!gsi)4141+ return 0;4242+3243 if (gicc->flags & ACPI_MADT_PERFORMANCE_IRQ_MODE)3344 trigger = ACPI_EDGE_SENSITIVE;3445 else
+3-17
drivers/pinctrl/core.c
···680680 * pinctrl_generic_free_groups() - removes all pin groups681681 * @pctldev: pin controller device682682 *683683- * Note that the caller must take care of locking.683683+ * Note that the caller must take care of locking. The pinctrl groups684684+ * are allocated with devm_kzalloc() so no need to free them here.684685 */685686static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev)686687{687688 struct radix_tree_iter iter;688688- struct group_desc *group;689689- unsigned long *indices;690689 void **slot;691691- int i = 0;692692-693693- indices = devm_kzalloc(pctldev->dev, sizeof(*indices) *694694- pctldev->num_groups, GFP_KERNEL);695695- if (!indices)696696- return;697690698691 radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0)699699- indices[i++] = iter.index;700700-701701- for (i = 0; i < pctldev->num_groups; i++) {702702- group = radix_tree_lookup(&pctldev->pin_group_tree,703703- indices[i]);704704- radix_tree_delete(&pctldev->pin_group_tree, indices[i]);705705- devm_kfree(pctldev->dev, group);706706- }692692+ radix_tree_delete(&pctldev->pin_group_tree, iter.index);707693708694 pctldev->num_groups = 0;709695}
···826826 * pinmux_generic_free_functions() - removes all functions827827 * @pctldev: pin controller device828828 *829829- * Note that the caller must take care of locking.829829+ * Note that the caller must take care of locking. The pinctrl830830+ * functions are allocated with devm_kzalloc() so no need to free831831+ * them here.830832 */831833void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)832834{833835 struct radix_tree_iter iter;834834- struct function_desc *function;835835- unsigned long *indices;836836 void **slot;837837- int i = 0;838838-839839- indices = devm_kzalloc(pctldev->dev, sizeof(*indices) *840840- pctldev->num_functions, GFP_KERNEL);841841- if (!indices)842842- return;843837844838 radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0)845845- indices[i++] = iter.index;846846-847847- for (i = 0; i < pctldev->num_functions; i++) {848848- function = radix_tree_lookup(&pctldev->pin_function_tree,849849- indices[i]);850850- radix_tree_delete(&pctldev->pin_function_tree, indices[i]);851851- devm_kfree(pctldev->dev, function);852852- }839839+ radix_tree_delete(&pctldev->pin_function_tree, iter.index);853840854841 pctldev->num_functions = 0;855842}
···18731873 tcp_task->dd_data = tdata;18741874 task->hdr = NULL;1875187518761876+ if (tdata->skb) {18771877+ kfree_skb(tdata->skb);18781878+ tdata->skb = NULL;18791879+ }18801880+18761881 if (SKB_MAX_HEAD(cdev->skb_tx_rsvd) > (512 * MAX_SKB_FRAGS) &&18771882 (opcode == ISCSI_OP_SCSI_DATA_OUT ||18781883 (opcode == ISCSI_OP_SCSI_CMD &&···18951890 return -ENOMEM;18961891 }1897189218931893+ skb_get(tdata->skb);18981894 skb_reserve(tdata->skb, cdev->skb_tx_rsvd);18991895 task->hdr = (struct iscsi_hdr *)tdata->skb->data;19001896 task->hdr_max = SKB_TX_ISCSI_PDU_HEADER_MAX; /* BHS + AHS */···20412035 unsigned int datalen;20422036 int err;2043203720442044- if (!skb) {20382038+ if (!skb || cxgbi_skcb_test_flag(skb, SKCBF_TX_DONE)) {20452039 log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,20462046- "task 0x%p, skb NULL.\n", task);20402040+ "task 0x%p, skb 0x%p\n", task, skb);20472041 return 0;20482042 }20492043···20562050 }2057205120582052 datalen = skb->data_len;20592059- tdata->skb = NULL;2060205320612054 /* write ppod first if using ofldq to write ppod */20622055 if (ttinfo->flags & CXGBI_PPOD_INFO_FLAG_VALID) {···20832078 pdulen += ISCSI_DIGEST_SIZE;2084207920852080 task->conn->txdata_octets += pdulen;20812081+ cxgbi_skcb_set_flag(skb, SKCBF_TX_DONE);20862082 return 0;20872083 }20882084···20922086 "task 0x%p, skb 0x%p, len %u/%u, %d EAGAIN.\n",20932087 task, skb, skb->len, skb->data_len, err);20942088 /* reset skb to send when we are called again */20952095- tdata->skb = skb;20962089 return err;20972090 }20982091···20992094 "itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",21002095 task->itt, skb, skb->len, skb->data_len, err);2101209621022102- kfree_skb(skb);20972097+ __kfree_skb(tdata->skb);20982098+ tdata->skb = NULL;2103209921042100 iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err);21052101 iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED);···2119211321202114 tcp_task->dd_data = NULL;21212115 /* never reached the xmit task callout */21222122- if (tdata->skb)21232123- __kfree_skb(tdata->skb);21162116+ if (tdata->skb) {21172117+ kfree_skb(tdata->skb);21182118+ tdata->skb = NULL;21192119+ }2124212021252121 task_release_itt(task, task->hdr_itt);21262122 memset(tdata, 0, sizeof(*tdata));···27222714static int __init libcxgbi_init_module(void)27232715{27242716 pr_info("%s", version);27172717+27182718+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, cb) <27192719+ sizeof(struct cxgbi_skb_cb));27252720 return 0;27262721}27272722
+8-8
drivers/scsi/cxgbi/libcxgbi.h
···195195};196196197197struct cxgbi_skb_tx_cb {198198- void *l2t;198198+ void *handle;199199+ void *arp_err_handler;199200 struct sk_buff *wr_next;200201};201202···204203 SKCBF_TX_NEED_HDR, /* packet needs a header */205204 SKCBF_TX_MEM_WRITE, /* memory write */206205 SKCBF_TX_FLAG_COMPL, /* wr completion flag */206206+ SKCBF_TX_DONE, /* skb tx done */207207 SKCBF_RX_COALESCED, /* received whole pdu */208208 SKCBF_RX_HDR, /* received pdu header */209209 SKCBF_RX_DATA, /* received pdu payload */···217215};218216219217struct cxgbi_skb_cb {220220- unsigned char ulp_mode;221221- unsigned long flags;222222- unsigned int seq;223218 union {224219 struct cxgbi_skb_rx_cb rx;225220 struct cxgbi_skb_tx_cb tx;226221 };222222+ unsigned char ulp_mode;223223+ unsigned long flags;224224+ unsigned int seq;227225};228226229227#define CXGBI_SKB_CB(skb) ((struct cxgbi_skb_cb *)&((skb)->cb[0]))···376374 cxgbi_skcb_tx_wr_next(skb) = NULL;377375 /*378376 * We want to take an extra reference since both us and the driver379379- * need to free the packet before it's really freed. We know there's380380- * just one user currently so we use atomic_set rather than skb_get381381- * to avoid the atomic op.377377+ * need to free the packet before it's really freed.382378 */383383- atomic_set(&skb->users, 2);379379+ skb_get(skb);384380385381 if (!csk->wr_pending_head)386382 csk->wr_pending_head = skb;
···11701170 cmd = list_first_entry_or_null(&vscsi->free_cmd,11711171 struct ibmvscsis_cmd, list);11721172 if (cmd) {11731173+ if (cmd->abort_cmd)11741174+ cmd->abort_cmd = NULL;11731175 cmd->flags &= ~(DELAY_SEND);11741176 list_del(&cmd->list);11751177 cmd->iue = iue;···17761774 if (cmd->abort_cmd) {17771775 retry = true;17781776 cmd->abort_cmd->flags &= ~(DELAY_SEND);17771777+ cmd->abort_cmd = NULL;17791778 }1780177917811780 /*···17911788 list_del(&cmd->list);17921789 ibmvscsis_free_cmd_resources(vscsi,17931790 cmd);17911791+ /*17921792+ * With a successfully aborted op17931793+ * through LIO we want to increment the17941794+ * the vscsi credit so that when we dont17951795+ * send a rsp to the original scsi abort17961796+ * op (h_send_crq), but the tm rsp to17971797+ * the abort is sent, the credit is17981798+ * correctly sent with the abort tm rsp.17991799+ * We would need 1 for the abort tm rsp18001800+ * and 1 credit for the aborted scsi op.18011801+ * Thus we need to increment here.18021802+ * Also we want to increment the credit18031803+ * here because we want to make sure18041804+ * cmd is actually released first18051805+ * otherwise the client will think it18061806+ * it can send a new cmd, and we could18071807+ * find ourselves short of cmd elements.18081808+ */18091809+ vscsi->credit += 1;17941810 } else {17951811 iue = cmd->iue;17961812···2984296229852963 rsp->opcode = SRP_RSP;2986296429872987- if (vscsi->credit > 0 && vscsi->state == SRP_PROCESSING)29882988- rsp->req_lim_delta = cpu_to_be32(vscsi->credit);29892989- else29902990- rsp->req_lim_delta = cpu_to_be32(1 + vscsi->credit);29652965+ rsp->req_lim_delta = cpu_to_be32(1 + vscsi->credit);29912966 rsp->tag = cmd->rsp.tag;29922967 rsp->flags = 0;29932968
···493493494494static int iscsi_target_do_login(struct iscsi_conn *, struct iscsi_login *);495495496496-static bool iscsi_target_sk_state_check(struct sock *sk)496496+static bool __iscsi_target_sk_check_close(struct sock *sk)497497{498498 if (sk->sk_state == TCP_CLOSE_WAIT || sk->sk_state == TCP_CLOSE) {499499- pr_debug("iscsi_target_sk_state_check: TCP_CLOSE_WAIT|TCP_CLOSE,"499499+ pr_debug("__iscsi_target_sk_check_close: TCP_CLOSE_WAIT|TCP_CLOSE,"500500 "returning FALSE\n");501501- return false;501501+ return true;502502 }503503- return true;503503+ return false;504504+}505505+506506+static bool iscsi_target_sk_check_close(struct iscsi_conn *conn)507507+{508508+ bool state = false;509509+510510+ if (conn->sock) {511511+ struct sock *sk = conn->sock->sk;512512+513513+ read_lock_bh(&sk->sk_callback_lock);514514+ state = (__iscsi_target_sk_check_close(sk) ||515515+ test_bit(LOGIN_FLAGS_CLOSED, &conn->login_flags));516516+ read_unlock_bh(&sk->sk_callback_lock);517517+ }518518+ return state;519519+}520520+521521+static bool iscsi_target_sk_check_flag(struct iscsi_conn *conn, unsigned int flag)522522+{523523+ bool state = false;524524+525525+ if (conn->sock) {526526+ struct sock *sk = conn->sock->sk;527527+528528+ read_lock_bh(&sk->sk_callback_lock);529529+ state = test_bit(flag, &conn->login_flags);530530+ read_unlock_bh(&sk->sk_callback_lock);531531+ }532532+ return state;533533+}534534+535535+static bool iscsi_target_sk_check_and_clear(struct iscsi_conn *conn, unsigned int flag)536536+{537537+ bool state = false;538538+539539+ if (conn->sock) {540540+ struct sock *sk = conn->sock->sk;541541+542542+ write_lock_bh(&sk->sk_callback_lock);543543+ state = (__iscsi_target_sk_check_close(sk) ||544544+ test_bit(LOGIN_FLAGS_CLOSED, &conn->login_flags));545545+ if (!state)546546+ clear_bit(flag, &conn->login_flags);547547+ write_unlock_bh(&sk->sk_callback_lock);548548+ }549549+ return state;504550}505551506552static void iscsi_target_login_drop(struct iscsi_conn *conn, struct iscsi_login *login)···586540587541 pr_debug("entering iscsi_target_do_login_rx, conn: %p, %s:%d\n",588542 conn, current->comm, current->pid);543543+ /*544544+ * If iscsi_target_do_login_rx() has been invoked by ->sk_data_ready()545545+ * before initial PDU processing in iscsi_target_start_negotiation()546546+ * has completed, go ahead and retry until it's cleared.547547+ *548548+ * Otherwise if the TCP connection drops while this is occuring,549549+ * iscsi_target_start_negotiation() will detect the failure, call550550+ * cancel_delayed_work_sync(&conn->login_work), and cleanup the551551+ * remaining iscsi connection resources from iscsi_np process context.552552+ */553553+ if (iscsi_target_sk_check_flag(conn, LOGIN_FLAGS_INITIAL_PDU)) {554554+ schedule_delayed_work(&conn->login_work, msecs_to_jiffies(10));555555+ return;556556+ }589557590558 spin_lock(&tpg->tpg_state_lock);591559 state = (tpg->tpg_state == TPG_STATE_ACTIVE);···607547608548 if (!state) {609549 pr_debug("iscsi_target_do_login_rx: tpg_state != TPG_STATE_ACTIVE\n");610610- iscsi_target_restore_sock_callbacks(conn);611611- iscsi_target_login_drop(conn, login);612612- iscsit_deaccess_np(np, tpg, tpg_np);613613- return;550550+ goto err;614551 }615552616616- if (conn->sock) {617617- struct sock *sk = conn->sock->sk;618618-619619- read_lock_bh(&sk->sk_callback_lock);620620- state = iscsi_target_sk_state_check(sk);621621- read_unlock_bh(&sk->sk_callback_lock);622622-623623- if (!state) {624624- pr_debug("iscsi_target_do_login_rx, TCP state CLOSE\n");625625- iscsi_target_restore_sock_callbacks(conn);626626- iscsi_target_login_drop(conn, login);627627- iscsit_deaccess_np(np, tpg, tpg_np);628628- return;629629- }553553+ if (iscsi_target_sk_check_close(conn)) {554554+ pr_debug("iscsi_target_do_login_rx, TCP state CLOSE\n");555555+ goto err;630556 }631557632558 conn->login_kworker = current;···630584 flush_signals(current);631585 conn->login_kworker = NULL;632586633633- if (rc < 0) {634634- iscsi_target_restore_sock_callbacks(conn);635635- iscsi_target_login_drop(conn, login);636636- iscsit_deaccess_np(np, tpg, tpg_np);637637- return;638638- }587587+ if (rc < 0)588588+ goto err;639589640590 pr_debug("iscsi_target_do_login_rx after rx_login_io, %p, %s:%d\n",641591 conn, current->comm, current->pid);642592643593 rc = iscsi_target_do_login(conn, login);644594 if (rc < 0) {645645- iscsi_target_restore_sock_callbacks(conn);646646- iscsi_target_login_drop(conn, login);647647- iscsit_deaccess_np(np, tpg, tpg_np);595595+ goto err;648596 } else if (!rc) {649649- if (conn->sock) {650650- struct sock *sk = conn->sock->sk;651651-652652- write_lock_bh(&sk->sk_callback_lock);653653- clear_bit(LOGIN_FLAGS_READ_ACTIVE, &conn->login_flags);654654- write_unlock_bh(&sk->sk_callback_lock);655655- }597597+ if (iscsi_target_sk_check_and_clear(conn, LOGIN_FLAGS_READ_ACTIVE))598598+ goto err;656599 } else if (rc == 1) {657600 iscsi_target_nego_release(conn);658601 iscsi_post_login_handler(np, conn, zero_tsih);659602 iscsit_deaccess_np(np, tpg, tpg_np);660603 }604604+ return;605605+606606+err:607607+ iscsi_target_restore_sock_callbacks(conn);608608+ iscsi_target_login_drop(conn, login);609609+ iscsit_deaccess_np(np, tpg, tpg_np);661610}662611663612static void iscsi_target_do_cleanup(struct work_struct *work)···700659 orig_state_change(sk);701660 return;702661 }662662+ state = __iscsi_target_sk_check_close(sk);663663+ pr_debug("__iscsi_target_sk_close_change: state: %d\n", state);664664+703665 if (test_bit(LOGIN_FLAGS_READ_ACTIVE, &conn->login_flags)) {704666 pr_debug("Got LOGIN_FLAGS_READ_ACTIVE=1 sk_state_change"705667 " conn: %p\n", conn);668668+ if (state)669669+ set_bit(LOGIN_FLAGS_CLOSED, &conn->login_flags);706670 write_unlock_bh(&sk->sk_callback_lock);707671 orig_state_change(sk);708672 return;709673 }710710- if (test_and_set_bit(LOGIN_FLAGS_CLOSED, &conn->login_flags)) {674674+ if (test_bit(LOGIN_FLAGS_CLOSED, &conn->login_flags)) {711675 pr_debug("Got LOGIN_FLAGS_CLOSED=1 sk_state_change conn: %p\n",712676 conn);713677 write_unlock_bh(&sk->sk_callback_lock);714678 orig_state_change(sk);715679 return;716680 }717717-718718- state = iscsi_target_sk_state_check(sk);719719- write_unlock_bh(&sk->sk_callback_lock);720720-721721- pr_debug("iscsi_target_sk_state_change: state: %d\n", state);722722-723723- if (!state) {681681+ /*682682+ * If the TCP connection has dropped, go ahead and set LOGIN_FLAGS_CLOSED,683683+ * but only queue conn->login_work -> iscsi_target_do_login_rx()684684+ * processing if LOGIN_FLAGS_INITIAL_PDU has already been cleared.685685+ *686686+ * When iscsi_target_do_login_rx() runs, iscsi_target_sk_check_close()687687+ * will detect the dropped TCP connection from delayed workqueue context.688688+ *689689+ * If LOGIN_FLAGS_INITIAL_PDU is still set, which means the initial690690+ * iscsi_target_start_negotiation() is running, iscsi_target_do_login()691691+ * via iscsi_target_sk_check_close() or iscsi_target_start_negotiation()692692+ * via iscsi_target_sk_check_and_clear() is responsible for detecting the693693+ * dropped TCP connection in iscsi_np process context, and cleaning up694694+ * the remaining iscsi connection resources.695695+ */696696+ if (state) {724697 pr_debug("iscsi_target_sk_state_change got failed state\n");725725- schedule_delayed_work(&conn->login_cleanup_work, 0);698698+ set_bit(LOGIN_FLAGS_CLOSED, &conn->login_flags);699699+ state = test_bit(LOGIN_FLAGS_INITIAL_PDU, &conn->login_flags);700700+ write_unlock_bh(&sk->sk_callback_lock);701701+702702+ orig_state_change(sk);703703+704704+ if (!state)705705+ schedule_delayed_work(&conn->login_work, 0);726706 return;727707 }708708+ write_unlock_bh(&sk->sk_callback_lock);709709+728710 orig_state_change(sk);729711}730712···1010946 if (iscsi_target_handle_csg_one(conn, login) < 0)1011947 return -1;1012948 if (login_rsp->flags & ISCSI_FLAG_LOGIN_TRANSIT) {949949+ /*950950+ * Check to make sure the TCP connection has not951951+ * dropped asynchronously while session reinstatement952952+ * was occuring in this kthread context, before953953+ * transitioning to full feature phase operation.954954+ */955955+ if (iscsi_target_sk_check_close(conn))956956+ return -1;957957+1013958 login->tsih = conn->sess->tsih;1014959 login->login_complete = 1;1015960 iscsi_target_restore_sock_callbacks(conn);···1043970 login_rsp->flags &= ~ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK;1044971 }1045972 break;10461046- }10471047-10481048- if (conn->sock) {10491049- struct sock *sk = conn->sock->sk;10501050- bool state;10511051-10521052- read_lock_bh(&sk->sk_callback_lock);10531053- state = iscsi_target_sk_state_check(sk);10541054- read_unlock_bh(&sk->sk_callback_lock);10551055-10561056- if (!state) {10571057- pr_debug("iscsi_target_do_login() failed state for"10581058- " conn: %p\n", conn);10591059- return -1;10601060- }1061973 }10629741063975 return 0;···1313125513141256 write_lock_bh(&sk->sk_callback_lock);13151257 set_bit(LOGIN_FLAGS_READY, &conn->login_flags);12581258+ set_bit(LOGIN_FLAGS_INITIAL_PDU, &conn->login_flags);13161259 write_unlock_bh(&sk->sk_callback_lock);13171260 }13181318-12611261+ /*12621262+ * If iscsi_target_do_login returns zero to signal more PDU12631263+ * exchanges are required to complete the login, go ahead and12641264+ * clear LOGIN_FLAGS_INITIAL_PDU but only if the TCP connection12651265+ * is still active.12661266+ *12671267+ * Otherwise if TCP connection dropped asynchronously, go ahead12681268+ * and perform connection cleanup now.12691269+ */13191270 ret = iscsi_target_do_login(conn, login);12711271+ if (!ret && iscsi_target_sk_check_and_clear(conn, LOGIN_FLAGS_INITIAL_PDU))12721272+ ret = -1;12731273+13201274 if (ret < 0) {13211275 cancel_delayed_work_sync(&conn->login_work);13221276 cancel_delayed_work_sync(&conn->login_cleanup_work);
+18-5
drivers/target/target_core_transport.c
···11601160 if (cmd->unknown_data_length) {11611161 cmd->data_length = size;11621162 } else if (size != cmd->data_length) {11631163- pr_warn("TARGET_CORE[%s]: Expected Transfer Length:"11631163+ pr_warn_ratelimited("TARGET_CORE[%s]: Expected Transfer Length:"11641164 " %u does not match SCSI CDB Length: %u for SAM Opcode:"11651165 " 0x%02x\n", cmd->se_tfo->get_fabric_name(),11661166 cmd->data_length, size, cmd->t_task_cdb[0]);1167116711681168- if (cmd->data_direction == DMA_TO_DEVICE &&11691169- cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {11701170- pr_err("Rejecting underflow/overflow WRITE data\n");11711171- return TCM_INVALID_CDB_FIELD;11681168+ if (cmd->data_direction == DMA_TO_DEVICE) {11691169+ if (cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {11701170+ pr_err_ratelimited("Rejecting underflow/overflow"11711171+ " for WRITE data CDB\n");11721172+ return TCM_INVALID_CDB_FIELD;11731173+ }11741174+ /*11751175+ * Some fabric drivers like iscsi-target still expect to11761176+ * always reject overflow writes. Reject this case until11771177+ * full fabric driver level support for overflow writes11781178+ * is introduced tree-wide.11791179+ */11801180+ if (size > cmd->data_length) {11811181+ pr_err_ratelimited("Rejecting overflow for"11821182+ " WRITE control CDB\n");11831183+ return TCM_INVALID_CDB_FIELD;11841184+ }11721185 }11731186 /*11741187 * Reject READ_* or WRITE_* with overflow/underflow for
···3434 if (!disc)3535 return 0;36363737- mutex_lock(&tty->atomic_write_lock);3837 ret = tty_ldisc_receive_buf(disc, p, (char *)f, count);3939- mutex_unlock(&tty->atomic_write_lock);40384139 tty_ldisc_deref(disc);4240
+23
fs/dax.c
···11551155 }1156115611571157 /*11581158+ * It is possible, particularly with mixed reads & writes to private11591159+ * mappings, that we have raced with a PMD fault that overlaps with11601160+ * the PTE we need to set up. If so just return and the fault will be11611161+ * retried.11621162+ */11631163+ if (pmd_trans_huge(*vmf->pmd) || pmd_devmap(*vmf->pmd)) {11641164+ vmf_ret = VM_FAULT_NOPAGE;11651165+ goto unlock_entry;11661166+ }11671167+11681168+ /*11581169 * Note that we don't bother to use iomap_apply here: DAX required11591170 * the file system block size to be equal the page size, which means11601171 * that we never have to deal with more than a single extent here.···14071396 entry = grab_mapping_entry(mapping, pgoff, RADIX_DAX_PMD);14081397 if (IS_ERR(entry))14091398 goto fallback;13991399+14001400+ /*14011401+ * It is possible, particularly with mixed reads & writes to private14021402+ * mappings, that we have raced with a PTE fault that overlaps with14031403+ * the PMD we need to set up. If so just return and the fault will be14041404+ * retried.14051405+ */14061406+ if (!pmd_none(*vmf->pmd) && !pmd_trans_huge(*vmf->pmd) &&14071407+ !pmd_devmap(*vmf->pmd)) {14081408+ result = 0;14091409+ goto unlock_entry;14101410+ }1410141114111412 /*14121413 * Note that we don't use iomap_apply here. We aren't doing I/O, only
···177177 if (status)178178 goto out;179179180180- if (!nfs_write_verifier_cmp(&res->write_res.verifier.verifier,180180+ if (nfs_write_verifier_cmp(&res->write_res.verifier.verifier,181181 &res->commit_res.verf->verifier)) {182182 status = -EAGAIN;183183 goto out;
···20942094}20952095EXPORT_SYMBOL_GPL(pnfs_generic_pg_check_layout);2096209620972097+/*20982098+ * Check for any intersection between the request and the pgio->pg_lseg,20992099+ * and if none, put this pgio->pg_lseg away.21002100+ */21012101+static void21022102+pnfs_generic_pg_check_range(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)21032103+{21042104+ if (pgio->pg_lseg && !pnfs_lseg_request_intersecting(pgio->pg_lseg, req)) {21052105+ pnfs_put_lseg(pgio->pg_lseg);21062106+ pgio->pg_lseg = NULL;21072107+ }21082108+}21092109+20972110void20982111pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)20992112{21002113 u64 rd_size = req->wb_bytes;2101211421022115 pnfs_generic_pg_check_layout(pgio);21162116+ pnfs_generic_pg_check_range(pgio, req);21032117 if (pgio->pg_lseg == NULL) {21042118 if (pgio->pg_dreq == NULL)21052119 rd_size = i_size_read(pgio->pg_inode) - req_offset(req);···21452131 struct nfs_page *req, u64 wb_size)21462132{21472133 pnfs_generic_pg_check_layout(pgio);21342134+ pnfs_generic_pg_check_range(pgio, req);21482135 if (pgio->pg_lseg == NULL) {21492136 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,21502137 req->wb_context,···22062191 seg_end = pnfs_end_offset(pgio->pg_lseg->pls_range.offset,22072192 pgio->pg_lseg->pls_range.length);22082193 req_start = req_offset(req);22092209- WARN_ON_ONCE(req_start >= seg_end);21942194+22102195 /* start of request is past the last byte of this segment */22112211- if (req_start >= seg_end) {22122212- /* reference the new lseg */22132213- if (pgio->pg_ops->pg_cleanup)22142214- pgio->pg_ops->pg_cleanup(pgio);22152215- if (pgio->pg_ops->pg_init)22162216- pgio->pg_ops->pg_init(pgio, req);21962196+ if (req_start >= seg_end)22172197 return 0;22182218- }2219219822202199 /* adjust 'size' iff there are fewer bytes left in the22212200 * segment than what nfs_generic_pg_test returned */
···23012301/*23022302 * Initialise the common bits of the superblock23032303 */23042304-inline void nfs_initialise_sb(struct super_block *sb)23042304+static void nfs_initialise_sb(struct super_block *sb)23052305{23062306 struct nfs_server *server = NFS_SB(sb);23072307···23482348/*23492349 * Finish setting up a cloned NFS2/3/4 superblock23502350 */23512351-void nfs_clone_super(struct super_block *sb, struct nfs_mount_info *mount_info)23512351+static void nfs_clone_super(struct super_block *sb,23522352+ struct nfs_mount_info *mount_info)23522353{23532354 const struct super_block *old_sb = mount_info->cloned->sb;23542355 struct nfs_server *server = NFS_SB(sb);
+6-17
fs/nfsd/nfs3xdr.c
···334334 if (!p)335335 return 0;336336 p = xdr_decode_hyper(p, &args->offset);337337+337338 args->count = ntohl(*p++);338338-339339- if (!xdr_argsize_check(rqstp, p))340340- return 0;341341-342339 len = min(args->count, max_blocksize);343340344341 /* set up the kvec */···349352 v++;350353 }351354 args->vlen = v;352352- return 1;355355+ return xdr_argsize_check(rqstp, p);353356}354357355358int···541544 p = decode_fh(p, &args->fh);542545 if (!p)543546 return 0;544544- if (!xdr_argsize_check(rqstp, p))545545- return 0;546547 args->buffer = page_address(*(rqstp->rq_next_page++));547548548548- return 1;549549+ return xdr_argsize_check(rqstp, p);549550}550551551552int···569574 args->verf = p; p += 2;570575 args->dircount = ~0;571576 args->count = ntohl(*p++);572572-573573- if (!xdr_argsize_check(rqstp, p))574574- return 0;575575-576577 args->count = min_t(u32, args->count, PAGE_SIZE);577578 args->buffer = page_address(*(rqstp->rq_next_page++));578579579579- return 1;580580+ return xdr_argsize_check(rqstp, p);580581}581582582583int···590599 args->dircount = ntohl(*p++);591600 args->count = ntohl(*p++);592601593593- if (!xdr_argsize_check(rqstp, p))594594- return 0;595595-596602 len = args->count = min(args->count, max_blocksize);597603 while (len > 0) {598604 struct page *p = *(rqstp->rq_next_page++);···597609 args->buffer = page_address(p);598610 len -= PAGE_SIZE;599611 }600600- return 1;612612+613613+ return xdr_argsize_check(rqstp, p);601614}602615603616int
+6-7
fs/nfsd/nfs4proc.c
···17691769 opdesc->op_get_currentstateid(cstate, &op->u);17701770 op->status = opdesc->op_func(rqstp, cstate, &op->u);1771177117721772+ /* Only from SEQUENCE */17731773+ if (cstate->status == nfserr_replay_cache) {17741774+ dprintk("%s NFS4.1 replay from cache\n", __func__);17751775+ status = op->status;17761776+ goto out;17771777+ }17721778 if (!op->status) {17731779 if (opdesc->op_set_currentstateid)17741780 opdesc->op_set_currentstateid(cstate, &op->u);···17851779 if (need_wrongsec_check(rqstp))17861780 op->status = check_nfsd_access(current_fh->fh_export, rqstp);17871781 }17881788-17891782encode_op:17901790- /* Only from SEQUENCE */17911791- if (cstate->status == nfserr_replay_cache) {17921792- dprintk("%s NFS4.1 replay from cache\n", __func__);17931793- status = op->status;17941794- goto out;17951795- }17961783 if (op->status == nfserr_replay_me) {17971784 op->replay = &cstate->replay_owner->so_replay;17981785 nfsd4_encode_replay(&resp->xdr, op);
+3-10
fs/nfsd/nfsxdr.c
···257257 len = args->count = ntohl(*p++);258258 p++; /* totalcount - unused */259259260260- if (!xdr_argsize_check(rqstp, p))261261- return 0;262262-263260 len = min_t(unsigned int, len, NFSSVC_MAXBLKSIZE_V2);264261265262 /* set up somewhere to store response.···272275 v++;273276 }274277 args->vlen = v;275275- return 1;278278+ return xdr_argsize_check(rqstp, p);276279}277280278281int···362365 p = decode_fh(p, &args->fh);363366 if (!p)364367 return 0;365365- if (!xdr_argsize_check(rqstp, p))366366- return 0;367368 args->buffer = page_address(*(rqstp->rq_next_page++));368369369369- return 1;370370+ return xdr_argsize_check(rqstp, p);370371}371372372373int···402407 args->cookie = ntohl(*p++);403408 args->count = ntohl(*p++);404409 args->count = min_t(u32, args->count, PAGE_SIZE);405405- if (!xdr_argsize_check(rqstp, p))406406- return 0;407410 args->buffer = page_address(*(rqstp->rq_next_page++));408411409409- return 1;412412+ return xdr_argsize_check(rqstp, p);410413}411414412415/*
+1-1
fs/ntfs/namei.c
···159159 PTR_ERR(dent_inode));160160 kfree(name);161161 /* Return the error code. */162162- return (struct dentry *)dent_inode;162162+ return ERR_CAST(dent_inode);163163 }164164 /* It is guaranteed that @name is no longer allocated at this point. */165165 if (MREF_ERR(mref) == -ENOENT) {
···11config OVERLAY_FS22 tristate "Overlay filesystem support"33+ select EXPORTFS34 help45 An overlay filesystem combines two filesystems - an 'upper' filesystem56 and a 'lower' filesystem. When a name exists in both filesystems, the
+17-7
fs/overlayfs/copy_up.c
···300300 return PTR_ERR(fh);301301 }302302303303- err = ovl_do_setxattr(upper, OVL_XATTR_ORIGIN, fh, fh ? fh->len : 0, 0);303303+ /*304304+ * Do not fail when upper doesn't support xattrs.305305+ */306306+ err = ovl_check_setxattr(dentry, upper, OVL_XATTR_ORIGIN, fh,307307+ fh ? fh->len : 0, 0);304308 kfree(fh);305309306310 return err;···346342 if (tmpfile)347343 temp = ovl_do_tmpfile(upperdir, stat->mode);348344 else349349- temp = ovl_lookup_temp(workdir, dentry);350350- err = PTR_ERR(temp);351351- if (IS_ERR(temp))352352- goto out1;353353-345345+ temp = ovl_lookup_temp(workdir);354346 err = 0;355355- if (!tmpfile)347347+ if (IS_ERR(temp)) {348348+ err = PTR_ERR(temp);349349+ temp = NULL;350350+ }351351+352352+ if (!err && !tmpfile)356353 err = ovl_create_real(wdir, temp, &cattr, NULL, true);357354358355 if (new_creds) {···458453459454 ovl_path_upper(parent, &parentpath);460455 upperdir = parentpath.dentry;456456+457457+ /* Mark parent "impure" because it may now contain non-pure upper */458458+ err = ovl_set_impure(parent, upperdir);459459+ if (err)460460+ return err;461461462462 err = vfs_getattr(&parentpath, &pstat,463463 STATX_ATIME | STATX_MTIME, AT_STATX_SYNC_AS_STAT);
+47-14
fs/overlayfs/dir.c
···4141 }4242}43434444-struct dentry *ovl_lookup_temp(struct dentry *workdir, struct dentry *dentry)4444+struct dentry *ovl_lookup_temp(struct dentry *workdir)4545{4646 struct dentry *temp;4747 char name[20];···6868 struct dentry *whiteout;6969 struct inode *wdir = workdir->d_inode;70707171- whiteout = ovl_lookup_temp(workdir, dentry);7171+ whiteout = ovl_lookup_temp(workdir);7272 if (IS_ERR(whiteout))7373 return whiteout;7474···127127 return err;128128}129129130130-static int ovl_set_opaque(struct dentry *dentry, struct dentry *upperdentry)130130+static int ovl_set_opaque_xerr(struct dentry *dentry, struct dentry *upper,131131+ int xerr)131132{132133 int err;133134134134- err = ovl_do_setxattr(upperdentry, OVL_XATTR_OPAQUE, "y", 1, 0);135135+ err = ovl_check_setxattr(dentry, upper, OVL_XATTR_OPAQUE, "y", 1, xerr);135136 if (!err)136137 ovl_dentry_set_opaque(dentry);137138138139 return err;140140+}141141+142142+static int ovl_set_opaque(struct dentry *dentry, struct dentry *upperdentry)143143+{144144+ /*145145+ * Fail with -EIO when trying to create opaque dir and upper doesn't146146+ * support xattrs. ovl_rename() calls ovl_set_opaque_xerr(-EXDEV) to147147+ * return a specific error for noxattr case.148148+ */149149+ return ovl_set_opaque_xerr(dentry, upperdentry, -EIO);139150}140151141152/* Common operations required to be done after creation of file on upper */···171160static bool ovl_type_merge(struct dentry *dentry)172161{173162 return OVL_TYPE_MERGE(ovl_path_type(dentry));163163+}164164+165165+static bool ovl_type_origin(struct dentry *dentry)166166+{167167+ return OVL_TYPE_ORIGIN(ovl_path_type(dentry));174168}175169176170static int ovl_create_upper(struct dentry *dentry, struct inode *inode,···266250 if (upper->d_parent->d_inode != udir)267251 goto out_unlock;268252269269- opaquedir = ovl_lookup_temp(workdir, dentry);253253+ opaquedir = ovl_lookup_temp(workdir);270254 err = PTR_ERR(opaquedir);271255 if (IS_ERR(opaquedir))272256 goto out_unlock;···398382 if (err)399383 goto out;400384401401- newdentry = ovl_lookup_temp(workdir, dentry);385385+ newdentry = ovl_lookup_temp(workdir);402386 err = PTR_ERR(newdentry);403387 if (IS_ERR(newdentry))404388 goto out_unlock;···862846 if (IS_ERR(redirect))863847 return PTR_ERR(redirect);864848865865- err = ovl_do_setxattr(ovl_dentry_upper(dentry), OVL_XATTR_REDIRECT,866866- redirect, strlen(redirect), 0);849849+ err = ovl_check_setxattr(dentry, ovl_dentry_upper(dentry),850850+ OVL_XATTR_REDIRECT,851851+ redirect, strlen(redirect), -EXDEV);867852 if (!err) {868853 spin_lock(&dentry->d_lock);869854 ovl_dentry_set_redirect(dentry, redirect);870855 spin_unlock(&dentry->d_lock);871856 } else {872857 kfree(redirect);873873- if (err == -EOPNOTSUPP)874874- ovl_clear_redirect_dir(dentry->d_sb);875875- else876876- pr_warn_ratelimited("overlay: failed to set redirect (%i)\n", err);858858+ pr_warn_ratelimited("overlay: failed to set redirect (%i)\n", err);877859 /* Fall back to userspace copy-up */878860 err = -EXDEV;879861 }···957943 old_upperdir = ovl_dentry_upper(old->d_parent);958944 new_upperdir = ovl_dentry_upper(new->d_parent);959945946946+ if (!samedir) {947947+ /*948948+ * When moving a merge dir or non-dir with copy up origin into949949+ * a new parent, we are marking the new parent dir "impure".950950+ * When ovl_iterate() iterates an "impure" upper dir, it will951951+ * lookup the origin inodes of the entries to fill d_ino.952952+ */953953+ if (ovl_type_origin(old)) {954954+ err = ovl_set_impure(new->d_parent, new_upperdir);955955+ if (err)956956+ goto out_revert_creds;957957+ }958958+ if (!overwrite && ovl_type_origin(new)) {959959+ err = ovl_set_impure(old->d_parent, old_upperdir);960960+ if (err)961961+ goto out_revert_creds;962962+ }963963+ }964964+960965 trap = lock_rename(new_upperdir, old_upperdir);961966962967 olddentry = lookup_one_len(old->d_name.name, old_upperdir,···1025992 if (ovl_type_merge_or_lower(old))1026993 err = ovl_set_redirect(old, samedir);1027994 else if (!old_opaque && ovl_type_merge(new->d_parent))10281028- err = ovl_set_opaque(old, olddentry);995995+ err = ovl_set_opaque_xerr(old, olddentry, -EXDEV);1029996 if (err)1030997 goto out_dput;1031998 }···10331000 if (ovl_type_merge_or_lower(new))10341001 err = ovl_set_redirect(new, samedir);10351002 else if (!new_opaque && ovl_type_merge(old->d_parent))10361036- err = ovl_set_opaque(new, newdentry);10031003+ err = ovl_set_opaque_xerr(new, newdentry, -EXDEV);10371004 if (err)10381005 goto out_dput;10391006 }
+11-1
fs/overlayfs/inode.c
···240240 return res;241241}242242243243+static bool ovl_can_list(const char *s)244244+{245245+ /* List all non-trusted xatts */246246+ if (strncmp(s, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) != 0)247247+ return true;248248+249249+ /* Never list trusted.overlay, list other trusted for superuser only */250250+ return !ovl_is_private_xattr(s) && capable(CAP_SYS_ADMIN);251251+}252252+243253ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)244254{245255 struct dentry *realdentry = ovl_dentry_real(dentry);···273263 return -EIO;274264275265 len -= slen;276276- if (ovl_is_private_xattr(s)) {266266+ if (!ovl_can_list(s)) {277267 res -= slen;278268 memmove(s, s + slen, len);279269 } else {
···812812 uspi->s_dirblksize = UFS_SECTOR_SIZE;813813 super_block_offset=UFS_SBLOCK;814814815815- /* Keep 2Gig file limit. Some UFS variants need to override 816816- this but as I don't know which I'll let those in the know loosen817817- the rules */815815+ sb->s_maxbytes = MAX_LFS_FILESIZE;816816+818817 switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) {819818 case UFS_MOUNT_UFSTYPE_44BSD:820819 UFSD("ufstype=44bsd\n");
+26-12
fs/xfs/xfs_buf.c
···9797xfs_buf_ioacct_inc(9898 struct xfs_buf *bp)9999{100100- if (bp->b_flags & (XBF_NO_IOACCT|_XBF_IN_FLIGHT))100100+ if (bp->b_flags & XBF_NO_IOACCT)101101 return;102102103103 ASSERT(bp->b_flags & XBF_ASYNC);104104- bp->b_flags |= _XBF_IN_FLIGHT;105105- percpu_counter_inc(&bp->b_target->bt_io_count);104104+ spin_lock(&bp->b_lock);105105+ if (!(bp->b_state & XFS_BSTATE_IN_FLIGHT)) {106106+ bp->b_state |= XFS_BSTATE_IN_FLIGHT;107107+ percpu_counter_inc(&bp->b_target->bt_io_count);108108+ }109109+ spin_unlock(&bp->b_lock);106110}107111108112/*···114110 * freed and unaccount from the buftarg.115111 */116112static inline void113113+__xfs_buf_ioacct_dec(114114+ struct xfs_buf *bp)115115+{116116+ ASSERT(spin_is_locked(&bp->b_lock));117117+118118+ if (bp->b_state & XFS_BSTATE_IN_FLIGHT) {119119+ bp->b_state &= ~XFS_BSTATE_IN_FLIGHT;120120+ percpu_counter_dec(&bp->b_target->bt_io_count);121121+ }122122+}123123+124124+static inline void117125xfs_buf_ioacct_dec(118126 struct xfs_buf *bp)119127{120120- if (!(bp->b_flags & _XBF_IN_FLIGHT))121121- return;122122-123123- bp->b_flags &= ~_XBF_IN_FLIGHT;124124- percpu_counter_dec(&bp->b_target->bt_io_count);128128+ spin_lock(&bp->b_lock);129129+ __xfs_buf_ioacct_dec(bp);130130+ spin_unlock(&bp->b_lock);125131}126132127133/*···163149 * unaccounted (released to LRU) before that occurs. Drop in-flight164150 * status now to preserve accounting consistency.165151 */166166- xfs_buf_ioacct_dec(bp);167167-168152 spin_lock(&bp->b_lock);153153+ __xfs_buf_ioacct_dec(bp);154154+169155 atomic_set(&bp->b_lru_ref, 0);170156 if (!(bp->b_state & XFS_BSTATE_DISPOSE) &&171157 (list_lru_del(&bp->b_target->bt_lru, &bp->b_lru)))···993979 * ensures the decrement occurs only once per-buf.994980 */995981 if ((atomic_read(&bp->b_hold) == 1) && !list_empty(&bp->b_lru))996996- xfs_buf_ioacct_dec(bp);982982+ __xfs_buf_ioacct_dec(bp);997983 goto out_unlock;998984 }9999851000986 /* the last reference has been dropped ... */10011001- xfs_buf_ioacct_dec(bp);987987+ __xfs_buf_ioacct_dec(bp);1002988 if (!(bp->b_flags & XBF_STALE) && atomic_read(&bp->b_lru_ref)) {1003989 /*1004990 * If the buffer is added to the LRU take a new reference to the
+2-3
fs/xfs/xfs_buf.h
···6363#define _XBF_KMEM (1 << 21)/* backed by heap memory */6464#define _XBF_DELWRI_Q (1 << 22)/* buffer on a delwri queue */6565#define _XBF_COMPOUND (1 << 23)/* compound buffer */6666-#define _XBF_IN_FLIGHT (1 << 25) /* I/O in flight, for accounting purposes */67666867typedef unsigned int xfs_buf_flags_t;6968···8384 { _XBF_PAGES, "PAGES" }, \8485 { _XBF_KMEM, "KMEM" }, \8586 { _XBF_DELWRI_Q, "DELWRI_Q" }, \8686- { _XBF_COMPOUND, "COMPOUND" }, \8787- { _XBF_IN_FLIGHT, "IN_FLIGHT" }8787+ { _XBF_COMPOUND, "COMPOUND" }888889899090/*9191 * Internal state flags.9292 */9393#define XFS_BSTATE_DISPOSE (1 << 0) /* buffer being discarded */9494+#define XFS_BSTATE_IN_FLIGHT (1 << 1) /* I/O in flight */94959596/*9697 * The xfs_buftarg contains 2 notions of "sector size" -
+51
include/drm/drm_dp_helper.h
···913913int drm_dp_start_crc(struct drm_dp_aux *aux, struct drm_crtc *crtc);914914int drm_dp_stop_crc(struct drm_dp_aux *aux);915915916916+struct drm_dp_dpcd_ident {917917+ u8 oui[3];918918+ u8 device_id[6];919919+ u8 hw_rev;920920+ u8 sw_major_rev;921921+ u8 sw_minor_rev;922922+} __packed;923923+924924+/**925925+ * struct drm_dp_desc - DP branch/sink device descriptor926926+ * @ident: DP device identification from DPCD 0x400 (sink) or 0x500 (branch).927927+ * @quirks: Quirks; use drm_dp_has_quirk() to query for the quirks.928928+ */929929+struct drm_dp_desc {930930+ struct drm_dp_dpcd_ident ident;931931+ u32 quirks;932932+};933933+934934+int drm_dp_read_desc(struct drm_dp_aux *aux, struct drm_dp_desc *desc,935935+ bool is_branch);936936+937937+/**938938+ * enum drm_dp_quirk - Display Port sink/branch device specific quirks939939+ *940940+ * Display Port sink and branch devices in the wild have a variety of bugs, try941941+ * to collect them here. The quirks are shared, but it's up to the drivers to942942+ * implement workarounds for them.943943+ */944944+enum drm_dp_quirk {945945+ /**946946+ * @DP_DPCD_QUIRK_LIMITED_M_N:947947+ *948948+ * The device requires main link attributes Mvid and Nvid to be limited949949+ * to 16 bits.950950+ */951951+ DP_DPCD_QUIRK_LIMITED_M_N,952952+};953953+954954+/**955955+ * drm_dp_has_quirk() - does the DP device have a specific quirk956956+ * @desc: Device decriptor filled by drm_dp_read_desc()957957+ * @quirk: Quirk to query for958958+ *959959+ * Return true if DP device identified by @desc has @quirk.960960+ */961961+static inline bool962962+drm_dp_has_quirk(const struct drm_dp_desc *desc, enum drm_dp_quirk quirk)963963+{964964+ return desc->quirks & BIT(quirk);965965+}966966+916967#endif /* _DRM_DP_HELPER_H_ */
···6464/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */6565#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)66666767+#ifndef __jiffy_arch_data6868+#define __jiffy_arch_data6969+#endif7070+6771/*6872 * The 64-bit value is not atomic - you MUST NOT read it6973 * without sampling the sequence number in jiffies_lock.7074 * get_jiffies_64() will do this for you as appropriate.7175 */7276extern u64 __cacheline_aligned_in_smp jiffies_64;7373-extern unsigned long volatile __cacheline_aligned_in_smp jiffies;7777+extern unsigned long volatile __cacheline_aligned_in_smp __jiffy_arch_data jiffies;74787579#if (BITS_PER_LONG < 64)7680u64 get_jiffies_64(void);
···23272327#define FOLL_REMOTE 0x2000 /* we are working on non-current tsk/mm */23282328#define FOLL_COW 0x4000 /* internal GUP flag */2329232923302330+static inline int vm_fault_to_errno(int vm_fault, int foll_flags)23312331+{23322332+ if (vm_fault & VM_FAULT_OOM)23332333+ return -ENOMEM;23342334+ if (vm_fault & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))23352335+ return (foll_flags & FOLL_HWPOISON) ? -EHWPOISON : -EFAULT;23362336+ if (vm_fault & (VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV))23372337+ return -EFAULT;23382338+ return 0;23392339+}23402340+23302341typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,23312342 void *data);23322343extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
+1
include/linux/mmzone.h
···678678 * is the first PFN that needs to be initialised.679679 */680680 unsigned long first_deferred_pfn;681681+ unsigned long static_init_size;681682#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */682683683684#ifdef CONFIG_TRANSPARENT_HUGEPAGE
···4242 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high4343 * impedance to VDD). If the argument is != 0 pull-up is enabled,4444 * if it is 0, pull-up is total, i.e. the pin is connected to VDD.4545- * @PIN_CONFIG_BIDIRECTIONAL: the pin will be configured to allow simultaneous4646- * input and output operations.4745 * @PIN_CONFIG_DRIVE_OPEN_DRAIN: the pin will be driven with open drain (open4846 * collector) which means it is usually wired with other output ports4947 * which are then pulled up with an external resistor. Setting this···9698 PIN_CONFIG_BIAS_PULL_DOWN,9799 PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,98100 PIN_CONFIG_BIAS_PULL_UP,9999- PIN_CONFIG_BIDIRECTIONAL,100101 PIN_CONFIG_DRIVE_OPEN_DRAIN,101102 PIN_CONFIG_DRIVE_OPEN_SOURCE,102103 PIN_CONFIG_DRIVE_PUSH_PULL,
···1010 struct module *module;1111};12121313-int ibnl_init(void);1414-void ibnl_cleanup(void);1515-1613/**1714 * Add a a client to the list of IB netlink exporters.1815 * @index: Index of the added client···7376 */7477int ibnl_multicast(struct sk_buff *skb, struct nlmsghdr *nlh,7578 unsigned int group, gfp_t flags);7676-7777-/**7878- * Check if there are any listeners to the netlink group7979- * @group: the netlink group ID8080- * Returns 0 on success or a negative for no listeners.8181- */8282-int ibnl_chk_listeners(unsigned int group);83798480#endif /* _RDMA_NETLINK_H */
···1010 depends on SYSFS1111 depends on KALLSYMS_ALL1212 depends on HAVE_LIVEPATCH1313+ depends on !TRIM_UNUSED_KSYMS1314 help1415 Say Y here if you want to support kernel live patching.1516 This option has no runtime impact until a kernel "patch"
+8-12
mm/gup.c
···407407408408 ret = handle_mm_fault(vma, address, fault_flags);409409 if (ret & VM_FAULT_ERROR) {410410- if (ret & VM_FAULT_OOM)411411- return -ENOMEM;412412- if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))413413- return *flags & FOLL_HWPOISON ? -EHWPOISON : -EFAULT;414414- if (ret & (VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV))415415- return -EFAULT;410410+ int err = vm_fault_to_errno(ret, *flags);411411+412412+ if (err)413413+ return err;416414 BUG();417415 }418416···721723 ret = handle_mm_fault(vma, address, fault_flags);722724 major |= ret & VM_FAULT_MAJOR;723725 if (ret & VM_FAULT_ERROR) {724724- if (ret & VM_FAULT_OOM)725725- return -ENOMEM;726726- if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))727727- return -EHWPOISON;728728- if (ret & (VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV))729729- return -EFAULT;726726+ int err = vm_fault_to_errno(ret, 0);727727+728728+ if (err)729729+ return err;730730 BUG();731731 }732732
···17391739 }17401740}1741174117421742+extern unsigned long __init_memblock17431743+memblock_reserved_memory_within(phys_addr_t start_addr, phys_addr_t end_addr)17441744+{17451745+ struct memblock_region *rgn;17461746+ unsigned long size = 0;17471747+ int idx;17481748+17491749+ for_each_memblock_type((&memblock.reserved), rgn) {17501750+ phys_addr_t start, end;17511751+17521752+ if (rgn->base + rgn->size < start_addr)17531753+ continue;17541754+ if (rgn->base > end_addr)17551755+ continue;17561756+17571757+ start = rgn->base;17581758+ end = start + rgn->size;17591759+ size += end - start;17601760+ }17611761+17621762+ return size;17631763+}17641764+17421765void __init_memblock __memblock_dump_all(void)17431766{17441767 pr_info("MEMBLOCK configuration:\n");
+2-6
mm/memory-failure.c
···15951595 if (ret) {15961596 pr_info("soft offline: %#lx: migration failed %d, type %lx (%pGp)\n",15971597 pfn, ret, page->flags, &page->flags);15981598- /*15991599- * We know that soft_offline_huge_page() tries to migrate16001600- * only one hugepage pointed to by hpage, so we need not16011601- * run through the pagelist here.16021602- */16031603- putback_active_hugepage(hpage);15981598+ if (!list_empty(&pagelist))15991599+ putback_movable_pages(&pagelist);16041600 if (ret > 0)16051601 ret = -EIO;16061602 } else {
+30-10
mm/memory.c
···30293029 return ret;30303030}3031303130323032+/*30333033+ * The ordering of these checks is important for pmds with _PAGE_DEVMAP set.30343034+ * If we check pmd_trans_unstable() first we will trip the bad_pmd() check30353035+ * inside of pmd_none_or_trans_huge_or_clear_bad(). This will end up correctly30363036+ * returning 1 but not before it spams dmesg with the pmd_clear_bad() output.30373037+ */30383038+static int pmd_devmap_trans_unstable(pmd_t *pmd)30393039+{30403040+ return pmd_devmap(*pmd) || pmd_trans_unstable(pmd);30413041+}30423042+30323043static int pte_alloc_one_map(struct vm_fault *vmf)30333044{30343045 struct vm_area_struct *vma = vmf->vma;···30633052map_pte:30643053 /*30653054 * If a huge pmd materialized under us just retry later. Use30663066- * pmd_trans_unstable() instead of pmd_trans_huge() to ensure the pmd30673067- * didn't become pmd_trans_huge under us and then back to pmd_none, as30683068- * a result of MADV_DONTNEED running immediately after a huge pmd fault30693069- * in a different thread of this mm, in turn leading to a misleading30703070- * pmd_trans_huge() retval. All we have to ensure is that it is a30713071- * regular pmd that we can walk with pte_offset_map() and we can do that30723072- * through an atomic read in C, which is what pmd_trans_unstable()30733073- * provides.30553055+ * pmd_trans_unstable() via pmd_devmap_trans_unstable() instead of30563056+ * pmd_trans_huge() to ensure the pmd didn't become pmd_trans_huge30573057+ * under us and then back to pmd_none, as a result of MADV_DONTNEED30583058+ * running immediately after a huge pmd fault in a different thread of30593059+ * this mm, in turn leading to a misleading pmd_trans_huge() retval.30603060+ * All we have to ensure is that it is a regular pmd that we can walk30613061+ * with pte_offset_map() and we can do that through an atomic read in30623062+ * C, which is what pmd_trans_unstable() provides.30743063 */30753075- if (pmd_trans_unstable(vmf->pmd) || pmd_devmap(*vmf->pmd))30643064+ if (pmd_devmap_trans_unstable(vmf->pmd))30763065 return VM_FAULT_NOPAGE;3077306630673067+ /*30683068+ * At this point we know that our vmf->pmd points to a page of ptes30693069+ * and it cannot become pmd_none(), pmd_devmap() or pmd_trans_huge()30703070+ * for the duration of the fault. If a racing MADV_DONTNEED runs and30713071+ * we zap the ptes pointed to by our vmf->pmd, the vmf->ptl will still30723072+ * be valid and we will re-check to make sure the vmf->pte isn't30733073+ * pte_none() under vmf->ptl protection when we return to30743074+ * alloc_set_pte().30753075+ */30783076 vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address,30793077 &vmf->ptl);30803078 return 0;···37103690 vmf->pte = NULL;37113691 } else {37123692 /* See comment in pte_alloc_one_map() */37133713- if (pmd_trans_unstable(vmf->pmd) || pmd_devmap(*vmf->pmd))36933693+ if (pmd_devmap_trans_unstable(vmf->pmd))37143694 return 0;37153695 /*37163696 * A regular pmd is established and it can't morph into a huge
+3-2
mm/mlock.c
···284284{285285 int i;286286 int nr = pagevec_count(pvec);287287- int delta_munlocked;287287+ int delta_munlocked = -nr;288288 struct pagevec pvec_putback;289289 int pgrescued = 0;290290···304304 continue;305305 else306306 __munlock_isolation_failed(page);307307+ } else {308308+ delta_munlocked++;307309 }308310309311 /*···317315 pagevec_add(&pvec_putback, pvec->pages[i]);318316 pvec->pages[i] = NULL;319317 }320320- delta_munlocked = -nr + pagevec_count(&pvec_putback);321318 __mod_zone_page_state(zone, NR_MLOCK, delta_munlocked);322319 spin_unlock_irq(zone_lru_lock(zone));323320
+25-12
mm/page_alloc.c
···292292#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT293293static inline void reset_deferred_meminit(pg_data_t *pgdat)294294{295295+ unsigned long max_initialise;296296+ unsigned long reserved_lowmem;297297+298298+ /*299299+ * Initialise at least 2G of a node but also take into account that300300+ * two large system hashes that can take up 1GB for 0.25TB/node.301301+ */302302+ max_initialise = max(2UL << (30 - PAGE_SHIFT),303303+ (pgdat->node_spanned_pages >> 8));304304+305305+ /*306306+ * Compensate the all the memblock reservations (e.g. crash kernel)307307+ * from the initial estimation to make sure we will initialize enough308308+ * memory to boot.309309+ */310310+ reserved_lowmem = memblock_reserved_memory_within(pgdat->node_start_pfn,311311+ pgdat->node_start_pfn + max_initialise);312312+ max_initialise += reserved_lowmem;313313+314314+ pgdat->static_init_size = min(max_initialise, pgdat->node_spanned_pages);295315 pgdat->first_deferred_pfn = ULONG_MAX;296316}297317···334314 unsigned long pfn, unsigned long zone_end,335315 unsigned long *nr_initialised)336316{337337- unsigned long max_initialise;338338-339317 /* Always populate low zones for address-contrained allocations */340318 if (zone_end < pgdat_end_pfn(pgdat))341319 return true;342342- /*343343- * Initialise at least 2G of a node but also take into account that344344- * two large system hashes that can take up 1GB for 0.25TB/node.345345- */346346- max_initialise = max(2UL << (30 - PAGE_SHIFT),347347- (pgdat->node_spanned_pages >> 8));348348-349320 (*nr_initialised)++;350350- if ((*nr_initialised > max_initialise) &&321321+ if ((*nr_initialised > pgdat->static_init_size) &&351322 (pfn & (PAGES_PER_SECTION - 1)) == 0) {352323 pgdat->first_deferred_pfn = pfn;353324 return false;···38813870 goto got_pg;3882387138833872 /* Avoid allocations with no watermarks from looping endlessly */38843884- if (test_thread_flag(TIF_MEMDIE))38733873+ if (test_thread_flag(TIF_MEMDIE) &&38743874+ (alloc_flags == ALLOC_NO_WATERMARKS ||38753875+ (gfp_mask & __GFP_NOMEMALLOC)))38853876 goto nopage;3886387738873878 /* Retry as long as the OOM killer is making progress */···61496136 /* pg_data_t should be reset to zero when it's allocated */61506137 WARN_ON(pgdat->nr_zones || pgdat->kswapd_classzone_idx);6151613861526152- reset_deferred_meminit(pgdat);61536139 pgdat->node_id = nid;61546140 pgdat->node_start_pfn = node_start_pfn;61556141 pgdat->per_cpu_nodestats = NULL;···61706158 (unsigned long)pgdat->node_mem_map);61716159#endif6172616061616161+ reset_deferred_meminit(pgdat);61736162 free_area_init_core(pgdat);61746163}61756164
···357357 WARN_ON_ONCE((flags & GFP_KERNEL) != GFP_KERNEL);358358359359 /*360360- * Make sure that larger requests are not too disruptive - no OOM361361- * killer and no allocation failure warnings as we have a fallback360360+ * We want to attempt a large physically contiguous block first because361361+ * it is less likely to fragment multiple larger blocks and therefore362362+ * contribute to a long term fragmentation less than vmalloc fallback.363363+ * However make sure that larger requests are not too disruptive - no364364+ * OOM killer and no allocation failure warnings as we have a fallback.362365 */363366 if (size > PAGE_SIZE) {364367 kmalloc_flags |= __GFP_NOWARN;
+2-4
net/sunrpc/xprtrdma/backchannel.c
···119119120120 for (i = 0; i < (reqs << 1); i++) {121121 rqst = kzalloc(sizeof(*rqst), GFP_KERNEL);122122- if (!rqst) {123123- pr_err("RPC: %s: Failed to create bc rpc_rqst\n",124124- __func__);122122+ if (!rqst)125123 goto out_free;126126- }124124+127125 dprintk("RPC: %s: new rqst %p\n", __func__, rqst);128126129127 rqst->rq_xprt = &r_xprt->rx_xprt;
+6-1
net/sunrpc/xprtsock.c
···24322432 case -ENETUNREACH:24332433 case -EADDRINUSE:24342434 case -ENOBUFS:24352435- /* retry with existing socket, after a delay */24352435+ /*24362436+ * xs_tcp_force_close() wakes tasks with -EIO.24372437+ * We need to wake them first to ensure the24382438+ * correct error code.24392439+ */24402440+ xprt_wake_pending_tasks(xprt, status);24362441 xs_tcp_force_close(xprt);24372442 goto out;24382443 }
···220220endchoice221221222222config INITRAMFS_COMPRESSION223223+ depends on INITRAMFS_SOURCE!=""223224 string224225 default "" if INITRAMFS_COMPRESSION_NONE225226 default ".gz" if INITRAMFS_COMPRESSION_GZIP