···249249250250html_static_path = ['sphinx-static']251251252252-html_context = {253253- 'css_files': [254254- '_static/theme_overrides.css',255255- ],256256-}252252+html_css_files = [253253+ 'theme_overrides.css',254254+]255255+256256+if major <= 1 and minor < 8:257257+ html_context = {258258+ 'css_files': [259259+ '_static/theme_overrides.css',260260+ ],261261+ }257262258263# Add any extra paths that contain custom files (such as robots.txt or259264# .htaccess) here, relative to this directory. These files are copied
···9191 compensate for the board being designed with the lanes9292 swapped.93939494+ enet-phy-lane-no-swap:9595+ $ref: /schemas/types.yaml#/definitions/flag9696+ description:9797+ If set, indicates that PHY will disable swap of the9898+ TX/RX lanes. This property allows the PHY to work correcly after9999+ e.g. wrong bootstrap configuration caused by issues in PCB100100+ layout design.101101+94102 eee-broken-100tx:95103 $ref: /schemas/types.yaml#/definitions/flag96104 description:
···439439 spin_lock(&p->lock);440440 p->count += this_cpu_read(var2);441441442442-On a non-PREEMPT_RT kernel migrate_disable() maps to preempt_disable()443443-which makes the above code fully equivalent. On a PREEMPT_RT kernel444442migrate_disable() ensures that the task is pinned on the current CPU which445443in turn guarantees that the per-CPU access to var1 and var2 are staying on446446-the same CPU.444444+the same CPU while the task remains preemptible.447445448446The migrate_disable() substitution is not valid for the following449447scenario::···454456 p = this_cpu_ptr(&var1);455457 p->val = func2();456458457457-While correct on a non-PREEMPT_RT kernel, this breaks on PREEMPT_RT because458458-here migrate_disable() does not protect against reentrancy from a459459-preempting task. A correct substitution for this case is::459459+This breaks because migrate_disable() does not protect against reentrancy from460460+a preempting task. A correct substitution for this case is::460461461462 func()462463 {
+11
Documentation/process/changes.rst
···3535binutils 2.23 ld -v3636flex 2.5.35 flex --version3737bison 2.0 bison --version3838+pahole 1.16 pahole --version3839util-linux 2.10o fdformat --version3940kmod 13 depmod -V4041e2fsprogs 1.41.4 e2fsck -V···108107109108Since Linux 4.16, the build system generates parsers110109during build. This requires bison 2.0 or later.110110+111111+pahole:112112+-------113113+114114+Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system115115+generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel116116+modules as well. This requires pahole v1.16 or later.117117+118118+It is found in the 'dwarves' or 'pahole' distro packages or from119119+https://fedorapeople.org/~acme/dwarves/.111120112121Perl113122----
+2-1
Documentation/process/submitting-patches.rst
···1414Documentation/process/submit-checklist.rst1515for a list of items to check before submitting code. If you are submitting1616a driver, also read Documentation/process/submitting-drivers.rst; for device1717-tree binding patches, read Documentation/process/submitting-patches.rst.1717+tree binding patches, read1818+Documentation/devicetree/bindings/submitting-patches.rst.18191920This documentation assumes that you're using ``git`` to prepare your patches.2021If you're unfamiliar with ``git``, you would be well-advised to learn how to
···19321932 depends on ACPI19331933 select UCS2_STRING19341934 select EFI_RUNTIME_WRAPPERS19351935+ select ARCH_USE_MEMREMAP_PROT19351936 help19361937 This enables the kernel to use EFI runtime services that are19371938 available (such as the EFI variable services).
···1922192219231923 all_cpus = send_ipi_ex.vp_set.format == HV_GENERIC_SET_ALL;1924192419251925+ if (all_cpus)19261926+ goto check_and_send_ipi;19271927+19251928 if (!sparse_banks_len)19261929 goto ret_success;1927193019281928- if (!all_cpus &&19291929- kvm_read_guest(kvm,19311931+ if (kvm_read_guest(kvm,19301932 hc->ingpa + offsetof(struct hv_send_ipi_ex,19311933 vp_set.bank_contents),19321934 sparse_banks,···19361934 return HV_STATUS_INVALID_HYPERCALL_INPUT;19371935 }1938193619371937+check_and_send_ipi:19391938 if ((vector < HV_IPI_LOW_VECTOR) || (vector > HV_IPI_HIGH_VECTOR))19401939 return HV_STATUS_INVALID_HYPERCALL_INPUT;19411940
+13-9
arch/x86/kvm/vmx/vmx.c
···26462646 if (!loaded_vmcs->msr_bitmap)26472647 goto out_vmcs;26482648 memset(loaded_vmcs->msr_bitmap, 0xff, PAGE_SIZE);26492649-26502650- if (IS_ENABLED(CONFIG_HYPERV) &&26512651- static_branch_unlikely(&enable_evmcs) &&26522652- (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {26532653- struct hv_enlightened_vmcs *evmcs =26542654- (struct hv_enlightened_vmcs *)loaded_vmcs->vmcs;26552655-26562656- evmcs->hv_enlightenments_control.msr_bitmap = 1;26572657- }26582649 }2659265026602651 memset(&loaded_vmcs->host_state, 0, sizeof(struct vmcs_host_state));···68326841 err = alloc_loaded_vmcs(&vmx->vmcs01);68336842 if (err < 0)68346843 goto free_pml;68446844+68456845+ /*68466846+ * Use Hyper-V 'Enlightened MSR Bitmap' feature when KVM runs as a68476847+ * nested (L1) hypervisor and Hyper-V in L0 supports it. Enable the68486848+ * feature only for vmcs01, KVM currently isn't equipped to realize any68496849+ * performance benefits from enabling it for vmcs02.68506850+ */68516851+ if (IS_ENABLED(CONFIG_HYPERV) && static_branch_unlikely(&enable_evmcs) &&68526852+ (ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {68536853+ struct hv_enlightened_vmcs *evmcs = (void *)vmx->vmcs01.vmcs;68546854+68556855+ evmcs->hv_enlightenments_control.msr_bitmap = 1;68566856+ }6835685768366858 /* The MSR bitmap starts with all ones */68376859 bitmap_fill(vmx->shadow_msr_intercept.read, MAX_POSSIBLE_PASSTHROUGH_MSRS);
+9-3
arch/x86/kvm/x86.c
···890890 !load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu)))891891 return 1;892892893893- if (!(cr0 & X86_CR0_PG) && kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE))893893+ if (!(cr0 & X86_CR0_PG) &&894894+ (is_64_bit_mode(vcpu) || kvm_read_cr4_bits(vcpu, X86_CR4_PCIDE)))894895 return 1;895896896897 static_call(kvm_x86_set_cr0)(vcpu, cr0);···71227121 unsigned short port, void *val, unsigned int count)71237122{71247123 if (vcpu->arch.pio.count) {71257125- /* Complete previous iteration. */71247124+ /*71257125+ * Complete a previous iteration that required userspace I/O.71267126+ * Note, @count isn't guaranteed to match pio.count as userspace71277127+ * can modify ECX before rerunning the vCPU. Ignore any such71287128+ * shenanigans as KVM doesn't support modifying the rep count,71297129+ * and the emulator ensures @count doesn't overflow the buffer.71307130+ */71267131 } else {71277132 int r = __emulator_pio_in(vcpu, size, port, count);71287133 if (!r)···71377130 /* Results already available, fall through. */71387131 }7139713271407140- WARN_ON(count != vcpu->arch.pio.count);71417133 complete_emulator_pio_in(vcpu, val);71427134 return 1;71437135}
+2-1
arch/x86/platform/efi/quirks.c
···277277 return;278278 }279279280280- new = early_memremap(data.phys_map, data.size);280280+ new = early_memremap_prot(data.phys_map, data.size,281281+ pgprot_val(pgprot_encrypted(FIXMAP_PAGE_NORMAL)));281282 if (!new) {282283 pr_err("Failed to map new boot services memmap\n");283284 return;
···44224422 __release(&t->lock);4423442344244424 /*44254425- * If this thread used poll, make sure we remove the waitqueue44264426- * from any epoll data structures holding it with POLLFREE.44274427- * waitqueue_active() is safe to use here because we're holding44284428- * the inner lock.44254425+ * If this thread used poll, make sure we remove the waitqueue from any44264426+ * poll data structures holding it.44294427 */44304430- if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&44314431- waitqueue_active(&thread->wait)) {44324432- wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);44334433- }44284428+ if (thread->looper & BINDER_LOOPER_STATE_POLL)44294429+ wake_up_pollfree(&thread->wait);4434443044354431 binder_inner_proc_unlock(thread->proc);4436443244374433 /*44384438- * This is needed to avoid races between wake_up_poll() above and44394439- * and ep_remove_waitqueue() called for other reasons (eg the epoll file44404440- * descriptor being closed); ep_remove_waitqueue() holds an RCU read44414441- * lock, so we can be sure it's done after calling synchronize_rcu().44344434+ * This is needed to avoid races between wake_up_pollfree() above and44354435+ * someone else removing the last entry from the queue for other reasons44364436+ * (e.g. ep_remove_wait_queue() being called due to an epoll file44374437+ * descriptor being closed). Such other users hold an RCU read lock, so44384438+ * we can be sure they're done after we call synchronize_rcu().44424439 */44434440 if (thread->looper & BINDER_LOOPER_STATE_POLL)44444441 synchronize_rcu();
+2-1
drivers/ata/ahci_ceva.c
···9494static unsigned int ceva_ahci_read_id(struct ata_device *dev,9595 struct ata_taskfile *tf, u16 *id)9696{9797+ __le16 *__id = (__le16 *)id;9798 u32 err_mask;989999100 err_mask = ata_do_dev_read_id(dev, tf, id);···104103 * Since CEVA controller does not support device sleep feature, we105104 * need to clear DEVSLP (bit 8) in word78 of the IDENTIFY DEVICE data.106105 */107107- id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));106106+ __id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));108107109108 return 0;110109}
···14291429void clk_trion_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,14301430 const struct alpha_pll_config *config)14311431{14321432+ /*14331433+ * If the bootloader left the PLL enabled it's likely that there are14341434+ * RCGs that will lock up if we disable the PLL below.14351435+ */14361436+ if (trion_pll_is_enabled(pll, regmap)) {14371437+ pr_debug("Trion PLL is already enabled, skipping configuration\n");14381438+ return;14391439+ }14401440+14321441 clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);14331442 regmap_write(regmap, PLL_CAL_L_VAL(pll), TRION_PLL_CAL_VAL);14341443 clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
+1-1
drivers/clk/qcom/clk-regmap-mux.c
···2828 val &= mask;29293030 if (mux->parent_map)3131- return qcom_find_src_index(hw, mux->parent_map, val);3131+ return qcom_find_cfg_index(hw, mux->parent_map, val);32323333 return val;3434}
+12
drivers/clk/qcom/common.c
···6969}7070EXPORT_SYMBOL_GPL(qcom_find_src_index);71717272+int qcom_find_cfg_index(struct clk_hw *hw, const struct parent_map *map, u8 cfg)7373+{7474+ int i, num_parents = clk_hw_get_num_parents(hw);7575+7676+ for (i = 0; i < num_parents; i++)7777+ if (cfg == map[i].cfg)7878+ return i;7979+8080+ return -ENOENT;8181+}8282+EXPORT_SYMBOL_GPL(qcom_find_cfg_index);8383+7284struct regmap *7385qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc)7486{
···394394395395static atomic_t timer_unstable_counter_workaround_in_use = ATOMIC_INIT(0);396396397397-static void erratum_set_next_event_generic(const int access, unsigned long evt,398398- struct clock_event_device *clk)397397+/*398398+ * Force the inlining of this function so that the register accesses399399+ * can be themselves correctly inlined.400400+ */401401+static __always_inline402402+void erratum_set_next_event_generic(const int access, unsigned long evt,403403+ struct clock_event_device *clk)399404{400405 unsigned long ctrl;401406 u64 cval;
+1-1
drivers/clocksource/dw_apb_timer_of.c
···4747 pr_warn("pclk for %pOFn is present, but could not be activated\n",4848 np);49495050- if (!of_property_read_u32(np, "clock-freq", rate) &&5050+ if (!of_property_read_u32(np, "clock-freq", rate) ||5151 !of_property_read_u32(np, "clock-frequency", rate))5252 return 0;5353
+6-1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
···25762576 */25772577 link_enc_cfg_init(dm->dc, dc_state);2578257825792579- amdgpu_dm_outbox_init(adev);25792579+ if (dc_enable_dmub_notifications(adev->dm.dc))25802580+ amdgpu_dm_outbox_init(adev);2580258125812582 r = dm_dmub_hw_init(adev);25822583 if (r)···26252624 dm_state->context = dc_create_state(dm->dc);26262625 /* TODO: Remove dc_state->dccg, use dc->dccg directly. */26272626 dc_resource_state_construct(dm->dc, dm_state->context);26272627+26282628+ /* Re-enable outbox interrupts for DPIA. */26292629+ if (dc_enable_dmub_notifications(adev->dm.dc))26302630+ amdgpu_dm_outbox_init(adev);2628263126292632 /* Before powering on DC we need to re-initialize DMUB. */26302633 r = dm_dmub_hw_init(adev);
+2
drivers/gpu/drm/amd/display/dc/dc_link.h
···226226 *edp_num = 0;227227 for (i = 0; i < dc->link_count; i++) {228228 // report any eDP links, even unconnected DDI's229229+ if (!dc->links[i])230230+ continue;229231 if (dc->links[i]->connector_signal == SIGNAL_TYPE_EDP) {230232 edp_links[*edp_num] = dc->links[i];231233 if (++(*edp_num) == MAX_NUM_EDP)
···404404405405 if (*fence) {406406 ret = dma_fence_chain_find_seqno(fence, point);407407- if (!ret)407407+ if (!ret) {408408+ /* If the requested seqno is already signaled409409+ * drm_syncobj_find_fence may return a NULL410410+ * fence. To make sure the recipient gets411411+ * signalled, use a new fence instead.412412+ */413413+ if (!*fence)414414+ *fence = dma_fence_get_stub();415415+408416 goto out;417417+ }409418 dma_fence_put(*fence);410419 } else {411420 ret = -EINVAL;
+1
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
···32773277 out_fence = eb_requests_create(&eb, in_fence, out_fence_fd);32783278 if (IS_ERR(out_fence)) {32793279 err = PTR_ERR(out_fence);32803280+ out_fence = NULL;32803281 if (eb.requests[0])32813282 goto err_request;32823283 else
+1
drivers/gpu/drm/i915/gt/intel_gtt.c
···66#include <linux/slab.h> /* fault-inject.h is not standalone! */7788#include <linux/fault-inject.h>99+#include <linux/sched/mm.h>9101011#include "gem/i915_gem_lmem.h"1112#include "i915_trace.h"
···207207208208config HID_CHICONY209209 tristate "Chicony devices"210210- depends on HID210210+ depends on USB_HID211211 default !EXPERT212212 help213213 Support for Chicony Tactical pad and special keys on Chicony keyboards.214214215215config HID_CORSAIR216216 tristate "Corsair devices"217217- depends on HID && USB && LEDS_CLASS217217+ depends on USB_HID && LEDS_CLASS218218 help219219 Support for Corsair devices that are not fully compliant with the220220 HID standard.···245245246246config HID_PRODIKEYS247247 tristate "Prodikeys PC-MIDI Keyboard support"248248- depends on HID && SND248248+ depends on USB_HID && SND249249 select SND_RAWMIDI250250 help251251 Support for Prodikeys PC-MIDI Keyboard device support.···560560561561config HID_LOGITECH562562 tristate "Logitech devices"563563- depends on HID563563+ depends on USB_HID564564 depends on LEDS_CLASS565565 default !EXPERT566566 help···951951952952config HID_SAMSUNG953953 tristate "Samsung InfraRed remote control or keyboards"954954- depends on HID954954+ depends on USB_HID955955 help956956 Support for Samsung InfraRed remote control or keyboards.957957
+2-4
drivers/hid/hid-asus.c
···10281028 if (drvdata->quirks & QUIRK_IS_MULTITOUCH)10291029 drvdata->tp = &asus_i2c_tp;1030103010311031- if ((drvdata->quirks & QUIRK_T100_KEYBOARD) &&10321032- hid_is_using_ll_driver(hdev, &usb_hid_driver)) {10311031+ if ((drvdata->quirks & QUIRK_T100_KEYBOARD) && hid_is_usb(hdev)) {10331032 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);1034103310351034 if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) {···10561057 drvdata->tp = &asus_t100chi_tp;10571058 }1058105910591059- if ((drvdata->quirks & QUIRK_MEDION_E1239T) &&10601060- hid_is_using_ll_driver(hdev, &usb_hid_driver)) {10601060+ if ((drvdata->quirks & QUIRK_MEDION_E1239T) && hid_is_usb(hdev)) {10611061 struct usb_host_interface *alt =10621062 to_usb_interface(hdev->dev.parent)->altsetting;10631063
+1-1
drivers/hid/hid-bigbenff.c
···191191 struct bigben_device, worker);192192 struct hid_field *report_field = bigben->report->field[0];193193194194- if (bigben->removed)194194+ if (bigben->removed || !report_field)195195 return;196196197197 if (bigben->work_led) {
+3
drivers/hid/hid-chicony.c
···114114{115115 int ret;116116117117+ if (!hid_is_usb(hdev))118118+ return -EINVAL;119119+117120 hdev->quirks |= HID_QUIRK_INPUT_PER_APP;118121 ret = hid_parse(hdev);119122 if (ret) {
···50505151static int is_not_elan_touchpad(struct hid_device *hdev)5252{5353- if (hdev->bus == BUS_USB) {5353+ if (hid_is_usb(hdev)) {5454 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);55555656 return (intf->altsetting->desc.bInterfaceNumber !=
+3
drivers/hid/hid-elo.c
···230230 int ret;231231 struct usb_device *udev;232232233233+ if (!hid_is_usb(hdev))234234+ return -EINVAL;235235+233236 priv = kzalloc(sizeof(*priv), GFP_KERNEL);234237 if (!priv)235238 return -ENOMEM;
+3
drivers/hid/hid-ft260.c
···915915 struct ft260_get_chip_version_report version;916916 int ret;917917918918+ if (!hid_is_usb(hdev))919919+ return -EINVAL;920920+918921 dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);919922 if (!dev)920923 return -ENOMEM;
···344344{345345 int retval;346346347347+ if (!hid_is_usb(hdev))348348+ return -EINVAL;349349+347350 retval = hid_parse(hdev);348351 if (retval) {349352 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-isku.c
···324324{325325 int retval;326326327327+ if (!hid_is_usb(hdev))328328+ return -EINVAL;329329+327330 retval = hid_parse(hdev);328331 if (retval) {329332 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-kone.c
···749749{750750 int retval;751751752752+ if (!hid_is_usb(hdev))753753+ return -EINVAL;754754+752755 retval = hid_parse(hdev);753756 if (retval) {754757 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-koneplus.c
···431431{432432 int retval;433433434434+ if (!hid_is_usb(hdev))435435+ return -EINVAL;436436+434437 retval = hid_parse(hdev);435438 if (retval) {436439 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-konepure.c
···133133{134134 int retval;135135136136+ if (!hid_is_usb(hdev))137137+ return -EINVAL;138138+136139 retval = hid_parse(hdev);137140 if (retval) {138141 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-kovaplus.c
···501501{502502 int retval;503503504504+ if (!hid_is_usb(hdev))505505+ return -EINVAL;506506+504507 retval = hid_parse(hdev);505508 if (retval) {506509 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-lua.c
···160160{161161 int retval;162162163163+ if (!hid_is_usb(hdev))164164+ return -EINVAL;165165+163166 retval = hid_parse(hdev);164167 if (retval) {165168 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-pyra.c
···449449{450450 int retval;451451452452+ if (!hid_is_usb(hdev))453453+ return -EINVAL;454454+452455 retval = hid_parse(hdev);453456 if (retval) {454457 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-ryos.c
···141141{142142 int retval;143143144144+ if (!hid_is_usb(hdev))145145+ return -EINVAL;146146+144147 retval = hid_parse(hdev);145148 if (retval) {146149 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-roccat-savu.c
···113113{114114 int retval;115115116116+ if (!hid_is_usb(hdev))117117+ return -EINVAL;118118+116119 retval = hid_parse(hdev);117120 if (retval) {118121 hid_err(hdev, "parse failed\n");
+3
drivers/hid/hid-samsung.c
···152152 int ret;153153 unsigned int cmask = HID_CONNECT_DEFAULT;154154155155+ if (!hid_is_usb(hdev))156156+ return -EINVAL;157157+155158 ret = hid_parse(hdev);156159 if (ret) {157160 hid_err(hdev, "parse failed\n");
+18-6
drivers/hid/hid-sony.c
···30003000 sc->quirks = quirks;30013001 hid_set_drvdata(hdev, sc);30023002 sc->hdev = hdev;30033003- usbdev = to_usb_device(sc->hdev->dev.parent->parent);3004300330053004 ret = hid_parse(hdev);30063005 if (ret) {···30373038 */30383039 if (!(hdev->claimed & HID_CLAIMED_INPUT)) {30393040 hid_err(hdev, "failed to claim input\n");30403040- hid_hw_stop(hdev);30413041- return -ENODEV;30413041+ ret = -ENODEV;30423042+ goto err;30423043 }3043304430443045 if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) {30463046+ if (!hid_is_usb(hdev)) {30473047+ ret = -EINVAL;30483048+ goto err;30493049+ }30503050+30513051+ usbdev = to_usb_device(sc->hdev->dev.parent->parent);30523052+30453053 sc->ghl_urb = usb_alloc_urb(0, GFP_ATOMIC);30463046- if (!sc->ghl_urb)30473047- return -ENOMEM;30543054+ if (!sc->ghl_urb) {30553055+ ret = -ENOMEM;30563056+ goto err;30573057+ }3048305830493059 if (sc->quirks & GHL_GUITAR_PS3WIIU)30503060 ret = ghl_init_urb(sc, usbdev, ghl_ps3wiiu_magic_data,···30633055 ARRAY_SIZE(ghl_ps4_magic_data));30643056 if (ret) {30653057 hid_err(hdev, "error preparing URB\n");30663066- return ret;30583058+ goto err;30673059 }3068306030693061 timer_setup(&sc->ghl_poke_timer, ghl_magic_poke, 0);···30713063 jiffies + GHL_GUITAR_POKE_INTERVAL*HZ);30723064 }3073306530663066+ return ret;30673067+30683068+err:30693069+ hid_hw_stop(hdev);30743070 return ret;30753071}30763072
+3
drivers/hid/hid-thrustmaster.c
···274274 int ret = 0;275275 struct tm_wheel *tm_wheel = NULL;276276277277+ if (!hid_is_usb(hdev))278278+ return -EINVAL;279279+277280 ret = hid_parse(hdev);278281 if (ret) {279282 hid_err(hdev, "parse failed with error %d\n", ret);
+1-1
drivers/hid/hid-u2fzero.c
···311311 unsigned int minor;312312 int ret;313313314314- if (!hid_is_using_ll_driver(hdev, &usb_hid_driver))314314+ if (!hid_is_usb(hdev))315315 return -EINVAL;316316317317 dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
+3
drivers/hid/hid-uclogic-core.c
···164164 struct uclogic_drvdata *drvdata = NULL;165165 bool params_initialized = false;166166167167+ if (!hid_is_usb(hdev))168168+ return -EINVAL;169169+167170 /*168171 * libinput requires the pad interface to be on a different node169172 * than the pen, so use QUIRK_MULTI_INPUT for all tablets.
···2323/*2424 * I2C command delays (in microseconds)2525 */2626-#define SHT4X_MEAS_DELAY 10002626+#define SHT4X_MEAS_DELAY_HPM 8200 /* see t_MEAS,h in datasheet */2727#define SHT4X_DELAY_EXTRA 1000028282929/*···9090 if (ret < 0)9191 goto unlock;92929393- usleep_range(SHT4X_MEAS_DELAY, SHT4X_MEAS_DELAY + SHT4X_DELAY_EXTRA);9393+ usleep_range(SHT4X_MEAS_DELAY_HPM, SHT4X_MEAS_DELAY_HPM + SHT4X_DELAY_EXTRA);94949595 ret = i2c_master_recv(client, raw_data, SHT4X_RESPONSE_LENGTH);9696 if (ret != SHT4X_RESPONSE_LENGTH) {
+1-1
drivers/i2c/busses/i2c-mpc.c
···636636 status = readb(i2c->base + MPC_I2C_SR);637637 if (status & CSR_MIF) {638638 /* Wait up to 100us for transfer to properly complete */639639- readb_poll_timeout(i2c->base + MPC_I2C_SR, status, !(status & CSR_MCF), 0, 100);639639+ readb_poll_timeout_atomic(i2c->base + MPC_I2C_SR, status, status & CSR_MCF, 0, 100);640640 writeb(0, i2c->base + MPC_I2C_SR);641641 mpc_i2c_do_intr(i2c, status);642642 return IRQ_HANDLED;
+12-20
drivers/i2c/busses/i2c-virtio.c
···2222/**2323 * struct virtio_i2c - virtio I2C data2424 * @vdev: virtio device for this controller2525- * @completion: completion of virtio I2C message2625 * @adap: I2C adapter for this controller2726 * @vq: the virtio virtqueue for communication2827 */2928struct virtio_i2c {3029 struct virtio_device *vdev;3131- struct completion completion;3230 struct i2c_adapter adap;3331 struct virtqueue *vq;3432};35333634/**3735 * struct virtio_i2c_req - the virtio I2C request structure3636+ * @completion: completion of virtio I2C message3837 * @out_hdr: the OUT header of the virtio I2C message3938 * @buf: the buffer into which data is read, or from which it's written4039 * @in_hdr: the IN header of the virtio I2C message4140 */4241struct virtio_i2c_req {4242+ struct completion completion;4343 struct virtio_i2c_out_hdr out_hdr ____cacheline_aligned;4444 uint8_t *buf ____cacheline_aligned;4545 struct virtio_i2c_in_hdr in_hdr ____cacheline_aligned;···47474848static void virtio_i2c_msg_done(struct virtqueue *vq)4949{5050- struct virtio_i2c *vi = vq->vdev->priv;5050+ struct virtio_i2c_req *req;5151+ unsigned int len;51525252- complete(&vi->completion);5353+ while ((req = virtqueue_get_buf(vq, &len)))5454+ complete(&req->completion);5355}54565557static int virtio_i2c_prepare_reqs(struct virtqueue *vq,···63616462 for (i = 0; i < num; i++) {6563 int outcnt = 0, incnt = 0;6464+6565+ init_completion(&reqs[i].completion);66666767 /*6868 * Only 7-bit mode supported for this moment. For the address···110106 struct virtio_i2c_req *reqs,111107 struct i2c_msg *msgs, int num)112108{113113- struct virtio_i2c_req *req;114109 bool failed = false;115115- unsigned int len;116110 int i, j = 0;117111118112 for (i = 0; i < num; i++) {119119- /* Detach the ith request from the vq */120120- req = virtqueue_get_buf(vq, &len);113113+ struct virtio_i2c_req *req = &reqs[i];121114122122- /*123123- * Condition req == &reqs[i] should always meet since we have124124- * total num requests in the vq. reqs[i] can never be NULL here.125125- */126126- if (!failed && (WARN_ON(req != &reqs[i]) ||127127- req->in_hdr.status != VIRTIO_I2C_MSG_OK))115115+ wait_for_completion(&req->completion);116116+117117+ if (!failed && req->in_hdr.status != VIRTIO_I2C_MSG_OK)128118 failed = true;129119130120 i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !failed);···154156 * remote here to clear the virtqueue, so we can try another set of155157 * messages later on.156158 */157157-158158- reinit_completion(&vi->completion);159159 virtqueue_kick(vq);160160-161161- wait_for_completion(&vi->completion);162160163161 count = virtio_i2c_complete_reqs(vq, reqs, msgs, count);164162···203209204210 vdev->priv = vi;205211 vi->vdev = vdev;206206-207207- init_completion(&vi->completion);208212209213 ret = virtio_i2c_setup_vqs(vi);210214 if (ret)
+2-3
drivers/iio/accel/kxcjk-1013.c
···15951595 return 0;1596159615971597err_buffer_cleanup:15981598- if (data->dready_trig)15991599- iio_triggered_buffer_cleanup(indio_dev);15981598+ iio_triggered_buffer_cleanup(indio_dev);16001599err_trigger_unregister:16011600 if (data->dready_trig)16021601 iio_trigger_unregister(data->dready_trig);···16171618 pm_runtime_disable(&client->dev);16181619 pm_runtime_set_suspended(&client->dev);1619162016211621+ iio_triggered_buffer_cleanup(indio_dev);16201622 if (data->dready_trig) {16211621- iio_triggered_buffer_cleanup(indio_dev);16221623 iio_trigger_unregister(data->dready_trig);16231624 iio_trigger_unregister(data->motion_trig);16241625 }
···532532533533config IMX8QXP_ADC534534 tristate "NXP IMX8QXP ADC driver"535535- depends on ARCH_MXC_ARM64 || COMPILE_TEST535535+ depends on ARCH_MXC || COMPILE_TEST536536 depends on HAS_IOMEM537537 help538538 Say yes here to build support for IMX8QXP ADC.
···664664665665 /* User MR data */666666 struct mlx5_cache_ent *cache_ent;667667- struct ib_umem *umem;668667669668 /* This is zero'd when the MR is allocated */670669 union {···675676 struct list_head list;676677 };677678678678- /* Used only by kernel MRs (umem == NULL) */679679+ /* Used only by kernel MRs */679680 struct {680681 void *descs;681682 void *descs_alloc;···696697 int data_length;697698 };698699699699- /* Used only by User MRs (umem != NULL) */700700+ /* Used only by User MRs */700701 struct {702702+ struct ib_umem *umem;701703 unsigned int page_shift;702704 /* Current access_flags */703705 int access_flags;
···238238 }239239240240 data->num_parent_irqs = platform_irq_count(pdev);241241+ put_device(&pdev->dev);241242 if (data->num_parent_irqs <= 0) {242243 pr_err("invalid number of parent interrupts\n");243244 ret = -ENOMEM;
···719719static u64 fastrpc_get_payload_size(struct fastrpc_invoke_ctx *ctx, int metalen)720720{721721 u64 size = 0;722722- int i;722722+ int oix;723723724724 size = ALIGN(metalen, FASTRPC_ALIGN);725725- for (i = 0; i < ctx->nscalars; i++) {725725+ for (oix = 0; oix < ctx->nbufs; oix++) {726726+ int i = ctx->olaps[oix].raix;727727+726728 if (ctx->args[i].fd == 0 || ctx->args[i].fd == -1) {727729728728- if (ctx->olaps[i].offset == 0)730730+ if (ctx->olaps[oix].offset == 0)729731 size = ALIGN(size, FASTRPC_ALIGN);730732731731- size += (ctx->olaps[i].mend - ctx->olaps[i].mstart);733733+ size += (ctx->olaps[oix].mend - ctx->olaps[oix].mstart);732734 }733735 }734736
+3-1
drivers/mmc/host/mtk-sd.c
···22912291 sdr_set_field(host->base + PAD_DS_TUNE,22922292 PAD_DS_TUNE_DLY1, i);22932293 ret = mmc_get_ext_csd(card, &ext_csd);22942294- if (!ret)22942294+ if (!ret) {22952295 result_dly1 |= (1 << i);22962296+ kfree(ext_csd);22972297+ }22962298 }22972299 host->hs400_tuning = false;22982300
+1-1
drivers/mmc/host/renesas_sdhi_core.c
···673673674674 /* Issue CMD19 twice for each tap */675675 for (i = 0; i < 2 * priv->tap_num; i++) {676676- int cmd_error;676676+ int cmd_error = 0;677677678678 /* Set sampling clock position */679679 sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
···2626config MTD_NAND_DENALI_DT2727 tristate "Denali NAND controller as a DT device"2828 select MTD_NAND_DENALI2929- depends on HAS_DMA && HAVE_CLK && OF2929+ depends on HAS_DMA && HAVE_CLK && OF && HAS_IOMEM3030 help3131 Enable the driver for NAND flash on platforms using a Denali NAND3232 controller as a DT device.
+28-8
drivers/mtd/nand/raw/fsmc_nand.c
···15151616#include <linux/clk.h>1717#include <linux/completion.h>1818+#include <linux/delay.h>1819#include <linux/dmaengine.h>1920#include <linux/dma-direction.h>2021#include <linux/dma-mapping.h>···9392#define FSMC_NAND_BANK_SZ 0x2094939594#define FSMC_BUSY_WAIT_TIMEOUT (1 * HZ)9595+9696+/*9797+ * According to SPEAr300 Reference Manual (RM0082)9898+ * TOUDEL = 7ns (Output delay from the flip-flops to the board)9999+ * TINDEL = 5ns (Input delay from the board to the flipflop)100100+ */101101+#define TOUTDEL 7000102102+#define TINDEL 50009610397104struct fsmc_nand_timings {98105 u8 tclr;···286277{287278 unsigned long hclk = clk_get_rate(host->clk);288279 unsigned long hclkn = NSEC_PER_SEC / hclk;289289- u32 thiz, thold, twait, tset;280280+ u32 thiz, thold, twait, tset, twait_min;290281291282 if (sdrt->tRC_min < 30000)292283 return -EOPNOTSUPP;···318309 else if (tims->thold > FSMC_THOLD_MASK)319310 tims->thold = FSMC_THOLD_MASK;320311321321- twait = max(sdrt->tRP_min, sdrt->tWP_min);322322- tims->twait = DIV_ROUND_UP(twait / 1000, hclkn) - 1;323323- if (tims->twait == 0)324324- tims->twait = 1;325325- else if (tims->twait > FSMC_TWAIT_MASK)326326- tims->twait = FSMC_TWAIT_MASK;327327-328312 tset = max(sdrt->tCS_min - sdrt->tWP_min,329313 sdrt->tCEA_max - sdrt->tREA_max);330314 tims->tset = DIV_ROUND_UP(tset / 1000, hclkn) - 1;···325323 tims->tset = 1;326324 else if (tims->tset > FSMC_TSET_MASK)327325 tims->tset = FSMC_TSET_MASK;326326+327327+ /*328328+ * According to SPEAr300 Reference Manual (RM0082) which gives more329329+ * information related to FSMSC timings than the SPEAr600 one (RM0305),330330+ * twait >= tCEA - (tset * TCLK) + TOUTDEL + TINDEL331331+ */332332+ twait_min = sdrt->tCEA_max - ((tims->tset + 1) * hclkn * 1000)333333+ + TOUTDEL + TINDEL;334334+ twait = max3(sdrt->tRP_min, sdrt->tWP_min, twait_min);335335+336336+ tims->twait = DIV_ROUND_UP(twait / 1000, hclkn) - 1;337337+ if (tims->twait == 0)338338+ tims->twait = 1;339339+ else if (tims->twait > FSMC_TWAIT_MASK)340340+ tims->twait = FSMC_TWAIT_MASK;328341329342 return 0;330343}···681664 instr->ctx.waitrdy.timeout_ms);682665 break;683666 }667667+668668+ if (instr->delay_ns)669669+ ndelay(instr->delay_ns);684670 }685671686672 return ret;
···471471 u16 reg;472472 int err;473473474474+ /* The 88e6250 family does not have the PHY detect bit. Instead,475475+ * report whether the port is internal.476476+ */477477+ if (chip->info->family == MV88E6XXX_FAMILY_6250)478478+ return port < chip->info->num_internal_phys;479479+474480 err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, ®);475481 if (err) {476482 dev_err(chip->dev,···698692{699693 struct mv88e6xxx_chip *chip = ds->priv;700694 struct mv88e6xxx_port *p;701701- int err;695695+ int err = 0;702696703697 p = &chip->ports[port];704698705705- /* FIXME: is this the correct test? If we're in fixed mode on an706706- * internal port, why should we process this any different from707707- * PHY mode? On the other hand, the port may be automedia between708708- * an internal PHY and the serdes...709709- */710710- if ((mode == MLO_AN_PHY) && mv88e6xxx_phy_is_internal(ds, port))711711- return;712712-713699 mv88e6xxx_reg_lock(chip);714714- /* In inband mode, the link may come up at any time while the link715715- * is not forced down. Force the link down while we reconfigure the716716- * interface mode.717717- */718718- if (mode == MLO_AN_INBAND && p->interface != state->interface &&719719- chip->info->ops->port_set_link)720720- chip->info->ops->port_set_link(chip, port, LINK_FORCED_DOWN);721700722722- err = mv88e6xxx_port_config_interface(chip, port, state->interface);723723- if (err && err != -EOPNOTSUPP)724724- goto err_unlock;701701+ if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) {702702+ /* In inband mode, the link may come up at any time while the703703+ * link is not forced down. Force the link down while we704704+ * reconfigure the interface mode.705705+ */706706+ if (mode == MLO_AN_INBAND &&707707+ p->interface != state->interface &&708708+ chip->info->ops->port_set_link)709709+ chip->info->ops->port_set_link(chip, port,710710+ LINK_FORCED_DOWN);725711726726- err = mv88e6xxx_serdes_pcs_config(chip, port, mode, state->interface,727727- state->advertising);728728- /* FIXME: we should restart negotiation if something changed - which729729- * is something we get if we convert to using phylinks PCS operations.730730- */731731- if (err > 0)732732- err = 0;712712+ err = mv88e6xxx_port_config_interface(chip, port,713713+ state->interface);714714+ if (err && err != -EOPNOTSUPP)715715+ goto err_unlock;716716+717717+ err = mv88e6xxx_serdes_pcs_config(chip, port, mode,718718+ state->interface,719719+ state->advertising);720720+ /* FIXME: we should restart negotiation if something changed -721721+ * which is something we get if we convert to using phylinks722722+ * PCS operations.723723+ */724724+ if (err > 0)725725+ err = 0;726726+ }733727734728 /* Undo the forced down state above after completing configuration735735- * irrespective of its state on entry, which allows the link to come up.729729+ * irrespective of its state on entry, which allows the link to come730730+ * up in the in-band case where there is no separate SERDES. Also731731+ * ensure that the link can come up if the PPU is in use and we are732732+ * in PHY mode (we treat the PPU as an effective in-band mechanism.)736733 */737737- if (mode == MLO_AN_INBAND && p->interface != state->interface &&738738- chip->info->ops->port_set_link)734734+ if (chip->info->ops->port_set_link &&735735+ ((mode == MLO_AN_INBAND && p->interface != state->interface) ||736736+ (mode == MLO_AN_PHY && mv88e6xxx_port_ppu_updates(chip, port))))739737 chip->info->ops->port_set_link(chip, port, LINK_UNFORCED);740738741739 p->interface = state->interface;···762752 ops = chip->info->ops;763753764754 mv88e6xxx_reg_lock(chip);765765- /* Internal PHYs propagate their configuration directly to the MAC.766766- * External PHYs depend on whether the PPU is enabled for this port.755755+ /* Force the link down if we know the port may not be automatically756756+ * updated by the switch or if we are using fixed-link mode.767757 */768768- if (((!mv88e6xxx_phy_is_internal(ds, port) &&769769- !mv88e6xxx_port_ppu_updates(chip, port)) ||758758+ if ((!mv88e6xxx_port_ppu_updates(chip, port) ||770759 mode == MLO_AN_FIXED) && ops->port_sync_link)771760 err = ops->port_sync_link(chip, port, mode, false);772761 mv88e6xxx_reg_unlock(chip);···788779 ops = chip->info->ops;789780790781 mv88e6xxx_reg_lock(chip);791791- /* Internal PHYs propagate their configuration directly to the MAC.792792- * External PHYs depend on whether the PPU is enabled for this port.782782+ /* Configure and force the link up if we know that the port may not783783+ * automatically updated by the switch or if we are using fixed-link784784+ * mode.793785 */794794- if ((!mv88e6xxx_phy_is_internal(ds, port) &&795795- !mv88e6xxx_port_ppu_updates(chip, port)) ||786786+ if (!mv88e6xxx_port_ppu_updates(chip, port) ||796787 mode == MLO_AN_FIXED) {797788 /* FIXME: for an automedia port, should we force the link798789 * down here - what if the link comes up due to "other" media
+7-1
drivers/net/dsa/mv88e6xxx/serdes.c
···830830 bool up)831831{832832 u8 cmode = chip->ports[port].cmode;833833- int err = 0;833833+ int err;834834835835 switch (cmode) {836836 case MV88E6XXX_PORT_STS_CMODE_SGMII:···841841 case MV88E6XXX_PORT_STS_CMODE_XAUI:842842 case MV88E6XXX_PORT_STS_CMODE_RXAUI:843843 err = mv88e6390_serdes_power_10g(chip, lane, up);844844+ break;845845+ default:846846+ err = -EINVAL;844847 break;845848 }846849···15431540 case MV88E6393X_PORT_STS_CMODE_5GBASER:15441541 case MV88E6393X_PORT_STS_CMODE_10GBASER:15451542 err = mv88e6390_serdes_power_10g(chip, lane, on);15431543+ break;15441544+ default:15451545+ err = -EINVAL;15461546 break;15471547 }15481548
···19491949}1950195019511951/**19521952+ * i40e_sync_vf_state19531953+ * @vf: pointer to the VF info19541954+ * @state: VF state19551955+ *19561956+ * Called from a VF message to synchronize the service with a potential19571957+ * VF reset state19581958+ **/19591959+static bool i40e_sync_vf_state(struct i40e_vf *vf, enum i40e_vf_states state)19601960+{19611961+ int i;19621962+19631963+ /* When handling some messages, it needs VF state to be set.19641964+ * It is possible that this flag is cleared during VF reset,19651965+ * so there is a need to wait until the end of the reset to19661966+ * handle the request message correctly.19671967+ */19681968+ for (i = 0; i < I40E_VF_STATE_WAIT_COUNT; i++) {19691969+ if (test_bit(state, &vf->vf_states))19701970+ return true;19711971+ usleep_range(10000, 20000);19721972+ }19731973+19741974+ return test_bit(state, &vf->vf_states);19751975+}19761976+19771977+/**19521978 * i40e_vc_get_version_msg19531979 * @vf: pointer to the VF info19541980 * @msg: pointer to the msg buffer···20342008 size_t len = 0;20352009 int ret;2036201020372037- if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {20112011+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_INIT)) {20382012 aq_ret = I40E_ERR_PARAM;20392013 goto err;20402014 }···21572131 bool allmulti = false;21582132 bool alluni = false;2159213321602160- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {21342134+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {21612135 aq_ret = I40E_ERR_PARAM;21622136 goto err_out;21632137 }···22452219 struct i40e_vsi *vsi;22462220 u16 num_qps_all = 0;2247222122482248- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {22222222+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {22492223 aq_ret = I40E_ERR_PARAM;22502224 goto error_param;22512225 }···23942368 i40e_status aq_ret = 0;23952369 int i;2396237023972397- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {23712371+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {23982372 aq_ret = I40E_ERR_PARAM;23992373 goto error_param;24002374 }···25662540 struct i40e_pf *pf = vf->pf;25672541 i40e_status aq_ret = 0;2568254225692569- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {25432543+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {25702544 aq_ret = I40E_ERR_PARAM;25712545 goto error_param;25722546 }···26162590 u8 cur_pairs = vf->num_queue_pairs;26172591 struct i40e_pf *pf = vf->pf;2618259226192619- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states))25932593+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE))26202594 return -EINVAL;2621259526222596 if (req_pairs > I40E_MAX_VF_QUEUES) {···2661263526622636 memset(&stats, 0, sizeof(struct i40e_eth_stats));2663263726642664- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {26382638+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {26652639 aq_ret = I40E_ERR_PARAM;26662640 goto error_param;26672641 }···27782752 i40e_status ret = 0;27792753 int i;2780275427812781- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||27552755+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||27822756 !i40e_vc_isvalid_vsi_id(vf, al->vsi_id)) {27832757 ret = I40E_ERR_PARAM;27842758 goto error_param;···28502824 i40e_status ret = 0;28512825 int i;2852282628532853- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||28272827+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||28542828 !i40e_vc_isvalid_vsi_id(vf, al->vsi_id)) {28552829 ret = I40E_ERR_PARAM;28562830 goto error_param;···29942968 i40e_status aq_ret = 0;29952969 int i;2996297029972997- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||29712971+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||29982972 !i40e_vc_isvalid_vsi_id(vf, vfl->vsi_id)) {29992973 aq_ret = I40E_ERR_PARAM;30002974 goto error_param;···31143088 struct i40e_vsi *vsi = NULL;31153089 i40e_status aq_ret = 0;3116309031173117- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||30913091+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||31183092 !i40e_vc_isvalid_vsi_id(vf, vrk->vsi_id) ||31193119- (vrk->key_len != I40E_HKEY_ARRAY_SIZE)) {30933093+ vrk->key_len != I40E_HKEY_ARRAY_SIZE) {31203094 aq_ret = I40E_ERR_PARAM;31213095 goto err;31223096 }···31453119 i40e_status aq_ret = 0;31463120 u16 i;3147312131483148- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states) ||31223122+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE) ||31493123 !i40e_vc_isvalid_vsi_id(vf, vrl->vsi_id) ||31503150- (vrl->lut_entries != I40E_VF_HLUT_ARRAY_SIZE)) {31243124+ vrl->lut_entries != I40E_VF_HLUT_ARRAY_SIZE) {31513125 aq_ret = I40E_ERR_PARAM;31523126 goto err;31533127 }···31803154 i40e_status aq_ret = 0;31813155 int len = 0;3182315631833183- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {31573157+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {31843158 aq_ret = I40E_ERR_PARAM;31853159 goto err;31863160 }···32163190 struct i40e_hw *hw = &pf->hw;32173191 i40e_status aq_ret = 0;3218319232193219- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {31933193+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {32203194 aq_ret = I40E_ERR_PARAM;32213195 goto err;32223196 }···32413215 i40e_status aq_ret = 0;32423216 struct i40e_vsi *vsi;3243321732443244- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {32183218+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {32453219 aq_ret = I40E_ERR_PARAM;32463220 goto err;32473221 }···32673241 i40e_status aq_ret = 0;32683242 struct i40e_vsi *vsi;3269324332703270- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {32443244+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {32713245 aq_ret = I40E_ERR_PARAM;32723246 goto err;32733247 }···34943468 i40e_status aq_ret = 0;34953469 int i, ret;3496347034973497- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {34713471+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {34983472 aq_ret = I40E_ERR_PARAM;34993473 goto err;35003474 }···36253599 i40e_status aq_ret = 0;36263600 int i, ret;3627360136283628- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {36023602+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {36293603 aq_ret = I40E_ERR_PARAM;36303604 goto err_out;36313605 }···37343708 i40e_status aq_ret = 0;37353709 u64 speed = 0;3736371037373737- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {37113711+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {37383712 aq_ret = I40E_ERR_PARAM;37393713 goto err;37403714 }···3823379738243798 /* set this flag only after making sure all inputs are sane */38253799 vf->adq_enabled = true;38263826- /* num_req_queues is set when user changes number of queues via ethtool38273827- * and this causes issue for default VSI(which depends on this variable)38283828- * when ADq is enabled, hence reset it.38293829- */38303830- vf->num_req_queues = 0;3831380038323801 /* reset the VF in order to allocate resources */38333802 i40e_vc_reset_vf(vf, true);···38453824 struct i40e_pf *pf = vf->pf;38463825 i40e_status aq_ret = 0;3847382638483848- if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {38273827+ if (!i40e_sync_vf_state(vf, I40E_VF_STATE_ACTIVE)) {38493828 aq_ret = I40E_ERR_PARAM;38503829 goto err;38513830 }
···615615 if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))616616 return -EINVAL;617617618618- new_tx_count = clamp_t(u32, ring->tx_pending,619619- IAVF_MIN_TXD,620620- IAVF_MAX_TXD);621621- new_tx_count = ALIGN(new_tx_count, IAVF_REQ_DESCRIPTOR_MULTIPLE);618618+ if (ring->tx_pending > IAVF_MAX_TXD ||619619+ ring->tx_pending < IAVF_MIN_TXD ||620620+ ring->rx_pending > IAVF_MAX_RXD ||621621+ ring->rx_pending < IAVF_MIN_RXD) {622622+ netdev_err(netdev, "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d] (increment %d)\n",623623+ ring->tx_pending, ring->rx_pending, IAVF_MIN_TXD,624624+ IAVF_MAX_RXD, IAVF_REQ_DESCRIPTOR_MULTIPLE);625625+ return -EINVAL;626626+ }622627623623- new_rx_count = clamp_t(u32, ring->rx_pending,624624- IAVF_MIN_RXD,625625- IAVF_MAX_RXD);626626- new_rx_count = ALIGN(new_rx_count, IAVF_REQ_DESCRIPTOR_MULTIPLE);628628+ new_tx_count = ALIGN(ring->tx_pending, IAVF_REQ_DESCRIPTOR_MULTIPLE);629629+ if (new_tx_count != ring->tx_pending)630630+ netdev_info(netdev, "Requested Tx descriptor count rounded up to %d\n",631631+ new_tx_count);632632+633633+ new_rx_count = ALIGN(ring->rx_pending, IAVF_REQ_DESCRIPTOR_MULTIPLE);634634+ if (new_rx_count != ring->rx_pending)635635+ netdev_info(netdev, "Requested Rx descriptor count rounded up to %d\n",636636+ new_rx_count);627637628638 /* if nothing to do return success */629639 if ((new_tx_count == adapter->tx_desc_count) &&630630- (new_rx_count == adapter->rx_desc_count))640640+ (new_rx_count == adapter->rx_desc_count)) {641641+ netdev_dbg(netdev, "Nothing to change, descriptor count is same as requested\n");631642 return 0;643643+ }632644633633- adapter->tx_desc_count = new_tx_count;634634- adapter->rx_desc_count = new_rx_count;645645+ if (new_tx_count != adapter->tx_desc_count) {646646+ netdev_dbg(netdev, "Changing Tx descriptor count from %d to %d\n",647647+ adapter->tx_desc_count, new_tx_count);648648+ adapter->tx_desc_count = new_tx_count;649649+ }650650+651651+ if (new_rx_count != adapter->rx_desc_count) {652652+ netdev_dbg(netdev, "Changing Rx descriptor count from %d to %d\n",653653+ adapter->rx_desc_count, new_rx_count);654654+ adapter->rx_desc_count = new_rx_count;655655+ }635656636657 if (netif_running(netdev)) {637658 adapter->flags |= IAVF_FLAG_RESET_NEEDED;
+1
drivers/net/ethernet/intel/iavf/iavf_main.c
···22482248 }2249224922502250 pci_set_master(adapter->pdev);22512251+ pci_restore_msi_state(adapter->pdev);2251225222522253 if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {22532254 dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
+12-6
drivers/net/ethernet/intel/ice/ice_dcb_nl.c
···97979898 new_cfg->etscfg.maxtcs = pf->hw.func_caps.common_cap.maxtc;9999100100+ if (!bwcfg)101101+ new_cfg->etscfg.tcbwtable[0] = 100;102102+100103 if (!bwrec)101104 new_cfg->etsrec.tcbwtable[0] = 100;102105···170167 if (mode == pf->dcbx_cap)171168 return ICE_DCB_NO_HW_CHG;172169173173- pf->dcbx_cap = mode;174170 qos_cfg = &pf->hw.port_info->qos_cfg;175175- if (mode & DCB_CAP_DCBX_VER_CEE) {176176- if (qos_cfg->local_dcbx_cfg.pfc_mode == ICE_QOS_MODE_DSCP)177177- return ICE_DCB_NO_HW_CHG;171171+172172+ /* DSCP configuration is not DCBx negotiated */173173+ if (qos_cfg->local_dcbx_cfg.pfc_mode == ICE_QOS_MODE_DSCP)174174+ return ICE_DCB_NO_HW_CHG;175175+176176+ pf->dcbx_cap = mode;177177+178178+ if (mode & DCB_CAP_DCBX_VER_CEE)178179 qos_cfg->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_CEE;179179- } else {180180+ else180181 qos_cfg->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_IEEE;181181- }182182183183 dev_info(ice_pf_to_dev(pf), "DCBx mode = 0x%x\n", mode);184184 return ICE_DCB_HW_CHG_RST;
+2-2
drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
···12681268 bool is_tun = tun == ICE_FD_HW_SEG_TUN;12691269 int err;1270127012711271- if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num))12711271+ if (is_tun && !ice_get_open_tunnel_port(&pf->hw, &port_num, TNL_ALL))12721272 continue;12731273 err = ice_fdir_write_fltr(pf, input, add, is_tun);12741274 if (err)···16521652 }1653165316541654 /* return error if not an update and no available filters */16551655- fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port) ? 2 : 1;16551655+ fltrs_needed = ice_get_open_tunnel_port(hw, &tunnel_port, TNL_ALL) ? 2 : 1;16561656 if (!ice_fdir_find_fltr_by_idx(hw, fsp->location) &&16571657 ice_fdir_num_avail_fltr(hw, pf->vsi[vsi->idx]) < fltrs_needed) {16581658 dev_err(dev, "Failed to add filter. The maximum number of flow director filters has been reached.\n");
+1-1
drivers/net/ethernet/intel/ice/ice_fdir.c
···924924 memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len);925925 loc = pkt;926926 } else {927927- if (!ice_get_open_tunnel_port(hw, &tnl_port))927927+ if (!ice_get_open_tunnel_port(hw, &tnl_port, TNL_ALL))928928 return ICE_ERR_DOES_NOT_EXIST;929929 if (!ice_fdir_pkt[idx].tun_pkt)930930 return ICE_ERR_PARAM;
+5-2
drivers/net/ethernet/intel/ice/ice_flex_pipe.c
···18991899 * ice_get_open_tunnel_port - retrieve an open tunnel port19001900 * @hw: pointer to the HW structure19011901 * @port: returns open port19021902+ * @type: type of tunnel, can be TNL_LAST if it doesn't matter19021903 */19031904bool19041904-ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port)19051905+ice_get_open_tunnel_port(struct ice_hw *hw, u16 *port,19061906+ enum ice_tunnel_type type)19051907{19061908 bool res = false;19071909 u16 i;···19111909 mutex_lock(&hw->tnl_lock);1912191019131911 for (i = 0; i < hw->tnl.count && i < ICE_TUNNEL_MAX_ENTRIES; i++)19141914- if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].port) {19121912+ if (hw->tnl.tbl[i].valid && hw->tnl.tbl[i].port &&19131913+ (type == TNL_LAST || type == hw->tnl.tbl[i].type)) {19151914 *port = hw->tnl.tbl[i].port;19161915 res = true;19171916 break;
···58815881 netif_carrier_on(vsi->netdev);58825882 }5883588358845884+ /* clear this now, and the first stats read will be used as baseline */58855885+ vsi->stat_offsets_loaded = false;58865886+58845887 ice_service_task_schedule(pf);5885588858865889 return 0;···59305927/**59315928 * ice_update_vsi_tx_ring_stats - Update VSI Tx ring stats counters59325929 * @vsi: the VSI to be updated59305930+ * @vsi_stats: the stats struct to be updated59335931 * @rings: rings to work on59345932 * @count: number of rings59355933 */59365934static void59375937-ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi, struct ice_tx_ring **rings,59385938- u16 count)59355935+ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi,59365936+ struct rtnl_link_stats64 *vsi_stats,59375937+ struct ice_tx_ring **rings, u16 count)59395938{59405940- struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;59415939 u16 i;5942594059435941 for (i = 0; i < count; i++) {···59625958 */59635959static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)59645960{59655965- struct rtnl_link_stats64 *vsi_stats = &vsi->net_stats;59615961+ struct rtnl_link_stats64 *vsi_stats;59665962 u64 pkts, bytes;59675963 int i;5968596459695969- /* reset netdev stats */59705970- vsi_stats->tx_packets = 0;59715971- vsi_stats->tx_bytes = 0;59725972- vsi_stats->rx_packets = 0;59735973- vsi_stats->rx_bytes = 0;59655965+ vsi_stats = kzalloc(sizeof(*vsi_stats), GFP_ATOMIC);59665966+ if (!vsi_stats)59675967+ return;5974596859755969 /* reset non-netdev (extended) stats */59765970 vsi->tx_restart = 0;···59805978 rcu_read_lock();5981597959825980 /* update Tx rings counters */59835983- ice_update_vsi_tx_ring_stats(vsi, vsi->tx_rings, vsi->num_txq);59815981+ ice_update_vsi_tx_ring_stats(vsi, vsi_stats, vsi->tx_rings,59825982+ vsi->num_txq);5984598359855984 /* update Rx rings counters */59865985 ice_for_each_rxq(vsi, i) {···5996599359975994 /* update XDP Tx rings counters */59985995 if (ice_is_xdp_ena_vsi(vsi))59995999- ice_update_vsi_tx_ring_stats(vsi, vsi->xdp_rings,59965996+ ice_update_vsi_tx_ring_stats(vsi, vsi_stats, vsi->xdp_rings,60005997 vsi->num_xdp_txq);6001599860025999 rcu_read_unlock();60006000+60016001+ vsi->net_stats.tx_packets = vsi_stats->tx_packets;60026002+ vsi->net_stats.tx_bytes = vsi_stats->tx_bytes;60036003+ vsi->net_stats.rx_packets = vsi_stats->rx_packets;60046004+ vsi->net_stats.rx_bytes = vsi_stats->rx_bytes;60056005+60066006+ kfree(vsi_stats);60036007}6004600860056009/**
+14-7
drivers/net/ethernet/intel/ice/ice_switch.c
···37963796 * ice_find_recp - find a recipe37973797 * @hw: pointer to the hardware structure37983798 * @lkup_exts: extension sequence to match37993799+ * @tun_type: type of recipe tunnel37993800 *38003801 * Returns index of matching recipe, or ICE_MAX_NUM_RECIPES if not found.38013802 */38023802-static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts)38033803+static u1638043804+ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,38053805+ enum ice_sw_tunnel_type tun_type)38033806{38043807 bool refresh_required = true;38053808 struct ice_sw_recipe *recp;···38633860 }38643861 /* If for "i"th recipe the found was never set to false38653862 * then it means we found our match38633863+ * Also tun type of recipe needs to be checked38663864 */38673867- if (found)38653865+ if (found && recp[i].tun_type == tun_type)38683866 return i; /* Return the recipe ID */38693867 }38703868 }···46554651 }4656465246574653 /* Look for a recipe which matches our requested fv / mask list */46584658- *rid = ice_find_recp(hw, lkup_exts);46544654+ *rid = ice_find_recp(hw, lkup_exts, rinfo->tun_type);46594655 if (*rid < ICE_MAX_NUM_RECIPES)46604656 /* Success if found a recipe that match the existing criteria */46614657 goto err_unroll;4662465846594659+ rm->tun_type = rinfo->tun_type;46634660 /* Recipe we need does not exist, add a recipe */46644661 status = ice_add_sw_recipe(hw, rm, profiles);46654662 if (status)···4963495849644959 switch (tun_type) {49654960 case ICE_SW_TUN_VXLAN:49664966- case ICE_SW_TUN_GENEVE:49674967- if (!ice_get_open_tunnel_port(hw, &open_port))49614961+ if (!ice_get_open_tunnel_port(hw, &open_port, TNL_VXLAN))49684962 return ICE_ERR_CFG;49694963 break;49704970-49644964+ case ICE_SW_TUN_GENEVE:49654965+ if (!ice_get_open_tunnel_port(hw, &open_port, TNL_GENEVE))49664966+ return ICE_ERR_CFG;49674967+ break;49714968 default:49724969 /* Nothing needs to be done for this tunnel type */49734970 return 0;···55625555 if (status)55635556 return status;5564555755655565- rid = ice_find_recp(hw, &lkup_exts);55585558+ rid = ice_find_recp(hw, &lkup_exts, rinfo->tun_type);55665559 /* If did not find a recipe that match the existing criteria */55675560 if (rid == ICE_MAX_NUM_RECIPES)55685561 return ICE_ERR_PARAM;
···16171617 ice_vc_set_default_allowlist(vf);1618161816191619 ice_vf_fdir_exit(vf);16201620+ ice_vf_fdir_init(vf);16201621 /* clean VF control VSI when resetting VFs since it should be16211622 * setup only when VF creates its first FDIR rule.16221623 */···17481747 }1749174817501749 ice_vf_fdir_exit(vf);17501750+ ice_vf_fdir_init(vf);17511751 /* clean VF control VSI when resetting VF since it should be setup17521752 * only when VF creates its first FDIR rule.17531753 */···20222020 ret = ice_eswitch_configure(pf);20232021 if (ret)20242022 goto err_unroll_sriov;20232023+20242024+ /* rearm global interrupts */20252025+ if (test_and_clear_bit(ICE_OICR_INTR_DIS, pf->state))20262026+ ice_irq_dynamic_ena(hw, NULL, NULL);2025202720262028 return 0;20272029
···3480348034813481 spin_lock_irqsave(&qdev->hw_lock, hw_flags);3482348234833483- err = ql_wait_for_drvr_lock(qdev);34843484- if (err) {34853485- err = ql_adapter_initialize(qdev);34863486- if (err) {34873487- netdev_err(ndev, "Unable to initialize adapter\n");34883488- goto err_init;34893489- }34903490- netdev_err(ndev, "Releasing driver lock\n");34913491- ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);34923492- } else {34833483+ if (!ql_wait_for_drvr_lock(qdev)) {34933484 netdev_err(ndev, "Could not acquire driver lock\n");34853485+ err = -ENODEV;34943486 goto err_lock;34953487 }34883488+34893489+ err = ql_adapter_initialize(qdev);34903490+ if (err) {34913491+ netdev_err(ndev, "Unable to initialize adapter\n");34923492+ goto err_init;34933493+ }34943494+ ql_sem_unlock(qdev, QL_DRVR_SEM_MASK);3496349534973496 spin_unlock_irqrestore(&qdev->hw_lock, hw_flags);34983497
+1
drivers/net/phy/phylink.c
···13881388 * @mac_wol: true if the MAC needs to receive packets for Wake-on-Lan13891389 *13901390 * Handle a network device suspend event. There are several cases:13911391+ *13911392 * - If Wake-on-Lan is not active, we can bring down the link between13921393 * the MAC and PHY by calling phylink_stop().13931394 * - If Wake-on-Lan is active, and being handled only by the PHY, we
+2
drivers/net/usb/cdc_ncm.c
···181181 min = ctx->max_datagram_size + ctx->max_ndp_size + sizeof(struct usb_cdc_ncm_nth32);182182183183 max = min_t(u32, CDC_NCM_NTB_MAX_SIZE_TX, le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize));184184+ if (max == 0)185185+ max = CDC_NCM_NTB_MAX_SIZE_TX; /* dwNtbOutMaxSize not set */184186185187 /* some devices set dwNtbOutMaxSize too low for the above default */186188 min = min(min, max);
+7-6
drivers/net/vmxnet3/vmxnet3_drv.c
···3261326132623262#ifdef CONFIG_PCI_MSI32633263 if (adapter->intr.type == VMXNET3_IT_MSIX) {32643264- int i, nvec;32643264+ int i, nvec, nvec_allocated;3265326532663266 nvec = adapter->share_intr == VMXNET3_INTR_TXSHARE ?32673267 1 : adapter->num_tx_queues;···32743274 for (i = 0; i < nvec; i++)32753275 adapter->intr.msix_entries[i].entry = i;3276327632773277- nvec = vmxnet3_acquire_msix_vectors(adapter, nvec);32783278- if (nvec < 0)32773277+ nvec_allocated = vmxnet3_acquire_msix_vectors(adapter, nvec);32783278+ if (nvec_allocated < 0)32793279 goto msix_err;3280328032813281 /* If we cannot allocate one MSIx vector per queue32823282 * then limit the number of rx queues to 132833283 */32843284- if (nvec == VMXNET3_LINUX_MIN_MSIX_VECT) {32843284+ if (nvec_allocated == VMXNET3_LINUX_MIN_MSIX_VECT &&32853285+ nvec != VMXNET3_LINUX_MIN_MSIX_VECT) {32853286 if (adapter->share_intr != VMXNET3_INTR_BUDDYSHARE32863287 || adapter->num_rx_queues != 1) {32873288 adapter->share_intr = VMXNET3_INTR_TXSHARE;···32923291 }32933292 }3294329332953295- adapter->intr.num_intrs = nvec;32943294+ adapter->intr.num_intrs = nvec_allocated;32963295 return;3297329632983297msix_err:32993298 /* If we cannot allocate MSIx vectors use only one rx queue */33003299 dev_info(&adapter->pdev->dev,33013300 "Failed to enable MSI-X, error %d. "33023302- "Limiting #rx queues to 1, try MSI.\n", nvec);33013301+ "Limiting #rx queues to 1, try MSI.\n", nvec_allocated);3303330233043303 adapter->intr.type = VMXNET3_IT_MSI;33053304 }
···533533 ret = mhi_pm_suspend(ab_pci->mhi_ctrl);534534 break;535535 case ATH11K_MHI_RESUME:536536- ret = mhi_pm_resume(ab_pci->mhi_ctrl);536536+ /* Do force MHI resume as some devices like QCA6390, WCN6855537537+ * are not in M3 state but they are functional. So just ignore538538+ * the MHI state while resuming.539539+ */540540+ ret = mhi_pm_resume_force(ab_pci->mhi_ctrl);537541 break;538542 case ATH11K_MHI_TRIGGER_RDDM:539543 ret = mhi_force_rddm_mode(ab_pci->mhi_ctrl);
+17-9
drivers/net/wwan/iosm/iosm_ipc_imem.c
···181181bool ipc_imem_ul_write_td(struct iosm_imem *ipc_imem)182182{183183 struct ipc_mem_channel *channel;184184+ bool hpda_ctrl_pending = false;184185 struct sk_buff_head *ul_list;185186 bool hpda_pending = false;186186- bool forced_hpdu = false;187187 struct ipc_pipe *pipe;188188 int i;189189···200200 ul_list = &channel->ul_list;201201202202 /* Fill the transfer descriptor with the uplink buffer info. */203203- hpda_pending |= ipc_protocol_ul_td_send(ipc_imem->ipc_protocol,203203+ if (!ipc_imem_check_wwan_ips(channel)) {204204+ hpda_ctrl_pending |=205205+ ipc_protocol_ul_td_send(ipc_imem->ipc_protocol,204206 pipe, ul_list);205205-206206- /* forced HP update needed for non data channels */207207- if (hpda_pending && !ipc_imem_check_wwan_ips(channel))208208- forced_hpdu = true;207207+ } else {208208+ hpda_pending |=209209+ ipc_protocol_ul_td_send(ipc_imem->ipc_protocol,210210+ pipe, ul_list);211211+ }209212 }210213211211- if (forced_hpdu) {214214+ /* forced HP update needed for non data channels */215215+ if (hpda_ctrl_pending) {212216 hpda_pending = false;213217 ipc_protocol_doorbell_trigger(ipc_imem->ipc_protocol,214218 IPC_HP_UL_WRITE_TD);···530526 "Modem link down. Exit run state worker.");531527 return;532528 }529529+530530+ if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))531531+ ipc_devlink_deinit(ipc_imem->ipc_devlink);533532534533 if (!ipc_imem_setup_cp_mux_cap_init(ipc_imem, &mux_cfg))535534 ipc_imem->mux = ipc_mux_init(&mux_cfg, ipc_imem);···11741167 ipc_port_deinit(ipc_imem->ipc_port);11751168 }1176116911771177- if (ipc_imem->ipc_devlink)11701170+ if (test_and_clear_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag))11781171 ipc_devlink_deinit(ipc_imem->ipc_devlink);1179117211801173 ipc_imem_device_ipc_uninit(ipc_imem);···1270126312711264 ipc_imem->pci_device_id = device_id;1272126512731273- ipc_imem->ev_cdev_write_pending = false;12741266 ipc_imem->cp_version = 0;12751267 ipc_imem->device_sleep = IPC_HOST_SLEEP_ENTER_SLEEP;12761268···1337133113381332 if (ipc_flash_link_establish(ipc_imem))13391333 goto devlink_channel_fail;13341334+13351335+ set_bit(IOSM_DEVLINK_INIT, &ipc_imem->flag);13401336 }13411337 return ipc_imem;13421338devlink_channel_fail:
+1-3
drivers/net/wwan/iosm/iosm_ipc_imem.h
···101101#define IOSM_CHIP_INFO_SIZE_MAX 100102102103103#define FULLY_FUNCTIONAL 0104104+#define IOSM_DEVLINK_INIT 1104105105106/* List of the supported UL/DL pipes. */106107enum ipc_mem_pipes {···336335 * process the irq actions.337336 * @flag: Flag to monitor the state of driver338337 * @td_update_timer_suspended: if true then td update timer suspend339339- * @ev_cdev_write_pending: 0 means inform the IPC tasklet to pass340340- * the accumulated uplink buffers to CP.341338 * @ev_mux_net_transmit_pending:0 means inform the IPC tasklet to pass342339 * @reset_det_n: Reset detect flag343340 * @pcie_wake_n: Pcie wake flag···373374 u8 ev_irq_pending[IPC_IRQ_VECTORS];374375 unsigned long flag;375376 u8 td_update_timer_suspended:1,376376- ev_cdev_write_pending:1,377377 ev_mux_net_transmit_pending:1,378378 reset_det_n:1,379379 pcie_wake_n:1;
+1-6
drivers/net/wwan/iosm/iosm_ipc_imem_ops.c
···4141static int ipc_imem_tq_cdev_write(struct iosm_imem *ipc_imem, int arg,4242 void *msg, size_t size)4343{4444- ipc_imem->ev_cdev_write_pending = false;4544 ipc_imem_ul_send(ipc_imem);46454746 return 0;···4950/* Through tasklet to do sio write. */5051static int ipc_imem_call_cdev_write(struct iosm_imem *ipc_imem)5152{5252- if (ipc_imem->ev_cdev_write_pending)5353- return -1;5454-5555- ipc_imem->ev_cdev_write_pending = true;5656-5753 return ipc_task_queue_send_task(ipc_imem, ipc_imem_tq_cdev_write, 0,5854 NULL, 0, false);5955}···444450 /* Release the pipe resources */445451 ipc_imem_pipe_cleanup(ipc_imem, &channel->ul_pipe);446452 ipc_imem_pipe_cleanup(ipc_imem, &channel->dl_pipe);453453+ ipc_imem->nr_of_channels--;447454}448455449456void ipc_imem_sys_devlink_notify_rx(struct iosm_devlink *ipc_devlink,
+18-5
drivers/nvme/host/core.c
···666666 struct request *rq)667667{668668 if (ctrl->state != NVME_CTRL_DELETING_NOIO &&669669+ ctrl->state != NVME_CTRL_DELETING &&669670 ctrl->state != NVME_CTRL_DEAD &&670671 !test_bit(NVME_CTRL_FAILFAST_EXPIRED, &ctrl->flags) &&671672 !blk_noretry_request(rq) && !(rq->cmd_flags & REQ_NVME_MPATH))···17501749 */17511750 if (WARN_ON_ONCE(!(id->flbas & NVME_NS_FLBAS_META_EXT)))17521751 return -EINVAL;17531753- if (ctrl->max_integrity_segments)17541754- ns->features |=17551755- (NVME_NS_METADATA_SUPPORTED | NVME_NS_EXT_LBAS);17521752+17531753+ ns->features |= NVME_NS_EXT_LBAS;17541754+17551755+ /*17561756+ * The current fabrics transport drivers support namespace17571757+ * metadata formats only if nvme_ns_has_pi() returns true.17581758+ * Suppress support for all other formats so the namespace will17591759+ * have a 0 capacity and not be usable through the block stack.17601760+ *17611761+ * Note, this check will need to be modified if any drivers17621762+ * gain the ability to use other metadata formats.17631763+ */17641764+ if (ctrl->max_integrity_segments && nvme_ns_has_pi(ns))17651765+ ns->features |= NVME_NS_METADATA_SUPPORTED;17561766 } else {17571767 /*17581768 * For PCIe controllers, we can't easily remap the separate···2708269627092697 if (tmp->cntlid == ctrl->cntlid) {27102698 dev_err(ctrl->device,27112711- "Duplicate cntlid %u with %s, rejecting\n",27122712- ctrl->cntlid, dev_name(tmp->device));26992699+ "Duplicate cntlid %u with %s, subsys %s, rejecting\n",27002700+ ctrl->cntlid, dev_name(tmp->device),27012701+ subsys->subnqn);27132702 return false;27142703 }27152704
···922922 size_t data_len = le32_to_cpu(req->cmd->common.dptr.sgl.length);923923 int ret;924924925925- if (!nvme_is_write(cmd->req.cmd) ||925925+ /*926926+ * This command has not been processed yet, hence we are trying to927927+ * figure out if there is still pending data left to receive. If928928+ * we don't, we can simply prepare for the next pdu and bail out,929929+ * otherwise we will need to prepare a buffer and receive the930930+ * stale data before continuing forward.931931+ */932932+ if (!nvme_is_write(cmd->req.cmd) || !data_len ||926933 data_len > cmd->req.port->inline_data_size) {927934 nvmet_prepare_receive_pdu(queue);928935 return;
+25-2
drivers/of/irq.c
···7676}7777EXPORT_SYMBOL_GPL(of_irq_find_parent);78787979+/*8080+ * These interrupt controllers abuse interrupt-map for unspeakable8181+ * reasons and rely on the core code to *ignore* it (the drivers do8282+ * their own parsing of the property).8383+ *8484+ * If you think of adding to the list for something *new*, think8585+ * again. There is a high chance that you will be sent back to the8686+ * drawing board.8787+ */8888+static const char * const of_irq_imap_abusers[] = {8989+ "CBEA,platform-spider-pic",9090+ "sti,platform-spider-pic",9191+ "realtek,rtl-intc",9292+ "fsl,ls1021a-extirq",9393+ "fsl,ls1043a-extirq",9494+ "fsl,ls1088a-extirq",9595+ "renesas,rza1-irqc",9696+ NULL,9797+};9898+7999/**80100 * of_irq_parse_raw - Low level interrupt tree parsing81101 * @addr: address specifier (start of "reg" property of the device) in be32 format···179159 /*180160 * Now check if cursor is an interrupt-controller and181161 * if it is then we are done, unless there is an182182- * interrupt-map which takes precedence.162162+ * interrupt-map which takes precedence except on one163163+ * of these broken platforms that want to parse164164+ * interrupt-map themselves for $reason.183165 */184166 bool intc = of_property_read_bool(ipar, "interrupt-controller");185167186168 imap = of_get_property(ipar, "interrupt-map", &imaplen);187187- if (imap == NULL && intc) {169169+ if (intc &&170170+ (!imap || of_device_compatible_match(ipar, of_irq_imap_abusers))) {188171 pr_debug(" -> got it !\n");189172 return 0;190173 }
···127127};128128129129/**130130- * Write register and read back masked value to confirm it is written130130+ * usb_phy_write_readback() - Write register and read back masked value to131131+ * confirm it is written131132 *132132- * @base - QCOM DWC3 PHY base virtual address.133133- * @offset - register offset.134134- * @mask - register bitmask specifying what should be updated135135- * @val - value to write.133133+ * @phy_dwc3: QCOM DWC3 phy context134134+ * @offset: register offset.135135+ * @mask: register bitmask specifying what should be updated136136+ * @val: value to write.136137 */137138static inline void usb_phy_write_readback(struct usb_phy *phy_dwc3,138139 u32 offset,···172171}173172174173/**175175- * Write SSPHY register174174+ * usb_ss_write_phycreg() - Write SSPHY register176175 *177177- * @base - QCOM DWC3 PHY base virtual address.178178- * @addr - SSPHY address to write.179179- * @val - value to write.176176+ * @phy_dwc3: QCOM DWC3 phy context177177+ * @addr: SSPHY address to write.178178+ * @val: value to write.180179 */181180static int usb_ss_write_phycreg(struct usb_phy *phy_dwc3,182181 u32 addr, u32 val)···210209}211210212211/**213213- * Read SSPHY register.212212+ * usb_ss_read_phycreg() - Read SSPHY register.214213 *215215- * @base - QCOM DWC3 PHY base virtual address.216216- * @addr - SSPHY address to read.214214+ * @phy_dwc3: QCOM DWC3 phy context215215+ * @addr: SSPHY address to read.216216+ * @val: pointer in which read is store.217217 */218218static int usb_ss_read_phycreg(struct usb_phy *phy_dwc3,219219 u32 addr, u32 *val)
+3
drivers/phy/qualcomm/phy-qcom-qmp.c
···29732973 * @qmp: QMP phy to which this lane belongs29742974 * @lane_rst: lane's reset controller29752975 * @mode: current PHY mode29762976+ * @dp_aux_cfg: Display port aux config29772977+ * @dp_opts: Display port optional config29782978+ * @dp_clks: Display port clocks29762979 */29772980struct qmp_phy {29782981 struct phy *phy;
···11// SPDX-License-Identifier: GPL-2.022-/**22+/*33 * Wrapper driver for SERDES used in J721E44 *55 * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+3-3
drivers/phy/ti/phy-omap-usb2.c
···8989}90909191/**9292- * omap_usb2_set_comparator - links the comparator present in the system with9393- * this phy9494- * @comparator - the companion phy(comparator) for this phy9292+ * omap_usb2_set_comparator() - links the comparator present in the system with this phy9393+ *9494+ * @comparator: the companion phy(comparator) for this phy9595 *9696 * The phy companion driver should call this API passing the phy_companion9797 * filled with set_vbus and start_srp to be used by usb phy.
···9999 DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Tablet Gen 2"),100100 },101101 },102102+ {103103+ .ident = "Microsoft Surface Go 3",104104+ .matches = {105105+ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),106106+ DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"),107107+ },108108+ },102109 { }103110};104111
+12
drivers/platform/x86/lg-laptop.c
···657657 if (product && strlen(product) > 4)658658 switch (product[4]) {659659 case '5':660660+ if (strlen(product) > 5)661661+ switch (product[5]) {662662+ case 'N':663663+ year = 2021;664664+ break;665665+ case '0':666666+ year = 2016;667667+ break;668668+ default:669669+ year = 2022;670670+ }671671+ break;660672 case '6':661673 year = 2016;662674 break;
···406406 * the USB-2 spec requires such endpoints to have wMaxPacketSize = 0407407 * (see the end of section 5.6.3), so don't warn about them.408408 */409409- maxp = usb_endpoint_maxp(&endpoint->desc);409409+ maxp = le16_to_cpu(endpoint->desc.wMaxPacketSize);410410 if (maxp == 0 && !(usb_endpoint_xfer_isoc(d) && asnum == 0)) {411411 dev_warn(ddev, "config %d interface %d altsetting %d endpoint 0x%X has invalid wMaxPacketSize 0\n",412412 cfgno, inum, asnum, d->bEndpointAddress);···422422 maxpacket_maxes = full_speed_maxpacket_maxes;423423 break;424424 case USB_SPEED_HIGH:425425- /* Bits 12..11 are allowed only for HS periodic endpoints */425425+ /* Multiple-transactions bits are allowed only for HS periodic endpoints */426426 if (usb_endpoint_xfer_int(d) || usb_endpoint_xfer_isoc(d)) {427427- i = maxp & (BIT(12) | BIT(11));427427+ i = maxp & USB_EP_MAXP_MULT_MASK;428428 maxp &= ~i;429429 }430430 fallthrough;
-15
drivers/usb/dwc3/dwc3-qcom.c
···649649 struct dwc3_qcom *qcom = platform_get_drvdata(pdev);650650 struct device_node *np = pdev->dev.of_node, *dwc3_np;651651 struct device *dev = &pdev->dev;652652- struct property *prop;653652 int ret;654653655654 dwc3_np = of_get_compatible_child(np, "snps,dwc3");656655 if (!dwc3_np) {657656 dev_err(dev, "failed to find dwc3 core child\n");658657 return -ENODEV;659659- }660660-661661- prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL);662662- if (!prop) {663663- ret = -ENOMEM;664664- dev_err(dev, "unable to allocate memory for property\n");665665- goto node_put;666666- }667667-668668- prop->name = "tx-fifo-resize";669669- ret = of_add_property(dwc3_np, prop);670670- if (ret) {671671- dev_err(dev, "unable to add property\n");672672- goto node_put;673658 }674659675660 ret = of_platform_populate(np, NULL, NULL, dev);
+13-1
drivers/usb/gadget/composite.c
···16921692 struct usb_function *f = NULL;16931693 u8 endp;1694169416951695+ if (w_length > USB_COMP_EP0_BUFSIZ) {16961696+ if (ctrl->bRequestType == USB_DIR_OUT) {16971697+ goto done;16981698+ } else {16991699+ /* Cast away the const, we are going to overwrite on purpose. */17001700+ __le16 *temp = (__le16 *)&ctrl->wLength;17011701+17021702+ *temp = cpu_to_le16(USB_COMP_EP0_BUFSIZ);17031703+ w_length = USB_COMP_EP0_BUFSIZ;17041704+ }17051705+ }17061706+16951707 /* partial re-init of the response message; the function or the16961708 * gadget might need to intercept e.g. a control-OUT completion16971709 * when we delegate to it.···22342222 if (!cdev->req)22352223 return -ENOMEM;2236222422372237- cdev->req->buf = kmalloc(USB_COMP_EP0_BUFSIZ, GFP_KERNEL);22252225+ cdev->req->buf = kzalloc(USB_COMP_EP0_BUFSIZ, GFP_KERNEL);22382226 if (!cdev->req->buf)22392227 goto fail;22402228
+14-1
drivers/usb/gadget/legacy/dbgp.c
···137137 goto fail_1;138138 }139139140140- req->buf = kmalloc(DBGP_REQ_LEN, GFP_KERNEL);140140+ req->buf = kzalloc(DBGP_REQ_LEN, GFP_KERNEL);141141 if (!req->buf) {142142 err = -ENOMEM;143143 stp = 2;···344344 int err = -EOPNOTSUPP;345345 void *data = NULL;346346 u16 len = 0;347347+348348+ if (length > DBGP_REQ_LEN) {349349+ if (ctrl->bRequestType == USB_DIR_OUT) {350350+ return err;351351+ } else {352352+ /* Cast away the const, we are going to overwrite on purpose. */353353+ __le16 *temp = (__le16 *)&ctrl->wLength;354354+355355+ *temp = cpu_to_le16(DBGP_REQ_LEN);356356+ length = DBGP_REQ_LEN;357357+ }358358+ }359359+347360348361 if (request == USB_REQ_GET_DESCRIPTOR) {349362 switch (value>>8) {
+15-1
drivers/usb/gadget/legacy/inode.c
···110110/* enough for the whole queue: most events invalidate others */111111#define N_EVENT 5112112113113+#define RBUF_SIZE 256114114+113115struct dev_data {114116 spinlock_t lock;115117 refcount_t count;···146144 struct dentry *dentry;147145148146 /* except this scratch i/o buffer for ep0 */149149- u8 rbuf [256];147147+ u8 rbuf[RBUF_SIZE];150148};151149152150static inline void get_dev (struct dev_data *data)···13321330 struct usb_gadgetfs_event *event;13331331 u16 w_value = le16_to_cpu(ctrl->wValue);13341332 u16 w_length = le16_to_cpu(ctrl->wLength);13331333+13341334+ if (w_length > RBUF_SIZE) {13351335+ if (ctrl->bRequestType == USB_DIR_OUT) {13361336+ return value;13371337+ } else {13381338+ /* Cast away the const, we are going to overwrite on purpose. */13391339+ __le16 *temp = (__le16 *)&ctrl->wLength;13401340+13411341+ *temp = cpu_to_le16(RBUF_SIZE);13421342+ w_length = RBUF_SIZE;13431343+ }13441344+ }1335134513361346 spin_lock (&dev->lock);13371347 dev->setup_abort = 0;
+1
drivers/usb/host/xhci-hub.c
···717717 continue;718718719719 retval = xhci_disable_slot(xhci, i);720720+ xhci_free_virt_device(xhci, i);720721 if (retval)721722 xhci_err(xhci, "Failed to disable slot %d, %d. Enter test mode anyway\n",722723 i, retval);
-1
drivers/usb/host/xhci-ring.c
···15251525 if (xhci->quirks & XHCI_EP_LIMIT_QUIRK)15261526 /* Delete default control endpoint resources */15271527 xhci_free_device_endpoint_resources(xhci, virt_dev, true);15281528- xhci_free_virt_device(xhci, slot_id);15291528}1530152915311530static void xhci_handle_cmd_config_ep(struct xhci_hcd *xhci, int slot_id,
+15-11
drivers/usb/host/xhci.c
···39343934 struct xhci_slot_ctx *slot_ctx;39353935 int i, ret;3936393639373937-#ifndef CONFIG_USB_DEFAULT_PERSIST39383937 /*39393938 * We called pm_runtime_get_noresume when the device was attached.39403939 * Decrement the counter here to allow controller to runtime suspend···39413942 */39423943 if (xhci->quirks & XHCI_RESET_ON_RESUME)39433944 pm_runtime_put_noidle(hcd->self.controller);39443944-#endif3945394539463946 ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__);39473947 /* If the host is halted due to driver unload, we still need to free the···39593961 del_timer_sync(&virt_dev->eps[i].stop_cmd_timer);39603962 }39613963 virt_dev->udev = NULL;39623962- ret = xhci_disable_slot(xhci, udev->slot_id);39633963- if (ret)39643964- xhci_free_virt_device(xhci, udev->slot_id);39643964+ xhci_disable_slot(xhci, udev->slot_id);39653965+ xhci_free_virt_device(xhci, udev->slot_id);39653966}3966396739673968int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)···39703973 u32 state;39713974 int ret = 0;3972397539733973- command = xhci_alloc_command(xhci, false, GFP_KERNEL);39763976+ command = xhci_alloc_command(xhci, true, GFP_KERNEL);39743977 if (!command)39753978 return -ENOMEM;39763979···39953998 }39963999 xhci_ring_cmd_db(xhci);39974000 spin_unlock_irqrestore(&xhci->lock, flags);40014001+40024002+ wait_for_completion(command->completion);40034003+40044004+ if (command->status != COMP_SUCCESS)40054005+ xhci_warn(xhci, "Unsuccessful disable slot %u command, status %d\n",40064006+ slot_id, command->status);40074007+40084008+ xhci_free_command(xhci, command);40094009+39984010 return ret;39994011}40004012···4100409441014095 xhci_debugfs_create_slot(xhci, slot_id);4102409641034103-#ifndef CONFIG_USB_DEFAULT_PERSIST41044097 /*41054098 * If resetting upon resume, we can't put the controller into runtime41064099 * suspend if there is a device attached.41074100 */41084101 if (xhci->quirks & XHCI_RESET_ON_RESUME)41094102 pm_runtime_get_noresume(hcd->self.controller);41104110-#endif4111410341124104 /* Is this a LS or FS device under a HS hub? */41134105 /* Hub or peripherial? */41144106 return 1;4115410741164108disable_slot:41174117- ret = xhci_disable_slot(xhci, udev->slot_id);41184118- if (ret)41194119- xhci_free_virt_device(xhci, udev->slot_id);41094109+ xhci_disable_slot(xhci, udev->slot_id);41104110+ xhci_free_virt_device(xhci, udev->slot_id);4120411141214112 return 0;41224113}···4243424042444241 mutex_unlock(&xhci->mutex);42454242 ret = xhci_disable_slot(xhci, udev->slot_id);42434243+ xhci_free_virt_device(xhci, udev->slot_id);42464244 if (!ret)42474245 xhci_alloc_dev(hcd, udev);42484246 kfree(command->completion);
+152-34
fs/aio.c
···181181 struct file *file;182182 struct wait_queue_head *head;183183 __poll_t events;184184- bool done;185184 bool cancelled;185185+ bool work_scheduled;186186+ bool work_need_resched;186187 struct wait_queue_entry wait;187188 struct work_struct work;188189};···16201619 iocb_put(iocb);16211620}1622162116221622+/*16231623+ * Safely lock the waitqueue which the request is on, synchronizing with the16241624+ * case where the ->poll() provider decides to free its waitqueue early.16251625+ *16261626+ * Returns true on success, meaning that req->head->lock was locked, req->wait16271627+ * is on req->head, and an RCU read lock was taken. Returns false if the16281628+ * request was already removed from its waitqueue (which might no longer exist).16291629+ */16301630+static bool poll_iocb_lock_wq(struct poll_iocb *req)16311631+{16321632+ wait_queue_head_t *head;16331633+16341634+ /*16351635+ * While we hold the waitqueue lock and the waitqueue is nonempty,16361636+ * wake_up_pollfree() will wait for us. However, taking the waitqueue16371637+ * lock in the first place can race with the waitqueue being freed.16381638+ *16391639+ * We solve this as eventpoll does: by taking advantage of the fact that16401640+ * all users of wake_up_pollfree() will RCU-delay the actual free. If16411641+ * we enter rcu_read_lock() and see that the pointer to the queue is16421642+ * non-NULL, we can then lock it without the memory being freed out from16431643+ * under us, then check whether the request is still on the queue.16441644+ *16451645+ * Keep holding rcu_read_lock() as long as we hold the queue lock, in16461646+ * case the caller deletes the entry from the queue, leaving it empty.16471647+ * In that case, only RCU prevents the queue memory from being freed.16481648+ */16491649+ rcu_read_lock();16501650+ head = smp_load_acquire(&req->head);16511651+ if (head) {16521652+ spin_lock(&head->lock);16531653+ if (!list_empty(&req->wait.entry))16541654+ return true;16551655+ spin_unlock(&head->lock);16561656+ }16571657+ rcu_read_unlock();16581658+ return false;16591659+}16601660+16611661+static void poll_iocb_unlock_wq(struct poll_iocb *req)16621662+{16631663+ spin_unlock(&req->head->lock);16641664+ rcu_read_unlock();16651665+}16661666+16231667static void aio_poll_complete_work(struct work_struct *work)16241668{16251669 struct poll_iocb *req = container_of(work, struct poll_iocb, work);···16841638 * avoid further branches in the fast path.16851639 */16861640 spin_lock_irq(&ctx->ctx_lock);16871687- if (!mask && !READ_ONCE(req->cancelled)) {16881688- add_wait_queue(req->head, &req->wait);16891689- spin_unlock_irq(&ctx->ctx_lock);16901690- return;16911691- }16411641+ if (poll_iocb_lock_wq(req)) {16421642+ if (!mask && !READ_ONCE(req->cancelled)) {16431643+ /*16441644+ * The request isn't actually ready to be completed yet.16451645+ * Reschedule completion if another wakeup came in.16461646+ */16471647+ if (req->work_need_resched) {16481648+ schedule_work(&req->work);16491649+ req->work_need_resched = false;16501650+ } else {16511651+ req->work_scheduled = false;16521652+ }16531653+ poll_iocb_unlock_wq(req);16541654+ spin_unlock_irq(&ctx->ctx_lock);16551655+ return;16561656+ }16571657+ list_del_init(&req->wait.entry);16581658+ poll_iocb_unlock_wq(req);16591659+ } /* else, POLLFREE has freed the waitqueue, so we must complete */16921660 list_del_init(&iocb->ki_list);16931661 iocb->ki_res.res = mangle_poll(mask);16941694- req->done = true;16951662 spin_unlock_irq(&ctx->ctx_lock);1696166316971664 iocb_put(iocb);···17161657 struct aio_kiocb *aiocb = container_of(iocb, struct aio_kiocb, rw);17171658 struct poll_iocb *req = &aiocb->poll;1718165917191719- spin_lock(&req->head->lock);17201720- WRITE_ONCE(req->cancelled, true);17211721- if (!list_empty(&req->wait.entry)) {17221722- list_del_init(&req->wait.entry);17231723- schedule_work(&aiocb->poll.work);17241724- }17251725- spin_unlock(&req->head->lock);16601660+ if (poll_iocb_lock_wq(req)) {16611661+ WRITE_ONCE(req->cancelled, true);16621662+ if (!req->work_scheduled) {16631663+ schedule_work(&aiocb->poll.work);16641664+ req->work_scheduled = true;16651665+ }16661666+ poll_iocb_unlock_wq(req);16671667+ } /* else, the request was force-cancelled by POLLFREE already */1726166817271669 return 0;17281670}···17401680 if (mask && !(mask & req->events))17411681 return 0;1742168217431743- list_del_init(&req->wait.entry);17441744-17451745- if (mask && spin_trylock_irqsave(&iocb->ki_ctx->ctx_lock, flags)) {16831683+ /*16841684+ * Complete the request inline if possible. This requires that three16851685+ * conditions be met:16861686+ * 1. An event mask must have been passed. If a plain wakeup was done16871687+ * instead, then mask == 0 and we have to call vfs_poll() to get16881688+ * the events, so inline completion isn't possible.16891689+ * 2. The completion work must not have already been scheduled.16901690+ * 3. ctx_lock must not be busy. We have to use trylock because we16911691+ * already hold the waitqueue lock, so this inverts the normal16921692+ * locking order. Use irqsave/irqrestore because not all16931693+ * filesystems (e.g. fuse) call this function with IRQs disabled,16941694+ * yet IRQs have to be disabled before ctx_lock is obtained.16951695+ */16961696+ if (mask && !req->work_scheduled &&16971697+ spin_trylock_irqsave(&iocb->ki_ctx->ctx_lock, flags)) {17461698 struct kioctx *ctx = iocb->ki_ctx;1747169917481748- /*17491749- * Try to complete the iocb inline if we can. Use17501750- * irqsave/irqrestore because not all filesystems (e.g. fuse)17511751- * call this function with IRQs disabled and because IRQs17521752- * have to be disabled before ctx_lock is obtained.17531753- */17001700+ list_del_init(&req->wait.entry);17541701 list_del(&iocb->ki_list);17551702 iocb->ki_res.res = mangle_poll(mask);17561756- req->done = true;17571757- if (iocb->ki_eventfd && eventfd_signal_allowed()) {17031703+ if (iocb->ki_eventfd && !eventfd_signal_allowed()) {17581704 iocb = NULL;17591705 INIT_WORK(&req->work, aio_poll_put_work);17601706 schedule_work(&req->work);···17691703 if (iocb)17701704 iocb_put(iocb);17711705 } else {17721772- schedule_work(&req->work);17061706+ /*17071707+ * Schedule the completion work if needed. If it was already17081708+ * scheduled, record that another wakeup came in.17091709+ *17101710+ * Don't remove the request from the waitqueue here, as it might17111711+ * not actually be complete yet (we won't know until vfs_poll()17121712+ * is called), and we must not miss any wakeups. POLLFREE is an17131713+ * exception to this; see below.17141714+ */17151715+ if (req->work_scheduled) {17161716+ req->work_need_resched = true;17171717+ } else {17181718+ schedule_work(&req->work);17191719+ req->work_scheduled = true;17201720+ }17211721+17221722+ /*17231723+ * If the waitqueue is being freed early but we can't complete17241724+ * the request inline, we have to tear down the request as best17251725+ * we can. That means immediately removing the request from its17261726+ * waitqueue and preventing all further accesses to the17271727+ * waitqueue via the request. We also need to schedule the17281728+ * completion work (done above). Also mark the request as17291729+ * cancelled, to potentially skip an unneeded call to ->poll().17301730+ */17311731+ if (mask & POLLFREE) {17321732+ WRITE_ONCE(req->cancelled, true);17331733+ list_del_init(&req->wait.entry);17341734+17351735+ /*17361736+ * Careful: this *must* be the last step, since as soon17371737+ * as req->head is NULL'ed out, the request can be17381738+ * completed and freed, since aio_poll_complete_work()17391739+ * will no longer need to take the waitqueue lock.17401740+ */17411741+ smp_store_release(&req->head, NULL);17421742+ }17731743 }17741744 return 1;17751745}···18131711struct aio_poll_table {18141712 struct poll_table_struct pt;18151713 struct aio_kiocb *iocb;17141714+ bool queued;18161715 int error;18171716};18181717···18241721 struct aio_poll_table *pt = container_of(p, struct aio_poll_table, pt);1825172218261723 /* multiple wait queues per file are not supported */18271827- if (unlikely(pt->iocb->poll.head)) {17241724+ if (unlikely(pt->queued)) {18281725 pt->error = -EINVAL;18291726 return;18301727 }1831172817291729+ pt->queued = true;18321730 pt->error = 0;18331731 pt->iocb->poll.head = head;18341732 add_wait_queue(head, &pt->iocb->poll.wait);···18541750 req->events = demangle_poll(iocb->aio_buf) | EPOLLERR | EPOLLHUP;1855175118561752 req->head = NULL;18571857- req->done = false;18581753 req->cancelled = false;17541754+ req->work_scheduled = false;17551755+ req->work_need_resched = false;1859175618601757 apt.pt._qproc = aio_poll_queue_proc;18611758 apt.pt._key = req->events;18621759 apt.iocb = aiocb;17601760+ apt.queued = false;18631761 apt.error = -EINVAL; /* same as no support for IOCB_CMD_POLL */1864176218651763 /* initialized the list so that we can do list_empty checks */···1870176418711765 mask = vfs_poll(req->file, &apt.pt) & req->events;18721766 spin_lock_irq(&ctx->ctx_lock);18731873- if (likely(req->head)) {18741874- spin_lock(&req->head->lock);18751875- if (unlikely(list_empty(&req->wait.entry))) {18761876- if (apt.error)17671767+ if (likely(apt.queued)) {17681768+ bool on_queue = poll_iocb_lock_wq(req);17691769+17701770+ if (!on_queue || req->work_scheduled) {17711771+ /*17721772+ * aio_poll_wake() already either scheduled the async17731773+ * completion work, or completed the request inline.17741774+ */17751775+ if (apt.error) /* unsupported case: multiple queues */18771776 cancel = true;18781777 apt.error = 0;18791778 mask = 0;18801779 }18811780 if (mask || apt.error) {17811781+ /* Steal to complete synchronously. */18821782 list_del_init(&req->wait.entry);18831783 } else if (cancel) {17841784+ /* Cancel if possible (may be too late though). */18841785 WRITE_ONCE(req->cancelled, true);18851885- } else if (!req->done) { /* actually waiting for an event */17861786+ } else if (on_queue) {17871787+ /*17881788+ * Actually waiting for an event, so add the request to17891789+ * active_reqs so that it can be cancelled if needed.17901790+ */18861791 list_add_tail(&aiocb->ki_list, &ctx->active_reqs);18871792 aiocb->ki_cancel = aio_poll_cancel;18881793 }18891889- spin_unlock(&req->head->lock);17941794+ if (on_queue)17951795+ poll_iocb_unlock_wq(req);18901796 }18911797 if (mask) { /* no async, we'd stolen it */18921798 aiocb->ki_res.res = mangle_poll(mask);
+9-3
fs/btrfs/delalloc-space.c
···143143144144 /* Use new btrfs_qgroup_reserve_data to reserve precious data space. */145145 ret = btrfs_qgroup_reserve_data(inode, reserved, start, len);146146- if (ret < 0)146146+ if (ret < 0) {147147 btrfs_free_reserved_data_space_noquota(fs_info, len);148148- else148148+ extent_changeset_free(*reserved);149149+ *reserved = NULL;150150+ } else {149151 ret = 0;152152+ }150153 return ret;151154}152155···455452 if (ret < 0)456453 return ret;457454 ret = btrfs_delalloc_reserve_metadata(inode, len);458458- if (ret < 0)455455+ if (ret < 0) {459456 btrfs_free_reserved_data_space(inode, *reserved, start, len);457457+ extent_changeset_free(*reserved);458458+ *reserved = NULL;459459+ }460460 return ret;461461}462462
···43144314 return;4315431543164316 /*43174317+ * A read may stumble upon this buffer later, make sure that it gets an43184318+ * error and knows there was an error.43194319+ */43204320+ clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);43214321+43224322+ /*43234323+ * We need to set the mapping with the io error as well because a write43244324+ * error will flip the file system readonly, and then syncfs() will43254325+ * return a 0 because we are readonly if we don't modify the err seq for43264326+ * the superblock.43274327+ */43284328+ mapping_set_error(page->mapping, -EIO);43294329+43304330+ /*43174331 * If we error out, we should add back the dirty_metadata_bytes43184332 * to make it consistent.43194333 */
+2-4
fs/btrfs/ioctl.c
···31873187 return -EPERM;3188318831893189 vol_args = memdup_user(arg, sizeof(*vol_args));31903190- if (IS_ERR(vol_args)) {31913191- ret = PTR_ERR(vol_args);31923192- goto out;31933193- }31903190+ if (IS_ERR(vol_args))31913191+ return PTR_ERR(vol_args);3194319231953193 if (vol_args->flags & ~BTRFS_DEVICE_REMOVE_ARGS_MASK) {31963194 ret = -EOPNOTSUPP;
···590590{591591 unsigned int tioffset; /* challenge message target info area */592592 unsigned int tilen; /* challenge message target info area length */593593-594593 CHALLENGE_MESSAGE *pblob = (CHALLENGE_MESSAGE *)bcc_ptr;594594+ __u32 server_flags;595595596596 if (blob_len < sizeof(CHALLENGE_MESSAGE)) {597597 cifs_dbg(VFS, "challenge blob len %d too small\n", blob_len);···609609 return -EINVAL;610610 }611611612612+ server_flags = le32_to_cpu(pblob->NegotiateFlags);613613+ cifs_dbg(FYI, "%s: negotiate=0x%08x challenge=0x%08x\n", __func__,614614+ ses->ntlmssp->client_flags, server_flags);615615+616616+ if ((ses->ntlmssp->client_flags & (NTLMSSP_NEGOTIATE_SEAL | NTLMSSP_NEGOTIATE_SIGN)) &&617617+ (!(server_flags & NTLMSSP_NEGOTIATE_56) && !(server_flags & NTLMSSP_NEGOTIATE_128))) {618618+ cifs_dbg(VFS, "%s: requested signing/encryption but server did not return either 56-bit or 128-bit session key size\n",619619+ __func__);620620+ return -EINVAL;621621+ }622622+ if (!(server_flags & NTLMSSP_NEGOTIATE_NTLM) && !(server_flags & NTLMSSP_NEGOTIATE_EXTENDED_SEC)) {623623+ cifs_dbg(VFS, "%s: server does not seem to support either NTLMv1 or NTLMv2\n", __func__);624624+ return -EINVAL;625625+ }626626+ if (ses->server->sign && !(server_flags & NTLMSSP_NEGOTIATE_SIGN)) {627627+ cifs_dbg(VFS, "%s: forced packet signing but server does not seem to support it\n",628628+ __func__);629629+ return -EOPNOTSUPP;630630+ }631631+ if ((ses->ntlmssp->client_flags & NTLMSSP_NEGOTIATE_KEY_XCH) &&632632+ !(server_flags & NTLMSSP_NEGOTIATE_KEY_XCH))633633+ pr_warn_once("%s: authentication has been weakened as server does not support key exchange\n",634634+ __func__);635635+636636+ ses->ntlmssp->server_flags = server_flags;637637+612638 memcpy(ses->ntlmssp->cryptkey, pblob->Challenge, CIFS_CRYPTO_KEY_SIZE);613613- /* BB we could decode pblob->NegotiateFlags; some may be useful */614639 /* In particular we can examine sign flags */615640 /* BB spec says that if AvId field of MsvAvTimestamp is populated then616641 we must set the MIC field of the AUTHENTICATE_MESSAGE */617617- ses->ntlmssp->server_flags = le32_to_cpu(pblob->NegotiateFlags);642642+618643 tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset);619644 tilen = le16_to_cpu(pblob->TargetInfoArray.Length);620645 if (tioffset > blob_len || tioffset + tilen > blob_len) {···746721 flags = NTLMSSP_NEGOTIATE_56 | NTLMSSP_REQUEST_TARGET |747722 NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_UNICODE |748723 NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_EXTENDED_SEC |749749- NTLMSSP_NEGOTIATE_SEAL;750750- if (server->sign)751751- flags |= NTLMSSP_NEGOTIATE_SIGN;724724+ NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NTLMSSP_NEGOTIATE_SEAL |725725+ NTLMSSP_NEGOTIATE_SIGN;752726 if (!server->session_estab || ses->ntlmssp->sesskey_per_smbsess)753727 flags |= NTLMSSP_NEGOTIATE_KEY_XCH;754728755729 tmp = *pbuffer + sizeof(NEGOTIATE_MESSAGE);730730+ ses->ntlmssp->client_flags = flags;756731 sec_blob->NegotiateFlags = cpu_to_le32(flags);757732758733 /* these fields should be null in negotiate phase MS-NLMP 3.1.5.1.1 */···804779 memcpy(sec_blob->Signature, NTLMSSP_SIGNATURE, 8);805780 sec_blob->MessageType = NtLmAuthenticate;806781807807- flags = NTLMSSP_NEGOTIATE_56 |808808- NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_TARGET_INFO |809809- NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_UNICODE |810810- NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_EXTENDED_SEC |811811- NTLMSSP_NEGOTIATE_SEAL | NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED;812812- if (ses->server->sign)813813- flags |= NTLMSSP_NEGOTIATE_SIGN;814814- if (!ses->server->session_estab || ses->ntlmssp->sesskey_per_smbsess)815815- flags |= NTLMSSP_NEGOTIATE_KEY_XCH;782782+ flags = ses->ntlmssp->server_flags | NTLMSSP_REQUEST_TARGET |783783+ NTLMSSP_NEGOTIATE_TARGET_INFO | NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED;816784817785 tmp = *pbuffer + sizeof(AUTHENTICATE_MESSAGE);818786 sec_blob->NegotiateFlags = cpu_to_le32(flags);···852834 *pbuffer, &tmp,853835 nls_cp);854836855855- if (((ses->ntlmssp->server_flags & NTLMSSP_NEGOTIATE_KEY_XCH) ||856856- (ses->ntlmssp->server_flags & NTLMSSP_NEGOTIATE_EXTENDED_SEC))857857- && !calc_seckey(ses)) {837837+ if ((ses->ntlmssp->server_flags & NTLMSSP_NEGOTIATE_KEY_XCH) &&838838+ (!ses->server->session_estab || ses->ntlmssp->sesskey_per_smbsess) &&839839+ !calc_seckey(ses)) {858840 memcpy(tmp, ses->ntlmssp->ciphertext, CIFS_CPHTXT_SIZE);859841 sec_blob->SessionKey.BufferOffset = cpu_to_le32(tmp - *pbuffer);860842 sec_blob->SessionKey.Length = cpu_to_le16(CIFS_CPHTXT_SIZE);
+23-6
fs/io-wq.c
···142142 struct io_wqe_acct *acct,143143 struct io_cb_cancel_data *match);144144static void create_worker_cb(struct callback_head *cb);145145+static void io_wq_cancel_tw_create(struct io_wq *wq);145146146147static bool io_worker_get(struct io_worker *worker)147148{···358357 test_and_set_bit_lock(0, &worker->create_state))359358 goto fail_release;360359360360+ atomic_inc(&wq->worker_refs);361361 init_task_work(&worker->create_work, func);362362 worker->create_index = acct->index;363363 if (!task_work_add(wq->task, &worker->create_work, TWA_SIGNAL)) {364364- clear_bit_unlock(0, &worker->create_state);364364+ /*365365+ * EXIT may have been set after checking it above, check after366366+ * adding the task_work and remove any creation item if it is367367+ * now set. wq exit does that too, but we can have added this368368+ * work item after we canceled in io_wq_exit_workers().369369+ */370370+ if (test_bit(IO_WQ_BIT_EXIT, &wq->state))371371+ io_wq_cancel_tw_create(wq);372372+ io_worker_ref_put(wq);365373 return true;366374 }375375+ io_worker_ref_put(wq);367376 clear_bit_unlock(0, &worker->create_state);368377fail_release:369378 io_worker_release(worker);···12091198 set_bit(IO_WQ_BIT_EXIT, &wq->state);12101199}1211120012121212-static void io_wq_exit_workers(struct io_wq *wq)12011201+static void io_wq_cancel_tw_create(struct io_wq *wq)12131202{12141203 struct callback_head *cb;12151215- int node;12161216-12171217- if (!wq->task)12181218- return;1219120412201205 while ((cb = task_work_cancel_match(wq->task, io_task_work_match, wq)) != NULL) {12211206 struct io_worker *worker;···12191212 worker = container_of(cb, struct io_worker, create_work);12201213 io_worker_cancel_cb(worker);12211214 }12151215+}12161216+12171217+static void io_wq_exit_workers(struct io_wq *wq)12181218+{12191219+ int node;12201220+12211221+ if (!wq->task)12221222+ return;12231223+12241224+ io_wq_cancel_tw_create(wq);1222122512231226 rcu_read_lock();12241227 for_each_node(node) {
+4-2
fs/io_uring.c
···9824982498259825/*98269826 * Find any io_uring ctx that this task has registered or done IO on, and cancel98279827- * requests. @sqd should be not-null IIF it's an SQPOLL thread cancellation.98279827+ * requests. @sqd should be not-null IFF it's an SQPOLL thread cancellation.98289828 */98299829static __cold void io_uring_cancel_generic(bool cancel_all,98309830 struct io_sq_data *sqd)···98669866 cancel_all);98679867 }9868986898699869- prepare_to_wait(&tctx->wait, &wait, TASK_UNINTERRUPTIBLE);98699869+ prepare_to_wait(&tctx->wait, &wait, TASK_INTERRUPTIBLE);98709870+ io_run_task_work();98709871 io_uring_drop_tctx_refs(current);98729872+98719873 /*98729874 * If we've seen completions, retry without waiting. This98739875 * avoids a race where a completion comes in before we did
···35353636void signalfd_cleanup(struct sighand_struct *sighand)3737{3838- wait_queue_head_t *wqh = &sighand->signalfd_wqh;3939- /*4040- * The lockless check can race with remove_wait_queue() in progress,4141- * but in this case its caller should run under rcu_read_lock() and4242- * sighand_cachep is SLAB_TYPESAFE_BY_RCU, we can safely return.4343- */4444- if (likely(!waitqueue_active(wqh)))4545- return;4646-4747- /* wait_queue_entry_t->func(POLLFREE) should do remove_wait_queue() */4848- wake_up_poll(wqh, EPOLLHUP | POLLFREE);3838+ wake_up_pollfree(&sighand->signalfd_wqh);4939}50405141struct signalfd_ctx {
-13
fs/smbfs_common/cifs_arc4.c
···7272 ctx->y = y;7373}7474EXPORT_SYMBOL_GPL(cifs_arc4_crypt);7575-7676-static int __init7777-init_smbfs_common(void)7878-{7979- return 0;8080-}8181-static void __init8282-exit_smbfs_common(void)8383-{8484-}8585-8686-module_init(init_smbfs_common)8787-module_exit(exit_smbfs_common)
+76
fs/tracefs/inode.c
···161161 struct tracefs_mount_opts mount_opts;162162};163163164164+static void change_gid(struct dentry *dentry, kgid_t gid)165165+{166166+ if (!dentry->d_inode)167167+ return;168168+ dentry->d_inode->i_gid = gid;169169+}170170+171171+/*172172+ * Taken from d_walk, but without he need for handling renames.173173+ * Nothing can be renamed while walking the list, as tracefs174174+ * does not support renames. This is only called when mounting175175+ * or remounting the file system, to set all the files to176176+ * the given gid.177177+ */178178+static void set_gid(struct dentry *parent, kgid_t gid)179179+{180180+ struct dentry *this_parent;181181+ struct list_head *next;182182+183183+ this_parent = parent;184184+ spin_lock(&this_parent->d_lock);185185+186186+ change_gid(this_parent, gid);187187+repeat:188188+ next = this_parent->d_subdirs.next;189189+resume:190190+ while (next != &this_parent->d_subdirs) {191191+ struct list_head *tmp = next;192192+ struct dentry *dentry = list_entry(tmp, struct dentry, d_child);193193+ next = tmp->next;194194+195195+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);196196+197197+ change_gid(dentry, gid);198198+199199+ if (!list_empty(&dentry->d_subdirs)) {200200+ spin_unlock(&this_parent->d_lock);201201+ spin_release(&dentry->d_lock.dep_map, _RET_IP_);202202+ this_parent = dentry;203203+ spin_acquire(&this_parent->d_lock.dep_map, 0, 1, _RET_IP_);204204+ goto repeat;205205+ }206206+ spin_unlock(&dentry->d_lock);207207+ }208208+ /*209209+ * All done at this level ... ascend and resume the search.210210+ */211211+ rcu_read_lock();212212+ascend:213213+ if (this_parent != parent) {214214+ struct dentry *child = this_parent;215215+ this_parent = child->d_parent;216216+217217+ spin_unlock(&child->d_lock);218218+ spin_lock(&this_parent->d_lock);219219+220220+ /* go into the first sibling still alive */221221+ do {222222+ next = child->d_child.next;223223+ if (next == &this_parent->d_subdirs)224224+ goto ascend;225225+ child = list_entry(next, struct dentry, d_child);226226+ } while (unlikely(child->d_flags & DCACHE_DENTRY_KILLED));227227+ rcu_read_unlock();228228+ goto resume;229229+ }230230+ rcu_read_unlock();231231+ spin_unlock(&this_parent->d_lock);232232+ return;233233+}234234+164235static int tracefs_parse_options(char *data, struct tracefs_mount_opts *opts)165236{166237 substring_t args[MAX_OPT_ARGS];···264193 if (!gid_valid(gid))265194 return -EINVAL;266195 opts->gid = gid;196196+ set_gid(tracefs_mount->mnt_root, gid);267197 break;268198 case Opt_mode:269199 if (match_octal(&args[0], &option))···486414 inode->i_mode = mode;487415 inode->i_fop = fops ? fops : &tracefs_file_operations;488416 inode->i_private = data;417417+ inode->i_uid = d_inode(dentry->d_parent)->i_uid;418418+ inode->i_gid = d_inode(dentry->d_parent)->i_gid;489419 d_instantiate(dentry, inode);490420 fsnotify_create(dentry->d_parent->d_inode, dentry);491421 return end_creating(dentry);···510436 inode->i_mode = S_IFDIR | S_IRWXU | S_IRUSR| S_IRGRP | S_IXUSR | S_IXGRP;511437 inode->i_op = ops;512438 inode->i_fop = &simple_dir_operations;439439+ inode->i_uid = d_inode(dentry->d_parent)->i_uid;440440+ inode->i_gid = d_inode(dentry->d_parent)->i_gid;513441514442 /* directory inodes start off with i_nlink == 2 (for "." entry) */515443 inc_nlink(inode);
+11-3
fs/xfs/xfs_super.c
···17651765xfs_remount_ro(17661766 struct xfs_mount *mp)17671767{17681768- int error;17681768+ struct xfs_icwalk icw = {17691769+ .icw_flags = XFS_ICWALK_FLAG_SYNC,17701770+ };17711771+ int error;1769177217701773 /*17711774 * Cancel background eofb scanning so it cannot race with the final···17761773 */17771774 xfs_blockgc_stop(mp);1778177517791779- /* Get rid of any leftover CoW reservations... */17801780- error = xfs_blockgc_free_space(mp, NULL);17761776+ /*17771777+ * Clear out all remaining COW staging extents and speculative post-EOF17781778+ * preallocations so that we don't leave inodes requiring inactivation17791779+ * cleanups during reclaim on a read-only mount. We must process every17801780+ * cached inode, so this requires a synchronous cache scan.17811781+ */17821782+ error = xfs_blockgc_free_space(mp, &icw);17811783 if (error) {17821784 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);17831785 return error;
+3-14
include/linux/bpf.h
···732732struct bpf_trampoline *bpf_trampoline_get(u64 key,733733 struct bpf_attach_target_info *tgt_info);734734void bpf_trampoline_put(struct bpf_trampoline *tr);735735+int arch_prepare_bpf_dispatcher(void *image, s64 *funcs, int num_funcs);735736#define BPF_DISPATCHER_INIT(_name) { \736737 .mutex = __MUTEX_INITIALIZER(_name.mutex), \737738 .func = &_name##_func, \···13531352 * kprobes, tracepoints) to prevent deadlocks on map operations as any of13541353 * these events can happen inside a region which holds a map bucket lock13551354 * and can deadlock on it.13561356- *13571357- * Use the preemption safe inc/dec variants on RT because migrate disable13581358- * is preemptible on RT and preemption in the middle of the RMW operation13591359- * might lead to inconsistent state. Use the raw variants for non RT13601360- * kernels as migrate_disable() maps to preempt_disable() so the slightly13611361- * more expensive save operation can be avoided.13621355 */13631356static inline void bpf_disable_instrumentation(void)13641357{13651358 migrate_disable();13661366- if (IS_ENABLED(CONFIG_PREEMPT_RT))13671367- this_cpu_inc(bpf_prog_active);13681368- else13691369- __this_cpu_inc(bpf_prog_active);13591359+ this_cpu_inc(bpf_prog_active);13701360}1371136113721362static inline void bpf_enable_instrumentation(void)13731363{13741374- if (IS_ENABLED(CONFIG_PREEMPT_RT))13751375- this_cpu_dec(bpf_prog_active);13761376- else13771377- __this_cpu_dec(bpf_prog_active);13641364+ this_cpu_dec(bpf_prog_active);13781365 migrate_enable();13791366}13801367
···2020 */21212222#include <linux/math.h>2323+#include <linux/sched.h>23242425extern unsigned long loops_per_jiffy;2526···5958void __attribute__((weak)) calibration_delay_done(void);6059void msleep(unsigned int msecs);6160unsigned long msleep_interruptible(unsigned int msecs);6262-void usleep_range(unsigned long min, unsigned long max);6161+void usleep_range_state(unsigned long min, unsigned long max,6262+ unsigned int state);6363+6464+static inline void usleep_range(unsigned long min, unsigned long max)6565+{6666+ usleep_range_state(min, max, TASK_UNINTERRUPTIBLE);6767+}6868+6969+static inline void usleep_idle_range(unsigned long min, unsigned long max)7070+{7171+ usleep_range_state(min, max, TASK_IDLE);7272+}63736474static inline void ssleep(unsigned int seconds)6575{
+1
include/linux/device/driver.h
···1818#include <linux/klist.h>1919#include <linux/pm.h>2020#include <linux/device/bus.h>2121+#include <linux/module.h>21222223/**2324 * enum probe_type - device driver probe type to try
+1-4
include/linux/filter.h
···66#define __LINUX_FILTER_H__7788#include <linux/atomic.h>99+#include <linux/bpf.h>910#include <linux/refcount.h>1011#include <linux/compat.h>1112#include <linux/skbuff.h>···27262827#include <asm/byteorder.h>2928#include <uapi/linux/filter.h>3030-#include <uapi/linux/bpf.h>31293230struct sk_buff;3331struct sock;···640640 * This uses migrate_disable/enable() explicitly to document that the641641 * invocation of a BPF program does not require reentrancy protection642642 * against a BPF program which is invoked from a preempting task.643643- *644644- * For non RT enabled kernels migrate_disable/enable() maps to645645- * preempt_disable/enable(), i.e. it disables also preemption.646643 */647644static inline u32 bpf_prog_run_pin_on_cpu(const struct bpf_prog *prog,648645 const void *ctx)
···664664int mhi_pm_resume(struct mhi_controller *mhi_cntrl);665665666666/**667667+ * mhi_pm_resume_force - Force resume MHI from suspended state668668+ * @mhi_cntrl: MHI controller669669+ *670670+ * Resume the device irrespective of its MHI state. As per the MHI spec, devices671671+ * has to be in M3 state during resume. But some devices seem to be in a672672+ * different MHI state other than M3 but they continue working fine if allowed.673673+ * This API is intented to be used for such devices.674674+ *675675+ * Return: 0 if the resume succeeds, a negative error code otherwise676676+ */677677+int mhi_pm_resume_force(struct mhi_controller *mhi_cntrl);678678+679679+/**667680 * mhi_download_rddm_image - Download ramdump image from device for668681 * debugging purpose.669682 * @mhi_cntrl: MHI controller
···538538 * @mac_managed_pm: Set true if MAC driver takes of suspending/resuming PHY539539 * @state: State of the PHY for management purposes540540 * @dev_flags: Device-specific flags used by the PHY driver.541541- * Bits [15:0] are free to use by the PHY driver to communicate542542- * driver specific behavior.543543- * Bits [23:16] are currently reserved for future use.544544- * Bits [31:24] are reserved for defining generic545545- * PHY driver behavior.541541+ *542542+ * - Bits [15:0] are free to use by the PHY driver to communicate543543+ * driver specific behavior.544544+ * - Bits [23:16] are currently reserved for future use.545545+ * - Bits [31:24] are reserved for defining generic546546+ * PHY driver behavior.546547 * @irq: IRQ number of the PHY's interrupt (-1 if none)547548 * @phy_timer: The timer for handling the state machine548549 * @phylink: Pointer to phylink instance for this PHY
+1-1
include/linux/pm_runtime.h
···129129 * pm_runtime_active - Check whether or not a device is runtime-active.130130 * @dev: Target device.131131 *132132- * Return %true if runtime PM is enabled for @dev and its runtime PM status is132132+ * Return %true if runtime PM is disabled for @dev or its runtime PM status is133133 * %RPM_ACTIVE, or %false otherwise.134134 *135135 * Note that the return value of this function can only be trusted if it is
+8-6
include/linux/regulator/driver.h
···499499 * best to shut-down regulator(s) or reboot the SOC if error500500 * handling is repeatedly failing. If fatal_cnt is given the IRQ501501 * handling is aborted if it fails for fatal_cnt times and die()502502- * callback (if populated) or BUG() is called to try to prevent502502+ * callback (if populated) is called. If die() is not populated503503+ * poweroff for the system is attempted in order to prevent any503504 * further damage.504505 * @reread_ms: The time which is waited before attempting to re-read status505506 * at the worker if IC reading fails. Immediate re-read is done···517516 * @data: Driver private data pointer which will be passed as such to518517 * the renable, map_event and die callbacks in regulator_irq_data.519518 * @die: Protection callback. If IC status reading or recovery actions520520- * fail fatal_cnt times this callback or BUG() is called. This521521- * callback should implement a final protection attempt like522522- * disabling the regulator. If protection succeeded this may523523- * return 0. If anything else is returned the core assumes final524524- * protection failed and calls BUG() as a last resort.519519+ * fail fatal_cnt times this callback is called or system is520520+ * powered off. This callback should implement a final protection521521+ * attempt like disabling the regulator. If protection succeeded522522+ * die() may return 0. If anything else is returned the core523523+ * assumes final protection failed and attempts to perform a524524+ * poweroff as a last resort.525525 * @map_event: Driver callback to map IRQ status into regulator devices with526526 * events / errors. NOTE: callback MUST initialize both the527527 * errors and notifs for all rdevs which it signals having
+26
include/linux/wait.h
···217217void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);218218void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr);219219void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode);220220+void __wake_up_pollfree(struct wait_queue_head *wq_head);220221221222#define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL)222223#define wake_up_nr(x, nr) __wake_up(x, TASK_NORMAL, nr, NULL)···245244 __wake_up_sync_key((x), TASK_INTERRUPTIBLE, poll_to_key(m))246245#define wake_up_interruptible_sync_poll_locked(x, m) \247246 __wake_up_locked_sync_key((x), TASK_INTERRUPTIBLE, poll_to_key(m))247247+248248+/**249249+ * wake_up_pollfree - signal that a polled waitqueue is going away250250+ * @wq_head: the wait queue head251251+ *252252+ * In the very rare cases where a ->poll() implementation uses a waitqueue whose253253+ * lifetime is tied to a task rather than to the 'struct file' being polled,254254+ * this function must be called before the waitqueue is freed so that255255+ * non-blocking polls (e.g. epoll) are notified that the queue is going away.256256+ *257257+ * The caller must also RCU-delay the freeing of the wait_queue_head, e.g. via258258+ * an explicit synchronize_rcu() or call_rcu(), or via SLAB_TYPESAFE_BY_RCU.259259+ */260260+static inline void wake_up_pollfree(struct wait_queue_head *wq_head)261261+{262262+ /*263263+ * For performance reasons, we don't always take the queue lock here.264264+ * Therefore, we might race with someone removing the last entry from265265+ * the queue, and proceed while they still hold the queue lock.266266+ * However, rcu_read_lock() is required to be held in such cases, so we267267+ * can safely proceed with an RCU-delayed free.268268+ */269269+ if (waitqueue_active(wq_head))270270+ __wake_up_pollfree(wq_head);271271+}248272249273#define ___wait_cond_timeout(condition) \250274({ \
+1-1
include/net/bond_alb.h
···126126struct alb_bond_info {127127 struct tlb_client_info *tx_hashtbl; /* Dynamically allocated */128128 u32 unbalanced_load;129129- int tx_rebalance_counter;129129+ atomic_t tx_rebalance_counter;130130 int lp_counter;131131 /* -------- rlb parameters -------- */132132 int rlb_enabled;
+13
include/net/busy_poll.h
···136136 sk_rx_queue_update(sk, skb);137137}138138139139+/* Variant of sk_mark_napi_id() for passive flow setup,140140+ * as sk->sk_napi_id and sk->sk_rx_queue_mapping content141141+ * needs to be set.142142+ */143143+static inline void sk_mark_napi_id_set(struct sock *sk,144144+ const struct sk_buff *skb)145145+{146146+#ifdef CONFIG_NET_RX_BUSY_POLL147147+ WRITE_ONCE(sk->sk_napi_id, skb->napi_id);148148+#endif149149+ sk_rx_queue_set(sk, skb);150150+}151151+139152static inline void __sk_mark_napi_id_once(struct sock *sk, unsigned int napi_id)140153{141154#ifdef CONFIG_NET_RX_BUSY_POLL
···2929#define POLLRDHUP 0x20003030#endif31313232-#define POLLFREE (__force __poll_t)0x4000 /* currently only for epoll */3232+#define POLLFREE (__force __poll_t)0x400033333434#define POLL_BUSY_LOOP (__force __poll_t)0x80003535
+10-3
include/uapi/linux/resource.h
···6666#define _STK_LIM (8*1024*1024)67676868/*6969- * GPG2 wants 64kB of mlocked memory, to make sure pass phrases7070- * and other sensitive information are never written to disk.6969+ * Limit the amount of locked memory by some sane default:7070+ * root can always increase this limit if needed.7171+ *7272+ * The main use-cases are (1) preventing sensitive memory7373+ * from being swapped; (2) real-time operations; (3) via7474+ * IOURING_REGISTER_BUFFERS.7575+ *7676+ * The first two don't need much. The latter will take as7777+ * much as it can get. 8MB is a reasonably sane default.7178 */7272-#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)7979+#define MLOCK_LIMIT (8*1024*1024)73807481/*7582 * Due to binary compatibility, the actual resource numbers
+2-9
kernel/bpf/btf.c
···6346634663476347/* BTF ID set registration API for modules */6348634863496349-struct kfunc_btf_id_list {63506350- struct list_head list;63516351- struct mutex mutex;63526352-};63536353-63546349#ifdef CONFIG_DEBUG_INFO_BTF_MODULES6355635063566351void register_kfunc_btf_id_set(struct kfunc_btf_id_list *l,···63716376{63726377 struct kfunc_btf_id_set *s;6373637863746374- if (!owner)63756375- return false;63766379 mutex_lock(&klist->mutex);63776380 list_for_each_entry(s, &klist->list, list) {63786381 if (s->owner == owner && btf_id_set_contains(s->set, kfunc_id)) {···63826389 return false;63836390}6384639163856385-#endif63866386-63876392#define DEFINE_KFUNC_BTF_ID_LIST(name) \63886393 struct kfunc_btf_id_list name = { LIST_HEAD_INIT(name.list), \63896394 __MUTEX_INITIALIZER(name.mutex) }; \···6389639863906399DEFINE_KFUNC_BTF_ID_LIST(bpf_tcp_ca_kfunc_list);63916400DEFINE_KFUNC_BTF_ID_LIST(prog_test_kfunc_list);64016401+64026402+#endif
···238238}239239EXPORT_SYMBOL_GPL(__wake_up_sync); /* For internal use only */240240241241+void __wake_up_pollfree(struct wait_queue_head *wq_head)242242+{243243+ __wake_up(wq_head, TASK_NORMAL, 0, poll_to_key(EPOLLHUP | POLLFREE));244244+ /* POLLFREE must have cleared the queue. */245245+ WARN_ON_ONCE(waitqueue_active(wq_head));246246+}247247+241248/*242249 * Note: we use "set_current_state()" _after_ the wait-queue add,243250 * because we need a memory barrier there on SMP, so that any
+9-7
kernel/time/timer.c
···20542054EXPORT_SYMBOL(msleep_interruptible);2055205520562056/**20572057- * usleep_range - Sleep for an approximate time20582058- * @min: Minimum time in usecs to sleep20592059- * @max: Maximum time in usecs to sleep20572057+ * usleep_range_state - Sleep for an approximate time in a given state20582058+ * @min: Minimum time in usecs to sleep20592059+ * @max: Maximum time in usecs to sleep20602060+ * @state: State of the current task that will be while sleeping20602061 *20612062 * In non-atomic context where the exact wakeup time is flexible, use20622062- * usleep_range() instead of udelay(). The sleep improves responsiveness20632063+ * usleep_range_state() instead of udelay(). The sleep improves responsiveness20632064 * by avoiding the CPU-hogging busy-wait of udelay(), and the range reduces20642065 * power usage by allowing hrtimers to take advantage of an already-20652066 * scheduled interrupt instead of scheduling a new one just for this sleep.20662067 */20672067-void __sched usleep_range(unsigned long min, unsigned long max)20682068+void __sched usleep_range_state(unsigned long min, unsigned long max,20692069+ unsigned int state)20682070{20692071 ktime_t exp = ktime_add_us(ktime_get(), min);20702072 u64 delta = (u64)(max - min) * NSEC_PER_USEC;2071207320722074 for (;;) {20732073- __set_current_state(TASK_UNINTERRUPTIBLE);20752075+ __set_current_state(state);20742076 /* Do not return before the requested sleep time has elapsed */20752077 if (!schedule_hrtimeout_range(&exp, delta, HRTIMER_MODE_ABS))20762078 break;20772079 }20782080}20792079-EXPORT_SYMBOL(usleep_range);20812081+EXPORT_SYMBOL(usleep_range_state);
+7-1
kernel/trace/ftrace.c
···52175217{52185218 struct ftrace_direct_func *direct;52195219 struct ftrace_func_entry *entry;52205220+ struct ftrace_hash *hash;52205221 int ret = -ENODEV;5221522252225223 mutex_lock(&direct_mutex);···52265225 if (!entry)52275226 goto out_unlock;5228522752295229- if (direct_functions->count == 1)52285228+ hash = direct_ops.func_hash->filter_hash;52295229+ if (hash->count == 1)52305230 unregister_ftrace_function(&direct_ops);5231523152325232 ret = ftrace_set_filter_ip(&direct_ops, ip, 1, 0);···55425540 err = unregister_ftrace_function(ops);55435541 remove_direct_functions_hash(hash, addr);55445542 mutex_unlock(&direct_mutex);55435543+55445544+ /* cleanup for possible another register call */55455545+ ops->func = NULL;55465546+ ops->trampoline = 0;55455547 return err;55465548}55475549EXPORT_SYMBOL_GPL(unregister_ftrace_direct_multi);
···316316 bool "Generate BTF typeinfo"317317 depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED318318 depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST319319+ depends on BPF_SYSCALL319320 help320321 Generate deduplicated BTF type information from DWARF debug info.321322 Turning this on expects presence of pahole tool, which will convert
+1-1
mm/Kconfig
···428428# UP and nommu archs use km based percpu allocator429429#430430config NEED_PER_CPU_KM431431- depends on !SMP431431+ depends on !SMP || !MMU432432 bool433433 default y434434
+7
mm/backing-dev.c
···945945 wb_shutdown(&bdi->wb);946946 cgwb_bdi_unregister(bdi);947947948948+ /*949949+ * If this BDI's min ratio has been set, use bdi_set_min_ratio() to950950+ * update the global bdi_min_ratio.951951+ */952952+ if (bdi->min_ratio)953953+ bdi_set_min_ratio(bdi, 0);954954+948955 if (bdi->dev) {949956 bdi_debug_unregister(bdi);950957 device_unregister(bdi->dev);
+7-13
mm/damon/core.c
···282282 for (i = 0; i < nr_ids; i++) {283283 t = damon_new_target(ids[i]);284284 if (!t) {285285- pr_err("Failed to alloc damon_target\n");286285 /* The caller should do cleanup of the ids itself */287286 damon_for_each_target_safe(t, next, ctx)288287 damon_destroy_target(t);···311312 unsigned long aggr_int, unsigned long primitive_upd_int,312313 unsigned long min_nr_reg, unsigned long max_nr_reg)313314{314314- if (min_nr_reg < 3) {315315- pr_err("min_nr_regions (%lu) must be at least 3\n",316316- min_nr_reg);315315+ if (min_nr_reg < 3)317316 return -EINVAL;318318- }319319- if (min_nr_reg > max_nr_reg) {320320- pr_err("invalid nr_regions. min (%lu) > max (%lu)\n",321321- min_nr_reg, max_nr_reg);317317+ if (min_nr_reg > max_nr_reg)322318 return -EINVAL;323323- }324319325320 ctx->sample_interval = sample_int;326321 ctx->aggr_interval = aggr_int;···973980974981static void kdamond_usleep(unsigned long usecs)975982{976976- if (usecs > 100 * 1000)977977- schedule_timeout_interruptible(usecs_to_jiffies(usecs));983983+ /* See Documentation/timers/timers-howto.rst for the thresholds */984984+ if (usecs > 20 * USEC_PER_MSEC)985985+ schedule_timeout_idle(usecs_to_jiffies(usecs));978986 else979979- usleep_range(usecs, usecs + 1);987987+ usleep_idle_range(usecs, usecs + 1);980988}981989982990/* Returns negative error code if it's not activated but should return */···10321038 ctx->callback.after_sampling(ctx))10331039 done = true;1034104010351035- usleep_range(ctx->sample_interval, ctx->sample_interval + 1);10411041+ kdamond_usleep(ctx->sample_interval);1036104210371043 if (ctx->primitive.check_accesses)10381044 max_nr_accesses = ctx->primitive.check_accesses(ctx);
+1-3
mm/damon/dbgfs.c
···210210 &wmarks.low, &parsed);211211 if (ret != 18)212212 break;213213- if (!damos_action_valid(action)) {214214- pr_err("wrong action %d\n", action);213213+ if (!damos_action_valid(action))215214 goto fail;216216- }217215218216 pos += parsed;219217 scheme = damon_new_scheme(min_sz, max_sz, min_nr_a, max_nr_a,
···32533253 goto skip;32543254 if (!PageUptodate(page) || PageReadahead(page))32553255 goto skip;32563256- if (PageHWPoison(page))32573257- goto skip;32583256 if (!trylock_page(page))32593257 goto skip;32603258 if (page->mapping != mapping)
+1-1
mm/hugetlb.c
···29732973 struct huge_bootmem_page *m = NULL; /* initialize for clang */29742974 int nr_nodes, node;2975297529762976- if (nid >= nr_online_nodes)29762976+ if (nid != NUMA_NO_NODE && nid >= nr_online_nodes)29772977 return 0;29782978 /* do node specific alloc */29792979 if (nid != NUMA_NO_NODE) {
+53-53
mm/memcontrol.c
···776776 rcu_read_unlock();777777}778778779779-/*780780- * mod_objcg_mlstate() may be called with irq enabled, so781781- * mod_memcg_lruvec_state() should be used.782782- */783783-static inline void mod_objcg_mlstate(struct obj_cgroup *objcg,784784- struct pglist_data *pgdat,785785- enum node_stat_item idx, int nr)786786-{787787- struct mem_cgroup *memcg;788788- struct lruvec *lruvec;789789-790790- rcu_read_lock();791791- memcg = obj_cgroup_memcg(objcg);792792- lruvec = mem_cgroup_lruvec(memcg, pgdat);793793- mod_memcg_lruvec_state(lruvec, idx, nr);794794- rcu_read_unlock();795795-}796796-797779/**798780 * __count_memcg_events - account VM events in a cgroup799781 * @memcg: the memory cgroup···21192137}21202138#endif2121213921222122-/*21232123- * Most kmem_cache_alloc() calls are from user context. The irq disable/enable21242124- * sequence used in this case to access content from object stock is slow.21252125- * To optimize for user context access, there are now two object stocks for21262126- * task context and interrupt context access respectively.21272127- *21282128- * The task context object stock can be accessed by disabling preemption only21292129- * which is cheap in non-preempt kernel. The interrupt context object stock21302130- * can only be accessed after disabling interrupt. User context code can21312131- * access interrupt object stock, but not vice versa.21322132- */21332133-static inline struct obj_stock *get_obj_stock(unsigned long *pflags)21342134-{21352135- struct memcg_stock_pcp *stock;21362136-21372137- if (likely(in_task())) {21382138- *pflags = 0UL;21392139- preempt_disable();21402140- stock = this_cpu_ptr(&memcg_stock);21412141- return &stock->task_obj;21422142- }21432143-21442144- local_irq_save(*pflags);21452145- stock = this_cpu_ptr(&memcg_stock);21462146- return &stock->irq_obj;21472147-}21482148-21492149-static inline void put_obj_stock(unsigned long flags)21502150-{21512151- if (likely(in_task()))21522152- preempt_enable();21532153- else21542154- local_irq_restore(flags);21552155-}21562156-21572140/**21582141 * consume_stock: Try to consume stocked charge on this cpu.21592142 * @memcg: memcg to consume from.···27622815 * reclaimable. So those GFP bits should be masked off.27632816 */27642817#define OBJCGS_CLEAR_MASK (__GFP_DMA | __GFP_RECLAIMABLE | __GFP_ACCOUNT)28182818+28192819+/*28202820+ * Most kmem_cache_alloc() calls are from user context. The irq disable/enable28212821+ * sequence used in this case to access content from object stock is slow.28222822+ * To optimize for user context access, there are now two object stocks for28232823+ * task context and interrupt context access respectively.28242824+ *28252825+ * The task context object stock can be accessed by disabling preemption only28262826+ * which is cheap in non-preempt kernel. The interrupt context object stock28272827+ * can only be accessed after disabling interrupt. User context code can28282828+ * access interrupt object stock, but not vice versa.28292829+ */28302830+static inline struct obj_stock *get_obj_stock(unsigned long *pflags)28312831+{28322832+ struct memcg_stock_pcp *stock;28332833+28342834+ if (likely(in_task())) {28352835+ *pflags = 0UL;28362836+ preempt_disable();28372837+ stock = this_cpu_ptr(&memcg_stock);28382838+ return &stock->task_obj;28392839+ }28402840+28412841+ local_irq_save(*pflags);28422842+ stock = this_cpu_ptr(&memcg_stock);28432843+ return &stock->irq_obj;28442844+}28452845+28462846+static inline void put_obj_stock(unsigned long flags)28472847+{28482848+ if (likely(in_task()))28492849+ preempt_enable();28502850+ else28512851+ local_irq_restore(flags);28522852+}28532853+28542854+/*28552855+ * mod_objcg_mlstate() may be called with irq enabled, so28562856+ * mod_memcg_lruvec_state() should be used.28572857+ */28582858+static inline void mod_objcg_mlstate(struct obj_cgroup *objcg,28592859+ struct pglist_data *pgdat,28602860+ enum node_stat_item idx, int nr)28612861+{28622862+ struct mem_cgroup *memcg;28632863+ struct lruvec *lruvec;28642864+28652865+ rcu_read_lock();28662866+ memcg = obj_cgroup_memcg(objcg);28672867+ lruvec = mem_cgroup_lruvec(memcg, pgdat);28682868+ mod_memcg_lruvec_state(lruvec, idx, nr);28692869+ rcu_read_unlock();28702870+}2765287127662872int memcg_alloc_page_obj_cgroups(struct page *page, struct kmem_cache *s,27672873 gfp_t gfp, bool new_page)
···167167 write_lock_bh(&sk->sk_callback_lock);168168 if (strp_stop)169169 sk_psock_stop_strp(sk, psock);170170- else170170+ if (verdict_stop)171171 sk_psock_stop_verdict(sk, psock);172172+173173+ if (psock->psock_update_sk_prot)174174+ psock->psock_update_sk_prot(sk, psock, false);172175 write_unlock_bh(&sk->sk_callback_lock);173176 }174177}···285282286283 if (msg_parser)287284 psock_set_prog(&psock->progs.msg_parser, msg_parser);285285+ if (stream_parser)286286+ psock_set_prog(&psock->progs.stream_parser, stream_parser);287287+ if (stream_verdict)288288+ psock_set_prog(&psock->progs.stream_verdict, stream_verdict);289289+ if (skb_verdict)290290+ psock_set_prog(&psock->progs.skb_verdict, skb_verdict);288291289292 ret = sock_map_init_proto(sk, psock);290293 if (ret < 0)···301292 ret = sk_psock_init_strp(sk, psock);302293 if (ret)303294 goto out_unlock_drop;304304- psock_set_prog(&psock->progs.stream_verdict, stream_verdict);305305- psock_set_prog(&psock->progs.stream_parser, stream_parser);306295 sk_psock_start_strp(sk, psock);307296 } else if (!stream_parser && stream_verdict && !psock->saved_data_ready) {308308- psock_set_prog(&psock->progs.stream_verdict, stream_verdict);309297 sk_psock_start_verdict(sk,psock);310298 } else if (!stream_verdict && skb_verdict && !psock->saved_data_ready) {311311- psock_set_prog(&psock->progs.skb_verdict, skb_verdict);312299 sk_psock_start_verdict(sk, psock);313300 }314301 write_unlock_bh(&sk->sk_callback_lock);
+2-1
net/ethtool/netlink.c
···4040 if (dev->dev.parent)4141 pm_runtime_get_sync(dev->dev.parent);42424343- if (!netif_device_present(dev)) {4343+ if (!netif_device_present(dev) ||4444+ dev->reg_state == NETREG_UNREGISTERING) {4445 ret = -ENODEV;4546 goto err;4647 }
···829829 int ret = 0;830830 int state = child->sk_state;831831832832- /* record NAPI ID of child */833833- sk_mark_napi_id(child, skb);832832+ /* record sk_napi_id and sk_rx_queue_mapping of child. */833833+ sk_mark_napi_id_set(child, skb);834834835835 tcp_segs_in(tcp_sk(child), skb);836836 if (!sock_owned_by_user(child)) {
···161161 hdr->hop_limit = ip6_dst_hoplimit(skb_dst(skb));162162163163 memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));164164+165165+ /* the control block has been erased, so we have to set the166166+ * iif once again.167167+ * We read the receiving interface index directly from the168168+ * skb->skb_iif as it is done in the IPv4 receiving path (i.e.:169169+ * ip_rcv_core(...)).170170+ */171171+ IP6CB(skb)->iif = skb->skb_iif;164172 }165173166174 hdr->nexthdr = NEXTHDR_ROUTING;
+3-3
net/netfilter/nf_conntrack_core.c
···684684685685 tstamp = nf_conn_tstamp_find(ct);686686 if (tstamp) {687687- s32 timeout = ct->timeout - nfct_time_stamp;687687+ s32 timeout = READ_ONCE(ct->timeout) - nfct_time_stamp;688688689689 tstamp->stop = ktime_get_real_ns();690690 if (timeout < 0)···10361036 }1037103710381038 /* We want the clashing entry to go away real soon: 1 second timeout. */10391039- loser_ct->timeout = nfct_time_stamp + HZ;10391039+ WRITE_ONCE(loser_ct->timeout, nfct_time_stamp + HZ);1040104010411041 /* IPS_NAT_CLASH removes the entry automatically on the first10421042 * reply. Also prevents UDP tracker from moving the entry to···15601560 /* save hash for reusing when confirming */15611561 *(unsigned long *)(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev) = hash;15621562 ct->status = 0;15631563- ct->timeout = 0;15631563+ WRITE_ONCE(ct->timeout, 0);15641564 write_pnet(&ct->ct_net, net);15651565 memset(&ct->__nfct_init_offset, 0,15661566 offsetof(struct nf_conn, proto) -
···11+// SPDX-License-Identifier: GPL-2.0-only22+#include <linux/module.h>33+#include <linux/kthread.h>44+#include <linux/ftrace.h>55+#include <asm/asm-offsets.h>66+77+void my_direct_func1(unsigned long ip)88+{99+ trace_printk("my direct func1 ip %lx\n", ip);1010+}1111+1212+void my_direct_func2(unsigned long ip)1313+{1414+ trace_printk("my direct func2 ip %lx\n", ip);1515+}1616+1717+extern void my_tramp1(void *);1818+extern void my_tramp2(void *);1919+2020+#ifdef CONFIG_X86_642121+2222+asm (2323+" .pushsection .text, \"ax\", @progbits\n"2424+" .type my_tramp1, @function\n"2525+" .globl my_tramp1\n"2626+" my_tramp1:"2727+" pushq %rbp\n"2828+" movq %rsp, %rbp\n"2929+" pushq %rdi\n"3030+" movq 8(%rbp), %rdi\n"3131+" call my_direct_func1\n"3232+" popq %rdi\n"3333+" leave\n"3434+" ret\n"3535+" .size my_tramp1, .-my_tramp1\n"3636+" .type my_tramp2, @function\n"3737+"\n"3838+" .globl my_tramp2\n"3939+" my_tramp2:"4040+" pushq %rbp\n"4141+" movq %rsp, %rbp\n"4242+" pushq %rdi\n"4343+" movq 8(%rbp), %rdi\n"4444+" call my_direct_func2\n"4545+" popq %rdi\n"4646+" leave\n"4747+" ret\n"4848+" .size my_tramp2, .-my_tramp2\n"4949+" .popsection\n"5050+);5151+5252+#endif /* CONFIG_X86_64 */5353+5454+#ifdef CONFIG_S3905555+5656+asm (5757+" .pushsection .text, \"ax\", @progbits\n"5858+" .type my_tramp1, @function\n"5959+" .globl my_tramp1\n"6060+" my_tramp1:"6161+" lgr %r1,%r15\n"6262+" stmg %r0,%r5,"__stringify(__SF_GPRS)"(%r15)\n"6363+" stg %r14,"__stringify(__SF_GPRS+8*8)"(%r15)\n"6464+" aghi %r15,"__stringify(-STACK_FRAME_OVERHEAD)"\n"6565+" stg %r1,"__stringify(__SF_BACKCHAIN)"(%r15)\n"6666+" lgr %r2,%r0\n"6767+" brasl %r14,my_direct_func1\n"6868+" aghi %r15,"__stringify(STACK_FRAME_OVERHEAD)"\n"6969+" lmg %r0,%r5,"__stringify(__SF_GPRS)"(%r15)\n"7070+" lg %r14,"__stringify(__SF_GPRS+8*8)"(%r15)\n"7171+" lgr %r1,%r0\n"7272+" br %r1\n"7373+" .size my_tramp1, .-my_tramp1\n"7474+"\n"7575+" .type my_tramp2, @function\n"7676+" .globl my_tramp2\n"7777+" my_tramp2:"7878+" lgr %r1,%r15\n"7979+" stmg %r0,%r5,"__stringify(__SF_GPRS)"(%r15)\n"8080+" stg %r14,"__stringify(__SF_GPRS+8*8)"(%r15)\n"8181+" aghi %r15,"__stringify(-STACK_FRAME_OVERHEAD)"\n"8282+" stg %r1,"__stringify(__SF_BACKCHAIN)"(%r15)\n"8383+" lgr %r2,%r0\n"8484+" brasl %r14,my_direct_func2\n"8585+" aghi %r15,"__stringify(STACK_FRAME_OVERHEAD)"\n"8686+" lmg %r0,%r5,"__stringify(__SF_GPRS)"(%r15)\n"8787+" lg %r14,"__stringify(__SF_GPRS+8*8)"(%r15)\n"8888+" lgr %r1,%r0\n"8989+" br %r1\n"9090+" .size my_tramp2, .-my_tramp2\n"9191+" .popsection\n"9292+);9393+9494+#endif /* CONFIG_S390 */9595+9696+static unsigned long my_tramp = (unsigned long)my_tramp1;9797+static unsigned long tramps[2] = {9898+ (unsigned long)my_tramp1,9999+ (unsigned long)my_tramp2,100100+};101101+102102+static struct ftrace_ops direct;103103+104104+static int simple_thread(void *arg)105105+{106106+ static int t;107107+ int ret = 0;108108+109109+ while (!kthread_should_stop()) {110110+ set_current_state(TASK_INTERRUPTIBLE);111111+ schedule_timeout(2 * HZ);112112+113113+ if (ret)114114+ continue;115115+ t ^= 1;116116+ ret = modify_ftrace_direct_multi(&direct, tramps[t]);117117+ if (!ret)118118+ my_tramp = tramps[t];119119+ WARN_ON_ONCE(ret);120120+ }121121+122122+ return 0;123123+}124124+125125+static struct task_struct *simple_tsk;126126+127127+static int __init ftrace_direct_multi_init(void)128128+{129129+ int ret;130130+131131+ ftrace_set_filter_ip(&direct, (unsigned long) wake_up_process, 0, 0);132132+ ftrace_set_filter_ip(&direct, (unsigned long) schedule, 0, 0);133133+134134+ ret = register_ftrace_direct_multi(&direct, my_tramp);135135+136136+ if (!ret)137137+ simple_tsk = kthread_run(simple_thread, NULL, "event-sample-fn");138138+ return ret;139139+}140140+141141+static void __exit ftrace_direct_multi_exit(void)142142+{143143+ kthread_stop(simple_tsk);144144+ unregister_ftrace_direct_multi(&direct, my_tramp);145145+}146146+147147+module_init(ftrace_direct_multi_init);148148+module_exit(ftrace_direct_multi_exit);149149+150150+MODULE_AUTHOR("Jiri Olsa");151151+MODULE_DESCRIPTION("Example use case of using modify_ftrace_direct_multi()");152152+MODULE_LICENSE("GPL");
+3
sound/core/control_compat.c
···264264 struct snd_ctl_elem_value *data,265265 int type, int count)266266{267267+ struct snd_ctl_elem_value32 __user *data32 = userdata;267268 int i, size;268269269270 if (type == SNDRV_CTL_ELEM_TYPE_BOOLEAN ||···281280 if (copy_to_user(valuep, data->value.bytes.data, size))282281 return -EFAULT;283282 }283283+ if (copy_to_user(&data32->id, &data->id, sizeof(data32->id)))284284+ return -EFAULT;284285 return 0;285286}286287
+25-12
sound/core/oss/pcm_oss.c
···147147 *148148 * Return the maximum value for field PAR.149149 */150150-static unsigned int150150+static int151151snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params,152152 snd_pcm_hw_param_t var, int *dir)153153{···682682 struct snd_pcm_hw_params *oss_params,683683 struct snd_pcm_hw_params *slave_params)684684{685685- size_t s;686686- size_t oss_buffer_size, oss_period_size, oss_periods;687687- size_t min_period_size, max_period_size;685685+ ssize_t s;686686+ ssize_t oss_buffer_size;687687+ ssize_t oss_period_size, oss_periods;688688+ ssize_t min_period_size, max_period_size;688689 struct snd_pcm_runtime *runtime = substream->runtime;689690 size_t oss_frame_size;690691691692 oss_frame_size = snd_pcm_format_physical_width(params_format(oss_params)) *692693 params_channels(oss_params) / 8;693694695695+ oss_buffer_size = snd_pcm_hw_param_value_max(slave_params,696696+ SNDRV_PCM_HW_PARAM_BUFFER_SIZE,697697+ NULL);698698+ if (oss_buffer_size <= 0)699699+ return -EINVAL;694700 oss_buffer_size = snd_pcm_plug_client_size(substream,695695- snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL)) * oss_frame_size;696696- if (!oss_buffer_size)701701+ oss_buffer_size * oss_frame_size);702702+ if (oss_buffer_size <= 0)697703 return -EINVAL;698704 oss_buffer_size = rounddown_pow_of_two(oss_buffer_size);699705 if (atomic_read(&substream->mmap_count)) {···736730737731 min_period_size = snd_pcm_plug_client_size(substream,738732 snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL));739739- if (min_period_size) {733733+ if (min_period_size > 0) {740734 min_period_size *= oss_frame_size;741735 min_period_size = roundup_pow_of_two(min_period_size);742736 if (oss_period_size < min_period_size)···745739746740 max_period_size = snd_pcm_plug_client_size(substream,747741 snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL));748748- if (max_period_size) {742742+ if (max_period_size > 0) {749743 max_period_size *= oss_frame_size;750744 max_period_size = rounddown_pow_of_two(max_period_size);751745 if (oss_period_size > max_period_size)···758752 oss_periods = substream->oss.setup.periods;759753760754 s = snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIODS, NULL);761761- if (runtime->oss.maxfrags && s > runtime->oss.maxfrags)755755+ if (s > 0 && runtime->oss.maxfrags && s > runtime->oss.maxfrags)762756 s = runtime->oss.maxfrags;763757 if (oss_periods > s)764758 oss_periods = s;···884878 err = -EINVAL;885879 goto failure;886880 }887887- choose_rate(substream, sparams, runtime->oss.rate);888888- snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL);881881+882882+ err = choose_rate(substream, sparams, runtime->oss.rate);883883+ if (err < 0)884884+ goto failure;885885+ err = snd_pcm_hw_param_near(substream, sparams,886886+ SNDRV_PCM_HW_PARAM_CHANNELS,887887+ runtime->oss.channels, NULL);888888+ if (err < 0)889889+ goto failure;889890890891 format = snd_pcm_oss_format_from(runtime->oss.format);891892···19691956 if (runtime->oss.subdivision || runtime->oss.fragshift)19701957 return -EINVAL;19711958 fragshift = val & 0xffff;19721972- if (fragshift >= 31)19591959+ if (fragshift >= 25) /* should be large enough */19731960 return -EINVAL;19741961 runtime->oss.fragshift = fragshift;19751962 runtime->oss.maxfrags = (val >> 16) & 0xffff;
+62-18
sound/pci/hda/patch_realtek.c
···65036503/* for alc285_fixup_ideapad_s740_coef() */65046504#include "ideapad_s740_helper.c"6505650565066506-static void alc256_fixup_tongfang_reset_persistent_settings(struct hda_codec *codec,65076507- const struct hda_fixup *fix,65086508- int action)65066506+static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {65076507+ WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),65086508+ WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),65096509+ WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),65106510+ {}65116511+};65126512+65136513+static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,65146514+ const struct hda_fixup *fix,65156515+ int action)65096516{65106517 /*65116511- * A certain other OS sets these coeffs to different values. On at least one TongFang65126512- * barebone these settings might survive even a cold reboot. So to restore a clean slate the65136513- * values are explicitly reset to default here. Without this, the external microphone is65146514- * always in a plugged-in state, while the internal microphone is always in an unplugged65156515- * state, breaking the ability to use the internal microphone.65166516- */65176517- alc_write_coef_idx(codec, 0x24, 0x0000);65186518- alc_write_coef_idx(codec, 0x26, 0x0000);65196519- alc_write_coef_idx(codec, 0x29, 0x3000);65206520- alc_write_coef_idx(codec, 0x37, 0xfe05);65216521- alc_write_coef_idx(codec, 0x45, 0x5089);65186518+ * A certain other OS sets these coeffs to different values. On at least65196519+ * one TongFang barebone these settings might survive even a cold65206520+ * reboot. So to restore a clean slate the values are explicitly reset65216521+ * to default here. Without this, the external microphone is always in a65226522+ * plugged-in state, while the internal microphone is always in an65236523+ * unplugged state, breaking the ability to use the internal microphone.65246524+ */65256525+ alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);65226526}6523652765246528static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {···67636759 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,67646760 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,67656761 ALC287_FIXUP_13S_GEN2_SPEAKERS,67666766- ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS,67626762+ ALC256_FIXUP_SET_COEF_DEFAULTS,67676763 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,67686764 ALC233_FIXUP_NO_AUDIO_JACK,67696765};···84698465 .chained = true,84708466 .chain_id = ALC269_FIXUP_HEADSET_MODE,84718467 },84728472- [ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS] = {84688468+ [ALC256_FIXUP_SET_COEF_DEFAULTS] = {84738469 .type = HDA_FIXUP_FUNC,84748474- .v.func = alc256_fixup_tongfang_reset_persistent_settings,84708470+ .v.func = alc256_fixup_set_coef_defaults,84758471 },84768472 [ALC245_FIXUP_HP_GPIO_LED] = {84778473 .type = HDA_FIXUP_FUNC,···89338929 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */89348930 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),89358931 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),89368936- SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS),89328932+ SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),89378933 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),89388934 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),89398935 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),···1023510231 }1023610232}10237102331023410234+static void alc897_hp_automute_hook(struct hda_codec *codec,1023510235+ struct hda_jack_callback *jack)1023610236+{1023710237+ struct alc_spec *spec = codec->spec;1023810238+ int vref;1023910239+1024010240+ snd_hda_gen_hp_automute(codec, jack);1024110241+ vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;1024210242+ snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,1024310243+ vref);1024410244+}1024510245+1024610246+static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,1024710247+ const struct hda_fixup *fix, int action)1024810248+{1024910249+ struct alc_spec *spec = codec->spec;1025010250+ if (action == HDA_FIXUP_ACT_PRE_PROBE) {1025110251+ spec->gen.hp_automute_hook = alc897_hp_automute_hook;1025210252+ }1025310253+}1025410254+1023810255static const struct coef_fw alc668_coefs[] = {1023910256 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),1024010257 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),···1033610311 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,1033710312 ALC668_FIXUP_HEADSET_MIC,1033810313 ALC668_FIXUP_MIC_DET_COEF,1031410314+ ALC897_FIXUP_LENOVO_HEADSET_MIC,1031510315+ ALC897_FIXUP_HEADSET_MIC_PIN,1033910316};10340103171034110318static const struct hda_fixup alc662_fixups[] = {···1074410717 {}1074510718 },1074610719 },1072010720+ [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {1072110721+ .type = HDA_FIXUP_FUNC,1072210722+ .v.func = alc897_fixup_lenovo_headset_mic,1072310723+ },1072410724+ [ALC897_FIXUP_HEADSET_MIC_PIN] = {1072510725+ .type = HDA_FIXUP_PINS,1072610726+ .v.pins = (const struct hda_pintbl[]) {1072710727+ { 0x1a, 0x03a11050 },1072810728+ { }1072910729+ },1073010730+ .chained = true,1073110731+ .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC1073210732+ },1074710733};10748107341074910735static const struct snd_pci_quirk alc662_fixup_tbl[] = {···1080110761 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),1080210762 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),1080310763 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),1076410764+ SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),1076510765+ SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),1076610766+ SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),1076710767+ SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),1080410768 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),1080510769 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),1080610770 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
+2-1
sound/soc/amd/yc/pci-acp6x.c
···146146{147147 struct acp6x_dev_data *adata;148148 struct platform_device_info pdevinfo[ACP6x_DEVS];149149- int ret, index;149149+ int index = 0;150150 int val = 0x00;151151 u32 addr;152152 unsigned int irqflags;153153+ int ret;153154154155 irqflags = IRQF_SHARED;155156 /* Yellow Carp device check */
+6-4
sound/soc/codecs/rt5682.c
···2858285828592859 for (i = 0; i < RT5682_DAI_NUM_CLKS; ++i) {28602860 struct clk_init_data init = { };28612861+ struct clk_parent_data parent_data;28622862+ const struct clk_hw *parent;2861286328622864 dai_clk_hw = &rt5682->dai_clks_hw[i];28632865···28672865 case RT5682_DAI_WCLK_IDX:28682866 /* Make MCLK the parent of WCLK */28692867 if (rt5682->mclk) {28702870- init.parent_data = &(struct clk_parent_data){28682868+ parent_data = (struct clk_parent_data){28712869 .fw_name = "mclk",28722870 };28712871+ init.parent_data = &parent_data;28732872 init.num_parents = 1;28742873 }28752874 break;28762875 case RT5682_DAI_BCLK_IDX:28772876 /* Make WCLK the parent of BCLK */28782878- init.parent_hws = &(const struct clk_hw *){28792879- &rt5682->dai_clks_hw[RT5682_DAI_WCLK_IDX]28802880- };28772877+ parent = &rt5682->dai_clks_hw[RT5682_DAI_WCLK_IDX];28782878+ init.parent_hws = &parent;28812879 init.num_parents = 1;28822880 break;28832881 default:
+6-4
sound/soc/codecs/rt5682s.c
···2693269326942694 for (i = 0; i < RT5682S_DAI_NUM_CLKS; ++i) {26952695 struct clk_init_data init = { };26962696+ struct clk_parent_data parent_data;26972697+ const struct clk_hw *parent;2696269826972699 dai_clk_hw = &rt5682s->dai_clks_hw[i];26982700···27022700 case RT5682S_DAI_WCLK_IDX:27032701 /* Make MCLK the parent of WCLK */27042702 if (rt5682s->mclk) {27052705- init.parent_data = &(struct clk_parent_data){27032703+ parent_data = (struct clk_parent_data){27062704 .fw_name = "mclk",27072705 };27062706+ init.parent_data = &parent_data;27082707 init.num_parents = 1;27092708 }27102709 break;27112710 case RT5682S_DAI_BCLK_IDX:27122711 /* Make WCLK the parent of BCLK */27132713- init.parent_hws = &(const struct clk_hw *){27142714- &rt5682s->dai_clks_hw[RT5682S_DAI_WCLK_IDX]27152715- };27122712+ parent = &rt5682s->dai_clks_hw[RT5682S_DAI_WCLK_IDX];27132713+ init.parent_hws = &parent;27162714 init.num_parents = 1;27172715 break;27182716 default:
+93-33
sound/soc/codecs/wcd934x.c
···32563256 int value = ucontrol->value.integer.value[0];32573257 int sel;3258325832593259+ if (wcd->comp_enabled[comp] == value)32603260+ return 0;32613261+32593262 wcd->comp_enabled[comp] = value;32603263 sel = value ? WCD934X_HPH_GAIN_SRC_SEL_COMPANDER :32613264 WCD934X_HPH_GAIN_SRC_SEL_REGISTER;···32823279 case COMPANDER_8:32833280 break;32843281 default:32853285- break;32823282+ return 0;32863283 }3287328432883288- return 0;32853285+ return 1;32893286}3290328732913288static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc,···33293326 return 0;33303327}3331332833293329+static int slim_rx_mux_to_dai_id(int mux)33303330+{33313331+ int aif_id;33323332+33333333+ switch (mux) {33343334+ case 1:33353335+ aif_id = AIF1_PB;33363336+ break;33373337+ case 2:33383338+ aif_id = AIF2_PB;33393339+ break;33403340+ case 3:33413341+ aif_id = AIF3_PB;33423342+ break;33433343+ case 4:33443344+ aif_id = AIF4_PB;33453345+ break;33463346+ default:33473347+ aif_id = -1;33483348+ break;33493349+ }33503350+33513351+ return aif_id;33523352+}33533353+33323354static int slim_rx_mux_put(struct snd_kcontrol *kc,33333355 struct snd_ctl_elem_value *ucontrol)33343356{···33613333 struct wcd934x_codec *wcd = dev_get_drvdata(w->dapm->dev);33623334 struct soc_enum *e = (struct soc_enum *)kc->private_value;33633335 struct snd_soc_dapm_update *update = NULL;33363336+ struct wcd934x_slim_ch *ch, *c;33643337 u32 port_id = w->shift;33383338+ bool found = false;33393339+ int mux_idx;33403340+ int prev_mux_idx = wcd->rx_port_value[port_id];33413341+ int aif_id;3365334233663366- if (wcd->rx_port_value[port_id] == ucontrol->value.enumerated.item[0])33433343+ mux_idx = ucontrol->value.enumerated.item[0];33443344+33453345+ if (mux_idx == prev_mux_idx)33673346 return 0;3368334733693369- wcd->rx_port_value[port_id] = ucontrol->value.enumerated.item[0];33703370-33713371- switch (wcd->rx_port_value[port_id]) {33483348+ switch(mux_idx) {33723349 case 0:33733373- list_del_init(&wcd->rx_chs[port_id].list);33503350+ aif_id = slim_rx_mux_to_dai_id(prev_mux_idx);33513351+ if (aif_id < 0)33523352+ return 0;33533353+33543354+ list_for_each_entry_safe(ch, c, &wcd->dai[aif_id].slim_ch_list, list) {33553355+ if (ch->port == port_id + WCD934X_RX_START) {33563356+ found = true;33573357+ list_del_init(&ch->list);33583358+ break;33593359+ }33603360+ }33613361+ if (!found)33623362+ return 0;33633363+33743364 break;33753375- case 1:33763376- list_add_tail(&wcd->rx_chs[port_id].list,33773377- &wcd->dai[AIF1_PB].slim_ch_list);33653365+ case 1 ... 4:33663366+ aif_id = slim_rx_mux_to_dai_id(mux_idx);33673367+ if (aif_id < 0)33683368+ return 0;33693369+33703370+ if (list_empty(&wcd->rx_chs[port_id].list)) {33713371+ list_add_tail(&wcd->rx_chs[port_id].list,33723372+ &wcd->dai[aif_id].slim_ch_list);33733373+ } else {33743374+ dev_err(wcd->dev ,"SLIM_RX%d PORT is busy\n", port_id);33753375+ return 0;33763376+ }33783377 break;33793379- case 2:33803380- list_add_tail(&wcd->rx_chs[port_id].list,33813381- &wcd->dai[AIF2_PB].slim_ch_list);33823382- break;33833383- case 3:33843384- list_add_tail(&wcd->rx_chs[port_id].list,33853385- &wcd->dai[AIF3_PB].slim_ch_list);33863386- break;33873387- case 4:33883388- list_add_tail(&wcd->rx_chs[port_id].list,33893389- &wcd->dai[AIF4_PB].slim_ch_list);33903390- break;33783378+33913379 default:33923392- dev_err(wcd->dev, "Unknown AIF %d\n",33933393- wcd->rx_port_value[port_id]);33803380+ dev_err(wcd->dev, "Unknown AIF %d\n", mux_idx);33943381 goto err;33953382 }3396338333843384+ wcd->rx_port_value[port_id] = mux_idx;33973385 snd_soc_dapm_mux_update_power(w->dapm, kc, wcd->rx_port_value[port_id],33983386 e, update);3399338734003400- return 0;33883388+ return 1;34013389err:34023390 return -EINVAL;34033391}···38593815 struct soc_mixer_control *mixer =38603816 (struct soc_mixer_control *)kc->private_value;38613817 int enable = ucontrol->value.integer.value[0];38183818+ struct wcd934x_slim_ch *ch, *c;38623819 int dai_id = widget->shift;38633820 int port_id = mixer->shift;38643821···38673822 if (enable == wcd->tx_port_value[port_id])38683823 return 0;3869382438253825+ if (enable) {38263826+ if (list_empty(&wcd->tx_chs[port_id].list)) {38273827+ list_add_tail(&wcd->tx_chs[port_id].list,38283828+ &wcd->dai[dai_id].slim_ch_list);38293829+ } else {38303830+ dev_err(wcd->dev ,"SLIM_TX%d PORT is busy\n", port_id);38313831+ return 0;38323832+ }38333833+ } else {38343834+ bool found = false;38353835+38363836+ list_for_each_entry_safe(ch, c, &wcd->dai[dai_id].slim_ch_list, list) {38373837+ if (ch->port == port_id) {38383838+ found = true;38393839+ list_del_init(&wcd->tx_chs[port_id].list);38403840+ break;38413841+ }38423842+ }38433843+ if (!found)38443844+ return 0;38453845+ }38463846+38703847 wcd->tx_port_value[port_id] = enable;38713871-38723872- if (enable)38733873- list_add_tail(&wcd->tx_chs[port_id].list,38743874- &wcd->dai[dai_id].slim_ch_list);38753875- else38763876- list_del_init(&wcd->tx_chs[port_id].list);38773877-38783848 snd_soc_dapm_mixer_update_power(widget->dapm, kc, enable, update);3879384938803880- return 0;38503850+ return 1;38813851}3882385238833853static const struct snd_kcontrol_new aif1_slim_cap_mixer[] = {
+12-4
sound/soc/codecs/wsa881x.c
···772772773773 usleep_range(1000, 1010);774774 }775775- return 0;775775+776776+ return 1;776777}777778778779static int wsa881x_get_port(struct snd_kcontrol *kcontrol,···817816 (struct soc_mixer_control *)kcontrol->private_value;818817 int portidx = mixer->reg;819818820820- if (ucontrol->value.integer.value[0])819819+ if (ucontrol->value.integer.value[0]) {820820+ if (data->port_enable[portidx])821821+ return 0;822822+821823 data->port_enable[portidx] = true;822822- else824824+ } else {825825+ if (!data->port_enable[portidx])826826+ return 0;827827+823828 data->port_enable[portidx] = false;829829+ }824830825831 if (portidx == WSA881X_PORT_BOOST) /* Boost Switch */826832 wsa881x_boost_ctrl(comp, data->port_enable[portidx]);827833828828- return 0;834834+ return 1;829835}830836831837static const char * const smart_boost_lvl_text[] = {
···8383 int cnt;8484 };8585 int addr_cnt;8686+ bool is_set;8687 Elf64_Addr addr[ADDR_CNT];8788};8889···452451 * in symbol's size, together with 'cnt' field hence453452 * that - 1.454453 */455455- if (id)454454+ if (id) {456455 id->cnt = sym.st_size / sizeof(int) - 1;456456+ id->is_set = true;457457+ }457458 } else {458459 pr_err("FAILED unsupported prefix %s\n", prefix);459460 return -1;···571568 int *ptr = data->d_buf;572569 int i;573570574574- if (!id->id) {571571+ if (!id->id && !id->is_set)575572 pr_err("WARN: resolve_btfids: unresolved symbol %s\n", id->name);576576- }577573578574 for (i = 0; i < id->addr_cnt; i++) {579575 unsigned long addr = id->addr[i];
···1414# include "test-libpython.c"1515#undef main16161717-#define main main_test_libpython_version1818-# include "test-libpython-version.c"1919-#undef main2020-2117#define main main_test_libperl2218# include "test-libperl.c"2319#undef main···173177int main(int argc, char *argv[])174178{175179 main_test_libpython();176176- main_test_libpython_version();177180 main_test_libperl();178181 main_test_hello();179182 main_test_libelf();
···528528446 common landlock_restrict_self sys_landlock_restrict_self529529# 447 reserved for memfd_secret530530448 common process_mrelease sys_process_mrelease531531+449 common futex_waitv sys_futex_waitv
+1
tools/perf/arch/s390/entry/syscalls/syscall.tbl
···451451446 common landlock_restrict_self sys_landlock_restrict_self sys_landlock_restrict_self452452# 447 reserved for memfd_secret453453448 common process_mrelease sys_process_mrelease sys_process_mrelease454454+449 common futex_waitv sys_futex_waitv sys_futex_waitv
-4
tools/perf/bench/sched-messaging.c
···223223 snd_ctx->out_fds[i] = fds[1];224224 if (!thread_mode)225225 close(fds[0]);226226-227227- free(ctx);228226 }229227230228 /* Now we have all the fds, fork the senders */···238240 if (!thread_mode)239241 for (i = 0; i < num_fds; i++)240242 close(snd_ctx->out_fds[i]);241241-242242- free(snd_ctx);243243244244 /* Return number of children to reap */245245 return num_fds * 2;
+1-1
tools/perf/builtin-inject.c
···820820 inject->tool.ordered_events = true;821821 inject->tool.ordering_requires_timestamps = true;822822 /* Allow space in the header for new attributes */823823- output_data_offset = 4096;823823+ output_data_offset = roundup(8192 + session->header.data_offset, 4096);824824 if (inject->strip)825825 strip_init(inject);826826 }
+3-1
tools/perf/tests/expr.c
···169169 TEST_ASSERT_VAL("#num_dies", expr__parse(&num_dies, ctx, "#num_dies") == 0);170170 TEST_ASSERT_VAL("#num_cores >= #num_dies", num_cores >= num_dies);171171 TEST_ASSERT_VAL("#num_packages", expr__parse(&num_packages, ctx, "#num_packages") == 0);172172- TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);172172+173173+ if (num_dies) // Some platforms do not have CPU die support, for example s390174174+ TEST_ASSERT_VAL("#num_dies >= #num_packages", num_dies >= num_packages);173175174176 /*175177 * Source count returns the number of events aggregating in a leader
···4444/* perf sample has 16 bits size limit */4545#define PERF_SAMPLE_MAX_SIZE (1 << 16)46464747+/* number of register is bound by the number of bits in regs_dump::mask (64) */4848+#define PERF_SAMPLE_REGS_CACHE_SIZE (8 * sizeof(u64))4949+4750struct regs_dump {4851 u64 abi;4952 u64 mask;5053 u64 *regs;51545255 /* Cached values/mask filled by first register access. */5353- u64 cache_regs[PERF_REGS_MAX];5656+ u64 cache_regs[PERF_SAMPLE_REGS_CACHE_SIZE];5457 u64 cache_mask;5558};5659
+10-5
tools/perf/util/header.c
···23212321#define FEAT_PROCESS_STR_FUN(__feat, __feat_env) \23222322static int process_##__feat(struct feat_fd *ff, void *data __maybe_unused) \23232323{\23242324+ free(ff->ph->env.__feat_env); \23242325 ff->ph->env.__feat_env = do_read_string(ff); \23252326 return ff->ph->env.__feat_env ? 0 : -ENOMEM; \23262327}···41254124 struct perf_record_header_feature *fe = (struct perf_record_header_feature *)event;41264125 int type = fe->header.type;41274126 u64 feat = fe->feat_id;41274127+ int ret = 0;4128412841294129 if (type < 0 || type >= PERF_RECORD_HEADER_MAX) {41304130 pr_warning("invalid record type %d in pipe-mode\n", type);···41434141 ff.size = event->header.size - sizeof(*fe);41444142 ff.ph = &session->header;4145414341464146- if (feat_ops[feat].process(&ff, NULL))41474147- return -1;41444144+ if (feat_ops[feat].process(&ff, NULL)) {41454145+ ret = -1;41464146+ goto out;41474147+ }4148414841494149 if (!feat_ops[feat].print || !tool->show_feat_hdr)41504150- return 0;41504150+ goto out;4151415141524152 if (!feat_ops[feat].full_only ||41534153 tool->show_feat_hdr >= SHOW_FEAT_HEADER_FULL_INFO) {···41584154 fprintf(stdout, "# %s info available, use -I to display\n",41594155 feat_ops[feat].name);41604156 }41614161-41624162- return 0;41574157+out:41584158+ free_event_desc(ff.events);41594159+ return ret;41634160}4164416141654162size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
···444444 setup445445446446 set -e447447+ ip netns add ns2448448+ ip netns set ns2 auto449449+450450+ ip -netns ns2 link set dev lo up451451+452452+ $IP link add name veth1 type veth peer name veth2453453+ $IP link set dev veth2 netns ns2454454+ $IP address add 192.0.2.1/24 dev veth1455455+ ip -netns ns2 address add 192.0.2.1/24 dev veth2456456+ $IP link set dev veth1 up457457+ ip -netns ns2 link set dev veth2 up458458+447459 $IP link set dev lo address 52:54:00:6a:c7:5e448448- $IP link set dummy0 address 52:54:00:6a:c7:5e449449- $IP link add dummy1 type dummy450450- $IP link set dummy1 address 52:54:00:6a:c7:5e451451- $IP link set dev dummy1 up460460+ $IP link set dev veth1 address 52:54:00:6a:c7:5e461461+ ip -netns ns2 link set dev lo address 52:54:00:6a:c7:5e462462+ ip -netns ns2 link set dev veth2 address 52:54:00:6a:c7:5e463463+464464+ # 1. (ns2) redirect lo's egress to veth2's egress465465+ ip netns exec ns2 tc qdisc add dev lo parent root handle 1: fq_codel466466+ ip netns exec ns2 tc filter add dev lo parent 1: protocol arp basic \467467+ action mirred egress redirect dev veth2468468+ ip netns exec ns2 tc filter add dev lo parent 1: protocol ip basic \469469+ action mirred egress redirect dev veth2470470+471471+ # 2. (ns1) redirect veth1's ingress to lo's ingress472472+ $NS_EXEC tc qdisc add dev veth1 ingress473473+ $NS_EXEC tc filter add dev veth1 ingress protocol arp basic \474474+ action mirred ingress redirect dev lo475475+ $NS_EXEC tc filter add dev veth1 ingress protocol ip basic \476476+ action mirred ingress redirect dev lo477477+478478+ # 3. (ns1) redirect lo's egress to veth1's egress479479+ $NS_EXEC tc qdisc add dev lo parent root handle 1: fq_codel480480+ $NS_EXEC tc filter add dev lo parent 1: protocol arp basic \481481+ action mirred egress redirect dev veth1482482+ $NS_EXEC tc filter add dev lo parent 1: protocol ip basic \483483+ action mirred egress redirect dev veth1484484+485485+ # 4. (ns2) redirect veth2's ingress to lo's ingress486486+ ip netns exec ns2 tc qdisc add dev veth2 ingress487487+ ip netns exec ns2 tc filter add dev veth2 ingress protocol arp basic \488488+ action mirred ingress redirect dev lo489489+ ip netns exec ns2 tc filter add dev veth2 ingress protocol ip basic \490490+ action mirred ingress redirect dev lo491491+452492 $NS_EXEC sysctl -qw net.ipv4.conf.all.rp_filter=1453493 $NS_EXEC sysctl -qw net.ipv4.conf.all.accept_local=1454494 $NS_EXEC sysctl -qw net.ipv4.conf.all.route_localnet=1455455-456456- $NS_EXEC tc qd add dev dummy1 parent root handle 1: fq_codel457457- $NS_EXEC tc filter add dev dummy1 parent 1: protocol arp basic action mirred egress redirect dev lo458458- $NS_EXEC tc filter add dev dummy1 parent 1: protocol ip basic action mirred egress redirect dev lo495495+ ip netns exec ns2 sysctl -qw net.ipv4.conf.all.rp_filter=1496496+ ip netns exec ns2 sysctl -qw net.ipv4.conf.all.accept_local=1497497+ ip netns exec ns2 sysctl -qw net.ipv4.conf.all.route_localnet=1459498 set +e460499461461- run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 198.51.100.1"500500+ run_cmd "ip netns exec ns2 ping -w1 -c1 192.0.2.1"462501 log_test $? 0 "rp_filter passes local packets"463502464464- run_cmd "ip netns exec ns1 ping -I dummy1 -w1 -c1 127.0.0.1"503503+ run_cmd "ip netns exec ns2 ping -w1 -c1 127.0.0.1"465504 log_test $? 0 "rp_filter passes loopback packets"466505467506 cleanup