Date: Mon, 29 Jul 2024 10:44:16 +0200 From: Benjamin Tissoires To: Linus Torvalds Cc: Jiri Kosina , linux-kernel@vger.kernel.org Subject: [GIT PULL] HID fixes for 6.11 Linus, please pull from git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git tags/for-linus-2024072901 to receive fixes that should go into 6.11: ==== - fixes for HID-BPF after the merge with the bpf tree (in v6.11-rc1) (Arnd Bergmann and Benjamin Tissoires) - some tool type fix for the Wacom driver (Tatsunosuke Tobita) - A reorder of the sensor discovery to ensure the HID AMD SFH is removed when no sensors are available (Basavaraj Natikar) ==== Thanks, ---------------------------------------------------------------- Arnd Bergmann (1): hid: bpf: add BPF_JIT dependency Basavaraj Natikar (1): HID: amd_sfh: Move sensor discovery before HID device initialization Benjamin Tissoires (4): selftests/hid: fix bpf_wq new API selftests/hid: disable struct_ops auto-attach HID: bpf: prevent the same struct_ops to be attached more than once selftests/hid: add test for attaching multiple time the same struct_ops Tatsunosuke Tobita (2): HID: wacom: Modify pen IDs HID: wacom: more appropriate tool type categorization drivers/hid/amd-sfh-hid/amd_sfh_client.c | 18 +++++++++++------- drivers/hid/bpf/Kconfig | 2 +- drivers/hid/bpf/hid_bpf_struct_ops.c | 5 +++++ drivers/hid/wacom_wac.c | 67 ++++++++++--------------------------------------------------------- tools/testing/selftests/hid/hid_bpf.c | 26 ++++++++++++++++++++++++++ tools/testing/selftests/hid/progs/hid.c | 2 +- tools/testing/selftests/hid/progs/hid_bpf_helpers.h | 2 +- 7 files changed, 55 insertions(+), 67 deletions(-) --- Cheers, Benjamin . Date: Mon, 29 Jul 2024 21:06:31 +0530 From: Vishnu Reddy To: krzysztof.kozlowski@linaro.org, s.nawrocki@samsung.com, alim.akhtar@samsung.com, linus.walleij@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, pankaj.dubey@samsung.com, ravi.patel@samsung.com, gost.dev@samsung.com Subject: [PATCH v4] pinctrl: samsung: Add support for pull-up and pull-down Gpiolib framework has the implementation of setting up the PUD configuration for GPIO pins but there is no driver support. Add support to handle the PUD configuration request from the userspace in samsung pinctrl driver. Signed-off-by: Vishnu Reddy --- drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 14 ++++ drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 14 ++++ drivers/pinctrl/samsung/pinctrl-samsung.c | 77 ++++++++++++++++++++ drivers/pinctrl/samsung/pinctrl-samsung.h | 21 ++++++ 4 files changed, 126 insertions(+) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c index 85ddf49a5188..d3d8672f74dc 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c @@ -40,6 +40,19 @@ static const struct samsung_pin_bank_type bank_type_alive = { #define S5P_OTHERS_RET_MMC (1 << 29) #define S5P_OTHERS_RET_UART (1 << 28) +#define S5P_PIN_PULL_DISABLE 0 +#define S5P_PIN_PULL_DOWN 1 +#define S5P_PIN_PULL_UP 2 + +static void s5pv210_pud_value_init(struct samsung_pinctrl_drv_data *drvdata) +{ + unsigned int *pud_val = drvdata->pud_val; + + pud_val[PUD_PULL_DISABLE] = S5P_PIN_PULL_DISABLE; + pud_val[PUD_PULL_DOWN] = S5P_PIN_PULL_DOWN; + pud_val[PUD_PULL_UP] = S5P_PIN_PULL_UP; +} + static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata) { void __iomem *clk_base = (void __iomem *)drvdata->retention_ctrl->priv; @@ -133,6 +146,7 @@ static const struct samsung_pin_ctrl s5pv210_pin_ctrl[] __initconst = { .nr_banks = ARRAY_SIZE(s5pv210_pin_bank), .eint_gpio_init = exynos_eint_gpio_init, .eint_wkup_init = exynos_eint_wkup_init, + .pud_value_init = s5pv210_pud_value_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, .retention_data = &s5pv210_retention_data, diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c index c5d92db4fdb1..68715c09baa9 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c @@ -63,6 +63,10 @@ #define EINT_CON_MASK 0xF #define EINT_CON_LEN 4 +#define S3C_PIN_PULL_DISABLE 0 +#define S3C_PIN_PULL_DOWN 1 +#define S3C_PIN_PULL_UP 2 + static const struct samsung_pin_bank_type bank_type_4bit_off = { .fld_width = { 4, 1, 2, 0, 2, 2, }, .reg_offset = { 0x00, 0x04, 0x08, 0, 0x0c, 0x10, }, @@ -255,6 +259,15 @@ static int s3c64xx_irq_get_trigger(unsigned int type) return trigger; } +static void s3c64xx_pud_value_init(struct samsung_pinctrl_drv_data *drvdata) +{ + unsigned int *pud_val = drvdata->pud_val; + + pud_val[PUD_PULL_DISABLE] = S3C_PIN_PULL_DISABLE; + pud_val[PUD_PULL_DOWN] = S3C_PIN_PULL_DOWN; + pud_val[PUD_PULL_UP] = S3C_PIN_PULL_UP; +} + static void s3c64xx_irq_set_handler(struct irq_data *d, unsigned int type) { /* Edge- and level-triggered interrupts need different handlers */ @@ -797,6 +810,7 @@ static const struct samsung_pin_ctrl s3c64xx_pin_ctrl[] __initconst = { .nr_banks = ARRAY_SIZE(s3c64xx_pin_banks0), .eint_gpio_init = s3c64xx_eint_gpio_init, .eint_wkup_init = s3c64xx_eint_eint0_init, + .pud_value_init = s3c64xx_pud_value_init, }, }; diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 623df65a5d6f..15aa1b71c025 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -997,6 +997,77 @@ static int samsung_pinctrl_unregister(struct platform_device *pdev, return 0; } +static void samsung_pud_value_init(struct samsung_pinctrl_drv_data *drvdata) +{ + unsigned int *pud_val = drvdata->pud_val; + + pud_val[PUD_PULL_DISABLE] = EXYNOS_PIN_PUD_PULL_DISABLE; + pud_val[PUD_PULL_DOWN] = EXYNOS_PIN_PID_PULL_DOWN; + pud_val[PUD_PULL_UP] = EXYNOS_PIN_PID_PULL_UP; +} + +/* + * Enable or Disable the pull-down and pull-up for the gpio pins in the + * PUD register. + */ +static void samsung_gpio_set_pud(struct gpio_chip *gc, unsigned int offset, + unsigned int value) +{ + struct samsung_pin_bank *bank = gpiochip_get_data(gc); + const struct samsung_pin_bank_type *type = bank->type; + void __iomem *reg; + unsigned int data, mask; + + reg = bank->pctl_base + bank->pctl_offset; + data = readl(reg + type->reg_offset[PINCFG_TYPE_PUD]); + mask = (1 << type->fld_width[PINCFG_TYPE_PUD]) - 1; + data &= ~(mask << (offset * type->fld_width[PINCFG_TYPE_PUD])); + data |= value << (offset * type->fld_width[PINCFG_TYPE_PUD]); + writel(data, reg + type->reg_offset[PINCFG_TYPE_PUD]); +} + +/* + * Identify the type of PUD config based on the gpiolib request to enable + * or disable the PUD config. + */ +static int samsung_gpio_set_config(struct gpio_chip *gc, unsigned int offset, + unsigned long config) +{ + struct samsung_pin_bank *bank = gpiochip_get_data(gc); + struct samsung_pinctrl_drv_data *drvdata = bank->drvdata; + unsigned int value; + int ret = 0; + unsigned long flags; + + switch (pinconf_to_config_param(config)) { + case PIN_CONFIG_BIAS_DISABLE: + value = drvdata->pud_val[PUD_PULL_DISABLE]; + break; + case PIN_CONFIG_BIAS_PULL_DOWN: + value = drvdata->pud_val[PUD_PULL_DOWN]; + break; + case PIN_CONFIG_BIAS_PULL_UP: + value = drvdata->pud_val[PUD_PULL_UP]; + break; + default: + return -ENOTSUPP; + } + + ret = clk_enable(drvdata->pclk); + if (ret) { + dev_err(drvdata->dev, "failed to enable clock\n"); + return ret; + } + + raw_spin_lock_irqsave(&bank->slock, flags); + samsung_gpio_set_pud(gc, offset, value); + raw_spin_unlock_irqrestore(&bank->slock, flags); + + clk_disable(drvdata->pclk); + + return ret; +} + static const struct gpio_chip samsung_gpiolib_chip = { .request = gpiochip_generic_request, .free = gpiochip_generic_free, @@ -1006,6 +1077,7 @@ static const struct gpio_chip samsung_gpiolib_chip = { .direction_output = samsung_gpio_direction_output, .to_irq = samsung_gpio_to_irq, .add_pin_ranges = samsung_add_pin_ranges, + .set_config = samsung_gpio_set_config, .owner = THIS_MODULE, }; @@ -1237,6 +1309,11 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) if (ctrl->eint_wkup_init) ctrl->eint_wkup_init(drvdata); + if (ctrl->pud_value_init) + ctrl->pud_value_init(drvdata); + else + samsung_pud_value_init(drvdata); + ret = samsung_gpiolib_register(pdev, drvdata); if (ret) goto err_unregister; diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index d50ba6f07d5d..a1e7377bd890 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -61,6 +61,25 @@ enum pincfg_type { #define PIN_CON_FUNC_INPUT 0x0 #define PIN_CON_FUNC_OUTPUT 0x1 +/* Values for the pin PUD register */ +#define EXYNOS_PIN_PUD_PULL_DISABLE 0x0 +#define EXYNOS_PIN_PID_PULL_DOWN 0x1 +#define EXYNOS_PIN_PID_PULL_UP 0x3 + +/* + * enum pud_index - Possible index values to access the pud_val array. + * @PUD_PULL_DISABLE: Index for the value of pud disable + * @PUD_PULL_DOWN: Index for the value of pull down enable + * @PUD_PULL_UP: Index for the value of pull up enable + * @PUD_MAX: Maximum value of the index + */ +enum pud_index { + PUD_PULL_DISABLE, + PUD_PULL_DOWN, + PUD_PULL_UP, + PUD_MAX, +}; + /** * enum eint_type - possible external interrupt types. * @EINT_TYPE_NONE: bank does not support external interrupts @@ -261,6 +280,7 @@ struct samsung_pin_ctrl { int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); + void (*pud_value_init)(struct samsung_pinctrl_drv_data *drvdata); void (*suspend)(struct samsung_pinctrl_drv_data *); void (*resume)(struct samsung_pinctrl_drv_data *); }; @@ -307,6 +327,7 @@ struct samsung_pinctrl_drv_data { struct samsung_pin_bank *pin_banks; unsigned int nr_banks; unsigned int nr_pins; + unsigned int pud_val[PUD_MAX]; struct samsung_retention_ctrl *retention_ctrl; -- 2.17.1 . Date: Tue, 30 Jul 2024 00:03:52 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: Anna-Maria Behnsen , linux-kernel@vger.kernel.org Subject: [GIT PULL] posix-timers updates Thomas, Please pull the latest tags/posix-timers-2024-07-29 tag from: git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git tags/posix-timers-2024-07-29 up to 7f8af7bac5380f2d95a63a6f19964e22437166e1: signal: Replace BUG_ON()s (2024-07-29 21:57:35 +0200) ---------------------------------------------------------------- Updates for posix timers and related signal code: * Prepare posix timers selftests for upcoming changes: - Check signal behaviour sanity against SIG_IGN - Check signal behaviour sanity against timer reprogramm/deletion - Check SIGEV_NONE pending expiry read - Check interval timer read on a pending SIGNAL - Check correct overrun count after signal block/unblock * Various consolidations: - timer get/set - signal queue * Fixes: - Correctly read SIGEV_NONE timers - Forward expiry while reading expired interval timers with pending signal - Don't arm SIGEV_NONE timers * Various cleanups all over the place ---------------------------------------------------------------- Thomas Gleixner (24): selftests/timers/posix_timers: Simplify error handling selftests/timers/posix_timers: Add SIG_IGN test selftests/timers/posix_timers: Validate signal rules selftests/timers/posix-timers: Validate SIGEV_NONE selftests/timers/posix-timers: Validate timer_gettime() selftests/timers/posix-timers: Validate overrun after unblock posix-cpu-timers: Split up posix_cpu_timer_get() posix-cpu-timers: Save interval only for armed timers posix-cpu-timers: Handle interval timers correctly in timer_get() posix-cpu-timers: Handle SIGEV_NONE timers correctly in timer_get() posix-cpu-timers: Handle SIGEV_NONE timers correctly in timer_set() posix-cpu-timers: Replace old expiry retrieval in posix_cpu_timer_set() posix-cpu-timers: Do not arm SIGEV_NONE timers posix-cpu-timers: Use @now instead of @val for clarity posix-cpu-timers: Remove incorrect comment in posix_cpu_timer_set() posix-cpu-timers: Simplify posix_cpu_timer_set() posix-timers: Retrieve interval in common timer_settime() code posix-timers: Clear overrun in common_timer_set() posix-timers: Convert timer list to hlist posix-timers: Consolidate timer setup posix-cpu-timers: Make k_itimer::it_active consistent posix-timers: Consolidate signal queueing signal: Remove task argument from dequeue_signal() signal: Replace BUG_ON()s fs/proc/base.c | 6 +- fs/signalfd.c | 4 +- include/linux/posix-timers.h | 2 +- include/linux/sched/signal.h | 7 +- init/init_task.c | 2 +- kernel/fork.c | 2 +- kernel/signal.c | 34 +- kernel/time/alarmtimer.c | 7 +- kernel/time/posix-cpu-timers.c | 207 ++++------ kernel/time/posix-timers.c | 69 ++-- kernel/time/posix-timers.h | 3 +- tools/testing/selftests/timers/posix_timers.c | 550 +++++++++++++++++++++----- 12 files changed, 607 insertions(+), 286 deletions(-) . Date: Tue, 30 Jul 2024 20:08:54 +0800 From: Tzung-Bi Shih To: torvalds@linux-foundation.org Cc: tzungbi@kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev Subject: [GIT PULL] chrome-platform fixes for v6.11-rc2 --adrtwPlj+pL8w0Qo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Linus, Please pull chrome-platform fixes for v6.11-rc2. Thanks, TzungBi ------ The following changes since commit 4baf1cc54433ff7c6e5178517bc8768001416681: power: supply: cros_charge-control: Fix signedness bug in charge_behaviour_store() (2024-07-05 01:51:33 +0000) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git tags/chrome-platform-fixes-for-v6.11-rc2 for you to fetch changes up to df615907f1bf907260af01ccb904d0e9304b5278: platform/chrome: cros_ec_proto: Lock device when updating MKBP version (2024-07-30 19:48:35 +0800) ---------------------------------------------------------------- chrome-platform fixes for v6.11-rc2 Fix a race condition that sends multiple host commands at a time. ---------------------------------------------------------------- Patryk Duda (1): platform/chrome: cros_ec_proto: Lock device when updating MKBP version drivers/platform/chrome/cros_ec_proto.c | 2 ++ 1 file changed, 2 insertions(+) --adrtwPlj+pL8w0Qo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQS0yQeDP3cjLyifNRUrxTEGBto89AUCZqjX1gAKCRArxTEGBto8 9L8hAP97NNwfIuLMJk3apnyzlQp3JX6JFkigWRLhk1nB+WxCPwEAtvgDxY3BybnA R+sF7Xt/Ag1qh4qSdaRI2Soz/jmy1AI= =e6/i -----END PGP SIGNATURE----- --adrtwPlj+pL8w0Qo-- . Date: Wed, 31 Jul 2024 04:14:09 +0200 From: David Sterba To: torvalds@linux-foundation.org Cc: David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Btrfs fixes for 6.11-rc2 Hi, please pull the following fixes, thanks. - fix regression in extent map rework when handling insertion of overlapping compressed extent - fix unexpected file length when appending to a file using direct io and buffer not faulted in - in zoned mode, fix accounting of unusable space when flipping read-only block group back to read-write - fix page locking when COWing an inline range, assertion failure found by syzbot - fix calculation of space info in debugging print - tree-checker, add validation of data reference item - fix a few -Wmaybe-uninitialized build warnings ---------------------------------------------------------------- The following changes since commit c3ece6b7ffb4a7c00e8d53cbf4026a32b6127914: btrfs: change BTRFS_MOUNT_* flags to 64bit type (2024-07-19 17:20:23 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git tags/for-6.11-rc1-tag for you to fetch changes up to b8e947e9f64cac9df85a07672b658df5b2bcff07: btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry() (2024-07-30 15:33:06 +0200) ---------------------------------------------------------------- Boris Burkov (1): btrfs: make cow_file_range_inline() honor locked_page on error David Sterba (1): btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry() Filipe Manana (2): btrfs: fix corrupt read due to bad offset of a compressed extent map btrfs: fix corruption after buffer fault in during direct IO append write Naohiro Aota (2): btrfs: do not subtract delalloc from avail bytes btrfs: zoned: fix zone_unusable accounting on making block group read-write again Qu Wenruo (1): btrfs: tree-checker: validate dref root and objectid fs/btrfs/block-group.c | 13 +++-- fs/btrfs/ctree.h | 1 + fs/btrfs/direct-io.c | 38 +++++++++++---- fs/btrfs/extent-tree.c | 3 +- fs/btrfs/extent_map.c | 2 +- fs/btrfs/file.c | 17 +++++-- fs/btrfs/free-space-cache.c | 4 +- fs/btrfs/inode.c | 18 ++++--- fs/btrfs/space-info.c | 5 +- fs/btrfs/space-info.h | 1 + fs/btrfs/tests/extent-map-tests.c | 99 +++++++++++++++++++++++++++++++++++++++ fs/btrfs/tree-checker.c | 47 +++++++++++++++++++ include/trace/events/btrfs.h | 8 ++++ 13 files changed, 225 insertions(+), 31 deletions(-) . Date: Tue, 30 Jul 2024 15:51:24 -0700 From: Namhyung Kim To: Linus Torvalds Cc: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Leo Yan , Casey Chen Subject: [GIT PULL] perf-tools fixes for v6.11-rc2 Hi Linus, Please consider pulling the following changes in perf tools for v6.11. Thanks, Namhyung The following changes since commit 92717bc077892d1ce60fee07aee3a33f33909b85: perf dso: Fix build when libunwind is enabled (2024-07-17 13:17:57 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git tags/perf-tools-fixes-for-v6.11-2024-07-30 for you to fetch changes up to d27087c76e3c859ea05b7581ef7ce8aa5a088dd8: perf docs: Document cross compilation (2024-07-26 11:15:55 -0700) ---------------------------------------------------------------- Another perf tools fixes for v6.11 Some more fixes about the build and a random crash: * Fix cross-build by setting pkg-config env according to the arch * Fix static build for missing library dependencies * Fix Segfault when callchain has no symbols Signed-off-by: Namhyung Kim ---------------------------------------------------------------- Casey Chen (1): perf tool: fix dereferencing NULL al->maps Leo Yan (6): perf: build: Setup PKG_CONFIG_LIBDIR for cross compilation perf: build: Set Python configuration for cross compilation perf: build: Only link libebl.a for old libdw perf: build: Link lib 'lzma' for static build perf: build: Link lib 'zstd' for static build perf docs: Document cross compilation tools/build/feature/Makefile | 53 +++++++++++++++++++++++++++++++------- tools/perf/Documentation/Build.txt | 28 ++++++++++++++++++++ tools/perf/Makefile.config | 20 +++++++++++++- tools/perf/Makefile.perf | 27 ++++++++++++++++++- tools/perf/util/callchain.c | 2 +- 5 files changed, 117 insertions(+), 13 deletions(-) . Date: Thu, 1 Aug 2024 13:15:14 -0500 From: Bjorn Helgaas To: Linus Torvalds Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Blazej Kucman , Philipp Stanner , Damien Le Moal , Ilpo =?utf-8?B?SsOkcnZpbmVu?= Subject: [GIT PULL] PCI fixes for v6.11 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git tags/pci-v6.11-fixes-1 for you to fetch changes up to 5560a612c20d3daacbf5da7913deefa5c31742f4: PCI: pciehp: Retain Power Indicator bits for userspace indicators (2024-08-01 12:58:03 -0500) N.B. These have been in linux-next since July 26; I updated the commit logs today to add a Tested-by and an error message. ---------------------------------------------------------------- - Fix a pci_intx() regression that caused driver reload to fail with "Resources present before probing" (Philipp Stanner) - Fix a pciehp regression that clobbered the upper bits of RAID status LEDs on NVMe devices behind an Intel VMD (Blazej Kucman) ---------------------------------------------------------------- Blazej Kucman (1): PCI: pciehp: Retain Power Indicator bits for userspace indicators Philipp Stanner (1): PCI: Fix devres regression in pci_intx() drivers/pci/hotplug/pciehp_hpc.c | 4 +++- drivers/pci/pci.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) . Date: Fri, 2 Aug 2024 15:08:04 +1000 From: Dave Airlie To: Linus Torvalds , Daniel Vetter Cc: dri-devel , LKML Subject: [git pull] drm fixes for 6.11-rc2 Hi Linus, Regular weekly fixes. This is a bit larger than usual but doesn't seem too crazy. Most of it is vmwgfx changes that fix a bunch of issues with wayland userspaces with dma-buf/external buffers and modesetting fixes. Otherwise it's kinda spread out, v3d fixes some new ioctls, nouveau has regression revert and fixes, amdgpu, i915 and ast have some small fixes, and some core fixes spread about. Let me know if any problems, Thanks, Dave. drm-fixes-2024-08-02: drm fixes for 6.11-rc2 client: - fix error code atomic: - allow damage clips with async flips - allow explicit sync with async flips kselftests: - fix dmabuf-heaps test panic: - fix schedule_work in panic paths panel: - fix OrangePi Neo orientation gpuvm: - fix missing dependency amdgpu: - SMU 14.x update - Fix contiguous VRAM handling for IB parsing - GFX 12 fix - Regression fix for old APUs i915: - Static analysis fix for int overflow - Fix for HDCP2_STREAM_STATUS macro and removal of PWR_CLK_STATE for gen12 nouveau: - revert busy wait change that caused a resume regression - fix buffer placement fault on dynamic pm s/r - fix refcount underflow ast: - fix black screen on resume - wake during connector status detect v3d: - fix issues with perf/timestamp ioctls vmwgfx: - fix deadlock in dma-buf fence polling - fix screen surface refcounting - fix dumb buffer handling - fix support for external buffers - fix overlay with screen targets - trigger modeset on screen moves The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b= : Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://gitlab.freedesktop.org/drm/kernel.git tags/drm-fixes-2024-08-02 for you to fetch changes up to 27ce65f65258cf2f2855162cbeef59659a81fac4: Revert "nouveau: rip out busy fence waits" (2024-08-02 14:38:28 +1000) ---------------------------------------------------------------- drm fixes for 6.11-rc2 client: - fix error code atomic: - allow damage clips with async flips - allow explicit sync with async flips kselftests: - fix dmabuf-heaps test panic: - fix schedule_work in panic paths panel: - fix OrangePi Neo orientation gpuvm: - fix missing dependency amdgpu: - SMU 14.x update - Fix contiguous VRAM handling for IB parsing - GFX 12 fix - Regression fix for old APUs i915: - Static analysis fix for int overflow - Fix for HDCP2_STREAM_STATUS macro and removal of PWR_CLK_STATE for gen12 nouveau: - revert busy wait change that caused a resume regression - fix buffer placement fault on dynamic pm s/r - fix refcount underflow ast: - fix black screen on resume - wake during connector status detect v3d: - fix issues with perf/timestamp ioctls vmwgfx: - fix deadlock in dma-buf fence polling - fix screen surface refcounting - fix dumb buffer handling - fix support for external buffers - fix overlay with screen targets - trigger modeset on screen moves ---------------------------------------------------------------- Alex Deucher (1): drm/amdgpu: Fix APU handling in amdgpu_pm_load_smu_firmware() Andr=C3=A9 Almeida (2): drm/atomic: Allow userspace to use explicit sync with atomic async fl= ips drm/atomic: Allow userspace to use damage clips with async flips Christian K=C3=B6nig (1): drm/amdgpu: fix contiguous handling for IB parsing v2 Dan Carpenter (1): drm/client: Fix error code in drm_client_buffer_vmap_local() Danilo Krummrich (2): drm/gpuvm: fix missing dependency to DRM_EXEC drm/nouveau: prime: fix refcount underflow Dave Airlie (5): nouveau: set placement to original placement on uvmm validate. Merge tag 'amd-drm-fixes-6.11-2024-07-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes Merge tag 'drm-intel-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes Merge tag 'drm-misc-fixes-2024-08-01' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes Revert "nouveau: rip out busy fence waits" Dmitry Osipenko (1): drm/virtio: Fix type of dma-fence context variable Ian Forbes (2): drm/vmwgfx: Fix overlay when using Screen Targets drm/vmwgfx: Trigger a modeset when the screen moves Jammy Huang (1): drm/ast: Fix black screen after resume Kenneth Feng (1): drm/amdgpu/pm: support gpu_metrics sysfs interface for smu v14.0.2/3 Maxime Ripard (2): Merge drm/drm-fixes into drm-misc-fixes Merge drm-misc/drm-misc-next-fixes into drm-misc-fixes Michael Chen (1): drm/amdgpu: increase mes log buffer size for gfx12 Nikita Zhandarovich (1): drm/i915: Fix possible int overflow in skl_ddi_calculate_wrpll() Philip Mueller (1): drm: panel-orientation-quirks: Add quirk for OrangePi Neo Qiuxu Zhuo (1): drm/fb-helper: Don't schedule_work() to flush frame buffer during pan= ic() Suraj Kandpal (1): drm/i915/hdcp: Fix HDCP2_STREAM_STATUS macro Thomas Zimmermann (1): drm/ast: astdp: Wake up during connector status detection Tvrtko Ursulin (5): drm/v3d: Prevent out of bounds access in performance query extensions drm/v3d: Fix potential memory leak in the timestamp extension drm/v3d: Fix potential memory leak in the performance extension drm/v3d: Validate passed in drm syncobj handles in the timestamp exte= nsion drm/v3d: Validate passed in drm syncobj handles in the performance extension Umesh Nerlige Ramappa (1): i915/perf: Remove code to update PWR_CLK_STATE for gen12 Zack Rusin (4): drm/vmwgfx: Fix a deadlock in dma buf fence polling drm/vmwgfx: Make sure the screen surface is ref counted drm/vmwgfx: Fix handling of dumb buffers drm/vmwgfx: Add basic support for external buffers Zenghui Yu (1): kselftests: dmabuf-heaps: Ensure the driver name is null-terminated drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 16 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 6 +- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 + drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 8 +- drivers/gpu/drm/amd/include/mes_v11_api_def.h | 3 + drivers/gpu/drm/amd/include/mes_v12_api_def.h | 3 + drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +- .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 86 +++- drivers/gpu/drm/ast/ast_dp.c | 7 + drivers/gpu/drm/ast/ast_drv.c | 5 + drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_mode.c | 29 +- drivers/gpu/drm/drm_atomic_uapi.c | 5 +- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_fb_helper.c | 11 + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 + drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 6 +- drivers/gpu/drm/i915/display/intel_hdcp_regs.h | 2 +- drivers/gpu/drm/i915/i915_perf.c | 33 -- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +- drivers/gpu/drm/nouveau/nouveau_chan.c | 2 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_fence.c | 30 +- drivers/gpu/drm/nouveau/nouveau_fence.h | 2 +- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- drivers/gpu/drm/nouveau/nouveau_prime.c | 3 +- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 1 + drivers/gpu/drm/v3d/v3d_drv.h | 4 + drivers/gpu/drm/v3d/v3d_sched.c | 44 +- drivers/gpu/drm/v3d/v3d_submit.c | 121 +++-- drivers/gpu/drm/virtio/virtgpu_submit.c | 2 +- drivers/gpu/drm/vmwgfx/vmw_surface_cache.h | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 127 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 15 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 40 +- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 62 ++- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 502 +++++++++--------= ---- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 17 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 14 +- drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 32 +- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 27 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 33 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 174 ++++--- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 280 +++++++++++- drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 40 +- tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 4 +- 50 files changed, 1202 insertions(+), 650 deletions(-) . Date: Fri, 02 Aug 2024 10:15:45 +0200 From: Takashi Iwai To: Linus Torvalds Cc: Linux Sound Mailing List , Linux Kernel Mailing List Subject: [GIT PULL] sound fixes for 6.12-rc1 Linus, please pull sound fixes for v6.11-rc2 from: git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-6.11-rc2 The topmost commit is 478689b5990deb626a0b3f1ebf165979914d6be4 ---------------------------------------------------------------- sound fixes for 6.11-rc2 A small collection of fixes: - Revert of FireWire changes that caused a long-time regression - Another long-time regression fix for AMD HDMI - MIDI2 UMP fixes - HD-audio Conexant codec fixes and a qurik ---------------------------------------------------------------- Edmund Raile (2): Revert "ALSA: firewire-lib: obsolete workqueue for period update" Revert "ALSA: firewire-lib: operate for period elapse event in process context" Mavroudis Chatzilazaridis (1): ALSA: hda/realtek: Add quirk for Acer Aspire E5-574G Takashi Iwai (10): ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown ALSA: hda/conexant: Mute speakers at suspend / shutdown ALSA: seq: ump: Optimize conversions from SysEx to UMP ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception ALSA: ump: Explicitly reset RPN with Null RPN ALSA: seq: ump: Use the common RPN/bank conversion context ALSA: seq: ump: Transmit RPN/NRPN message at each MSB/LSB data reception ALSA: seq: ump: Explicitly reset RPN with Null RPN ALSA: usb-audio: Correct surround channels in UAC1 channel map ALSA: hda: Conditionally use snooping for AMD HDMI songxiebing (1): ALSA: hda: conexant: Fix headset auto detect fail in the polling mode --- include/sound/ump_convert.h | 1 + sound/core/seq/seq_ports.h | 14 +--- sound/core/seq/seq_ump_convert.c | 138 ++++++++++++++++++++++++--------------- sound/core/ump_convert.c | 60 ++++++++++++----- sound/firewire/amdtp-stream.c | 38 +++++++---- sound/firewire/amdtp-stream.h | 1 + sound/pci/hda/hda_controller.h | 2 +- sound/pci/hda/hda_generic.c | 63 ++++++++++++++++++ sound/pci/hda/hda_generic.h | 1 + sound/pci/hda/hda_intel.c | 10 ++- sound/pci/hda/patch_conexant.c | 56 ++++------------ sound/pci/hda/patch_realtek.c | 1 + sound/usb/stream.c | 4 +- 13 files changed, 244 insertions(+), 145 deletions(-) . Date: Fri, 02 Aug 2024 15:29:25 +0200 From: "Arnd Bergmann" To: "Linus Torvalds" Cc: linux-alpha@vger.kernel.org, "Jiri Olsa" , "Masami Hiramatsu (Google)" , "Florian Weimer" , "Andreas Schwab" , linux-kernel@vger.kernel.org, Linux-Arch , linux-api@vger.kernel.org Subject: [GIT PULL] asm-generic: fixes for 6.11 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git tags/asm-generic-fixes-6.11-1 for you to fetch changes up to 343416f0c11c42bed07f6db03ca599f4f1771b17: syscalls: fix syscall macros for newfstat/newfstatat (2024-08-02 15:20:47 +0200) ---------------------------------------------------------------- asm-generic: fixes for 6.11 These are three important bug fixes for the cross-architecture tree, fixing a regression with the new syscall.tbl file, the inconsistent numbering for the new uretprobe syscall and a bug with iowrite64be on alpha. ---------------------------------------------------------------- Arnd Bergmann (3): alpha: fix ioread64be()/iowrite64be() helpers uretprobe: change syscall number, again syscalls: fix syscall macros for newfstat/newfstatat arch/alpha/include/asm/io.h | 4 ++-- arch/arm64/kernel/Makefile.syscalls | 2 +- arch/loongarch/kernel/Makefile.syscalls | 3 ++- arch/riscv/kernel/Makefile.syscalls | 2 +- arch/x86/entry/syscalls/syscall_64.tbl | 2 +- include/uapi/asm-generic/unistd.h | 5 +---- scripts/syscall.tbl | 5 ++--- tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) ---------------------------------------------------------------- diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index 2bb8cbeedf91..b191d87f89c4 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -534,8 +534,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr) #define ioread16be(p) swab16(ioread16(p)) #define ioread32be(p) swab32(ioread32(p)) +#define ioread64be(p) swab64(ioread64(p)) #define iowrite16be(v,p) iowrite16(swab16(v), (p)) #define iowrite32be(v,p) iowrite32(swab32(v), (p)) +#define iowrite64be(v,p) iowrite64(swab64(v), (p)) #define inb_p inb #define inw_p inw @@ -634,8 +636,6 @@ extern void outsl (unsigned long port, const void *src, unsigned long count); */ #define ioread64 ioread64 #define iowrite64 iowrite64 -#define ioread64be ioread64be -#define iowrite64be iowrite64be #define ioread8_rep ioread8_rep #define ioread16_rep ioread16_rep #define ioread32_rep ioread32_rep diff --git a/arch/arm64/kernel/Makefile.syscalls b/arch/arm64/kernel/Makefile.syscalls index 3cfafd003b2d..0542a718871a 100644 --- a/arch/arm64/kernel/Makefile.syscalls +++ b/arch/arm64/kernel/Makefile.syscalls @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 syscall_abis_32 += -syscall_abis_64 += renameat newstat rlimit memfd_secret +syscall_abis_64 += renameat rlimit memfd_secret syscalltbl = arch/arm64/tools/syscall_%.tbl diff --git a/arch/loongarch/kernel/Makefile.syscalls b/arch/loongarch/kernel/Makefile.syscalls index 523bb411a3bc..ab7d9baa2915 100644 --- a/arch/loongarch/kernel/Makefile.syscalls +++ b/arch/loongarch/kernel/Makefile.syscalls @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -syscall_abis_64 += newstat +# No special ABIs on loongarch so far +syscall_abis_64 += diff --git a/arch/riscv/kernel/Makefile.syscalls b/arch/riscv/kernel/Makefile.syscalls index 52087a023b3d..9668fd1faf60 100644 --- a/arch/riscv/kernel/Makefile.syscalls +++ b/arch/riscv/kernel/Makefile.syscalls @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 syscall_abis_32 += riscv memfd_secret -syscall_abis_64 += riscv newstat rlimit memfd_secret +syscall_abis_64 += riscv rlimit memfd_secret diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 83073fa3c989..7093ee21c0d1 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -344,6 +344,7 @@ 332 common statx sys_statx 333 common io_pgetevents sys_io_pgetevents 334 common rseq sys_rseq +335 common uretprobe sys_uretprobe # don't use numbers 387 through 423, add new calls after the last # 'common' entry 424 common pidfd_send_signal sys_pidfd_send_signal @@ -385,7 +386,6 @@ 460 common lsm_set_self_attr sys_lsm_set_self_attr 461 common lsm_list_modules sys_lsm_list_modules 462 common mseal sys_mseal -467 common uretprobe sys_uretprobe # # Due to a historical design error, certain syscalls are numbered differently diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 985a262d0f9e..5bf6148cac2b 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -841,11 +841,8 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) #define __NR_mseal 462 __SYSCALL(__NR_mseal, sys_mseal) -#define __NR_uretprobe 463 -__SYSCALL(__NR_uretprobe, sys_uretprobe) - #undef __NR_syscalls -#define __NR_syscalls 464 +#define __NR_syscalls 463 /* * 32 bit systems traditionally used different diff --git a/scripts/syscall.tbl b/scripts/syscall.tbl index 591d85e8ca7e..4586a18dfe9b 100644 --- a/scripts/syscall.tbl +++ b/scripts/syscall.tbl @@ -98,9 +98,9 @@ 77 common tee sys_tee 78 common readlinkat sys_readlinkat 79 stat64 fstatat64 sys_fstatat64 -79 newstat fstatat sys_newfstatat +79 64 newfstatat sys_newfstatat 80 stat64 fstat64 sys_fstat64 -80 newstat fstat sys_newfstat +80 64 newfstat sys_newfstat 81 common sync sys_sync 82 common fsync sys_fsync 83 common fdatasync sys_fdatasync @@ -402,4 +402,3 @@ 460 common lsm_set_self_attr sys_lsm_set_self_attr 461 common lsm_list_modules sys_lsm_list_modules 462 common mseal sys_mseal -467 common uretprobe sys_uretprobe diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c index bd8c75b620c2..5f78edca6540 100644 --- a/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c +++ b/tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c @@ -216,7 +216,7 @@ static void test_uretprobe_regs_change(void) } #ifndef __NR_uretprobe -#define __NR_uretprobe 467 +#define __NR_uretprobe 335 #endif __naked unsigned long uretprobe_syscall_call_1(void) . Date: Fri, 2 Aug 2024 15:56:59 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] USB-serial fix for 6.11-rc2 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git tags/usb-serial-6.11-rc2 for you to fetch changes up to 00af4f3dda1461ec90d892edc10bec6d3c50c554: USB: serial: debug: do not echo input by default (2024-07-31 15:13:45 +0200) ---------------------------------------------------------------- USB-serial fix for 6.11-rc2 Here's a fix for an issue when using the usb_debug driver with Xen. This change has been in linux-next for a couple of days with no reported issues. ---------------------------------------------------------------- Marek Marczykowski-Górecki (1): USB: serial: debug: do not echo input by default drivers/usb/serial/usb_debug.c | 7 +++++++ 1 file changed, 7 insertions(+) . Date: Fri, 2 Aug 2024 16:01:05 +0200 From: Vasily Gorbik To: Linus Torvalds Cc: Heiko Carstens , Alexander Gordeev , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [GIT PULL] s390 updates for 6.11-rc2 Hello Linus, please pull s390 changes for 6.11-rc2. Thank you, Vasily The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git tags/s390-6.11-3 for you to fetch changes up to 33bd8d153c337ba9b30a2e5994437ca703ab4ed8: s390: Keep inittext section writable (2024-07-31 16:30:20 +0200) ---------------------------------------------------------------- s390 updates for 6.11-rc2 - Remove unused empty CPU alternatives header file - Fix recently and erroneously removed exception handling when loading an invalid floating point register - Couple of ptdump fixes to reflect the recent changes due to the uncoupling of physical vs virtual kernel address spaces - Couple of changes to avoid the unnecessary splitting of large pages in kernel mappings - Add the missing MODULE_DESCRIPTION for the CIO modules ---------------------------------------------------------------- Heiko Carstens (8): s390/fpu: Re-add exception handling in load_fpu_state() s390/alternatives: Remove unused empty header file s390/mm/ptdump: Fix handling of identity mapping area s390/mm/ptdump: Add support for relocated lowcore mapping s390/mm/ptdump: Improve sorting of markers s390/mm: Get rid of RELOC_HIDE() s390/vmlinux.lds.S: Move ro_after_init section behind rodata section s390: Keep inittext section writable Jeff Johnson (1): s390/cio: Add missing MODULE_DESCRIPTION() macros arch/s390/kernel/alternative.h | 0 arch/s390/kernel/fpu.c | 2 +- arch/s390/kernel/vmlinux.lds.S | 17 ++--- arch/s390/mm/dump_pagetables.c | 140 +++++++++++++++++++++++----------------- arch/s390/mm/init.c | 9 +-- arch/s390/mm/vmem.c | 13 +--- drivers/s390/cio/ccwgroup.c | 1 + drivers/s390/cio/vfio_ccw_drv.c | 1 + 8 files changed, 95 insertions(+), 88 deletions(-) delete mode 100644 arch/s390/kernel/alternative.h . Date: Fri, 02 Aug 2024 08:44:50 -0700 (PDT) From: Palmer Dabbelt To: Linus Torvalds Subject: [GIT PULL] RISC-V Fixes for 6.11-rc2 The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git tags/riscv-for-linus-6.11-rc2 for you to fetch changes up to 3b6564427aea83b7a35a15ca278291d50a1edcfc: riscv: Fix linear mapping checks for non-contiguous memory regions (2024-08-01 11:46:09 -0700) ---------------------------------------------------------------- RISC-V Fixes for 6.11-rc2 * A fix to avoid dropping some of the internal pseudo-extensions, which breaks *envcfg dependency parsing. * The kernel entry address is now aligned in purgatory, which avoids a misaligned load that can lead to crash on systems that don't support misaligned accesses early in boot. * The FW_SFENCE_VMA_RECEIVED perf event was duplicated in a handful of perf JSON configurations, one of them been updated to FW_SFENCE_VMA_ASID_SENT. * The starfive cache driver is now restricted to 64-bit systems, as it isn't 32-bit clean. * A fix for to avoid aliasing legacy-mode perf counters with software perf counters. * VM_FAULT_SIGSEGV is now handled in the page fault code. * A fix for stalls during CPU hotplug due to IPIs being disabled. * A fix for memblock bounds checking. This manifests as a crash on systems with discontinuous memory maps that have regions that don't fit in the linear map. ---------------------------------------------------------------- Daniel Maslowski (1): riscv/purgatory: align riscv_kernel_entry Eric Lin (1): perf arch events: Fix duplicate RISC-V SBI firmware event name Nick Hu (1): RISC-V: Enable the IPI before workqueue_online_cpu() Palmer Dabbelt (1): cache: StarFive: Require a 64-bit system Samuel Holland (1): riscv: cpufeature: Do not drop Linux-internal extensions Shifrin Dmitry (1): perf: riscv: Fix selecting counters in legacy mode Stuart Menefy (1): riscv: Fix linear mapping checks for non-contiguous memory regions Zhe Qiao (1): riscv/mm: Add handling for VM_FAULT_SIGSEGV in mm_fault_error() arch/riscv/kernel/cpufeature.c | 14 ++++++-------- arch/riscv/kernel/sbi-ipi.c | 2 +- arch/riscv/mm/fault.c | 17 +++++++++-------- arch/riscv/mm/init.c | 15 +++++++++++---- arch/riscv/purgatory/entry.S | 2 ++ drivers/cache/Kconfig | 1 + drivers/perf/riscv_pmu_sbi.c | 2 +- include/linux/cpuhotplug.h | 1 + .../perf/pmu-events/arch/riscv/andes/ax45/firmware.json | 2 +- .../perf/pmu-events/arch/riscv/riscv-sbi-firmware.json | 2 +- .../perf/pmu-events/arch/riscv/sifive/u74/firmware.json | 2 +- .../arch/riscv/starfive/dubhe-80/firmware.json | 2 +- .../arch/riscv/thead/c900-legacy/firmware.json | 2 +- 13 files changed, 37 insertions(+), 27 deletions(-) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . Date: Fri, 2 Aug 2024 12:51:16 -0400 From: Paolo Bonzini To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: [GIT PULL] KVM changes for Linux 6.11-rc2 Linus, The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus for you to fetch changes up to 1773014a975919195be71646fc2c2cad1570fce4: Merge branch 'kvm-fixes' into HEAD (2024-08-02 12:33:43 -0400) The bulk of the changes here is a largish change to guest_memfd, delaying the clearing and encryption of guest-private pages until they are actually added to guest page tables. This started as "let's make it impossible to misuse the API" for SEV-SNP; but then it ballooned a bit. The new logic is generally simpler and more ready for hugepage support in guest_memfd. Thanks, Paolo ---------------------------------------------------------------- * fix latent bug in how usage of large pages is determined for confidential VMs * fix "underline too short" in docs * eliminate log spam from limited APIC timer periods * disallow pre-faulting of memory before SEV-SNP VMs are initialized * delay clearing and encrypting private memory until it is added to guest page tables * this change also enables another small cleanup: the checks in SNP_LAUNCH_UPDATE that limit it to non-populated, private pages can now be moved in the common kvm_gmem_populate() function * fix compilation error that the RISC-V merge introduced in selftests ---------------------------------------------------------------- Ackerley Tng (1): KVM: x86/mmu: fix determination of max NPT mapping level for private pages Chang Yu (1): KVM: Documentation: Fix title underline too short warning Jim Mattson (1): KVM: x86: Eliminate log spam from limited APIC timer periods Paolo Bonzini (16): KVM: x86: disallow pre-fault for SNP VMs before initialization KVM: guest_memfd: return folio from __kvm_gmem_get_pfn() KVM: guest_memfd: delay folio_mark_uptodate() until after successful preparation KVM: guest_memfd: do not go through struct page KVM: rename CONFIG_HAVE_KVM_GMEM_* to CONFIG_HAVE_KVM_ARCH_GMEM_* KVM: guest_memfd: return locked folio from __kvm_gmem_get_pfn KVM: guest_memfd: delay kvm_gmem_prepare_folio() until the memory is passed to the guest KVM: guest_memfd: make kvm_gmem_prepare_folio() operate on a single struct kvm KVM: remove kvm_arch_gmem_prepare_needed() KVM: guest_memfd: move check for already-populated page to common code KVM: cleanup and add shortcuts to kvm_range_has_memory_attributes() KVM: extend kvm_range_has_memory_attributes() to check subset of attributes KVM: guest_memfd: let kvm_gmem_populate() operate only on private gfns KVM: guest_memfd: abstract how prepared folios are recorded Merge tag 'kvm-riscv-fixes-6.11-1' of https://github.com/kvm-riscv/linux into HEAD Merge branch 'kvm-fixes' into HEAD Yong-Xuan Wang (1): KVM: riscv: selftests: Fix compile error Documentation/virt/kvm/api.rst | 8 +- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/Kconfig | 4 +- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/mmu/mmu.c | 7 +- arch/x86/kvm/svm/sev.c | 17 +- arch/x86/kvm/svm/svm.c | 1 + arch/x86/kvm/x86.c | 12 +- include/linux/kvm_host.h | 9 +- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 +- virt/kvm/Kconfig | 4 +- virt/kvm/guest_memfd.c | 227 ++++++++++++++--------- virt/kvm/kvm_main.c | 73 ++++---- 13 files changed, 214 insertions(+), 159 deletions(-) . Date: Fri, 2 Aug 2024 18:46:36 +0200 From: Ilya Dryomov To: Linus Torvalds Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Ceph fix for 6.11-rc2 Hi Linus, The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: https://github.com/ceph/ceph-client.git tags/ceph-for-6.11-rc2 for you to fetch changes up to 31634d7597d8c57894b6c98eeefc9e58cf842993: ceph: force sending a cap update msg back to MDS for revoke op (2024-08-01 13:14:28 +0200) ---------------------------------------------------------------- A fix for a potential hang in the MDS when cap revocation races with the client releasing the caps in question, marked for stable. ---------------------------------------------------------------- Xiubo Li (1): ceph: force sending a cap update msg back to MDS for revoke op fs/ceph/caps.c | 35 ++++++++++++++++++++++++----------- fs/ceph/super.h | 7 ++++--- 2 files changed, 28 insertions(+), 14 deletions(-) . Date: Fri, 2 Aug 2024 18:45:58 +0100 From: Catalin Marinas To: Linus Torvalds Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] arm64 fixes for 6.11-rc2 Hi Linus, Please pull the arm64 fixes below. Thanks. The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux tags/arm64-fixes for you to fetch changes up to cfb00a35786414e7c0e6226b277d9f09657eae74: arm64: jump_label: Ensure patched jump_labels are visible to all CPUs (2024-08-02 15:07:01 +0100) ---------------------------------------------------------------- arm64 fixes: - Expand the speculative SSBS errata workaround to more CPUs - Ensure jump label changes are visible to all CPUs with a kick_all_cpus_sync() (and also enable jump label batching as part of the fix) - The shadow call stack sanitiser is currently incompatible with Rust, make CONFIG_RUST conditional on !CONFIG_SHADOW_CALL_STACK ---------------------------------------------------------------- Alice Ryhl (1): rust: SHADOW_CALL_STACK is incompatible with Rust Mark Rutland (3): arm64: cputype: Add Cortex-X1C definitions arm64: cputype: Add Cortex-A725 definitions arm64: errata: Expand speculative SSBS workaround (again) Will Deacon (1): arm64: jump_label: Ensure patched jump_labels are visible to all CPUs Documentation/arch/arm64/silicon-errata.rst | 18 ++++++++++++++++++ arch/arm64/Kconfig | 22 ++++++++++++++++------ arch/arm64/include/asm/cputype.h | 4 ++++ arch/arm64/include/asm/jump_label.h | 1 + arch/arm64/kernel/cpu_errata.c | 11 ++++++++++- arch/arm64/kernel/jump_label.c | 11 +++++++++-- init/Kconfig | 1 + 7 files changed, 59 insertions(+), 9 deletions(-) -- Catalin . Date: Fri, 2 Aug 2024 19:50:32 +0200 From: "Rafael J. Wysocki" To: Linus Torvalds Cc: Linux PM , Linux Kernel Mailing List , Daniel Lezcano Subject: [GIT PULL] Thermal control fixes for v6.11-rc2 Hi Linus, Please pull from the tag git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ thermal-6.11-rc2 with top-most commit a09074228977c24c677c10282f506fa11f88eb93 thermal: core: Update thermal zone registration documentation on top of commit 8400291e289ee6b2bf9779ff1c83a291501f017b Linux 6.11-rc1 to receive thermal control fixes for 6.11-rc2. These fix a few issues related to the MSI IRQs management in the int340x thermal driver, fix a thermal core issue that may lead to missing trip point crossing events and update the thermal core documentation. Specifics: - Fix MSI error path cleanup in int340x, allow it to work with a subset of thermal MSI IRQs if some of them are not working and make it free all MSI IRQs on module exit (Srinivas Pandruvada). - Fix a thermal core issue that may lead to missing trip point crossing events in some cases when thermal_zone_set_trips() is used and update the thermal core documentation (Rafael Wysocki). Thanks! --------------- Rafael J. Wysocki (2): thermal: trip: Avoid skipping trips in thermal_zone_set_trips() thermal: core: Update thermal zone registration documentation Srinivas Pandruvada (3): thermal: intel: int340x: Fix kernel warning during MSI cleanup thermal: intel: int340x: Allow limited thermal MSI support thermal: intel: int340x: Free MSI IRQ vectors on module exit --------------- Documentation/driver-api/thermal/sysfs-api.rst | 65 ++++++++++------------ .../int340x_thermal/processor_thermal_device_pci.c | 29 +++++++--- drivers/thermal/thermal_trip.c | 4 +- 3 files changed, 54 insertions(+), 44 deletions(-) . Date: Sat, 03 Aug 2024 17:46:50 -0400 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Subject: [GIT PULL] SCSI fixes for 6.11-rc1 One core change that reverts the double message print patch in sd.c (it was causing regressions on embedded systems). The rest are driver fixes in ufs, mpt3sas and mpi3mr. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Damien Le Moal (2): scsi: mpt3sas: Avoid IOMMU page faults on REPORT ZONES scsi: mpi3mr: Avoid IOMMU page faults on REPORT ZONES Eric Biggers (1): scsi: ufs: exynos: Don't resume FMP when crypto support is disabled Johan Hovold (1): scsi: Revert "scsi: sd: Do not repeat the starting disk message" Kyoungrul Kim (1): scsi: ufs: core: Check LSDBS cap when !mcq Manivannan Sadhasivam (1): scsi: ufs: core: Do not set link to OFF state while waking up from hibernation Peter Wang (2): scsi: ufs: core: Fix deadlock during RTC update scsi: ufs: core: Bypass quick recovery if force reset is needed With the diffstat: drivers/scsi/mpi3mr/mpi3mr_os.c | 11 +++++++++++ drivers/scsi/mpt3sas/mpt3sas_base.c | 20 ++++++++++++++++++-- drivers/scsi/sd.c | 5 +++-- drivers/ufs/core/ufshcd-priv.h | 5 +++++ drivers/ufs/core/ufshcd.c | 27 ++++++++++++++++++++++----- drivers/ufs/host/ufs-exynos.c | 3 +++ include/ufs/ufshcd.h | 1 + include/ufs/ufshci.h | 1 + 8 files changed, 64 insertions(+), 9 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 69b14918de59..ca8f132e03ae 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -3575,6 +3575,17 @@ static int mpi3mr_prepare_sg_scmd(struct mpi3mr_ioc *mrioc, scmd->sc_data_direction); priv->meta_sg_valid = 1; /* To unmap meta sg DMA */ } else { + /* + * Some firmware versions byte-swap the REPORT ZONES command + * reply from ATA-ZAC devices by directly accessing in the host + * buffer. This does not respect the default command DMA + * direction and causes IOMMU page faults on some architectures + * with an IOMMU enforcing write mappings (e.g. AMD hosts). + * Avoid such issue by making the REPORT ZONES buffer mapping + * bi-directional. + */ + if (scmd->cmnd[0] == ZBC_IN && scmd->cmnd[1] == ZI_REPORT_ZONES) + scmd->sc_data_direction = DMA_BIDIRECTIONAL; sg_scmd = scsi_sglist(scmd); sges_left = scsi_dma_map(scmd); } diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index b2bcf4a27ddc..b785a7e88b49 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -2671,6 +2671,22 @@ _base_build_zero_len_sge_ieee(struct MPT3SAS_ADAPTER *ioc, void *paddr) _base_add_sg_single_ieee(paddr, sgl_flags, 0, 0, -1); } +static inline int _base_scsi_dma_map(struct scsi_cmnd *cmd) +{ + /* + * Some firmware versions byte-swap the REPORT ZONES command reply from + * ATA-ZAC devices by directly accessing in the host buffer. This does + * not respect the default command DMA direction and causes IOMMU page + * faults on some architectures with an IOMMU enforcing write mappings + * (e.g. AMD hosts). Avoid such issue by making the report zones buffer + * mapping bi-directional. + */ + if (cmd->cmnd[0] == ZBC_IN && cmd->cmnd[1] == ZI_REPORT_ZONES) + cmd->sc_data_direction = DMA_BIDIRECTIONAL; + + return scsi_dma_map(cmd); +} + /** * _base_build_sg_scmd - main sg creation routine * pcie_device is unused here! @@ -2717,7 +2733,7 @@ _base_build_sg_scmd(struct MPT3SAS_ADAPTER *ioc, sgl_flags = sgl_flags << MPI2_SGE_FLAGS_SHIFT; sg_scmd = scsi_sglist(scmd); - sges_left = scsi_dma_map(scmd); + sges_left = _base_scsi_dma_map(scmd); if (sges_left < 0) return -ENOMEM; @@ -2861,7 +2877,7 @@ _base_build_sg_scmd_ieee(struct MPT3SAS_ADAPTER *ioc, } sg_scmd = scsi_sglist(scmd); - sges_left = scsi_dma_map(scmd); + sges_left = _base_scsi_dma_map(scmd); if (sges_left < 0) return -ENOMEM; diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index adeaa8ab9951..8bb3a3611851 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -4205,6 +4205,8 @@ static int sd_resume(struct device *dev) { struct scsi_disk *sdkp = dev_get_drvdata(dev); + sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); + if (opal_unlock_from_suspend(sdkp->opal_dev)) { sd_printk(KERN_NOTICE, sdkp, "OPAL unlock failed\n"); return -EIO; @@ -4221,13 +4223,12 @@ static int sd_resume_common(struct device *dev, bool runtime) if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */ return 0; - sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); - if (!sd_do_start_stop(sdkp->device, runtime)) { sdkp->suspended = false; return 0; } + sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); ret = sd_start_stop_device(sdkp, 1); if (!ret) { sd_resume(dev); diff --git a/drivers/ufs/core/ufshcd-priv.h b/drivers/ufs/core/ufshcd-priv.h index ce36154ce963..7aea8fbaeee8 100644 --- a/drivers/ufs/core/ufshcd-priv.h +++ b/drivers/ufs/core/ufshcd-priv.h @@ -316,6 +316,11 @@ static inline int ufshcd_rpm_get_sync(struct ufs_hba *hba) return pm_runtime_get_sync(&hba->ufs_device_wlun->sdev_gendev); } +static inline int ufshcd_rpm_get_if_active(struct ufs_hba *hba) +{ + return pm_runtime_get_if_active(&hba->ufs_device_wlun->sdev_gendev); +} + static inline int ufshcd_rpm_put_sync(struct ufs_hba *hba) { return pm_runtime_put_sync(&hba->ufs_device_wlun->sdev_gendev); diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index dc757ba47522..5e3c67e96956 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2416,7 +2416,17 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba) return err; } + /* + * The UFSHCI 3.0 specification does not define MCQ_SUPPORT and + * LSDB_SUPPORT, but [31:29] as reserved bits with reset value 0s, which + * means we can simply read values regardless of version. + */ hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities); + /* + * 0h: legacy single doorbell support is available + * 1h: indicate that legacy single doorbell support has been removed + */ + hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities); if (!hba->mcq_sup) return 0; @@ -6553,7 +6563,8 @@ static void ufshcd_err_handler(struct work_struct *work) if (ufshcd_err_handling_should_stop(hba)) goto skip_err_handling; - if (hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) { + if ((hba->dev_quirks & UFS_DEVICE_QUIRK_RECOVERY_FROM_DL_NAC_ERRORS) && + !hba->force_reset) { bool ret; spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -8211,7 +8222,10 @@ static void ufshcd_update_rtc(struct ufs_hba *hba) */ val = ts64.tv_sec - hba->dev_info.rtc_time_baseline; - ufshcd_rpm_get_sync(hba); + /* Skip update RTC if RPM state is not RPM_ACTIVE */ + if (ufshcd_rpm_get_if_active(hba) <= 0) + return; + err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, QUERY_ATTR_IDN_SECONDS_PASSED, 0, 0, &val); ufshcd_rpm_put_sync(hba); @@ -10265,9 +10279,6 @@ int ufshcd_system_restore(struct device *dev) */ ufshcd_readl(hba, REG_UTP_TASK_REQ_LIST_BASE_H); - /* Resuming from hibernate, assume that link was OFF */ - ufshcd_set_link_off(hba); - return 0; } @@ -10496,6 +10507,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) } if (!is_mcq_supported(hba)) { + if (!hba->lsdb_sup) { + dev_err(hba->dev, "%s: failed to initialize (legacy doorbell mode not supported)\n", + __func__); + err = -EINVAL; + goto out_disable; + } err = scsi_add_host(host, hba->dev); if (err) { dev_err(hba->dev, "scsi_add_host failed\n"); diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 16ad3528d80b..9ec318ef52bf 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1293,6 +1293,9 @@ static void exynos_ufs_fmp_resume(struct ufs_hba *hba) { struct arm_smccc_res res; + if (!(hba->caps & UFSHCD_CAP_CRYPTO)) + return; + arm_smccc_smc(SMC_CMD_FMP_SECURITY, 0, SMU_EMBEDDED, CFG_DESCTYPE_3, 0, 0, 0, 0, &res); if (res.a0) diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index a43b14276bc3..cac0cdb9a916 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1109,6 +1109,7 @@ struct ufs_hba { bool ext_iid_sup; bool scsi_host_added; bool mcq_sup; + bool lsdb_sup; bool mcq_enabled; struct ufshcd_res_info res[RES_MAX]; void __iomem *mcq_base; diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h index 38fe97971a65..9917c7743d80 100644 --- a/include/ufs/ufshci.h +++ b/include/ufs/ufshci.h @@ -77,6 +77,7 @@ enum { MASK_OUT_OF_ORDER_DATA_DELIVERY_SUPPORT = 0x02000000, MASK_UIC_DME_TEST_MODE_SUPPORT = 0x04000000, MASK_CRYPTO_SUPPORT = 0x10000000, + MASK_LSDB_SUPPORT = 0x20000000, MASK_MCQ_SUPPORT = 0x40000000, }; . Date: Sat, 3 Aug 2024 18:14:19 -0500 From: Steve French To: Linus Torvalds Cc: LKML , CIFS Subject: [GIT PULL] smb3 client fixes Please pull the following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.samba.org/sfrench/cifs-2.6.git tags/6.11-rc1-smb-client-fixes for you to fetch changes up to a91bfa67601c07ff9d31731fd2d624b47b0039f2: cifs: update internal version number (2024-08-02 10:56:14 -0500) ---------------------------------------------------------------- smb3 client fixes - two reparse point fixes - minor cleanup - additional trace point (to help debug a recent problem) ---------------------------------------------------------------- David Howells (1): cifs: Remove cifs_aio_ctx Paulo Alcantara (2): smb: client: handle lack of FSCTL_GET_REPARSE_POINT support smb: client: fix FSCTL_GET_REPARSE_POINT against NetApp Steve French (2): smb3: add dynamic tracepoints for shutdown ioctl cifs: update internal version number fs/smb/client/cifsfs.h | 4 ++-- fs/smb/client/cifsglob.h | 24 ----------------------- fs/smb/client/cifsproto.h | 2 -- fs/smb/client/inode.c | 17 ++++++++++++++-- fs/smb/client/ioctl.c | 32 +++++++++++++++++++++++------- fs/smb/client/misc.c | 54 --------------------------------------------------- fs/smb/client/reparse.c | 4 ++++ fs/smb/client/reparse.h | 19 ++++++++++++++++-- fs/smb/client/smb2inode.c | 8 ++++++-- fs/smb/client/trace.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 10 files changed, 119 insertions(+), 96 deletions(-) -- Thanks, Steve . Date: Sun, 4 Aug 2024 10:07:36 +0200 From: Mauro Carvalho Chehab To: Linus Torvalds Cc: Greg Kroah-Hartman , Andrew Morton , Linux Media Mailing List , Linux Kernel Mailing List Subject: [GIT PULL for v6.11-rc2] media fixes Hi Linus, Please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media tags/media/v6.11-2 For: - two Kconfig fixes; - one fix at UVC driver addressing probing time detection of a UVC custom controls; - one fix related to PDF generation. The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media tags/media/v6.11-2 for you to fetch changes up to e2ed53694e5356a55fd539a4d8dc56c2fa42b2ff: Merge tag 'tags/fixes-media-uvc-20230722' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git (2024-08-03 11:01:04 +0200) ---------------------------------------------------------------- media fixes for v6.11-rc2 ---------------------------------------------------------------- Arnd Bergmann (1): media: ipu-bridge: fix ipu6 Kconfig dependencies Bingbu Cao (1): media: intel/ipu6: select AUXILIARY_BUS in Kconfig Hans Verkuil (1): Merge tag 'tags/fixes-media-uvc-20230722' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git Jean-Michel Hautbois (1): media: v4l: Fix missing tabular column hint for Y14P format Ricardo Ribalda (1): media: uvcvideo: Fix custom control mapping probing Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++-- drivers/media/pci/intel/ipu6/Kconfig | 3 ++- drivers/media/usb/uvc/uvc_ctrl.c | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) . Date: Sun, 4 Aug 2024 15:02:53 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] locking/urgent for v6.11-rc2 Linus, please pull the latest locking/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2= 024-08-04 up to: 224fa3552029: jump_label: Fix the fix, brown paper bags galore Two fixes for locking and jump labels: - Ensure that the atomic_cmpxchg() conditions are correct and evaluating to true on any non-zero value except 1. The missing check of the return value leads to inconsisted state of the jump label counter. - Add a missing type conversion in the paravirt spinlock code which makes loongson build again. Thanks, tglx ------------------> Peter Zijlstra (1): jump_label: Fix the fix, brown paper bags galore Uros Bizjak (1): locking/pvqspinlock: Correct the type of "old" variable in pv_kick_node= () kernel/jump_label.c | 4 ++-- kernel/locking/qspinlock_paravirt.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 4ad5ed8adf96..6dc76b590703 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -236,7 +236,7 @@ void static_key_disable_cpuslocked(struct static_key *key) } =20 jump_label_lock(); - if (atomic_cmpxchg(&key->enabled, 1, 0)) + if (atomic_cmpxchg(&key->enabled, 1, 0) =3D=3D 1) jump_label_update(key); jump_label_unlock(); } @@ -289,7 +289,7 @@ static void __static_key_slow_dec_cpuslocked(struct stati= c_key *key) return; =20 guard(mutex)(&jump_label_mutex); - if (atomic_cmpxchg(&key->enabled, 1, 0)) + if (atomic_cmpxchg(&key->enabled, 1, 0) =3D=3D 1) jump_label_update(key); else WARN_ON_ONCE(!static_key_slow_try_dec(key)); diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_p= aravirt.h index f5a36e67b593..ac2e22502741 100644 --- a/kernel/locking/qspinlock_paravirt.h +++ b/kernel/locking/qspinlock_paravirt.h @@ -357,7 +357,7 @@ static void pv_wait_node(struct mcs_spinlock *node, struc= t mcs_spinlock *prev) static void pv_kick_node(struct qspinlock *lock, struct mcs_spinlock *node) { struct pv_node *pn =3D (struct pv_node *)node; - enum vcpu_state old =3D vcpu_halted; + u8 old =3D vcpu_halted; /* * If the vCPU is indeed halted, advance its state to match that of * pv_wait_node(). If OTOH this fails, the vCPU was running and will . Date: Sun, 4 Aug 2024 15:02:51 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] irq/urgent for v6.11-rc2 Linus, please pull the latest irq/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-2024-= 08-04 up to: 6be6cba9c437: irqchip/mbigen: Fix mbigen node address layout A couple of fixes for interrupt chip drivers: - Ensure to skip the clear register space in the MBIGEN driver when calculating the node register index. Otherwise the clear register is clobbered and the wrong node registers are accessed. - Fix a signed/unsigned confusion in the loongarch CPU driver which converts an error code to a huge "valid" interrupt number. - Convert the mesion GPIO interrupt controller lock to a raw spinlock so it works on RT. - Add a missing static to a internal function in the pic32 EVIC driver. Thanks, tglx ------------------> Arseniy Krasnov (1): irqchip/meson-gpio: Convert meson_gpio_irq_controller::lock to 'raw_spi= nlock_t' Huacai Chen (1): irqchip/loongarch-cpu: Fix return value of lpic_gsi_to_irq() Luca Ceresoli (1): irqchip/irq-pic32-evic: Add missing 'static' to internal function Yipeng Zou (1): irqchip/mbigen: Fix mbigen node address layout drivers/irqchip/irq-loongarch-cpu.c | 6 ++++-- drivers/irqchip/irq-mbigen.c | 20 ++++++++++++++++---- drivers/irqchip/irq-meson-gpio.c | 14 +++++++------- drivers/irqchip/irq-pic32-evic.c | 6 +++--- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loonga= rch-cpu.c index 9d8f2c406043..b35903a06902 100644 --- a/drivers/irqchip/irq-loongarch-cpu.c +++ b/drivers/irqchip/irq-loongarch-cpu.c @@ -18,11 +18,13 @@ struct fwnode_handle *cpuintc_handle; =20 static u32 lpic_gsi_to_irq(u32 gsi) { + int irq =3D 0; + /* Only pch irqdomain transferring is required for LoongArch. */ if (gsi >=3D GSI_MIN_PCH_IRQ && gsi <=3D GSI_MAX_PCH_IRQ) - return acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH= ); + irq =3D acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIG= H); =20 - return 0; + return (irq > 0) ? irq : 0; } =20 static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi) diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 093fd42893a7..53cc08387588 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -64,6 +64,20 @@ struct mbigen_device { void __iomem *base; }; =20 +static inline unsigned int get_mbigen_node_offset(unsigned int nid) +{ + unsigned int offset =3D nid * MBIGEN_NODE_OFFSET; + + /* + * To avoid touched clear register in unexpected way, we need to directly + * skip clear register when access to more than 10 mbigen nodes. + */ + if (nid >=3D (REG_MBIGEN_CLEAR_OFFSET / MBIGEN_NODE_OFFSET)) + offset +=3D MBIGEN_NODE_OFFSET; + + return offset; +} + static inline unsigned int get_mbigen_vec_reg(irq_hw_number_t hwirq) { unsigned int nid, pin; @@ -72,8 +86,7 @@ static inline unsigned int get_mbigen_vec_reg(irq_hw_number= _t hwirq) nid =3D hwirq / IRQS_PER_MBIGEN_NODE + 1; pin =3D hwirq % IRQS_PER_MBIGEN_NODE; =20 - return pin * 4 + nid * MBIGEN_NODE_OFFSET - + REG_MBIGEN_VEC_OFFSET; + return pin * 4 + get_mbigen_node_offset(nid) + REG_MBIGEN_VEC_OFFSET; } =20 static inline void get_mbigen_type_reg(irq_hw_number_t hwirq, @@ -88,8 +101,7 @@ static inline void get_mbigen_type_reg(irq_hw_number_t hwi= rq, *mask =3D 1 << (irq_ofst % 32); ofst =3D irq_ofst / 32 * 4; =20 - *addr =3D ofst + nid * MBIGEN_NODE_OFFSET - + REG_MBIGEN_TYPE_OFFSET; + *addr =3D ofst + get_mbigen_node_offset(nid) + REG_MBIGEN_TYPE_OFFSET; } =20 static inline void get_mbigen_clear_reg(irq_hw_number_t hwirq, diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpi= o.c index 27e30ce41db3..cd789fa51519 100644 --- a/drivers/irqchip/irq-meson-gpio.c +++ b/drivers/irqchip/irq-meson-gpio.c @@ -178,7 +178,7 @@ struct meson_gpio_irq_controller { void __iomem *base; u32 channel_irqs[MAX_NUM_CHANNEL]; DECLARE_BITMAP(channel_map, MAX_NUM_CHANNEL); - spinlock_t lock; + raw_spinlock_t lock; }; =20 static void meson_gpio_irq_update_bits(struct meson_gpio_irq_controller *ctl, @@ -187,14 +187,14 @@ static void meson_gpio_irq_update_bits(struct meson_gpi= o_irq_controller *ctl, unsigned long flags; u32 tmp; =20 - spin_lock_irqsave(&ctl->lock, flags); + raw_spin_lock_irqsave(&ctl->lock, flags); =20 tmp =3D readl_relaxed(ctl->base + reg); tmp &=3D ~mask; tmp |=3D val; writel_relaxed(tmp, ctl->base + reg); =20 - spin_unlock_irqrestore(&ctl->lock, flags); + raw_spin_unlock_irqrestore(&ctl->lock, flags); } =20 static void meson_gpio_irq_init_dummy(struct meson_gpio_irq_controller *ctl) @@ -244,12 +244,12 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_co= ntroller *ctl, unsigned long flags; unsigned int idx; =20 - spin_lock_irqsave(&ctl->lock, flags); + raw_spin_lock_irqsave(&ctl->lock, flags); =20 /* Find a free channel */ idx =3D find_first_zero_bit(ctl->channel_map, ctl->params->nr_channels); if (idx >=3D ctl->params->nr_channels) { - spin_unlock_irqrestore(&ctl->lock, flags); + raw_spin_unlock_irqrestore(&ctl->lock, flags); pr_err("No channel available\n"); return -ENOSPC; } @@ -257,7 +257,7 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_cont= roller *ctl, /* Mark the channel as used */ set_bit(idx, ctl->channel_map); =20 - spin_unlock_irqrestore(&ctl->lock, flags); + raw_spin_unlock_irqrestore(&ctl->lock, flags); =20 /* * Setup the mux of the channel to route the signal of the pad @@ -567,7 +567,7 @@ static int meson_gpio_irq_of_init(struct device_node *nod= e, struct device_node * if (!ctl) return -ENOMEM; =20 - spin_lock_init(&ctl->lock); + raw_spin_lock_init(&ctl->lock); =20 ctl->base =3D of_iomap(node, 0); if (!ctl->base) { diff --git a/drivers/irqchip/irq-pic32-evic.c b/drivers/irqchip/irq-pic32-evi= c.c index 1d9bb28d13e5..277240325cbc 100644 --- a/drivers/irqchip/irq-pic32-evic.c +++ b/drivers/irqchip/irq-pic32-evic.c @@ -161,9 +161,9 @@ static int pic32_irq_domain_map(struct irq_domain *d, uns= igned int virq, return ret; } =20 -int pic32_irq_domain_xlate(struct irq_domain *d, struct device_node *ctrlr, - const u32 *intspec, unsigned int intsize, - irq_hw_number_t *out_hwirq, unsigned int *out_type) +static int pic32_irq_domain_xlate(struct irq_domain *d, struct device_node *= ctrlr, + const u32 *intspec, unsigned int intsize, + irq_hw_number_t *out_hwirq, unsigned int *out_type) { struct evic_chip_data *priv =3D d->host_data; =20 . Date: Sun, 4 Aug 2024 15:02:55 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] perf/urgent for v6.11-rc2 Linus, please pull the latest perf/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2024= -08-04 up to: f73cefa3b72e: perf/x86: Fix smp_processor_id()-in-preemptible warnings perf/x86 subsystem fixes: - Move the smp_processor_id() invocation back into the non-preemtible region, so that the result is valid to use. - Add the missing package C2 residency counters for Sierra Forest CPUs to make the newly added support actually useful Thanks, tglx ------------------> Li Huafei (1): perf/x86: Fix smp_processor_id()-in-preemptible warnings Zhenyu Wang (1): perf/x86/intel/cstate: Add pkg C2 residency counter for Sierra Forest arch/x86/events/core.c | 22 ++++++++++++---------- arch/x86/events/intel/cstate.c | 5 +++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 12f2a0c14d33..be01823b1bb4 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1520,20 +1520,23 @@ static void x86_pmu_start(struct perf_event *event, i= nt flags) void perf_event_print_debug(void) { u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left, fixed; + unsigned long *cntr_mask, *fixed_cntr_mask; + struct event_constraint *pebs_constraints; + struct cpu_hw_events *cpuc; u64 pebs, debugctl; - int cpu =3D smp_processor_id(); - struct cpu_hw_events *cpuc =3D &per_cpu(cpu_hw_events, cpu); - unsigned long *cntr_mask =3D hybrid(cpuc->pmu, cntr_mask); - unsigned long *fixed_cntr_mask =3D hybrid(cpuc->pmu, fixed_cntr_mask); - struct event_constraint *pebs_constraints =3D hybrid(cpuc->pmu, pebs_constr= aints); - unsigned long flags; - int idx; + int cpu, idx; + + guard(irqsave)(); + + cpu =3D smp_processor_id(); + cpuc =3D &per_cpu(cpu_hw_events, cpu); + cntr_mask =3D hybrid(cpuc->pmu, cntr_mask); + fixed_cntr_mask =3D hybrid(cpuc->pmu, fixed_cntr_mask); + pebs_constraints =3D hybrid(cpuc->pmu, pebs_constraints); =20 if (!*(u64 *)cntr_mask) return; =20 - local_irq_save(flags); - if (x86_pmu.version >=3D 2) { rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl); rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status); @@ -1577,7 +1580,6 @@ void perf_event_print_debug(void) pr_info("CPU#%d: fixed-PMC%d count: %016llx\n", cpu, idx, pmc_count); } - local_irq_restore(flags); } =20 void x86_pmu_stop(struct perf_event *event, int flags) diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index be58cfb012dd..9f116dfc4728 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c @@ -64,7 +64,7 @@ * perf code: 0x00 * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, * KBL,CML,ICL,ICX,TGL,TNT,RKL,ADL, - * RPL,SPR,MTL,ARL,LNL + * RPL,SPR,MTL,ARL,LNL,SRF * Scope: Package (physical package) * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter. * perf code: 0x01 @@ -693,7 +693,8 @@ static const struct cstate_model srf_cstates __initconst = =3D { .core_events =3D BIT(PERF_CSTATE_CORE_C1_RES) | BIT(PERF_CSTATE_CORE_C6_RES), =20 - .pkg_events =3D BIT(PERF_CSTATE_PKG_C6_RES), + .pkg_events =3D BIT(PERF_CSTATE_PKG_C2_RES) | + BIT(PERF_CSTATE_PKG_C6_RES), =20 .module_events =3D BIT(PERF_CSTATE_MODULE_C6_RES), }; . Date: Sun, 4 Aug 2024 15:02:57 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] sched/urgent for v6.11-rc2 Linus, please pull the latest sched/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-202= 4-08-04 up to: fe7a11c78d2a: sched/core: Fix unbalance set_rq_online/offline() in sc= hed_cpu_deactivate() Scheduler fixes: - When stime is larger than rtime due to accounting imprecision, then utime =3D rtime - stime becomes negative. As this is unsigned math, the result becomes a huge positive number. Cure it by resetting stime to rtime in that case, so utime becomes 0. - Restore consistent state when sched_cpu_deactivate() fails. When offlining a CPU fails in sched_cpu_deactivate() after the SMT present counter has been decremented, then the function aborts but fails to increment the SMT present counter and leaves it imbalanced. Consecutive operations cause it to underflow. Add the missing fixup for the error path. As SMT accounting the runqueue needs to marked online again in the error exit path to restore consistent state. Thanks, tglx ------------------> Yang Yingliang (4): sched/smt: Introduce sched_smt_present_inc/dec() helper sched/smt: Fix unbalance sched_smt_present dec/inc sched/core: Introduce sched_set_rq_on/offline() helper sched/core: Fix unbalance set_rq_online/offline() in sched_cpu_deactiva= te() Zheng Zucheng (1): sched/cputime: Fix mul_u64_u64_div_u64() precision for cputime kernel/sched/core.c | 68 ++++++++++++++++++++++++++++++++++--------------= -- kernel/sched/cputime.c | 6 +++++ 2 files changed, 53 insertions(+), 21 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a9f655025607..f3951e4a55e5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7845,6 +7845,30 @@ void set_rq_offline(struct rq *rq) } } =20 +static inline void sched_set_rq_online(struct rq *rq, int cpu) +{ + struct rq_flags rf; + + rq_lock_irqsave(rq, &rf); + if (rq->rd) { + BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); + set_rq_online(rq); + } + rq_unlock_irqrestore(rq, &rf); +} + +static inline void sched_set_rq_offline(struct rq *rq, int cpu) +{ + struct rq_flags rf; + + rq_lock_irqsave(rq, &rf); + if (rq->rd) { + BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); + set_rq_offline(rq); + } + rq_unlock_irqrestore(rq, &rf); +} + /* * used to mark begin/end of suspend/resume: */ @@ -7895,10 +7919,25 @@ static int cpuset_cpu_inactive(unsigned int cpu) return 0; } =20 +static inline void sched_smt_present_inc(int cpu) +{ +#ifdef CONFIG_SCHED_SMT + if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) + static_branch_inc_cpuslocked(&sched_smt_present); +#endif +} + +static inline void sched_smt_present_dec(int cpu) +{ +#ifdef CONFIG_SCHED_SMT + if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) + static_branch_dec_cpuslocked(&sched_smt_present); +#endif +} + int sched_cpu_activate(unsigned int cpu) { struct rq *rq =3D cpu_rq(cpu); - struct rq_flags rf; =20 /* * Clear the balance_push callback and prepare to schedule @@ -7906,13 +7945,10 @@ int sched_cpu_activate(unsigned int cpu) */ balance_push_set(cpu, false); =20 -#ifdef CONFIG_SCHED_SMT /* * When going up, increment the number of cores with SMT present. */ - if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) - static_branch_inc_cpuslocked(&sched_smt_present); -#endif + sched_smt_present_inc(cpu); set_cpu_active(cpu, true); =20 if (sched_smp_initialized) { @@ -7930,12 +7966,7 @@ int sched_cpu_activate(unsigned int cpu) * 2) At runtime, if cpuset_cpu_active() fails to rebuild the * domains. */ - rq_lock_irqsave(rq, &rf); - if (rq->rd) { - BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); - set_rq_online(rq); - } - rq_unlock_irqrestore(rq, &rf); + sched_set_rq_online(rq, cpu); =20 return 0; } @@ -7943,7 +7974,6 @@ int sched_cpu_activate(unsigned int cpu) int sched_cpu_deactivate(unsigned int cpu) { struct rq *rq =3D cpu_rq(cpu); - struct rq_flags rf; int ret; =20 /* @@ -7974,20 +8004,14 @@ int sched_cpu_deactivate(unsigned int cpu) */ synchronize_rcu(); =20 - rq_lock_irqsave(rq, &rf); - if (rq->rd) { - BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span)); - set_rq_offline(rq); - } - rq_unlock_irqrestore(rq, &rf); + sched_set_rq_offline(rq, cpu); =20 -#ifdef CONFIG_SCHED_SMT /* * When going down, decrement the number of cores with SMT present. */ - if (cpumask_weight(cpu_smt_mask(cpu)) =3D=3D 2) - static_branch_dec_cpuslocked(&sched_smt_present); + sched_smt_present_dec(cpu); =20 +#ifdef CONFIG_SCHED_SMT sched_core_cpu_deactivate(cpu); #endif =20 @@ -7997,6 +8021,8 @@ int sched_cpu_deactivate(unsigned int cpu) sched_update_numa(cpu, false); ret =3D cpuset_cpu_inactive(cpu); if (ret) { + sched_smt_present_inc(cpu); + sched_set_rq_online(rq, cpu); balance_push_set(cpu, false); set_cpu_active(cpu, true); sched_update_numa(cpu, true); diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index a5e00293ae43..0bed0fa1acd9 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -582,6 +582,12 @@ void cputime_adjust(struct task_cputime *curr, struct pr= ev_cputime *prev, } =20 stime =3D mul_u64_u64_div_u64(stime, rtime, stime + utime); + /* + * Because mul_u64_u64_div_u64() can approximate on some + * achitectures; enforce the constraint that: a*b/(b+c) <=3D a. + */ + if (unlikely(stime > rtime)) + stime =3D rtime; =20 update: /* . Date: Sun, 4 Aug 2024 15:02:58 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] timers/urgent for v6.11-rc2 Linus, please pull the latest timers/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-20= 24-08-04 up to: f2655ac2c06a: clocksource: Fix brown-bag boolean thinko in cs_watchdo= g_read() Two fixes for the timer/clocksource code: - The recent fix for making the take over of the broadcast timer more reliable retrieves a per CPU pointer in preemptible context. This went unnoticed in testing as some compilers hoist the access into the non-preemotible section where the pointer is actually used, but obviously compilers can rightfully invoke it where the code put it. Move it into the non-preemptible section right to the actual usage side to cure it. - The clocksource watchdog is supposed to emit a warning when the retry count is greater than one and the number of retries reaches the limit. The condition is backwards and warns always when the count is greater than one. Fixup the condition to prevent spamming dmesg. Thanks, tglx ------------------> Paul E. McKenney (1): clocksource: Fix brown-bag boolean thinko in cs_watchdog_read() Thomas Gleixner (1): tick/broadcast: Move per CPU pointer access into the atomic section kernel/time/clocksource.c | 2 +- kernel/time/tick-broadcast.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index d25ba49e313c..d0538a75f4c6 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -246,7 +246,7 @@ static enum wd_read_status cs_watchdog_read(struct clocks= ource *cs, u64 *csnow, =20 wd_delay =3D cycles_to_nsec_safe(watchdog, *wdnow, wd_end); if (wd_delay <=3D WATCHDOG_MAX_SKEW) { - if (nretries > 1 || nretries >=3D max_retries) { + if (nretries > 1 && nretries >=3D max_retries) { pr_warn("timekeeping watchdog on CPU%d: %s retried %d times before succe= ss\n", smp_processor_id(), watchdog->name, nretries); } diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index b4843099a8da..ed58eebb4e8f 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -1141,7 +1141,6 @@ void tick_broadcast_switch_to_oneshot(void) #ifdef CONFIG_HOTPLUG_CPU void hotplug_cpu__broadcast_tick_pull(int deadcpu) { - struct tick_device *td =3D this_cpu_ptr(&tick_cpu_device); struct clock_event_device *bc; unsigned long flags; =20 @@ -1167,6 +1166,8 @@ void hotplug_cpu__broadcast_tick_pull(int deadcpu) * device to avoid the starvation. */ if (tick_check_broadcast_expired()) { + struct tick_device *td =3D this_cpu_ptr(&tick_cpu_device); + cpumask_clear_cpu(smp_processor_id(), tick_broadcast_force_mask); tick_program_event(td->evtdev->next_event, 1); } . Date: Sun, 4 Aug 2024 15:03:00 +0200 (CEST) From: Thomas Gleixner To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] x86/urgent for v6.11-rc2 Linus, please pull the latest x86/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-2024-= 08-04 up to: dd35a0933269: x86/uaccess: Zero the 8-byte get_range case on failure = on 32-bit X86 fixes: - Prevent a deadlock on cpu_hotplug_lock in the aperf/mperf driver. A recent change in the ACPI code which consolidated code pathes moved the invocation of init_freq_invariance_cppc() to be moved to a CPU hotplug handler. The first invocation on AMD CPUs ends up enabling a static branch which dead locks because the static branch enable tries to acquire cpu_hotplug_lock but that lock is already held write by the hotplug machinery. Use static_branch_enable_cpuslocked() instead and take the hotplug lock read for the Intel code path which is invoked from the architecture code outside of the CPU hotplug operations. - Fix the number of reserved bits in the sev_config structure bit field so that the bitfield does not exceed 64 bit. - Add missing Zen5 model numbers - Fix the alignment assumptions of pti_clone_pgtable() and clone_entry_text() on 32-bit: The code assumes PMD aligned code sections, but on 32-bit the kernel entry text is not PMD aligned. So depending on the code size and location, which is configuration and compiler dependent, entry text can cross a PMD boundary. As the start is not PMD aligned adding PMD size to the start address is larger than the end address which results in partially mapped entry code for user space. That causes endless recursion on the first entry from userspace (usually #PF). Cure this by aligning the start address in the addition so it ends up at the next PMD start address. clone_entry_text() enforces PMD mapping, but on 32-bit the tail might eventually be PTE mapped, which causes a map fail because the PMD for the tail is not a large page mapping. Use PTI_LEVEL_KERNEL_IMAGE for the clone() invocation which resolves to PTE on 32-bit and PMD on 64-bit. - Zero the 8-byte case for get_user() on range check failure on 32-bit The recend consolidation of the 8-byte get_user() case broke the zeroing in the failure case again. Establish it by clearing ECX before the range check and not afterwards as that obvioulsy can't be reached when the range check fails =20 Thanks, tglx ------------------> Borislav Petkov (AMD) (1): x86/setup: Parse the builtin command line before merging David Gow (1): x86/uaccess: Zero the 8-byte get_range case on failure on 32-bit Jonathan Cameron (1): x86/aperfmperf: Fix deadlock on cpu_hotplug_lock Pavan Kumar Paluri (1): x86/sev: Fix __reserved field in sev_config Perry Yuan (1): x86/CPU/AMD: Add models 0x60-0x6f to the Zen5 range Peter Zijlstra (2): x86/mm: Fix pti_clone_pgtable() alignment assumption x86/mm: Fix pti_clone_entry_text() for i386 arch/x86/coco/sev/core.c | 2 +- arch/x86/include/asm/cmdline.h | 4 ++++ arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/kernel/cpu/aperfmperf.c | 6 ++++-- arch/x86/kernel/setup.c | 2 +- arch/x86/lib/cmdline.c | 25 ++++++++++++++++++------- arch/x86/lib/getuser.S | 4 +++- arch/x86/mm/pti.c | 8 ++++---- 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c index 082d61d85dfc..de1df0cb45da 100644 --- a/arch/x86/coco/sev/core.c +++ b/arch/x86/coco/sev/core.c @@ -163,7 +163,7 @@ struct sev_config { */ use_cas : 1, =20 - __reserved : 62; + __reserved : 61; }; =20 static struct sev_config sev_cfg __read_mostly; diff --git a/arch/x86/include/asm/cmdline.h b/arch/x86/include/asm/cmdline.h index 6faaf27e8899..6cbd9ae58b21 100644 --- a/arch/x86/include/asm/cmdline.h +++ b/arch/x86/include/asm/cmdline.h @@ -2,6 +2,10 @@ #ifndef _ASM_X86_CMDLINE_H #define _ASM_X86_CMDLINE_H =20 +#include + +extern char builtin_cmdline[COMMAND_LINE_SIZE]; + int cmdline_find_option_bool(const char *cmdline_ptr, const char *option); int cmdline_find_option(const char *cmdline_ptr, const char *option, char *buffer, int bufsize); diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index be5889bded49..1e0fe5f8ab84 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -462,7 +462,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) switch (c->x86_model) { case 0x00 ... 0x2f: case 0x40 ... 0x4f: - case 0x70 ... 0x7f: + case 0x60 ... 0x7f: setup_force_cpu_cap(X86_FEATURE_ZEN5); break; default: diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmper= f.c index b3fa61d45352..0b69bfbf345d 100644 --- a/arch/x86/kernel/cpu/aperfmperf.c +++ b/arch/x86/kernel/cpu/aperfmperf.c @@ -306,7 +306,7 @@ static void freq_invariance_enable(void) WARN_ON_ONCE(1); return; } - static_branch_enable(&arch_scale_freq_key); + static_branch_enable_cpuslocked(&arch_scale_freq_key); register_freq_invariance_syscore_ops(); pr_info("Estimated ratio of average max frequency by base frequency (times = 1024): %llu\n", arch_max_freq_ratio); } @@ -323,8 +323,10 @@ static void __init bp_init_freq_invariance(void) if (boot_cpu_data.x86_vendor !=3D X86_VENDOR_INTEL) return; =20 - if (intel_set_max_freq_ratio()) + if (intel_set_max_freq_ratio()) { + guard(cpus_read_lock)(); freq_invariance_enable(); + } } =20 static void disable_freq_invariance_workfn(struct work_struct *work) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 5d34cad9b7b1..6129dc2ba784 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -164,7 +164,7 @@ unsigned long saved_video_mode; =20 static char __initdata command_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_CMDLINE_BOOL -static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] =3D CONFIG_CMDLINE; +char builtin_cmdline[COMMAND_LINE_SIZE] =3D CONFIG_CMDLINE; bool builtin_cmdline_added __ro_after_init; #endif =20 diff --git a/arch/x86/lib/cmdline.c b/arch/x86/lib/cmdline.c index 384da1fdd5c6..c65cd5550454 100644 --- a/arch/x86/lib/cmdline.c +++ b/arch/x86/lib/cmdline.c @@ -207,18 +207,29 @@ __cmdline_find_option(const char *cmdline, int max_cmdl= ine_size, =20 int cmdline_find_option_bool(const char *cmdline, const char *option) { - if (IS_ENABLED(CONFIG_CMDLINE_BOOL)) - WARN_ON_ONCE(!builtin_cmdline_added); + int ret; =20 - return __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); + ret =3D __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); + if (ret > 0) + return ret; + + if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && !builtin_cmdline_added) + return __cmdline_find_option_bool(builtin_cmdline, COMMAND_LINE_SIZE, opti= on); + + return ret; } =20 int cmdline_find_option(const char *cmdline, const char *option, char *buffe= r, int bufsize) { - if (IS_ENABLED(CONFIG_CMDLINE_BOOL)) - WARN_ON_ONCE(!builtin_cmdline_added); + int ret; + + ret =3D __cmdline_find_option(cmdline, COMMAND_LINE_SIZE, option, buffer, b= ufsize); + if (ret > 0) + return ret; + + if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && !builtin_cmdline_added) + return __cmdline_find_option(builtin_cmdline, COMMAND_LINE_SIZE, option, b= uffer, bufsize); =20 - return __cmdline_find_option(cmdline, COMMAND_LINE_SIZE, option, - buffer, bufsize); + return ret; } diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S index a314622aa093..d066aecf8aeb 100644 --- a/arch/x86/lib/getuser.S +++ b/arch/x86/lib/getuser.S @@ -88,12 +88,14 @@ SYM_FUNC_END(__get_user_4) EXPORT_SYMBOL(__get_user_4) =20 SYM_FUNC_START(__get_user_8) +#ifndef CONFIG_X86_64 + xor %ecx,%ecx +#endif check_range size=3D8 ASM_STAC #ifdef CONFIG_X86_64 UACCESS movq (%_ASM_AX),%rdx #else - xor %ecx,%ecx UACCESS movl (%_ASM_AX),%edx UACCESS movl 4(%_ASM_AX),%ecx #endif diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 2e69abf4f852..bfdf5f45b137 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -374,14 +374,14 @@ pti_clone_pgtable(unsigned long start, unsigned long en= d, */ *target_pmd =3D *pmd; =20 - addr +=3D PMD_SIZE; + addr =3D round_up(addr + 1, PMD_SIZE); =20 } else if (level =3D=3D PTI_CLONE_PTE) { =20 /* Walk the page-table down to the pte level */ pte =3D pte_offset_kernel(pmd, addr); if (pte_none(*pte)) { - addr +=3D PAGE_SIZE; + addr =3D round_up(addr + 1, PAGE_SIZE); continue; } =20 @@ -401,7 +401,7 @@ pti_clone_pgtable(unsigned long start, unsigned long end, /* Clone the PTE */ *target_pte =3D *pte; =20 - addr +=3D PAGE_SIZE; + addr =3D round_up(addr + 1, PAGE_SIZE); =20 } else { BUG(); @@ -496,7 +496,7 @@ static void pti_clone_entry_text(void) { pti_clone_pgtable((unsigned long) __entry_text_start, (unsigned long) __entry_text_end, - PTI_CLONE_PMD); + PTI_LEVEL_KERNEL_IMAGE); } =20 /* .