Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Anbernic RG-DS AW87391 Speaker Amps

Merge series from Chris Morgan <macroalpha82@gmail.com>:

Add support for the Anbernic RG-DS Speaker Amplifiers. The Anbernic
RG-DS uses two AW87391 ICs at 0x58 and 0x5B on i2c2. However, the
manufacturer did not provide a firmware file, only a sequence of
register writes to each device to enable and disable them.

Add support for this *specific* configuration in the AW87390 driver.
Since we are relying on a device specific sequence I am using a
device specific compatible string. This driver does not currently
support the aw87391 for any other device as I have none to test
with valid firmware. Attempts to create firmware with the AwinicSCPv4
have not been successful.

+1554 -828
+1
.mailmap
··· 851 851 Veera Sundaram Sankaran <quic_veeras@quicinc.com> <veeras@codeaurora.org> 852 852 Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com> <vbadigan@codeaurora.org> 853 853 Venkateswara Naralasetty <quic_vnaralas@quicinc.com> <vnaralas@codeaurora.org> 854 + Viacheslav Bocharov <v@baodeep.com> <adeep@lexina.in> 854 855 Vikash Garodia <vikash.garodia@oss.qualcomm.com> <vgarodia@codeaurora.org> 855 856 Vikash Garodia <vikash.garodia@oss.qualcomm.com> <quic_vgarodia@quicinc.com> 856 857 Vincent Mailhol <mailhol@kernel.org> <mailhol.vincent@wanadoo.fr>
+2
Documentation/admin-guide/sysctl/vm.rst
··· 231 231 inode is old enough to be eligible for writeback by the kernel flusher threads. 232 232 And, it is also used as the interval to wakeup dirtytime_writeback thread. 233 233 234 + Setting this to zero disables periodic dirtytime writeback. 235 + 234 236 235 237 dirty_writeback_centisecs 236 238 =========================
+1 -1
Documentation/devicetree/bindings/pinctrl/marvell,armada3710-xb-pinctrl.yaml
··· 88 88 pcie1_clkreq, pcie1_wakeup, pmic0, pmic1, ptp, ptp_clk, 89 89 ptp_trig, pwm0, pwm1, pwm2, pwm3, rgmii, sdio0, sdio_sb, smi, 90 90 spi_cs1, spi_cs2, spi_cs3, spi_quad, uart1, uart2, 91 - usb2_drvvbus1, usb32_drvvbus ] 91 + usb2_drvvbus1, usb32_drvvbus0 ] 92 92 93 93 function: 94 94 enum: [ drvbus, emmc, gpio, i2c, jtag, led, mii, mii_err, onewire,
+29 -5
Documentation/devicetree/bindings/sound/awinic,aw87390.yaml
··· 15 15 sound quallity, which is a new high efficiency, low 16 16 noise, constant large volume, 6th Smart K audio amplifier. 17 17 18 - allOf: 19 - - $ref: dai-common.yaml# 20 - 21 18 properties: 22 19 compatible: 23 - const: awinic,aw87390 20 + oneOf: 21 + - enum: 22 + - awinic,aw87390 23 + - items: 24 + - enum: 25 + - anbernic,rgds-amp 26 + - const: awinic,aw87391 24 27 25 28 reg: 26 29 maxItems: 1 ··· 43 40 - compatible 44 41 - reg 45 42 - "#sound-dai-cells" 46 - - awinic,audio-channel 47 43 48 44 unevaluatedProperties: false 45 + 46 + allOf: 47 + - $ref: dai-common.yaml# 48 + - if: 49 + properties: 50 + compatible: 51 + contains: 52 + enum: 53 + - awinic,aw87390 54 + then: 55 + required: 56 + - awinic,audio-channel 57 + 58 + - if: 59 + properties: 60 + compatible: 61 + contains: 62 + enum: 63 + - anbernic,rgds-amp 64 + then: 65 + properties: 66 + vdd-supply: true 49 67 50 68 examples: 51 69 - |
+1
Documentation/devicetree/bindings/sound/fsl,sai.yaml
··· 44 44 - items: 45 45 - enum: 46 46 - fsl,imx94-sai 47 + - fsl,imx952-sai 47 48 - const: fsl,imx95-sai 48 49 49 50 reg:
-1
MAINTAINERS
··· 9260 9260 EMULEX 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER (be2net) 9261 9261 M: Ajit Khaparde <ajit.khaparde@broadcom.com> 9262 9262 M: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> 9263 - M: Somnath Kotur <somnath.kotur@broadcom.com> 9264 9263 L: netdev@vger.kernel.org 9265 9264 S: Maintained 9266 9265 W: http://www.emulex.com
+3 -2
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 19 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc7 5 + EXTRAVERSION = -rc8 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION* ··· 1624 1624 certs/x509.genkey \ 1625 1625 vmlinux-gdb.py \ 1626 1626 rpmbuild \ 1627 - rust/libmacros.so rust/libmacros.dylib 1627 + rust/libmacros.so rust/libmacros.dylib \ 1628 + rust/libpin_init_internal.so rust/libpin_init_internal.dylib 1628 1629 1629 1630 # clean - Delete most, but leave enough to build external modules 1630 1631 #
-1
arch/arm64/configs/defconfig
··· 670 670 CONFIG_PINCTRL_SC7280_LPASS_LPI=m 671 671 CONFIG_PINCTRL_SM6115_LPASS_LPI=m 672 672 CONFIG_PINCTRL_SM8250_LPASS_LPI=m 673 - CONFIG_PINCTRL_SM8350_LPASS_LPI=m 674 673 CONFIG_PINCTRL_SM8450_LPASS_LPI=m 675 674 CONFIG_PINCTRL_SC8280XP_LPASS_LPI=m 676 675 CONFIG_PINCTRL_SM8550_LPASS_LPI=m
+1 -1
arch/powerpc/kvm/book3s_hv_uvmem.c
··· 723 723 724 724 dpage = pfn_to_page(uvmem_pfn); 725 725 dpage->zone_device_data = pvt; 726 - zone_device_page_init(dpage, 0); 726 + zone_device_page_init(dpage, &kvmppc_uvmem_pgmap, 0); 727 727 return dpage; 728 728 out_clear: 729 729 spin_lock(&kvmppc_uvmem_bitmap_lock);
-18
arch/riscv/errata/sifive/errata.c
··· 75 75 return cpu_req_errata; 76 76 } 77 77 78 - static void __init_or_module warn_miss_errata(u32 miss_errata) 79 - { 80 - int i; 81 - 82 - pr_warn("----------------------------------------------------------------\n"); 83 - pr_warn("WARNING: Missing the following errata may cause potential issues\n"); 84 - for (i = 0; i < ERRATA_SIFIVE_NUMBER; i++) 85 - if (miss_errata & 0x1 << i) 86 - pr_warn("\tSiFive Errata[%d]:%s\n", i, errata_list[i].name); 87 - pr_warn("Please enable the corresponding Kconfig to apply them\n"); 88 - pr_warn("----------------------------------------------------------------\n"); 89 - } 90 - 91 78 void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, 92 79 unsigned long archid, unsigned long impid, 93 80 unsigned int stage) 94 81 { 95 82 struct alt_entry *alt; 96 83 u32 cpu_req_errata; 97 - u32 cpu_apply_errata = 0; 98 84 u32 tmp; 99 85 100 86 BUILD_BUG_ON(ERRATA_SIFIVE_NUMBER >= RISCV_VENDOR_EXT_ALTERNATIVES_BASE); ··· 104 118 patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt), 105 119 alt->alt_len); 106 120 mutex_unlock(&text_mutex); 107 - cpu_apply_errata |= tmp; 108 121 } 109 122 } 110 - if (stage != RISCV_ALTERNATIVES_MODULE && 111 - cpu_apply_errata != cpu_req_errata) 112 - warn_miss_errata(cpu_req_errata - cpu_apply_errata); 113 123 }
+1 -1
arch/riscv/include/asm/compat.h
··· 2 2 #ifndef __ASM_COMPAT_H 3 3 #define __ASM_COMPAT_H 4 4 5 - #define COMPAT_UTS_MACHINE "riscv\0\0" 5 + #define COMPAT_UTS_MACHINE "riscv32\0\0" 6 6 7 7 /* 8 8 * Architecture specific compatibility types
+1 -1
arch/riscv/include/asm/syscall.h
··· 20 20 extern void * const compat_sys_call_table[]; 21 21 22 22 /* 23 - * Only the low 32 bits of orig_r0 are meaningful, so we return int. 23 + * Only the low 32 bits of orig_a0 are meaningful, so we return int. 24 24 * This importantly ignores the high bits on 64-bit, so comparisons 25 25 * sign-extend the low 32 bits. 26 26 */
+3 -3
arch/riscv/kernel/signal.c
··· 145 145 long (*save)(struct pt_regs *regs, void __user *sc_vec); 146 146 }; 147 147 148 - struct arch_ext_priv arch_ext_list[] = { 148 + static struct arch_ext_priv arch_ext_list[] = { 149 149 { 150 150 .magic = RISCV_V_MAGIC, 151 151 .save = &save_v_state, 152 152 }, 153 153 }; 154 154 155 - const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list); 155 + static const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list); 156 156 157 157 static long restore_sigcontext(struct pt_regs *regs, 158 158 struct sigcontext __user *sc) ··· 297 297 } else { 298 298 err |= __put_user(arch_ext->magic, &sc_ext_ptr->magic); 299 299 err |= __put_user(ext_size, &sc_ext_ptr->size); 300 - sc_ext_ptr = (void *)sc_ext_ptr + ext_size; 300 + sc_ext_ptr = (void __user *)sc_ext_ptr + ext_size; 301 301 } 302 302 } 303 303 /* Write zero to fp-reserved space and check it on restore_sigcontext */
+1
drivers/block/rnbd/rnbd-clt.c
··· 1662 1662 /* To avoid deadlock firstly remove itself */ 1663 1663 sysfs_remove_file_self(&dev->kobj, sysfs_self); 1664 1664 kobject_del(&dev->kobj); 1665 + kobject_put(&dev->kobj); 1665 1666 } 1666 1667 } 1667 1668
+2 -2
drivers/bluetooth/hci_ldisc.c
··· 685 685 return err; 686 686 } 687 687 688 + set_bit(HCI_UART_PROTO_INIT, &hu->flags); 689 + 688 690 if (test_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags)) 689 691 return 0; 690 692 ··· 713 711 return -EPROTONOSUPPORT; 714 712 715 713 hu->proto = p; 716 - 717 - set_bit(HCI_UART_PROTO_INIT, &hu->flags); 718 714 719 715 err = hci_uart_register_dev(hu); 720 716 if (err) {
+6
drivers/bus/simple-pm-bus.c
··· 142 142 { .compatible = "simple-mfd", .data = ONLY_BUS }, 143 143 { .compatible = "isa", .data = ONLY_BUS }, 144 144 { .compatible = "arm,amba-bus", .data = ONLY_BUS }, 145 + { .compatible = "fsl,ls1021a-scfg", }, 146 + { .compatible = "fsl,ls1043a-scfg", }, 147 + { .compatible = "fsl,ls1046a-scfg", }, 148 + { .compatible = "fsl,ls1088a-isc", }, 149 + { .compatible = "fsl,ls2080a-isc", }, 150 + { .compatible = "fsl,lx2160a-isc", }, 145 151 { /* sentinel */ } 146 152 }; 147 153 MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match);
+1
drivers/cpufreq/qcom-cpufreq-nvmem.c
··· 263 263 { .compatible = "qcom,ipq8066", .data = (const void *)QCOM_ID_IPQ8066 }, 264 264 { .compatible = "qcom,ipq8068", .data = (const void *)QCOM_ID_IPQ8068 }, 265 265 { .compatible = "qcom,ipq8069", .data = (const void *)QCOM_ID_IPQ8069 }, 266 + { /* sentinel */ } 266 267 }; 267 268 268 269 static int qcom_cpufreq_ipq8064_name_version(struct device *cpu_dev,
+10 -9
drivers/firewire/core-transaction.c
··· 173 173 } 174 174 } 175 175 176 - static void start_split_transaction_timeout(struct fw_transaction *t, 177 - struct fw_card *card) 176 + // card->transactions.lock should be acquired in advance for the linked list. 177 + static void start_split_transaction_timeout(struct fw_transaction *t, unsigned int delta) 178 178 { 179 - unsigned long delta; 180 - 181 179 if (list_empty(&t->link) || WARN_ON(t->is_split_transaction)) 182 180 return; 183 181 184 182 t->is_split_transaction = true; 185 183 186 - // NOTE: This can be without irqsave when we can guarantee that __fw_send_request() for 187 - // local destination never runs in any type of IRQ context. 188 - scoped_guard(spinlock_irqsave, &card->split_timeout.lock) 189 - delta = card->split_timeout.jiffies; 190 184 mod_timer(&t->split_timeout_timer, jiffies + delta); 191 185 } 192 186 ··· 201 207 break; 202 208 case ACK_PENDING: 203 209 { 210 + unsigned int delta; 211 + 204 212 // NOTE: This can be without irqsave when we can guarantee that __fw_send_request() for 205 213 // local destination never runs in any type of IRQ context. 206 214 scoped_guard(spinlock_irqsave, &card->split_timeout.lock) { 207 215 t->split_timeout_cycle = 208 216 compute_split_timeout_timestamp(card, packet->timestamp) & 0xffff; 217 + delta = card->split_timeout.jiffies; 209 218 } 210 - start_split_transaction_timeout(t, card); 219 + 220 + // NOTE: This can be without irqsave when we can guarantee that __fw_send_request() for 221 + // local destination never runs in any type of IRQ context. 222 + scoped_guard(spinlock_irqsave, &card->transactions.lock) 223 + start_split_transaction_timeout(t, delta); 211 224 break; 212 225 } 213 226 case ACK_BUSY_X:
+3 -5
drivers/gpio/gpio-brcmstb.c
··· 301 301 struct brcmstb_gpio_priv *priv, irq_hw_number_t hwirq) 302 302 { 303 303 struct brcmstb_gpio_bank *bank; 304 - int i = 0; 305 304 306 - /* banks are in descending order */ 307 - list_for_each_entry_reverse(bank, &priv->bank_list, node) { 308 - i += bank->chip.gc.ngpio; 309 - if (hwirq < i) 305 + list_for_each_entry(bank, &priv->bank_list, node) { 306 + if (hwirq >= bank->chip.gc.offset && 307 + hwirq < (bank->chip.gc.offset + bank->chip.gc.ngpio)) 310 308 return bank; 311 309 } 312 310 return NULL;
+18 -4
drivers/gpio/gpio-omap.c
··· 799 799 800 800 static inline void omap_mpuio_init(struct gpio_bank *bank) 801 801 { 802 - platform_set_drvdata(&omap_mpuio_device, bank); 802 + static bool registered; 803 803 804 - if (platform_driver_register(&omap_mpuio_driver) == 0) 805 - (void) platform_device_register(&omap_mpuio_device); 804 + platform_set_drvdata(&omap_mpuio_device, bank); 805 + if (!registered) { 806 + (void)platform_device_register(&omap_mpuio_device); 807 + registered = true; 808 + } 806 809 } 807 810 808 811 /*---------------------------------------------------------------------*/ ··· 1578 1575 */ 1579 1576 static int __init omap_gpio_drv_reg(void) 1580 1577 { 1581 - return platform_driver_register(&omap_gpio_driver); 1578 + int ret; 1579 + 1580 + ret = platform_driver_register(&omap_mpuio_driver); 1581 + if (ret) 1582 + return ret; 1583 + 1584 + ret = platform_driver_register(&omap_gpio_driver); 1585 + if (ret) 1586 + platform_driver_unregister(&omap_mpuio_driver); 1587 + 1588 + return ret; 1582 1589 } 1583 1590 postcore_initcall(omap_gpio_drv_reg); 1584 1591 1585 1592 static void __exit omap_gpio_exit(void) 1586 1593 { 1587 1594 platform_driver_unregister(&omap_gpio_driver); 1595 + platform_driver_unregister(&omap_mpuio_driver); 1588 1596 } 1589 1597 module_exit(omap_gpio_exit); 1590 1598
+2
drivers/gpio/gpio-pca953x.c
··· 914 914 clear_bit(hwirq, chip->irq_trig_fall); 915 915 clear_bit(hwirq, chip->irq_trig_level_low); 916 916 clear_bit(hwirq, chip->irq_trig_level_high); 917 + 918 + pca953x_irq_mask(d); 917 919 } 918 920 919 921 static void pca953x_irq_print_chip(struct irq_data *data, struct seq_file *p)
-8
drivers/gpio/gpio-rockchip.c
··· 18 18 #include <linux/of.h> 19 19 #include <linux/of_address.h> 20 20 #include <linux/of_irq.h> 21 - #include <linux/pinctrl/consumer.h> 22 21 #include <linux/pinctrl/pinconf-generic.h> 23 22 #include <linux/platform_device.h> 24 23 #include <linux/regmap.h> ··· 162 163 struct rockchip_pin_bank *bank = gpiochip_get_data(chip); 163 164 unsigned long flags; 164 165 u32 data = input ? 0 : 1; 165 - 166 - 167 - if (input) 168 - pinctrl_gpio_direction_input(chip, offset); 169 - else 170 - pinctrl_gpio_direction_output(chip, offset); 171 166 172 167 raw_spin_lock_irqsave(&bank->slock, flags); 173 168 rockchip_gpio_writel_bit(bank, offset, data, bank->gpio_regs->port_ddr); ··· 586 593 gc->ngpio = bank->nr_pins; 587 594 gc->label = bank->name; 588 595 gc->parent = bank->dev; 589 - gc->can_sleep = true; 590 596 591 597 ret = gpiochip_add_data(gc, bank); 592 598 if (ret) {
+4 -4
drivers/gpio/gpio-sprd.c
··· 35 35 struct sprd_gpio { 36 36 struct gpio_chip chip; 37 37 void __iomem *base; 38 - spinlock_t lock; 38 + raw_spinlock_t lock; 39 39 int irq; 40 40 }; 41 41 ··· 54 54 unsigned long flags; 55 55 u32 tmp; 56 56 57 - spin_lock_irqsave(&sprd_gpio->lock, flags); 57 + raw_spin_lock_irqsave(&sprd_gpio->lock, flags); 58 58 tmp = readl_relaxed(base + reg); 59 59 60 60 if (val) ··· 63 63 tmp &= ~BIT(SPRD_GPIO_BIT(offset)); 64 64 65 65 writel_relaxed(tmp, base + reg); 66 - spin_unlock_irqrestore(&sprd_gpio->lock, flags); 66 + raw_spin_unlock_irqrestore(&sprd_gpio->lock, flags); 67 67 } 68 68 69 69 static int sprd_gpio_read(struct gpio_chip *chip, unsigned int offset, u16 reg) ··· 236 236 if (IS_ERR(sprd_gpio->base)) 237 237 return PTR_ERR(sprd_gpio->base); 238 238 239 - spin_lock_init(&sprd_gpio->lock); 239 + raw_spin_lock_init(&sprd_gpio->lock); 240 240 241 241 sprd_gpio->chip.label = dev_name(&pdev->dev); 242 242 sprd_gpio->chip.ngpio = SPRD_GPIO_NR;
+4 -4
drivers/gpio/gpio-virtuser.c
··· 1682 1682 { 1683 1683 struct gpio_virtuser_device *dev = to_gpio_virtuser_device(item); 1684 1684 1685 - guard(mutex)(&dev->lock); 1686 - 1687 - if (gpio_virtuser_device_is_live(dev)) 1688 - gpio_virtuser_device_deactivate(dev); 1685 + scoped_guard(mutex, &dev->lock) { 1686 + if (gpio_virtuser_device_is_live(dev)) 1687 + gpio_virtuser_device_deactivate(dev); 1688 + } 1689 1689 1690 1690 mutex_destroy(&dev->lock); 1691 1691 ida_free(&gpio_virtuser_ida, dev->id);
+17 -4
drivers/gpio/gpiolib-acpi-core.c
··· 1104 1104 unsigned int pin = agpio->pin_table[i]; 1105 1105 struct acpi_gpio_connection *conn; 1106 1106 struct gpio_desc *desc; 1107 + u16 word, shift; 1107 1108 bool found; 1108 1109 1109 1110 mutex_lock(&achip->conn_lock); ··· 1159 1158 1160 1159 mutex_unlock(&achip->conn_lock); 1161 1160 1162 - if (function == ACPI_WRITE) 1163 - gpiod_set_raw_value_cansleep(desc, !!(*value & BIT(i))); 1164 - else 1165 - *value |= (u64)gpiod_get_raw_value_cansleep(desc) << i; 1161 + /* 1162 + * For the cases when OperationRegion() consists of more than 1163 + * 64 bits calculate the word and bit shift to use that one to 1164 + * access the value. 1165 + */ 1166 + word = i / 64; 1167 + shift = i % 64; 1168 + 1169 + if (function == ACPI_WRITE) { 1170 + gpiod_set_raw_value_cansleep(desc, value[word] & BIT_ULL(shift)); 1171 + } else { 1172 + if (gpiod_get_raw_value_cansleep(desc)) 1173 + value[word] |= BIT_ULL(shift); 1174 + else 1175 + value[word] &= ~BIT_ULL(shift); 1176 + } 1166 1177 } 1167 1178 1168 1179 out:
+6 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
··· 498 498 499 499 if (adev->irq.retry_cam_enabled) 500 500 return; 501 + else if (adev->irq.ih1.ring_size) 502 + ih = &adev->irq.ih1; 503 + else if (adev->irq.ih_soft.enabled) 504 + ih = &adev->irq.ih_soft; 505 + else 506 + return; 501 507 502 - ih = &adev->irq.ih1; 503 508 /* Get the WPTR of the last entry in IH ring */ 504 509 last_wptr = amdgpu_ih_get_wptr(adev, ih); 505 510 /* Order wptr with ring data. */
+3 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
··· 235 235 236 236 amdgpu_ring_ib_begin(ring); 237 237 238 - if (ring->funcs->emit_gfx_shadow) 238 + if (ring->funcs->emit_gfx_shadow && adev->gfx.cp_gfx_shadow) 239 239 amdgpu_ring_emit_gfx_shadow(ring, shadow_va, csa_va, gds_va, 240 240 init_shadow, vmid); 241 241 ··· 291 291 fence_flags | AMDGPU_FENCE_FLAG_64BIT); 292 292 } 293 293 294 - if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec) { 294 + if (ring->funcs->emit_gfx_shadow && ring->funcs->init_cond_exec && 295 + adev->gfx.cp_gfx_shadow) { 295 296 amdgpu_ring_emit_gfx_shadow(ring, 0, 0, 0, false, 0); 296 297 amdgpu_ring_init_cond_exec(ring, ring->cond_exe_gpu_addr); 297 298 }
+1 -1
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
··· 6879 6879 memcpy_toio(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); 6880 6880 /* reset the ring */ 6881 6881 ring->wptr = 0; 6882 - *ring->wptr_cpu_addr = 0; 6882 + atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0); 6883 6883 amdgpu_ring_clear_ring(ring); 6884 6884 } 6885 6885
+14 -11
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 4201 4201 memcpy_toio(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); 4202 4202 /* reset the ring */ 4203 4203 ring->wptr = 0; 4204 - *ring->wptr_cpu_addr = 0; 4204 + atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0); 4205 4205 amdgpu_ring_clear_ring(ring); 4206 4206 } 4207 4207 ··· 6823 6823 struct amdgpu_fence *timedout_fence) 6824 6824 { 6825 6825 struct amdgpu_device *adev = ring->adev; 6826 + bool use_mmio = false; 6826 6827 int r; 6827 6828 6828 6829 amdgpu_ring_reset_helper_begin(ring, timedout_fence); 6829 6830 6830 - r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, false); 6831 + r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, use_mmio); 6831 6832 if (r) { 6832 6833 6833 6834 dev_warn(adev->dev, "reset via MES failed and try pipe reset %d\n", r); ··· 6837 6836 return r; 6838 6837 } 6839 6838 6840 - r = gfx_v11_0_kgq_init_queue(ring, true); 6841 - if (r) { 6842 - dev_err(adev->dev, "failed to init kgq\n"); 6843 - return r; 6844 - } 6839 + if (use_mmio) { 6840 + r = gfx_v11_0_kgq_init_queue(ring, true); 6841 + if (r) { 6842 + dev_err(adev->dev, "failed to init kgq\n"); 6843 + return r; 6844 + } 6845 6845 6846 - r = amdgpu_mes_map_legacy_queue(adev, ring); 6847 - if (r) { 6848 - dev_err(adev->dev, "failed to remap kgq\n"); 6849 - return r; 6846 + r = amdgpu_mes_map_legacy_queue(adev, ring); 6847 + if (r) { 6848 + dev_err(adev->dev, "failed to remap kgq\n"); 6849 + return r; 6850 + } 6850 6851 } 6851 6852 6852 6853 return amdgpu_ring_reset_helper_end(ring, timedout_fence);
+14 -11
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
··· 3079 3079 memcpy_toio(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); 3080 3080 /* reset the ring */ 3081 3081 ring->wptr = 0; 3082 - *ring->wptr_cpu_addr = 0; 3082 + atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0); 3083 3083 amdgpu_ring_clear_ring(ring); 3084 3084 } 3085 3085 ··· 5297 5297 struct amdgpu_fence *timedout_fence) 5298 5298 { 5299 5299 struct amdgpu_device *adev = ring->adev; 5300 + bool use_mmio = false; 5300 5301 int r; 5301 5302 5302 5303 amdgpu_ring_reset_helper_begin(ring, timedout_fence); 5303 5304 5304 - r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, false); 5305 + r = amdgpu_mes_reset_legacy_queue(ring->adev, ring, vmid, use_mmio); 5305 5306 if (r) { 5306 5307 dev_warn(adev->dev, "reset via MES failed and try pipe reset %d\n", r); 5307 5308 r = gfx_v12_reset_gfx_pipe(ring); ··· 5310 5309 return r; 5311 5310 } 5312 5311 5313 - r = gfx_v12_0_kgq_init_queue(ring, true); 5314 - if (r) { 5315 - dev_err(adev->dev, "failed to init kgq\n"); 5316 - return r; 5317 - } 5312 + if (use_mmio) { 5313 + r = gfx_v12_0_kgq_init_queue(ring, true); 5314 + if (r) { 5315 + dev_err(adev->dev, "failed to init kgq\n"); 5316 + return r; 5317 + } 5318 5318 5319 - r = amdgpu_mes_map_legacy_queue(adev, ring); 5320 - if (r) { 5321 - dev_err(adev->dev, "failed to remap kgq\n"); 5322 - return r; 5319 + r = amdgpu_mes_map_legacy_queue(adev, ring); 5320 + if (r) { 5321 + dev_err(adev->dev, "failed to remap kgq\n"); 5322 + return r; 5323 + } 5323 5324 } 5324 5325 5325 5326 return amdgpu_ring_reset_helper_end(ring, timedout_fence);
+7 -1
drivers/gpu/drm/amd/amdgpu/soc21.c
··· 225 225 226 226 static u32 soc21_get_xclk(struct amdgpu_device *adev) 227 227 { 228 - return adev->clock.spll.reference_freq; 228 + u32 reference_clock = adev->clock.spll.reference_freq; 229 + 230 + /* reference clock is actually 99.81 Mhz rather than 100 Mhz */ 231 + if ((adev->flags & AMD_IS_APU) && reference_clock == 10000) 232 + return 9981; 233 + 234 + return reference_clock; 229 235 } 230 236 231 237
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
··· 217 217 page = pfn_to_page(pfn); 218 218 svm_range_bo_ref(prange->svm_bo); 219 219 page->zone_device_data = prange->svm_bo; 220 - zone_device_page_init(page, 0); 220 + zone_device_page_init(page, page_pgmap(page), 0); 221 221 } 222 222 223 223 static void
+6 -4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 7754 7754 drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr); 7755 7755 7756 7756 /* Cancel and flush any pending HDMI HPD debounce work */ 7757 - cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work); 7758 - if (aconnector->hdmi_prev_sink) { 7759 - dc_sink_release(aconnector->hdmi_prev_sink); 7760 - aconnector->hdmi_prev_sink = NULL; 7757 + if (aconnector->hdmi_hpd_debounce_delay_ms) { 7758 + cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work); 7759 + if (aconnector->hdmi_prev_sink) { 7760 + dc_sink_release(aconnector->hdmi_prev_sink); 7761 + aconnector->hdmi_prev_sink = NULL; 7762 + } 7761 7763 } 7762 7764 7763 7765 if (aconnector->bl_idx != -1) {
+4 -3
drivers/gpu/drm/amd/pm/amdgpu_dpm.c
··· 80 80 enum ip_power_state pwr_state = gate ? POWER_STATE_OFF : POWER_STATE_ON; 81 81 bool is_vcn = block_type == AMD_IP_BLOCK_TYPE_VCN; 82 82 83 + mutex_lock(&adev->pm.mutex); 84 + 83 85 if (atomic_read(&adev->pm.pwr_state[block_type]) == pwr_state && 84 86 (!is_vcn || adev->vcn.num_vcn_inst == 1)) { 85 87 dev_dbg(adev->dev, "IP block%d already in the target %s state!", 86 88 block_type, gate ? "gate" : "ungate"); 87 - return 0; 89 + goto out_unlock; 88 90 } 89 - 90 - mutex_lock(&adev->pm.mutex); 91 91 92 92 switch (block_type) { 93 93 case AMD_IP_BLOCK_TYPE_UVD: ··· 115 115 if (!ret) 116 116 atomic_set(&adev->pm.pwr_state[block_type], pwr_state); 117 117 118 + out_unlock: 118 119 mutex_unlock(&adev->pm.mutex); 119 120 120 121 return ret;
+1
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
··· 56 56 #define SMUQ10_TO_UINT(x) ((x) >> 10) 57 57 #define SMUQ10_FRAC(x) ((x) & 0x3ff) 58 58 #define SMUQ10_ROUND(x) ((SMUQ10_TO_UINT(x)) + ((SMUQ10_FRAC(x)) >= 0x200)) 59 + #define SMU_V13_SOFT_FREQ_ROUND(x) ((x) + 1) 59 60 60 61 extern const int pmfw_decoded_link_speed[5]; 61 62 extern const int pmfw_decoded_link_width[7];
+1
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0.h
··· 57 57 58 58 #define DECODE_GEN_SPEED(gen_speed_idx) (decoded_link_speed[gen_speed_idx]) 59 59 #define DECODE_LANE_WIDTH(lane_width_idx) (decoded_link_width[lane_width_idx]) 60 + #define SMU_V14_SOFT_FREQ_ROUND(x) ((x) + 1) 60 61 61 62 struct smu_14_0_max_sustainable_clocks { 62 63 uint32_t display_clock;
+1
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
··· 1555 1555 return clk_id; 1556 1556 1557 1557 if (max > 0) { 1558 + max = SMU_V13_SOFT_FREQ_ROUND(max); 1558 1559 if (automatic) 1559 1560 param = (uint32_t)((clk_id << 16) | 0xffff); 1560 1561 else
+1
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c
··· 1178 1178 return clk_id; 1179 1179 1180 1180 if (max > 0) { 1181 + max = SMU_V14_SOFT_FREQ_ROUND(max); 1181 1182 if (automatic) 1182 1183 param = (uint32_t)((clk_id << 16) | 0xffff); 1183 1184 else
+12 -6
drivers/gpu/drm/drm_gem.c
··· 960 960 { 961 961 struct drm_gem_change_handle *args = data; 962 962 struct drm_gem_object *obj; 963 - int ret; 963 + int handle, ret; 964 964 965 965 if (!drm_core_check_feature(dev, DRIVER_GEM)) 966 966 return -EOPNOTSUPP; 967 + 968 + /* idr_alloc() limitation. */ 969 + if (args->new_handle > INT_MAX) 970 + return -EINVAL; 971 + handle = args->new_handle; 967 972 968 973 obj = drm_gem_object_lookup(file_priv, args->handle); 969 974 if (!obj) 970 975 return -ENOENT; 971 976 972 - if (args->handle == args->new_handle) { 977 + if (args->handle == handle) { 973 978 ret = 0; 974 979 goto out; 975 980 } ··· 982 977 mutex_lock(&file_priv->prime.lock); 983 978 984 979 spin_lock(&file_priv->table_lock); 985 - ret = idr_alloc(&file_priv->object_idr, obj, 986 - args->new_handle, args->new_handle + 1, GFP_NOWAIT); 980 + ret = idr_alloc(&file_priv->object_idr, obj, handle, handle + 1, 981 + GFP_NOWAIT); 987 982 spin_unlock(&file_priv->table_lock); 988 983 989 984 if (ret < 0) 990 985 goto out_unlock; 991 986 992 987 if (obj->dma_buf) { 993 - ret = drm_prime_add_buf_handle(&file_priv->prime, obj->dma_buf, args->new_handle); 988 + ret = drm_prime_add_buf_handle(&file_priv->prime, obj->dma_buf, 989 + handle); 994 990 if (ret < 0) { 995 991 spin_lock(&file_priv->table_lock); 996 - idr_remove(&file_priv->object_idr, args->new_handle); 992 + idr_remove(&file_priv->object_idr, handle); 997 993 spin_unlock(&file_priv->table_lock); 998 994 goto out_unlock; 999 995 }
+1 -1
drivers/gpu/drm/drm_pagemap.c
··· 197 197 struct drm_pagemap_zdd *zdd) 198 198 { 199 199 page->zone_device_data = drm_pagemap_zdd_get(zdd); 200 - zone_device_page_init(page, 0); 200 + zone_device_page_init(page, page_pgmap(page), 0); 201 201 } 202 202 203 203 /**
+13
drivers/gpu/drm/imx/ipuv3/imx-tve.c
··· 528 528 .bind = imx_tve_bind, 529 529 }; 530 530 531 + static void imx_tve_put_device(void *_dev) 532 + { 533 + struct device *dev = _dev; 534 + 535 + put_device(dev); 536 + } 537 + 531 538 static int imx_tve_probe(struct platform_device *pdev) 532 539 { 533 540 struct device *dev = &pdev->dev; ··· 556 549 if (ddc_node) { 557 550 tve->ddc = of_find_i2c_adapter_by_node(ddc_node); 558 551 of_node_put(ddc_node); 552 + if (tve->ddc) { 553 + ret = devm_add_action_or_reset(dev, imx_tve_put_device, 554 + &tve->ddc->dev); 555 + if (ret) 556 + return ret; 557 + } 559 558 } 560 559 561 560 tve->mode = of_get_tve_mode(np);
-2
drivers/gpu/drm/msm/adreno/a6xx_catalog.c
··· 501 501 {REG_A6XX_RBBM_CLOCK_CNTL_GMU_GX, 0x00000222}, 502 502 {REG_A6XX_RBBM_CLOCK_DELAY_GMU_GX, 0x00000111}, 503 503 {REG_A6XX_RBBM_CLOCK_HYST_GMU_GX, 0x00000555}, 504 - {REG_A6XX_GPU_GMU_AO_GMU_CGC_DELAY_CNTL, 0x10111}, 505 - {REG_A6XX_GPU_GMU_AO_GMU_CGC_HYST_CNTL, 0x5555}, 506 504 {} 507 505 }; 508 506
+1 -1
drivers/gpu/drm/nouveau/nouveau_dmem.c
··· 425 425 order = ilog2(DMEM_CHUNK_NPAGES); 426 426 } 427 427 428 - zone_device_folio_init(folio, order); 428 + zone_device_folio_init(folio, page_pgmap(folio_page(folio, 0)), order); 429 429 return page; 430 430 } 431 431
+1
drivers/gpu/drm/tyr/Kconfig
··· 6 6 depends on RUST 7 7 depends on ARM || ARM64 || COMPILE_TEST 8 8 depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE 9 + depends on COMMON_CLK 9 10 default n 10 11 help 11 12 Rust DRM driver for ARM Mali CSF-based GPUs.
+1 -2
drivers/gpu/drm/xe/xe_configfs.c
··· 347 347 return false; 348 348 349 349 ret = pci_get_drvdata(pdev); 350 - pci_dev_put(pdev); 351 - 352 350 if (ret) 353 351 pci_dbg(pdev, "Already bound to driver\n"); 354 352 353 + pci_dev_put(pdev); 355 354 return ret; 356 355 } 357 356
-2
drivers/gpu/drm/xe/xe_device.c
··· 984 984 { 985 985 xe_display_unregister(xe); 986 986 987 - xe_nvm_fini(xe); 988 - 989 987 drm_dev_unplug(&xe->drm); 990 988 991 989 xe_bo_pci_dev_remove_all(xe);
+3 -3
drivers/gpu/drm/xe/xe_exec.c
··· 190 190 goto err_syncs; 191 191 } 192 192 193 - if (xe_exec_queue_is_parallel(q)) { 194 - err = copy_from_user(addresses, addresses_user, sizeof(u64) * 195 - q->width); 193 + if (args->num_batch_buffer && xe_exec_queue_is_parallel(q)) { 194 + err = copy_from_user(addresses, addresses_user, 195 + sizeof(u64) * q->width); 196 196 if (err) { 197 197 err = -EFAULT; 198 198 goto err_syncs;
+1 -1
drivers/gpu/drm/xe/xe_lrc.c
··· 1185 1185 return -ENOSPC; 1186 1186 1187 1187 *cmd++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1); 1188 - *cmd++ = CS_DEBUG_MODE1(0).addr; 1188 + *cmd++ = CS_DEBUG_MODE2(0).addr; 1189 1189 *cmd++ = _MASKED_BIT_ENABLE(INSTRUCTION_STATE_CACHE_INVALIDATE); 1190 1190 1191 1191 return cmd - batch;
+27 -28
drivers/gpu/drm/xe/xe_nvm.c
··· 83 83 return writable_override; 84 84 } 85 85 86 + static void xe_nvm_fini(void *arg) 87 + { 88 + struct xe_device *xe = arg; 89 + struct intel_dg_nvm_dev *nvm = xe->nvm; 90 + 91 + if (!xe->info.has_gsc_nvm) 92 + return; 93 + 94 + /* No access to internal NVM from VFs */ 95 + if (IS_SRIOV_VF(xe)) 96 + return; 97 + 98 + /* Nvm pointer should not be NULL here */ 99 + if (WARN_ON(!nvm)) 100 + return; 101 + 102 + auxiliary_device_delete(&nvm->aux_dev); 103 + auxiliary_device_uninit(&nvm->aux_dev); 104 + xe->nvm = NULL; 105 + } 106 + 86 107 int xe_nvm_init(struct xe_device *xe) 87 108 { 88 109 struct pci_dev *pdev = to_pci_dev(xe->drm.dev); ··· 153 132 ret = auxiliary_device_init(aux_dev); 154 133 if (ret) { 155 134 drm_err(&xe->drm, "xe-nvm aux init failed %d\n", ret); 156 - goto err; 135 + kfree(nvm); 136 + xe->nvm = NULL; 137 + return ret; 157 138 } 158 139 159 140 ret = auxiliary_device_add(aux_dev); 160 141 if (ret) { 161 142 drm_err(&xe->drm, "xe-nvm aux add failed %d\n", ret); 162 143 auxiliary_device_uninit(aux_dev); 163 - goto err; 144 + xe->nvm = NULL; 145 + return ret; 164 146 } 165 - return 0; 166 - 167 - err: 168 - kfree(nvm); 169 - xe->nvm = NULL; 170 - return ret; 171 - } 172 - 173 - void xe_nvm_fini(struct xe_device *xe) 174 - { 175 - struct intel_dg_nvm_dev *nvm = xe->nvm; 176 - 177 - if (!xe->info.has_gsc_nvm) 178 - return; 179 - 180 - /* No access to internal NVM from VFs */ 181 - if (IS_SRIOV_VF(xe)) 182 - return; 183 - 184 - /* Nvm pointer should not be NULL here */ 185 - if (WARN_ON(!nvm)) 186 - return; 187 - 188 - auxiliary_device_delete(&nvm->aux_dev); 189 - auxiliary_device_uninit(&nvm->aux_dev); 190 - xe->nvm = NULL; 147 + return devm_add_action_or_reset(xe->drm.dev, xe_nvm_fini, xe); 191 148 }
-2
drivers/gpu/drm/xe/xe_nvm.h
··· 10 10 11 11 int xe_nvm_init(struct xe_device *xe); 12 12 13 - void xe_nvm_fini(struct xe_device *xe); 14 - 15 13 #endif
+1 -5
drivers/gpu/drm/xe/xe_pci.c
··· 342 342 .has_display = true, 343 343 .has_flat_ccs = 1, 344 344 .has_pxp = true, 345 - .has_mem_copy_instr = true, 346 345 .max_gt_per_tile = 2, 347 346 .needs_scratch = true, 348 347 .va_bits = 48, ··· 362 363 .has_heci_cscfi = 1, 363 364 .has_late_bind = true, 364 365 .has_sriov = true, 365 - .has_mem_copy_instr = true, 366 366 .max_gt_per_tile = 2, 367 367 .needs_scratch = true, 368 368 .subplatforms = (const struct xe_subplatform_desc[]) { ··· 378 380 .has_display = true, 379 381 .has_flat_ccs = 1, 380 382 .has_sriov = true, 381 - .has_mem_copy_instr = true, 382 383 .max_gt_per_tile = 2, 383 384 .needs_scratch = true, 384 385 .needs_shared_vf_gt_wq = true, ··· 390 393 .dma_mask_size = 46, 391 394 .has_display = true, 392 395 .has_flat_ccs = 1, 393 - .has_mem_copy_instr = true, 394 396 .max_gt_per_tile = 2, 395 397 .require_force_probe = true, 396 398 .va_bits = 48, ··· 671 675 xe->info.has_pxp = desc->has_pxp; 672 676 xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) && 673 677 desc->has_sriov; 674 - xe->info.has_mem_copy_instr = desc->has_mem_copy_instr; 675 678 xe->info.skip_guc_pc = desc->skip_guc_pc; 676 679 xe->info.skip_mtcfg = desc->skip_mtcfg; 677 680 xe->info.skip_pcode = desc->skip_pcode; ··· 859 864 xe->info.has_range_tlb_inval = graphics_desc->has_range_tlb_inval; 860 865 xe->info.has_usm = graphics_desc->has_usm; 861 866 xe->info.has_64bit_timestamp = graphics_desc->has_64bit_timestamp; 867 + xe->info.has_mem_copy_instr = GRAPHICS_VER(xe) >= 20; 862 868 863 869 xe_info_probe_tile_count(xe); 864 870
-1
drivers/gpu/drm/xe/xe_pci_types.h
··· 46 46 u8 has_late_bind:1; 47 47 u8 has_llc:1; 48 48 u8 has_mbx_power_limits:1; 49 - u8 has_mem_copy_instr:1; 50 49 u8 has_pxp:1; 51 50 u8 has_sriov:1; 52 51 u8 needs_scratch:1;
+3
drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
··· 1078 1078 { 1079 1079 char header[64]; 1080 1080 1081 + /* Reset VCMDQ */ 1082 + tegra241_vcmdq_hw_deinit(vcmdq); 1083 + 1081 1084 /* Configure the vcmdq only; User space does the enabling */ 1082 1085 writeq_relaxed(vcmdq->cmdq.q.q_base, REG_VCMDQ_PAGE1(vcmdq, BASE)); 1083 1086
+10 -1
drivers/iommu/generic_pt/iommu_pt.h
··· 931 931 struct pt_table_p *table) 932 932 { 933 933 struct pt_state pts = pt_init(range, level, table); 934 + unsigned int flush_start_index = UINT_MAX; 935 + unsigned int flush_end_index = UINT_MAX; 934 936 struct pt_unmap_args *unmap = arg; 935 937 unsigned int num_oas = 0; 936 938 unsigned int start_index; ··· 988 986 iommu_pages_list_add(&unmap->free_list, 989 987 pts.table_lower); 990 988 pt_clear_entries(&pts, ilog2(1)); 989 + if (pts.index < flush_start_index) 990 + flush_start_index = pts.index; 991 + flush_end_index = pts.index + 1; 991 992 } 992 993 pts.index++; 993 994 } else { ··· 1004 999 num_contig_lg2 = pt_entry_num_contig_lg2(&pts); 1005 1000 pt_clear_entries(&pts, num_contig_lg2); 1006 1001 num_oas += log2_to_int(num_contig_lg2); 1002 + if (pts.index < flush_start_index) 1003 + flush_start_index = pts.index; 1007 1004 pts.index += log2_to_int(num_contig_lg2); 1005 + flush_end_index = pts.index; 1008 1006 } 1009 1007 if (pts.index >= pts.end_index) 1010 1008 break; ··· 1015 1007 } while (true); 1016 1008 1017 1009 unmap->unmapped += log2_mul(num_oas, pt_table_item_lg2sz(&pts)); 1018 - flush_writes_range(&pts, start_index, pts.index); 1010 + if (flush_start_index != flush_end_index) 1011 + flush_writes_range(&pts, flush_start_index, flush_end_index); 1019 1012 1020 1013 return ret; 1021 1014 }
+1
drivers/iommu/iommufd/pages.c
··· 289 289 batch->end = 0; 290 290 batch->pfns[0] = 0; 291 291 batch->npfns[0] = 0; 292 + batch->kind = 0; 292 293 } 293 294 294 295 /*
+36 -39
drivers/irqchip/irq-ls-extirq.c
··· 168 168 return 0; 169 169 } 170 170 171 - static int __init 172 - ls_extirq_of_init(struct device_node *node, struct device_node *parent) 171 + static int ls_extirq_probe(struct platform_device *pdev) 173 172 { 174 173 struct irq_domain *domain, *parent_domain; 174 + struct device_node *node, *parent; 175 + struct device *dev = &pdev->dev; 175 176 struct ls_extirq_data *priv; 176 177 int ret; 177 178 179 + node = dev->of_node; 180 + parent = of_irq_find_parent(node); 181 + if (!parent) 182 + return dev_err_probe(dev, -ENODEV, "Failed to get IRQ parent node\n"); 183 + 178 184 parent_domain = irq_find_host(parent); 179 - if (!parent_domain) { 180 - pr_err("Cannot find parent domain\n"); 181 - ret = -ENODEV; 182 - goto err_irq_find_host; 183 - } 185 + if (!parent_domain) 186 + return dev_err_probe(dev, -EPROBE_DEFER, "Cannot find parent domain\n"); 184 187 185 - priv = kzalloc(sizeof(*priv), GFP_KERNEL); 186 - if (!priv) { 187 - ret = -ENOMEM; 188 - goto err_alloc_priv; 189 - } 188 + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 189 + if (!priv) 190 + return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n"); 190 191 191 - /* 192 - * All extirq OF nodes are under a scfg/syscon node with 193 - * the 'ranges' property 194 - */ 195 - priv->intpcr = of_iomap(node, 0); 196 - if (!priv->intpcr) { 197 - pr_err("Cannot ioremap OF node %pOF\n", node); 198 - ret = -ENOMEM; 199 - goto err_iomap; 200 - } 192 + priv->intpcr = devm_of_iomap(dev, node, 0, NULL); 193 + if (!priv->intpcr) 194 + return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node); 201 195 202 196 ret = ls_extirq_parse_map(priv, node); 203 197 if (ret) 204 - goto err_parse_map; 198 + return dev_err_probe(dev, ret, "Failed to parse IRQ map\n"); 205 199 206 200 priv->big_endian = of_device_is_big_endian(node->parent); 207 201 priv->is_ls1021a_or_ls1043a = of_device_is_compatible(node, "fsl,ls1021a-extirq") || ··· 204 210 205 211 domain = irq_domain_create_hierarchy(parent_domain, 0, priv->nirq, of_fwnode_handle(node), 206 212 &extirq_domain_ops, priv); 207 - if (!domain) { 208 - ret = -ENOMEM; 209 - goto err_add_hierarchy; 210 - } 213 + if (!domain) 214 + return dev_err_probe(dev, -ENOMEM, "Failed to add IRQ domain\n"); 211 215 212 216 return 0; 213 - 214 - err_add_hierarchy: 215 - err_parse_map: 216 - iounmap(priv->intpcr); 217 - err_iomap: 218 - kfree(priv); 219 - err_alloc_priv: 220 - err_irq_find_host: 221 - return ret; 222 217 } 223 218 224 - IRQCHIP_DECLARE(ls1021a_extirq, "fsl,ls1021a-extirq", ls_extirq_of_init); 225 - IRQCHIP_DECLARE(ls1043a_extirq, "fsl,ls1043a-extirq", ls_extirq_of_init); 226 - IRQCHIP_DECLARE(ls1088a_extirq, "fsl,ls1088a-extirq", ls_extirq_of_init); 219 + static const struct of_device_id ls_extirq_dt_ids[] = { 220 + { .compatible = "fsl,ls1021a-extirq" }, 221 + { .compatible = "fsl,ls1043a-extirq" }, 222 + { .compatible = "fsl,ls1088a-extirq" }, 223 + {} 224 + }; 225 + MODULE_DEVICE_TABLE(of, ls_extirq_dt_ids); 226 + 227 + static struct platform_driver ls_extirq_driver = { 228 + .probe = ls_extirq_probe, 229 + .driver = { 230 + .name = "ls-extirq", 231 + .of_match_table = ls_extirq_dt_ids, 232 + } 233 + }; 234 + 235 + builtin_platform_driver(ls_extirq_driver);
+1 -5
drivers/md/bcache/request.c
··· 1107 1107 1108 1108 if (bio_op(orig_bio) == REQ_OP_DISCARD && 1109 1109 !bdev_max_discard_sectors(dc->bdev)) { 1110 + bio_end_io_acct(orig_bio, start_time); 1110 1111 bio_endio(orig_bio); 1111 1112 return; 1112 1113 } 1113 1114 1114 1115 clone_bio = bio_alloc_clone(dc->bdev, orig_bio, GFP_NOIO, 1115 1116 &d->bio_detached); 1116 - if (!clone_bio) { 1117 - orig_bio->bi_status = BLK_STS_RESOURCE; 1118 - bio_endio(orig_bio); 1119 - return; 1120 - } 1121 1117 1122 1118 ddip = container_of(clone_bio, struct detached_dev_io_private, bio); 1123 1119 /* Count on the bcache device */
+1 -1
drivers/mtd/nand/spi/esmt.c
··· 215 215 SPINAND_FACT_OTP_INFO(2, 0, &f50l1g41lb_fact_otp_ops)), 216 216 SPINAND_INFO("F50D1G41LB", 217 217 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x11, 0x7f, 218 - 0x7f), 218 + 0x7f, 0x7f), 219 219 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), 220 220 NAND_ECCREQ(1, 512), 221 221 SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+15 -13
drivers/net/bonding/bond_main.c
··· 2202 2202 unblock_netpoll_tx(); 2203 2203 } 2204 2204 2205 - /* broadcast mode uses the all_slaves to loop through slaves. */ 2206 - if (bond_mode_can_use_xmit_hash(bond) || 2207 - BOND_MODE(bond) == BOND_MODE_BROADCAST) 2208 - bond_update_slave_arr(bond, NULL); 2209 - 2210 2205 if (!slave_dev->netdev_ops->ndo_bpf || 2211 2206 !slave_dev->netdev_ops->ndo_xdp_xmit) { 2212 2207 if (bond->xdp_prog) { ··· 2234 2239 if (bond->xdp_prog) 2235 2240 bpf_prog_inc(bond->xdp_prog); 2236 2241 } 2242 + 2243 + /* broadcast mode uses the all_slaves to loop through slaves. */ 2244 + if (bond_mode_can_use_xmit_hash(bond) || 2245 + BOND_MODE(bond) == BOND_MODE_BROADCAST) 2246 + bond_update_slave_arr(bond, NULL); 2237 2247 2238 2248 bond_xdp_set_features(bond_dev); 2239 2249 ··· 3047 3047 __func__, &sip); 3048 3048 return; 3049 3049 } 3050 - slave->last_rx = jiffies; 3051 - slave->target_last_arp_rx[i] = jiffies; 3050 + WRITE_ONCE(slave->last_rx, jiffies); 3051 + WRITE_ONCE(slave->target_last_arp_rx[i], jiffies); 3052 3052 } 3053 3053 3054 3054 static int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, ··· 3267 3267 __func__, saddr); 3268 3268 return; 3269 3269 } 3270 - slave->last_rx = jiffies; 3271 - slave->target_last_arp_rx[i] = jiffies; 3270 + WRITE_ONCE(slave->last_rx, jiffies); 3271 + WRITE_ONCE(slave->target_last_arp_rx[i], jiffies); 3272 3272 } 3273 3273 3274 3274 static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond, ··· 3338 3338 (slave_do_arp_validate_only(bond) && is_ipv6) || 3339 3339 #endif 3340 3340 !slave_do_arp_validate_only(bond)) 3341 - slave->last_rx = jiffies; 3341 + WRITE_ONCE(slave->last_rx, jiffies); 3342 3342 return RX_HANDLER_ANOTHER; 3343 3343 } else if (is_arp) { 3344 3344 return bond_arp_rcv(skb, bond, slave); ··· 3406 3406 3407 3407 if (slave->link != BOND_LINK_UP) { 3408 3408 if (bond_time_in_interval(bond, last_tx, 1) && 3409 - bond_time_in_interval(bond, slave->last_rx, 1)) { 3409 + bond_time_in_interval(bond, READ_ONCE(slave->last_rx), 1)) { 3410 3410 3411 3411 bond_propose_link_state(slave, BOND_LINK_UP); 3412 3412 slave_state_changed = 1; ··· 3430 3430 * when the source ip is 0, so don't take the link down 3431 3431 * if we don't know our ip yet 3432 3432 */ 3433 - if (!bond_time_in_interval(bond, last_tx, bond->params.missed_max) || 3434 - !bond_time_in_interval(bond, slave->last_rx, bond->params.missed_max)) { 3433 + if (!bond_time_in_interval(bond, last_tx, 3434 + bond->params.missed_max) || 3435 + !bond_time_in_interval(bond, READ_ONCE(slave->last_rx), 3436 + bond->params.missed_max)) { 3435 3437 3436 3438 bond_propose_link_state(slave, BOND_LINK_DOWN); 3437 3439 slave_state_changed = 1;
+4 -4
drivers/net/bonding/bond_options.c
··· 1152 1152 1153 1153 if (slot >= 0 && slot < BOND_MAX_ARP_TARGETS) { 1154 1154 bond_for_each_slave(bond, slave, iter) 1155 - slave->target_last_arp_rx[slot] = last_rx; 1155 + WRITE_ONCE(slave->target_last_arp_rx[slot], last_rx); 1156 1156 targets[slot] = target; 1157 1157 } 1158 1158 } ··· 1221 1221 bond_for_each_slave(bond, slave, iter) { 1222 1222 targets_rx = slave->target_last_arp_rx; 1223 1223 for (i = ind; (i < BOND_MAX_ARP_TARGETS-1) && targets[i+1]; i++) 1224 - targets_rx[i] = targets_rx[i+1]; 1225 - targets_rx[i] = 0; 1224 + WRITE_ONCE(targets_rx[i], READ_ONCE(targets_rx[i+1])); 1225 + WRITE_ONCE(targets_rx[i], 0); 1226 1226 } 1227 1227 for (i = ind; (i < BOND_MAX_ARP_TARGETS-1) && targets[i+1]; i++) 1228 1228 targets[i] = targets[i+1]; ··· 1377 1377 1378 1378 if (slot >= 0 && slot < BOND_MAX_NS_TARGETS) { 1379 1379 bond_for_each_slave(bond, slave, iter) { 1380 - slave->target_last_arp_rx[slot] = last_rx; 1380 + WRITE_ONCE(slave->target_last_arp_rx[slot], last_rx); 1381 1381 slave_set_ns_maddr(bond, slave, target, &targets[slot]); 1382 1382 } 1383 1383 targets[slot] = *target;
+1 -1
drivers/net/can/at91_can.c
··· 1099 1099 if (IS_ERR(transceiver)) { 1100 1100 err = PTR_ERR(transceiver); 1101 1101 dev_err_probe(&pdev->dev, err, "failed to get phy\n"); 1102 - goto exit_iounmap; 1102 + goto exit_free; 1103 1103 } 1104 1104 1105 1105 dev->netdev_ops = &at91_netdev_ops;
+2 -2
drivers/net/can/usb/gs_usb.c
··· 610 610 { 611 611 struct gs_usb *parent = urb->context; 612 612 struct gs_can *dev; 613 - struct net_device *netdev; 613 + struct net_device *netdev = NULL; 614 614 int rc; 615 615 struct net_device_stats *stats; 616 616 struct gs_host_frame *hf = urb->transfer_buffer; ··· 768 768 } 769 769 } else if (rc != -ESHUTDOWN && net_ratelimit()) { 770 770 netdev_info(netdev, "failed to re-submit IN URB: %pe\n", 771 - ERR_PTR(urb->status)); 771 + ERR_PTR(rc)); 772 772 } 773 773 } 774 774
+8 -7
drivers/net/dsa/yt921x.c
··· 682 682 const struct yt921x_mib_desc *desc = &yt921x_mib_descs[i]; 683 683 u32 reg = YT921X_MIBn_DATA0(port) + desc->offset; 684 684 u64 *valp = &((u64 *)mib)[i]; 685 - u64 val = *valp; 686 685 u32 val0; 687 - u32 val1; 686 + u64 val; 688 687 689 688 res = yt921x_reg_read(priv, reg, &val0); 690 689 if (res) 691 690 break; 692 691 693 692 if (desc->size <= 1) { 694 - if (val < (u32)val) 695 - /* overflow */ 696 - val += (u64)U32_MAX + 1; 697 - val &= ~U32_MAX; 698 - val |= val0; 693 + u64 old_val = *valp; 694 + 695 + val = (old_val & ~(u64)U32_MAX) | val0; 696 + if (val < old_val) 697 + val += 1ull << 32; 699 698 } else { 699 + u32 val1; 700 + 700 701 res = yt921x_reg_read(priv, reg + 4, &val1); 701 702 if (res) 702 703 break;
+4 -1
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c
··· 1261 1261 netdev_err(intf->ndev, "invalid PHY mode: %s for port %d\n", 1262 1262 phy_modes(intf->phy_interface), intf->port); 1263 1263 ret = -EINVAL; 1264 - goto err_free_netdev; 1264 + goto err_deregister_fixed_link; 1265 1265 } 1266 1266 1267 1267 ret = of_get_ethdev_address(ndev_dn, ndev); ··· 1286 1286 1287 1287 return intf; 1288 1288 1289 + err_deregister_fixed_link: 1290 + if (of_phy_is_fixed_link(ndev_dn)) 1291 + of_phy_deregister_fixed_link(ndev_dn); 1289 1292 err_free_netdev: 1290 1293 free_netdev(ndev); 1291 1294 err:
+5
drivers/net/ethernet/google/gve/gve.h
··· 1206 1206 } 1207 1207 } 1208 1208 1209 + static inline bool gve_is_clock_enabled(struct gve_priv *priv) 1210 + { 1211 + return priv->nic_ts_report; 1212 + } 1213 + 1209 1214 /* gqi napi handler defined in gve_main.c */ 1210 1215 int gve_napi_poll(struct napi_struct *napi, int budget); 1211 1216
+1 -1
drivers/net/ethernet/google/gve/gve_ethtool.c
··· 938 938 939 939 ethtool_op_get_ts_info(netdev, info); 940 940 941 - if (priv->nic_timestamp_supported) { 941 + if (gve_is_clock_enabled(priv)) { 942 942 info->so_timestamping |= SOF_TIMESTAMPING_RX_HARDWARE | 943 943 SOF_TIMESTAMPING_RAW_HARDWARE; 944 944
+7 -5
drivers/net/ethernet/google/gve/gve_main.c
··· 680 680 } 681 681 } 682 682 683 - err = gve_init_clock(priv); 684 - if (err) { 685 - dev_err(&priv->pdev->dev, "Failed to init clock"); 686 - goto abort_with_ptype_lut; 683 + if (priv->nic_timestamp_supported) { 684 + err = gve_init_clock(priv); 685 + if (err) { 686 + dev_warn(&priv->pdev->dev, "Failed to init clock, continuing without PTP support"); 687 + err = 0; 688 + } 687 689 } 688 690 689 691 err = gve_init_rss_config(priv, priv->rx_cfg.num_queues); ··· 2185 2183 } 2186 2184 2187 2185 if (kernel_config->rx_filter != HWTSTAMP_FILTER_NONE) { 2188 - if (!priv->nic_ts_report) { 2186 + if (!gve_is_clock_enabled(priv)) { 2189 2187 NL_SET_ERR_MSG_MOD(extack, 2190 2188 "RX timestamping is not supported"); 2191 2189 kernel_config->rx_filter = HWTSTAMP_FILTER_NONE;
-8
drivers/net/ethernet/google/gve/gve_ptp.c
··· 70 70 struct gve_ptp *ptp; 71 71 int err; 72 72 73 - if (!priv->nic_timestamp_supported) { 74 - dev_dbg(&priv->pdev->dev, "Device does not support PTP\n"); 75 - return -EOPNOTSUPP; 76 - } 77 - 78 73 priv->ptp = kzalloc(sizeof(*priv->ptp), GFP_KERNEL); 79 74 if (!priv->ptp) 80 75 return -ENOMEM; ··· 110 115 int gve_init_clock(struct gve_priv *priv) 111 116 { 112 117 int err; 113 - 114 - if (!priv->nic_timestamp_supported) 115 - return 0; 116 118 117 119 err = gve_ptp_init(priv); 118 120 if (err)
+1 -1
drivers/net/ethernet/google/gve/gve_rx_dqo.c
··· 484 484 { 485 485 const struct gve_xdp_buff *ctx = (void *)_ctx; 486 486 487 - if (!ctx->gve->nic_ts_report) 487 + if (!gve_is_clock_enabled(ctx->gve)) 488 488 return -ENODATA; 489 489 490 490 if (!(ctx->compl_desc->ts_sub_nsecs_low & GVE_DQO_RX_HWTSTAMP_VALID))
+6 -4
drivers/net/ethernet/intel/ice/ice_lib.c
··· 2783 2783 2784 2784 ASSERT_RTNL(); 2785 2785 ice_for_each_rxq(vsi, q_idx) 2786 - netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_RX, 2787 - &vsi->rx_rings[q_idx]->q_vector->napi); 2786 + if (vsi->rx_rings[q_idx] && vsi->rx_rings[q_idx]->q_vector) 2787 + netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_RX, 2788 + &vsi->rx_rings[q_idx]->q_vector->napi); 2788 2789 2789 2790 ice_for_each_txq(vsi, q_idx) 2790 - netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_TX, 2791 - &vsi->tx_rings[q_idx]->q_vector->napi); 2791 + if (vsi->tx_rings[q_idx] && vsi->tx_rings[q_idx]->q_vector) 2792 + netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_TX, 2793 + &vsi->tx_rings[q_idx]->q_vector->napi); 2792 2794 /* Also set the interrupt number for the NAPI */ 2793 2795 ice_for_each_q_vector(vsi, v_idx) { 2794 2796 struct ice_q_vector *q_vector = vsi->q_vectors[v_idx];
-1
drivers/net/ethernet/intel/ice/ice_main.c
··· 6982 6982 cur_ns->rx_errors = pf->stats.crc_errors + 6983 6983 pf->stats.illegal_bytes + 6984 6984 pf->stats.rx_undersize + 6985 - pf->hw_csum_rx_error + 6986 6985 pf->stats.rx_jabber + 6987 6986 pf->stats.rx_fragments + 6988 6987 pf->stats.rx_oversize;
+10 -16
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 11468 11468 */ 11469 11469 static int ixgbe_recovery_probe(struct ixgbe_adapter *adapter) 11470 11470 { 11471 - struct net_device *netdev = adapter->netdev; 11472 11471 struct pci_dev *pdev = adapter->pdev; 11473 11472 struct ixgbe_hw *hw = &adapter->hw; 11474 - bool disable_dev; 11475 11473 int err = -EIO; 11476 11474 11477 11475 if (hw->mac.type != ixgbe_mac_e610) 11478 - goto clean_up_probe; 11476 + return err; 11479 11477 11480 11478 ixgbe_get_hw_control(adapter); 11481 - mutex_init(&hw->aci.lock); 11482 11479 err = ixgbe_get_flash_data(&adapter->hw); 11483 11480 if (err) 11484 - goto shutdown_aci; 11481 + goto err_release_hw_control; 11485 11482 11486 11483 timer_setup(&adapter->service_timer, ixgbe_service_timer, 0); 11487 11484 INIT_WORK(&adapter->service_task, ixgbe_recovery_service_task); ··· 11501 11504 devl_unlock(adapter->devlink); 11502 11505 11503 11506 return 0; 11504 - shutdown_aci: 11505 - mutex_destroy(&adapter->hw.aci.lock); 11507 + err_release_hw_control: 11506 11508 ixgbe_release_hw_control(adapter); 11507 - clean_up_probe: 11508 - disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state); 11509 - free_netdev(netdev); 11510 - devlink_free(adapter->devlink); 11511 - pci_release_mem_regions(pdev); 11512 - if (disable_dev) 11513 - pci_disable_device(pdev); 11514 11509 return err; 11515 11510 } 11516 11511 ··· 11644 11655 if (err) 11645 11656 goto err_sw_init; 11646 11657 11647 - if (ixgbe_check_fw_error(adapter)) 11648 - return ixgbe_recovery_probe(adapter); 11658 + if (ixgbe_check_fw_error(adapter)) { 11659 + err = ixgbe_recovery_probe(adapter); 11660 + if (err) 11661 + goto err_sw_init; 11662 + 11663 + return 0; 11664 + } 11649 11665 11650 11666 if (adapter->hw.mac.type == ixgbe_mac_e610) { 11651 11667 err = ixgbe_get_caps(&adapter->hw);
+1 -1
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
··· 1389 1389 efs->rule.flow_type = mvpp2_cls_ethtool_flow_to_type(info->fs.flow_type); 1390 1390 if (efs->rule.flow_type < 0) { 1391 1391 ret = efs->rule.flow_type; 1392 - goto clean_rule; 1392 + goto clean_eth_rule; 1393 1393 } 1394 1394 1395 1395 ret = mvpp2_cls_rfs_parse_rule(&efs->rule);
+1 -1
drivers/net/ethernet/marvell/octeon_ep/octep_main.c
··· 1338 1338 1339 1339 ret = octep_ctrl_net_init(oct); 1340 1340 if (ret) 1341 - return ret; 1341 + goto unsupported_dev; 1342 1342 1343 1343 INIT_WORK(&oct->tx_timeout_task, octep_tx_timeout_task); 1344 1344 INIT_WORK(&oct->ctrl_mbox_task, octep_ctrl_mbox_task);
+16
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
··· 613 613 cq->dbg = NULL; 614 614 } 615 615 } 616 + 617 + static int vhca_id_show(struct seq_file *file, void *priv) 618 + { 619 + struct mlx5_core_dev *dev = file->private; 620 + 621 + seq_printf(file, "0x%x\n", MLX5_CAP_GEN(dev, vhca_id)); 622 + return 0; 623 + } 624 + 625 + DEFINE_SHOW_ATTRIBUTE(vhca_id); 626 + 627 + void mlx5_vhca_debugfs_init(struct mlx5_core_dev *dev) 628 + { 629 + debugfs_create_file("vhca_id", 0400, dev->priv.dbg.dbg_root, dev, 630 + &vhca_id_fops); 631 + }
+14
drivers/net/ethernet/mellanox/mlx5/core/dev.c
··· 575 575 return plen && flen && flen == plen && 576 576 !memcmp(fsystem_guid, psystem_guid, flen); 577 577 } 578 + 579 + void mlx5_core_reps_aux_devs_remove(struct mlx5_core_dev *dev) 580 + { 581 + struct mlx5_priv *priv = &dev->priv; 582 + 583 + if (priv->adev[MLX5_INTERFACE_PROTOCOL_ETH]) 584 + device_lock_assert(&priv->adev[MLX5_INTERFACE_PROTOCOL_ETH]->adev.dev); 585 + else 586 + mlx5_core_err(dev, "ETH driver already removed\n"); 587 + if (priv->adev[MLX5_INTERFACE_PROTOCOL_IB_REP]) 588 + del_adev(&priv->adev[MLX5_INTERFACE_PROTOCOL_IB_REP]->adev); 589 + if (priv->adev[MLX5_INTERFACE_PROTOCOL_ETH_REP]) 590 + del_adev(&priv->adev[MLX5_INTERFACE_PROTOCOL_ETH_REP]->adev); 591 + }
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
··· 430 430 attrs->replay_esn.esn = sa_entry->esn_state.esn; 431 431 attrs->replay_esn.esn_msb = sa_entry->esn_state.esn_msb; 432 432 attrs->replay_esn.overlap = sa_entry->esn_state.overlap; 433 - if (attrs->dir == XFRM_DEV_OFFLOAD_OUT) 433 + if (attrs->dir == XFRM_DEV_OFFLOAD_OUT || 434 + x->xso.type != XFRM_DEV_OFFLOAD_PACKET) 434 435 goto skip_replay_window; 435 436 436 437 switch (x->replay_esn->replay_window) {
+11 -6
drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp_rxtx.c
··· 177 177 { 178 178 struct mlx5e_priv *priv = netdev_priv(netdev); 179 179 struct net *net = sock_net(skb->sk); 180 - const struct ipv6hdr *ip6; 181 - struct tcphdr *th; 182 180 183 181 if (!mlx5e_psp_set_state(priv, skb, psp_st)) 184 182 return true; ··· 188 190 return false; 189 191 } 190 192 if (skb_is_gso(skb)) { 191 - ip6 = ipv6_hdr(skb); 192 - th = inner_tcp_hdr(skb); 193 + int len = skb_shinfo(skb)->gso_size + inner_tcp_hdrlen(skb); 194 + struct tcphdr *th = inner_tcp_hdr(skb); 193 195 194 - th->check = ~tcp_v6_check(skb_shinfo(skb)->gso_size + inner_tcp_hdrlen(skb), &ip6->saddr, 195 - &ip6->daddr, 0); 196 + if (skb->protocol == htons(ETH_P_IP)) { 197 + const struct iphdr *ip = ip_hdr(skb); 198 + 199 + th->check = ~tcp_v4_check(len, ip->saddr, ip->daddr, 0); 200 + } else { 201 + const struct ipv6hdr *ip6 = ipv6_hdr(skb); 202 + 203 + th->check = ~tcp_v6_check(len, &ip6->saddr, &ip6->daddr, 0); 204 + } 196 205 } 197 206 198 207 return true;
+12 -9
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 4052 4052 mlx5e_queue_update_stats(priv); 4053 4053 } 4054 4054 4055 + netdev_stats_to_stats64(stats, &dev->stats); 4056 + 4055 4057 if (mlx5e_is_uplink_rep(priv)) { 4056 4058 struct mlx5e_vport_stats *vstats = &priv->stats.vport; 4057 4059 ··· 4070 4068 mlx5e_fold_sw_stats64(priv, stats); 4071 4069 } 4072 4070 4073 - stats->rx_missed_errors = priv->stats.qcnt.rx_out_of_buffer; 4074 - stats->rx_dropped = PPORT_2863_GET(pstats, if_in_discards); 4071 + stats->rx_missed_errors += priv->stats.qcnt.rx_out_of_buffer; 4072 + stats->rx_dropped += PPORT_2863_GET(pstats, if_in_discards); 4075 4073 4076 - stats->rx_length_errors = 4074 + stats->rx_length_errors += 4077 4075 PPORT_802_3_GET(pstats, a_in_range_length_errors) + 4078 4076 PPORT_802_3_GET(pstats, a_out_of_range_length_field) + 4079 4077 PPORT_802_3_GET(pstats, a_frame_too_long_errors) + 4080 4078 VNIC_ENV_GET(&priv->stats.vnic, eth_wqe_too_small); 4081 - stats->rx_crc_errors = 4079 + stats->rx_crc_errors += 4082 4080 PPORT_802_3_GET(pstats, a_frame_check_sequence_errors); 4083 - stats->rx_frame_errors = PPORT_802_3_GET(pstats, a_alignment_errors); 4084 - stats->tx_aborted_errors = PPORT_2863_GET(pstats, if_out_discards); 4085 - stats->rx_errors = stats->rx_length_errors + stats->rx_crc_errors + 4086 - stats->rx_frame_errors; 4087 - stats->tx_errors = stats->tx_aborted_errors + stats->tx_carrier_errors; 4081 + stats->rx_frame_errors += PPORT_802_3_GET(pstats, a_alignment_errors); 4082 + stats->tx_aborted_errors += PPORT_2863_GET(pstats, if_out_discards); 4083 + stats->rx_errors += stats->rx_length_errors + stats->rx_crc_errors + 4084 + stats->rx_frame_errors; 4085 + stats->tx_errors += stats->tx_aborted_errors + stats->tx_carrier_errors; 4088 4086 } 4089 4087 4090 4088 static void mlx5e_nic_set_rx_mode(struct mlx5e_priv *priv) ··· 6844 6842 struct mlx5e_priv *priv = netdev_priv(netdev); 6845 6843 struct mlx5_core_dev *mdev = edev->mdev; 6846 6844 6845 + mlx5_eswitch_safe_aux_devs_remove(mdev); 6847 6846 mlx5_core_uplink_netdev_set(mdev, NULL); 6848 6847 6849 6848 if (priv->profile)
+13 -6
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
··· 2147 2147 2148 2148 static void mlx5e_tc_del_fdb_peers_flow(struct mlx5e_tc_flow *flow) 2149 2149 { 2150 + struct mlx5_devcom_comp_dev *devcom; 2151 + struct mlx5_devcom_comp_dev *pos; 2152 + struct mlx5_eswitch *peer_esw; 2150 2153 int i; 2151 2154 2152 - for (i = 0; i < MLX5_MAX_PORTS; i++) { 2153 - if (i == mlx5_get_dev_index(flow->priv->mdev)) 2154 - continue; 2155 + devcom = flow->priv->mdev->priv.eswitch->devcom; 2156 + mlx5_devcom_for_each_peer_entry(devcom, peer_esw, pos) { 2157 + i = mlx5_get_dev_index(peer_esw->dev); 2155 2158 mlx5e_tc_del_fdb_peer_flow(flow, i); 2156 2159 } 2157 2160 } ··· 5516 5513 5517 5514 void mlx5e_tc_clean_fdb_peer_flows(struct mlx5_eswitch *esw) 5518 5515 { 5516 + struct mlx5_devcom_comp_dev *devcom; 5517 + struct mlx5_devcom_comp_dev *pos; 5519 5518 struct mlx5e_tc_flow *flow, *tmp; 5519 + struct mlx5_eswitch *peer_esw; 5520 5520 int i; 5521 5521 5522 - for (i = 0; i < MLX5_MAX_PORTS; i++) { 5523 - if (i == mlx5_get_dev_index(esw->dev)) 5524 - continue; 5522 + devcom = esw->devcom; 5523 + 5524 + mlx5_devcom_for_each_peer_entry(devcom, peer_esw, pos) { 5525 + i = mlx5_get_dev_index(peer_esw->dev); 5525 5526 list_for_each_entry_safe(flow, tmp, &esw->offloads.peer_flows[i], peer[i]) 5526 5527 mlx5e_tc_del_fdb_peers_flow(flow); 5527 5528 }
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c
··· 188 188 if (IS_ERR(vport->ingress.acl)) { 189 189 err = PTR_ERR(vport->ingress.acl); 190 190 vport->ingress.acl = NULL; 191 - return err; 191 + goto out; 192 192 } 193 193 194 194 err = esw_acl_ingress_lgcy_groups_create(esw, vport);
+5 -1
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
··· 929 929 int mlx5_esw_ipsec_vf_packet_offload_supported(struct mlx5_core_dev *dev, 930 930 u16 vport_num); 931 931 bool mlx5_esw_host_functions_enabled(const struct mlx5_core_dev *dev); 932 + void mlx5_eswitch_safe_aux_devs_remove(struct mlx5_core_dev *dev); 932 933 #else /* CONFIG_MLX5_ESWITCH */ 933 934 /* eswitch API stubs */ 934 935 static inline int mlx5_eswitch_init(struct mlx5_core_dev *dev) { return 0; } ··· 1010 1009 static inline bool 1011 1010 mlx5_esw_vport_vhca_id(struct mlx5_eswitch *esw, u16 vportn, u16 *vhca_id) 1012 1011 { 1013 - return -EOPNOTSUPP; 1012 + return false; 1014 1013 } 1014 + 1015 + static inline void 1016 + mlx5_eswitch_safe_aux_devs_remove(struct mlx5_core_dev *dev) {} 1015 1017 1016 1018 #endif /* CONFIG_MLX5_ESWITCH */ 1017 1019
+26
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
··· 3981 3981 return true; 3982 3982 } 3983 3983 3984 + #define MLX5_ESW_HOLD_TIMEOUT_MS 7000 3985 + #define MLX5_ESW_HOLD_RETRY_DELAY_MS 500 3986 + 3987 + void mlx5_eswitch_safe_aux_devs_remove(struct mlx5_core_dev *dev) 3988 + { 3989 + unsigned long timeout; 3990 + bool hold_esw = true; 3991 + 3992 + /* Wait for any concurrent eswitch mode transition to complete. */ 3993 + if (!mlx5_esw_hold(dev)) { 3994 + timeout = jiffies + msecs_to_jiffies(MLX5_ESW_HOLD_TIMEOUT_MS); 3995 + while (!mlx5_esw_hold(dev)) { 3996 + if (!time_before(jiffies, timeout)) { 3997 + hold_esw = false; 3998 + break; 3999 + } 4000 + msleep(MLX5_ESW_HOLD_RETRY_DELAY_MS); 4001 + } 4002 + } 4003 + if (hold_esw) { 4004 + if (mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS) 4005 + mlx5_core_reps_aux_devs_remove(dev); 4006 + mlx5_esw_release(dev); 4007 + } 4008 + } 4009 + 3984 4010 int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode, 3985 4011 struct netlink_ext_ack *extack) 3986 4012 {
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
··· 1198 1198 u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)] = {}; 1199 1199 u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)] = {}; 1200 1200 1201 - if (disconnect && MLX5_CAP_FLOWTABLE_NIC_TX(dev, reset_root_to_default)) 1201 + if (disconnect && 1202 + !MLX5_CAP_FLOWTABLE_NIC_TX(dev, reset_root_to_default)) 1202 1203 return -EOPNOTSUPP; 1203 1204 1204 1205 MLX5_SET(set_flow_table_root_in, in, opcode,
+3 -11
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 1806 1806 return -ENOMEM; 1807 1807 } 1808 1808 1809 - static int vhca_id_show(struct seq_file *file, void *priv) 1810 - { 1811 - struct mlx5_core_dev *dev = file->private; 1812 - 1813 - seq_printf(file, "0x%x\n", MLX5_CAP_GEN(dev, vhca_id)); 1814 - return 0; 1815 - } 1816 - 1817 - DEFINE_SHOW_ATTRIBUTE(vhca_id); 1818 - 1819 1809 static int mlx5_notifiers_init(struct mlx5_core_dev *dev) 1820 1810 { 1821 1811 int err; ··· 1874 1884 priv->numa_node = dev_to_node(mlx5_core_dma_dev(dev)); 1875 1885 priv->dbg.dbg_root = debugfs_create_dir(dev_name(dev->device), 1876 1886 mlx5_debugfs_root); 1877 - debugfs_create_file("vhca_id", 0400, priv->dbg.dbg_root, dev, &vhca_id_fops); 1887 + 1878 1888 INIT_LIST_HEAD(&priv->traps); 1879 1889 1880 1890 err = mlx5_cmd_init(dev); ··· 2011 2021 err); 2012 2022 goto err_init_one; 2013 2023 } 2024 + 2025 + mlx5_vhca_debugfs_init(dev); 2014 2026 2015 2027 pci_save_state(pdev); 2016 2028 return 0;
+2
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
··· 258 258 void mlx5_cmd_flush(struct mlx5_core_dev *dev); 259 259 void mlx5_cq_debugfs_init(struct mlx5_core_dev *dev); 260 260 void mlx5_cq_debugfs_cleanup(struct mlx5_core_dev *dev); 261 + void mlx5_vhca_debugfs_init(struct mlx5_core_dev *dev); 261 262 262 263 int mlx5_query_pcam_reg(struct mlx5_core_dev *dev, u32 *pcam, u8 feature_group, 263 264 u8 access_reg_group); ··· 291 290 void mlx5_unregister_device(struct mlx5_core_dev *dev); 292 291 void mlx5_dev_set_lightweight(struct mlx5_core_dev *dev); 293 292 bool mlx5_dev_is_lightweight(struct mlx5_core_dev *dev); 293 + void mlx5_core_reps_aux_devs_remove(struct mlx5_core_dev *dev); 294 294 295 295 void mlx5_fw_reporters_create(struct mlx5_core_dev *dev); 296 296 int mlx5_query_mtpps(struct mlx5_core_dev *dev, u32 *mtpps, u32 mtpps_size);
+1
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
··· 76 76 goto init_one_err; 77 77 } 78 78 79 + mlx5_vhca_debugfs_init(mdev); 79 80 return 0; 80 81 81 82 init_one_err:
+2 -3
drivers/net/ethernet/rocker/rocker_main.c
··· 1524 1524 { 1525 1525 struct rocker_world_ops *wops = rocker_port->rocker->wops; 1526 1526 1527 - if (!wops->port_post_fini) 1528 - return; 1529 - wops->port_post_fini(rocker_port); 1527 + if (wops->port_post_fini) 1528 + wops->port_post_fini(rocker_port); 1530 1529 kfree(rocker_port->wpriv); 1531 1530 } 1532 1531
+1 -6
drivers/net/ethernet/sfc/mcdi_filters.c
··· 2182 2182 2183 2183 int efx_mcdi_rx_pull_rss_config(struct efx_nic *efx) 2184 2184 { 2185 - int rc; 2186 - 2187 - mutex_lock(&efx->net_dev->ethtool->rss_lock); 2188 - rc = efx_mcdi_rx_pull_rss_context_config(efx, &efx->rss_context); 2189 - mutex_unlock(&efx->net_dev->ethtool->rss_lock); 2190 - return rc; 2185 + return efx_mcdi_rx_pull_rss_context_config(efx, &efx->rss_context); 2191 2186 } 2192 2187 2193 2188 void efx_mcdi_rx_restore_rss_contexts(struct efx_nic *efx)
+27 -7
drivers/net/ethernet/spacemit/k1_emac.c
··· 1099 1099 100, 10000); 1100 1100 1101 1101 if (ret) { 1102 - netdev_err(priv->ndev, "Read stat timeout\n"); 1102 + /* 1103 + * This could be caused by the PHY stopping its refclk even when 1104 + * the link is up, for power saving. See also comments in 1105 + * emac_stats_update(). 1106 + */ 1107 + dev_err_ratelimited(&priv->ndev->dev, 1108 + "Read stat timeout. PHY clock stopped?\n"); 1103 1109 return ret; 1104 1110 } 1105 1111 ··· 1153 1147 1154 1148 assert_spin_locked(&priv->stats_lock); 1155 1149 1156 - if (!netif_running(priv->ndev) || !netif_device_present(priv->ndev)) { 1157 - /* Not up, don't try to update */ 1150 + /* 1151 + * We can't read statistics if the interface is not up. Also, some PHYs 1152 + * stop their reference clocks for link down power saving, which also 1153 + * causes reading statistics to time out. Don't update and don't 1154 + * reschedule in these cases. 1155 + */ 1156 + if (!netif_running(priv->ndev) || 1157 + !netif_carrier_ok(priv->ndev) || 1158 + !netif_device_present(priv->ndev)) { 1158 1159 return; 1159 1160 } 1160 1161 1161 1162 for (i = 0; i < sizeof(priv->tx_stats) / sizeof(*tx_stats); i++) { 1162 1163 /* 1163 - * If reading stats times out, everything is broken and there's 1164 - * nothing we can do. Reading statistics also can't return an 1165 - * error, so just return without updating and without 1166 - * rescheduling. 1164 + * If reading stats times out anyway, the stat registers will be 1165 + * stuck, and we can't really recover from that. 1166 + * 1167 + * Reading statistics also can't return an error, so just return 1168 + * without updating and without rescheduling. 1167 1169 */ 1168 1170 if (emac_tx_read_stat_cnt(priv, i, &res)) 1169 1171 return; ··· 1650 1636 emac_wr(priv, MAC_GLOBAL_CONTROL, ctrl); 1651 1637 1652 1638 emac_set_fc_autoneg(priv); 1639 + 1640 + /* 1641 + * Reschedule stats updates now that link is up. See comments in 1642 + * emac_stats_update(). 1643 + */ 1644 + mod_timer(&priv->stats_timer, jiffies); 1653 1645 } 1654 1646 1655 1647 phy_print_status(phydev);
+13 -4
drivers/net/phy/micrel.c
··· 2643 2643 2644 2644 kszphy_parse_led_mode(phydev); 2645 2645 2646 - clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, "rmii-ref"); 2646 + clk = devm_clk_get_optional(&phydev->mdio.dev, "rmii-ref"); 2647 2647 /* NOTE: clk may be NULL if building without CONFIG_HAVE_CLK */ 2648 2648 if (!IS_ERR_OR_NULL(clk)) { 2649 - unsigned long rate = clk_get_rate(clk); 2650 2649 bool rmii_ref_clk_sel_25_mhz; 2650 + unsigned long rate; 2651 + int err; 2652 + 2653 + err = clk_prepare_enable(clk); 2654 + if (err) { 2655 + phydev_err(phydev, "Failed to enable rmii-ref clock\n"); 2656 + return err; 2657 + } 2658 + 2659 + rate = clk_get_rate(clk); 2660 + clk_disable_unprepare(clk); 2651 2661 2652 2662 if (type) 2653 2663 priv->rmii_ref_clk_sel = type->has_rmii_ref_clk_sel; ··· 2675 2665 } 2676 2666 } else if (!clk) { 2677 2667 /* unnamed clock from the generic ethernet-phy binding */ 2678 - clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, NULL); 2668 + clk = devm_clk_get_optional(&phydev->mdio.dev, NULL); 2679 2669 } 2680 2670 2681 2671 if (IS_ERR(clk)) 2682 2672 return PTR_ERR(clk); 2683 2673 2684 - clk_disable_unprepare(clk); 2685 2674 priv->clk = clk; 2686 2675 2687 2676 if (ksz8041_fiber_mode(phydev))
+7 -2
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
··· 395 395 struct sk_buff *skb) 396 396 { 397 397 unsigned long long data_bus_addr, data_base_addr; 398 + struct skb_shared_info *shinfo = skb_shinfo(skb); 398 399 struct device *dev = rxq->dpmaif_ctrl->dev; 399 400 struct dpmaif_bat_page *page_info; 400 401 unsigned int data_len; ··· 403 402 404 403 page_info = rxq->bat_frag->bat_skb; 405 404 page_info += t7xx_normal_pit_bid(pkt_info); 406 - dma_unmap_page(dev, page_info->data_bus_addr, page_info->data_len, DMA_FROM_DEVICE); 407 405 408 406 if (!page_info->page) 409 407 return -EINVAL; 408 + 409 + if (shinfo->nr_frags >= MAX_SKB_FRAGS) 410 + return -EINVAL; 411 + 412 + dma_unmap_page(dev, page_info->data_bus_addr, page_info->data_len, DMA_FROM_DEVICE); 410 413 411 414 data_bus_addr = le32_to_cpu(pkt_info->pd.data_addr_h); 412 415 data_bus_addr = (data_bus_addr << 32) + le32_to_cpu(pkt_info->pd.data_addr_l); ··· 418 413 data_offset = data_bus_addr - data_base_addr; 419 414 data_offset += page_info->offset; 420 415 data_len = FIELD_GET(PD_PIT_DATA_LEN, le32_to_cpu(pkt_info->header)); 421 - skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page_info->page, 416 + skb_add_rx_frag(skb, shinfo->nr_frags, page_info->page, 422 417 data_offset, data_len, page_info->data_len); 423 418 424 419 page_info->page = NULL;
+2 -2
drivers/nvme/host/pci.c
··· 806 806 if (!blk_rq_dma_unmap(req, dma_dev, &iod->dma_state, iod->total_len, 807 807 map)) { 808 808 if (nvme_pci_cmd_use_sgl(&iod->cmd)) 809 - nvme_free_sgls(req, iod->descriptors[0], 810 - &iod->cmd.common.dptr.sgl, attrs); 809 + nvme_free_sgls(req, &iod->cmd.common.dptr.sgl, 810 + iod->descriptors[0], attrs); 811 811 else 812 812 nvme_free_prps(req, attrs); 813 813 }
+2 -1
drivers/nvme/target/io-cmd-bdev.c
··· 180 180 static void nvmet_bio_done(struct bio *bio) 181 181 { 182 182 struct nvmet_req *req = bio->bi_private; 183 + blk_status_t blk_status = bio->bi_status; 183 184 184 - nvmet_req_complete(req, blk_to_nvme_status(req, bio->bi_status)); 185 185 nvmet_req_bio_put(req, bio); 186 + nvmet_req_complete(req, blk_to_nvme_status(req, blk_status)); 186 187 } 187 188 188 189 #ifdef CONFIG_BLK_DEV_INTEGRITY
+17 -2
drivers/of/of_reserved_mem.c
··· 157 157 phys_addr_t base, size; 158 158 int i, len; 159 159 const __be32 *prop; 160 - bool nomap; 160 + bool nomap, default_cma; 161 161 162 162 prop = of_flat_dt_get_addr_size_prop(node, "reg", &len); 163 163 if (!prop) 164 164 return -ENOENT; 165 165 166 166 nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL; 167 + default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL); 168 + 169 + if (default_cma && cma_skip_dt_default_reserved_mem()) { 170 + pr_err("Skipping dt linux,cma-default for \"cma=\" kernel param.\n"); 171 + return -EINVAL; 172 + } 167 173 168 174 for (i = 0; i < len; i++) { 169 175 u64 b, s; ··· 254 248 255 249 fdt_for_each_subnode(child, fdt, node) { 256 250 const char *uname; 251 + bool default_cma = of_get_flat_dt_prop(child, "linux,cma-default", NULL); 257 252 u64 b, s; 258 253 259 254 if (!of_fdt_device_is_available(fdt, child)) 255 + continue; 256 + if (default_cma && cma_skip_dt_default_reserved_mem()) 260 257 continue; 261 258 262 259 if (!of_flat_dt_get_addr_size(child, "reg", &b, &s)) ··· 398 389 phys_addr_t base = 0, align = 0, size; 399 390 int i, len; 400 391 const __be32 *prop; 401 - bool nomap; 392 + bool nomap, default_cma; 402 393 int ret; 403 394 404 395 prop = of_get_flat_dt_prop(node, "size", &len); ··· 422 413 } 423 414 424 415 nomap = of_get_flat_dt_prop(node, "no-map", NULL) != NULL; 416 + default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL); 417 + 418 + if (default_cma && cma_skip_dt_default_reserved_mem()) { 419 + pr_err("Skipping dt linux,cma-default for \"cma=\" kernel param.\n"); 420 + return -EINVAL; 421 + } 425 422 426 423 /* Need adjust the alignment to satisfy the CMA requirement */ 427 424 if (IS_ENABLED(CONFIG_CMA)
+1 -1
drivers/pinctrl/meson/pinctrl-meson.c
··· 619 619 pc->chip.set = meson_gpio_set; 620 620 pc->chip.base = -1; 621 621 pc->chip.ngpio = pc->data->num_pins; 622 - pc->chip.can_sleep = false; 622 + pc->chip.can_sleep = true; 623 623 624 624 ret = gpiochip_add_data(&pc->chip, pc); 625 625 if (ret) {
+4 -5
drivers/pinctrl/pinctrl-rockchip.c
··· 3545 3545 return 0; 3546 3546 } 3547 3547 3548 - static int rockchip_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, 3549 - struct pinctrl_gpio_range *range, 3550 - unsigned offset, 3551 - bool input) 3548 + static int rockchip_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, 3549 + struct pinctrl_gpio_range *range, 3550 + unsigned int offset) 3552 3551 { 3553 3552 struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev); 3554 3553 struct rockchip_pin_bank *bank; ··· 3561 3562 .get_function_name = rockchip_pmx_get_func_name, 3562 3563 .get_function_groups = rockchip_pmx_get_groups, 3563 3564 .set_mux = rockchip_pmx_set, 3564 - .gpio_set_direction = rockchip_pmx_gpio_set_direction, 3565 + .gpio_request_enable = rockchip_pmx_gpio_request_enable, 3565 3566 }; 3566 3567 3567 3568 /*
+1 -1
drivers/pinctrl/pinctrl-th1520.c
··· 287 287 TH1520_PAD(5, QSPI0_D0_MOSI, QSPI, PWM, I2S, GPIO, ____, ____, 0), 288 288 TH1520_PAD(6, QSPI0_D1_MISO, QSPI, PWM, I2S, GPIO, ____, ____, 0), 289 289 TH1520_PAD(7, QSPI0_D2_WP, QSPI, PWM, I2S, GPIO, ____, ____, 0), 290 - TH1520_PAD(8, QSPI1_D3_HOLD, QSPI, ____, I2S, GPIO, ____, ____, 0), 290 + TH1520_PAD(8, QSPI0_D3_HOLD, QSPI, ____, I2S, GPIO, ____, ____, 0), 291 291 TH1520_PAD(9, I2C2_SCL, I2C, UART, ____, GPIO, ____, ____, 0), 292 292 TH1520_PAD(10, I2C2_SDA, I2C, UART, ____, GPIO, ____, ____, 0), 293 293 TH1520_PAD(11, I2C3_SCL, I2C, ____, ____, GPIO, ____, ____, 0),
+3 -12
drivers/pinctrl/qcom/Kconfig
··· 61 61 (Low Power Island) found on the Qualcomm Technologies Inc SoCs. 62 62 63 63 config PINCTRL_SC7280_LPASS_LPI 64 - tristate "Qualcomm Technologies Inc SC7280 LPASS LPI pin controller driver" 64 + tristate "Qualcomm Technologies Inc SC7280 and SM8350 LPASS LPI pin controller driver" 65 65 depends on ARM64 || COMPILE_TEST 66 66 depends on PINCTRL_LPASS_LPI 67 67 help 68 68 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 69 69 Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 70 - (Low Power Island) found on the Qualcomm Technologies Inc SC7280 platform. 70 + (Low Power Island) found on the Qualcomm Technologies Inc SC7280 71 + and SM8350 platforms. 71 72 72 73 config PINCTRL_SDM660_LPASS_LPI 73 74 tristate "Qualcomm Technologies Inc SDM660 LPASS LPI pin controller driver" ··· 106 105 This is the pinctrl, pinmux, pinconf and gpiolib driver for the 107 106 Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 108 107 (Low Power Island) found on the Qualcomm Technologies Inc SM8250 platform. 109 - 110 - config PINCTRL_SM8350_LPASS_LPI 111 - tristate "Qualcomm Technologies Inc SM8350 LPASS LPI pin controller driver" 112 - depends on ARM64 || COMPILE_TEST 113 - depends on PINCTRL_LPASS_LPI 114 - help 115 - This is the pinctrl, pinmux, pinconf and gpiolib driver for the 116 - Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI 117 - (Low Power Island) found on the Qualcomm Technologies Inc SM8350 118 - platform. 119 108 120 109 config PINCTRL_SM8450_LPASS_LPI 121 110 tristate "Qualcomm Technologies Inc SM8450 LPASS LPI pin controller driver"
-1
drivers/pinctrl/qcom/Makefile
··· 64 64 obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o 65 65 obj-$(CONFIG_PINCTRL_SM8250_LPASS_LPI) += pinctrl-sm8250-lpass-lpi.o 66 66 obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o 67 - obj-$(CONFIG_PINCTRL_SM8350_LPASS_LPI) += pinctrl-sm8350-lpass-lpi.o 68 67 obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o 69 68 obj-$(CONFIG_PINCTRL_SM8450_LPASS_LPI) += pinctrl-sm8450-lpass-lpi.o 70 69 obj-$(CONFIG_PINCTRL_SM8550) += pinctrl-sm8550.o
+17
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
··· 312 312 .pin_config_group_set = lpi_config_set, 313 313 }; 314 314 315 + static int lpi_gpio_get_direction(struct gpio_chip *chip, unsigned int pin) 316 + { 317 + unsigned long config = pinconf_to_config_packed(PIN_CONFIG_LEVEL, 0); 318 + struct lpi_pinctrl *state = gpiochip_get_data(chip); 319 + unsigned long arg; 320 + int ret; 321 + 322 + ret = lpi_config_get(state->ctrl, pin, &config); 323 + if (ret) 324 + return ret; 325 + 326 + arg = pinconf_to_config_argument(config); 327 + 328 + return arg ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; 329 + } 330 + 315 331 static int lpi_gpio_direction_input(struct gpio_chip *chip, unsigned int pin) 316 332 { 317 333 struct lpi_pinctrl *state = gpiochip_get_data(chip); ··· 425 409 #endif 426 410 427 411 static const struct gpio_chip lpi_gpio_template = { 412 + .get_direction = lpi_gpio_get_direction, 428 413 .direction_input = lpi_gpio_direction_input, 429 414 .direction_output = lpi_gpio_direction_output, 430 415 .get = lpi_gpio_get,
+3
drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
··· 131 131 { 132 132 .compatible = "qcom,sc7280-lpass-lpi-pinctrl", 133 133 .data = &sc7280_lpi_data, 134 + }, { 135 + .compatible = "qcom,sm8350-lpass-lpi-pinctrl", 136 + .data = &sc7280_lpi_data, 134 137 }, 135 138 { } 136 139 };
-151
drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. 4 - * Copyright (c) 2020-2023 Linaro Ltd. 5 - */ 6 - 7 - #include <linux/gpio/driver.h> 8 - #include <linux/module.h> 9 - #include <linux/platform_device.h> 10 - 11 - #include "pinctrl-lpass-lpi.h" 12 - 13 - enum lpass_lpi_functions { 14 - LPI_MUX_dmic1_clk, 15 - LPI_MUX_dmic1_data, 16 - LPI_MUX_dmic2_clk, 17 - LPI_MUX_dmic2_data, 18 - LPI_MUX_dmic3_clk, 19 - LPI_MUX_dmic3_data, 20 - LPI_MUX_i2s1_clk, 21 - LPI_MUX_i2s1_data, 22 - LPI_MUX_i2s1_ws, 23 - LPI_MUX_i2s2_clk, 24 - LPI_MUX_i2s2_data, 25 - LPI_MUX_i2s2_ws, 26 - LPI_MUX_qua_mi2s_data, 27 - LPI_MUX_qua_mi2s_sclk, 28 - LPI_MUX_qua_mi2s_ws, 29 - LPI_MUX_swr_rx_clk, 30 - LPI_MUX_swr_rx_data, 31 - LPI_MUX_swr_tx_clk, 32 - LPI_MUX_swr_tx_data, 33 - LPI_MUX_wsa_swr_clk, 34 - LPI_MUX_wsa_swr_data, 35 - LPI_MUX_gpio, 36 - LPI_MUX__, 37 - }; 38 - 39 - static const struct pinctrl_pin_desc sm8350_lpi_pins[] = { 40 - PINCTRL_PIN(0, "gpio0"), 41 - PINCTRL_PIN(1, "gpio1"), 42 - PINCTRL_PIN(2, "gpio2"), 43 - PINCTRL_PIN(3, "gpio3"), 44 - PINCTRL_PIN(4, "gpio4"), 45 - PINCTRL_PIN(5, "gpio5"), 46 - PINCTRL_PIN(6, "gpio6"), 47 - PINCTRL_PIN(7, "gpio7"), 48 - PINCTRL_PIN(8, "gpio8"), 49 - PINCTRL_PIN(9, "gpio9"), 50 - PINCTRL_PIN(10, "gpio10"), 51 - PINCTRL_PIN(11, "gpio11"), 52 - PINCTRL_PIN(12, "gpio12"), 53 - PINCTRL_PIN(13, "gpio13"), 54 - PINCTRL_PIN(14, "gpio14"), 55 - }; 56 - 57 - static const char * const swr_tx_clk_groups[] = { "gpio0" }; 58 - static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio5", "gpio14" }; 59 - static const char * const swr_rx_clk_groups[] = { "gpio3" }; 60 - static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" }; 61 - static const char * const dmic1_clk_groups[] = { "gpio6" }; 62 - static const char * const dmic1_data_groups[] = { "gpio7" }; 63 - static const char * const dmic2_clk_groups[] = { "gpio8" }; 64 - static const char * const dmic2_data_groups[] = { "gpio9" }; 65 - static const char * const i2s2_clk_groups[] = { "gpio10" }; 66 - static const char * const i2s2_ws_groups[] = { "gpio11" }; 67 - static const char * const dmic3_clk_groups[] = { "gpio12" }; 68 - static const char * const dmic3_data_groups[] = { "gpio13" }; 69 - static const char * const qua_mi2s_sclk_groups[] = { "gpio0" }; 70 - static const char * const qua_mi2s_ws_groups[] = { "gpio1" }; 71 - static const char * const qua_mi2s_data_groups[] = { "gpio2", "gpio3", "gpio4" }; 72 - static const char * const i2s1_clk_groups[] = { "gpio6" }; 73 - static const char * const i2s1_ws_groups[] = { "gpio7" }; 74 - static const char * const i2s1_data_groups[] = { "gpio8", "gpio9" }; 75 - static const char * const wsa_swr_clk_groups[] = { "gpio10" }; 76 - static const char * const wsa_swr_data_groups[] = { "gpio11" }; 77 - static const char * const i2s2_data_groups[] = { "gpio12", "gpio12" }; 78 - 79 - static const struct lpi_pingroup sm8350_groups[] = { 80 - LPI_PINGROUP(0, 0, swr_tx_clk, qua_mi2s_sclk, _, _), 81 - LPI_PINGROUP(1, 2, swr_tx_data, qua_mi2s_ws, _, _), 82 - LPI_PINGROUP(2, 4, swr_tx_data, qua_mi2s_data, _, _), 83 - LPI_PINGROUP(3, 8, swr_rx_clk, qua_mi2s_data, _, _), 84 - LPI_PINGROUP(4, 10, swr_rx_data, qua_mi2s_data, _, _), 85 - LPI_PINGROUP(5, 12, swr_tx_data, swr_rx_data, _, _), 86 - LPI_PINGROUP(6, LPI_NO_SLEW, dmic1_clk, i2s1_clk, _, _), 87 - LPI_PINGROUP(7, LPI_NO_SLEW, dmic1_data, i2s1_ws, _, _), 88 - LPI_PINGROUP(8, LPI_NO_SLEW, dmic2_clk, i2s1_data, _, _), 89 - LPI_PINGROUP(9, LPI_NO_SLEW, dmic2_data, i2s1_data, _, _), 90 - LPI_PINGROUP(10, 16, i2s2_clk, wsa_swr_clk, _, _), 91 - LPI_PINGROUP(11, 18, i2s2_ws, wsa_swr_data, _, _), 92 - LPI_PINGROUP(12, LPI_NO_SLEW, dmic3_clk, i2s2_data, _, _), 93 - LPI_PINGROUP(13, LPI_NO_SLEW, dmic3_data, i2s2_data, _, _), 94 - LPI_PINGROUP(14, 6, swr_tx_data, _, _, _), 95 - }; 96 - 97 - static const struct lpi_function sm8350_functions[] = { 98 - LPI_FUNCTION(dmic1_clk), 99 - LPI_FUNCTION(dmic1_data), 100 - LPI_FUNCTION(dmic2_clk), 101 - LPI_FUNCTION(dmic2_data), 102 - LPI_FUNCTION(dmic3_clk), 103 - LPI_FUNCTION(dmic3_data), 104 - LPI_FUNCTION(i2s1_clk), 105 - LPI_FUNCTION(i2s1_data), 106 - LPI_FUNCTION(i2s1_ws), 107 - LPI_FUNCTION(i2s2_clk), 108 - LPI_FUNCTION(i2s2_data), 109 - LPI_FUNCTION(i2s2_ws), 110 - LPI_FUNCTION(qua_mi2s_data), 111 - LPI_FUNCTION(qua_mi2s_sclk), 112 - LPI_FUNCTION(qua_mi2s_ws), 113 - LPI_FUNCTION(swr_rx_clk), 114 - LPI_FUNCTION(swr_rx_data), 115 - LPI_FUNCTION(swr_tx_clk), 116 - LPI_FUNCTION(swr_tx_data), 117 - LPI_FUNCTION(wsa_swr_clk), 118 - LPI_FUNCTION(wsa_swr_data), 119 - }; 120 - 121 - static const struct lpi_pinctrl_variant_data sm8350_lpi_data = { 122 - .pins = sm8350_lpi_pins, 123 - .npins = ARRAY_SIZE(sm8350_lpi_pins), 124 - .groups = sm8350_groups, 125 - .ngroups = ARRAY_SIZE(sm8350_groups), 126 - .functions = sm8350_functions, 127 - .nfunctions = ARRAY_SIZE(sm8350_functions), 128 - }; 129 - 130 - static const struct of_device_id lpi_pinctrl_of_match[] = { 131 - { 132 - .compatible = "qcom,sm8350-lpass-lpi-pinctrl", 133 - .data = &sm8350_lpi_data, 134 - }, 135 - { } 136 - }; 137 - MODULE_DEVICE_TABLE(of, lpi_pinctrl_of_match); 138 - 139 - static struct platform_driver lpi_pinctrl_driver = { 140 - .driver = { 141 - .name = "qcom-sm8350-lpass-lpi-pinctrl", 142 - .of_match_table = lpi_pinctrl_of_match, 143 - }, 144 - .probe = lpi_pinctrl_probe, 145 - .remove = lpi_pinctrl_remove, 146 - }; 147 - module_platform_driver(lpi_pinctrl_driver); 148 - 149 - MODULE_AUTHOR("Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>"); 150 - MODULE_DESCRIPTION("QTI SM8350 LPI GPIO pin control driver"); 151 - MODULE_LICENSE("GPL");
+1
drivers/scsi/be2iscsi/be_mgmt.c
··· 1025 1025 &nonemb_cmd->dma, 1026 1026 GFP_KERNEL); 1027 1027 if (!nonemb_cmd->va) { 1028 + free_mcc_wrb(ctrl, tag); 1028 1029 mutex_unlock(&ctrl->mbox_lock); 1029 1030 return 0; 1030 1031 }
+1 -1
drivers/scsi/qla2xxx/qla_os.c
··· 4489 4489 fail_elsrej: 4490 4490 dma_pool_destroy(ha->purex_dma_pool); 4491 4491 fail_flt: 4492 - dma_free_coherent(&ha->pdev->dev, SFP_DEV_SIZE, 4492 + dma_free_coherent(&ha->pdev->dev, sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE, 4493 4493 ha->flt, ha->flt_dma); 4494 4494 4495 4495 fail_flt_buffer:
+2 -2
drivers/target/sbp/sbp_target.c
··· 1960 1960 container_of(wwn, struct sbp_tport, tport_wwn); 1961 1961 1962 1962 struct sbp_tpg *tpg; 1963 - unsigned long tpgt; 1963 + u16 tpgt; 1964 1964 int ret; 1965 1965 1966 1966 if (strstr(name, "tpgt_") != name) 1967 1967 return ERR_PTR(-EINVAL); 1968 - if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX) 1968 + if (kstrtou16(name + 5, 10, &tpgt)) 1969 1969 return ERR_PTR(-EINVAL); 1970 1970 1971 1971 if (tport->tpg) {
+1 -1
drivers/ufs/host/ufs-amd-versal2.c
··· 367 367 { 368 368 int ret = 0; 369 369 370 - if (status == PRE_CHANGE) { 370 + if (status == POST_CHANGE) { 371 371 ret = ufs_versal2_phy_init(hba); 372 372 if (ret) 373 373 dev_err(hba->dev, "Phy init failed (%d)\n", ret);
+12
drivers/vfio/pci/vfio_pci_dmabuf.c
··· 20 20 u8 revoked : 1; 21 21 }; 22 22 23 + static int vfio_pci_dma_buf_pin(struct dma_buf_attachment *attachment) 24 + { 25 + return -EOPNOTSUPP; 26 + } 27 + 28 + static void vfio_pci_dma_buf_unpin(struct dma_buf_attachment *attachment) 29 + { 30 + /* Do nothing */ 31 + } 32 + 23 33 static int vfio_pci_dma_buf_attach(struct dma_buf *dmabuf, 24 34 struct dma_buf_attachment *attachment) 25 35 { ··· 86 76 } 87 77 88 78 static const struct dma_buf_ops vfio_pci_dmabuf_ops = { 79 + .pin = vfio_pci_dma_buf_pin, 80 + .unpin = vfio_pci_dma_buf_unpin, 89 81 .attach = vfio_pci_dma_buf_attach, 90 82 .map_dma_buf = vfio_pci_dma_buf_map, 91 83 .unmap_dma_buf = vfio_pci_dma_buf_unmap,
+2
fs/9p/vfs_dir.c
··· 242 242 .iterate_shared = v9fs_dir_readdir, 243 243 .open = v9fs_file_open, 244 244 .release = v9fs_dir_release, 245 + .setlease = simple_nosetlease, 245 246 }; 246 247 247 248 const struct file_operations v9fs_dir_operations_dotl = { ··· 252 251 .open = v9fs_file_open, 253 252 .release = v9fs_dir_release, 254 253 .fsync = v9fs_file_fsync_dotl, 254 + .setlease = simple_nosetlease, 255 255 };
-22
fs/btrfs/disk-io.c
··· 498 498 #define btree_migrate_folio NULL 499 499 #endif 500 500 501 - static int btree_writepages(struct address_space *mapping, 502 - struct writeback_control *wbc) 503 - { 504 - int ret; 505 - 506 - if (wbc->sync_mode == WB_SYNC_NONE) { 507 - struct btrfs_fs_info *fs_info; 508 - 509 - if (wbc->for_kupdate) 510 - return 0; 511 - 512 - fs_info = inode_to_fs_info(mapping->host); 513 - /* this is a bit racy, but that's ok */ 514 - ret = __percpu_counter_compare(&fs_info->dirty_metadata_bytes, 515 - BTRFS_DIRTY_METADATA_THRESH, 516 - fs_info->dirty_metadata_batch); 517 - if (ret < 0) 518 - return 0; 519 - } 520 - return btree_write_cache_pages(mapping, wbc); 521 - } 522 - 523 501 static bool btree_release_folio(struct folio *folio, gfp_t gfp_flags) 524 502 { 525 503 if (folio_test_writeback(folio) || folio_test_dirty(folio))
+1 -2
fs/btrfs/extent_io.c
··· 2286 2286 } 2287 2287 } 2288 2288 2289 - int btree_write_cache_pages(struct address_space *mapping, 2290 - struct writeback_control *wbc) 2289 + int btree_writepages(struct address_space *mapping, struct writeback_control *wbc) 2291 2290 { 2292 2291 struct btrfs_eb_write_context ctx = { .wbc = wbc }; 2293 2292 struct btrfs_fs_info *fs_info = inode_to_fs_info(mapping->host);
+1 -2
fs/btrfs/extent_io.h
··· 237 237 u64 start, u64 end, struct writeback_control *wbc, 238 238 bool pages_dirty); 239 239 int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc); 240 - int btree_write_cache_pages(struct address_space *mapping, 241 - struct writeback_control *wbc); 240 + int btree_writepages(struct address_space *mapping, struct writeback_control *wbc); 242 241 void btrfs_btree_wait_writeback_range(struct btrfs_fs_info *fs_info, u64 start, u64 end); 243 242 void btrfs_readahead(struct readahead_control *rac); 244 243 int set_folio_extent_mapped(struct folio *folio);
+1
fs/btrfs/zlib.c
··· 139 139 data_in = kmap_local_folio(folio, offset); 140 140 memcpy(workspace->buf + cur - filepos, data_in, copy_length); 141 141 kunmap_local(data_in); 142 + folio_put(folio); 142 143 cur += copy_length; 143 144 } 144 145 return 0;
+2
fs/ceph/dir.c
··· 2214 2214 .fsync = ceph_fsync, 2215 2215 .lock = ceph_lock, 2216 2216 .flock = ceph_flock, 2217 + .setlease = simple_nosetlease, 2217 2218 }; 2218 2219 2219 2220 const struct file_operations ceph_snapdir_fops = { ··· 2222 2221 .llseek = ceph_dir_llseek, 2223 2222 .open = ceph_open, 2224 2223 .release = ceph_release, 2224 + .setlease = simple_nosetlease, 2225 2225 }; 2226 2226 2227 2227 const struct inode_operations ceph_dir_iops = {
+10
fs/dcache.c
··· 1104 1104 return de; 1105 1105 } 1106 1106 1107 + /** 1108 + * d_dispose_if_unused - move unreferenced dentries to shrink list 1109 + * @dentry: dentry in question 1110 + * @dispose: head of shrink list 1111 + * 1112 + * If dentry has no external references, move it to shrink list. 1113 + * 1114 + * NOTE!!! The caller is responsible for preventing eviction of the dentry by 1115 + * holding dentry->d_inode->i_lock or equivalent. 1116 + */ 1107 1117 void d_dispose_if_unused(struct dentry *dentry, struct list_head *dispose) 1108 1118 { 1109 1119 spin_lock(&dentry->d_lock);
+1 -1
fs/efivarfs/vars.c
··· 552 552 err = __efivar_entry_get(entry, attributes, size, data); 553 553 efivar_unlock(); 554 554 555 - return 0; 555 + return err; 556 556 } 557 557 558 558 /**
+12 -4
fs/fs-writeback.c
··· 2492 2492 wb_wakeup(wb); 2493 2493 } 2494 2494 rcu_read_unlock(); 2495 - schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ); 2495 + if (dirtytime_expire_interval) 2496 + schedule_delayed_work(&dirtytime_work, 2497 + round_jiffies_relative(dirtytime_expire_interval * HZ)); 2496 2498 } 2497 2499 2498 2500 static int dirtytime_interval_handler(const struct ctl_table *table, int write, ··· 2503 2501 int ret; 2504 2502 2505 2503 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); 2506 - if (ret == 0 && write) 2507 - mod_delayed_work(system_percpu_wq, &dirtytime_work, 0); 2504 + if (ret == 0 && write) { 2505 + if (dirtytime_expire_interval) 2506 + mod_delayed_work(system_percpu_wq, &dirtytime_work, 0); 2507 + else 2508 + cancel_delayed_work_sync(&dirtytime_work); 2509 + } 2508 2510 return ret; 2509 2511 } 2510 2512 ··· 2525 2519 2526 2520 static int __init start_dirtytime_writeback(void) 2527 2521 { 2528 - schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ); 2522 + if (dirtytime_expire_interval) 2523 + schedule_delayed_work(&dirtytime_work, 2524 + round_jiffies_relative(dirtytime_expire_interval * HZ)); 2529 2525 register_sysctl_init("vm", vm_fs_writeback_table); 2530 2526 return 0; 2531 2527 }
+37 -29
fs/fuse/dir.c
··· 32 32 spinlock_t lock; 33 33 }; 34 34 35 - #define HASH_BITS 5 36 - #define HASH_SIZE (1 << HASH_BITS) 37 - static struct dentry_bucket dentry_hash[HASH_SIZE]; 35 + #define FUSE_HASH_BITS 5 36 + #define FUSE_HASH_SIZE (1 << FUSE_HASH_BITS) 37 + static struct dentry_bucket dentry_hash[FUSE_HASH_SIZE]; 38 38 struct delayed_work dentry_tree_work; 39 39 40 40 /* Minimum invalidation work queue frequency */ ··· 83 83 84 84 static inline struct dentry_bucket *get_dentry_bucket(struct dentry *dentry) 85 85 { 86 - int i = hash_ptr(dentry, HASH_BITS); 86 + int i = hash_ptr(dentry, FUSE_HASH_BITS); 87 87 88 88 return &dentry_hash[i]; 89 89 } ··· 164 164 struct rb_node *node; 165 165 int i; 166 166 167 - for (i = 0; i < HASH_SIZE; i++) { 167 + for (i = 0; i < FUSE_HASH_SIZE; i++) { 168 168 spin_lock(&dentry_hash[i].lock); 169 169 node = rb_first(&dentry_hash[i].tree); 170 170 while (node) { 171 171 fd = rb_entry(node, struct fuse_dentry, node); 172 - if (time_after64(get_jiffies_64(), fd->time)) { 173 - rb_erase(&fd->node, &dentry_hash[i].tree); 174 - RB_CLEAR_NODE(&fd->node); 172 + if (!time_before64(fd->time, get_jiffies_64())) 173 + break; 174 + 175 + rb_erase(&fd->node, &dentry_hash[i].tree); 176 + RB_CLEAR_NODE(&fd->node); 177 + spin_lock(&fd->dentry->d_lock); 178 + /* If dentry is still referenced, let next dput release it */ 179 + fd->dentry->d_flags |= DCACHE_OP_DELETE; 180 + spin_unlock(&fd->dentry->d_lock); 181 + d_dispose_if_unused(fd->dentry, &dispose); 182 + if (need_resched()) { 175 183 spin_unlock(&dentry_hash[i].lock); 176 - d_dispose_if_unused(fd->dentry, &dispose); 177 184 cond_resched(); 178 185 spin_lock(&dentry_hash[i].lock); 179 - } else 180 - break; 186 + } 181 187 node = rb_first(&dentry_hash[i].tree); 182 188 } 183 189 spin_unlock(&dentry_hash[i].lock); 184 - shrink_dentry_list(&dispose); 185 190 } 191 + shrink_dentry_list(&dispose); 186 192 187 193 if (inval_wq) 188 194 schedule_delayed_work(&dentry_tree_work, ··· 219 213 { 220 214 int i; 221 215 222 - for (i = 0; i < HASH_SIZE; i++) { 216 + for (i = 0; i < FUSE_HASH_SIZE; i++) { 223 217 spin_lock_init(&dentry_hash[i].lock); 224 218 dentry_hash[i].tree = RB_ROOT; 225 219 } ··· 233 227 inval_wq = 0; 234 228 cancel_delayed_work_sync(&dentry_tree_work); 235 229 236 - for (i = 0; i < HASH_SIZE; i++) 230 + for (i = 0; i < FUSE_HASH_SIZE; i++) 237 231 WARN_ON_ONCE(!RB_EMPTY_ROOT(&dentry_hash[i].tree)); 238 232 } 239 233 ··· 485 479 return 0; 486 480 } 487 481 488 - static void fuse_dentry_prune(struct dentry *dentry) 482 + static void fuse_dentry_release(struct dentry *dentry) 489 483 { 490 484 struct fuse_dentry *fd = dentry->d_fsdata; 491 485 492 486 if (!RB_EMPTY_NODE(&fd->node)) 493 487 fuse_dentry_tree_del_node(dentry); 494 - } 495 - 496 - static void fuse_dentry_release(struct dentry *dentry) 497 - { 498 - struct fuse_dentry *fd = dentry->d_fsdata; 499 - 500 488 kfree_rcu(fd, rcu); 501 489 } 502 490 ··· 527 527 .d_revalidate = fuse_dentry_revalidate, 528 528 .d_delete = fuse_dentry_delete, 529 529 .d_init = fuse_dentry_init, 530 - .d_prune = fuse_dentry_prune, 531 530 .d_release = fuse_dentry_release, 532 531 .d_automount = fuse_dentry_automount, 533 532 }; ··· 1583 1584 { 1584 1585 int err = -ENOTDIR; 1585 1586 struct inode *parent; 1586 - struct dentry *dir; 1587 - struct dentry *entry; 1587 + struct dentry *dir = NULL; 1588 + struct dentry *entry = NULL; 1588 1589 1589 1590 parent = fuse_ilookup(fc, parent_nodeid, NULL); 1590 1591 if (!parent) ··· 1597 1598 dir = d_find_alias(parent); 1598 1599 if (!dir) 1599 1600 goto put_parent; 1600 - 1601 - entry = start_removing_noperm(dir, name); 1602 - dput(dir); 1603 - if (IS_ERR(entry)) 1604 - goto put_parent; 1601 + while (!entry) { 1602 + struct dentry *child = try_lookup_noperm(name, dir); 1603 + if (!child || IS_ERR(child)) 1604 + goto put_parent; 1605 + entry = start_removing_dentry(dir, child); 1606 + dput(child); 1607 + if (IS_ERR(entry)) 1608 + goto put_parent; 1609 + if (!d_same_name(entry, dir, name)) { 1610 + end_removing(entry); 1611 + entry = NULL; 1612 + } 1613 + } 1605 1614 1606 1615 fuse_dir_changed(parent); 1607 1616 if (!(flags & FUSE_EXPIRE_ONLY)) ··· 1647 1640 1648 1641 end_removing(entry); 1649 1642 put_parent: 1643 + dput(dir); 1650 1644 iput(parent); 1651 1645 return err; 1652 1646 }
+1
fs/gfs2/file.c
··· 1608 1608 .lock = gfs2_lock, 1609 1609 .flock = gfs2_flock, 1610 1610 .llseek = default_llseek, 1611 + .setlease = simple_nosetlease, 1611 1612 .fop_flags = FOP_ASYNC_LOCK, 1612 1613 }; 1613 1614
+1
fs/iomap/buffered-io.c
··· 851 851 } 852 852 853 853 folio_get(folio); 854 + folio_wait_stable(folio); 854 855 return folio; 855 856 } 856 857
+1
fs/nfs/dir.c
··· 66 66 .open = nfs_opendir, 67 67 .release = nfs_closedir, 68 68 .fsync = nfs_fsync_dir, 69 + .setlease = simple_nosetlease, 69 70 }; 70 71 71 72 const struct address_space_operations nfs_dir_aops = {
-2
fs/nfs/nfs4file.c
··· 431 431 static int nfs4_setlease(struct file *file, int arg, struct file_lease **lease, 432 432 void **priv) 433 433 { 434 - if (!S_ISREG(file_inode(file)->i_mode)) 435 - return -EINVAL; 436 434 return nfs4_proc_setlease(file, arg, lease, priv); 437 435 } 438 436
+3
fs/readdir.c
··· 316 316 struct getdents_callback buf = { 317 317 .ctx.actor = filldir, 318 318 .ctx.count = count, 319 + .ctx.dt_flags_mask = FILLDIR_FLAG_NOINTR, 319 320 .current_dir = dirent 320 321 }; 321 322 int error; ··· 401 400 struct getdents_callback64 buf = { 402 401 .ctx.actor = filldir64, 403 402 .ctx.count = count, 403 + .ctx.dt_flags_mask = FILLDIR_FLAG_NOINTR, 404 404 .current_dir = dirent 405 405 }; 406 406 int error; ··· 571 569 struct compat_getdents_callback buf = { 572 570 .ctx.actor = compat_filldir, 573 571 .ctx.count = count, 572 + .ctx.dt_flags_mask = FILLDIR_FLAG_NOINTR, 574 573 .current_dir = dirent, 575 574 }; 576 575 int error;
+4 -1
fs/romfs/super.c
··· 458 458 459 459 #ifdef CONFIG_BLOCK 460 460 if (!sb->s_mtd) { 461 - sb_set_blocksize(sb, ROMBSIZE); 461 + if (!sb_set_blocksize(sb, ROMBSIZE)) { 462 + errorf(fc, "romfs: unable to set blocksize\n"); 463 + return -EINVAL; 464 + } 462 465 } else { 463 466 sb->s_blocksize = ROMBSIZE; 464 467 sb->s_blocksize_bits = blksize_bits(ROMBSIZE);
+1 -3
fs/smb/client/cifsfs.c
··· 1149 1149 struct inode *inode = file_inode(file); 1150 1150 struct cifsFileInfo *cfile = file->private_data; 1151 1151 1152 - if (!S_ISREG(inode->i_mode)) 1153 - return -EINVAL; 1154 - 1155 1152 /* Check if file is oplocked if this is request for new lease */ 1156 1153 if (arg == F_UNLCK || 1157 1154 ((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) || ··· 1709 1712 .remap_file_range = cifs_remap_file_range, 1710 1713 .llseek = generic_file_llseek, 1711 1714 .fsync = cifs_dir_fsync, 1715 + .setlease = simple_nosetlease, 1712 1716 }; 1713 1717 1714 1718 static void
+1
fs/vboxsf/dir.c
··· 186 186 .release = vboxsf_dir_release, 187 187 .read = generic_read_dir, 188 188 .llseek = generic_file_llseek, 189 + .setlease = simple_nosetlease, 189 190 }; 190 191 191 192 /*
+9
include/linux/cma.h
··· 57 57 58 58 extern void cma_reserve_pages_on_error(struct cma *cma); 59 59 60 + #ifdef CONFIG_DMA_CMA 61 + extern bool cma_skip_dt_default_reserved_mem(void); 62 + #else 63 + static inline bool cma_skip_dt_default_reserved_mem(void) 64 + { 65 + return false; 66 + } 67 + #endif 68 + 60 69 #ifdef CONFIG_CMA 61 70 struct folio *cma_alloc_folio(struct cma *cma, int order, gfp_t gfp); 62 71 bool cma_free_folio(struct cma *cma, const struct folio *folio);
+5 -1
include/linux/fs.h
··· 1855 1855 * INT_MAX unlimited 1856 1856 */ 1857 1857 int count; 1858 + /* @actor supports these flags in d_type high bits */ 1859 + unsigned int dt_flags_mask; 1858 1860 }; 1859 1861 1860 1862 /* If OR-ed with d_type, pending signals are not checked */ ··· 3526 3524 const char *name, int namelen, 3527 3525 u64 ino, unsigned type) 3528 3526 { 3529 - return ctx->actor(ctx, name, namelen, ctx->pos, ino, type); 3527 + unsigned int dt_mask = S_DT_MASK | ctx->dt_flags_mask; 3528 + 3529 + return ctx->actor(ctx, name, namelen, ctx->pos, ino, type & dt_mask); 3530 3530 } 3531 3531 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) 3532 3532 {
+14
include/linux/kasan.h
··· 641 641 __kasan_unpoison_vmap_areas(vms, nr_vms, flags); 642 642 } 643 643 644 + void __kasan_vrealloc(const void *start, unsigned long old_size, 645 + unsigned long new_size); 646 + 647 + static __always_inline void kasan_vrealloc(const void *start, 648 + unsigned long old_size, 649 + unsigned long new_size) 650 + { 651 + if (kasan_enabled()) 652 + __kasan_vrealloc(start, old_size, new_size); 653 + } 654 + 644 655 #else /* CONFIG_KASAN_VMALLOC */ 645 656 646 657 static inline void kasan_populate_early_vm_area_shadow(void *start, ··· 680 669 kasan_unpoison_vmap_areas(struct vm_struct **vms, int nr_vms, 681 670 kasan_vmalloc_flags_t flags) 682 671 { } 672 + 673 + static inline void kasan_vrealloc(const void *start, unsigned long old_size, 674 + unsigned long new_size) { } 683 675 684 676 #endif /* CONFIG_KASAN_VMALLOC */ 685 677
+6
include/linux/memfd.h
··· 17 17 * to by vm_flags_ptr. 18 18 */ 19 19 int memfd_check_seals_mmap(struct file *file, vm_flags_t *vm_flags_ptr); 20 + struct file *memfd_alloc_file(const char *name, unsigned int flags); 20 21 #else 21 22 static inline long memfd_fcntl(struct file *f, unsigned int c, unsigned int a) 22 23 { ··· 31 30 vm_flags_t *vm_flags_ptr) 32 31 { 33 32 return 0; 33 + } 34 + 35 + static inline struct file *memfd_alloc_file(const char *name, unsigned int flags) 36 + { 37 + return ERR_PTR(-EINVAL); 34 38 } 35 39 #endif 36 40
+6 -3
include/linux/memremap.h
··· 224 224 } 225 225 226 226 #ifdef CONFIG_ZONE_DEVICE 227 - void zone_device_page_init(struct page *page, unsigned int order); 227 + void zone_device_page_init(struct page *page, struct dev_pagemap *pgmap, 228 + unsigned int order); 228 229 void *memremap_pages(struct dev_pagemap *pgmap, int nid); 229 230 void memunmap_pages(struct dev_pagemap *pgmap); 230 231 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap); ··· 235 234 236 235 unsigned long memremap_compat_align(void); 237 236 238 - static inline void zone_device_folio_init(struct folio *folio, unsigned int order) 237 + static inline void zone_device_folio_init(struct folio *folio, 238 + struct dev_pagemap *pgmap, 239 + unsigned int order) 239 240 { 240 - zone_device_page_init(&folio->page, order); 241 + zone_device_page_init(&folio->page, pgmap, order); 241 242 if (order) 242 243 folio_set_large_rmappable(folio); 243 244 }
+5
include/linux/sched.h
··· 1776 1776 (current->nr_cpus_allowed == 1); 1777 1777 } 1778 1778 1779 + static __always_inline bool is_user_task(struct task_struct *task) 1780 + { 1781 + return task->mm && !(task->flags & (PF_KTHREAD | PF_USER_WORKER)); 1782 + } 1783 + 1779 1784 /* Per-process atomic flags. */ 1780 1785 #define PFA_NO_NEW_PRIVS 0 /* May not gain new privileges. */ 1781 1786 #define PFA_SPREAD_PAGE 1 /* Spread page cache over cpuset */
+7 -6
include/net/bonding.h
··· 521 521 static inline unsigned long slave_oldest_target_arp_rx(struct bonding *bond, 522 522 struct slave *slave) 523 523 { 524 + unsigned long tmp, ret = READ_ONCE(slave->target_last_arp_rx[0]); 524 525 int i = 1; 525 - unsigned long ret = slave->target_last_arp_rx[0]; 526 526 527 - for (; (i < BOND_MAX_ARP_TARGETS) && bond->params.arp_targets[i]; i++) 528 - if (time_before(slave->target_last_arp_rx[i], ret)) 529 - ret = slave->target_last_arp_rx[i]; 530 - 527 + for (; (i < BOND_MAX_ARP_TARGETS) && bond->params.arp_targets[i]; i++) { 528 + tmp = READ_ONCE(slave->target_last_arp_rx[i]); 529 + if (time_before(tmp, ret)) 530 + ret = tmp; 531 + } 531 532 return ret; 532 533 } 533 534 ··· 538 537 if (bond->params.arp_all_targets == BOND_ARP_TARGETS_ALL) 539 538 return slave_oldest_target_arp_rx(bond, slave); 540 539 541 - return slave->last_rx; 540 + return READ_ONCE(slave->last_rx); 542 541 } 543 542 544 543 static inline void slave_update_last_tx(struct slave *slave)
+2
include/net/nfc/nfc.h
··· 219 219 220 220 int nfc_register_device(struct nfc_dev *dev); 221 221 222 + void nfc_unregister_rfkill(struct nfc_dev *dev); 223 + void nfc_remove_device(struct nfc_dev *dev); 222 224 void nfc_unregister_device(struct nfc_dev *dev); 223 225 224 226 /**
+10 -6
kernel/dma/contiguous.c
··· 91 91 } 92 92 early_param("cma", early_cma); 93 93 94 + /* 95 + * cma_skip_dt_default_reserved_mem - This is called from the 96 + * reserved_mem framework to detect if the default cma region is being 97 + * set by the "cma=" kernel parameter. 98 + */ 99 + bool __init cma_skip_dt_default_reserved_mem(void) 100 + { 101 + return size_cmdline != -1; 102 + } 103 + 94 104 #ifdef CONFIG_DMA_NUMA_CMA 95 105 96 106 static struct cma *dma_contiguous_numa_area[MAX_NUMNODES]; ··· 479 469 bool default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL); 480 470 struct cma *cma; 481 471 int err; 482 - 483 - if (size_cmdline != -1 && default_cma) { 484 - pr_info("Reserved memory: bypass %s node, using cmdline CMA params instead\n", 485 - rmem->name); 486 - return -EBUSY; 487 - } 488 472 489 473 if (!of_get_flat_dt_prop(node, "reusable", NULL) || 490 474 of_get_flat_dt_prop(node, "no-map", NULL))
+6 -1
kernel/dma/pool.c
··· 277 277 { 278 278 struct gen_pool *pool = NULL; 279 279 struct page *page; 280 + bool pool_found = false; 280 281 281 282 while ((pool = dma_guess_pool(pool, gfp))) { 283 + pool_found = true; 282 284 page = __dma_alloc_from_pool(dev, size, pool, cpu_addr, 283 285 phys_addr_ok); 284 286 if (page) 285 287 return page; 286 288 } 287 289 288 - WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev)); 290 + if (pool_found) 291 + WARN(!(gfp & __GFP_NOWARN), "DMA pool exhausted for %s\n", dev_name(dev)); 292 + else 293 + WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev)); 289 294 return NULL; 290 295 } 291 296
+1 -1
kernel/events/callchain.c
··· 246 246 247 247 if (user && !crosstask) { 248 248 if (!user_mode(regs)) { 249 - if (current->flags & (PF_KTHREAD | PF_USER_WORKER)) 249 + if (!is_user_task(current)) 250 250 goto exit_put; 251 251 regs = task_pt_regs(current); 252 252 }
+3 -3
kernel/events/core.c
··· 7460 7460 if (user_mode(regs)) { 7461 7461 regs_user->abi = perf_reg_abi(current); 7462 7462 regs_user->regs = regs; 7463 - } else if (!(current->flags & (PF_KTHREAD | PF_USER_WORKER))) { 7463 + } else if (is_user_task(current)) { 7464 7464 perf_get_regs_user(regs_user, regs); 7465 7465 } else { 7466 7466 regs_user->abi = PERF_SAMPLE_REGS_ABI_NONE; ··· 8100 8100 * Try IRQ-safe get_user_page_fast_only first. 8101 8101 * If failed, leave phys_addr as 0. 8102 8102 */ 8103 - if (!(current->flags & (PF_KTHREAD | PF_USER_WORKER))) { 8103 + if (is_user_task(current)) { 8104 8104 struct page *p; 8105 8105 8106 8106 pagefault_disable(); ··· 8215 8215 { 8216 8216 bool kernel = !event->attr.exclude_callchain_kernel; 8217 8217 bool user = !event->attr.exclude_callchain_user && 8218 - !(current->flags & (PF_KTHREAD | PF_USER_WORKER)); 8218 + is_user_task(current); 8219 8219 /* Disallow cross-task user callchains. */ 8220 8220 bool crosstask = event->ctx->task && event->ctx->task != current; 8221 8221 bool defer_user = IS_ENABLED(CONFIG_UNWIND_USER) && user &&
+11 -1
kernel/liveupdate/kexec_handover.c
··· 255 255 if (is_folio && info.order) 256 256 prep_compound_page(page, info.order); 257 257 258 + /* Always mark headpage's codetag as empty to avoid accounting mismatch */ 259 + clear_page_tag_ref(page); 260 + if (!is_folio) { 261 + /* Also do that for the non-compound tail pages */ 262 + for (unsigned int i = 1; i < nr_pages; i++) 263 + clear_page_tag_ref(page + i); 264 + } 265 + 258 266 adjust_managed_page_count(page, nr_pages); 259 267 return page; 260 268 } ··· 1014 1006 chunk->phys[idx++] = phys; 1015 1007 if (idx == ARRAY_SIZE(chunk->phys)) { 1016 1008 chunk = new_vmalloc_chunk(chunk); 1017 - if (!chunk) 1009 + if (!chunk) { 1010 + err = -ENOMEM; 1018 1011 goto err_free; 1012 + } 1019 1013 idx = 0; 1020 1014 } 1021 1015 }
+12
kernel/sched/deadline.c
··· 1034 1034 return; 1035 1035 } 1036 1036 1037 + /* 1038 + * When [4] D->A is followed by [1] A->B, dl_defer_running 1039 + * needs to be cleared, otherwise it will fail to properly 1040 + * start the zero-laxity timer. 1041 + */ 1042 + dl_se->dl_defer_running = 0; 1037 1043 replenish_dl_new_period(dl_se, rq); 1038 1044 } else if (dl_server(dl_se) && dl_se->dl_defer) { 1039 1045 /* ··· 1661 1655 * dl_server_active = 1; 1662 1656 * enqueue_dl_entity() 1663 1657 * update_dl_entity(WAKEUP) 1658 + * if (dl_time_before() || dl_entity_overflow()) 1659 + * dl_defer_running = 0; 1660 + * replenish_dl_new_period(); 1661 + * // fwd period 1662 + * dl_throttled = 1; 1663 + * dl_defer_armed = 1; 1664 1664 * if (!dl_defer_running) 1665 1665 * dl_defer_armed = 1; 1666 1666 * dl_throttled = 1;
+5 -1
kernel/vmcore_info.c
··· 36 36 time64_t timestamp; 37 37 }; 38 38 39 - static struct hwerr_info hwerr_data[HWERR_RECOV_MAX]; 39 + /* 40 + * The hwerr_data[] array is declared with global scope so that it remains 41 + * accessible to vmcoreinfo even when Link Time Optimization (LTO) is enabled. 42 + */ 43 + struct hwerr_info hwerr_data[HWERR_RECOV_MAX]; 40 44 41 45 Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type, 42 46 void *data, size_t data_len)
+3 -2
lib/flex_proportions.c
··· 64 64 bool fprop_new_period(struct fprop_global *p, int periods) 65 65 { 66 66 s64 events = percpu_counter_sum(&p->events); 67 + unsigned long flags; 67 68 68 69 /* 69 70 * Don't do anything if there are no events. 70 71 */ 71 72 if (events <= 1) 72 73 return false; 73 - preempt_disable_nested(); 74 + local_irq_save(flags); 74 75 write_seqcount_begin(&p->sequence); 75 76 if (periods < 64) 76 77 events -= events >> periods; ··· 79 78 percpu_counter_add(&p->events, -events); 80 79 p->period += periods; 81 80 write_seqcount_end(&p->sequence); 82 - preempt_enable_nested(); 81 + local_irq_restore(flags); 83 82 84 83 return true; 85 84 }
+3 -1
lib/test_hmm.c
··· 662 662 goto error; 663 663 } 664 664 665 - zone_device_folio_init(page_folio(dpage), order); 665 + zone_device_folio_init(page_folio(dpage), 666 + page_pgmap(folio_page(page_folio(dpage), 0)), 667 + order); 666 668 dpage->zone_device_data = rpage; 667 669 return dpage; 668 670
+21
mm/kasan/common.c
··· 606 606 __kasan_unpoison_vmalloc(addr, size, flags | KASAN_VMALLOC_KEEP_TAG); 607 607 } 608 608 } 609 + 610 + void __kasan_vrealloc(const void *addr, unsigned long old_size, 611 + unsigned long new_size) 612 + { 613 + if (new_size < old_size) { 614 + kasan_poison_last_granule(addr, new_size); 615 + 616 + new_size = round_up(new_size, KASAN_GRANULE_SIZE); 617 + old_size = round_up(old_size, KASAN_GRANULE_SIZE); 618 + if (new_size < old_size) 619 + __kasan_poison_vmalloc(addr + new_size, 620 + old_size - new_size); 621 + } else if (new_size > old_size) { 622 + old_size = round_down(old_size, KASAN_GRANULE_SIZE); 623 + __kasan_unpoison_vmalloc(addr + old_size, 624 + new_size - old_size, 625 + KASAN_VMALLOC_PROT_NORMAL | 626 + KASAN_VMALLOC_VM_ALLOC | 627 + KASAN_VMALLOC_KEEP_TAG); 628 + } 629 + } 609 630 #endif
+19 -4
mm/kfence/core.c
··· 596 596 static unsigned long kfence_init_pool(void) 597 597 { 598 598 unsigned long addr, start_pfn; 599 - int i; 599 + int i, rand; 600 600 601 601 if (!arch_kfence_init_pool()) 602 602 return (unsigned long)__kfence_pool; ··· 647 647 INIT_LIST_HEAD(&meta->list); 648 648 raw_spin_lock_init(&meta->lock); 649 649 meta->state = KFENCE_OBJECT_UNUSED; 650 - meta->addr = addr; /* Initialize for validation in metadata_to_pageaddr(). */ 651 - list_add_tail(&meta->list, &kfence_freelist); 650 + /* Use addr to randomize the freelist. */ 651 + meta->addr = i; 652 652 653 653 /* Protect the right redzone. */ 654 - if (unlikely(!kfence_protect(addr + PAGE_SIZE))) 654 + if (unlikely(!kfence_protect(addr + 2 * i * PAGE_SIZE + PAGE_SIZE))) 655 655 goto reset_slab; 656 + } 656 657 658 + for (i = CONFIG_KFENCE_NUM_OBJECTS; i > 0; i--) { 659 + rand = get_random_u32_below(i); 660 + swap(kfence_metadata_init[i - 1].addr, kfence_metadata_init[rand].addr); 661 + } 662 + 663 + for (i = 0; i < CONFIG_KFENCE_NUM_OBJECTS; i++) { 664 + struct kfence_metadata *meta_1 = &kfence_metadata_init[i]; 665 + struct kfence_metadata *meta_2 = &kfence_metadata_init[meta_1->addr]; 666 + 667 + list_add_tail(&meta_2->list, &kfence_freelist); 668 + } 669 + for (i = 0; i < CONFIG_KFENCE_NUM_OBJECTS; i++) { 670 + kfence_metadata_init[i].addr = addr; 657 671 addr += 2 * PAGE_SIZE; 658 672 } 659 673 ··· 680 666 return 0; 681 667 682 668 reset_slab: 669 + addr += 2 * i * PAGE_SIZE; 683 670 for (i = 0; i < KFENCE_POOL_SIZE / PAGE_SIZE; i++) { 684 671 struct page *page; 685 672
+2 -2
mm/memfd.c
··· 456 456 return ERR_PTR(error); 457 457 } 458 458 459 - static struct file *alloc_file(const char *name, unsigned int flags) 459 + struct file *memfd_alloc_file(const char *name, unsigned int flags) 460 460 { 461 461 unsigned int *file_seals; 462 462 struct file *file; ··· 520 520 return PTR_ERR(name); 521 521 522 522 fd_flags = (flags & MFD_CLOEXEC) ? O_CLOEXEC : 0; 523 - return FD_ADD(fd_flags, alloc_file(name, flags)); 523 + return FD_ADD(fd_flags, memfd_alloc_file(name, flags)); 524 524 }
+6 -4
mm/memfd_luo.c
··· 78 78 #include <linux/liveupdate.h> 79 79 #include <linux/shmem_fs.h> 80 80 #include <linux/vmalloc.h> 81 + #include <linux/memfd.h> 81 82 #include "internal.h" 82 83 83 84 static int memfd_luo_preserve_folios(struct file *file, ··· 444 443 if (!ser) 445 444 return -EINVAL; 446 445 447 - file = shmem_file_setup("", 0, VM_NORESERVE); 448 - 446 + file = memfd_alloc_file("", 0); 449 447 if (IS_ERR(file)) { 450 448 pr_err("failed to setup file: %pe\n", file); 451 - return PTR_ERR(file); 449 + err = PTR_ERR(file); 450 + goto free_ser; 452 451 } 453 452 454 453 vfs_setpos(file, ser->pos, MAX_LFS_FILESIZE); ··· 474 473 475 474 put_file: 476 475 fput(file); 477 - 476 + free_ser: 477 + kho_restore_free(ser); 478 478 return err; 479 479 } 480 480
+60 -39
mm/memory-failure.c
··· 692 692 unsigned long poisoned_pfn, struct to_kill *tk) 693 693 { 694 694 unsigned long pfn = 0; 695 + unsigned long hwpoison_vaddr; 696 + unsigned long mask; 695 697 696 698 if (pte_present(pte)) { 697 699 pfn = pte_pfn(pte); ··· 704 702 pfn = softleaf_to_pfn(entry); 705 703 } 706 704 707 - if (!pfn || pfn != poisoned_pfn) 705 + mask = ~((1UL << (shift - PAGE_SHIFT)) - 1); 706 + if (!pfn || pfn != (poisoned_pfn & mask)) 708 707 return 0; 709 708 710 - set_to_kill(tk, addr, shift); 709 + hwpoison_vaddr = addr + ((poisoned_pfn - pfn) << PAGE_SHIFT); 710 + set_to_kill(tk, hwpoison_vaddr, shift); 711 711 return 1; 712 712 } 713 713 ··· 1887 1883 return count; 1888 1884 } 1889 1885 1890 - static int folio_set_hugetlb_hwpoison(struct folio *folio, struct page *page) 1886 + #define MF_HUGETLB_FREED 0 /* freed hugepage */ 1887 + #define MF_HUGETLB_IN_USED 1 /* in-use hugepage */ 1888 + #define MF_HUGETLB_NON_HUGEPAGE 2 /* not a hugepage */ 1889 + #define MF_HUGETLB_FOLIO_PRE_POISONED 3 /* folio already poisoned */ 1890 + #define MF_HUGETLB_PAGE_PRE_POISONED 4 /* exact page already poisoned */ 1891 + #define MF_HUGETLB_RETRY 5 /* hugepage is busy, retry */ 1892 + /* 1893 + * Set hugetlb folio as hwpoisoned, update folio private raw hwpoison list 1894 + * to keep track of the poisoned pages. 1895 + */ 1896 + static int hugetlb_update_hwpoison(struct folio *folio, struct page *page) 1891 1897 { 1892 1898 struct llist_head *head; 1893 1899 struct raw_hwp_page *raw_hwp; 1894 1900 struct raw_hwp_page *p; 1895 - int ret = folio_test_set_hwpoison(folio) ? -EHWPOISON : 0; 1901 + int ret = folio_test_set_hwpoison(folio) ? MF_HUGETLB_FOLIO_PRE_POISONED : 0; 1896 1902 1897 1903 /* 1898 1904 * Once the hwpoison hugepage has lost reliable raw error info, ··· 1910 1896 * so skip to add additional raw error info. 1911 1897 */ 1912 1898 if (folio_test_hugetlb_raw_hwp_unreliable(folio)) 1913 - return -EHWPOISON; 1899 + return MF_HUGETLB_FOLIO_PRE_POISONED; 1914 1900 head = raw_hwp_list_head(folio); 1915 1901 llist_for_each_entry(p, head->first, node) { 1916 1902 if (p->page == page) 1917 - return -EHWPOISON; 1903 + return MF_HUGETLB_PAGE_PRE_POISONED; 1918 1904 } 1919 1905 1920 1906 raw_hwp = kmalloc(sizeof(struct raw_hwp_page), GFP_ATOMIC); 1921 1907 if (raw_hwp) { 1922 1908 raw_hwp->page = page; 1923 1909 llist_add(&raw_hwp->node, head); 1924 - /* the first error event will be counted in action_result(). */ 1925 - if (ret) 1926 - num_poisoned_pages_inc(page_to_pfn(page)); 1927 1910 } else { 1928 1911 /* 1929 1912 * Failed to save raw error info. We no longer trace all ··· 1968 1957 1969 1958 /* 1970 1959 * Called from hugetlb code with hugetlb_lock held. 1971 - * 1972 - * Return values: 1973 - * 0 - free hugepage 1974 - * 1 - in-use hugepage 1975 - * 2 - not a hugepage 1976 - * -EBUSY - the hugepage is busy (try to retry) 1977 - * -EHWPOISON - the hugepage is already hwpoisoned 1978 1960 */ 1979 1961 int __get_huge_page_for_hwpoison(unsigned long pfn, int flags, 1980 1962 bool *migratable_cleared) 1981 1963 { 1982 1964 struct page *page = pfn_to_page(pfn); 1983 1965 struct folio *folio = page_folio(page); 1984 - int ret = 2; /* fallback to normal page handling */ 1985 1966 bool count_increased = false; 1967 + int ret, rc; 1986 1968 1987 - if (!folio_test_hugetlb(folio)) 1969 + if (!folio_test_hugetlb(folio)) { 1970 + ret = MF_HUGETLB_NON_HUGEPAGE; 1988 1971 goto out; 1989 - 1990 - if (flags & MF_COUNT_INCREASED) { 1991 - ret = 1; 1972 + } else if (flags & MF_COUNT_INCREASED) { 1973 + ret = MF_HUGETLB_IN_USED; 1992 1974 count_increased = true; 1993 1975 } else if (folio_test_hugetlb_freed(folio)) { 1994 - ret = 0; 1976 + ret = MF_HUGETLB_FREED; 1995 1977 } else if (folio_test_hugetlb_migratable(folio)) { 1996 - ret = folio_try_get(folio); 1997 - if (ret) 1978 + if (folio_try_get(folio)) { 1979 + ret = MF_HUGETLB_IN_USED; 1998 1980 count_increased = true; 1981 + } else { 1982 + ret = MF_HUGETLB_FREED; 1983 + } 1999 1984 } else { 2000 - ret = -EBUSY; 1985 + ret = MF_HUGETLB_RETRY; 2001 1986 if (!(flags & MF_NO_RETRY)) 2002 1987 goto out; 2003 1988 } 2004 1989 2005 - if (folio_set_hugetlb_hwpoison(folio, page)) { 2006 - ret = -EHWPOISON; 1990 + rc = hugetlb_update_hwpoison(folio, page); 1991 + if (rc >= MF_HUGETLB_FOLIO_PRE_POISONED) { 1992 + ret = rc; 2007 1993 goto out; 2008 1994 } 2009 1995 ··· 2025 2017 * with basic operations like hugepage allocation/free/demotion. 2026 2018 * So some of prechecks for hwpoison (pinning, and testing/setting 2027 2019 * PageHWPoison) should be done in single hugetlb_lock range. 2020 + * Returns: 2021 + * 0 - not hugetlb, or recovered 2022 + * -EBUSY - not recovered 2023 + * -EOPNOTSUPP - hwpoison_filter'ed 2024 + * -EHWPOISON - folio or exact page already poisoned 2025 + * -EFAULT - kill_accessing_process finds current->mm null 2028 2026 */ 2029 2027 static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb) 2030 2028 { 2031 - int res; 2029 + int res, rv; 2032 2030 struct page *p = pfn_to_page(pfn); 2033 2031 struct folio *folio; 2034 2032 unsigned long page_flags; ··· 2043 2029 *hugetlb = 1; 2044 2030 retry: 2045 2031 res = get_huge_page_for_hwpoison(pfn, flags, &migratable_cleared); 2046 - if (res == 2) { /* fallback to normal page handling */ 2032 + switch (res) { 2033 + case MF_HUGETLB_NON_HUGEPAGE: /* fallback to normal page handling */ 2047 2034 *hugetlb = 0; 2048 2035 return 0; 2049 - } else if (res == -EHWPOISON) { 2050 - if (flags & MF_ACTION_REQUIRED) { 2051 - folio = page_folio(p); 2052 - res = kill_accessing_process(current, folio_pfn(folio), flags); 2053 - } 2054 - action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); 2055 - return res; 2056 - } else if (res == -EBUSY) { 2036 + case MF_HUGETLB_RETRY: 2057 2037 if (!(flags & MF_NO_RETRY)) { 2058 2038 flags |= MF_NO_RETRY; 2059 2039 goto retry; 2060 2040 } 2061 2041 return action_result(pfn, MF_MSG_GET_HWPOISON, MF_IGNORED); 2042 + case MF_HUGETLB_FOLIO_PRE_POISONED: 2043 + case MF_HUGETLB_PAGE_PRE_POISONED: 2044 + rv = -EHWPOISON; 2045 + if (flags & MF_ACTION_REQUIRED) 2046 + rv = kill_accessing_process(current, pfn, flags); 2047 + if (res == MF_HUGETLB_PAGE_PRE_POISONED) 2048 + action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); 2049 + else 2050 + action_result(pfn, MF_MSG_HUGE, MF_FAILED); 2051 + return rv; 2052 + default: 2053 + WARN_ON((res != MF_HUGETLB_FREED) && (res != MF_HUGETLB_IN_USED)); 2054 + break; 2062 2055 } 2063 2056 2064 2057 folio = page_folio(p); ··· 2076 2055 if (migratable_cleared) 2077 2056 folio_set_hugetlb_migratable(folio); 2078 2057 folio_unlock(folio); 2079 - if (res == 1) 2058 + if (res == MF_HUGETLB_IN_USED) 2080 2059 folio_put(folio); 2081 2060 return -EOPNOTSUPP; 2082 2061 } ··· 2085 2064 * Handling free hugepage. The possible race with hugepage allocation 2086 2065 * or demotion can be prevented by PageHWPoison flag. 2087 2066 */ 2088 - if (res == 0) { 2067 + if (res == MF_HUGETLB_FREED) { 2089 2068 folio_unlock(folio); 2090 2069 if (__page_handle_poison(p) > 0) { 2091 2070 page_ref_inc(p);
+34 -1
mm/memremap.c
··· 477 477 } 478 478 } 479 479 480 - void zone_device_page_init(struct page *page, unsigned int order) 480 + void zone_device_page_init(struct page *page, struct dev_pagemap *pgmap, 481 + unsigned int order) 481 482 { 483 + struct page *new_page = page; 484 + unsigned int i; 485 + 482 486 VM_WARN_ON_ONCE(order > MAX_ORDER_NR_PAGES); 487 + 488 + for (i = 0; i < (1UL << order); ++i, ++new_page) { 489 + struct folio *new_folio = (struct folio *)new_page; 490 + 491 + /* 492 + * new_page could have been part of previous higher order folio 493 + * which encodes the order, in page + 1, in the flags bits. We 494 + * blindly clear bits which could have set my order field here, 495 + * including page head. 496 + */ 497 + new_page->flags.f &= ~0xffUL; /* Clear possible order, page head */ 498 + 499 + #ifdef NR_PAGES_IN_LARGE_FOLIO 500 + /* 501 + * This pointer math looks odd, but new_page could have been 502 + * part of a previous higher order folio, which sets _nr_pages 503 + * in page + 1 (new_page). Therefore, we use pointer casting to 504 + * correctly locate the _nr_pages bits within new_page which 505 + * could have modified by previous higher order folio. 506 + */ 507 + ((struct folio *)(new_page - 1))->_nr_pages = 0; 508 + #endif 509 + 510 + new_folio->mapping = NULL; 511 + new_folio->pgmap = pgmap; /* Also clear compound head */ 512 + new_folio->share = 0; /* fsdax only, unused for device private */ 513 + VM_WARN_ON_FOLIO(folio_ref_count(new_folio), new_folio); 514 + VM_WARN_ON_FOLIO(!folio_is_zone_device(new_folio), new_folio); 515 + } 483 516 484 517 /* 485 518 * Drivers shouldn't be allocating pages after calling
+6 -6
mm/mm_init.c
··· 2059 2059 */ 2060 2060 static unsigned long __init 2061 2061 deferred_init_memmap_chunk(unsigned long start_pfn, unsigned long end_pfn, 2062 - struct zone *zone) 2062 + struct zone *zone, bool can_resched) 2063 2063 { 2064 2064 int nid = zone_to_nid(zone); 2065 2065 unsigned long nr_pages = 0; ··· 2085 2085 2086 2086 spfn = chunk_end; 2087 2087 2088 - if (irqs_disabled()) 2089 - touch_nmi_watchdog(); 2090 - else 2088 + if (can_resched) 2091 2089 cond_resched(); 2090 + else 2091 + touch_nmi_watchdog(); 2092 2092 } 2093 2093 } 2094 2094 ··· 2101 2101 { 2102 2102 struct zone *zone = arg; 2103 2103 2104 - deferred_init_memmap_chunk(start_pfn, end_pfn, zone); 2104 + deferred_init_memmap_chunk(start_pfn, end_pfn, zone, true); 2105 2105 } 2106 2106 2107 2107 static unsigned int __init ··· 2216 2216 for (spfn = first_deferred_pfn, epfn = SECTION_ALIGN_UP(spfn + 1); 2217 2217 nr_pages < nr_pages_needed && spfn < zone_end_pfn(zone); 2218 2218 spfn = epfn, epfn += PAGES_PER_SECTION) { 2219 - nr_pages += deferred_init_memmap_chunk(spfn, epfn, zone); 2219 + nr_pages += deferred_init_memmap_chunk(spfn, epfn, zone, false); 2220 2220 } 2221 2221 2222 2222 /*
+34 -11
mm/shmem.c
··· 962 962 * being freed). 963 963 */ 964 964 static long shmem_free_swap(struct address_space *mapping, 965 - pgoff_t index, void *radswap) 965 + pgoff_t index, pgoff_t end, void *radswap) 966 966 { 967 - int order = xa_get_order(&mapping->i_pages, index); 968 - void *old; 967 + XA_STATE(xas, &mapping->i_pages, index); 968 + unsigned int nr_pages = 0; 969 + pgoff_t base; 970 + void *entry; 969 971 970 - old = xa_cmpxchg_irq(&mapping->i_pages, index, radswap, NULL, 0); 971 - if (old != radswap) 972 - return 0; 973 - free_swap_and_cache_nr(radix_to_swp_entry(radswap), 1 << order); 972 + xas_lock_irq(&xas); 973 + entry = xas_load(&xas); 974 + if (entry == radswap) { 975 + nr_pages = 1 << xas_get_order(&xas); 976 + base = round_down(xas.xa_index, nr_pages); 977 + if (base < index || base + nr_pages - 1 > end) 978 + nr_pages = 0; 979 + else 980 + xas_store(&xas, NULL); 981 + } 982 + xas_unlock_irq(&xas); 974 983 975 - return 1 << order; 984 + if (nr_pages) 985 + free_swap_and_cache_nr(radix_to_swp_entry(radswap), nr_pages); 986 + 987 + return nr_pages; 976 988 } 977 989 978 990 /* ··· 1136 1124 if (xa_is_value(folio)) { 1137 1125 if (unfalloc) 1138 1126 continue; 1139 - nr_swaps_freed += shmem_free_swap(mapping, 1140 - indices[i], folio); 1127 + nr_swaps_freed += shmem_free_swap(mapping, indices[i], 1128 + end - 1, folio); 1141 1129 continue; 1142 1130 } 1143 1131 ··· 1203 1191 folio = fbatch.folios[i]; 1204 1192 1205 1193 if (xa_is_value(folio)) { 1194 + int order; 1206 1195 long swaps_freed; 1207 1196 1208 1197 if (unfalloc) 1209 1198 continue; 1210 - swaps_freed = shmem_free_swap(mapping, indices[i], folio); 1199 + swaps_freed = shmem_free_swap(mapping, indices[i], 1200 + end - 1, folio); 1211 1201 if (!swaps_freed) { 1202 + /* 1203 + * If found a large swap entry cross the end border, 1204 + * skip it as the truncate_inode_partial_folio above 1205 + * should have at least zerod its content once. 1206 + */ 1207 + order = shmem_confirm_swap(mapping, indices[i], 1208 + radix_to_swp_entry(folio)); 1209 + if (order > 0 && indices[i] + (1 << order) > end) 1210 + continue; 1212 1211 /* Swap was replaced by page: retry */ 1213 1212 index = indices[i]; 1214 1213 break;
+1 -1
mm/swap.h
··· 198 198 void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug); 199 199 200 200 /* linux/mm/swap_state.c */ 201 - extern struct address_space swap_space __ro_after_init; 201 + extern struct address_space swap_space __read_mostly; 202 202 static inline struct address_space *swap_address_space(swp_entry_t entry) 203 203 { 204 204 return &swap_space;
+1 -2
mm/swap_state.c
··· 37 37 #endif 38 38 }; 39 39 40 - /* Set swap_space as read only as swap cache is handled by swap table */ 41 - struct address_space swap_space __ro_after_init = { 40 + struct address_space swap_space __read_mostly = { 42 41 .a_ops = &swap_aops, 43 42 }; 44 43
+2 -5
mm/vmalloc.c
··· 4322 4322 if (want_init_on_free() || want_init_on_alloc(flags)) 4323 4323 memset((void *)p + size, 0, old_size - size); 4324 4324 vm->requested_size = size; 4325 - kasan_poison_vmalloc(p + size, old_size - size); 4325 + kasan_vrealloc(p, old_size, size); 4326 4326 return (void *)p; 4327 4327 } 4328 4328 ··· 4330 4330 * We already have the bytes available in the allocation; use them. 4331 4331 */ 4332 4332 if (size <= alloced_size) { 4333 - kasan_unpoison_vmalloc(p + old_size, size - old_size, 4334 - KASAN_VMALLOC_PROT_NORMAL | 4335 - KASAN_VMALLOC_VM_ALLOC | 4336 - KASAN_VMALLOC_KEEP_TAG); 4337 4333 /* 4338 4334 * No need to zero memory here, as unused memory will have 4339 4335 * already been zeroed at initial allocation time or during 4340 4336 * realloc shrink time. 4341 4337 */ 4342 4338 vm->requested_size = size; 4339 + kasan_vrealloc(p, old_size, size); 4343 4340 return (void *)p; 4344 4341 } 4345 4342
+3
net/bluetooth/mgmt.c
··· 1966 1966 } 1967 1967 1968 1968 mgmt_cmd_status(cmd->sk, cmd->hdev->id, cmd->opcode, mgmt_err); 1969 + mgmt_pending_free(cmd); 1969 1970 return; 1970 1971 } 1971 1972 ··· 1985 1984 sock_put(match.sk); 1986 1985 1987 1986 hci_update_eir_sync(hdev); 1987 + mgmt_pending_free(cmd); 1988 1988 } 1989 1989 1990 1990 static int set_ssp_sync(struct hci_dev *hdev, void *data) ··· 6440 6438 hci_dev_clear_flag(hdev, HCI_ADVERTISING); 6441 6439 6442 6440 settings_rsp(cmd, &match); 6441 + mgmt_pending_free(cmd); 6443 6442 6444 6443 new_settings(hdev, match.sk); 6445 6444
+1 -1
net/bridge/br_input.c
··· 274 274 int ret; 275 275 276 276 net = dev_net(skb->dev); 277 - #ifdef HAVE_JUMP_LABEL 277 + #ifdef CONFIG_JUMP_LABEL 278 278 if (!static_key_false(&nf_hooks_needed[NFPROTO_BRIDGE][NF_BR_PRE_ROUTING])) 279 279 goto frame_finish; 280 280 #endif
+2
net/core/filter.c
··· 3353 3353 shinfo->gso_type &= ~SKB_GSO_TCPV4; 3354 3354 shinfo->gso_type |= SKB_GSO_TCPV6; 3355 3355 } 3356 + shinfo->gso_type |= SKB_GSO_DODGY; 3356 3357 } 3357 3358 3358 3359 bpf_skb_change_protocol(skb, ETH_P_IPV6); ··· 3384 3383 shinfo->gso_type &= ~SKB_GSO_TCPV6; 3385 3384 shinfo->gso_type |= SKB_GSO_TCPV4; 3386 3385 } 3386 + shinfo->gso_type |= SKB_GSO_DODGY; 3387 3387 } 3388 3388 3389 3389 bpf_skb_change_protocol(skb, ETH_P_IP);
+2 -1
net/ipv4/tcp_offload.c
··· 107 107 if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST) { 108 108 struct tcphdr *th = tcp_hdr(skb); 109 109 110 - if (skb_pagelen(skb) - th->doff * 4 == skb_shinfo(skb)->gso_size) 110 + if ((skb_pagelen(skb) - th->doff * 4 == skb_shinfo(skb)->gso_size) && 111 + !(skb_shinfo(skb)->gso_type & SKB_GSO_DODGY)) 111 112 return __tcp4_gso_segment_list(skb, features); 112 113 113 114 skb->ip_summed = CHECKSUM_NONE;
+2 -1
net/ipv4/udp_offload.c
··· 514 514 515 515 if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) { 516 516 /* Detect modified geometry and pass those to skb_segment. */ 517 - if (skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size) 517 + if ((skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size) && 518 + !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_DODGY)) 518 519 return __udp_gso_segment_list(gso_skb, features, is_ipv6); 519 520 520 521 ret = __skb_linearize(gso_skb);
+3 -1
net/ipv6/icmp.c
··· 965 965 fl6.daddr = ipv6_hdr(skb)->saddr; 966 966 if (saddr) 967 967 fl6.saddr = *saddr; 968 - fl6.flowi6_oif = icmp6_iif(skb); 968 + fl6.flowi6_oif = ipv6_addr_loopback(&fl6.daddr) ? 969 + skb->dev->ifindex : 970 + icmp6_iif(skb); 969 971 fl6.fl6_icmp_type = type; 970 972 fl6.flowi6_mark = mark; 971 973 fl6.flowi6_uid = sock_net_uid(net, NULL);
+2 -1
net/ipv6/tcpv6_offload.c
··· 170 170 if (skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST) { 171 171 struct tcphdr *th = tcp_hdr(skb); 172 172 173 - if (skb_pagelen(skb) - th->doff * 4 == skb_shinfo(skb)->gso_size) 173 + if ((skb_pagelen(skb) - th->doff * 4 == skb_shinfo(skb)->gso_size) && 174 + !(skb_shinfo(skb)->gso_type & SKB_GSO_DODGY)) 174 175 return __tcp6_gso_segment_list(skb, features); 175 176 176 177 skb->ip_summed = CHECKSUM_NONE;
+5 -3
net/mac80211/mlme.c
··· 8 8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 9 9 * Copyright 2013-2014 Intel Mobile Communications GmbH 10 10 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 - 2025 Intel Corporation 11 + * Copyright (C) 2018 - 2026 Intel Corporation 12 12 */ 13 13 14 14 #include <linux/delay.h> ··· 6190 6190 return -EINVAL; 6191 6191 } 6192 6192 6193 - link_map_presence = *pos; 6194 - pos++; 6193 + if (!(control & IEEE80211_TTLM_CONTROL_DEF_LINK_MAP)) { 6194 + link_map_presence = *pos; 6195 + pos++; 6196 + } 6195 6197 6196 6198 if (control & IEEE80211_TTLM_CONTROL_SWITCH_TIME_PRESENT) { 6197 6199 ttlm_info->switch_time = get_unaligned_le16(pos);
+13 -3
net/mptcp/pm_kernel.c
··· 1294 1294 int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb, struct genl_info *info) 1295 1295 { 1296 1296 struct pm_nl_pernet *pernet = genl_info_pm_nl(info); 1297 - LIST_HEAD(free_list); 1297 + struct list_head free_list; 1298 1298 1299 1299 spin_lock_bh(&pernet->lock); 1300 - list_splice_init(&pernet->endp_list, &free_list); 1300 + free_list = pernet->endp_list; 1301 + INIT_LIST_HEAD_RCU(&pernet->endp_list); 1301 1302 __reset_counters(pernet); 1302 1303 pernet->next_id = 1; 1303 1304 bitmap_zero(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); 1304 1305 spin_unlock_bh(&pernet->lock); 1305 - mptcp_nl_flush_addrs_list(sock_net(skb->sk), &free_list); 1306 + 1307 + if (free_list.next == &pernet->endp_list) 1308 + return 0; 1309 + 1306 1310 synchronize_rcu(); 1311 + 1312 + /* Adjust the pointers to free_list instead of pernet->endp_list */ 1313 + free_list.prev->next = &free_list; 1314 + free_list.next->prev = &free_list; 1315 + 1316 + mptcp_nl_flush_addrs_list(sock_net(skb->sk), &free_list); 1307 1317 __flush_addrs(&free_list); 1308 1318 return 0; 1309 1319 }
+7 -6
net/mptcp/protocol.c
··· 821 821 822 822 static bool __mptcp_subflow_error_report(struct sock *sk, struct sock *ssk) 823 823 { 824 - int err = sock_error(ssk); 825 824 int ssk_state; 826 - 827 - if (!err) 828 - return false; 825 + int err; 829 826 830 827 /* only propagate errors on fallen-back sockets or 831 828 * on MPC connect 832 829 */ 833 830 if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(mptcp_sk(sk))) 831 + return false; 832 + 833 + err = sock_error(ssk); 834 + if (!err) 834 835 return false; 835 836 836 837 /* We need to propagate only transition to CLOSE state. ··· 2599 2598 struct mptcp_sock *msk = mptcp_sk(sk); 2600 2599 struct sk_buff *skb; 2601 2600 2602 - /* The first subflow can already be closed and still in the list */ 2603 - if (subflow->close_event_done) 2601 + /* The first subflow can already be closed or disconnected */ 2602 + if (subflow->close_event_done || READ_ONCE(subflow->local_id) < 0) 2604 2603 return; 2605 2604 2606 2605 subflow->close_event_done = true;
+24 -3
net/nfc/core.c
··· 1147 1147 EXPORT_SYMBOL(nfc_register_device); 1148 1148 1149 1149 /** 1150 - * nfc_unregister_device - unregister a nfc device in the nfc subsystem 1150 + * nfc_unregister_rfkill - unregister a nfc device in the rfkill subsystem 1151 1151 * 1152 1152 * @dev: The nfc device to unregister 1153 1153 */ 1154 - void nfc_unregister_device(struct nfc_dev *dev) 1154 + void nfc_unregister_rfkill(struct nfc_dev *dev) 1155 1155 { 1156 - int rc; 1157 1156 struct rfkill *rfk = NULL; 1157 + int rc; 1158 1158 1159 1159 pr_debug("dev_name=%s\n", dev_name(&dev->dev)); 1160 1160 ··· 1175 1175 rfkill_unregister(rfk); 1176 1176 rfkill_destroy(rfk); 1177 1177 } 1178 + } 1179 + EXPORT_SYMBOL(nfc_unregister_rfkill); 1178 1180 1181 + /** 1182 + * nfc_remove_device - remove a nfc device in the nfc subsystem 1183 + * 1184 + * @dev: The nfc device to remove 1185 + */ 1186 + void nfc_remove_device(struct nfc_dev *dev) 1187 + { 1179 1188 if (dev->ops->check_presence) { 1180 1189 timer_delete_sync(&dev->check_pres_timer); 1181 1190 cancel_work_sync(&dev->check_pres_work); ··· 1196 1187 nfc_devlist_generation++; 1197 1188 device_del(&dev->dev); 1198 1189 mutex_unlock(&nfc_devlist_mutex); 1190 + } 1191 + EXPORT_SYMBOL(nfc_remove_device); 1192 + 1193 + /** 1194 + * nfc_unregister_device - unregister a nfc device in the nfc subsystem 1195 + * 1196 + * @dev: The nfc device to unregister 1197 + */ 1198 + void nfc_unregister_device(struct nfc_dev *dev) 1199 + { 1200 + nfc_unregister_rfkill(dev); 1201 + nfc_remove_device(dev); 1199 1202 } 1200 1203 EXPORT_SYMBOL(nfc_unregister_device); 1201 1204
+16 -1
net/nfc/llcp_commands.c
··· 778 778 if (likely(frag_len > 0)) 779 779 skb_put_data(pdu, msg_ptr, frag_len); 780 780 781 + spin_lock(&local->tx_queue.lock); 782 + 783 + if (list_empty(&local->list)) { 784 + spin_unlock(&local->tx_queue.lock); 785 + 786 + kfree_skb(pdu); 787 + 788 + len -= remaining_len; 789 + if (len == 0) 790 + len = -ENXIO; 791 + break; 792 + } 793 + 781 794 /* No need to check for the peer RW for UI frames */ 782 - skb_queue_tail(&local->tx_queue, pdu); 795 + __skb_queue_tail(&local->tx_queue, pdu); 796 + 797 + spin_unlock(&local->tx_queue.lock); 783 798 784 799 remaining_len -= frag_len; 785 800 msg_ptr += frag_len;
+3 -1
net/nfc/llcp_core.c
··· 316 316 spin_lock(&llcp_devices_lock); 317 317 list_for_each_entry_safe(local, tmp, &llcp_devices, list) 318 318 if (local->dev == dev) { 319 - list_del(&local->list); 319 + spin_lock(&local->tx_queue.lock); 320 + list_del_init(&local->list); 321 + spin_unlock(&local->tx_queue.lock); 320 322 spin_unlock(&llcp_devices_lock); 321 323 return local; 322 324 }
+3 -1
net/nfc/nci/core.c
··· 1303 1303 { 1304 1304 struct nci_conn_info *conn_info, *n; 1305 1305 1306 + nfc_unregister_rfkill(ndev->nfc_dev); 1307 + 1306 1308 /* This set_bit is not protected with specialized barrier, 1307 1309 * However, it is fine because the mutex_lock(&ndev->req_lock); 1308 1310 * in nci_close_device() will help to emit one. ··· 1322 1320 /* conn_info is allocated with devm_kzalloc */ 1323 1321 } 1324 1322 1325 - nfc_unregister_device(ndev->nfc_dev); 1323 + nfc_remove_device(ndev->nfc_dev); 1326 1324 } 1327 1325 EXPORT_SYMBOL(nci_unregister_device); 1328 1326
+1
rust/Makefile
··· 383 383 -fno-inline-functions-called-once -fsanitize=bounds-strict \ 384 384 -fstrict-flex-arrays=% -fmin-function-alignment=% \ 385 385 -fzero-init-padding-bits=% -mno-fdpic \ 386 + -fdiagnostics-show-context -fdiagnostics-show-context=% \ 386 387 --param=% --param asan-% -fno-isolate-erroneous-paths-dereference 387 388 388 389 # Derived from `scripts/Makefile.clang`.
+4 -2
rust/kernel/bits.rs
··· 27 27 /// 28 28 /// This version is the default and should be used if `n` is known at 29 29 /// compile time. 30 - #[inline] 30 + // Always inline to optimize out error path of `build_assert`. 31 + #[inline(always)] 31 32 pub const fn [<bit_ $ty>](n: u32) -> $ty { 32 33 build_assert!(n < <$ty>::BITS); 33 34 (1 as $ty) << n ··· 76 75 /// This version is the default and should be used if the range is known 77 76 /// at compile time. 78 77 $(#[$genmask_ex])* 79 - #[inline] 78 + // Always inline to optimize out error path of `build_assert`. 79 + #[inline(always)] 80 80 pub const fn [<genmask_ $ty>](range: RangeInclusive<u32>) -> $ty { 81 81 let start = *range.start(); 82 82 let end = *range.end();
+1 -1
rust/kernel/fmt.rs
··· 6 6 7 7 pub use core::fmt::{Arguments, Debug, Error, Formatter, Result, Write}; 8 8 9 - /// Internal adapter used to route allow implementations of formatting traits for foreign types. 9 + /// Internal adapter used to route and allow implementations of formatting traits for foreign types. 10 10 /// 11 11 /// It is inserted automatically by the [`fmt!`] macro and is not meant to be used directly. 12 12 ///
+26 -23
rust/kernel/num/bounded.rs
··· 40 40 fits_within!(value, T, num_bits) 41 41 } 42 42 43 - /// An integer value that requires only the `N` less significant bits of the wrapped type to be 43 + /// An integer value that requires only the `N` least significant bits of the wrapped type to be 44 44 /// encoded. 45 45 /// 46 46 /// This limits the number of usable bits in the wrapped integer type, and thus the stored value to 47 - /// a narrower range, which provides guarantees that can be useful when working with in e.g. 47 + /// a narrower range, which provides guarantees that can be useful when working within e.g. 48 48 /// bitfields. 49 49 /// 50 50 /// # Invariants ··· 56 56 /// # Examples 57 57 /// 58 58 /// The preferred way to create values is through constants and the [`Bounded::new`] family of 59 - /// constructors, as they trigger a build error if the type invariants cannot be withheld. 59 + /// constructors, as they trigger a build error if the type invariants cannot be upheld. 60 60 /// 61 61 /// ``` 62 62 /// use kernel::num::Bounded; ··· 82 82 /// ``` 83 83 /// use kernel::num::Bounded; 84 84 /// 85 - /// // This succeeds because `15` can be represented with 4 unsigned bits. 85 + /// // This succeeds because `15` can be represented with 4 unsigned bits. 86 86 /// assert!(Bounded::<u8, 4>::try_new(15).is_some()); 87 87 /// 88 88 /// // This fails because `16` cannot be represented with 4 unsigned bits. ··· 221 221 /// let v: Option<Bounded<u16, 8>> = 128u32.try_into_bounded(); 222 222 /// assert_eq!(v.as_deref().copied(), Some(128)); 223 223 /// 224 - /// // Fails because `128` doesn't fits into 6 bits. 224 + /// // Fails because `128` doesn't fit into 6 bits. 225 225 /// let v: Option<Bounded<u16, 6>> = 128u32.try_into_bounded(); 226 226 /// assert_eq!(v, None); 227 227 /// ``` ··· 259 259 assert!(fits_within!(VALUE, $type, N)); 260 260 } 261 261 262 - // INVARIANT: `fits_within` confirmed that `VALUE` can be represented within 262 + // SAFETY: `fits_within` confirmed that `VALUE` can be represented within 263 263 // `N` bits. 264 - Self::__new(VALUE) 264 + unsafe { Self::__new(VALUE) } 265 265 } 266 266 } 267 267 )* ··· 282 282 /// All instances of [`Bounded`] must be created through this method as it enforces most of the 283 283 /// type invariants. 284 284 /// 285 - /// The caller remains responsible for checking, either statically or dynamically, that `value` 286 - /// can be represented as a `T` using at most `N` bits. 287 - const fn __new(value: T) -> Self { 285 + /// # Safety 286 + /// 287 + /// The caller must ensure that `value` can be represented within `N` bits. 288 + const unsafe fn __new(value: T) -> Self { 288 289 // Enforce the type invariants. 289 290 const { 290 291 // `N` cannot be zero. ··· 294 293 assert!(N <= T::BITS); 295 294 } 296 295 296 + // INVARIANT: The caller ensures `value` fits within `N` bits. 297 297 Self(value) 298 298 } 299 299 ··· 330 328 /// ``` 331 329 pub fn try_new(value: T) -> Option<Self> { 332 330 fits_within(value, N).then(|| { 333 - // INVARIANT: `fits_within` confirmed that `value` can be represented within `N` bits. 334 - Self::__new(value) 331 + // SAFETY: `fits_within` confirmed that `value` can be represented within `N` bits. 332 + unsafe { Self::__new(value) } 335 333 }) 336 334 } 337 335 ··· 365 363 /// assert_eq!(Bounded::<u8, 1>::from_expr(1).get(), 1); 366 364 /// assert_eq!(Bounded::<u16, 8>::from_expr(0xff).get(), 0xff); 367 365 /// ``` 366 + // Always inline to optimize out error path of `build_assert`. 368 367 #[inline(always)] 369 368 pub fn from_expr(expr: T) -> Self { 370 369 crate::build_assert!( ··· 373 370 "Requested value larger than maximal representable value." 374 371 ); 375 372 376 - // INVARIANT: `fits_within` confirmed that `expr` can be represented within `N` bits. 377 - Self::__new(expr) 373 + // SAFETY: `fits_within` confirmed that `expr` can be represented within `N` bits. 374 + unsafe { Self::__new(expr) } 378 375 } 379 376 380 377 /// Returns the wrapped value as the backing type. ··· 413 410 ); 414 411 } 415 412 416 - // INVARIANT: The value did fit within `N` bits, so it will all the more fit within 413 + // SAFETY: The value did fit within `N` bits, so it will all the more fit within 417 414 // the larger `M` bits. 418 - Bounded::__new(self.0) 415 + unsafe { Bounded::__new(self.0) } 419 416 } 420 417 421 418 /// Attempts to shrink the number of bits usable for `self`. ··· 469 466 // `U` and `T` have the same sign, hence this conversion cannot fail. 470 467 let value = unsafe { U::try_from(self.get()).unwrap_unchecked() }; 471 468 472 - // INVARIANT: Although the backing type has changed, the value is still represented within 469 + // SAFETY: Although the backing type has changed, the value is still represented within 473 470 // `N` bits, and with the same signedness. 474 - Bounded::__new(value) 471 + unsafe { Bounded::__new(value) } 475 472 } 476 473 } 477 474 ··· 504 501 /// let v: Option<Bounded<u16, 8>> = 128u32.try_into_bounded(); 505 502 /// assert_eq!(v.as_deref().copied(), Some(128)); 506 503 /// 507 - /// // Fails because `128` doesn't fits into 6 bits. 504 + /// // Fails because `128` doesn't fit into 6 bits. 508 505 /// let v: Option<Bounded<u16, 6>> = 128u32.try_into_bounded(); 509 506 /// assert_eq!(v, None); 510 507 /// ``` ··· 947 944 Self: AtLeastXBits<{ <$type as Integer>::BITS as usize }>, 948 945 { 949 946 fn from(value: $type) -> Self { 950 - // INVARIANT: The trait bound on `Self` guarantees that `N` bits is 947 + // SAFETY: The trait bound on `Self` guarantees that `N` bits is 951 948 // enough to hold any value of the source type. 952 - Self::__new(T::from(value)) 949 + unsafe { Self::__new(T::from(value)) } 953 950 } 954 951 } 955 952 )* ··· 1054 1051 T: Integer + From<bool>, 1055 1052 { 1056 1053 fn from(value: bool) -> Self { 1057 - // INVARIANT: A boolean can be represented using a single bit, and thus fits within any 1054 + // SAFETY: A boolean can be represented using a single bit, and thus fits within any 1058 1055 // integer type for any `N` > 0. 1059 - Self::__new(T::from(value)) 1056 + unsafe { Self::__new(T::from(value)) } 1060 1057 } 1061 1058 }
+2 -2
rust/kernel/rbtree.rs
··· 985 985 self.peek(Direction::Prev) 986 986 } 987 987 988 - /// Access the previous node without moving the cursor. 988 + /// Access the next node without moving the cursor. 989 989 pub fn peek_next(&self) -> Option<(&K, &V)> { 990 990 self.peek(Direction::Next) 991 991 } ··· 1130 1130 } 1131 1131 1132 1132 // SAFETY: The [`IterMut`] has exclusive access to both `K` and `V`, so it is sufficient to require them to be `Send`. 1133 - // The iterator only gives out immutable references to the keys, but since the iterator has excusive access to those same 1133 + // The iterator only gives out immutable references to the keys, but since the iterator has exclusive access to those same 1134 1134 // keys, `Send` is sufficient. `Sync` would be okay, but it is more restrictive to the user. 1135 1135 unsafe impl<'a, K: Send, V: Send> Send for IterMut<'a, K, V> {} 1136 1136
+11
rust/kernel/sync/atomic/predefine.rs
··· 35 35 // as `isize` and `usize`, and `isize` and `usize` are always bi-directional transmutable to 36 36 // `isize_atomic_repr`, which also always implements `AtomicImpl`. 37 37 #[allow(non_camel_case_types)] 38 + #[cfg(not(testlib))] 38 39 #[cfg(not(CONFIG_64BIT))] 39 40 type isize_atomic_repr = i32; 40 41 #[allow(non_camel_case_types)] 42 + #[cfg(not(testlib))] 41 43 #[cfg(CONFIG_64BIT)] 44 + type isize_atomic_repr = i64; 45 + 46 + #[allow(non_camel_case_types)] 47 + #[cfg(testlib)] 48 + #[cfg(target_pointer_width = "32")] 49 + type isize_atomic_repr = i32; 50 + #[allow(non_camel_case_types)] 51 + #[cfg(testlib)] 52 + #[cfg(target_pointer_width = "64")] 42 53 type isize_atomic_repr = i64; 43 54 44 55 // Ensure size and alignment requirements are checked.
+2 -1
rust/kernel/sync/refcount.rs
··· 23 23 /// Construct a new [`Refcount`] from an initial value. 24 24 /// 25 25 /// The initial value should be non-saturated. 26 - #[inline] 26 + // Always inline to optimize out error path of `build_assert`. 27 + #[inline(always)] 27 28 pub fn new(value: i32) -> Self { 28 29 build_assert!(value >= 0, "initial value saturated"); 29 30 // SAFETY: There are no safety requirements for this FFI call.
+1 -1
rust/macros/fmt.rs
··· 67 67 } 68 68 (None, acc) 69 69 })(); 70 - args.extend(quote_spanned!(first_span => #lhs #adapter(&#rhs))); 70 + args.extend(quote_spanned!(first_span => #lhs #adapter(&(#rhs)))); 71 71 } 72 72 }; 73 73
+1 -1
rust/macros/lib.rs
··· 59 59 /// 60 60 /// # Examples 61 61 /// 62 - /// ``` 62 + /// ```ignore 63 63 /// use kernel::prelude::*; 64 64 /// 65 65 /// module!{
+4
rust/proc-macro2/lib.rs
··· 1 1 // SPDX-License-Identifier: Apache-2.0 OR MIT 2 2 3 + // When fixdep scans this, it will find this string `CONFIG_RUSTC_VERSION_TEXT` 4 + // and thus add a dependency on `include/config/RUSTC_VERSION_TEXT`, which is 5 + // touched by Kconfig when the version string from the compiler changes. 6 + 3 7 //! [![github]](https://github.com/dtolnay/proc-macro2)&ensp;[![crates-io]](https://crates.io/crates/proc-macro2)&ensp;[![docs-rs]](crate) 4 8 //! 5 9 //! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+3 -1
scripts/Makefile.build
··· 166 166 cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< 167 167 endif 168 168 169 + ifeq ($(KBUILD_EXTMOD),) 169 170 ifneq ($(KBUILD_EXTRA_WARN),) 170 171 cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \ 171 172 $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \ 172 173 $< 174 + endif 173 175 endif 174 176 175 177 # Compile C sources (.c) ··· 358 356 quiet_cmd_rustc_rsi_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@ 359 357 cmd_rustc_rsi_rs = \ 360 358 $(rust_common_cmd) -Zunpretty=expanded $< >$@; \ 361 - command -v $(RUSTFMT) >/dev/null && $(RUSTFMT) $@ 359 + command -v $(RUSTFMT) >/dev/null && $(RUSTFMT) --config-path $(srctree)/.rustfmt.toml $@ 362 360 363 361 $(obj)/%.rsi: $(obj)/%.rs FORCE 364 362 +$(call if_changed_dep,rustc_rsi_rs)
+2 -1
scripts/Makefile.vmlinux
··· 113 113 # what kmod expects to parse. 114 114 quiet_cmd_modules_builtin_modinfo = GEN $@ 115 115 cmd_modules_builtin_modinfo = $(cmd_objcopy); \ 116 - sed -i 's/\x00\+$$/\x00/g' $@ 116 + sed -i 's/\x00\+$$/\x00/g' $@; \ 117 + chmod -x $@ 117 118 118 119 OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary 119 120
+33 -12
scripts/generate_rust_analyzer.py
··· 61 61 display_name, 62 62 deps, 63 63 cfg=[], 64 - edition="2021", 65 64 ): 66 65 append_crate( 67 66 display_name, ··· 68 69 deps, 69 70 cfg, 70 71 is_workspace_member=False, 71 - edition=edition, 72 + # Miguel Ojeda writes: 73 + # 74 + # > ... in principle even the sysroot crates may have different 75 + # > editions. 76 + # > 77 + # > For instance, in the move to 2024, it seems all happened at once 78 + # > in 1.87.0 in these upstream commits: 79 + # > 80 + # > 0e071c2c6a58 ("Migrate core to Rust 2024") 81 + # > f505d4e8e380 ("Migrate alloc to Rust 2024") 82 + # > 0b2489c226c3 ("Migrate proc_macro to Rust 2024") 83 + # > 993359e70112 ("Migrate std to Rust 2024") 84 + # > 85 + # > But in the previous move to 2021, `std` moved in 1.59.0, while 86 + # > the others in 1.60.0: 87 + # > 88 + # > b656384d8398 ("Update stdlib to the 2021 edition") 89 + # > 06a1c14d52a8 ("Switch all libraries to the 2021 edition") 90 + # 91 + # Link: https://lore.kernel.org/all/CANiq72kd9bHdKaAm=8xCUhSHMy2csyVed69bOc4dXyFAW4sfuw@mail.gmail.com/ 92 + # 93 + # At the time of writing all rust versions we support build the 94 + # sysroot crates with the same edition. We may need to relax this 95 + # assumption if future edition moves span multiple rust versions. 96 + edition=core_edition, 72 97 ) 73 98 74 99 # NB: sysroot crates reexport items from one another so setting up our transitive dependencies 75 100 # here is important for ensuring that rust-analyzer can resolve symbols. The sources of truth 76 101 # for this dependency graph are `(sysroot_src / crate / "Cargo.toml" for crate in crates)`. 77 - append_sysroot_crate("core", [], cfg=crates_cfgs.get("core", []), edition=core_edition) 102 + append_sysroot_crate("core", [], cfg=crates_cfgs.get("core", [])) 78 103 append_sysroot_crate("alloc", ["core"]) 79 104 append_sysroot_crate("std", ["alloc", "core"]) 80 105 append_sysroot_crate("proc_macro", ["core", "std"]) ··· 106 83 append_crate( 107 84 "compiler_builtins", 108 85 srctree / "rust" / "compiler_builtins.rs", 109 - [], 86 + ["core"], 110 87 ) 111 88 112 89 append_crate( ··· 119 96 append_crate( 120 97 "quote", 121 98 srctree / "rust" / "quote" / "lib.rs", 122 - ["alloc", "proc_macro", "proc_macro2"], 99 + ["core", "alloc", "std", "proc_macro", "proc_macro2"], 123 100 cfg=crates_cfgs["quote"], 101 + edition="2018", 124 102 ) 125 103 126 104 append_crate( 127 105 "syn", 128 106 srctree / "rust" / "syn" / "lib.rs", 129 - ["proc_macro", "proc_macro2", "quote"], 107 + ["std", "proc_macro", "proc_macro2", "quote"], 130 108 cfg=crates_cfgs["syn"], 131 109 ) 132 110 ··· 147 123 append_crate( 148 124 "pin_init_internal", 149 125 srctree / "rust" / "pin-init" / "internal" / "src" / "lib.rs", 150 - [], 126 + ["std", "proc_macro"], 151 127 cfg=["kernel"], 152 128 is_proc_macro=True, 153 129 ) ··· 155 131 append_crate( 156 132 "pin_init", 157 133 srctree / "rust" / "pin-init" / "src" / "lib.rs", 158 - ["core", "pin_init_internal", "macros"], 134 + ["core", "compiler_builtins", "pin_init_internal", "macros"], 159 135 cfg=["kernel"], 160 136 ) 161 137 ··· 214 190 append_crate( 215 191 name, 216 192 path, 217 - ["core", "kernel"], 193 + ["core", "kernel", "pin_init"], 218 194 cfg=cfg, 219 195 ) 220 196 ··· 236 212 format="[%(asctime)s] [%(levelname)s] %(message)s", 237 213 level=logging.INFO if args.verbose else logging.WARNING 238 214 ) 239 - 240 - # Making sure that the `sysroot` and `sysroot_src` belong to the same toolchain. 241 - assert args.sysroot in args.sysroot_src.parents 242 215 243 216 rust_project = { 244 217 "crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.exttree, args.cfgs, args.core_edition),
+4 -4
scripts/livepatch/klp-build
··· 555 555 local file_dir="$(dirname "$file")" 556 556 local orig_file="$ORIG_DIR/$rel_file" 557 557 local orig_dir="$(dirname "$orig_file")" 558 - local cmd_file="$file_dir/.$(basename "$file").cmd" 559 558 560 559 [[ ! -f "$file" ]] && die "missing $(basename "$file") for $_file" 561 560 562 561 mkdir -p "$orig_dir" 563 562 cp -f "$file" "$orig_dir" 564 - [[ -e "$cmd_file" ]] && cp -f "$cmd_file" "$orig_dir" 565 563 done 566 564 xtrace_restore 567 565 ··· 738 740 local orig_dir="$(dirname "$orig_file")" 739 741 local kmod_file="$KMOD_DIR/$rel_file" 740 742 local kmod_dir="$(dirname "$kmod_file")" 741 - local cmd_file="$orig_dir/.$(basename "$file").cmd" 743 + local cmd_file="$kmod_dir/.$(basename "$file").cmd" 742 744 743 745 mkdir -p "$kmod_dir" 744 746 cp -f "$file" "$kmod_dir" 745 - [[ -e "$cmd_file" ]] && cp -f "$cmd_file" "$kmod_dir" 746 747 747 748 # Tell kbuild this is a prebuilt object 748 749 cp -f "$file" "${kmod_file}_shipped" 750 + 751 + # Make modpost happy 752 + touch "$cmd_file" 749 753 750 754 echo -n " $rel_file" >> "$makefile" 751 755 done
+30 -35
scripts/package/kernel.spec
··· 2 2 %{!?_arch: %define _arch dummy} 3 3 %{!?make: %define make make} 4 4 %define makeflags %{?_smp_mflags} ARCH=%{ARCH} 5 + %define __spec_install_post /usr/lib/rpm/brp-compress || : 6 + %define debug_package %{nil} 5 7 6 8 Name: kernel 7 9 Summary: The Linux Kernel ··· 48 46 %endif 49 47 50 48 %if %{with_debuginfo} 51 - # list of debuginfo-related options taken from distribution kernel.spec 52 - # files 53 - %undefine _include_minidebuginfo 54 - %undefine _find_debuginfo_dwz_opts 55 - %undefine _unique_build_ids 56 - %undefine _unique_debug_names 57 - %undefine _unique_debug_srcs 58 - %undefine _debugsource_packages 59 - %undefine _debuginfo_subpackages 60 - %global _find_debuginfo_opts -r 61 - %global _missing_build_ids_terminate_build 1 62 - %global _no_recompute_build_ids 1 63 - %{debug_package} 49 + %package debuginfo 50 + Summary: Debug information package for the Linux kernel 51 + %description debuginfo 52 + This package provides debug information for the kernel image and modules from the 53 + %{version} package. 64 54 %endif 65 - # some (but not all) versions of rpmbuild emit %%debug_package with 66 - # %%install. since we've already emitted it manually, that would cause 67 - # a package redefinition error. ensure that doesn't happen 68 - %define debug_package %{nil} 69 - 70 - # later, we make all modules executable so that find-debuginfo.sh strips 71 - # them up. but they don't actually need to be executable, so remove the 72 - # executable bit, taking care to do it _after_ find-debuginfo.sh has run 73 - %define __spec_install_post \ 74 - %{?__debug_package:%{__debug_install_post}} \ 75 - %{__arch_install_post} \ 76 - %{__os_install_post} \ 77 - find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \\\ 78 - | xargs --no-run-if-empty chmod u-x 79 55 80 56 %prep 81 57 %setup -q -n linux ··· 67 87 mkdir -p %{buildroot}/lib/modules/%{KERNELRELEASE} 68 88 cp $(%{make} %{makeflags} -s image_name) %{buildroot}/lib/modules/%{KERNELRELEASE}/vmlinuz 69 89 # DEPMOD=true makes depmod no-op. We do not package depmod-generated files. 70 - %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} DEPMOD=true modules_install 90 + %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} INSTALL_MOD_STRIP=1 DEPMOD=true modules_install 71 91 %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install 72 92 cp System.map %{buildroot}/lib/modules/%{KERNELRELEASE} 73 93 cp .config %{buildroot}/lib/modules/%{KERNELRELEASE}/config ··· 98 118 echo "%exclude /lib/modules/%{KERNELRELEASE}/build" 99 119 } > %{buildroot}/kernel.list 100 120 101 - # make modules executable so that find-debuginfo.sh strips them. this 102 - # will be undone later in %%__spec_install_post 103 - find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \ 104 - | xargs --no-run-if-empty chmod u+x 105 - 106 121 %if %{with_debuginfo} 107 122 # copying vmlinux directly to the debug directory means it will not get 108 123 # stripped (but its source paths will still be collected + fixed up) 109 124 mkdir -p %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE} 110 125 cp vmlinux %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE} 126 + 127 + echo /usr/lib/debug/lib/modules/%{KERNELRELEASE}/vmlinux > %{buildroot}/debuginfo.list 128 + 129 + while read -r mod; do 130 + mod="${mod%.o}.ko" 131 + dbg="%{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}/kernel/${mod}" 132 + buildid=$("${READELF}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p') 133 + link="%{buildroot}/usr/lib/debug/.build-id/${buildid}.debug" 134 + 135 + mkdir -p "${dbg%/*}" "${link%/*}" 136 + "${OBJCOPY}" --only-keep-debug "${mod}" "${dbg}" 137 + ln -sf --relative "${dbg}" "${link}" 138 + 139 + echo "${dbg#%{buildroot}}" >> %{buildroot}/debuginfo.list 140 + echo "${link#%{buildroot}}" >> %{buildroot}/debuginfo.list 141 + done < modules.order 111 142 %endif 112 143 113 144 %clean 114 145 rm -rf %{buildroot} 115 - rm -f debugfiles.list debuglinks.list debugsourcefiles.list debugsources.list \ 116 - elfbins.list 117 146 118 147 %post 119 148 if [ -x /usr/bin/kernel-install ]; then ··· 160 171 %defattr (-, root, root) 161 172 /usr/src/kernels/%{KERNELRELEASE} 162 173 /lib/modules/%{KERNELRELEASE}/build 174 + %endif 175 + 176 + %if %{with_debuginfo} 177 + %files -f %{buildroot}/debuginfo.list debuginfo 178 + %defattr (-, root, root) 179 + %exclude /debuginfo.list 163 180 %endif
+1 -1
scripts/rustdoc_test_gen.rs
··· 206 206 207 207 /// The anchor where the test code body starts. 208 208 #[allow(unused)] 209 - static __DOCTEST_ANCHOR: i32 = ::core::line!() as i32 + {body_offset} + 1; 209 + static __DOCTEST_ANCHOR: i32 = ::core::line!() as i32 + {body_offset} + 2; 210 210 {{ 211 211 #![allow(unreachable_pub, clippy::disallowed_names)] 212 212 {body}
+14 -4
sound/hda/codecs/realtek/alc269.c
··· 3383 3383 struct snd_pcm_substream *substream, 3384 3384 int action) 3385 3385 { 3386 + static const struct coef_fw dis_coefs[] = { 3387 + WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC203), 3388 + WRITE_COEF(0x28, 0x0004), WRITE_COEF(0x29, 0xb023), 3389 + }; /* Disable AMP silence detection */ 3390 + static const struct coef_fw en_coefs[] = { 3391 + WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC203), 3392 + WRITE_COEF(0x28, 0x0084), WRITE_COEF(0x29, 0xb023), 3393 + }; /* Enable AMP silence detection */ 3394 + 3386 3395 switch (action) { 3387 3396 case HDA_GEN_PCM_ACT_OPEN: 3397 + alc_process_coef_fw(codec, dis_coefs); 3388 3398 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */ 3389 3399 break; 3390 3400 case HDA_GEN_PCM_ACT_CLOSE: 3401 + alc_process_coef_fw(codec, en_coefs); 3391 3402 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ 3392 3403 break; 3393 3404 } ··· 6750 6739 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), 6751 6740 SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED), 6752 6741 SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED), 6742 + SND_PCI_QUIRK(0x103c, 0x8c8f, "HP EliteBook 630 G11", ALC236_FIXUP_HP_GPIO_LED), 6753 6743 SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED), 6754 6744 SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), 6755 6745 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), ··· 7348 7336 SND_PCI_QUIRK(0x1d05, 0x1409, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC), 7349 7337 SND_PCI_QUIRK(0x1d05, 0x300f, "TongFang X6AR5xxY", ALC2XX_FIXUP_HEADSET_MIC), 7350 7338 SND_PCI_QUIRK(0x1d05, 0x3019, "TongFang X6FR5xxY", ALC2XX_FIXUP_HEADSET_MIC), 7339 + SND_PCI_QUIRK(0x1d05, 0x3031, "TongFang X6AR55xU", ALC2XX_FIXUP_HEADSET_MIC), 7351 7340 SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 7352 7341 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 7353 7342 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), ··· 7359 7346 SND_PCI_QUIRK(0x1ee7, 0x2078, "HONOR BRB-X M1010", ALC2XX_FIXUP_HEADSET_MIC), 7360 7347 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2), 7361 7348 SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7349 + SND_PCI_QUIRK(0x2039, 0x0001, "Inspur S14-G1", ALC295_FIXUP_CHROME_BOOK), 7362 7350 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7363 7351 SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13), 7364 7352 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO), ··· 7819 7805 {0x12, 0x90a60140}, 7820 7806 {0x19, 0x04a11030}, 7821 7807 {0x21, 0x04211020}), 7822 - SND_HDA_PIN_QUIRK(0x10ec0274, 0x1d05, "TongFang", ALC274_FIXUP_HP_HEADSET_MIC, 7823 - {0x17, 0x90170110}, 7824 - {0x19, 0x03a11030}, 7825 - {0x21, 0x03211020}), 7826 7808 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 7827 7809 ALC282_STANDARD_PINS, 7828 7810 {0x12, 0x90a609c0},
+15
sound/soc/amd/yc/acp6x-mach.c
··· 545 545 { 546 546 .driver_data = &acp6x_card, 547 547 .matches = { 548 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), 549 + DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK PM1503CDA"), 550 + } 551 + }, 552 + { 553 + .driver_data = &acp6x_card, 554 + .matches = { 548 555 DMI_MATCH(DMI_BOARD_VENDOR, "HP"), 549 556 DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"), 550 557 } ··· 682 675 DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), 683 676 } 684 677 }, 678 + { 679 + .driver_data = &acp6x_card, 680 + .matches = { 681 + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), 682 + DMI_MATCH(DMI_BOARD_NAME, "XyloD5_RBU"), 683 + } 684 + }, 685 + 685 686 {} 686 687 }; 687 688
+167 -8
sound/soc/codecs/aw87390.c
··· 314 314 return ret; 315 315 } 316 316 317 + static int aw87391_rgds_drv_event(struct snd_soc_dapm_widget *w, 318 + struct snd_kcontrol *kcontrol, int event) 319 + { 320 + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); 321 + struct aw87390 *aw87390 = snd_soc_component_get_drvdata(component); 322 + struct aw_device *aw_dev = aw87390->aw_pa; 323 + 324 + switch (event) { 325 + case SND_SOC_DAPM_PRE_PMU: 326 + if (!IS_ERR(aw87390->vdd_reg)) { 327 + if (regulator_enable(aw87390->vdd_reg)) 328 + dev_warn(aw_dev->dev, "Failed to enable vdd\n"); 329 + } 330 + break; 331 + case SND_SOC_DAPM_POST_PMU: 332 + regmap_write(aw_dev->regmap, AW87391_SYSCTRL_REG, 333 + AW87391_REG_VER_SEL_LOW | AW87391_REG_EN_ADAP | 334 + AW87391_REG_EN_2X | AW87391_EN_SPK | 335 + AW87391_EN_PA | AW87391_REG_EN_CP | 336 + AW87391_EN_SW); 337 + break; 338 + case SND_SOC_DAPM_PRE_PMD: 339 + regmap_write(aw_dev->regmap, AW87390_SYSCTRL_REG, 340 + AW87390_POWER_DOWN_VALUE); 341 + break; 342 + case SND_SOC_DAPM_POST_PMD: 343 + if (!IS_ERR(aw87390->vdd_reg)) { 344 + if (regulator_disable(aw87390->vdd_reg)) 345 + dev_warn(aw_dev->dev, "Failed to disable vdd\n"); 346 + } 347 + break; 348 + default: 349 + dev_err(aw_dev->dev, "%s: invalid event %d\n", __func__, event); 350 + return -EINVAL; 351 + } 352 + 353 + return 0; 354 + } 355 + 317 356 static const struct snd_soc_dapm_widget aw87390_dapm_widgets[] = { 318 357 SND_SOC_DAPM_INPUT("IN"), 319 358 SND_SOC_DAPM_PGA_E("SPK PA", SND_SOC_NOPM, 0, 0, NULL, 0, aw87390_drv_event, 320 359 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 360 + SND_SOC_DAPM_OUTPUT("OUT"), 361 + }; 362 + 363 + static const struct snd_soc_dapm_widget aw87391_rgds_dapm_widgets[] = { 364 + SND_SOC_DAPM_INPUT("IN"), 365 + SND_SOC_DAPM_PGA_E("SPK PA", SND_SOC_NOPM, 0, 0, NULL, 0, aw87391_rgds_drv_event, 366 + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | 367 + SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), 321 368 SND_SOC_DAPM_OUTPUT("OUT"), 322 369 }; 323 370 ··· 386 339 return 0; 387 340 } 388 341 342 + /* 343 + * Firmware typically is used to load the sequence of init commands, 344 + * however for the Anbernic RG-DS we don't have a firmware file just 345 + * a list of registers and values. Most of these values are undocumented 346 + * in the AW87391 datasheet. 347 + */ 348 + static void aw87391_rgds_codec_init(struct aw87390 *aw87390) 349 + { 350 + struct aw_device *aw_dev = aw87390->aw_pa; 351 + 352 + /* Undocumented command per datasheet. */ 353 + regmap_write(aw_dev->regmap, 0x64, 0x3a); 354 + 355 + /* Bits 7:4 are undocumented but provided by manufacturer. */ 356 + regmap_write(aw_dev->regmap, AW87391_CP_REG, 357 + (5 << 4) | AW87391_REG_CP_OVP_8_50V); 358 + 359 + regmap_write(aw_dev->regmap, AW87391_AGCPO_REG, 360 + AW87391_AK1_S_016 | AW87391_AGC2PO_MW(500)); 361 + 362 + regmap_write(aw_dev->regmap, AW87391_AGC2PA_REG, 363 + AW87391_RK_S_20_48 | AW87391_AK2_S_41 | AW87391_AK2F_S_41); 364 + 365 + /* Undocumented commands per datasheet. */ 366 + regmap_write(aw_dev->regmap, 0x5d, 0x00); 367 + regmap_write(aw_dev->regmap, 0x5e, 0xb4); 368 + regmap_write(aw_dev->regmap, 0x5f, 0x30); 369 + regmap_write(aw_dev->regmap, 0x60, 0x39); 370 + regmap_write(aw_dev->regmap, 0x61, 0x10); 371 + regmap_write(aw_dev->regmap, 0x62, 0x03); 372 + regmap_write(aw_dev->regmap, 0x63, 0x7d); 373 + regmap_write(aw_dev->regmap, 0x65, 0xa0); 374 + regmap_write(aw_dev->regmap, 0x66, 0x21); 375 + regmap_write(aw_dev->regmap, 0x67, 0x41); 376 + regmap_write(aw_dev->regmap, 0x68, 0x3b); 377 + regmap_write(aw_dev->regmap, 0x6e, 0x00); 378 + regmap_write(aw_dev->regmap, 0x6f, 0x00); 379 + regmap_write(aw_dev->regmap, 0x70, 0x00); 380 + regmap_write(aw_dev->regmap, 0x71, 0x00); 381 + regmap_write(aw_dev->regmap, 0x72, 0x34); 382 + regmap_write(aw_dev->regmap, 0x73, 0x06); 383 + regmap_write(aw_dev->regmap, 0x74, 0x10); 384 + regmap_write(aw_dev->regmap, 0x75, 0x00); 385 + regmap_write(aw_dev->regmap, 0x7a, 0x00); 386 + regmap_write(aw_dev->regmap, 0x7b, 0x00); 387 + regmap_write(aw_dev->regmap, 0x7c, 0x00); 388 + regmap_write(aw_dev->regmap, 0x7d, 0x00); 389 + 390 + regmap_write(aw_dev->regmap, AW87391_PAG_REG, AW87391_GAIN_12DB); 391 + regmap_write(aw_dev->regmap, AW87391_SYSCTRL_REG, 392 + AW87391_EN_PA | AW87391_REG_EN_CP | AW87391_EN_SW); 393 + regmap_write(aw_dev->regmap, AW87391_SYSCTRL_REG, 394 + AW87391_REG_VER_SEL_LOW | AW87391_REG_EN_ADAP | 395 + AW87391_REG_EN_2X | AW87391_EN_SPK | AW87391_EN_PA | 396 + AW87391_REG_EN_CP | AW87391_EN_SW); 397 + regmap_write(aw_dev->regmap, AW87391_PAG_REG, AW87391_GAIN_15DB); 398 + } 399 + 400 + static int aw87391_rgds_codec_probe(struct snd_soc_component *component) 401 + { 402 + struct aw87390 *aw87390 = snd_soc_component_get_drvdata(component); 403 + 404 + aw87390->vdd_reg = devm_regulator_get_optional(aw87390->aw_pa->dev, 405 + "vdd"); 406 + if (IS_ERR(aw87390->vdd_reg) && PTR_ERR(aw87390->vdd_reg) != -ENODEV) 407 + return dev_err_probe(aw87390->aw_pa->dev, 408 + PTR_ERR(aw87390->vdd_reg), 409 + "Could not get vdd regulator\n"); 410 + 411 + aw87391_rgds_codec_init(aw87390); 412 + 413 + return 0; 414 + } 415 + 389 416 static const struct snd_soc_component_driver soc_codec_dev_aw87390 = { 390 417 .probe = aw87390_codec_probe, 391 418 .dapm_widgets = aw87390_dapm_widgets, ··· 468 347 .num_dapm_routes = ARRAY_SIZE(aw87390_dapm_routes), 469 348 .controls = aw87390_controls, 470 349 .num_controls = ARRAY_SIZE(aw87390_controls), 350 + }; 351 + 352 + static const struct snd_soc_component_driver soc_codec_dev_anbernic_rgds = { 353 + .probe = aw87391_rgds_codec_probe, 354 + .dapm_widgets = aw87391_rgds_dapm_widgets, 355 + .num_dapm_widgets = ARRAY_SIZE(aw87391_rgds_dapm_widgets), 356 + .dapm_routes = aw87390_dapm_routes, 357 + .num_dapm_routes = ARRAY_SIZE(aw87390_dapm_routes), 471 358 }; 472 359 473 360 static void aw87390_parse_channel_dt(struct aw87390 *aw87390) ··· 495 366 unsigned int chip_id; 496 367 int ret; 497 368 369 + aw_dev = devm_kzalloc(&i2c->dev, sizeof(*aw_dev), GFP_KERNEL); 370 + if (!aw_dev) 371 + return -ENOMEM; 372 + 498 373 /* read chip id */ 499 374 ret = regmap_read(regmap, AW87390_ID_REG, &chip_id); 500 375 if (ret) { ··· 506 373 return ret; 507 374 } 508 375 509 - if (chip_id != AW87390_CHIP_ID) { 376 + switch (chip_id) { 377 + case AW87390_CHIP_ID: 378 + aw_dev->chip_id = AW87390_CHIP_ID; 379 + break; 380 + case AW87391_CHIP_ID: 381 + aw_dev->chip_id = AW87391_CHIP_ID; 382 + break; 383 + default: 510 384 dev_err(&i2c->dev, "unsupported device\n"); 511 385 return -ENXIO; 512 386 } 513 387 514 388 dev_dbg(&i2c->dev, "chip id = 0x%x\n", chip_id); 515 389 516 - aw_dev = devm_kzalloc(&i2c->dev, sizeof(*aw_dev), GFP_KERNEL); 517 - if (!aw_dev) 518 - return -ENOMEM; 519 - 520 390 aw87390->aw_pa = aw_dev; 521 391 aw_dev->i2c = i2c; 522 392 aw_dev->regmap = regmap; 523 393 aw_dev->dev = &i2c->dev; 524 - aw_dev->chip_id = AW87390_CHIP_ID; 525 394 aw_dev->acf = NULL; 526 395 aw_dev->prof_info.prof_desc = NULL; 527 396 aw_dev->prof_info.count = 0; ··· 541 406 static int aw87390_i2c_probe(struct i2c_client *i2c) 542 407 { 543 408 struct aw87390 *aw87390; 409 + const struct snd_soc_component_driver *priv; 544 410 int ret; 545 411 546 412 ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C); ··· 570 434 if (ret) 571 435 return ret; 572 436 573 - ret = devm_snd_soc_register_component(&i2c->dev, 574 - &soc_codec_dev_aw87390, NULL, 0); 437 + switch (aw87390->aw_pa->chip_id) { 438 + case AW87390_CHIP_ID: 439 + ret = devm_snd_soc_register_component(&i2c->dev, 440 + &soc_codec_dev_aw87390, NULL, 0); 441 + break; 442 + case AW87391_CHIP_ID: 443 + priv = of_device_get_match_data(&i2c->dev); 444 + if (!priv) 445 + return dev_err_probe(&i2c->dev, -EINVAL, 446 + "aw87391 not currently supported\n"); 447 + ret = devm_snd_soc_register_component(&i2c->dev, priv, NULL, 0); 448 + break; 449 + default: 450 + return -ENXIO; 451 + } 452 + 575 453 if (ret) 576 454 dev_err(&i2c->dev, "failed to register aw87390: %d\n", ret); 577 455 578 456 return ret; 579 457 } 580 458 459 + static const struct of_device_id aw87390_of_match[] = { 460 + { .compatible = "awinic,aw87390" }, 461 + { .compatible = "anbernic,rgds-amp", .data = &soc_codec_dev_anbernic_rgds }, 462 + {}, 463 + }; 464 + MODULE_DEVICE_TABLE(of, aw87390_of_match); 465 + 581 466 static const struct i2c_device_id aw87390_i2c_id[] = { 582 467 { AW87390_I2C_NAME }, 468 + { AW87391_I2C_NAME }, 583 469 { } 584 470 }; 585 471 MODULE_DEVICE_TABLE(i2c, aw87390_i2c_id); ··· 609 451 static struct i2c_driver aw87390_i2c_driver = { 610 452 .driver = { 611 453 .name = AW87390_I2C_NAME, 454 + .of_match_table = of_match_ptr(aw87390_of_match), 612 455 }, 613 456 .probe = aw87390_i2c_probe, 614 457 .id_table = aw87390_i2c_id,
+86
sound/soc/codecs/aw87390.h
··· 52 52 #define AW87390_I2C_NAME "aw87390" 53 53 #define AW87390_ACF_FILE "aw87390_acf.bin" 54 54 55 + #define AW87391_SYSCTRL_REG (0x01) 56 + #define AW87391_REG_VER_SEL_LOW (0 << 6) 57 + #define AW87391_REG_VER_SEL_NORMAL (1 << 6) 58 + #define AW87391_REG_VER_SEL_SUPER (2 << 6) 59 + #define AW87391_REG_EN_ADAP BIT(5) 60 + #define AW87391_REG_EN_2X BIT(4) 61 + #define AW87391_EN_SPK BIT(3) 62 + #define AW87391_EN_PA BIT(2) 63 + #define AW87391_REG_EN_CP BIT(1) 64 + #define AW87391_EN_SW BIT(0) 65 + 66 + #define AW87391_CP_REG (0x02) 67 + #define AW87391_REG_CP_OVP_6_50V 0 68 + #define AW87391_REG_CP_OVP_6_75V 1 69 + #define AW87391_REG_CP_OVP_7_00V 2 70 + #define AW87391_REG_CP_OVP_7_25V 3 71 + #define AW87391_REG_CP_OVP_7_50V 4 72 + #define AW87391_REG_CP_OVP_7_75V 5 73 + #define AW87391_REG_CP_OVP_8_00V 6 74 + #define AW87391_REG_CP_OVP_8_25V 7 75 + #define AW87391_REG_CP_OVP_8_50V 8 76 + 77 + #define AW87391_PAG_REG (0x03) 78 + #define AW87391_GAIN_12DB 0 79 + #define AW87391_GAIN_15DB 1 80 + #define AW87391_GAIN_18DB 2 81 + #define AW87391_GAIN_21DB 3 82 + #define AW87391_GAIN_24DB 4 83 + 84 + #define AW87391_AGCPO_REG (0x04) 85 + #define AW87391_AK1_S_016 (2 << 5) 86 + #define AW87391_AK1_S_032 (3 << 5) 87 + #define AW87391_PD_AGC1_PWRDN BIT(4) 88 + /* AGC2PO supports values between 500mW (0000) to 1600mW (1011) */ 89 + #define AW87391_AGC2PO_MW(n) ((n / 100) - 5) 90 + 91 + #define AW87391_AGC2PA_REG (0x05) 92 + #define AW87391_RK_S_5_12 (0 << 5) 93 + #define AW87391_RK_S_10_24 (1 << 5) 94 + #define AW87391_RK_S_20_48 (2 << 5) 95 + #define AW87391_RK_S_41 (3 << 5) 96 + #define AW87391_RK_S_82 (4 << 5) 97 + #define AW87391_RK_S_164 (5 << 5) 98 + #define AW87391_RK_S_328 (6 << 5) 99 + #define AW87391_RK_S_656 (7 << 5) 100 + #define AW87391_AK2_S_1_28 (0 << 2) 101 + #define AW87391_AK2_S_2_56 (1 << 2) 102 + #define AW87391_AK2_S_10_24 (2 << 2) 103 + #define AW87391_AK2_S_41 (3 << 2) 104 + #define AW87391_AK2_S_82 (4 << 2) 105 + #define AW87391_AK2_S_164 (5 << 2) 106 + #define AW87391_AK2_S_328 (6 << 2) 107 + #define AW87391_AK2_S_656 (7 << 2) 108 + #define AW87391_AK2F_S_10_24 0 109 + #define AW87391_AK2F_S_20_48 1 110 + #define AW87391_AK2F_S_41 2 111 + #define AW87391_AK2F_S_82 3 112 + 113 + #define AW87391_SYSST_REG (0x06) 114 + #define AW87391_UVLO BIT(7) 115 + #define AW87391_OTN BIT(6) 116 + #define AW87391_OC_FLAG BIT(5) 117 + #define AW87391_ADAP_CP BIT(4) 118 + #define AW87391_STARTOK BIT(3) 119 + #define AW87391_CP_OVP BIT(2) 120 + #define AW87391_PORN BIT(1) 121 + 122 + #define AW87391_SYSINT_REG (0x07) 123 + #define AW87391_UVLOI BIT(7) 124 + #define AW87391_ONTI BIT(6) 125 + #define AW87391_OC_FLAGI BIT(5) 126 + #define AW87391_ADAP_CPI BIT(4) 127 + #define AW87391_STARTOKI BIT(3) 128 + #define AW87391_CP_OVPI BIT(2) 129 + #define AW87391_PORNI BIT(1) 130 + 131 + #define AW87391_DFT_THGEN0_REG (0x63) 132 + #define AW87391_ADAPVTH_01W (0 << 2) 133 + #define AW87391_ADAPVTH_02W (1 << 2) 134 + #define AW87391_ADAPVTH_03W (2 << 2) 135 + #define AW87391_ADAPVTH_04W (3 << 2) 136 + 137 + #define AW87391_I2C_NAME "aw87391" 138 + 55 139 #define AW87390_PROFILE_EXT(xname, profile_info, profile_get, profile_set) \ 56 140 { \ 57 141 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ ··· 147 63 148 64 enum aw87390_id { 149 65 AW87390_CHIP_ID = 0x76, 66 + AW87391_CHIP_ID = 0xc1, 150 67 }; 151 68 152 69 enum { ··· 165 80 struct mutex lock; 166 81 struct regmap *regmap; 167 82 struct aw_container *aw_cfg; 83 + struct regulator *vdd_reg; 168 84 }; 169 85 170 86 #endif
+1 -1
sound/soc/codecs/cs35l45.c
··· 453 453 SND_SOC_DAPM_AIF_OUT("ASP_TX2", NULL, 1, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX2_EN_SHIFT, 0), 454 454 SND_SOC_DAPM_AIF_OUT("ASP_TX3", NULL, 2, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX3_EN_SHIFT, 0), 455 455 SND_SOC_DAPM_AIF_OUT("ASP_TX4", NULL, 3, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX4_EN_SHIFT, 0), 456 - SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 3, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX5_EN_SHIFT, 0), 456 + SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 4, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX5_EN_SHIFT, 0), 457 457 458 458 SND_SOC_DAPM_MUX("ASP_TX1 Source", SND_SOC_NOPM, 0, 0, &cs35l45_asp_muxes[0]), 459 459 SND_SOC_DAPM_MUX("ASP_TX2 Source", SND_SOC_NOPM, 0, 0, &cs35l45_asp_muxes[1]),
-1
sound/soc/fsl/imx-card.c
··· 346 346 SND_SOC_DAIFMT_PDM; 347 347 } else { 348 348 slots = 2; 349 - slot_width = params_physical_width(params); 350 349 fmt = (rtd->dai_link->dai_fmt & ~SND_SOC_DAIFMT_FORMAT_MASK) | 351 350 SND_SOC_DAIFMT_I2S; 352 351 }
+1 -1
sound/soc/intel/boards/sof_es8336.c
··· 120 120 gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en); 121 121 122 122 if (quirk & SOF_ES8336_HEADPHONE_GPIO) 123 - gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en); 123 + gpiod_set_value_cansleep(priv->gpio_headphone, !priv->speaker_en); 124 124 125 125 } 126 126
+1
sound/soc/intel/boards/sof_sdw.c
··· 838 838 SND_PCI_QUIRK(0x17aa, 0x2347, "Lenovo P16", SOC_SDW_CODEC_MIC), 839 839 SND_PCI_QUIRK(0x17aa, 0x2348, "Lenovo P16", SOC_SDW_CODEC_MIC), 840 840 SND_PCI_QUIRK(0x17aa, 0x2349, "Lenovo P1", SOC_SDW_CODEC_MIC), 841 + SND_PCI_QUIRK(0x17aa, 0x3821, "Lenovo 0x3821", SOC_SDW_SIDECAR_AMPS), 841 842 {} 842 843 }; 843 844
+1 -1
sound/soc/intel/common/soc-acpi-intel-ptl-match.c
··· 451 451 .adr = 0x000230025D132001ull, 452 452 .num_endpoints = 1, 453 453 .endpoints = &spk_r_endpoint, 454 - .name_prefix = "rt1320-1" 454 + .name_prefix = "rt1320-2" 455 455 } 456 456 }; 457 457
+2 -1
tools/objtool/check.c
··· 197 197 * as well as changes to the source code itself between versions (since 198 198 * these come from the Rust standard library). 199 199 */ 200 - return str_ends_with(func->name, "_4core5sliceSp15copy_from_slice17len_mismatch_fail") || 200 + return str_ends_with(func->name, "_4core3num22from_ascii_radix_panic") || 201 + str_ends_with(func->name, "_4core5sliceSp15copy_from_slice17len_mismatch_fail") || 201 202 str_ends_with(func->name, "_4core6option13expect_failed") || 202 203 str_ends_with(func->name, "_4core6option13unwrap_failed") || 203 204 str_ends_with(func->name, "_4core6result13unwrap_failed") ||
+8 -6
tools/objtool/disas.c
··· 108 108 109 109 #define DINFO_FPRINTF(dinfo, ...) \ 110 110 ((*(dinfo)->fprintf_func)((dinfo)->stream, __VA_ARGS__)) 111 + #define bfd_vma_fmt \ 112 + __builtin_choose_expr(sizeof(bfd_vma) == sizeof(unsigned long), "%#lx <%s>", "%#llx <%s>") 111 113 112 114 static int disas_result_fprintf(struct disas_context *dctx, 113 115 const char *fmt, va_list ap) ··· 172 170 173 171 if (sym) { 174 172 sprint_name(symstr, sym->name, addr - sym->offset); 175 - DINFO_FPRINTF(dinfo, "0x%lx <%s>", addr, symstr); 173 + DINFO_FPRINTF(dinfo, bfd_vma_fmt, addr, symstr); 176 174 } else { 177 175 str = offstr(sec, addr); 178 - DINFO_FPRINTF(dinfo, "0x%lx <%s>", addr, str); 176 + DINFO_FPRINTF(dinfo, bfd_vma_fmt, addr, str); 179 177 free(str); 180 178 } 181 179 } ··· 254 252 * example: "lea 0x0(%rip),%rdi". The kernel can reference 255 253 * the next IP with _THIS_IP_ macro. 256 254 */ 257 - DINFO_FPRINTF(dinfo, "0x%lx <_THIS_IP_>", addr); 255 + DINFO_FPRINTF(dinfo, bfd_vma_fmt, addr, "_THIS_IP_"); 258 256 return; 259 257 } 260 258 ··· 266 264 */ 267 265 if (reloc->sym->type == STT_SECTION) { 268 266 str = offstr(reloc->sym->sec, reloc->sym->offset + offset); 269 - DINFO_FPRINTF(dinfo, "0x%lx <%s>", addr, str); 267 + DINFO_FPRINTF(dinfo, bfd_vma_fmt, addr, str); 270 268 free(str); 271 269 } else { 272 270 sprint_name(symstr, reloc->sym->name, offset); 273 - DINFO_FPRINTF(dinfo, "0x%lx <%s>", addr, symstr); 271 + DINFO_FPRINTF(dinfo, bfd_vma_fmt, addr, symstr); 274 272 } 275 273 } 276 274 ··· 313 311 */ 314 312 sym = insn_call_dest(insn); 315 313 if (sym && (sym->offset == addr || (sym->offset == 0 && is_reloc))) { 316 - DINFO_FPRINTF(dinfo, "0x%lx <%s>", addr, sym->name); 314 + DINFO_FPRINTF(dinfo, bfd_vma_fmt, addr, sym->name); 317 315 return; 318 316 } 319 317
+6 -7
tools/objtool/elf.c
··· 18 18 #include <errno.h> 19 19 #include <libgen.h> 20 20 #include <ctype.h> 21 + #include <linux/align.h> 22 + #include <linux/kernel.h> 21 23 #include <linux/interval_tree_generic.h> 24 + #include <linux/log2.h> 22 25 #include <objtool/builtin.h> 23 26 #include <objtool/elf.h> 24 27 #include <objtool/warn.h> 25 - 26 - #define ALIGN_UP(x, align_to) (((x) + ((align_to)-1)) & ~((align_to)-1)) 27 - #define ALIGN_UP_POW2(x) (1U << ((8 * sizeof(x)) - __builtin_clz((x) - 1U))) 28 - #define MAX(a, b) ((a) > (b) ? (a) : (b)) 29 28 30 29 static inline u32 str_hash(const char *str) 31 30 { ··· 1335 1336 return -1; 1336 1337 } 1337 1338 1338 - offset = ALIGN_UP(strtab->sh.sh_size, strtab->sh.sh_addralign); 1339 + offset = ALIGN(strtab->sh.sh_size, strtab->sh.sh_addralign); 1339 1340 1340 1341 if (!elf_add_data(elf, strtab, str, strlen(str) + 1)) 1341 1342 return -1; ··· 1377 1378 sec->data->d_size = size; 1378 1379 sec->data->d_align = 1; 1379 1380 1380 - offset = ALIGN_UP(sec->sh.sh_size, sec->sh.sh_addralign); 1381 + offset = ALIGN(sec->sh.sh_size, sec->sh.sh_addralign); 1381 1382 sec->sh.sh_size = offset + size; 1382 1383 1383 1384 mark_sec_changed(elf, sec, true); ··· 1501 1502 rsec->data->d_size = nr_relocs_new * elf_rela_size(elf); 1502 1503 rsec->sh.sh_size = rsec->data->d_size; 1503 1504 1504 - nr_alloc = MAX(64, ALIGN_UP_POW2(nr_relocs_new)); 1505 + nr_alloc = max(64UL, roundup_pow_of_two(nr_relocs_new)); 1505 1506 if (nr_alloc <= rsec->nr_alloc_relocs) 1506 1507 return 0; 1507 1508
+11 -3
tools/objtool/klp-diff.c
··· 1425 1425 { 1426 1426 struct section *patched_sec; 1427 1427 1428 - if (create_fake_symbols(e->patched)) 1429 - return -1; 1430 - 1431 1428 for_each_sec(e->patched, patched_sec) { 1432 1429 if (is_special_section(patched_sec)) { 1433 1430 if (clone_special_section(e, patched_sec)) ··· 1699 1702 1700 1703 e.out = elf_create_file(&e.orig->ehdr, argv[2]); 1701 1704 if (!e.out) 1705 + return -1; 1706 + 1707 + /* 1708 + * Special section fake symbols are needed so that individual special 1709 + * section entries can be extracted by clone_special_sections(). 1710 + * 1711 + * Note the fake symbols are also needed by clone_included_functions() 1712 + * because __WARN_printf() call sites add references to bug table 1713 + * entries in the calling functions. 1714 + */ 1715 + if (create_fake_symbols(e.patched)) 1702 1716 return -1; 1703 1717 1704 1718 if (clone_included_functions(&e))
+7
tools/testing/selftests/net/fcnal-test.sh
··· 2327 2327 log_test_addr ${a} $? 2 "ping local, device bind" 2328 2328 done 2329 2329 2330 + for a in ${NSA_LO_IP6} ${NSA_LINKIP6}%${NSA_DEV} ${NSA_IP6} 2331 + do 2332 + log_start 2333 + run_cmd ${ping6} -c1 -w1 -I ::1 ${a} 2334 + log_test_addr ${a} $? 0 "ping local, from localhost" 2335 + done 2336 + 2330 2337 # 2331 2338 # ip rule blocks address 2332 2339 #
+74 -7
tools/testing/selftests/net/mptcp/mptcp_join.sh
··· 2329 2329 ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=1 2330 2330 speed=slow \ 2331 2331 run_tests $ns1 $ns2 10.0.1.1 2332 + chk_join_nr 3 3 3 2332 2333 2333 2334 # It is not directly linked to the commit introducing this 2334 2335 # symbol but for the parent one which is linked anyway. 2335 - if ! mptcp_lib_kallsyms_has "mptcp_pm_subflow_check_next$"; then 2336 - chk_join_nr 3 3 2 2337 - chk_add_nr 4 4 2338 - else 2339 - chk_join_nr 3 3 3 2336 + if mptcp_lib_kallsyms_has "mptcp_pm_subflow_check_next$"; then 2340 2337 # the server will not signal the address terminating 2341 2338 # the MPC subflow 2342 2339 chk_add_nr 3 3 2340 + else 2341 + chk_add_nr 4 4 2343 2342 fi 2344 2343 fi 2345 2344 } ··· 3846 3847 fi 3847 3848 } 3848 3849 3849 - # $1: ns ; $2: event type ; $3: count 3850 + # $1: ns ; $2: event type ; $3: count ; [ $4: attr ; $5: attr count ] 3850 3851 chk_evt_nr() 3851 3852 { 3852 3853 local ns=${1} 3853 3854 local evt_name="${2}" 3854 3855 local exp="${3}" 3856 + local attr="${4}" 3857 + local attr_exp="${5}" 3855 3858 3856 3859 local evts="${evts_ns1}" 3857 3860 local evt="${!evt_name}" 3861 + local attr_name 3858 3862 local count 3863 + 3864 + if [ -n "${attr}" ]; then 3865 + attr_name=", ${attr}: ${attr_exp}" 3866 + fi 3859 3867 3860 3868 evt_name="${evt_name:16}" # without MPTCP_LIB_EVENT_ 3861 3869 [ "${ns}" == "ns2" ] && evts="${evts_ns2}" 3862 3870 3863 - print_check "event ${ns} ${evt_name} (${exp})" 3871 + print_check "event ${ns} ${evt_name} (${exp}${attr_name})" 3864 3872 3865 3873 if [[ "${evt_name}" = "LISTENER_"* ]] && 3866 3874 ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then ··· 3878 3872 count=$(grep -cw "type:${evt}" "${evts}") 3879 3873 if [ "${count}" != "${exp}" ]; then 3880 3874 fail_test "got ${count} events, expected ${exp}" 3875 + cat "${evts}" 3876 + return 3877 + elif [ -z "${attr}" ]; then 3878 + print_ok 3879 + return 3880 + fi 3881 + 3882 + count=$(grep -w "type:${evt}" "${evts}" | grep -c ",${attr}:") 3883 + if [ "${count}" != "${attr_exp}" ]; then 3884 + fail_test "got ${count} event attributes, expected ${attr_exp}" 3885 + grep -w "type:${evt}" "${evts}" 3881 3886 else 3882 3887 print_ok 3883 3888 fi 3889 + } 3890 + 3891 + # $1: ns ; $2: event type ; $3: expected count 3892 + wait_event() 3893 + { 3894 + local ns="${1}" 3895 + local evt_name="${2}" 3896 + local exp="${3}" 3897 + 3898 + local evt="${!evt_name}" 3899 + local evts="${evts_ns1}" 3900 + local count 3901 + 3902 + [ "${ns}" == "ns2" ] && evts="${evts_ns2}" 3903 + 3904 + for _ in $(seq 100); do 3905 + count=$(grep -cw "type:${evt}" "${evts}") 3906 + [ "${count}" -ge "${exp}" ] && break 3907 + sleep 0.1 3908 + done 3884 3909 } 3885 3910 3886 3911 userspace_tests() ··· 4119 4082 chk_rst_nr 0 0 invert 4120 4083 chk_mptcp_info subflows 1 subflows 1 4121 4084 chk_subflows_total 1 1 4085 + kill_events_pids 4086 + mptcp_lib_kill_group_wait $tests_pid 4087 + fi 4088 + 4089 + # userspace pm no duplicated spurious close events after an error 4090 + if reset_with_events "userspace pm no dup close events after error" && 4091 + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then 4092 + set_userspace_pm $ns2 4093 + pm_nl_set_limits $ns1 0 2 4094 + { timeout_test=120 test_linkfail=128 speed=slow \ 4095 + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 4096 + local tests_pid=$! 4097 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 4098 + userspace_pm_add_sf $ns2 10.0.3.2 20 4099 + chk_mptcp_info subflows 1 subflows 1 4100 + chk_subflows_total 2 2 4101 + 4102 + # force quick loss 4103 + ip netns exec $ns2 sysctl -q net.ipv4.tcp_syn_retries=1 4104 + if ip netns exec "${ns1}" ${iptables} -A INPUT -s "10.0.1.2" \ 4105 + -p tcp --tcp-option 30 -j REJECT --reject-with tcp-reset && 4106 + ip netns exec "${ns2}" ${iptables} -A INPUT -d "10.0.1.2" \ 4107 + -p tcp --tcp-option 30 -j REJECT --reject-with tcp-reset; then 4108 + wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 1 4109 + wait_event ns1 MPTCP_LIB_EVENT_SUB_CLOSED 1 4110 + chk_subflows_total 1 1 4111 + userspace_pm_add_sf $ns2 10.0.1.2 0 4112 + wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 4113 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 error 2 4114 + fi 4122 4115 kill_events_pids 4123 4116 mptcp_lib_kill_group_wait $tests_pid 4124 4117 fi