···5959 brightness. Reading this file when no hw brightness change6060 event has happened will return an ENODATA error.61616262-What: /sys/class/leds/<led>/color6363-Date: June 20236464-KernelVersion: 6.56565-Description:6666- Color of the LED.6767-6868- This is a read-only file. Reading this file returns the color6969- of the LED as a string (e.g: "red", "green", "multicolor").7070-7162What: /sys/class/leds/<led>/trigger7263Date: March 20067364KernelVersion: 2.6.17
···991010maintainers:1111 - Ghennadi Procopciuc <Ghennadi.Procopciuc@oss.nxp.com>1212- - Chester Lin <clin@suse.com>1212+ - Chester Lin <chester62515@gmail.com>13131414description: |1515 S32G2 pinmux is implemented in SIUL2 (System Integration Unit Lite2),
···36363737 vdd-supply:3838 description:3939- VDD power supply to the hub3939+ 3V3 power supply to the hub4040+4141+ vdd2-supply:4242+ description:4343+ 1V2 power supply to the hub40444145 peer-hub:4246 $ref: /schemas/types.yaml#/definitions/phandle···6662 properties:6763 reset-gpios: false6864 vdd-supply: false6565+ vdd2-supply: false6966 peer-hub: false7067 i2c-bus: false7168 else:
···484484 * for secondary CPUs as they are brought up.485485 * For uniformity we use VCPUOP_register_vcpu_info even on cpu0.486486 */487487- xen_vcpu_info = alloc_percpu(struct vcpu_info);487487+ xen_vcpu_info = __alloc_percpu(sizeof(struct vcpu_info),488488+ 1 << fls(sizeof(struct vcpu_info) - 1));488489 if (xen_vcpu_info == NULL)489490 return -ENOMEM;490491
···2929 *3030 * KFENCE pool requires page-granular mapping if initialized late.3131 */3232- return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() ||3333- arm64_kfence_can_set_direct_map();3232+ return rodata_full || debug_pagealloc_enabled() ||3333+ arm64_kfence_can_set_direct_map();3434}35353636static int change_page_range(pte_t *ptep, unsigned long addr, void *data)···105105 * If we are manipulating read-only permissions, apply the same106106 * change to the linear mapping of the pages that back this VM area.107107 */108108- if (rodata_enabled &&109109- rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||108108+ if (rodata_full && (pgprot_val(set_mask) == PTE_RDONLY ||110109 pgprot_val(clear_mask) == PTE_RDONLY)) {111110 for (i = 0; i < area->nr_pages; i++) {112111 __change_memory_common((u64)page_address(area->pages[i]),
+5-2
arch/parisc/Kconfig
···115115 default n116116117117config GENERIC_BUG118118- bool119119- default y118118+ def_bool y120119 depends on BUG120120+ select GENERIC_BUG_RELATIVE_POINTERS if 64BIT121121+122122+config GENERIC_BUG_RELATIVE_POINTERS123123+ bool121124122125config GENERIC_HWEIGHT123126 bool
+6-3
arch/parisc/include/asm/alternative.h
···34343535/* Alternative SMP implementation. */3636#define ALTERNATIVE(cond, replacement) "!0:" \3737- ".section .altinstructions, \"aw\" !" \3737+ ".section .altinstructions, \"a\" !" \3838+ ".align 4 !" \3839 ".word (0b-4-.) !" \3940 ".hword 1, " __stringify(cond) " !" \4041 ".word " __stringify(replacement) " !" \···45444645/* to replace one single instructions by a new instruction */4746#define ALTERNATIVE(from, to, cond, replacement)\4848- .section .altinstructions, "aw" ! \4747+ .section .altinstructions, "a" ! \4848+ .align 4 ! \4949 .word (from - .) ! \5050 .hword (to - from)/4, cond ! \5151 .word replacement ! \···54525553/* to replace multiple instructions by new code */5654#define ALTERNATIVE_CODE(from, num_instructions, cond, new_instr_ptr)\5757- .section .altinstructions, "aw" ! \5555+ .section .altinstructions, "a" ! \5656+ .align 4 ! \5857 .word (from - .) ! \5958 .hword -num_instructions, cond ! \6059 .word (new_instr_ptr - .) ! \
···75757676/* We now return you to your regularly scheduled HPUX. */77777878-#define ENOSYM 215 /* symbol does not exist in executable */7978#define ENOTSOCK 216 /* Socket operation on non-socket */8079#define EDESTADDRREQ 217 /* Destination address required */8180#define EMSGSIZE 218 /* Message too long */···100101#define ETIMEDOUT 238 /* Connection timed out */101102#define ECONNREFUSED 239 /* Connection refused */102103#define EREFUSED ECONNREFUSED /* for HP's NFS apparently */103103-#define EREMOTERELEASE 240 /* Remote peer released connection */104104#define EHOSTDOWN 241 /* Host is down */105105#define EHOSTUNREACH 242 /* No route to host */106106
···228228 execve_tail(); \229229} while (0)230230231231-/* Forward declaration, a strange C thing */232231struct task_struct;233232struct mm_struct;234233struct seq_file;
+1
arch/s390/kernel/ipl.c
···666666 &ipl_ccw_attr_group_lpar);667667 break;668668 case IPL_TYPE_ECKD:669669+ case IPL_TYPE_ECKD_DUMP:669670 rc = sysfs_create_group(&ipl_kset->kobj, &ipl_eckd_attr_group);670671 break;671672 case IPL_TYPE_FCP:
+5-6
arch/s390/kernel/perf_pai_crypto.c
···279279 if (IS_ERR(cpump))280280 return PTR_ERR(cpump);281281282282- /* Event initialization sets last_tag to 0. When later on the events283283- * are deleted and re-added, do not reset the event count value to zero.284284- * Events are added, deleted and re-added when 2 or more events285285- * are active at the same time.286286- */287287- event->hw.last_tag = 0;288282 event->destroy = paicrypt_event_destroy;289283290284 if (a->sample_period) {···312318{313319 u64 sum;314320321321+ /* Event initialization sets last_tag to 0. When later on the events322322+ * are deleted and re-added, do not reset the event count value to zero.323323+ * Events are added, deleted and re-added when 2 or more events324324+ * are active at the same time.325325+ */315326 if (!event->hw.last_tag) {316327 event->hw.last_tag = 1;317328 sum = paicrypt_getall(event); /* Get current value */
-1
arch/s390/kernel/perf_pai_ext.c
···260260 rc = paiext_alloc(a, event);261261 if (rc)262262 return rc;263263- event->hw.last_tag = 0;264263 event->destroy = paiext_event_destroy;265264266265 if (a->sample_period) {
···577577 struct request_queue *q = disk->queue;578578 struct blkcg_gq *blkg, *n;579579 int count = BLKG_DESTROY_BATCH_SIZE;580580+ int i;580581581582restart:582583 spin_lock_irq(&q->queue_lock);···601600 cond_resched();602601 goto restart;603602 }603603+ }604604+605605+ /*606606+ * Mark policy deactivated since policy offline has been done, and607607+ * the free is scheduled, so future blkcg_deactivate_policy() can608608+ * be bypassed609609+ */610610+ for (i = 0; i < BLKCG_MAX_POLS; i++) {611611+ struct blkcg_policy *pol = blkcg_policy[i];612612+613613+ if (pol)614614+ __clear_bit(pol->plid, q->blkcg_pols);604615 }605616606617 q->root_blkg = NULL;
···163163 * @q: the queue of the device164164 *165165 * Description:166166- * For historical reasons, this routine merely calls blk_set_runtime_active()167167- * to do the real work of restarting the queue. It does this regardless of168168- * whether the device's runtime-resume succeeded; even if it failed the166166+ * Restart the queue of a runtime suspended device. It does this regardless167167+ * of whether the device's runtime-resume succeeded; even if it failed the169168 * driver or error handler will need to communicate with the device.170169 *171170 * This function should be called near the end of the device's172172- * runtime_resume callback.171171+ * runtime_resume callback to correct queue runtime PM status and re-enable172172+ * peeking requests from the queue.173173 */174174void blk_post_runtime_resume(struct request_queue *q)175175-{176176- blk_set_runtime_active(q);177177-}178178-EXPORT_SYMBOL(blk_post_runtime_resume);179179-180180-/**181181- * blk_set_runtime_active - Force runtime status of the queue to be active182182- * @q: the queue of the device183183- *184184- * If the device is left runtime suspended during system suspend the resume185185- * hook typically resumes the device and corrects runtime status186186- * accordingly. However, that does not affect the queue runtime PM status187187- * which is still "suspended". This prevents processing requests from the188188- * queue.189189- *190190- * This function can be used in driver's resume hook to correct queue191191- * runtime PM status and re-enable peeking requests from the queue. It192192- * should be called before first request is added to the queue.193193- *194194- * This function is also called by blk_post_runtime_resume() for195195- * runtime resumes. It does everything necessary to restart the queue.196196- */197197-void blk_set_runtime_active(struct request_queue *q)198175{199176 int old_status;200177···188211 if (old_status != RPM_ACTIVE)189212 blk_clear_pm_only(q);190213}191191-EXPORT_SYMBOL(blk_set_runtime_active);214214+EXPORT_SYMBOL(blk_post_runtime_resume);
+2
block/blk-throttle.c
···13201320 tg_bps_limit(tg, READ), tg_bps_limit(tg, WRITE),13211321 tg_iops_limit(tg, READ), tg_iops_limit(tg, WRITE));1322132213231323+ rcu_read_lock();13231324 /*13241325 * Update has_rules[] flags for the updated tg's subtree. A tg is13251326 * considered to have rules if either the tg itself or any of its···13481347 this_tg->latency_target = max(this_tg->latency_target,13491348 parent_tg->latency_target);13501349 }13501350+ rcu_read_unlock();1351135113521352 /*13531353 * We're already holding queue_lock and know @tg is valid. Let's
+22-24
drivers/accel/ivpu/ivpu_hw_37xx.c
···502502 return ret;503503}504504505505+static int ivpu_boot_pwr_domain_disable(struct ivpu_device *vdev)506506+{507507+ ivpu_boot_dpu_active_drive(vdev, false);508508+ ivpu_boot_pwr_island_isolation_drive(vdev, true);509509+ ivpu_boot_pwr_island_trickle_drive(vdev, false);510510+ ivpu_boot_pwr_island_drive(vdev, false);511511+512512+ return ivpu_boot_wait_for_pwr_island_status(vdev, 0x0);513513+}514514+505515static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)506516{507517 u32 val = REGV_RD32(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES);···610600611601static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)612602{613613- int ret;614614- u32 val;603603+ int ret = 0;615604616616- if (IVPU_WA(punit_disabled))617617- return 0;618618-619619- ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);620620- if (ret) {621621- ivpu_err(vdev, "Timed out waiting for TRIGGER bit\n");622622- return ret;605605+ if (ivpu_boot_pwr_domain_disable(vdev)) {606606+ ivpu_err(vdev, "Failed to disable power domain\n");607607+ ret = -EIO;623608 }624609625625- val = REGB_RD32(VPU_37XX_BUTTRESS_VPU_IP_RESET);626626- val = REG_SET_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, val);627627- REGB_WR32(VPU_37XX_BUTTRESS_VPU_IP_RESET, val);628628-629629- ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);630630- if (ret)631631- ivpu_err(vdev, "Timed out waiting for RESET completion\n");610610+ if (ivpu_pll_disable(vdev)) {611611+ ivpu_err(vdev, "Failed to disable PLL\n");612612+ ret = -EIO;613613+ }632614633615 return ret;634616}···652650static int ivpu_hw_37xx_power_up(struct ivpu_device *vdev)653651{654652 int ret;655655-656656- ret = ivpu_hw_37xx_reset(vdev);657657- if (ret)658658- ivpu_warn(vdev, "Failed to reset HW: %d\n", ret);659653660654 ret = ivpu_hw_37xx_d0i3_disable(vdev);661655 if (ret)···720722{721723 int ret = 0;722724723723- if (!ivpu_hw_37xx_is_idle(vdev) && ivpu_hw_37xx_reset(vdev))724724- ivpu_err(vdev, "Failed to reset the VPU\n");725725+ if (!ivpu_hw_37xx_is_idle(vdev))726726+ ivpu_warn(vdev, "VPU not idle during power down\n");725727726726- if (ivpu_pll_disable(vdev)) {727727- ivpu_err(vdev, "Failed to disable PLL\n");728728+ if (ivpu_hw_37xx_reset(vdev)) {729729+ ivpu_err(vdev, "Failed to reset VPU\n");728730 ret = -EIO;729731 }730732
+1-1
drivers/acpi/acpi_video.c
···20312031 * HP ZBook Fury 16 G10 requires ACPI video's child devices have _PS020322032 * evaluated to have functional panel brightness control.20332033 */20342034- acpi_device_fix_up_power_extended(device);20342034+ acpi_device_fix_up_power_children(device);2035203520362036 pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n",20372037 ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
+13
drivers/acpi/device_pm.c
···397397}398398EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended);399399400400+/**401401+ * acpi_device_fix_up_power_children - Force a device's children into D0.402402+ * @adev: Parent device object whose children's power state is to be fixed up.403403+ *404404+ * Call acpi_device_fix_up_power() for @adev's children so long as they405405+ * are reported as present and enabled.406406+ */407407+void acpi_device_fix_up_power_children(struct acpi_device *adev)408408+{409409+ acpi_dev_for_each_child(adev, fix_up_power_if_applicable, NULL);410410+}411411+EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_children);412412+400413int acpi_device_update_power(struct acpi_device *device, int *state_p)401414{402415 int state;
+1-1
drivers/acpi/processor_idle.c
···592592 while (1) {593593594594 if (cx->entry_method == ACPI_CSTATE_HALT)595595- safe_halt();595595+ raw_safe_halt();596596 else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {597597 io_idle(cx->address);598598 } else
···17671767 .destroy = drm_encoder_cleanup,17681768};1769176917701770+static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector,17711771+ struct drm_modeset_acquire_ctx *ctx,17721772+ bool force)17731773+{17741774+ struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector);17751775+ struct drm_connector *physical_connector = bmc_connector->physical_connector;17761776+17771777+ /*17781778+ * Most user-space compositors cannot handle more than one connected17791779+ * connector per CRTC. Hence, we only mark the BMC as connected if the17801780+ * physical connector is disconnected. If the physical connector's status17811781+ * is connected or unknown, the BMC remains disconnected. This has no17821782+ * effect on the output of the BMC.17831783+ *17841784+ * FIXME: Remove this logic once user-space compositors can handle more17851785+ * than one connector per CRTC. The BMC should always be connected.17861786+ */17871787+17881788+ if (physical_connector && physical_connector->status == connector_status_disconnected)17891789+ return connector_status_connected;17901790+17911791+ return connector_status_disconnected;17921792+}17931793+17701794static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)17711795{17721796 return drm_add_modes_noedid(connector, 4096, 4096);···1798177417991775static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = {18001776 .get_modes = ast_bmc_connector_helper_get_modes,17771777+ .detect_ctx = ast_bmc_connector_helper_detect_ctx,18011778};1802177918031780static const struct drm_connector_funcs ast_bmc_connector_funcs = {···18091784 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,18101785};1811178618121812-static int ast_bmc_output_init(struct ast_device *ast)17871787+static int ast_bmc_connector_init(struct drm_device *dev,17881788+ struct ast_bmc_connector *bmc_connector,17891789+ struct drm_connector *physical_connector)17901790+{17911791+ struct drm_connector *connector = &bmc_connector->base;17921792+ int ret;17931793+17941794+ ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,17951795+ DRM_MODE_CONNECTOR_VIRTUAL);17961796+ if (ret)17971797+ return ret;17981798+17991799+ drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);18001800+18011801+ bmc_connector->physical_connector = physical_connector;18021802+18031803+ return 0;18041804+}18051805+18061806+static int ast_bmc_output_init(struct ast_device *ast,18071807+ struct drm_connector *physical_connector)18131808{18141809 struct drm_device *dev = &ast->base;18151810 struct drm_crtc *crtc = &ast->crtc;18161811 struct drm_encoder *encoder = &ast->output.bmc.encoder;18171817- struct drm_connector *connector = &ast->output.bmc.connector;18121812+ struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector;18131813+ struct drm_connector *connector = &bmc_connector->base;18181814 int ret;1819181518201816 ret = drm_encoder_init(dev, encoder,···18451799 return ret;18461800 encoder->possible_crtcs = drm_crtc_mask(crtc);1847180118481848- ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,18491849- DRM_MODE_CONNECTOR_VIRTUAL);18021802+ ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector);18501803 if (ret)18511804 return ret;18521852-18531853- drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);1854180518551806 ret = drm_connector_attach_encoder(connector, encoder);18561807 if (ret)···19071864int ast_mode_config_init(struct ast_device *ast)19081865{19091866 struct drm_device *dev = &ast->base;18671867+ struct drm_connector *physical_connector = NULL;19101868 int ret;1911186919121870 ret = drmm_mode_config_init(dev);···19481904 ret = ast_vga_output_init(ast);19491905 if (ret)19501906 return ret;19071907+ physical_connector = &ast->output.vga.vga_connector.base;19511908 }19521909 if (ast->tx_chip_types & AST_TX_SIL164_BIT) {19531910 ret = ast_sil164_output_init(ast);19541911 if (ret)19551912 return ret;19131913+ physical_connector = &ast->output.sil164.sil164_connector.base;19561914 }19571915 if (ast->tx_chip_types & AST_TX_DP501_BIT) {19581916 ret = ast_dp501_output_init(ast);19591917 if (ret)19601918 return ret;19191919+ physical_connector = &ast->output.dp501.connector;19611920 }19621921 if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {19631922 ret = ast_astdp_output_init(ast);19641923 if (ret)19651924 return ret;19251925+ physical_connector = &ast->output.astdp.connector;19661926 }19671967- ret = ast_bmc_output_init(ast);19271927+ ret = ast_bmc_output_init(ast, physical_connector);19681928 if (ret)19691929 return ret;19701930
+8-8
drivers/gpu/drm/i915/display/intel_dp_mst.c
···11611161 intel_connector->port = port;11621162 drm_dp_mst_get_port_malloc(port);1163116311641164+ /*11651165+ * TODO: set the AUX for the actual MST port decompressing the stream.11661166+ * At the moment the driver only supports enabling this globally in the11671167+ * first downstream MST branch, via intel_dp's (root port) AUX.11681168+ */11691169+ intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;11701170+ intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);11711171+11641172 connector = &intel_connector->base;11651173 ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,11661174 DRM_MODE_CONNECTOR_DisplayPort);···11791171 }1180117211811173 drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs);11821182-11831183- /*11841184- * TODO: set the AUX for the actual MST port decompressing the stream.11851185- * At the moment the driver only supports enabling this globally in the11861186- * first downstream MST branch, via intel_dp's (root port) AUX.11871187- */11881188- intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;11891189- intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);1190117411911175 for_each_pipe(dev_priv, pipe) {11921176 struct drm_encoder *enc =
···247247 VOP_REG_SET(vop, common, cfg_done, 1);248248}249249250250-static bool has_rb_swapped(uint32_t format)250250+static bool has_rb_swapped(uint32_t version, uint32_t format)251251{252252 switch (format) {253253 case DRM_FORMAT_XBGR8888:254254 case DRM_FORMAT_ABGR8888:255255- case DRM_FORMAT_BGR888:256255 case DRM_FORMAT_BGR565:257256 return true;257257+ /*258258+ * full framework (IP version 3.x) only need rb swapped for RGB888 and259259+ * little framework (IP version 2.x) only need rb swapped for BGR888,260260+ * check for 3.x to also only rb swap BGR888 for unknown vop version261261+ */262262+ case DRM_FORMAT_RGB888:263263+ return VOP_MAJOR(version) == 3;264264+ case DRM_FORMAT_BGR888:265265+ return VOP_MAJOR(version) != 3;258266 default:259267 return false;260268 }···10381030 VOP_WIN_SET(vop, win, dsp_info, dsp_info);10391031 VOP_WIN_SET(vop, win, dsp_st, dsp_st);1040103210411041- rb_swap = has_rb_swapped(fb->format->format);10331033+ rb_swap = has_rb_swapped(vop->data->version, fb->format->format);10421034 VOP_WIN_SET(vop, win, rb_swap, rb_swap);1043103510441036 /*
···2121 * Glorious Model O and O- specify the const flag in the consumer input2222 * report descriptor, which leads to inputs being ignored. Fix this2323 * by patching the descriptor.2424+ *2525+ * Glorious Model I incorrectly specifes the Usage Minimum for its2626+ * keyboard HID report, causing keycodes to be misinterpreted.2727+ * Fix this by setting Usage Minimum to 0 in that report.2428 */2529static __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc,2630 unsigned int *rsize)···3531 hid_info(hdev, "patching Glorious Model O consumer control report descriptor\n");3632 rdesc[85] = rdesc[113] = rdesc[141] = \3733 HID_MAIN_ITEM_VARIABLE | HID_MAIN_ITEM_RELATIVE;3434+ }3535+ if (*rsize == 156 && rdesc[41] == 1) {3636+ hid_info(hdev, "patching Glorious Model I keyboard report descriptor\n");3737+ rdesc[41] = 0;3838 }3939 return rdesc;4040}···5244 model = "Model O"; break;5345 case USB_DEVICE_ID_GLORIOUS_MODEL_D:5446 model = "Model D"; break;4747+ case USB_DEVICE_ID_GLORIOUS_MODEL_I:4848+ model = "Model I"; break;5549 }56505751 snprintf(hdev->name, sizeof(hdev->name), "%s %s", "Glorious", model);···7666}77677868static const struct hid_device_id glorious_devices[] = {7979- { HID_USB_DEVICE(USB_VENDOR_ID_GLORIOUS,6969+ { HID_USB_DEVICE(USB_VENDOR_ID_SINOWEALTH,8070 USB_DEVICE_ID_GLORIOUS_MODEL_O) },8181- { HID_USB_DEVICE(USB_VENDOR_ID_GLORIOUS,7171+ { HID_USB_DEVICE(USB_VENDOR_ID_SINOWEALTH,8272 USB_DEVICE_ID_GLORIOUS_MODEL_D) },7373+ { HID_USB_DEVICE(USB_VENDOR_ID_LAVIEW,7474+ USB_DEVICE_ID_GLORIOUS_MODEL_I) },8375 { }8476};8577MODULE_DEVICE_TABLE(hid, glorious_devices);
···265265#define BCACHE_DEV_WB_RUNNING 3266266#define BCACHE_DEV_RATE_DW_RUNNING 4267267 int nr_stripes;268268+#define BCH_MIN_STRIPE_SZ ((4 << 20) >> SECTOR_SHIFT)268269 unsigned int stripe_size;269270 atomic_t *stripe_sectors_dirty;270271 unsigned long *full_dirty_stripes;
+10-1
drivers/md/bcache/btree.c
···10001000 *10011001 * The btree node will have either a read or a write lock held, depending on10021002 * level and op->lock.10031003+ *10041004+ * Note: Only error code or btree pointer will be returned, it is unncessary10051005+ * for callers to check NULL pointer.10031006 */10041007struct btree *bch_btree_node_get(struct cache_set *c, struct btree_op *op,10051008 struct bkey *k, int level, bool write,···11141111 mutex_unlock(&b->c->bucket_lock);11151112}1116111311141114+/*11151115+ * Only error code or btree pointer will be returned, it is unncessary for11161116+ * callers to check NULL pointer.11171117+ */11171118struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op,11181119 int level, bool wait,11191120 struct btree *parent)···13751368 memset(new_nodes, 0, sizeof(new_nodes));13761369 closure_init_stack(&cl);1377137013781378- while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b))13711371+ while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b))13791372 keys += r[nodes++].keys;1380137313811374 blocks = btree_default_blocks(b->c) * 2 / 3;···15391532 return 0;1540153315411534 n = btree_node_alloc_replacement(replace, NULL);15351535+ if (IS_ERR(n))15361536+ return 0;1542153715431538 /* recheck reserve after allocating replacement node */15441539 if (btree_check_reserve(b, NULL)) {
+3-1
drivers/md/bcache/super.c
···905905906906 if (!d->stripe_size)907907 d->stripe_size = 1 << 31;908908+ else if (d->stripe_size < BCH_MIN_STRIPE_SZ)909909+ d->stripe_size = roundup(BCH_MIN_STRIPE_SZ, d->stripe_size);908910909911 n = DIV_ROUND_UP_ULL(sectors, d->stripe_size);910912 if (!n || n > max_stripes) {···20182016 c->root = bch_btree_node_get(c, NULL, k,20192017 j->btree_level,20202018 true, NULL);20212021- if (IS_ERR_OR_NULL(c->root))20192019+ if (IS_ERR(c->root))20222020 goto err;2023202120242022 list_del_init(&c->root->list);
+1-1
drivers/md/bcache/sysfs.c
···11041104 sum += INITIAL_PRIO - cached[i];1105110511061106 if (n)11071107- do_div(sum, n);11071107+ sum = div64_u64(sum, n);1108110811091109 for (i = 0; i < ARRAY_SIZE(q); i++)11101110 q[i] = INITIAL_PRIO - cached[n * (i + 1) /
+18-6
drivers/md/bcache/writeback.c
···913913 int cur_idx, prev_idx, skip_nr;914914915915 k = p = NULL;916916- cur_idx = prev_idx = 0;916916+ prev_idx = 0;917917918918 bch_btree_iter_init(&c->root->keys, &iter, NULL);919919 k = bch_btree_iter_next_filter(&iter, &c->root->keys, bch_ptr_bad);···977977void bch_sectors_dirty_init(struct bcache_device *d)978978{979979 int i;980980+ struct btree *b = NULL;980981 struct bkey *k = NULL;981982 struct btree_iter iter;982983 struct sectors_dirty_init op;983984 struct cache_set *c = d->c;984985 struct bch_dirty_init_state state;985986987987+retry_lock:988988+ b = c->root;989989+ rw_lock(0, b, b->level);990990+ if (b != c->root) {991991+ rw_unlock(0, b);992992+ goto retry_lock;993993+ }994994+986995 /* Just count root keys if no leaf node */987987- rw_lock(0, c->root, c->root->level);988996 if (c->root->level == 0) {989997 bch_btree_op_init(&op.op, -1);990998 op.inode = d->id;991999 op.count = 0;99210009931001 for_each_key_filter(&c->root->keys,994994- k, &iter, bch_ptr_invalid)10021002+ k, &iter, bch_ptr_invalid) {10031003+ if (KEY_INODE(k) != op.inode)10041004+ continue;9951005 sectors_dirty_init_fn(&op.op, c->root, k);10061006+ }9961007997997- rw_unlock(0, c->root);10081008+ rw_unlock(0, b);9981009 return;9991010 }10001011···10251014 if (atomic_read(&state.enough))10261015 break;1027101610171017+ atomic_inc(&state.started);10281018 state.infos[i].state = &state;10291019 state.infos[i].thread =10301020 kthread_run(bch_dirty_init_thread, &state.infos[i],10311021 "bch_dirtcnt[%d]", i);10321022 if (IS_ERR(state.infos[i].thread)) {10331023 pr_err("fails to run thread bch_dirty_init[%d]\n", i);10241024+ atomic_dec(&state.started);10341025 for (--i; i >= 0; i--)10351026 kthread_stop(state.infos[i].thread);10361027 goto out;10371028 }10381038- atomic_inc(&state.started);10391029 }1040103010411031out:10421032 /* Must wait for all threads to stop. */10431033 wait_event(state.wait, atomic_read(&state.started) == 0);10441044- rw_unlock(0, c->root);10341034+ rw_unlock(0, b);10451035}1046103610471037void bch_cached_dev_writeback_init(struct cached_dev *dc)
+2-1
drivers/md/md.c
···86668666 struct bio *orig_bio = md_io_clone->orig_bio;86678667 struct mddev *mddev = md_io_clone->mddev;8668866886698669- orig_bio->bi_status = bio->bi_status;86698669+ if (bio->bi_status && !orig_bio->bi_status)86708670+ orig_bio->bi_status = bio->bi_status;8670867186718672 if (md_io_clone->start_time)86728673 bio_end_io_acct(orig_bio, md_io_clone->start_time);
···942942 ret = cqhci_tasks_cleared(cq_host);943943944944 if (!ret)945945- pr_debug("%s: cqhci: Failed to clear tasks\n",946946- mmc_hostname(mmc));945945+ pr_warn("%s: cqhci: Failed to clear tasks\n",946946+ mmc_hostname(mmc));947947948948 return ret;949949}···976976 ret = cqhci_halted(cq_host);977977978978 if (!ret)979979- pr_debug("%s: cqhci: Failed to halt\n", mmc_hostname(mmc));979979+ pr_warn("%s: cqhci: Failed to halt\n", mmc_hostname(mmc));980980981981 return ret;982982}···984984/*985985 * After halting we expect to be able to use the command line. We interpret the986986 * failure to halt to mean the data lines might still be in use (and the upper987987- * layers will need to send a STOP command), so we set the timeout based on a988988- * generous command timeout.987987+ * layers will need to send a STOP command), however failing to halt complicates988988+ * the recovery, so set a timeout that would reasonably allow I/O to complete.989989 */990990-#define CQHCI_START_HALT_TIMEOUT 5990990+#define CQHCI_START_HALT_TIMEOUT 500991991992992static void cqhci_recovery_start(struct mmc_host *mmc)993993{···1075107510761076 ok = cqhci_halt(mmc, CQHCI_FINISH_HALT_TIMEOUT);1077107710781078- if (!cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT))10791079- ok = false;10801080-10811078 /*10821079 * The specification contradicts itself, by saying that tasks cannot be10831080 * cleared if CQHCI does not halt, but if CQHCI does not halt, it should10841081 * be disabled/re-enabled, but not to disable before clearing tasks.10851082 * Have a go anyway.10861083 */10871087- if (!ok) {10881088- pr_debug("%s: cqhci: disable / re-enable\n", mmc_hostname(mmc));10891089- cqcfg = cqhci_readl(cq_host, CQHCI_CFG);10901090- cqcfg &= ~CQHCI_ENABLE;10911091- cqhci_writel(cq_host, cqcfg, CQHCI_CFG);10921092- cqcfg |= CQHCI_ENABLE;10931093- cqhci_writel(cq_host, cqcfg, CQHCI_CFG);10941094- /* Be sure that there are no tasks */10951095- ok = cqhci_halt(mmc, CQHCI_FINISH_HALT_TIMEOUT);10961096- if (!cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT))10971097- ok = false;10981098- WARN_ON(!ok);10991099- }10841084+ if (!cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT))10851085+ ok = false;10861086+10871087+ /* Disable to make sure tasks really are cleared */10881088+ cqcfg = cqhci_readl(cq_host, CQHCI_CFG);10891089+ cqcfg &= ~CQHCI_ENABLE;10901090+ cqhci_writel(cq_host, cqcfg, CQHCI_CFG);10911091+10921092+ cqcfg = cqhci_readl(cq_host, CQHCI_CFG);10931093+ cqcfg |= CQHCI_ENABLE;10941094+ cqhci_writel(cq_host, cqcfg, CQHCI_CFG);10951095+10961096+ cqhci_halt(mmc, CQHCI_FINISH_HALT_TIMEOUT);10971097+10981098+ if (!ok)10991099+ cqhci_clear_all_tasks(mmc, CQHCI_CLEAR_TIMEOUT);1100110011011101 cqhci_recover_mrqs(cq_host);11021102
+29-25
drivers/mmc/host/sdhci-pci-gli.c
···11891189 sdhci_writel(host, val, SDHCI_GLI_9763E_HS400_ES_REG);11901190}1191119111921192+static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot,11931193+ bool enable)11941194+{11951195+ struct pci_dev *pdev = slot->chip->pdev;11961196+ u32 value;11971197+11981198+ pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);11991199+ value &= ~GLI_9763E_VHS_REV;12001200+ value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_W);12011201+ pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);12021202+12031203+ pci_read_config_dword(pdev, PCIE_GLI_9763E_CFG, &value);12041204+12051205+ if (enable)12061206+ value &= ~GLI_9763E_CFG_LPSN_DIS;12071207+ else12081208+ value |= GLI_9763E_CFG_LPSN_DIS;12091209+12101210+ pci_write_config_dword(pdev, PCIE_GLI_9763E_CFG, value);12111211+12121212+ pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);12131213+ value &= ~GLI_9763E_VHS_REV;12141214+ value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_R);12151215+ pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);12161216+}12171217+11921218static void sdhci_set_gl9763e_signaling(struct sdhci_host *host,11931219 unsigned int timing)11941220{···13231297 if (ret)13241298 goto cleanup;1325129913001300+ /* Disable LPM negotiation to avoid entering L1 state. */13011301+ gl9763e_set_low_power_negotiation(slot, false);13021302+13261303 return 0;1327130413281305cleanup:···13691340}1370134113711342#ifdef CONFIG_PM13721372-static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, bool enable)13731373-{13741374- struct pci_dev *pdev = slot->chip->pdev;13751375- u32 value;13761376-13771377- pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);13781378- value &= ~GLI_9763E_VHS_REV;13791379- value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_W);13801380- pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);13811381-13821382- pci_read_config_dword(pdev, PCIE_GLI_9763E_CFG, &value);13831383-13841384- if (enable)13851385- value &= ~GLI_9763E_CFG_LPSN_DIS;13861386- else13871387- value |= GLI_9763E_CFG_LPSN_DIS;13881388-13891389- pci_write_config_dword(pdev, PCIE_GLI_9763E_CFG, value);13901390-13911391- pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);13921392- value &= ~GLI_9763E_VHS_REV;13931393- value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_R);13941394- pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);13951395-}13961396-13971343static int gl9763e_runtime_suspend(struct sdhci_pci_chip *chip)13981344{13991345 struct sdhci_pci_slot *slot = chip->slots[0];
···516516517517 memcpy(skb->data, fd_vaddr + fd_offset, fd_length);518518519519- dpaa2_eth_recycle_buf(priv, ch, dpaa2_fd_get_addr(fd));520520-521519 return skb;522520}523521···587589 struct rtnl_link_stats64 *percpu_stats;588590 struct dpaa2_eth_drv_stats *percpu_extras;589591 struct device *dev = priv->net_dev->dev.parent;592592+ bool recycle_rx_buf = false;590593 void *buf_data;591594 u32 xdp_act;592595···617618 dma_unmap_page(dev, addr, priv->rx_buf_size,618619 DMA_BIDIRECTIONAL);619620 skb = dpaa2_eth_build_linear_skb(ch, fd, vaddr);621621+ } else {622622+ recycle_rx_buf = true;620623 }621624 } else if (fd_format == dpaa2_fd_sg) {622625 WARN_ON(priv->xdp_prog);···638637 goto err_build_skb;639638640639 dpaa2_eth_receive_skb(priv, ch, fd, vaddr, fq, percpu_stats, skb);640640+641641+ if (recycle_rx_buf)642642+ dpaa2_eth_recycle_buf(priv, ch, dpaa2_fd_get_addr(fd));641643 return;642644643645err_build_skb:···10771073 dma_addr_t addr;1078107410791075 buffer_start = skb->data - dpaa2_eth_needed_headroom(skb);10801080-10811081- /* If there's enough room to align the FD address, do it.10821082- * It will help hardware optimize accesses.10831083- */10841076 aligned_start = PTR_ALIGN(buffer_start - DPAA2_ETH_TX_BUF_ALIGN,10851077 DPAA2_ETH_TX_BUF_ALIGN);10861078 if (aligned_start >= skb->head)10871079 buffer_start = aligned_start;10801080+ else10811081+ return -ENOMEM;1088108210891083 /* Store a backpointer to the skb at the beginning of the buffer10901084 * (in the private data area) such that we can release it···49684966 err = dpaa2_eth_dl_port_add(priv);49694967 if (err)49704968 goto err_dl_port_add;49694969+49704970+ net_dev->needed_headroom = DPAA2_ETH_SWA_SIZE + DPAA2_ETH_TX_BUF_ALIGN;4971497149724972 err = register_netdev(net_dev);49734973 if (err < 0) {
+1-1
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
···740740741741static inline unsigned int dpaa2_eth_needed_headroom(struct sk_buff *skb)742742{743743- unsigned int headroom = DPAA2_ETH_SWA_SIZE;743743+ unsigned int headroom = DPAA2_ETH_SWA_SIZE + DPAA2_ETH_TX_BUF_ALIGN;744744745745 /* If we don't have an skb (e.g. XDP buffer), we only need space for746746 * the software annotation area
+72-50
drivers/net/ethernet/intel/ice/ice_lag.c
···570570}571571572572/**573573+ * ice_lag_build_netdev_list - populate the lag struct's netdev list574574+ * @lag: local lag struct575575+ * @ndlist: pointer to netdev list to populate576576+ */577577+static void ice_lag_build_netdev_list(struct ice_lag *lag,578578+ struct ice_lag_netdev_list *ndlist)579579+{580580+ struct ice_lag_netdev_list *nl;581581+ struct net_device *tmp_nd;582582+583583+ INIT_LIST_HEAD(&ndlist->node);584584+ rcu_read_lock();585585+ for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {586586+ nl = kzalloc(sizeof(*nl), GFP_ATOMIC);587587+ if (!nl)588588+ break;589589+590590+ nl->netdev = tmp_nd;591591+ list_add(&nl->node, &ndlist->node);592592+ }593593+ rcu_read_unlock();594594+ lag->netdev_head = &ndlist->node;595595+}596596+597597+/**598598+ * ice_lag_destroy_netdev_list - free lag struct's netdev list599599+ * @lag: pointer to local lag struct600600+ * @ndlist: pointer to lag struct netdev list601601+ */602602+static void ice_lag_destroy_netdev_list(struct ice_lag *lag,603603+ struct ice_lag_netdev_list *ndlist)604604+{605605+ struct ice_lag_netdev_list *entry, *n;606606+607607+ rcu_read_lock();608608+ list_for_each_entry_safe(entry, n, &ndlist->node, node) {609609+ list_del(&entry->node);610610+ kfree(entry);611611+ }612612+ rcu_read_unlock();613613+ lag->netdev_head = NULL;614614+}615615+616616+/**573617 * ice_lag_move_single_vf_nodes - Move Tx scheduling nodes for single VF574618 * @lag: primary interface LAG struct575619 * @oldport: lport of previous interface···641597void ice_lag_move_new_vf_nodes(struct ice_vf *vf)642598{643599 struct ice_lag_netdev_list ndlist;644644- struct list_head *tmp, *n;645600 u8 pri_port, act_port;646601 struct ice_lag *lag;647602 struct ice_vsi *vsi;···664621 pri_port = pf->hw.port_info->lport;665622 act_port = lag->active_port;666623667667- if (lag->upper_netdev) {668668- struct ice_lag_netdev_list *nl;669669- struct net_device *tmp_nd;670670-671671- INIT_LIST_HEAD(&ndlist.node);672672- rcu_read_lock();673673- for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {674674- nl = kzalloc(sizeof(*nl), GFP_ATOMIC);675675- if (!nl)676676- break;677677-678678- nl->netdev = tmp_nd;679679- list_add(&nl->node, &ndlist.node);680680- }681681- rcu_read_unlock();682682- }683683-684684- lag->netdev_head = &ndlist.node;624624+ if (lag->upper_netdev)625625+ ice_lag_build_netdev_list(lag, &ndlist);685626686627 if (ice_is_feature_supported(pf, ICE_F_SRIOV_LAG) &&687628 lag->bonded && lag->primary && pri_port != act_port &&688629 !list_empty(lag->netdev_head))689630 ice_lag_move_single_vf_nodes(lag, pri_port, act_port, vsi->idx);690631691691- list_for_each_safe(tmp, n, &ndlist.node) {692692- struct ice_lag_netdev_list *entry;693693-694694- entry = list_entry(tmp, struct ice_lag_netdev_list, node);695695- list_del(&entry->node);696696- kfree(entry);697697- }698698- lag->netdev_head = NULL;632632+ ice_lag_destroy_netdev_list(lag, &ndlist);699633700634new_vf_unlock:701635 mutex_unlock(&pf->lag_mutex);···697677 if (pf->vsi[i] && (pf->vsi[i]->type == ICE_VSI_VF ||698678 pf->vsi[i]->type == ICE_VSI_SWITCHDEV_CTRL))699679 ice_lag_move_single_vf_nodes(lag, oldport, newport, i);680680+}681681+682682+/**683683+ * ice_lag_move_vf_nodes_cfg - move vf nodes outside LAG netdev event context684684+ * @lag: local lag struct685685+ * @src_prt: lport value for source port686686+ * @dst_prt: lport value for destination port687687+ *688688+ * This function is used to move nodes during an out-of-netdev-event situation,689689+ * primarily when the driver needs to reconfigure or recreate resources.690690+ *691691+ * Must be called while holding the lag_mutex to avoid lag events from692692+ * processing while out-of-sync moves are happening. Also, paired moves,693693+ * such as used in a reset flow, should both be called under the same mutex694694+ * lock to avoid changes between start of reset and end of reset.695695+ */696696+void ice_lag_move_vf_nodes_cfg(struct ice_lag *lag, u8 src_prt, u8 dst_prt)697697+{698698+ struct ice_lag_netdev_list ndlist;699699+700700+ ice_lag_build_netdev_list(lag, &ndlist);701701+ ice_lag_move_vf_nodes(lag, src_prt, dst_prt);702702+ ice_lag_destroy_netdev_list(lag, &ndlist);700703}701704702705#define ICE_LAG_SRIOV_CP_RECIPE 10···20942051{20952052 struct ice_lag_netdev_list ndlist;20962053 struct ice_lag *lag, *prim_lag;20972097- struct list_head *tmp, *n;20982054 u8 act_port, loc_port;2099205521002056 if (!pf->lag || !pf->lag->bonded)···21052063 if (lag->primary) {21062064 prim_lag = lag;21072065 } else {21082108- struct ice_lag_netdev_list *nl;21092109- struct net_device *tmp_nd;21102110-21112111- INIT_LIST_HEAD(&ndlist.node);21122112- rcu_read_lock();21132113- for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {21142114- nl = kzalloc(sizeof(*nl), GFP_ATOMIC);21152115- if (!nl)21162116- break;21172117-21182118- nl->netdev = tmp_nd;21192119- list_add(&nl->node, &ndlist.node);21202120- }21212121- rcu_read_unlock();21222122- lag->netdev_head = &ndlist.node;20662066+ ice_lag_build_netdev_list(lag, &ndlist);21232067 prim_lag = ice_lag_find_primary(lag);21242068 }21252069···2135210721362108 ice_clear_rdma_cap(pf);21372109lag_rebuild_out:21382138- list_for_each_safe(tmp, n, &ndlist.node) {21392139- struct ice_lag_netdev_list *entry;21402140-21412141- entry = list_entry(tmp, struct ice_lag_netdev_list, node);21422142- list_del(&entry->node);21432143- kfree(entry);21442144- }21102110+ ice_lag_destroy_netdev_list(lag, &ndlist);21452111 mutex_unlock(&pf->lag_mutex);21462112}21472113
···9393{9494 struct nsim_bpf_bound_prog *state;95959696- if (!prog || !prog->aux->offload)9696+ if (!prog || !bpf_prog_is_offloaded(prog->aux))9797 return;98989999 state = prog->aux->offload->dev_priv;···311311 if (!bpf->prog)312312 return 0;313313314314- if (!bpf->prog->aux->offload) {314314+ if (!bpf_prog_is_offloaded(bpf->prog->aux)) {315315 NSIM_EA(bpf->extack, "xdpoffload of non-bound program");316316 return -EINVAL;317317 }
+6
drivers/net/netkit.c
···851851 return -EACCES;852852 }853853854854+ if (data[IFLA_NETKIT_PEER_INFO]) {855855+ NL_SET_ERR_MSG_ATTR(extack, data[IFLA_NETKIT_PEER_INFO],856856+ "netkit peer info cannot be changed after device creation");857857+ return -EINVAL;858858+ }859859+854860 if (data[IFLA_NETKIT_POLICY]) {855861 attr = data[IFLA_NETKIT_POLICY];856862 policy = nla_get_u32(attr);
+1-3
drivers/net/wireless/ath/ath9k/Kconfig
···57575858config ATH9K_DEBUGFS5959 bool "Atheros ath9k debugging"6060- depends on ATH9K && DEBUG_FS6161- select MAC80211_DEBUGFS6060+ depends on ATH9K && DEBUG_FS && MAC80211_DEBUGFS6261 select ATH9K_COMMON_DEBUG6362 help6463 Say Y, if you need access to ath9k's statistics for···6970config ATH9K_STATION_STATISTICS7071 bool "Detailed station statistics"7172 depends on ATH9K && ATH9K_DEBUGFS && DEBUG_FS7272- select MAC80211_DEBUGFS7373 default n7474 help7575 This option enables detailed statistics for association stations.
+3-1
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
···707707 rcu_dereference_protected(mvm_sta->link[link_id],708708 lockdep_is_held(&mvm->mutex));709709710710- if (WARN_ON(!link_conf || !mvm_link_sta))710710+ if (WARN_ON(!link_conf || !mvm_link_sta)) {711711+ ret = -EINVAL;711712 goto err;713713+ }712714713715 ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,714716 mvm_link_sta);
+1
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
···375375 int ret, i, len, offset = 0;376376 u8 *clc_base = NULL, hw_encap = 0;377377378378+ dev->phy.clc_chan_conf = 0xff;378379 if (mt7921_disable_clc ||379380 mt76_is_usb(&dev->mt76))380381 return 0;
···25302530 * clean up the admin queue. Same thing as above.25312531 */25322532 nvme_quiesce_admin_queue(&ctrl->ctrl);25332533-25342534- /*25352535- * Open-coding nvme_cancel_admin_tagset() as fc25362536- * is not using nvme_cancel_request().25372537- */25382538- nvme_stop_keep_alive(&ctrl->ctrl);25392533 blk_sync_queue(ctrl->ctrl.admin_q);25402534 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,25412535 nvme_fc_terminate_exchange, &ctrl->ctrl);···31323138 nvme_unquiesce_admin_queue(&ctrl->ctrl);3133313931343140 ret = nvme_init_ctrl_finish(&ctrl->ctrl, false);31353135- if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags))31363136- ret = -EIO;31373141 if (ret)31383142 goto out_disconnect_admin_queue;31393139-31433143+ if (test_bit(ASSOC_FAILED, &ctrl->flags)) {31443144+ ret = -EIO;31453145+ goto out_stop_keep_alive;31463146+ }31403147 /* sanity checks */3141314831423149 /* FC-NVME does not have other data in the capsule */···31453150 dev_err(ctrl->ctrl.device, "icdoff %d is not supported!\n",31463151 ctrl->ctrl.icdoff);31473152 ret = NVME_SC_INVALID_FIELD | NVME_SC_DNR;31483148- goto out_disconnect_admin_queue;31533153+ goto out_stop_keep_alive;31493154 }3150315531513156 /* FC-NVME supports normal SGL Data Block Descriptors */···31533158 dev_err(ctrl->ctrl.device,31543159 "Mandatory sgls are not supported!\n");31553160 ret = NVME_SC_INVALID_FIELD | NVME_SC_DNR;31563156- goto out_disconnect_admin_queue;31613161+ goto out_stop_keep_alive;31573162 }3158316331593164 if (opts->queue_size > ctrl->ctrl.maxcmd) {···3200320532013206out_term_aen_ops:32023207 nvme_fc_term_aen_ops(ctrl);32083208+out_stop_keep_alive:32093209+ nvme_stop_keep_alive(&ctrl->ctrl);32033210out_disconnect_admin_queue:32043211 dev_warn(ctrl->ctrl.device,32053212 "NVME-FC{%d}: create_assoc failed, assoc_id %llx ret %d\n",
···11-# SPDX-License-Identifier: GPL-2.022-#33-# Phy drivers for Realtek platforms44-#55-66-if ARCH_REALTEK || COMPILE_TEST77-88-config PHY_RTK_RTD_USB2PHY99- tristate "Realtek RTD USB2 PHY Transceiver Driver"1010- depends on USB_SUPPORT1111- select GENERIC_PHY1212- select USB_PHY1313- select USB_COMMON1414- help1515- Enable this to support Realtek SoC USB2 phy transceiver.1616- The DHC (digital home center) RTD series SoCs used the Synopsys1717- DWC3 USB IP. This driver will do the PHY initialization1818- of the parameters.1919-2020-config PHY_RTK_RTD_USB3PHY2121- tristate "Realtek RTD USB3 PHY Transceiver Driver"2222- depends on USB_SUPPORT2323- select GENERIC_PHY2424- select USB_PHY2525- select USB_COMMON2626- help2727- Enable this to support Realtek SoC USB3 phy transceiver.2828- The DHC (digital home center) RTD series SoCs used the Synopsys2929- DWC3 USB IP. This driver will do the PHY initialization3030- of the parameters.3131-3232-endif # ARCH_REALTEK || COMPILE_TEST
···12121313config PINCTRL_LOCHNAGAR1414 tristate "Cirrus Logic Lochnagar pinctrl driver"1515- depends on MFD_LOCHNAGAR1515+ # Avoid clash caused by MIPS defining RST, which is used in the driver1616+ depends on MFD_LOCHNAGAR && !MIPS1617 select GPIOLIB1718 select PINMUX1819 select PINCONF
+3-3
drivers/pinctrl/core.c
···12621262static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state)12631263{12641264 struct pinctrl_setting *setting, *setting2;12651265- struct pinctrl_state *old_state = p->state;12651265+ struct pinctrl_state *old_state = READ_ONCE(p->state);12661266 int ret;1267126712681268- if (p->state) {12681268+ if (old_state) {12691269 /*12701270 * For each pinmux setting in the old state, forget SW's record12711271 * of mux owner for that pingroup. Any pingroups which are12721272 * still owned by the new state will be re-acquired by the call12731273 * to pinmux_enable_setting() in the loop below.12741274 */12751275- list_for_each_entry(setting, &p->state->settings, node) {12751275+ list_for_each_entry(setting, &old_state->settings, node) {12761276 if (setting->type != PIN_MAP_TYPE_MUX_GROUP)12771277 continue;12781278 pinmux_disable_setting(setting);
+2-2
drivers/pinctrl/nxp/pinctrl-s32cc.c
···843843 if (!np)844844 return -ENODEV;845845846846- if (mem_regions == 0) {847847- dev_err(&pdev->dev, "mem_regions is 0\n");846846+ if (mem_regions == 0 || mem_regions >= 10000) {847847+ dev_err(&pdev->dev, "mem_regions is invalid: %u\n", mem_regions);848848 return -EINVAL;849849 }850850
+1
drivers/pinctrl/pinctrl-cy8c95x0.c
···143143 * @pinctrl_desc: pin controller description144144 * @name: Chip controller name145145 * @tpin: Total number of pins146146+ * @gpio_reset: GPIO line handler that can reset the IC146147 */147148struct cy8c95x0_pinctrl {148149 struct regmap *regmap;
+2-2
drivers/pinctrl/realtek/pinctrl-rtd.c
···146146147147static const struct rtd_pin_desc *rtd_pinctrl_find_mux(struct rtd_pinctrl *data, unsigned int pin)148148{149149- if (!data->info->muxes[pin].name)149149+ if (data->info->muxes[pin].name)150150 return &data->info->muxes[pin];151151152152 return NULL;···249249static const struct rtd_pin_config_desc250250 *rtd_pinctrl_find_config(struct rtd_pinctrl *data, unsigned int pin)251251{252252- if (!data->info->configs[pin].name)252252+ if (data->info->configs[pin].name)253253 return &data->info->configs[pin];254254255255 return NULL;
+10-3
drivers/pinctrl/stm32/pinctrl-stm32.c
···12731273 int i;1274127412751275 /* With few exceptions (e.g. bank 'Z'), pin number matches with pin index in array */12761276- pin_desc = pctl->pins + stm32_pin_nb;12771277- if (pin_desc->pin.number == stm32_pin_nb)12781278- return pin_desc;12761276+ if (stm32_pin_nb < pctl->npins) {12771277+ pin_desc = pctl->pins + stm32_pin_nb;12781278+ if (pin_desc->pin.number == stm32_pin_nb)12791279+ return pin_desc;12801280+ }1279128112801282 /* Otherwise, loop all array to find the pin with the right number */12811283 for (i = 0; i < pctl->npins; i++) {···13701368 }1371136913721370 names = devm_kcalloc(dev, npins, sizeof(char *), GFP_KERNEL);13711371+ if (!names) {13721372+ err = -ENOMEM;13731373+ goto err_clk;13741374+ }13751375+13731376 for (i = 0; i < npins; i++) {13741377 stm32_pin = stm32_pctrl_get_desc_pin_from_gpio(pctl, bank, i);13751378 if (stm32_pin && stm32_pin->pin.name)
+1-1
drivers/pmdomain/arm/scmi_perf_domain.c
···3535 if (!state)3636 return -EINVAL;37373838- ret = pd->perf_ops->level_set(pd->ph, pd->domain_id, state, true);3838+ ret = pd->perf_ops->level_set(pd->ph, pd->domain_id, state, false);3939 if (ret)4040 dev_warn(&genpd->dev, "Failed with %d when trying to set %d perf level",4141 ret, state);
+13-11
drivers/s390/block/dasd.c
···676676 * we count each request only once.677677 */678678 device = cqr->startdev;679679- if (device->profile.data) {680680- counter = 1; /* request is not yet queued on the start device */681681- list_for_each(l, &device->ccw_queue)682682- if (++counter >= 31)683683- break;684684- }679679+ if (!device->profile.data)680680+ return;681681+682682+ spin_lock(get_ccwdev_lock(device->cdev));683683+ counter = 1; /* request is not yet queued on the start device */684684+ list_for_each(l, &device->ccw_queue)685685+ if (++counter >= 31)686686+ break;687687+ spin_unlock(get_ccwdev_lock(device->cdev));688688+685689 spin_lock(&device->profile.lock);686686- if (device->profile.data) {687687- device->profile.data->dasd_io_nr_req[counter]++;688688- if (rq_data_dir(req) == READ)689689- device->profile.data->dasd_read_nr_req[counter]++;690690- }690690+ device->profile.data->dasd_io_nr_req[counter]++;691691+ if (rq_data_dir(req) == READ)692692+ device->profile.data->dasd_read_nr_req[counter]++;691693 spin_unlock(&device->profile.lock);692694}693695
+1-1
drivers/s390/block/dasd_int.h
···283283 __u8 secondary; /* 7 Secondary device address */284284 __u16 pprc_id; /* 8-9 Peer-to-Peer Remote Copy ID */285285 __u8 reserved2[12]; /* 10-21 reserved */286286- __u16 prim_cu_ssid; /* 22-23 Pimary Control Unit SSID */286286+ __u16 prim_cu_ssid; /* 22-23 Primary Control Unit SSID */287287 __u8 reserved3[12]; /* 24-35 reserved */288288 __u16 sec_cu_ssid; /* 36-37 Secondary Control Unit SSID */289289 __u8 reserved4[90]; /* 38-127 reserved */
+3-3
drivers/thunderbolt/switch.c
···11431143 * Only set bonding if the link was not already bonded. This11441144 * avoids the lane adapter to re-enter bonding state.11451145 */11461146- if (width == TB_LINK_WIDTH_SINGLE) {11461146+ if (width == TB_LINK_WIDTH_SINGLE && !tb_is_upstream_port(port)) {11471147 ret = tb_port_set_lane_bonding(port, true);11481148 if (ret)11491149 goto err_lane1;···28802880 return tb_port_wait_for_link_width(down, TB_LINK_WIDTH_SINGLE, 100);28812881}2882288228832883+/* Note updating sw->link_width done in tb_switch_update_link_attributes() */28832884static int tb_switch_asym_enable(struct tb_switch *sw, enum tb_link_width width)28842885{28852886 struct tb_port *up, *down, *port;···29202919 return ret;29212920 }2922292129232923- sw->link_width = width;29242922 return 0;29252923}2926292429252925+/* Note updating sw->link_width done in tb_switch_update_link_attributes() */29272926static int tb_switch_asym_disable(struct tb_switch *sw)29282927{29292928 struct tb_port *up, *down;···29582957 return ret;29592958 }2960295929612961- sw->link_width = TB_LINK_WIDTH_DUAL;29622960 return 0;29632961}29642962
+11-1
drivers/thunderbolt/tb.c
···213213 if (!tb_switch_query_dp_resource(sw, port))214214 continue;215215216216- list_add(&port->list, &tcm->dp_resources);216216+ /*217217+ * If DP IN on device router exist, position it at the218218+ * beginning of the DP resources list, so that it is used219219+ * before DP IN of the host router. This way external GPU(s)220220+ * will be prioritized when pairing DP IN to a DP OUT.221221+ */222222+ if (tb_route(sw))223223+ list_add(&port->list, &tcm->dp_resources);224224+ else225225+ list_add_tail(&port->list, &tcm->dp_resources);226226+217227 tb_port_dbg(port, "DP IN resource available\n");218228 }219229}
···622622 ret = 0;623623 }624624 mutex_unlock(&hub->status_mutex);625625-626626- /*627627- * There is no need to lock status_mutex here, because status_mutex628628- * protects hub->status, and the phy driver only checks the port629629- * status without changing the status.630630- */631631- if (!ret) {632632- struct usb_device *hdev = hub->hdev;633633-634634- /*635635- * Only roothub will be notified of port state changes,636636- * since the USB PHY only cares about changes at the next637637- * level.638638- */639639- if (is_root_hub(hdev)) {640640- struct usb_hcd *hcd = bus_to_hcd(hdev->bus);641641-642642- if (hcd->usb_phy)643643- usb_phy_notify_port_status(hcd->usb_phy,644644- port1 - 1, *status, *change);645645- }646646- }647647-648625 return ret;649626}650627
+7-8
drivers/usb/dwc2/hcd_intr.c
···20152015{20162016 struct dwc2_qtd *qtd;20172017 struct dwc2_host_chan *chan;20182018- u32 hcint, hcintmsk;20182018+ u32 hcint, hcintraw, hcintmsk;2019201920202020 chan = hsotg->hc_ptr_array[chnum];2021202120222022- hcint = dwc2_readl(hsotg, HCINT(chnum));20222022+ hcintraw = dwc2_readl(hsotg, HCINT(chnum));20232023 hcintmsk = dwc2_readl(hsotg, HCINTMSK(chnum));20242024+ hcint = hcintraw & hcintmsk;20252025+ dwc2_writel(hsotg, hcint, HCINT(chnum));20262026+20242027 if (!chan) {20252028 dev_err(hsotg->dev, "## hc_ptr_array for channel is NULL ##\n");20262026- dwc2_writel(hsotg, hcint, HCINT(chnum));20272029 return;20282030 }20292031···20342032 chnum);20352033 dev_vdbg(hsotg->dev,20362034 " hcint 0x%08x, hcintmsk 0x%08x, hcint&hcintmsk 0x%08x\n",20372037- hcint, hcintmsk, hcint & hcintmsk);20352035+ hcintraw, hcintmsk, hcint);20382036 }20392039-20402040- dwc2_writel(hsotg, hcint, HCINT(chnum));2041203720422038 /*20432039 * If we got an interrupt after someone called···20462046 return;20472047 }2048204820492049- chan->hcint = hcint;20502050- hcint &= hcintmsk;20492049+ chan->hcint = hcintraw;2051205020522051 /*20532052 * If the channel was halted due to a dequeue, the qtd list might
···650650651651 if (sch_ep->ep_type == ISOC_OUT_EP) {652652 for (j = 0; j < sch_ep->num_budget_microframes; j++) {653653- k = XHCI_MTK_BW_INDEX(base + j + CS_OFFSET);654654- /* use cs to indicate existence of in-ss @(base+j) */655655- if (tt->fs_bus_bw_in[k])653653+ k = XHCI_MTK_BW_INDEX(base + j);654654+ if (tt->in_ss_cnt[k])656655 return -ESCH_SS_OVERLAP;657656 }658657 } else if (sch_ep->ep_type == ISOC_IN_EP || sch_ep->ep_type == INT_IN_EP) {···767768 fs_bus_bw[k] -= (u16)sch_ep->bw_budget_table[j];768769 tt->fs_frame_bw[f] -= (u16)sch_ep->bw_budget_table[j];769770 }771771+ }772772+773773+ if (sch_ep->ep_type == ISOC_IN_EP || sch_ep->ep_type == INT_IN_EP) {774774+ k = XHCI_MTK_BW_INDEX(base);775775+ if (used)776776+ tt->in_ss_cnt[k]++;777777+ else778778+ tt->in_ss_cnt[k]--;770779 }771780 }772781
+2
drivers/usb/host/xhci-mtk.h
···3838 * @fs_bus_bw_in: save bandwidth used by FS/LS IN eps in each uframes3939 * @ls_bus_bw: save bandwidth used by LS eps in each uframes4040 * @fs_frame_bw: save bandwidth used by FS/LS eps in each FS frames4141+ * @in_ss_cnt: the count of Start-Split for IN eps4142 * @ep_list: Endpoints using this TT4243 */4344struct mu3h_sch_tt {···4645 u16 fs_bus_bw_in[XHCI_MTK_MAX_ESIT];4746 u8 ls_bus_bw[XHCI_MTK_MAX_ESIT];4847 u16 fs_frame_bw[XHCI_MTK_FRAMES_CNT];4848+ u8 in_ss_cnt[XHCI_MTK_MAX_ESIT];4949 struct list_head ep_list;5050};5151
+30-20
drivers/usb/host/xhci-plat.c
···1313#include <linux/module.h>1414#include <linux/pci.h>1515#include <linux/of.h>1616+#include <linux/of_device.h>1617#include <linux/platform_device.h>1718#include <linux/usb/phy.h>1819#include <linux/slab.h>···149148 int ret;150149 int irq;151150 struct xhci_plat_priv *priv = NULL;152152-151151+ bool of_match;153152154153 if (usb_disabled())155154 return -ENODEV;···254253 &xhci->imod_interval);255254 }256255257257- hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);258258- if (IS_ERR(hcd->usb_phy)) {259259- ret = PTR_ERR(hcd->usb_phy);260260- if (ret == -EPROBE_DEFER)261261- goto disable_clk;262262- hcd->usb_phy = NULL;263263- } else {264264- ret = usb_phy_init(hcd->usb_phy);265265- if (ret)266266- goto disable_clk;256256+ /*257257+ * Drivers such as dwc3 manages PHYs themself (and rely on driver name258258+ * matching for the xhci platform device).259259+ */260260+ of_match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);261261+ if (of_match) {262262+ hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);263263+ if (IS_ERR(hcd->usb_phy)) {264264+ ret = PTR_ERR(hcd->usb_phy);265265+ if (ret == -EPROBE_DEFER)266266+ goto disable_clk;267267+ hcd->usb_phy = NULL;268268+ } else {269269+ ret = usb_phy_init(hcd->usb_phy);270270+ if (ret)271271+ goto disable_clk;272272+ }267273 }268274269275 hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);···293285 goto dealloc_usb2_hcd;294286 }295287296296- xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,297297- "usb-phy", 1);298298- if (IS_ERR(xhci->shared_hcd->usb_phy)) {299299- xhci->shared_hcd->usb_phy = NULL;300300- } else {301301- ret = usb_phy_init(xhci->shared_hcd->usb_phy);302302- if (ret)303303- dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n",304304- __func__, ret);288288+ if (of_match) {289289+ xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,290290+ "usb-phy", 1);291291+ if (IS_ERR(xhci->shared_hcd->usb_phy)) {292292+ xhci->shared_hcd->usb_phy = NULL;293293+ } else {294294+ ret = usb_phy_init(xhci->shared_hcd->usb_phy);295295+ if (ret)296296+ dev_err(sysdev, "%s init usb3phy fail (ret=%d)\n",297297+ __func__, ret);298298+ }305299 }306300307301 xhci->shared_hcd->tpl_support = hcd->tpl_support;
+2
drivers/usb/misc/onboard_usb_hub.c
···432432 { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2412) }, /* USB2412 USB 2.0 */433433 { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2514) }, /* USB2514B USB 2.0 */434434 { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2517) }, /* USB2517 USB 2.0 */435435+ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x2744) }, /* USB5744 USB 2.0 */436436+ { USB_DEVICE(VENDOR_ID_MICROCHIP, 0x5744) }, /* USB5744 USB 3.0 */435437 { USB_DEVICE(VENDOR_ID_REALTEK, 0x0411) }, /* RTS5411 USB 3.1 */436438 { USB_DEVICE(VENDOR_ID_REALTEK, 0x5411) }, /* RTS5411 USB 2.1 */437439 { USB_DEVICE(VENDOR_ID_REALTEK, 0x0414) }, /* RTS5414 USB 3.2 */
···5858 }59596060 /* Status load is ordered after lookup counter load */6161+ if (cell->dns_status == DNS_LOOKUP_GOT_NOT_FOUND) {6262+ pr_warn("No record of cell %s\n", cell->name);6363+ vc->error = -ENOENT;6464+ return false;6565+ }6666+6167 if (cell->dns_source == DNS_RECORD_UNAVAILABLE) {6268 vc->error = -EDESTADDRREQ;6369 return false;···291285 */292286static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc)293287{288288+ struct afs_cell *cell = vc->cell;294289 static int count;295290 int i;296291···301294302295 rcu_read_lock();303296 pr_notice("EDESTADDR occurred\n");297297+ pr_notice("CELL: %s err=%d\n", cell->name, cell->error);298298+ pr_notice("DNS: src=%u st=%u lc=%x\n",299299+ cell->dns_source, cell->dns_status, cell->dns_lookup_count);304300 pr_notice("VC: ut=%lx ix=%u ni=%hu fl=%hx err=%hd\n",305301 vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error);306302
+21-35
fs/autofs/inode.c
···309309 struct autofs_fs_context *ctx = fc->fs_private;310310 struct autofs_sb_info *sbi = s->s_fs_info;311311 struct inode *root_inode;312312- struct dentry *root;313312 struct autofs_info *ino;314314- int ret = -ENOMEM;315313316314 pr_debug("starting up, sbi = %p\n", sbi);317315···326328 */327329 ino = autofs_new_ino(sbi);328330 if (!ino)329329- goto fail;331331+ return -ENOMEM;330332331333 root_inode = autofs_get_inode(s, S_IFDIR | 0755);334334+ if (!root_inode)335335+ return -ENOMEM;336336+332337 root_inode->i_uid = ctx->uid;333338 root_inode->i_gid = ctx->gid;339339+ root_inode->i_fop = &autofs_root_operations;340340+ root_inode->i_op = &autofs_dir_inode_operations;334341335335- root = d_make_root(root_inode);336336- if (!root)337337- goto fail_ino;338338-339339- root->d_fsdata = ino;342342+ s->s_root = d_make_root(root_inode);343343+ if (unlikely(!s->s_root)) {344344+ autofs_free_ino(ino);345345+ return -ENOMEM;346346+ }347347+ s->s_root->d_fsdata = ino;340348341349 if (ctx->pgrp_set) {342350 sbi->oz_pgrp = find_get_pid(ctx->pgrp);343343- if (!sbi->oz_pgrp) {344344- ret = invalf(fc, "Could not find process group %d",345345- ctx->pgrp);346346- goto fail_dput;347347- }348348- } else {351351+ if (!sbi->oz_pgrp)352352+ return invalf(fc, "Could not find process group %d",353353+ ctx->pgrp);354354+ } else349355 sbi->oz_pgrp = get_task_pid(current, PIDTYPE_PGID);350350- }351356352357 if (autofs_type_trigger(sbi->type))353353- __managed_dentry_set_managed(root);354354-355355- root_inode->i_fop = &autofs_root_operations;356356- root_inode->i_op = &autofs_dir_inode_operations;358358+ /* s->s_root won't be contended so there's little to359359+ * be gained by not taking the d_lock when setting360360+ * d_flags, even when a lot mounts are being done.361361+ */362362+ managed_dentry_set_managed(s->s_root);357363358364 pr_debug("pipe fd = %d, pgrp = %u\n",359365 sbi->pipefd, pid_nr(sbi->oz_pgrp));360366361367 sbi->flags &= ~AUTOFS_SBI_CATATONIC;362362-363363- /*364364- * Success! Install the root dentry now to indicate completion.365365- */366366- s->s_root = root;367368 return 0;368368-369369- /*370370- * Failure ... clean up.371371- */372372-fail_dput:373373- dput(root);374374- goto fail;375375-fail_ino:376376- autofs_free_ino(ino);377377-fail:378378- return ret;379369}380370381371/*
+1
fs/btrfs/disk-io.c
···32133213 goto fail_alloc;32143214 }3215321532163216+ btrfs_info(fs_info, "first mount of filesystem %pU", disk_super->fsid);32163217 /*32173218 * Verify the type first, if that or the checksum value are32183219 * corrupted, we'll find out
+8-3
fs/btrfs/extent_io.c
···674674 * the array will be skipped675675 *676676 * Return: 0 if all pages were able to be allocated;677677- * -ENOMEM otherwise, and the caller is responsible for freeing all678678- * non-null page pointers in the array.677677+ * -ENOMEM otherwise, the partially allocated pages would be freed and678678+ * the array slots zeroed679679 */680680int btrfs_alloc_page_array(unsigned int nr_pages, struct page **page_array)681681{···694694 * though alloc_pages_bulk_array() falls back to alloc_page()695695 * if it could not bulk-allocate. So we must be out of memory.696696 */697697- if (allocated == last)697697+ if (allocated == last) {698698+ for (int i = 0; i < allocated; i++) {699699+ __free_page(page_array[i]);700700+ page_array[i] = NULL;701701+ }698702 return -ENOMEM;703703+ }699704700705 memalloc_retry_wait(GFP_NOFS);701706 }
···17741774 btrfs_release_path(path);1775177517761776 ret = btrfs_create_qgroup(trans, objectid);17771777- if (ret) {17771777+ if (ret && ret != -EEXIST) {17781778 btrfs_abort_transaction(trans, ret);17791779 goto fail;17801780 }
+39
fs/btrfs/tree-checker.c
···3131#include "inode-item.h"3232#include "dir-item.h"3333#include "raid-stripe-tree.h"3434+#include "extent-tree.h"34353536/*3637 * Error message should follow the following format:···12771276 unsigned long ptr; /* Current pointer inside inline refs */12781277 unsigned long end; /* Extent item end */12791278 const u32 item_size = btrfs_item_size(leaf, slot);12791279+ u8 last_type = 0;12801280+ u64 last_seq = U64_MAX;12801281 u64 flags;12811282 u64 generation;12821283 u64 total_refs; /* Total refs in btrfs_extent_item */···13251322 * 2.2) Ref type specific data13261323 * Either using btrfs_extent_inline_ref::offset, or specific13271324 * data structure.13251325+ *13261326+ * All above inline items should follow the order:13271327+ *13281328+ * - All btrfs_extent_inline_ref::type should be in an ascending13291329+ * order13301330+ *13311331+ * - Within the same type, the items should follow a descending13321332+ * order by their sequence number. The sequence number is13331333+ * determined by:13341334+ * * btrfs_extent_inline_ref::offset for all types other than13351335+ * EXTENT_DATA_REF13361336+ * * hash_extent_data_ref() for EXTENT_DATA_REF13281337 */13291338 if (unlikely(item_size < sizeof(*ei))) {13301339 extent_err(leaf, slot,···14181403 struct btrfs_extent_inline_ref *iref;14191404 struct btrfs_extent_data_ref *dref;14201405 struct btrfs_shared_data_ref *sref;14061406+ u64 seq;14211407 u64 dref_offset;14221408 u64 inline_offset;14231409 u8 inline_type;···14321416 iref = (struct btrfs_extent_inline_ref *)ptr;14331417 inline_type = btrfs_extent_inline_ref_type(leaf, iref);14341418 inline_offset = btrfs_extent_inline_ref_offset(leaf, iref);14191419+ seq = inline_offset;14351420 if (unlikely(ptr + btrfs_extent_inline_ref_size(inline_type) > end)) {14361421 extent_err(leaf, slot,14371422"inline ref item overflows extent item, ptr %lu iref size %u end %lu",···14631446 case BTRFS_EXTENT_DATA_REF_KEY:14641447 dref = (struct btrfs_extent_data_ref *)(&iref->offset);14651448 dref_offset = btrfs_extent_data_ref_offset(leaf, dref);14491449+ seq = hash_extent_data_ref(14501450+ btrfs_extent_data_ref_root(leaf, dref),14511451+ btrfs_extent_data_ref_objectid(leaf, dref),14521452+ btrfs_extent_data_ref_offset(leaf, dref));14661453 if (unlikely(!IS_ALIGNED(dref_offset,14671454 fs_info->sectorsize))) {14681455 extent_err(leaf, slot,···14961475 inline_type);14971476 return -EUCLEAN;14981477 }14781478+ if (inline_type < last_type) {14791479+ extent_err(leaf, slot,14801480+ "inline ref out-of-order: has type %u, prev type %u",14811481+ inline_type, last_type);14821482+ return -EUCLEAN;14831483+ }14841484+ /* Type changed, allow the sequence starts from U64_MAX again. */14851485+ if (inline_type > last_type)14861486+ last_seq = U64_MAX;14871487+ if (seq > last_seq) {14881488+ extent_err(leaf, slot,14891489+"inline ref out-of-order: has type %u offset %llu seq 0x%llx, prev type %u seq 0x%llx",14901490+ inline_type, inline_offset, seq,14911491+ last_type, last_seq);14921492+ return -EUCLEAN;14931493+ }14941494+ last_type = inline_type;14951495+ last_seq = seq;14991496 ptr += btrfs_extent_inline_ref_size(inline_type);15001497 }15011498 /* No padding is allowed */
+5-4
fs/btrfs/volumes.c
···30063006 read_unlock(&em_tree->lock);3007300730083008 if (!em) {30093009- btrfs_crit(fs_info, "unable to find logical %llu length %llu",30093009+ btrfs_crit(fs_info,30103010+ "unable to find chunk map for logical %llu length %llu",30103011 logical, length);30113012 return ERR_PTR(-EINVAL);30123013 }3013301430143014- if (em->start > logical || em->start + em->len < logical) {30153015+ if (em->start > logical || em->start + em->len <= logical) {30153016 btrfs_crit(fs_info,30163016- "found a bad mapping, wanted %llu-%llu, found %llu-%llu",30173017- logical, length, em->start, em->start + em->len);30173017+ "found a bad chunk map, wanted %llu-%llu, found %llu-%llu",30183018+ logical, logical + length, em->start, em->start + em->len);30183019 free_extent_map(em);30193020 return ERR_PTR(-EINVAL);30203021 }
+100
fs/debugfs/file.c
···8484 struct debugfs_fsdata *fsd;8585 void *d_fsd;86868787+ /*8888+ * This could only happen if some debugfs user erroneously calls8989+ * debugfs_file_get() on a dentry that isn't even a file, let9090+ * them know about it.9191+ */9292+ if (WARN_ON(!d_is_reg(dentry)))9393+ return -EINVAL;9494+8795 d_fsd = READ_ONCE(dentry->d_fsdata);8896 if (!((unsigned long)d_fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)) {8997 fsd = d_fsd;···108100 kfree(fsd);109101 fsd = READ_ONCE(dentry->d_fsdata);110102 }103103+#ifdef CONFIG_LOCKDEP104104+ fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);105105+ lockdep_register_key(&fsd->key);106106+ lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",107107+ &fsd->key, 0);108108+#endif109109+ INIT_LIST_HEAD(&fsd->cancellations);110110+ mutex_init(&fsd->cancellations_mtx);111111 }112112113113 /*···131115132116 if (!refcount_inc_not_zero(&fsd->active_users))133117 return -EIO;118118+119119+ lock_map_acquire_read(&fsd->lockdep_map);134120135121 return 0;136122}···151133{152134 struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);153135136136+ lock_map_release(&fsd->lockdep_map);137137+154138 if (refcount_dec_and_test(&fsd->active_users))155139 complete(&fsd->active_users_drained);156140}157141EXPORT_SYMBOL_GPL(debugfs_file_put);142142+143143+/**144144+ * debugfs_enter_cancellation - enter a debugfs cancellation145145+ * @file: the file being accessed146146+ * @cancellation: the cancellation object, the cancel callback147147+ * inside of it must be initialized148148+ *149149+ * When a debugfs file is removed it needs to wait for all active150150+ * operations to complete. However, the operation itself may need151151+ * to wait for hardware or completion of some asynchronous process152152+ * or similar. As such, it may need to be cancelled to avoid long153153+ * waits or even deadlocks.154154+ *155155+ * This function can be used inside a debugfs handler that may156156+ * need to be cancelled. As soon as this function is called, the157157+ * cancellation's 'cancel' callback may be called, at which point158158+ * the caller should proceed to call debugfs_leave_cancellation()159159+ * and leave the debugfs handler function as soon as possible.160160+ * Note that the 'cancel' callback is only ever called in the161161+ * context of some kind of debugfs_remove().162162+ *163163+ * This function must be paired with debugfs_leave_cancellation().164164+ */165165+void debugfs_enter_cancellation(struct file *file,166166+ struct debugfs_cancellation *cancellation)167167+{168168+ struct debugfs_fsdata *fsd;169169+ struct dentry *dentry = F_DENTRY(file);170170+171171+ INIT_LIST_HEAD(&cancellation->list);172172+173173+ if (WARN_ON(!d_is_reg(dentry)))174174+ return;175175+176176+ if (WARN_ON(!cancellation->cancel))177177+ return;178178+179179+ fsd = READ_ONCE(dentry->d_fsdata);180180+ if (WARN_ON(!fsd ||181181+ ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)))182182+ return;183183+184184+ mutex_lock(&fsd->cancellations_mtx);185185+ list_add(&cancellation->list, &fsd->cancellations);186186+ mutex_unlock(&fsd->cancellations_mtx);187187+188188+ /* if we're already removing wake it up to cancel */189189+ if (d_unlinked(dentry))190190+ complete(&fsd->active_users_drained);191191+}192192+EXPORT_SYMBOL_GPL(debugfs_enter_cancellation);193193+194194+/**195195+ * debugfs_leave_cancellation - leave cancellation section196196+ * @file: the file being accessed197197+ * @cancellation: the cancellation previously registered with198198+ * debugfs_enter_cancellation()199199+ *200200+ * See the documentation of debugfs_enter_cancellation().201201+ */202202+void debugfs_leave_cancellation(struct file *file,203203+ struct debugfs_cancellation *cancellation)204204+{205205+ struct debugfs_fsdata *fsd;206206+ struct dentry *dentry = F_DENTRY(file);207207+208208+ if (WARN_ON(!d_is_reg(dentry)))209209+ return;210210+211211+ fsd = READ_ONCE(dentry->d_fsdata);212212+ if (WARN_ON(!fsd ||213213+ ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)))214214+ return;215215+216216+ mutex_lock(&fsd->cancellations_mtx);217217+ if (!list_empty(&cancellation->list))218218+ list_del(&cancellation->list);219219+ mutex_unlock(&fsd->cancellations_mtx);220220+}221221+EXPORT_SYMBOL_GPL(debugfs_leave_cancellation);158222159223/*160224 * Only permit access to world-readable files when the kernel is locked down.
+63-8
fs/debugfs/inode.c
···236236237237static void debugfs_release_dentry(struct dentry *dentry)238238{239239- void *fsd = dentry->d_fsdata;239239+ struct debugfs_fsdata *fsd = dentry->d_fsdata;240240241241- if (!((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT))242242- kfree(dentry->d_fsdata);241241+ if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)242242+ return;243243+244244+ /* check it wasn't a dir (no fsdata) or automount (no real_fops) */245245+ if (fsd && fsd->real_fops) {246246+#ifdef CONFIG_LOCKDEP247247+ lockdep_unregister_key(&fsd->key);248248+ kfree(fsd->lock_name);249249+#endif250250+ WARN_ON(!list_empty(&fsd->cancellations));251251+ mutex_destroy(&fsd->cancellations_mtx);252252+ }253253+254254+ kfree(fsd);243255}244256245257static struct vfsmount *debugfs_automount(struct path *path)246258{247247- debugfs_automount_t f;248248- f = (debugfs_automount_t)path->dentry->d_fsdata;249249- return f(path->dentry, d_inode(path->dentry)->i_private);259259+ struct debugfs_fsdata *fsd = path->dentry->d_fsdata;260260+261261+ return fsd->automount(path->dentry, d_inode(path->dentry)->i_private);250262}251263252264static const struct dentry_operations debugfs_dops = {···646634 void *data)647635{648636 struct dentry *dentry = start_creating(name, parent);637637+ struct debugfs_fsdata *fsd;649638 struct inode *inode;650639651640 if (IS_ERR(dentry))652641 return dentry;653642643643+ fsd = kzalloc(sizeof(*fsd), GFP_KERNEL);644644+ if (!fsd) {645645+ failed_creating(dentry);646646+ return ERR_PTR(-ENOMEM);647647+ }648648+649649+ fsd->automount = f;650650+654651 if (!(debugfs_allow & DEBUGFS_ALLOW_API)) {655652 failed_creating(dentry);653653+ kfree(fsd);656654 return ERR_PTR(-EPERM);657655 }658656···670648 if (unlikely(!inode)) {671649 pr_err("out of free dentries, can not create automount '%s'\n",672650 name);651651+ kfree(fsd);673652 return failed_creating(dentry);674653 }675654676655 make_empty_dir_inode(inode);677656 inode->i_flags |= S_AUTOMOUNT;678657 inode->i_private = data;679679- dentry->d_fsdata = (void *)f;658658+ dentry->d_fsdata = fsd;680659 /* directory inodes start off with i_nlink == 2 (for "." entry) */681660 inc_nlink(inode);682661 d_instantiate(dentry, inode);···754731 fsd = READ_ONCE(dentry->d_fsdata);755732 if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)756733 return;757757- if (!refcount_dec_and_test(&fsd->active_users))734734+735735+ lock_map_acquire(&fsd->lockdep_map);736736+ lock_map_release(&fsd->lockdep_map);737737+738738+ /* if we hit zero, just wait for all to finish */739739+ if (!refcount_dec_and_test(&fsd->active_users)) {758740 wait_for_completion(&fsd->active_users_drained);741741+ return;742742+ }743743+744744+ /* if we didn't hit zero, try to cancel any we can */745745+ while (refcount_read(&fsd->active_users)) {746746+ struct debugfs_cancellation *c;747747+748748+ /*749749+ * Lock the cancellations. Note that the cancellations750750+ * structs are meant to be on the stack, so we need to751751+ * ensure we either use them here or don't touch them,752752+ * and debugfs_leave_cancellation() will wait for this753753+ * to be finished processing before exiting one. It may754754+ * of course win and remove the cancellation, but then755755+ * chances are we never even got into this bit, we only756756+ * do if the refcount isn't zero already.757757+ */758758+ mutex_lock(&fsd->cancellations_mtx);759759+ while ((c = list_first_entry_or_null(&fsd->cancellations,760760+ typeof(*c), list))) {761761+ list_del_init(&c->list);762762+ c->cancel(dentry, c->cancel_data);763763+ }764764+ mutex_unlock(&fsd->cancellations_mtx);765765+766766+ wait_for_completion(&fsd->active_users_drained);767767+ }759768}760769761770static void remove_one(struct dentry *victim)
···133133 idmap = mnt_idmap(path->mnt);134134 if (inode->i_op->getattr)135135 return inode->i_op->getattr(idmap, path, stat,136136- request_mask, query_flags);136136+ request_mask,137137+ query_flags | AT_GETATTR_NOSEC);137138138139 generic_fillattr(idmap, request_mask, inode, stat);139140 return 0;···166165 u32 request_mask, unsigned int query_flags)167166{168167 int retval;168168+169169+ if (WARN_ON_ONCE(query_flags & AT_GETATTR_NOSEC))170170+ return -EPERM;169171170172 retval = security_inode_getattr(path);171173 if (retval)
+26-39
fs/tracefs/event_inode.c
···2727/*2828 * eventfs_mutex protects the eventfs_inode (ei) dentry. Any access2929 * to the ei->dentry must be done under this mutex and after checking3030- * if ei->is_freed is not set. The ei->dentry is released under the3131- * mutex at the same time ei->is_freed is set. If ei->is_freed is set3232- * then the ei->dentry is invalid.3030+ * if ei->is_freed is not set. When ei->is_freed is set, the dentry3131+ * is on its way to being freed after the last dput() is made on it.3332 */3433static DEFINE_MUTEX(eventfs_mutex);35343635/*3736 * The eventfs_inode (ei) itself is protected by SRCU. It is released from3837 * its parent's list and will have is_freed set (under eventfs_mutex).3939- * After the SRCU grace period is over, the ei may be freed.3838+ * After the SRCU grace period is over and the last dput() is called3939+ * the ei is freed.4040 */4141DEFINE_STATIC_SRCU(eventfs_srcu);4242···9595 if (!(dentry->d_inode->i_mode & S_IFDIR)) {9696 if (!ei->entry_attrs) {9797 ei->entry_attrs = kzalloc(sizeof(*ei->entry_attrs) * ei->nr_entries,9898- GFP_KERNEL);9898+ GFP_NOFS);9999 if (!ei->entry_attrs) {100100 ret = -ENOMEM;101101 goto out;···326326 struct eventfs_attr *attr = NULL;327327 struct dentry **e_dentry = &ei->d_children[idx];328328 struct dentry *dentry;329329- bool invalidate = false;329329+330330+ WARN_ON_ONCE(!inode_is_locked(parent->d_inode));330331331332 mutex_lock(&eventfs_mutex);332333 if (ei->is_freed) {···349348350349 mutex_unlock(&eventfs_mutex);351350352352- /* The lookup already has the parent->d_inode locked */353353- if (!lookup)354354- inode_lock(parent->d_inode);355355-356351 dentry = create_file(name, mode, attr, parent, data, fops);357357-358358- if (!lookup)359359- inode_unlock(parent->d_inode);360352361353 mutex_lock(&eventfs_mutex);362354···359365 * created the dentry for this e_dentry. In which case360366 * use that one.361367 *362362- * Note, with the mutex held, the e_dentry cannot have content363363- * and the ei->is_freed be true at the same time.368368+ * If ei->is_freed is set, the e_dentry is currently on its369369+ * way to being freed, don't return it. If e_dentry is NULL370370+ * it means it was already freed.364371 */365365- dentry = *e_dentry;366366- if (WARN_ON_ONCE(dentry && ei->is_freed))372372+ if (ei->is_freed)367373 dentry = NULL;374374+ else375375+ dentry = *e_dentry;368376 /* The lookup does not need to up the dentry refcount */369377 if (dentry && !lookup)370378 dget(dentry);···383387 * Otherwise it means two dentries exist with the same name.384388 */385389 WARN_ON_ONCE(!ei->is_freed);386386- invalidate = true;390390+ dentry = NULL;387391 }388392 mutex_unlock(&eventfs_mutex);389393390390- if (invalidate)391391- d_invalidate(dentry);392392-393393- if (lookup || invalidate)394394+ if (lookup)394395 dput(dentry);395396396396- return invalidate ? NULL : dentry;397397+ return dentry;397398}398399399400/**···430437create_dir_dentry(struct eventfs_inode *pei, struct eventfs_inode *ei,431438 struct dentry *parent, bool lookup)432439{433433- bool invalidate = false;434440 struct dentry *dentry = NULL;441441+442442+ WARN_ON_ONCE(!inode_is_locked(parent->d_inode));435443436444 mutex_lock(&eventfs_mutex);437445 if (pei->is_freed || ei->is_freed) {···450456 }451457 mutex_unlock(&eventfs_mutex);452458453453- /* The lookup already has the parent->d_inode locked */454454- if (!lookup)455455- inode_lock(parent->d_inode);456456-457459 dentry = create_dir(ei, parent);458458-459459- if (!lookup)460460- inode_unlock(parent->d_inode);461460462461 mutex_lock(&eventfs_mutex);463462···460473 * created the dentry for this e_dentry. In which case461474 * use that one.462475 *463463- * Note, with the mutex held, the e_dentry cannot have content464464- * and the ei->is_freed be true at the same time.476476+ * If ei->is_freed is set, the e_dentry is currently on its477477+ * way to being freed.465478 */466479 dentry = ei->dentry;467480 if (dentry && !lookup)···480493 * Otherwise it means two dentries exist with the same name.481494 */482495 WARN_ON_ONCE(!ei->is_freed);483483- invalidate = true;496496+ dentry = NULL;484497 }485498 mutex_unlock(&eventfs_mutex);486486- if (invalidate)487487- d_invalidate(dentry);488499489489- if (lookup || invalidate)500500+ if (lookup)490501 dput(dentry);491502492492- return invalidate ? NULL : dentry;503503+ return dentry;493504}494505495506/**···617632{618633 struct dentry **tmp;619634620620- tmp = krealloc(*dentries, sizeof(d) * (cnt + 2), GFP_KERNEL);635635+ tmp = krealloc(*dentries, sizeof(d) * (cnt + 2), GFP_NOFS);621636 if (!tmp)622637 return -1;623638 tmp[cnt] = d;···683698 return -ENOMEM;684699 }685700701701+ inode_lock(parent->d_inode);686702 list_for_each_entry_srcu(ei_child, &ei->children, list,687703 srcu_read_lock_held(&eventfs_srcu)) {688704 d = create_dir_dentry(ei, ei_child, parent, false);···716730 cnt++;717731 }718732 }733733+ inode_unlock(parent->d_inode);719734 srcu_read_unlock(&eventfs_srcu, idx);720735 ret = dcache_dir_open(inode, file);721736
+4-9
fs/tracefs/inode.c
···509509 struct dentry *dentry;510510 int error;511511512512+ /* Must always have a parent. */513513+ if (WARN_ON_ONCE(!parent))514514+ return ERR_PTR(-EINVAL);515515+512516 error = simple_pin_fs(&trace_fs_type, &tracefs_mount,513517 &tracefs_mount_count);514518 if (error)515519 return ERR_PTR(error);516516-517517- /*518518- * If the parent is not specified, we create it in the root.519519- * We need the root dentry to do this, which is in the super520520- * block. A pointer to that is in the struct vfsmount that we521521- * have around.522522- */523523- if (!parent)524524- parent = tracefs_mount->mnt_root;525520526521 if (unlikely(IS_DEADDIR(parent->d_inode)))527522 dentry = ERR_PTR(-ENOENT);
+3-2
fs/xfs/xfs_dquot.c
···562562 struct xfs_dquot *dqp,563563 struct xfs_buf *bp)564564{565565- struct xfs_disk_dquot *ddqp = bp->b_addr + dqp->q_bufoffset;565565+ struct xfs_dqblk *dqb = xfs_buf_offset(bp, dqp->q_bufoffset);566566+ struct xfs_disk_dquot *ddqp = &dqb->dd_diskdq;566567567568 /*568569 * Ensure that we got the type and ID we were looking for.···12511250 }1252125112531252 /* Flush the incore dquot to the ondisk buffer. */12541254- dqblk = bp->b_addr + dqp->q_bufoffset;12531253+ dqblk = xfs_buf_offset(bp, dqp->q_bufoffset);12551254 xfs_dquot_to_disk(&dqblk->dd_diskdq, dqp);1256125512571256 /*
+18-3
fs/xfs/xfs_dquot_item_recover.c
···1919#include "xfs_log.h"2020#include "xfs_log_priv.h"2121#include "xfs_log_recover.h"2222+#include "xfs_error.h"22232324STATIC void2425xlog_recover_dquot_ra_pass2(···6665{6766 struct xfs_mount *mp = log->l_mp;6867 struct xfs_buf *bp;6868+ struct xfs_dqblk *dqb;6969 struct xfs_disk_dquot *ddq, *recddq;7070 struct xfs_dq_logformat *dq_f;7171 xfs_failaddr_t fa;···132130 return error;133131134132 ASSERT(bp);135135- ddq = xfs_buf_offset(bp, dq_f->qlf_boffset);133133+ dqb = xfs_buf_offset(bp, dq_f->qlf_boffset);134134+ ddq = &dqb->dd_diskdq;136135137136 /*138137 * If the dquot has an LSN in it, recover the dquot only if it's less139138 * than the lsn of the transaction we are replaying.140139 */141140 if (xfs_has_crc(mp)) {142142- struct xfs_dqblk *dqb = (struct xfs_dqblk *)ddq;143141 xfs_lsn_t lsn = be64_to_cpu(dqb->dd_lsn);144142145143 if (lsn && lsn != -1 && XFS_LSN_CMP(lsn, current_lsn) >= 0) {···149147150148 memcpy(ddq, recddq, item->ri_buf[1].i_len);151149 if (xfs_has_crc(mp)) {152152- xfs_update_cksum((char *)ddq, sizeof(struct xfs_dqblk),150150+ xfs_update_cksum((char *)dqb, sizeof(struct xfs_dqblk),153151 XFS_DQUOT_CRC_OFF);152152+ }153153+154154+ /* Validate the recovered dquot. */155155+ fa = xfs_dqblk_verify(log->l_mp, dqb, dq_f->qlf_id);156156+ if (fa) {157157+ XFS_CORRUPTION_ERROR("Bad dquot after recovery",158158+ XFS_ERRLEVEL_LOW, mp, dqb,159159+ sizeof(struct xfs_dqblk));160160+ xfs_alert(mp,161161+ "Metadata corruption detected at %pS, dquot 0x%x",162162+ fa, dq_f->qlf_id);163163+ error = -EFSCORRUPTED;164164+ goto out_release;154165 }155166156167 ASSERT(dq_f->qlf_size == 2);
+8
fs/xfs/xfs_inode.h
···569569extern void xfs_setup_iops(struct xfs_inode *ip);570570extern void xfs_diflags_to_iflags(struct xfs_inode *ip, bool init);571571572572+static inline void xfs_update_stable_writes(struct xfs_inode *ip)573573+{574574+ if (bdev_stable_writes(xfs_inode_buftarg(ip)->bt_bdev))575575+ mapping_set_stable_writes(VFS_I(ip)->i_mapping);576576+ else577577+ mapping_clear_stable_writes(VFS_I(ip)->i_mapping);578578+}579579+572580/*573581 * When setting up a newly allocated inode, we need to call574582 * xfs_finish_inode_setup() once the inode is fully instantiated at
+22-12
fs/xfs/xfs_ioctl.c
···11211121 struct fileattr *fa)11221122{11231123 struct xfs_mount *mp = ip->i_mount;11241124+ bool rtflag = (fa->fsx_xflags & FS_XFLAG_REALTIME);11241125 uint64_t i_flags2;1125112611261126- /* Can't change realtime flag if any extents are allocated. */11271127- if ((ip->i_df.if_nextents || ip->i_delayed_blks) &&11281128- XFS_IS_REALTIME_INODE(ip) != (fa->fsx_xflags & FS_XFLAG_REALTIME))11291129- return -EINVAL;11301130-11311131- /* If realtime flag is set then must have realtime device */11321132- if (fa->fsx_xflags & FS_XFLAG_REALTIME) {11331133- if (mp->m_sb.sb_rblocks == 0 || mp->m_sb.sb_rextsize == 0 ||11341134- xfs_extlen_to_rtxmod(mp, ip->i_extsize))11271127+ if (rtflag != XFS_IS_REALTIME_INODE(ip)) {11281128+ /* Can't change realtime flag if any extents are allocated. */11291129+ if (ip->i_df.if_nextents || ip->i_delayed_blks)11351130 return -EINVAL;11361131 }1137113211381138- /* Clear reflink if we are actually able to set the rt flag. */11391139- if ((fa->fsx_xflags & FS_XFLAG_REALTIME) && xfs_is_reflink_inode(ip))11401140- ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK;11331133+ if (rtflag) {11341134+ /* If realtime flag is set then must have realtime device */11351135+ if (mp->m_sb.sb_rblocks == 0 || mp->m_sb.sb_rextsize == 0 ||11361136+ xfs_extlen_to_rtxmod(mp, ip->i_extsize))11371137+ return -EINVAL;11381138+11391139+ /* Clear reflink if we are actually able to set the rt flag. */11401140+ if (xfs_is_reflink_inode(ip))11411141+ ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK;11421142+ }1141114311421144 /* diflags2 only valid for v3 inodes. */11431145 i_flags2 = xfs_flags2diflags2(ip, fa->fsx_xflags);···11501148 ip->i_diflags2 = i_flags2;1151114911521150 xfs_diflags_to_iflags(ip, false);11511151+11521152+ /*11531153+ * Make the stable writes flag match that of the device the inode11541154+ * resides on when flipping the RT flag.11551155+ */11561156+ if (rtflag != XFS_IS_REALTIME_INODE(ip) && S_ISREG(VFS_I(ip)->i_mode))11571157+ xfs_update_stable_writes(ip);11581158+11531159 xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG);11541160 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);11551161 XFS_STATS_INC(mp, xs_ig_attrchg);
+7
fs/xfs/xfs_iops.c
···12991299 mapping_set_gfp_mask(inode->i_mapping, (gfp_mask & ~(__GFP_FS)));1300130013011301 /*13021302+ * For real-time inodes update the stable write flags to that of the RT13031303+ * device instead of the data device.13041304+ */13051305+ if (S_ISREG(inode->i_mode) && XFS_IS_REALTIME_INODE(ip))13061306+ xfs_update_stable_writes(ip);13071307+13081308+ /*13021309 * If there is no attribute fork no ACL can exist on this inode,13031310 * and it can't have any file capabilities attached to it either.13041311 */
···93029302 */93039303void cfg80211_links_removed(struct net_device *dev, u16 link_mask);9304930493059305+#ifdef CONFIG_CFG80211_DEBUGFS93069306+/**93079307+ * wiphy_locked_debugfs_read - do a locked read in debugfs93089308+ * @wiphy: the wiphy to use93099309+ * @file: the file being read93109310+ * @buf: the buffer to fill and then read from93119311+ * @bufsize: size of the buffer93129312+ * @userbuf: the user buffer to copy to93139313+ * @count: read count93149314+ * @ppos: read position93159315+ * @handler: the read handler to call (under wiphy lock)93169316+ * @data: additional data to pass to the read handler93179317+ */93189318+ssize_t wiphy_locked_debugfs_read(struct wiphy *wiphy, struct file *file,93199319+ char *buf, size_t bufsize,93209320+ char __user *userbuf, size_t count,93219321+ loff_t *ppos,93229322+ ssize_t (*handler)(struct wiphy *wiphy,93239323+ struct file *file,93249324+ char *buf,93259325+ size_t bufsize,93269326+ void *data),93279327+ void *data);93289328+93299329+/**93309330+ * wiphy_locked_debugfs_write - do a locked write in debugfs93319331+ * @wiphy: the wiphy to use93329332+ * @file: the file being written to93339333+ * @buf: the buffer to copy the user data to93349334+ * @bufsize: size of the buffer93359335+ * @userbuf: the user buffer to copy from93369336+ * @count: read count93379337+ * @handler: the write handler to call (under wiphy lock)93389338+ * @data: additional data to pass to the write handler93399339+ */93409340+ssize_t wiphy_locked_debugfs_write(struct wiphy *wiphy, struct file *file,93419341+ char *buf, size_t bufsize,93429342+ const char __user *userbuf, size_t count,93439343+ ssize_t (*handler)(struct wiphy *wiphy,93449344+ struct file *file,93459345+ char *buf,93469346+ size_t count,93479347+ void *data),93489348+ void *data);93499349+#endif93509350+93059351#endif /* __NET_CFG80211_H */
···116116#define AT_HANDLE_FID AT_REMOVEDIR /* file handle is needed to117117 compare object identity and may not118118 be usable to open_by_handle_at(2) */119119+#if defined(__KERNEL__)120120+#define AT_GETATTR_NOSEC 0x80000000121121+#endif119122120123#endif /* _UAPI_LINUX_FCNTL_H */
+1-1
include/uapi/linux/v4l2-subdev.h
···239239 * set (which is the default), the 'stream' fields will be forced to 0 by the240240 * kernel.241241 */242242- #define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1U << 0)242242+ #define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0)243243244244/**245245 * struct v4l2_subdev_client_capability - Capabilities of the client accessing
···12581258 */12591259 const struct bio_vec *bvec = imu->bvec;1260126012611261- if (offset <= bvec->bv_len) {12611261+ if (offset < bvec->bv_len) {12621262 /*12631263 * Note, huge pages buffers consists of one large12641264 * bvec entry and should always go this way. The other
···409409 void *kaddr = kmap_local_page(page);410410 size_t n = min(bytes, (size_t)PAGE_SIZE - offset);411411412412- n = iterate_and_advance(i, bytes, kaddr,412412+ n = iterate_and_advance(i, n, kaddr + offset,413413 copy_to_user_iter_nofault,414414 memcpy_to_iter);415415 kunmap_local(kaddr);
+1-1
mm/page-writeback.c
···31073107 */31083108void folio_wait_stable(struct folio *folio)31093109{31103110- if (folio_inode(folio)->i_sb->s_iflags & SB_I_STABLE_WRITES)31103110+ if (mapping_stable_writes(folio_mapping(folio)))31113111 folio_wait_writeback(folio);31123112}31133113EXPORT_SYMBOL_GPL(folio_wait_stable);
+2
net/core/skmsg.c
···826826827827 if (psock->sk_redir)828828 sock_put(psock->sk_redir);829829+ if (psock->sk_pair)830830+ sock_put(psock->sk_pair);829831 sock_put(psock->sk);830832 kfree(psock);831833}
···216216 int tv = get_random_u32_below(max_delay);217217218218 im->tm_running = 1;219219- if (!mod_timer(&im->timer, jiffies+tv+2))220220- refcount_inc(&im->refcnt);219219+ if (refcount_inc_not_zero(&im->refcnt)) {220220+ if (mod_timer(&im->timer, jiffies + tv + 2))221221+ ip_ma_put(im);222222+ }221223}222224223225static void igmp_gq_start_timer(struct in_device *in_dev)
+1-1
net/mac80211/Kconfig
···88888989config MAC80211_DEBUGFS9090 bool "Export mac80211 internals in DebugFS"9191- depends on MAC80211 && DEBUG_FS9191+ depends on MAC80211 && CFG80211_DEBUGFS9292 help9393 Select this to see extensive information about9494 the internal state of mac80211 in debugfs.
···271271 case NL80211_CHAN_WIDTH_80:272272 case NL80211_CHAN_WIDTH_80P80:273273 case NL80211_CHAN_WIDTH_160:274274+ case NL80211_CHAN_WIDTH_320:274275 bw = ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?275276 IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20;276277 break;
···75757676/* We now return you to your regularly scheduled HPUX. */77777878-#define ENOSYM 215 /* symbol does not exist in executable */7978#define ENOTSOCK 216 /* Socket operation on non-socket */8079#define EDESTADDRREQ 217 /* Destination address required */8180#define EMSGSIZE 218 /* Message too long */···100101#define ETIMEDOUT 238 /* Connection timed out */101102#define ECONNREFUSED 239 /* Connection refused */102103#define EREFUSED ECONNREFUSED /* for HP's NFS apparently */103103-#define EREMOTERELEASE 240 /* Remote peer released connection */104104#define EHOSTDOWN 241 /* Host is down */105105#define EHOSTUNREACH 242 /* No route to host */106106
···41514151 elif(re.match('Enabling non-boot CPUs .*', msg)):41524152 # start of first cpu resume41534153 cpu_start = ktime41544154- elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)) \41544154+ elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg) \41554155 or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):41564156 # end of a cpu suspend, start of the next41574157 m = re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)
+1-1
tools/testing/selftests/arm64/fp/za-fork.c
···8585 */8686 ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);8787 if (ret >= 0) {8888- ksft_test_result(fork_test(), "fork_test");8888+ ksft_test_result(fork_test(), "fork_test\n");89899090 } else {9191 ksft_print_msg("SME not supported\n");