Subject: Linux 6.12
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Date: Sun, 17 Nov 2024 14:26:38 -0800

.
Subject: linux-next: the merge window is open
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linux-Next Mailing List <linux-next@vger.kernel.org>, Linux-kernel
 Mailing List <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 09:36:45 +1100

.
Subject: [PATCH] ASoC: qcom: apq8016_sbc: Fix second argument of apq8016_dai_init()
From: Bert Karwatzki <spasswolf@web.de>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: Bert Karwatzki <spasswolf@web.de>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	alsa-devel@alsa-project.org
Date: Mon, 18 Nov 2024 00:20:58 +0100

.
Subject: [PATCH] XHCI NULL Pointer check in xhci_check_bw_table
From: Markus Rechberger <linuxusb.ml@sundtek.de>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: Greg KH <gregkh@linuxfoundation.org>
Date: Mon, 18 Nov 2024 07:27:03 +0800

.
Subject: [PATCH] bcachefs: initialize local variables in bch2_evacuate_bucket
From: Piotr Zalewski <pZ010001011111@proton.me>
To: kent.overstreet@linux.dev, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Cc: skhan@linuxfoundation.org, Piotr Zalewski <pZ010001011111@proton.me>
Date: Sun, 17 Nov 2024 23:48:23 +0000

.
Subject: [PATCH 0/2] Fix kernel panic on niu bind
From: dullfire@yahoo.com
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Simon Horman <horms@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mostafa Saleh <smostafa@google.com>,
	Marc Zyngier <maz@kernel.org>,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org
Cc: Jonathan Currier <dullfire@yahoo.com>
Date: Sun, 17 Nov 2024 17:48:41 -0600

.
Subject: [PATCH] vfs: move getattr in inode_operations to a more commonly read area
From: Mateusz Guzik <mjguzik@gmail.com>
To: brauner@kernel.org
Cc: viro@zeniv.linux.org.uk,
	jack@suse.cz,
	linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	Mateusz Guzik <mjguzik@gmail.com>
Date: Mon, 18 Nov 2024 01:20:24 +0100

.
Subject: sound/ac97/bus.c:192: warning: Function parameter or member 'drv'
 not described in 'snd_ac97_codec_driver_register'
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Date: Mon, 18 Nov 2024 08:27:44 +0800

.
Subject: [GIT PULL] chrome-platform changes for v6.13
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: torvalds@linux-foundation.org
Cc: pmalani@chromium.org, bleung@chromium.org, groeck@chromium.org,
	tzungbi@kernel.org, linux-kernel@vger.kernel.org,
	chrome-platform@lists.linux.dev
Date: Mon, 18 Nov 2024 00:32:10 +0000


--vc1NQ08x9iOiuR1K
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git t=
ags/chrome-platform-for-6.13

for you to fetch changes up to ea45f3f46734a47bdbcfb31f41748484219d2ea6:

  platform/chrome: Switch back to struct platform_driver::remove() (2024-10=
-28 08:48:34 +0000)

----------------------------------------------------------------
chrome platform changes for 6.13

* Fixes

  - Fix a leak of fwnode refcount.

* Cleanups

  - Drop unused I2C driver data.
  - Move back from platform_driver::remove_new() to
    platform_driver::remove().

----------------------------------------------------------------
Javier Carrasco (1):
      platform/chrome: cros_ec_typec: fix missing fwnode reference decrement

Uwe Kleine-K=F6nig (2):
      platform/chrome: Drop explicit initialization of struct i2c_device_id=
::driver_data to 0
      platform/chrome: Switch back to struct platform_driver::remove()

 drivers/platform/chrome/cros_ec_chardev.c    | 2 +-
 drivers/platform/chrome/cros_ec_debugfs.c    | 2 +-
 drivers/platform/chrome/cros_ec_i2c.c        | 2 +-
 drivers/platform/chrome/cros_ec_lightbar.c   | 2 +-
 drivers/platform/chrome/cros_ec_lpc.c        | 2 +-
 drivers/platform/chrome/cros_ec_sysfs.c      | 2 +-
 drivers/platform/chrome/cros_ec_typec.c      | 3 ++-
 drivers/platform/chrome/cros_ec_vbc.c        | 2 +-
 drivers/platform/chrome/cros_hps_i2c.c       | 2 +-
 drivers/platform/chrome/cros_typec_switch.c  | 2 +-
 drivers/platform/chrome/cros_usbpd_logger.c  | 2 +-
 drivers/platform/chrome/cros_usbpd_notify.c  | 4 ++--
 drivers/platform/chrome/wilco_ec/core.c      | 2 +-
 drivers/platform/chrome/wilco_ec/debugfs.c   | 2 +-
 drivers/platform/chrome/wilco_ec/telemetry.c | 2 +-
 15 files changed, 17 insertions(+), 16 deletions(-)

--vc1NQ08x9iOiuR1K
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQS0yQeDP3cjLyifNRUrxTEGBto89AUCZzqLCQAKCRArxTEGBto8
9ApLAP4qa6WjKDVBG2nSATTjSr4ZViW4HnQ/4Ew84WizjPfHKQEArxlOXIapg7rx
ejDb+N7T1Ng+4iZXyBrK186UHkIsNA8=
=tGCY
-----END PGP SIGNATURE-----

--vc1NQ08x9iOiuR1K--

.
Subject: [GIT PULL] chrome-platform-firmware changes for v6.13
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: torvalds@linux-foundation.org
Cc: briannorris@chromium.org, jwerner@chromium.org, tzungbi@kernel.org,
	linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev
Date: Mon, 18 Nov 2024 00:32:38 +0000


--2vTng0Lkhdjc+j2z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git tags/chrome-platform-firmware-for-6.13

for you to fetch changes up to 32b0901e141f6d4cf49d820b53eb09b88b1f72f7:

  firmware: google: Unregister driver_info on failure (2024-10-15 22:51:24 +0000)

----------------------------------------------------------------
chrome platform firmware changes for 6.13

* Fixes

  - Do not double register "simple-framebuffer" platform device if
    Generic System Framebuffers (sysfb) already did that.
  - Fix a missing of unregistering platform driver in error handling
    path.

----------------------------------------------------------------
Javier Martinez Canillas (2):
      firmware: sysfb: Add a sysfb_handles_screen_info() helper function
      firmware: coreboot: Don't register a pdev if screen_info data is present

Yuan Can (1):
      firmware: google: Unregister driver_info on failure

 drivers/firmware/google/framebuffer-coreboot.c | 14 ++++++++++++++
 drivers/firmware/google/gsmi.c                 |  6 ++++--
 drivers/firmware/sysfb.c                       | 19 +++++++++++++++++++
 include/linux/sysfb.h                          |  7 +++++++
 4 files changed, 44 insertions(+), 2 deletions(-)

--2vTng0Lkhdjc+j2z
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQS0yQeDP3cjLyifNRUrxTEGBto89AUCZzqLJgAKCRArxTEGBto8
9Bc7AP4qSLGHwc+uR0kF+Z7OGGNeeZiZ40+2EC5cUfTRbQgc/gEAh+yK72dfH5RN
/A4T73K6g/GzxCZLROe3jCx4AqtfQwE=
=y9/A
-----END PGP SIGNATURE-----

--2vTng0Lkhdjc+j2z--

.
Subject: [tip:tip/urgent] BUILD SUCCESS
 468fbe038f2fc42547db8ba47c9e552e76f52eeb
From: kernel test robot <lkp@intel.com>
To: "x86-ml" <x86@kernel.org>
Cc: linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 08:39:03 +0800

.
Subject: [PATCH v2 0/2] x86/ioremap: clean up the mess in xxx_is_setup_data
From: Baoquan He <bhe@redhat.com>
To: linux-kernel@vger.kernel.org,
	mingo@kernel.org,
	bp@alien8.de,
	thomas.lendacky@amd.com
Cc: x86@kernel.org,
	Baoquan He <bhe@redhat.com>
Date: Mon, 18 Nov 2024 09:08:17 +0800

.
Subject: [gustavoars:testing/wfamnae-next20241114 1/22]
 kernel/sched/ext.c:3765:10: error: incompatible pointer types returning
 'struct cgroup_hdr *' from a function with result type 'struct cgroup *'
From: kernel test robot <lkp@intel.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	LKML <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 09:22:16 +0800

.
Subject: [gustavoars:testing/wfamnae-next20241114] BUILD REGRESSION
 ffa0ea7cd2216fa4db0e24844e1675e94b7db1aa
From: kernel test robot <lkp@intel.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 09:35:56 +0800

.
Subject: linux-next: manual merge of the pci tree with Linus' tree
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Bjorn Helgaas <bhelgaas@google.com>, Lorenzo Pieralisi
 <lpieralisi@kernel.org>, Krzysztof =?UTF-8?B?V2lsY3p5xYRza2k=?=
 <kw@linux.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Linux Kernel
 Mailing List <linux-kernel@vger.kernel.org>, Linux Next Mailing List
 <linux-next@vger.kernel.org>
Date: Mon, 18 Nov 2024 13:00:06 +1100

.
Subject: [GIT PULL] random number generator updates for 6.13-rc1
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 03:09:39 +0100

Hi Linus,

This pull request contains a single series from Uros to replace uses of
#include <linux/random.h> with prandom.h or other more specific headers, as
needed, in order to avoid a circular header issue. Uros' goal is to be able to
use percpu.h from prandom.h, which will then allow him to define __percpu in
percpu.h rather than in compiler_types.h.

This has been sitting in next for most of the 6.12 cycle.

Please pull!

Thanks,
Jason

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git tags/random-6.13-rc1-for-linus

for you to fetch changes up to d18c13697b4dcbf6a8f06c3d8e564c4f5ad1477c:

  prandom: Include <linux/percpu.h> in <linux/prandom.h> (2024-10-03 18:21:07 +0200)

----------------------------------------------------------------
Random number generator updates for Linux 6.13-rc1.
----------------------------------------------------------------

Uros Bizjak (19):
      x86/kaslr: Include <linux/prandom.h> instead of <linux/random.h>
      crypto: testmgr: Include <linux/prandom.h> instead of <linux/random.h>
      drm/i915/selftests: Include <linux/prandom.h> instead of <linux/random.h>
      drm/lib: Include <linux/prandom.h> instead of <linux/random.h>
      media: vivid: Include <linux/prandom.h> in vivid-vid-cap.c
      mtd: tests: Include <linux/prandom.h> instead of <linux/random.h>
      fscrypt: Include <linux/once.h> in fs/crypto/keyring.c
      scsi: libfcoe: Include <linux/prandom.h> instead of <linux/random.h>
      bpf: Include <linux/prandom.h> instead of <linux/random.h>
      lib/interval_tree_test.c: Include <linux/prandom.h> instead of <linux/random.h>
      kunit: string-stream-test: Include <linux/prandom.h>
      random32: Include <linux/prandom.h> instead of <linux/random.h>
      lib/rbtree-test: Include <linux/prandom.h> instead of <linux/random.h>
      bpf/tests: Include <linux/prandom.h> instead of <linux/random.h>
      lib/test_parman: Include <linux/prandom.h> instead of <linux/random.h>
      lib/test_scanf: Include <linux/prandom.h> instead of <linux/random.h>
      netem: Include <linux/prandom.h> in sch_netem.c
      random: Do not include <linux/prandom.h> in <linux/random.h>
      prandom: Include <linux/percpu.h> in <linux/prandom.h>

 arch/x86/mm/kaslr.c                              | 2 +-
 crypto/testmgr.c                                 | 2 +-
 drivers/gpu/drm/i915/selftests/i915_gem.c        | 2 +-
 drivers/gpu/drm/i915/selftests/i915_random.h     | 2 +-
 drivers/gpu/drm/i915/selftests/scatterlist.c     | 2 +-
 drivers/gpu/drm/lib/drm_random.h                 | 2 +-
 drivers/media/test-drivers/vivid/vivid-vid-cap.c | 1 +
 drivers/mtd/tests/oobtest.c                      | 2 +-
 drivers/mtd/tests/pagetest.c                     | 2 +-
 drivers/mtd/tests/subpagetest.c                  | 2 +-
 fs/crypto/keyring.c                              | 1 +
 include/linux/prandom.h                          | 1 +
 include/linux/random.h                           | 7 -------
 include/scsi/libfcoe.h                           | 2 +-
 kernel/bpf/core.c                                | 2 +-
 lib/interval_tree_test.c                         | 2 +-
 lib/kunit/string-stream-test.c                   | 1 +
 lib/random32.c                                   | 2 +-
 lib/rbtree_test.c                                | 2 +-
 lib/test_bpf.c                                   | 2 +-
 lib/test_parman.c                                | 2 +-
 lib/test_scanf.c                                 | 2 +-
 net/sched/sch_netem.c                            | 1 +
 23 files changed, 22 insertions(+), 24 deletions(-)

.
Subject: [PATCH v3 0/3] Support ExynosAutov920 ufs phy driver
From: Sowon Na <sowon.na@samsung.com>
To: robh@kernel.org, krzk@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
	alim.akhtar@samsung.com, kishon@kernel.org
Cc: krzk+dt@kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	sowon.na@samsung.com
Date: Mon, 18 Nov 2024 11:10:03 +0900

.
Subject: [PATCH v6] soc: imx: Add SoC device register for i.MX9
From: alice.guo@oss.nxp.com
To: alexander.stein@ew.tq-group.com,
	wahrenst@gmx.net,
	shawnguo@kernel.org,
	s.hauer@pengutronix.de,
	kernel@pengutronix.de,
	festevam@gmail.com
Cc: imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"alice.guo" <alice.guo@nxp.com>
Date: Mon, 18 Nov 2024 10:17:16 +0800

.
Subject: [PATCH 0/2] clk: qcom: Add support for multiple power-domains for
 a clock controller.
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>, 
 Michael Turquette <mturquette@baylibre.com>, 
 Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, 
 linux-kernel@vger.kernel.org, Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Date: Mon, 18 Nov 2024 02:24:31 +0000

.
Subject: [PATCH] drm/mediatek: Add support for 180-degree rotation in the display driver
From: Jason-JH.Lin <jason-jh.lin@mediatek.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Date: Mon, 18 Nov 2024 10:51:26 +0800

.
Subject: [PATCH] ASoC: amd: Fix build dependencies for `SND_SOC_AMD_PS`
From: Mario Limonciello <superm1@kernel.org>
To: Mark Brown <broonie@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: linux-sound@vger.kernel.org (open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...),
	linux-kernel@vger.kernel.org (open list),
	Mario Limonciello <mario.limonciello@amd.com>,
	kernel test robot <lkp@intel.com>
Date: Sun, 17 Nov 2024 20:55:27 -0600

.
Subject: [PATCH] usb: gadget: u_serial: Fix the issue that gs_start_io crashed
 due to accessing null pointer
From: =?gb2312?B?uvrBrMfa?= <hulianqin@vivo.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"quic_jjohnson@quicinc.com" <quic_jjohnson@quicinc.com>, "mwalle@kernel.org"
	<mwalle@kernel.org>, Prashanth K <quic_prashk@quicinc.com>
Date: Mon, 18 Nov 2024 03:12:54 +0000

.
Subject: [PATCH] drm/mediatek: Add no pending_planes flag checking for mtk_crtc_finish_page_flip()
From: Jason-JH.Lin <jason-jh.lin@mediatek.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Date: Mon, 18 Nov 2024 11:36:46 +0800

.
Subject: [GIT PULL] hwmon updates for v6.13-rc1
From: Guenter Roeck <linux@roeck-us.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org
Date: Sun, 17 Nov 2024 19:38:36 -0800

Hi Linus,

Please pull hwmon updates for Linux v6.13-rc1 from signed tag:

    git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-for-v6.13-rc1

Thanks,
Guenter
------

The following changes since commit 2d5404caa8c7bb5c4e0435f94b28834ae5456623:

  Linux 6.12-rc7 (2024-11-10 14:19:35 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git tags/hwmon-for-v6.13-rc1

for you to fetch changes up to 3996187f80a0e24bff1959609065d49041cf648d:

  hwmon: (pmbus/isl68137) add support for voltage divider on Vout (2024-11-13 12:08:07 -0800)

----------------------------------------------------------------
hmon updates for v6.13-rc1

* New drivers

  - ISL28022 power monitor

  - Nuvoton NCT7363Y

* Added support for new chips to existing drivers

  - The tmp180 driver now supports NXP p3t1085, including its I3C mode

  - The ina2xx driver now supports SY24655 and INA260

  - The amc6821 driver now supports tsd,mule

* Other notable improvements

  - The sht4x driver now supports the chip heater

  - The pmbus/isl68137 driver now supports a voltage divider on Vout

  - The cros_ec driver registers with the thermal framework

  - The pmbus/ltc2978 driver now supports LTC7841

  - The PMBus core now allow drivers to override WRITE_PROTECT

* Various other minor improvements and cleanups

----------------------------------------------------------------
Abhinav Saxena (2):
      hwmon: (f71882fg) Fix grammar in fan speed trip points explanation
      hwmon: (sch5627, max31827) Fix typos in driver documentation

Andy Shevchenko (1):
      hwmon: (jc42) Drop of_match_ptr() protection

Antoni Pokusinski (1):
      hwmon: (sht4x): add heater support

Arnd Bergmann (1):
      hwmon: tmp108: fix I3C dependency

Ban Feng (2):
      dt-bindings: hwmon: Add NCT7363Y documentation
      hwmon: Add driver for I2C chip Nuvoton NCT7363Y

Everest K.C. (1):
      hwmon: (max31827) Fix spelling errors reported by codespell

Farouk Bouabid (2):
      dt-bindings: hwmon: add support for ti,amc6821
      hwmon: (amc6821) add support for tsd,mule

Frank Li (4):
      dt-bindings: hwmon: ti,tmp108: Add nxp,p3t1085 compatible string
      hwmon: (tmp108) Add NXP p3t1085 support
      hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support
      hwmon: (tmp108) Add support for I3C device

Grant Peltier (2):
      dt-bindings: hwmon: isl68137: add bindings to support voltage dividers
      hwmon: (pmbus/isl68137) add support for voltage divider on Vout

Guenter Roeck (3):
      hwmon: (ina2xx) Add support for has_alerts configuration flag
      hwmon: (ina2xx) Add support for INA260
      MAINTAINERS: Remove Aleksandr Mezin as NZXT-SMART2 driver maintainer

Heiner Kallweit (9):
      hwmon: Add static visibility member to struct hwmon_ops
      hwmon: (i5500_temp) Simplify specifying static visibility attribute
      hwmon: (surface_fan) Simplify specifying static visibility attribute
      hwmon: (sl28cpld) Simplify specifying static visibility attribute
      hwmon: (gsc) Simplify specifying static visibility attribute
      hwmon: (powerz) Simplify specifying static visibility attribute
      hwmon: (raspberrypi) Simplify specifying static visibility attribute
      hwmon: (intel-m10-bmc) Simplify specifying static visibility attribute
      hwmon: (nzxt-kraken2) Simplify specifying static visibility attribute

Huisong Li (1):
      hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method

Jerome Brunet (4):
      hwmon: (pmbus) add documentation for existing flags
      hwmon: (pmbus/core) allow drivers to override WRITE_PROTECT
      hwmon: (pmbus/core) clear faults after setting smbalert mask
      dt-bindings: hwmon: pmbus: add ti tps25990 support

Marek Vasut (2):
      dt-bindings: hwmon: pwm-fan: Document start from stopped state properties
      hwmon: (pwm-fan) Introduce start from stopped state handling

Mariel Tinaco (3):
      dt-bindings: hwmon: ltc2978: add support for ltc7841
      hwmon: (pmbus/ltc7841) add support for LTC7841 - docs
      hwmon: (pmbus/ltc2978) add support for ltc7841

Naresh Solanki (3):
      hwmon: (max6639) : Configure based on DT property
      dt-bindings: hwmon: pmbus: Add bindings for MPS MP297x
      dt-bindings: hwmon: pmbus: Add bindings for Vicor pli1209bc

Pei Xiao (1):
      hwmon: (nct6775-core) Fix overflows seen when writing limit attributes

Sarah Maedel (1):
      hwmon: (nct6775) Add 665-ACE/600M-CL to ASUS WMI monitoring list

Shen Lichuan (1):
      hwmon: (pmbus/mpq8785) Convert comma to semicolon

Sung-Chi, Li (1):
      hwmon: (cros_ec) register thermal sensors to thermal framework

Uwe Kleine-KÃ¶nig (2):
      hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0
      hwmon: Switch back to struct platform_driver::remove()

Wenliang Yan (2):
      dt-bindings: Add SY24655 to ina2xx devicetree bindings
      hwmon: (ina226) Add support for SY24655

Yikai Tsai (2):
      dt-bindings: hwmon: add renesas,isl28022
      hwmon: (isl28022) new driver for ISL28022 power monitor

 .../devicetree/bindings/hwmon/lltc,ltc2978.yaml    |   2 +
 .../devicetree/bindings/hwmon/nuvoton,nct7363.yaml |  66 +++
 .../bindings/hwmon/pmbus/isil,isl68137.yaml        | 148 ++++++
 .../bindings/hwmon/pmbus/mps,mp2975.yaml           |  75 +++
 .../bindings/hwmon/pmbus/ti,tps25990.yaml          |  83 ++++
 .../bindings/hwmon/pmbus/vicor,pli1209bc.yaml      |  62 +++
 .../devicetree/bindings/hwmon/pwm-fan.yaml         |  10 +
 .../bindings/hwmon/renesas,isl28022.yaml           |  64 +++
 .../devicetree/bindings/hwmon/ti,amc6821.yaml      |  86 ++++
 .../devicetree/bindings/hwmon/ti,ina2xx.yaml       |   1 +
 .../devicetree/bindings/hwmon/ti,tmp108.yaml       |   8 +-
 .../devicetree/bindings/trivial-devices.yaml       |  16 -
 Documentation/hwmon/f71882fg.rst                   |   9 +-
 Documentation/hwmon/ina2xx.rst                     |  46 +-
 Documentation/hwmon/index.rst                      |   2 +
 Documentation/hwmon/isl28022.rst                   |  63 +++
 Documentation/hwmon/ltc2978.rst                    |  12 +
 Documentation/hwmon/max31827.rst                   |   2 +-
 Documentation/hwmon/nct7363.rst                    |  35 ++
 Documentation/hwmon/pmbus-core.rst                 |  15 +
 Documentation/hwmon/sch5627.rst                    |   2 +-
 Documentation/hwmon/sht4x.rst                      |  14 +
 Documentation/hwmon/tmp108.rst                     |   8 +
 MAINTAINERS                                        |  29 +-
 drivers/hwmon/Kconfig                              |  31 +-
 drivers/hwmon/Makefile                             |   2 +
 drivers/hwmon/abituguru.c                          |   2 +-
 drivers/hwmon/abituguru3.c                         |   4 +-
 drivers/hwmon/acpi_power_meter.c                   |   3 +-
 drivers/hwmon/amc6821.c                            |  14 +-
 drivers/hwmon/aspeed-g6-pwm-tach.c                 |   2 +-
 drivers/hwmon/cros_ec_hwmon.c                      |   1 +
 drivers/hwmon/da9052-hwmon.c                       |   2 +-
 drivers/hwmon/dme1737.c                            |   2 +-
 drivers/hwmon/f71805f.c                            |   2 +-
 drivers/hwmon/f71882fg.c                           |   2 +-
 drivers/hwmon/gsc-hwmon.c                          |   9 +-
 drivers/hwmon/hwmon.c                              |  19 +-
 drivers/hwmon/i5500_temp.c                         |   8 +-
 drivers/hwmon/i5k_amb.c                            |   2 +-
 drivers/hwmon/ina2xx.c                             | 152 +++++-
 drivers/hwmon/intel-m10-bmc-hwmon.c                |   9 +-
 drivers/hwmon/isl28022.c                           | 535 +++++++++++++++++++++
 drivers/hwmon/jc42.c                               |   6 +-
 drivers/hwmon/max197.c                             |   2 +-
 drivers/hwmon/max6639.c                            |  83 +++-
 drivers/hwmon/mc13783-adc.c                        |   2 +-
 drivers/hwmon/nct6775-core.c                       |   7 +-
 drivers/hwmon/nct6775-platform.c                   |   2 +
 drivers/hwmon/nct7363.c                            | 447 +++++++++++++++++
 drivers/hwmon/nzxt-kraken2.c                       |   9 +-
 drivers/hwmon/occ/p9_sbe.c                         |   4 +-
 drivers/hwmon/pc87360.c                            |   2 +-
 drivers/hwmon/pc87427.c                            |   2 +-
 drivers/hwmon/pmbus/Kconfig                        |   6 +-
 drivers/hwmon/pmbus/isl68137.c                     | 210 +++++++-
 drivers/hwmon/pmbus/ltc2978.c                      |  20 +-
 drivers/hwmon/pmbus/mp2891.c                       |   4 +-
 drivers/hwmon/pmbus/mp2993.c                       |   4 +-
 drivers/hwmon/pmbus/mp9941.c                       |   4 +-
 drivers/hwmon/pmbus/mpq8785.c                      |   2 +-
 drivers/hwmon/pmbus/pmbus_core.c                   |  16 +-
 drivers/hwmon/powerz.c                             |   8 +-
 drivers/hwmon/pwm-fan.c                            |  33 +-
 drivers/hwmon/raspberrypi-hwmon.c                  |   8 +-
 drivers/hwmon/sch5636.c                            |   2 +-
 drivers/hwmon/sg2042-mcu.c                         |   4 +-
 drivers/hwmon/sht15.c                              |   2 +-
 drivers/hwmon/sht4x.c                              | 184 ++++++-
 drivers/hwmon/sis5595.c                            |   2 +-
 drivers/hwmon/sl28cpld-hwmon.c                     |   9 +-
 drivers/hwmon/smsc47m1.c                           |   2 +-
 drivers/hwmon/spd5118.c                            |   2 +-
 drivers/hwmon/surface_fan.c                        |  10 +-
 drivers/hwmon/tmp108.c                             |  75 ++-
 drivers/hwmon/ultra45_env.c                        |   2 +-
 drivers/hwmon/via-cputemp.c                        |   2 +-
 drivers/hwmon/via686a.c                            |   2 +-
 drivers/hwmon/vt1211.c                             |   2 +-
 drivers/hwmon/vt8231.c                             |   4 +-
 drivers/hwmon/w83627hf.c                           |   2 +-
 drivers/hwmon/w83781d.c                            |   2 +-
 drivers/hwmon/xgene-hwmon.c                        |   2 +-
 include/linux/hwmon.h                              |   5 +-
 include/linux/platform_data/max6639.h              |  15 -
 85 files changed, 2620 insertions(+), 250 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/nuvoton,nct7363.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/isil,isl68137.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/mps,mp2975.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/ti,tps25990.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/pmbus/vicor,pli1209bc.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
 create mode 100644 Documentation/hwmon/isl28022.rst
 create mode 100644 Documentation/hwmon/nct7363.rst
 create mode 100644 drivers/hwmon/isl28022.c
 create mode 100644 drivers/hwmon/nct7363.c
 delete mode 100644 include/linux/platform_data/max6639.h

.
Subject: [PATCH v3 0/1] riscv: dts: starfive: jh7110-milkv-mars: enable usb0 host function
From: E Shattow <e@freeshell.de>
To: Jisheng Zhang <jszhang@kernel.org>
Cc: E Shattow <e@freeshell.de>,
	Conor Dooley <conor@kernel.org>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv@lists.infradead.org,
	devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Date: Sun, 17 Nov 2024 19:45:07 -0800

.
Subject: [PATCH v1 0/1] riscv: dts: starfive: jh7110-pine64-star64: enable usb0 host function
From: E Shattow <e@freeshell.de>
To: Henry Bell <dmoo_dv@protonmail.com>
Cc: E Shattow <e@freeshell.de>,
	Emil Renner Berthing <kernel@esmil.dk>,
	Conor Dooley <conor@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv@lists.infradead.org,
	devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Date: Sun, 17 Nov 2024 20:02:09 -0800

.
Subject: [PATCH v3] sched: Don't try to catch up excess steal time.
From: Suleiman Souhlal <suleiman@google.com>
To: Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org>, 
	Juri Lelli <juri.lelli@redhat.com>, Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>, Steven Rostedt <rostedt@goodmis.org>, 
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>, 
	Valentin Schneider <vschneid@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, seanjc@google.com, 
	Srikar Dronamraju <srikar@linux.ibm.com>, David Woodhouse <dwmw2@infradead.org>, joelaf@google.com, 
	vineethrp@google.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, 
	ssouhlal@freebsd.org, Suleiman Souhlal <suleiman@google.com>
Date: Mon, 18 Nov 2024 13:37:45 +0900

.
Subject: [syzbot] [netfs?] WARNING in netfs_writepages
From: syzbot <syzbot+06023121b0153752a3d3@syzkaller.appspotmail.com>
To: dhowells@redhat.com, jlayton@kernel.org, linux-fsdevel@vger.kernel.org, 
	linux-kernel@vger.kernel.org, netfs@lists.linux.dev, 
	syzkaller-bugs@googlegroups.com
Date: Sun, 17 Nov 2024 20:34:21 -0800

.
Subject: KASAN: wild-memory-access in dqput.part.0
From: "Bai, Shuangpeng" <SJB7183@PSU.EDU>
To: "jack@suse.com" <jack@suse.com>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 04:32:38 +0000

.
Subject: [PATCHv2,sound-next] ASoC: rockchip: i2s-tdm: Fix a useless call issue
From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: frattaroli.nicolas@gmail.com,
	linux-rockchip@lists.infradead.org
Cc: lgirdwood@gmail.com,
	broonie@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	heiko@sntech.de,
	linux-sound@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Date: Mon, 18 Nov 2024 10:26:05 +0530

.
Subject: [PATCH v2 0/4] Add i.MX91 platform support
From: Pengfei Li <pengfei.li_1@nxp.com>
To: robh@kernel.org,
	krzk+dt@kernel.org,
	conor+dt@kernel.org,
	shawnguo@kernel.org,
	s.hauer@pengutronix.de,
	catalin.marinas@arm.com,
	will@kernel.org,
	kernel@pengutronix.de,
	festevam@gmail.com
Cc: francesco.dolcini@toradex.com,
	joao.goncalves@toradex.com,
	marex@denx.de,
	hvilleneuve@dimonoff.com,
	peng.fan@nxp.com,
	hiago.franco@toradex.com,
	frieder.schrempf@kontron.de,
	alexander.stein@ew.tq-group.com,
	mwalle@kernel.org,
	m.othacehe@gmail.com,
	Max.Merchel@ew.tq-group.com,
	tharvey@gateworks.com,
	quic_bjorande@quicinc.com,
	geert+renesas@glider.be,
	dmitry.baryshkov@linaro.org,
	konradybcio@kernel.org,
	neil.armstrong@linaro.org,
	arnd@arndb.de,
	nfraprado@collabora.com,
	devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	ping.bai@nxp.com,
	ye.li@nxp.com,
	aisheng.dong@nxp.com,
	frank.li@nxp.com
Date: Mon, 18 Nov 2024 13:15:37 +0800

.
Subject: [PATCH 4.19.y] m68k: Add missing mmap_read_lock() to sys_cacheflush()
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Liam Howlett <liam.howlett@oracle.com>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:22:48 +1100

.
Subject: [PATCH 5.4.y] m68k: Add missing mmap_read_lock() to sys_cacheflush()
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Liam Howlett <liam.howlett@oracle.com>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:23:16 +1100

.
Subject: [PATCH 4.19.y] m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Al Viro <viro@zeniv.linux.org.uk>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:26:49 +1100

.
Subject: [PATCH 5.4.y] m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Al Viro <viro@zeniv.linux.org.uk>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:27:03 +1100

.
Subject: [PATCH v1] perf test: Correct hwmon test PMU detection
From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, 
	Arnaldo Carvalho de Melo <acme@kernel.org>, Namhyung Kim <namhyung@kernel.org>, 
	Mark Rutland <mark.rutland@arm.com>, 
	Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, 
	Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, 
	Kan Liang <kan.liang@linux.intel.com>, linux-perf-users@vger.kernel.org, 
	linux-kernel@vger.kernel.org
Date: Sun, 17 Nov 2024 21:26:38 -0800

.
Subject: [PATCH 5.10.y] m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Al Viro <viro@zeniv.linux.org.uk>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:27:18 +1100

.
Subject: [PATCH v4 0/6] Enable IPQ5424 USB support
From: Varadarajan Narayanan <quic_varada@quicinc.com>
To: <vkoul@kernel.org>, <kishon@kernel.org>, <robh@kernel.org>,
        <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
        <gregkh@linuxfoundation.org>, <andersson@kernel.org>,
        <konradybcio@kernel.org>, <dmitry.baryshkov@linaro.org>,
        <mantas@8devices.com>, <manivannan.sadhasivam@linaro.org>,
        <abel.vesa@linaro.org>, <quic_kriskura@quicinc.com>,
        <quic_rohiagar@quicinc.com>, <quic_kbajaj@quicinc.com>,
        <quic_varada@quicinc.com>, <quic_wcheng@quicinc.com>,
        <linux-arm-msm@vger.kernel.org>, <linux-phy@lists.infradead.org>,
        <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
        <linux-usb@vger.kernel.org>
Date: Mon, 18 Nov 2024 10:58:33 +0530

.
Subject: [GIT PULL] probes: Updates for v6.13
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jinjie Ruan <ruanjinjie@huawei.com>, Masami Hiramatsu (Google)
 <mhiramat@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Steven
 Rostedt <rostedt@goodmis.org>, Masami Hiramatsu <mhiramat@kernel.org>,
 linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 14:30:16 +0900

Hi Linus,

Probes update for v6.13:

Kprobes cleanups. Functionality does not change.
- kprobes: Cleanup the config comment
  Adjust #endif comments.
- kprobes: Cleanup collect_one_slot() and __disable_kprobe()
  Make fail fast to reduce code nested level.
- kprobes: Use struct_size() in __get_insn_slot()
  Use struct_size() to avoid special macro.
- x86/kprobes: Cleanup kprobes on ftrace code
  Use macro instead of direct field access/magic number, and avoid
  redundant instruction pointer setting.


Please pull the latest probes-v6.13 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes-v6.13

Tag SHA1: 5d620f418ef869a7cdceb38cd32bb7422cb6ae0e
Head SHA1: 4638d7ebeff5a741e22139cf00aaa9db0f668a8c


Jinjie Ruan (2):
      kprobes: Cleanup the config comment
      kprobes: Cleanup collect_one_slot() and __disable_kprobe()

Masami Hiramatsu (Google) (1):
      x86/kprobes: Cleanup kprobes on ftrace code

Nathan Chancellor (1):
      kprobes: Use struct_size() in __get_insn_slot()

----
 arch/x86/kernel/kprobes/ftrace.c | 19 +++++----
 kernel/kprobes.c                 | 91 +++++++++++++++++++---------------------
 2 files changed, 55 insertions(+), 55 deletions(-)

-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

.
Subject: [PATCH 0/2] arm64: dts: ti: introduce basic support for the AM62L
From: Bryan Brattlof <bb@ti.com>
To: Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
        Tero
 Kristo <kristo@kernel.org>, Rob Herring <robh@kernel.org>,
        Krzysztof
 Kozlowski <krzk+dt@kernel.org>,
        Conor Dooley <conor+dt@kernel.org>
Date: Sun, 17 Nov 2024 23:34:06 -0600

.
Subject: [PATCH 4.19.y] signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Eric W. Biederman <ebiederm@xmission.com>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:40:05 +1100

.
Subject: [PATCH 5.4.y] signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Eric W. Biederman <ebiederm@xmission.com>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:40:20 +1100

.
Subject: [PATCH 5.10.y] signal/m68k: Use force_sigsegv(SIGSEGV) in fpsp040_die
From: Finn Thain <fthain@linux-m68k.org>
To: stable@kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Eric W. Biederman <ebiederm@xmission.com>, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:40:41 +1100

.
Subject: [PATCH] overflow: improve size_add/mul for 32bit systems
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Kees Cook <kees@kernel.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 09:09:28 +0300

.
Subject: [PATCH v3] PCI: dwc: Clean up some unnecessary codes in dw_pcie_suspend_noirq()
From: Richard Zhu <hongxing.zhu@nxp.com>
To: jingoohan1@gmail.com,
	bhelgaas@google.com,
	lpieralisi@kernel.org,
	kw@linux.com,
	manivannan.sadhasivam@linaro.org,
	robh@kernel.org,
	frank.li@nxp.com
Cc: imx@lists.linux.dev,
	kernel@pengutronix.de,
	linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Richard Zhu <hongxing.zhu@nxp.com>
Date: Mon, 18 Nov 2024 13:44:47 +0800

.
Subject: [PATCH v12 0/9] iommu/amd: Use 128-bit cmpxchg operation to update DTE
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: <linux-kernel@vger.kernel.org>, <iommu@lists.linux.dev>
Date: Mon, 18 Nov 2024 05:49:28 +0000

.
Subject: [net-next v2 0/7] Add Aspeed G7 FTGMAC100 support
From: Jacky Chou <jacky_chou@aspeedtech.com>
To: <andrew+netdev@lunn.ch>, <davem@davemloft.net>, <edumazet@google.com>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <robh@kernel.org>,
	<krzk+dt@kernel.org>, <conor+dt@kernel.org>, <p.zabel@pengutronix.de>,
	<netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 14:02:00 +0800

.
Subject: [PATCH] netfs: silence an uninitialized variable warning
From: Dan Carpenter <dan.carpenter@linaro.org>
To: David Howells <dhowells@redhat.com>
Cc: Jeff Layton <jlayton@kernel.org>, netfs@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Date: Mon, 18 Nov 2024 09:08:19 +0300

.
Subject: [PATCH 0/2] Update location of the media tree
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: 
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org
Date: Mon, 18 Nov 2024 07:09:17 +0100

.
Subject: [syzbot] [xfs?] possible deadlock in xfs_ilock (3)
From: syzbot <syzbot+b143b25b374fbc5c3a04@syzkaller.appspotmail.com>
To: cem@kernel.org, chandan.babu@oracle.com, djwong@kernel.org, 
	linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Sun, 17 Nov 2024 22:10:24 -0800

.
Subject: [PATCH v3 0/2] hwmon: (core) Avoid ifdef CONFIG_THERMAL in C
 source file
From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net>
To: Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, 
 "Rafael J. Wysocki" <rafael@kernel.org>, 
 Daniel Lezcano <daniel.lezcano@linaro.org>, Zhang Rui <rui.zhang@intel.com>, 
 Lukasz Luba <lukasz.luba@arm.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, 
 linux-pm@vger.kernel.org, 
 =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net>
Date: Mon, 18 Nov 2024 07:15:57 +0100

.
Subject: [syzbot] [perf?] INFO: task hung in _free_event
From: syzbot <syzbot+3c4321e10eea460eb606@syzkaller.appspotmail.com>
To: acme@kernel.org, adrian.hunter@intel.com, 
	alexander.shishkin@linux.intel.com, irogers@google.com, jolsa@kernel.org, 
	kan.liang@linux.intel.com, linux-kernel@vger.kernel.org, 
	linux-perf-users@vger.kernel.org, mark.rutland@arm.com, mingo@redhat.com, 
	namhyung@kernel.org, peterz@infradead.org, syzkaller-bugs@googlegroups.com
Date: Sun, 17 Nov 2024 22:32:21 -0800

.
Subject: [PATCH v3 0/2] Documentation: Debugging guide
From: Sebastian Fricke <sebastian.fricke@collabora.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: rdunlap@infradead.org, linux-doc@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
 laurent.pinchart@ideasonboard.com, hverkuil-cisco@xs4all.nl,
 mchehab@kernel.org, kernel@collabora.com, bob.beckett@collabora.com,
 nicolas.dufresne@collabora.com,
 Sebastian Fricke <sebastian.fricke@collabora.com>
Date: Mon, 18 Nov 2024 08:03:50 +0100

.
Subject: [PATCH] platform/x86: panasonic-laptop: Return errno correctly in show callback
From: Yao Zi <ziyao@disroot.org>
To: Kenneth Chan <kenneth.t.chan@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	=?UTF-8?q?Ilpo=20J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org (open list:PANASONIC LAPTOP ACPI EXTRAS DRIVER),
	linux-kernel@vger.kernel.org (open list),
	Yao Zi <ziyao@disroot.org>
Date: Mon, 18 Nov 2024 06:46:39 +0000

.
Subject: [PATCH v3] f2fs: replace deprecated strcpy with strscpy
From: Daniel Yang <danielyangkang@gmail.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
	Chao Yu <chao@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net (open list:F2FS FILE SYSTEM),
	linux-kernel@vger.kernel.org (open list)
Cc: Daniel Yang <danielyangkang@gmail.com>
Date: Sun, 17 Nov 2024 23:01:40 -0800

.
Subject: [PATCH v4 0/2] Drivers: hv: vmbus: Wait for boot-time offers and log missing offers
From: Naman Jain <namjain@linux.microsoft.com>
To: "K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>
Cc: linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Naman Jain <namjain@linux.microsoft.com>,
	John Starks <jostarks@microsoft.com>,
	jacob.pan@linux.microsoft.com,
	Easwar Hariharan <eahariha@linux.microsoft.com>,
	Michael Kelley <mhklinux@outlook.com>,
	Saurabh Singh Sengar <ssengar@linux.microsoft.com>
Date: Sun, 17 Nov 2024 23:07:23 -0800

.
Subject: [PATCH] nvme-pci: Shutdown the device if D3Cold is allowed by the user
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: kbusch@kernel.org,
	axboe@kernel.dk,
	hch@lst.de,
	sagi@grimberg.me
Cc: linux-nvme@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org,
	andersson@kernel.org,
	konradybcio@kernel.org,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Date: Mon, 18 Nov 2024 13:53:44 +0530

.
Subject: [PATCH v3] drm/bridge: adv7511_audio: Update Audio InfoFrame
 properly
From: Stefan Ekenberg <stefan.ekenberg@axis.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong
	<neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Laurent Pinchart
	<Laurent.pinchart@ideasonboard.com>, Jonas Karlman <jonas@kwiboo.se>, "Jernej
 Skrabec" <jernej.skrabec@gmail.com>, Maarten Lankhorst
	<maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>
Date: Mon, 18 Nov 2024 09:03:33 +0100

.
Subject: [paulmck-rcu:dev.2024.11.14a] BUILD SUCCESS
 296b366973ed47a5d8ced65fc28a5a04255be7d1
From: kernel test robot <lkp@intel.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:20:35 +0800

.
Subject: [paulmck-rcu:dev] BUILD SUCCESS
 9861a4952a3a33d834b9fa5e5e8075cb9531dd99
From: kernel test robot <lkp@intel.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 16:20:56 +0800

.
Subject: [PATCH 0/5] pci: qcom: Add QCS615 PCIe support
From: Ziyue Zhang <quic_ziyuzhan@quicinc.com>
To: vkoul@kernel.org, kishon@kernel.org, robh+dt@kernel.org,
        manivannan.sadhasivam@linaro.org, bhelgaas@google.com, kw@linux.com,
        lpieralisi@kernel.org, quic_qianyu@quicinc.com, conor+dt@kernel.org,
        neil.armstrong@linaro.org, andersson@kernel.org,
        konradybcio@kernel.org
Cc: quic_shashim@quicinc.com, quic_kaushalk@quicinc.com, quic_tdas@quicinc.com,
        quic_tingweiz@quicinc.com, quic_aiquny@quicinc.com, kernel@quicinc.com,
        linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
        linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org,
        Ziyue Zhang <quic_ziyuzhan@quicinc.com>,
        Krishna chaitanya chundru <quic_krichai@quicinc.com>
Date: Mon, 18 Nov 2024 16:26:14 +0800

.
Subject: [PATCH net-next 0/2] Add support for AXI 2.5G ethernet
From: Suraj Gupta <suraj.gupta2@amd.com>
To: <andrew+netdev@lunn.ch>, <davem@davemloft.net>, <edumazet@google.com>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <michal.simek@amd.com>,
	<sean.anderson@linux.dev>, <radhey.shyam.pandey@amd.com>, <horms@kernel.org>
Date: Mon, 18 Nov 2024 13:48:20 +0530

.
Subject: [PATCH media-next] media: rkisp1: Fix unused value issue
From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: dafna@fastmail.com,
	laurent.pinchart@ideasonboard.com,
	linux-media@vger.kernel.org
Cc: mchehab@kernel.org,
	heiko@sntech.de,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Date: Mon, 18 Nov 2024 13:57:49 +0530

.
Subject: linux-next: build warning after merge of the usb tree
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Greg KH <greg@kroah.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thinh Nguyen
 <Thinh.Nguyen@synopsys.com>, Linux Kernel Mailing List
 <linux-kernel@vger.kernel.org>, Linux Next Mailing List
 <linux-next@vger.kernel.org>
Date: Mon, 18 Nov 2024 19:40:06 +1100

.
Subject: [PATCH v1 0/4] Add debugfs support for fastrpc driver
From: Ekansh Gupta <quic_ekangupt@quicinc.com>
To: <srinivas.kandagatla@linaro.org>, <linux-arm-msm@vger.kernel.org>
Date: Mon, 18 Nov 2024 14:10:42 +0530

.
Subject: [PATCH] riscv: Fix sleeping in invalid context in die()
From: Nam Cao <namcao@linutronix.de>
To: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	=?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= <bjorn@rivosinc.com>,
	Nam Cao <namcao@linutronix.de>,
	Andreas Schwab <schwab@suse.de>,
	Song Shuai <songshuaishuai@tinylab.org>,
	Celeste Liu <coelacanthushex@gmail.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Date: Mon, 18 Nov 2024 10:13:33 +0100

.
Subject: [RFC PATCH] vfs: dodge strlen() in vfs_readlink() when ->i_link is populated
From: Mateusz Guzik <mjguzik@gmail.com>
To: brauner@kernel.org
Cc: viro@zeniv.linux.org.uk,
	jack@suse.cz,
	linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	Mateusz Guzik <mjguzik@gmail.com>
Date: Mon, 18 Nov 2024 09:53:57 +0100

.
Subject: linux-next: Tree for Nov 18
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linux Next Mailing List <linux-next@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 19:53:57 +1100

.
Subject: [PATCH v2] bluetooth: add quirk using packet size 60
From: Hilda Wu <hildawu@realtek.com>
To: <marcel@holtmann.org>
Date: Mon, 18 Nov 2024 16:57:57 +0800

.
Subject: [PATCH] iio: adc: ti-ads1298: Add NULL check in ads1298_init
From: Charles Han <hanchunchao@inspur.com>
To: <mike.looijmans@topic.nl>, <jic23@kernel.org>, <lars@metafoo.de>,
	<dan.carpenter@linaro.org>, <nuno.sa@analog.com>,
	<andriy.shevchenko@linux.intel.com>, <viro@zeniv.linux.org.uk>,
	<yujiaoliang@vivo.com>
Date: Mon, 18 Nov 2024 17:02:08 +0800

.
Subject: [GIT PULL] MIPS changes for v6.13
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: torvalds@linux-foundation.org
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 10:02:56 +0100

The following changes since commit 81983758430957d9a5cb3333fe324fd70cf63e7e:

  Linux 6.12-rc5 (2024-10-27 12:52:02 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/ tags/mips_6.13

for you to fetch changes up to 56131e6d1fcce8e7359a2445711cc1a4ddb8325c:

  mips: dts: realtek: Add I2C controllers (2024-11-12 15:51:21 +0100)

----------------------------------------------------------------
just cleanups and fixes

----------------------------------------------------------------
Chris Packham (2):
      mips: dts: realtek: Add syscon-reboot node
      mips: dts: realtek: Add I2C controllers

Christian Marangi (1):
      mips: bmips: bcm6358/6368: define required brcm,bmips-cbr-reg

Gregory CLEMENT (2):
      MIPS: Allow using more than 32-bit addresses for reset vectors when possible
      MIPS: mobileye: eyeq6h-epm6: Use eyeq6h in the board device tree

Jonas Gorski (1):
      mips: asm: fix warning when disabling MIPS_FP_SUPPORT

Maciej W. Rozycki (2):
      MAINTAINERS: Retire Ralf Baechle
      MAINTAINERS: Remove linux-mips.org references

Paulo Miguel Almeida (1):
      mips: sgi-ip22: Replace "s[n]?printf" with sysfs_emit in sysfs callbacks

Thorsten Blum (1):
      MIPS: kernel: proc: Use str_yes_no() helper function

WangYuli (2):
      MIPS: loongson3_defconfig: Update configs dependencies
      MIPS: loongson3_defconfig: Enable blk_dev_nvme by default

zhang jiao (1):
      TC: Fix the wrong format specifier

 .get_maintainer.ignore                             |  1 +
 CREDITS                                            |  5 +++
 MAINTAINERS                                        | 17 +++-----
 arch/mips/boot/dts/brcm/bcm6358.dtsi               |  1 +
 arch/mips/boot/dts/brcm/bcm6368.dtsi               |  1 +
 arch/mips/boot/dts/mobileye/eyeq6h-epm6.dts        |  2 +-
 .../dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts |  2 +-
 arch/mips/boot/dts/realtek/rtl9302c.dtsi           | 15 +++++++
 arch/mips/boot/dts/realtek/rtl930x.dtsi            | 29 ++++++++++++++
 arch/mips/configs/loongson3_defconfig              | 32 +++++----------
 arch/mips/include/asm/mips-cm.h                    |  2 +
 arch/mips/include/asm/switch_to.h                  |  2 +-
 arch/mips/kernel/proc.c                            | 17 ++++----
 arch/mips/kernel/smp-cps.c                         | 46 ++++++++++++++++++----
 arch/mips/sgi-ip22/ip22-gio.c                      |  7 ++--
 drivers/tc/tc.c                                    |  2 +-
 16 files changed, 123 insertions(+), 58 deletions(-)
 create mode 100644 arch/mips/boot/dts/realtek/rtl9302c.dtsi

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

.
Subject: [GIT PULL] locking changes for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>, Will Deacon <will@kernel.org>,
	Waiman Long <longman@redhat.com>, Boqun Feng <boqun.feng@gmail.com>,
	Borislav Petkov <bp@alien8.de>
Date: Mon, 18 Nov 2024 10:03:40 +0100

Linus,

Please pull the latest locking/core Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-core-2024-11-18

   # HEAD: 3b49a347d751553b1d1be69c8619ae2e85fdc28d locking/Documentation: Fix grammar in percpu-rw-semaphore.rst

Locking changes for v6.13 are:

 - lockdep:
    - Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING (Sebastian Andrzej Siewior)
    - Add lockdep_cleanup_dead_cpu() (David Woodhouse)

 - futexes:
    - Use atomic64_inc_return() in get_inode_sequence_number() (Uros Bizjak)
    - Use atomic64_try_cmpxchg_relaxed() in get_inode_sequence_number() (Uros Bizjak)

 - RT locking:
    - Add sparse annotation PREEMPT_RT's locking (Sebastian Andrzej Siewior)

 - spinlocks:
    - Use atomic_try_cmpxchg_release() in osq_unlock() (Uros Bizjak)

 - atomics:
    - x86: Use ALT_OUTPUT_SP() for __alternative_atomic64() (Uros Bizjak)
    - x86: Use ALT_OUTPUT_SP() for __arch_{,try_}cmpxchg64_emu() (Uros Bizjak)

 - KCSAN, seqlocks:
    - Support seqcount_latch_t (Marco Elver)

 - <linux/cleanup.h>:
    - Add if_not_cond_guard() conditional guard helper (David Lechner)
    - Adjust scoped_guard() macros to avoid potential warning (Przemek Kitszel)
    - Remove address space of returned pointer (Uros Bizjak)

 - WW mutexes:
    - locking/ww_mutex: Adjust to lockdep nest_lock requirements (Thomas Hellström)

 - Rust integration:
    - Fix raw_spin_lock initialization on PREEMPT_RT (Eder Zulian)

 - miscellaneous cleanups & fixes:
    - lockdep: Fix wait-type check related warnings (Ahmed Ehab)
    - lockdep: Use info level for initial info messages (Jiri Slaby)
    - spinlocks: Make __raw_* lock ops static (Geert Uytterhoeven)
    - pvqspinlock: Convert fields of 'enum vcpu_state' to uppercase (Qiuxu Zhuo)
    - iio: magnetometer: Fix if () scoped_guard() formatting (Stephen Rothwell)
    - rtmutex: Fix misleading comment (Peter Zijlstra)
    - percpu-rw-semaphores: Fix grammar in percpu-rw-semaphore.rst (Xiu Jianfeng)

 Thanks,

	Ingo

------------------>
Ahmed Ehab (2):
      locking/lockdep: Avoid creating new name string literals in lockdep_set_subclass()
      locking/lockdep: Add a test for lockdep_set_subclass()

David Lechner (1):
      cleanup: Add conditional guard helper

David Woodhouse (1):
      lockdep: Add lockdep_cleanup_dead_cpu()

Eder Zulian (1):
      rust: helpers: Avoid raw_spin_lock initialization for PREEMPT_RT

Geert Uytterhoeven (1):
      locking/spinlocks: Make __raw_* lock ops static

Jiri Slaby (SUSE) (1):
      lockdep: Use info level for lockdep initial info messages

Marco Elver (5):
      time/sched_clock: Swap update_clock_read_data() latch writes
      time/sched_clock: Broaden sched_clock()'s instrumentation coverage
      kcsan, seqlock: Support seqcount_latch_t
      seqlock, treewide: Switch to non-raw seqcount_latch interface
      kcsan, seqlock: Fix incorrect assumption in read_seqbegin()

Peter Zijlstra (1):
      locking/rtmutex: Fix misleading comment

Przemek Kitszel (1):
      cleanup: Adjust scoped_guard() macros to avoid potential warning

Qiuxu Zhuo (1):
      locking/pvqspinlock: Convert fields of 'enum vcpu_state' to uppercase

Sebastian Andrzej Siewior (5):
      lockdep: Enable PROVE_RAW_LOCK_NESTING with PROVE_LOCKING.
      locking/rt: Add sparse annotation PREEMPT_RT's sleeping locks.
      locking/rt: Remove one __cond_lock() in RT's spin_trylock_irqsave()
      locking/rt: Add sparse annotation for RCU.
      locking/rt: Annotate unlock followed by lock for sparse.

Stephen Rothwell (1):
      iio: magnetometer: fix if () scoped_guard() formatting

Thomas Hellström (1):
      locking/ww_mutex: Adjust to lockdep nest_lock requirements

Uros Bizjak (6):
      futex: Use atomic64_inc_return() in get_inode_sequence_number()
      futex: Use atomic64_try_cmpxchg_relaxed() in get_inode_sequence_number()
      cleanup: Remove address space of returned pointer
      locking/osq_lock: Use atomic_try_cmpxchg_release() in osq_unlock()
      locking/atomic/x86: Use ALT_OUTPUT_SP() for __alternative_atomic64()
      locking/atomic/x86: Use ALT_OUTPUT_SP() for __arch_{,try_}cmpxchg64_emu()

Xiu Jianfeng (1):
      locking/Documentation: Fix grammar in percpu-rw-semaphore.rst


 Documentation/locking/percpu-rw-semaphore.rst |  4 +-
 Documentation/locking/seqlock.rst             |  2 +-
 arch/x86/include/asm/atomic64_32.h            |  3 +-
 arch/x86/include/asm/cmpxchg_32.h             |  6 +-
 arch/x86/kernel/tsc.c                         |  5 +-
 drivers/iio/magnetometer/af8133j.c            |  3 +-
 include/linux/cleanup.h                       | 69 ++++++++++++++++---
 include/linux/irqflags.h                      |  6 ++
 include/linux/lockdep.h                       |  2 +-
 include/linux/rbtree_latch.h                  | 20 +++---
 include/linux/rwlock_rt.h                     | 10 +--
 include/linux/seqlock.h                       | 98 ++++++++++++++++++++-------
 include/linux/spinlock_rt.h                   | 28 ++++----
 include/linux/ww_mutex.h                      | 14 ++++
 kernel/cpu.c                                  |  1 +
 kernel/futex/core.c                           |  6 +-
 kernel/locking/lockdep.c                      | 46 ++++++++++---
 kernel/locking/osq_lock.c                     |  3 +-
 kernel/locking/qspinlock_paravirt.h           | 36 +++++-----
 kernel/locking/rtmutex.c                      |  2 +
 kernel/locking/rtmutex_api.c                  |  8 +--
 kernel/locking/spinlock.c                     |  8 +--
 kernel/locking/spinlock_rt.c                  | 14 ++--
 kernel/locking/test-ww_mutex.c                |  8 ++-
 kernel/printk/printk.c                        |  9 +--
 kernel/time/sched_clock.c                     | 34 +++++++---
 kernel/time/timekeeping.c                     | 12 ++--
 lib/Kconfig.debug                             | 12 +---
 lib/locking-selftest.c                        | 39 +++++++++++
 rust/helpers/spinlock.c                       |  8 ++-
 30 files changed, 355 insertions(+), 161 deletions(-)

.
Subject: [GIT PULL] KCSAN updates for v6.13
From: Marco Elver <elver@google.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	Dmitry Vyukov <dvyukov@google.com>, kasan-dev@googlegroups.com,
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 10:23:28 +0100

Linus,

Please pull the below KCSAN updates for v6.13.

Many thanks,
-- Marco

------ >8 ------

The following changes since commit 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b:

  Linux 6.12-rc2 (2024-10-06 15:32:27 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git tags/kcsan-20241112-v6.13-rc1

for you to fetch changes up to b86f7c9fad06b960f3ac5594cb3838a7eaeb1892:

  kcsan: Remove redundant call of kallsyms_lookup_name() (2024-10-14 16:44:56 +0200)

----------------------------------------------------------------
Kernel Concurrency Sanitizer (KCSAN) updates for v6.13

- Fixes to make KCSAN compatible with PREEMPT_RT

- Minor cleanups

All changes have been in linux-next for the past 4 weeks.

----------------------------------------------------------------
Marco Elver (1):
      kcsan: Turn report_filterlist_lock into a raw_spinlock

Ran Xiaokai (1):
      kcsan: Remove redundant call of kallsyms_lookup_name()

 kernel/kcsan/debugfs.c | 77 ++++++++++++++++++++++++--------------------------
 1 file changed, 37 insertions(+), 40 deletions(-)

.
Subject: [PATCH v2 1/1] gpio: zevio: Add missed label initialisation
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Date: Mon, 18 Nov 2024 11:27:07 +0200

.
Subject: [PATCH 0/3] Introduce new driver cros-ec-charge-state
From: "Sung-Chi, Li" <lschyi@chromium.org>
To: Benson Leung <bleung@chromium.org>, Tzung-Bi Shih <tzungbi@kernel.org>, 
 Guenter Roeck <groeck@chromium.org>, Rob Herring <robh@kernel.org>, 
 Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>
Cc: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, 
 devicetree@vger.kernel.org
Date: Mon, 18 Nov 2024 17:33:45 +0800

.
Subject: [PATCH v2 media-next] media: rkisp1: Fix unused value issue
From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: dafna@fastmail.com,
	laurent.pinchart@ideasonboard.com,
	linux-media@vger.kernel.org
Cc: mchehab@kernel.org,
	heiko@sntech.de,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Date: Mon, 18 Nov 2024 15:07:21 +0530

.
Subject: [PATCH v2] sched/topology: Enable topology_span_sane check only for debug builds
From: Saurabh Sengar <ssengar@linux.microsoft.com>
To: mingo@redhat.com,
	peterz@infradead.org,
	juri.lelli@redhat.com,
	vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com,
	rostedt@goodmis.org,
	bsegall@google.com,
	mgorman@suse.de,
	vschneid@redhat.com,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org,
	ssengar@microsoft.com,
	srivatsa@csail.mit.edu
Date: Mon, 18 Nov 2024 01:39:37 -0800

.
Subject: [GIT PULL] Power management updates for v6.13-rc1
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux PM <linux-pm@vger.kernel.org>, 
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, 
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Date: Mon, 18 Nov 2024 11:22:04 +0100

Hi Linus,

Please pull from the tag

 git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
 pm-6.13-rc1

with top-most commit c6e2a4c9eed5249c4158bc621882d44e94af3371

 Merge branch 'pm-tools'

on top of commit 1a1030d10a6335bb5e6cdb24fc9388d3d9bcc1ac

 cpufreq: intel_pstate: Rearrange locking in hybrid_init_cpu_capacity_scali=
ng()

to receive power management updates for 6.13-rc1.

The amd-pstate cpufreq driver gets the majority of changes this time.
They are mostly fixes and cleanups, but one of them causes it to become
the default cpufreq driver on some AMD server platforms.

Apart from that, the menu cpuidle governor is modified to not use iowait
any more, the intel_idle gets a custom C-states table for Granite Rapids
Xeon D, and the intel_pstate driver will use a more aggressive Balance-
performance default EPP value on Granite Rapids now.

There are also some fixes, cleanups and tooling updates.

Specifics:

 - Update the amd-pstate driver to set the initial scaling frequency
   policy lower bound to be the lowest non-linear frequency (Dhananjay
   Ugwekar).

 - Enable amd-pstate by default on servers starting with newer AMD Epyc
   processors (Swapnil Sapkal).

 - Align more codepaths between shared memory and MSR designs in
   amd-pstate (Dhananjay Ugwekar).

 - Clean up amd-pstate code to rename functions and remove redundant
   calls (Dhananjay Ugwekar, Mario Limonciello).

 - Do other assorted fixes and cleanups in amd-pstate (Dhananjay Ugwekar
   and Mario Limonciello).

 - Change the Balance-performance EPP value for Granite Rapids in the
   intel_pstate driver to a more performance-biased one (Srinivas
   Pandruvada).

 - Simplify MSR read on the boot CPU in the ACPI cpufreq driver (Chang
   S. Bae).

 - Ensure sugov_eas_rebuild_sd() is always called when sugov_init()
   succeeds to always enforce sched domains rebuild in case EAS needs
   to be enabled (Christian Loehle).

 - Switch cpufreq back to platform_driver::remove() (Uwe Kleine-K=C3=B6nig)=
.

 - Use proper frequency unit names in cpufreq (Marcin Juszkiewicz).

 - Add a built-in idle states table for Granite Rapids Xeon D to the
   intel_idle driver (Artem Bityutskiy).

 - Fix some typos in comments in the cpuidle core and drivers (Shen
   Lichuan).

 - Remove iowait influence from the menu cpuidle governor (Christian
   Loehle).

 - Add min/max available performance state limits to the Energy Model
   management code (Lukasz Luba).

 - Update pm-graph to v5.13 (Todd Brandt).

 - Add documentation for some recently introduced cpupower utility
   options (Tor Vic).

 - Make cpupower inform users where cpufreq-bench.conf should be located
   when opening it fails (Peng Fan).

 - Allow overriding cross-compiling env params in cpupower (Peng Fan).

 - Add compile_commands.json to .gitignore in cpupower (John B. Wyatt
   IV).

 - Improve disable c_state block in cpupower bindings and add a test to
   confirm that CPU state is disabled to it (John B. Wyatt IV).

 - Add Chinese Simplified translation to cpupower (Kieran Moy).

 - Add checks for xgettext and msgfmt to cpupower (Siddharth Menon).

Thanks!


---------------

Artem Bityutskiy (1):
      intel_idle: add Granite Rapids Xeon D support

Chang S. Bae (1):
      cpufreq: ACPI: Simplify MSR read on the boot CPU

Christian Loehle (2):
      cpuidle: menu: Remove iowait influence
      sched/cpufreq: Ensure sd is rebuilt for EAS check

Dhananjay Ugwekar (11):
      cpufreq/amd-pstate: Rename MSR and shared memory specific functions
      cpufreq/amd-pstate: Remove the redundant verify() function
      cpufreq/amd-pstate: Set the initial min_freq to lowest_nonlinear_freq
      cpufreq/amd-pstate: Call amd_pstate_register() in amd_pstate_init()
      cpufreq/amd-pstate: Call amd_pstate_set_driver() in
amd_pstate_register_driver()
      cpufreq/amd-pstate: Remove the switch case in amd_pstate_init()
      cpufreq/amd-pstate: Remove the redundant amd_pstate_set_driver() call
      cpufreq/amd-pstate: Rename functions that enable CPPC
      cpufreq/amd-pstate: Do not attempt to clear MSR_AMD_CPPC_ENABLE
      cpufreq/amd-pstate: Call cppc_set_epp_perf in the reenable function
      cpufreq/amd-pstate: Align offline flow of shared memory and MSR
based systems

Gautham R. Shenoy (1):
      amd-pstate: Set min_perf to nominal_perf for active mode performance =
gov

John B. Wyatt IV (3):
      pm: cpupower: gitignore: Add compile_commands.json
      pm: cpupower: bindings: Improve disable c_state block
      pm: cpupower: bindings: Add test to confirm cpu state is disabled

Kieran Moy (1):
      cpupower: Add Chinese Simplified translation

Lukasz Luba (1):
      PM: EM: Add min/max available performance state limits

Marcin Juszkiewicz (1):
      cpufreq: use proper units for frequency

Mario Limonciello (7):
      cpufreq/amd-pstate: Fix non kerneldoc comment
      cpufreq/amd-pstate: Don't update CPPC request in
amd_pstate_cpu_boost_update()
      cpufreq/amd-pstate: Use amd_pstate_update_min_max_limit() for EPP lim=
its
      cpufreq/amd-pstate: Drop needless EPP initialization
      cpufreq/amd-pstate-ut: Add fix for min freq unit test
      cpufreq/amd-pstate: Push adjust_perf vfunc init into cpu_init
      cpufreq/amd-pstate: Move registration after static function call upda=
te

Peng Fan (2):
      pm: cpupower: bench: print config file path when open
cpufreq-bench.conf fails
      pm: cpupower: Makefile: Allow overriding cross-compiling env params

Shen Lichuan (1):
      cpuidle: Correct some typos in comments

Siddharth Menon (1):
      cpupower: add checks for xgettext and msgfmt

Srinivas Pandruvada (1):
      cpufreq: intel_pstate: Update Balance-performance EPP for Granite Rap=
ids

Swapnil Sapkal (1):
      amd-pstate: Switch to amd-pstate by default on some Server platforms

Todd Brandt (1):
      pm-graph v5.13

Tor Vic (1):
      tools/power/cpupower: Add documentation for some recently
introduced options

Uwe Kleine-K=C3=B6nig (1):
      cpufreq: Switch back to struct platform_driver::remove()

---------------

 drivers/cpufreq/acpi-cpufreq.c                     |   9 +-
 drivers/cpufreq/amd-pstate-ut.c                    |   6 +-
 drivers/cpufreq/amd-pstate.c                       | 229 ++---
 drivers/cpufreq/brcmstb-avs-cpufreq.c              |   2 +-
 drivers/cpufreq/cpufreq-dt.c                       |   2 +-
 drivers/cpufreq/cpufreq.c                          |   2 +-
 drivers/cpufreq/davinci-cpufreq.c                  |   2 +-
 drivers/cpufreq/imx-cpufreq-dt.c                   |   2 +-
 drivers/cpufreq/imx6q-cpufreq.c                    |   2 +-
 drivers/cpufreq/intel_pstate.c                     |   2 +
 drivers/cpufreq/kirkwood-cpufreq.c                 |   2 +-
 drivers/cpufreq/loongson3_cpufreq.c                |   2 +-
 drivers/cpufreq/mediatek-cpufreq-hw.c              |   2 +-
 drivers/cpufreq/omap-cpufreq.c                     |   2 +-
 drivers/cpufreq/pcc-cpufreq.c                      |   2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c                  |   2 +-
 drivers/cpufreq/qcom-cpufreq-nvmem.c               |   2 +-
 drivers/cpufreq/qoriq-cpufreq.c                    |   2 +-
 drivers/cpufreq/raspberrypi-cpufreq.c              |   2 +-
 drivers/cpufreq/scpi-cpufreq.c                     |   2 +-
 drivers/cpufreq/sun50i-cpufreq-nvmem.c             |   2 +-
 drivers/cpufreq/tegra186-cpufreq.c                 |   2 +-
 drivers/cpufreq/tegra194-cpufreq.c                 |   2 +-
 drivers/cpufreq/vexpress-spc-cpufreq.c             |   2 +-
 drivers/cpuidle/cpuidle-arm.c                      |   2 +-
 drivers/cpuidle/cpuidle-qcom-spm.c                 |   2 +-
 drivers/cpuidle/cpuidle.c                          |   2 +-
 drivers/cpuidle/driver.c                           |   4 +-
 drivers/cpuidle/governors/menu.c                   |  76 +-
 drivers/idle/intel_idle.c                          |  48 ++
 include/linux/energy_model.h                       |  29 +-
 kernel/power/energy_model.c                        |  52 ++
 kernel/sched/cpufreq_schedutil.c                   |   3 +-
 tools/power/cpupower/.gitignore                    |   3 +
 tools/power/cpupower/Makefile                      |  26 +-
 tools/power/cpupower/bench/parse.c                 |   5 +-
 .../bindings/python/test_raw_pylibcpupower.py      |  28 +-
 tools/power/cpupower/man/cpupower-set.1            |  38 +-
 tools/power/cpupower/po/zh_CN.po                   | 942 +++++++++++++++++=
++++
 tools/power/pm-graph/sleepgraph.8                  |   3 +
 tools/power/pm-graph/sleepgraph.py                 |  59 +-
 41 files changed, 1330 insertions(+), 278 deletions(-)

.
Subject: [GIT PULL] ACPI updates for v6.13-rc1
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>, Linux PM <linux-pm@vger.kernel.org>, 
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 11:25:27 +0100

Hi Linus,

Please pull from the tag

 git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
 acpi-6.13-rc1

with top-most commit d47a60e487fbb65bbbca3d99e59009f0a4acf34d

 Merge branch 'acpi-misc'

on top of commit 2d5404caa8c7bb5c4e0435f94b28834ae5456623

 Linux 6.12-rc7

to receive ACPI updates for 6.13-rc1.

These include a couple of fixes, a new ACPI backlight quirk for Apple
MacbookPro11,2 and Air7,2 and a bunch of cleanups:

 - Fix _CPC register setting issue for registers located in memory in
   the ACPI CPPC library code (Lifeng Zheng).

 - Use DEFINE_SIMPLE_DEV_PM_OPS in the ACPI battery driver, make it use
   devm_ for initializing mutexes and allocating driver data, and make
   it check the register_pm_notifier() return value (Thomas Wei=C3=9Fschuh,
   Andy Shevchenko).

 - Make the ACPI EC driver support compile-time conditional and allow
   ACPI to be built without CONFIG_HAS_IOPORT (Arnd Bergmann).

 - Remove a redundant error check from the pfr_telemetry driver (Colin
   Ian King).

 - Rearrange the processor_perflib code in the ACPI processor driver
   to avoid compiling x86-specific code on other architectures (Arnd
   Bergmann).

 - Add adev NULL check to acpi_quirk_skip_serdev_enumeration() and
   make UART skip quirks work on PCI UARTs without an UID (Hans de
   Goede).

 - Force native backlight handling Apple MacbookPro11,2 and Air7,2 in
   the ACPI video driver (Jonathan Denose).

 - Switch several ACPI platform drivers back to using struct
   platform_driver::remove() (Uwe Kleine-K=C3=B6nig).

 - Replace strcpy() with strscpy() in multiple places in the ACPI
   subsystem (Muhammad Qasim Abdul Majeed, Abdul Rahim).

Thanks!


---------------

Abdul Rahim (1):
      ACPI: thermal: Use strscpy() instead of strcpy()

Andy Shevchenko (1):
      ACPI: battery: Check for error code from devm_mutex_init() call

Arnd Bergmann (3):
      ACPI: EC: make EC support compile-time conditional
      ACPI: processor_perflib: extend X86 dependency
      ACPI: allow building without CONFIG_HAS_IOPORT

Colin Ian King (1):
      ACPI: pfr_telemetry: remove redundant error check on ret

Hans de Goede (2):
      ACPI: x86: Make UART skip quirks work on PCI UARTs without an UID
      ACPI: x86: Add adev NULL check to acpi_quirk_skip_serdev_enumeration(=
)

Jonathan Denose (1):
      ACPI: video: force native for Apple MacbookPro11,2 and Air7,2

Lifeng Zheng (1):
      ACPI: CPPC: Fix _CPC register setting issue

Muhammad Qasim Abdul Majeed (9):
      ACPI: APD: Use strscpy() instead of strcpy()
      ACPI: EC: Use strscpy() instead of strcpy()
      ACPI: event: Use strscpy() instead of strcpy()
      ACPI: pci_link: Use strscpy() instead of strcpy()
      ACPI: pci_root: Use strscpy() instead of strcpy()
      ACPI: power: Use strscpy() instead of strcpy()
      ACPI: SBS: Use strscpy() instead of strcpy()
      ACPI: SBSHC: Use strscpy() instead of strcpy()
      ACPI: scan: Use strscpy() instead of strcpy()

Thomas Wei=C3=9Fschuh (4):
      ACPI: battery: check result of register_pm_notifier()
      ACPI: battery: allocate driver data through devm_ APIs
      ACPI: battery: initialize mutexes through devm_ APIs
      ACPI: battery: use DEFINE_SIMPLE_DEV_PM_OPS

Uwe Kleine-K=C3=B6nig (1):
      ACPI: Switch back to struct platform_driver::remove()

---------------

 drivers/acpi/Kconfig               | 11 ++++++++-
 drivers/acpi/Makefile              |  2 +-
 drivers/acpi/ac.c                  |  2 +-
 drivers/acpi/acpi_apd.c            |  2 +-
 drivers/acpi/acpi_pad.c            |  2 +-
 drivers/acpi/acpi_tad.c            |  2 +-
 drivers/acpi/apei/einj-core.c      |  2 +-
 drivers/acpi/apei/ghes.c           |  2 +-
 drivers/acpi/arm64/agdi.c          |  2 +-
 drivers/acpi/battery.c             | 31 +++++++++++-------------
 drivers/acpi/cppc_acpi.c           |  7 +++---
 drivers/acpi/dptf/dptf_pch_fivr.c  |  2 +-
 drivers/acpi/dptf/dptf_power.c     |  2 +-
 drivers/acpi/ec.c                  |  4 ++--
 drivers/acpi/event.c               |  4 ++--
 drivers/acpi/evged.c               |  2 +-
 drivers/acpi/fan_core.c            |  2 +-
 drivers/acpi/internal.h            | 25 +++++++++++++++++++
 drivers/acpi/osl.c                 | 12 ++++++++++
 drivers/acpi/pci_link.c            |  4 ++--
 drivers/acpi/pci_root.c            |  4 ++--
 drivers/acpi/pfr_telemetry.c       |  5 +---
 drivers/acpi/pfr_update.c          |  2 +-
 drivers/acpi/power.c               |  4 ++--
 drivers/acpi/processor_perflib.c   | 13 ++++------
 drivers/acpi/sbs.c                 |  4 ++--
 drivers/acpi/sbshc.c               | 13 +++-------
 drivers/acpi/scan.c                | 14 +++++------
 drivers/acpi/thermal.c             |  6 ++---
 drivers/acpi/video_detect.c        | 16 +++++++++++++
 drivers/acpi/x86/utils.c           | 49 +++++++++++++++++++++++++++++++---=
----
 drivers/char/Kconfig               |  1 +
 drivers/hwmon/Kconfig              |  3 ++-
 drivers/platform/x86/Kconfig       | 22 +++++++++--------
 drivers/platform/x86/dell/Kconfig  |  1 +
 drivers/platform/x86/hp/Kconfig    |  1 +
 drivers/platform/x86/intel/Kconfig |  2 +-
 include/linux/acpi.h               |  8 +++++--
 38 files changed, 189 insertions(+), 101 deletions(-)

.
Subject: [syzbot] Monthly block report (Nov 2024)
From: syzbot <syzbot+list462fc37593d30c75df84@syzkaller.appspotmail.com>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:38:24 -0800

.
Subject: [syzbot] Monthly btrfs report (Nov 2024)
From: syzbot <syzbot+list69ba8ebe12d504efee8b@syzkaller.appspotmail.com>
To: clm@fb.com, dsterba@suse.com, josef@toxicpanda.com, 
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:39:26 -0800

.
Subject: [PATCH v2 0/9] misc: Support TI FPC202 dual-port controller
From: Romain Gantois <romain.gantois@bootlin.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Luca Ceresoli <luca.ceresoli@bootlin.com>, 
 Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>, 
 Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, Derek Kiernan <derek.kiernan@amd.com>, 
 Dragan Cvetic <dragan.cvetic@amd.com>, Arnd Bergmann <arnd@arndb.de>, 
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>, 
 Mauro Carvalho Chehab <mchehab@kernel.org>, 
 Linus Walleij <linus.walleij@linaro.org>, 
 Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, 
 Kory Maincent <kory.maincent@bootlin.com>, linux-i2c@vger.kernel.org, 
 linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-media@vger.kernel.org, linux-gpio@vger.kernel.org, 
 Romain Gantois <romain.gantois@bootlin.com>
Date: Mon, 18 Nov 2024 11:12:59 +0100

.
Subject: [GIT PULL] RCU changes for v6.13
From: Frederic Weisbecker <frederic@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
	Joel Fernandes <joel@joelfernandes.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Uladzislau Rezki <urezki@gmail.com>, linux-kernel@vger.kernel.org,
	rcu@vger.kernel.org
Date: Mon, 18 Nov 2024 10:50:47 +0100

Hello Linus,

The following changes since commit f7345ccc62a4b880cf76458db5f320725f28e400:

  rcu/nocb: Fix rcuog wake-up from offline softirq (2024-10-10 22:18:19 +0530)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git tags/rcu.release.v6.13

for you to fetch changes up to d8dfba2c606ac9fa763ce3c51dcbf7335544b815:

  Merge branches 'rcu/fixes', 'rcu/nocb', 'rcu/torture', 'rcu/stall' and 'rcu/srcu' into rcu/dev (2024-11-15 22:38:53 +0100)

----------------------------------------------------------------
RCU pull request for v6.13

SRCU:

	- Introduction of the new SRCU-lite flavour with a new pair of
	  srcu_read_[un]lock_lite() APIs. In practice the read side using
	  this flavour becomes lighter by removing a full memory barrier on
	  LOCK and a full memory barrier on UNLOCK. This comes at the
	  expense of a higher latency write side with two (in the best case
	  of a snaphot of unused read-sides) or more RCU grace periods on
	  the update side which now assumes by itself the whole full
	  ordering guarantee against the LOCK/UNLOCK counters on both
	  indexes, along with the accesses performed inside.

	  Uretprobes is a known potential user.

	  Note this doesn't replace the default normal flavour of SRCU which
	  still behaves the same as usual.

	- Add testing of SRCU-lite through rcutorture and rcuscale

	- Various cleanups on the way.

FIXES:

	- Allow short-circuiting RCU-TASKS-RUDE grace periods on architectures
	  that have sane noinstr boundaries forbidding tracing on low-level
	  idle and kernel entry code. RCU-TASKS is enough on such configurations
	  because it involves an RCU grace period that waits for all idle
	  tasks to either schedule out voluntarily or enter into RCU
	  unwatched noinstr code.

	- Allow and test start_poll_synchronize_rcu() with IRQs disabled.

	- Mention rcuog kthreads in relevant documentation and Kconfig help

	- Various fixes and consolidations

RCUTORTURE:

	- Add --no-affinity on tools to leave the affinity setting of guests
	  up to the user.

	- Add guest_os_delay parameter to rcuscale for better warm-up
	  control.

	- Fix and improve some rcuscale error handling.

	- Various cleanups and fixes

STALL:

	- Remove dead code

	- Stop dumping tasks if a stalled grace period eventually ended
	  midway as that only produces confusing output.

	- Optimize detection of stalling CPUs and avoid useless node
	  locking otherwise.

NOCB:

	- Fix rcu_barrier() hang due to a race against callbacks
	  deoffloading. This is not yet used, except by rcutorture, and
	  waits for its promised cpusets interface.

	- Remove leftover function declaration

----------------------------------------------------------------
Baruch Siach (1):
      doc: rcu: update printed dynticks counter bits

Frederic Weisbecker (1):
      Merge branches 'rcu/fixes', 'rcu/nocb', 'rcu/torture', 'rcu/stall' and 'rcu/srcu' into rcu/dev

Hongbo Li (1):
      rcu: Use bitwise instead of arithmetic operator for flags

Jinjie Ruan (1):
      rcu: Use the BITS_PER_LONG macro

Michal Schmidt (1):
      rcu/srcutiny: don't return before reenabling preemption

Paul E. McKenney (32):
      rcu: Delete unused rcu_gp_might_be_stalled() function
      rcu: Stop stall warning from dumping stacks if grace period ends
      srcu: Rename srcu_might_be_idle() to srcu_should_expedite()
      srcu: Introduce srcu_gp_is_expedited() helper function
      rcu: Finer-grained grace-period-end checks in rcu_dump_cpu_stacks()
      srcu: Renaming in preparation for additional reader flavor
      srcu: Bit manipulation changes for additional reader flavor
      srcu: Standardize srcu_data pointers to "sdp" and similar
      srcu: Improve srcu_read_lock{,_nmisafe}() comments
      srcu: Create CPP macros for normal and NMI-safe SRCU readers
      srcu: Add srcu_read_lock_lite() and srcu_read_unlock_lite()
      srcu: Allow inlining of __srcu_read_{,un}lock_lite()
      rcutorture: Expand RCUTORTURE_RDR_MASK_[12] to eight bits
      rcutorture: Add reader_flavor parameter for SRCU readers
      rcutorture: Add srcu_read_lock_lite() support to rcutorture.reader_flavor
      rcutorture: Add light-weight SRCU scenario
      refscale: Add srcu_read_lock_lite() support using "srcu-lite"
      srcu: Improve srcu_read_lock_lite() kernel-doc comment
      rcu: Add rcuog kthreads to RCU_NOCB_CPU help text
      doc: Add rcuog kthreads to kernel-per-CPU-kthreads.rst
      rcu: Allow short-circuiting of synchronize_rcu_tasks_rude()
      rcu: Permit start_poll_synchronize_rcu*() with interrupts disabled
      rcutorture: Test start-poll primitives with interrupts disabled
      doc: Remove kernel-parameters.txt entry for rcutorture.read_exit
      rcu-tasks: Remove open-coded one-byte cmpxchg() emulation
      torture: Add --no-affinity parameter to kvm.sh
      refscale: Correct affinity check
      rcuscale: Add guest_os_delay module parameter
      rcutorture: Avoid printing cpu=-1 for no-fault RCU boost failure
      srcu: Remove smp_mb() from srcu_read_unlock_lite()
      srcu: Check for srcu_read_lock_lite() across all CPUs
      srcu: Unconditionally record srcu_read_lock_lite() in ->srcu_reader_flavor

Uladzislau Rezki (Sony) (3):
      rcu/kvfree: Fix data-race in __mod_timer / kvfree_call_rcu
      rcuscale: Do a proper cleanup if kfree_scale_init() fails
      rcuscale: Remove redundant WARN_ON_ONCE() splat

Yue Haibing (1):
      rcu: Remove unused declaration rcu_segcblist_offload()

Zhen Lei (1):
      srcu: Replace WARN_ON_ONCE() with BUILD_BUG_ON() if possible

Zqiang (1):
      rcu/nocb: Fix missed RCU barrier on deoffloading

 Documentation/RCU/stallwarn.rst                    |   2 +-
 Documentation/admin-guide/kernel-parameters.txt    |  13 +-
 .../admin-guide/kernel-per-CPU-kthreads.rst        |   2 +-
 include/linux/rcutiny.h                            |   1 -
 include/linux/rcutree.h                            |   1 -
 include/linux/srcu.h                               |  92 ++++++++++----
 include/linux/srcutiny.h                           |   3 +
 include/linux/srcutree.h                           |  67 ++++++++++-
 kernel/rcu/Kconfig                                 |  28 +++--
 kernel/rcu/rcu_segcblist.h                         |   1 -
 kernel/rcu/rcuscale.c                              |   8 +-
 kernel/rcu/rcutorture.c                            |  84 +++++++++----
 kernel/rcu/refscale.c                              |  56 ++++++++-
 kernel/rcu/srcutiny.c                              |   2 +-
 kernel/rcu/srcutree.c                              | 133 +++++++++++++--------
 kernel/rcu/tasks.h                                 |  20 +---
 kernel/rcu/tree.c                                  |  24 ++--
 kernel/rcu/tree_nocb.h                             |  13 +-
 kernel/rcu/tree_plugin.h                           |  22 ++--
 kernel/rcu/tree_stall.h                            |  57 +++------
 .../rcutorture/bin/kvm-test-1-run-batch.sh         |  43 +++----
 tools/testing/selftests/rcutorture/bin/kvm.sh      |   6 +
 .../selftests/rcutorture/configs/rcu/CFLIST        |   1 +
 .../selftests/rcutorture/configs/rcu/SRCU-L        |  10 ++
 .../selftests/rcutorture/configs/rcu/SRCU-L.boot   |   3 +
 .../selftests/rcutorture/configs/rcu/SRCU-N.boot   |   1 +
 .../selftests/rcutorture/configs/rcu/TREE10        |   2 +-
 27 files changed, 468 insertions(+), 227 deletions(-)
 create mode 100644 tools/testing/selftests/rcutorture/configs/rcu/SRCU-L
 create mode 100644 tools/testing/selftests/rcutorture/configs/rcu/SRCU-L.boot

.
Subject: [PATCH v2 1/1] gpio: altera: Add missed base and label initialisations
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Mun Yew Tham <mun.yew.tham@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Date: Mon, 18 Nov 2024 11:28:02 +0200

.
Subject: [PATCH] interconnect: Add NULL check in icc_clk_register
From: Charles Han <hanchunchao@inspur.com>
To: <djakov@kernel.org>
Date: Mon, 18 Nov 2024 17:59:39 +0800

.
Subject: [PATCH] Lenovo Legion Go WMI Control
From: zhixin zhang <jonmail@163.com>
To: hdegoede@redhat.com,
	ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	zhixin zhang <zhangzx36@lenovo.com>
Date: Mon, 18 Nov 2024 18:05:03 +0800

.
Subject: [GIT PULL] pwm: Changes for 6.13-rc1
From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= <u.kleine-koenig@baylibre.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, 
	Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Date: Mon, 18 Nov 2024 11:06:12 +0100


--57l3bzelwfcxov3e
Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: [GIT PULL] pwm: Changes for 6.13-rc1
MIME-Version: 1.0

Hello Linus,

The following changes since commit 517fb4d77c44c7519ae6937329c496894461f416:

  MAINTAINERS: add self as reviewer for AXI PWM GENERATOR (2024-10-25 11:31=
:17 +0200)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git tags/p=
wm/for-6.13-rc1

for you to fetch changes up to b2eaa1170e45dc18eb09dcc9abafbe9a7502e960:

  pwm: Assume a disabled PWM to emit a constant inactive output (2024-11-07=
 12:03:39 +0100)

----------------------------------------------------------------
pwm: Changes for v6.13-rc1

This pull request prominently contains a new abstraction for PWM
waveforms that is more expressive that the legacy one. Compared to the
old abstraction it contains a duty_offset member instead of polarity.
This new abstraction is already used in an ADC driver merged into the
iio tree. So I expect you will get a part of this tree also via the iio
pull request for 6.13-rc1 (tag pwm/duty_offset-for-6.13-rc1).

Otherwise it's the usual collection of fixes, cleanups and dt doc
updates.

This time around thanks go to Andy Shevchenko, Clark Wang, Conor Dooley,
David Lechner, Dimitri Fedrau, Frank Li, Jun Li, Kelvin Zhang, Krzysztof
Kozlowski, Nuno Sa, Shen Lichuan and Trevor Gamblin for code
contributions, testing and review.

----------------------------------------------------------------

The new API requires changes to the lowlevel drivers. For now there are
two drivers that are converted to the new API (axi-pwmgen and stm32).
Converted drivers continue to work with the old API. Drivers not yet
converted only work with the older API.

Please pull these changes for 6.13-rc1.

Thanks
Uwe

Andy Shevchenko (1):
      pwm: core: use device_match_name() instead of strcmp(dev_name(...

Clark Wang (1):
      pwm: imx27: Workaround of the pwm output bug when decrease the duty c=
ycle

David Lechner (3):
      pwm: axi-pwmgen: Rename 0x10 register
      pwm: axi-pwmgen: Enable FORCE_ALIGN by default
      pwm: core: export pwm_get_state_hw()

Frank Li (1):
      pwm: imx27: Use clk_bulk_*() API to simplify clock handling

Kelvin Zhang (1):
      dt-bindings: pwm: amlogic: Document C3 PWM

Shen Lichuan (1):
      pwm: atmel-tcb: Use min() macro

Uwe Kleine-K=F6nig (13):
      pwm: Add more locking
      pwm: New abstraction for PWM waveforms
      pwm: Provide new consumer API functions for waveforms
      pwm: Add tracing for waveform callbacks
      pwm: axi-pwmgen: Implementation of the waveform callbacks
      pwm: stm32: Implementation of the waveform callbacks
      pwm: Reorder symbols in core.c
      pwm: Add kernel doc for members added to pwm_ops recently
      pwm: stm32: Fix error checking for a regmap_read() call
      pwm: axi-pwmgen: Create a dedicated function for getting driver data =
=66rom a chip
      Merge tag 'pwm/duty_offset-for-6.13-rc1' of https://git.kernel.org/pu=
b/scm/linux/kernel/git/ukleinek/linux
      dt-bindings: pwm: adi,axi-pwmgen: Increase #pwm-cells to 3
      pwm: Assume a disabled PWM to emit a constant inactive output

 .../devicetree/bindings/pwm/adi,axi-pwmgen.yaml    |   4 +-
 .../devicetree/bindings/pwm/pwm-amlogic.yaml       |   1 +
 drivers/pwm/core.c                                 | 885 +++++++++++++++++=
----
 drivers/pwm/pwm-atmel-tcb.c                        |   4 +-
 drivers/pwm/pwm-axi-pwmgen.c                       | 199 +++--
 drivers/pwm/pwm-imx27.c                            | 161 +++-
 drivers/pwm/pwm-stm32.c                            | 612 +++++++++-----
 include/linux/pwm.h                                |  66 +-
 include/trace/events/pwm.h                         | 134 +++-
 9 files changed, 1571 insertions(+), 495 deletions(-)


--57l3bzelwfcxov3e
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmc7EZIACgkQj4D7WH0S
/k6cZwgAoMkjVDFUq9QM8g87/DWUZABFHzVKCIyRCCmql+pxVSnE5xBrG9fNK70Q
ijkdSDtrRpCWSHBMLm09+Qnb2vkJpyy0fYwMUfgaU0GcE+z9zpgfbu4Z8mY4A59d
Nj7yfpmYYrusKAZRgUnijI7QC5hC7EJa598qPhZP/D91fm89BlK7y6TJosRzCbpq
m9xAzXGzQiKq1Z1tX3XzmVn5Mt2KrfXCUjFX75Zk3eKrzOOuWQ804X4g+qynKDuz
STyRfyrskqfKZOGENAJr/N5G1bT4dDybkBp6Zz1dB7s5TQ0GXnSSA9n8LHl3ojPk
F1b+lwfWaQqwDS1qjEGU2pHbWUUwxg==
=R4t8
-----END PGP SIGNATURE-----

--57l3bzelwfcxov3e--

.
Subject: [GIT PULL] arm64 updates for 6.13-rc1
From: Catalin Marinas <catalin.marinas@arm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Will Deacon <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 10:06:23 +0000

Hi Linus,

Here are the arm64 updates for 6.13. The major features are support to
run Linux in a protected VM (a.k.a. realm) under the Arm CCA and the
user Guarded Control Stack (GCS). There are a few smaller scale
additions for in-kernel memcpy instructions, MTE hugetlbfs support,
optimised CRC32, non-leaf pmd_young(), the usual perf/PMU updates and
various fixes and cleanups. We are also introducing HWCAP3 as we'll
likely run out of HWCAP2 bits in a year or so.

There's a trivial conflict with mainline due to a recent upstream fix:
commit 5baf8b037deb ("mm: refactor arch_calc_vm_flag_bits() and arm64
MTE handling") and the MTE hugetlbfs support. My fixup:

diff --cc arch/arm64/include/asm/mman.h
index 798d965760d4,1dbfb56cb313..e1572482fae8
--- a/arch/arm64/include/asm/mman.h
+++ b/arch/arm64/include/asm/mman.h
@@@ -42,7 -39,7 +42,7 @@@ static inline unsigned long arch_calc_v
  	 * filesystem supporting MTE (RAM-based).
  	 */
  	if (system_supports_mte() &&
- 	    ((flags & MAP_ANONYMOUS) || shmem_file(file)))
 -	    (flags & (MAP_ANONYMOUS | MAP_HUGETLB)))
++	    ((flags & (MAP_ANONYMOUS | MAP_HUGETLB)) || shmem_file(file)))
  		return VM_MTE_ALLOWED;
  
  	return 0;

Depending on the order you pull other requests in, there are a couple
more conflicts with the trace and KVM trees. The slightly more
complicated one is in arch/arm64/kvm/guest.c - the MTE hugetlbfs support
in the arm64 tree conflicting with the __gfn_to_page() use in
kvm_vm_ioctl_mte_copy_tags() from the KVM tree. The resolution in -next
is correct.

Since the arm64 tree has two bases, -rc1 mostly but -rc3 for the perf
branch, the diffstat below is generated against 6.12.

Thanks.

The following changes since commit 2e8a1acea8597ff42189ea94f0a63fa58640223d:

  arm64: signal: Improve POR_EL0 handling to avoid uaccess failures (2024-10-29 17:59:12 +0000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux tags/arm64-upstream

for you to fetch changes up to 83ef4a378e563d085ddd7214c2a393116b5f3435:

  Merge branch 'for-next/pkey-signal' into for-next/core (2024-11-14 12:07:30 +0000)

----------------------------------------------------------------
arm64 updates for 6.13:

* Support for running Linux in a protected VM under the Arm Confidential
  Compute Architecture (CCA)

* Guarded Control Stack user-space support. Current patches follow the
  x86 ABI of implicitly creating a shadow stack on clone(). Subsequent
  patches (already on the list) will add support for clone3() allowing
  finer-grained control of the shadow stack size and placement from libc

* AT_HWCAP3 support (not running out of HWCAP2 bits yet but we are
  getting close with the upcoming dpISA support)

* Other arch features:

  - In-kernel use of the memcpy instructions, FEAT_MOPS (previously only
    exposed to user; uaccess support not merged yet)

  - MTE: hugetlbfs support and the corresponding kselftests

  - Optimise CRC32 using the PMULL instructions

  - Support for FEAT_HAFT enabling ARCH_HAS_NONLEAF_PMD_YOUNG

  - Optimise the kernel TLB flushing to use the range operations

  - POE/pkey (permission overlays): further cleanups after bringing the
    signal handler in line with the x86 behaviour for 6.12

* arm64 perf updates:

  - Support for the NXP i.MX91 PMU in the existing IMX driver

  - Support for Ampere SoCs in the Designware PCIe PMU driver

  - Support for Marvell's 'PEM' PCIe PMU present in the 'Odyssey' SoC

  - Support for Samsung's 'Mongoose' CPU PMU

  - Support for PMUv3.9 finer-grained userspace counter access control

  - Switch back to platform_driver::remove() now that it returns 'void'

  - Add some missing events for the CXL PMU driver

* Miscellaneous arm64 fixes/cleanups:

  - Page table accessors cleanup: type updates, drop unused macros,
    reorganise arch_make_huge_pte() and clean up pte_mkcont(), sanity
    check addresses before runtime P4D/PUD folding

  - Command line override for ID_AA64MMFR0_EL1.ECV (advertising the
    FEAT_ECV for the generic timers) allowing Linux to boot with
    firmware deployments that don't set SCTLR_EL3.ECVEn

  - ACPI/arm64: tighten the check for the array of platform timer
    structures and adjust the error handling procedure in
    gtdt_parse_timer_block()

  - Optimise the cache flush for the uprobes xol slot (skip if no
    change) and other uprobes/kprobes cleanups

  - Fix the context switching of tpidrro_el0 when kpti is enabled

  - Dynamic shadow call stack fixes

  - Sysreg updates

  - Various arm64 kselftest improvements

----------------------------------------------------------------
 Documentation/admin-guide/kernel-parameters.txt    |   3 +
 Documentation/admin-guide/perf/index.rst           |   1 +
 Documentation/admin-guide/perf/mrvl-pem-pmu.rst    |  56 ++
 Documentation/arch/arm64/arm-cca.rst               |  69 ++
 Documentation/arch/arm64/booting.rst               |  38 ++
 Documentation/arch/arm64/elf_hwcaps.rst            |  10 +-
 Documentation/arch/arm64/gcs.rst                   | 227 +++++++
 Documentation/arch/arm64/index.rst                 |   3 +
 Documentation/arch/arm64/mops.rst                  |  44 ++
 Documentation/arch/arm64/sme.rst                   |   4 +
 Documentation/arch/arm64/sve.rst                   |   4 +
 Documentation/devicetree/bindings/arm/pmu.yaml     |   1 +
 .../devicetree/bindings/perf/fsl-imx-ddr.yaml      |   4 +-
 Documentation/filesystems/proc.rst                 |   2 +-
 MAINTAINERS                                        |   6 +
 arch/arm/include/asm/arm_pmuv3.h                   |   8 +
 arch/arm64/Kconfig                                 |  43 ++
 arch/arm64/include/asm/arm_pmuv3.h                 |  10 +
 arch/arm64/include/asm/assembler.h                 |   7 -
 arch/arm64/include/asm/cpucaps.h                   |   2 +
 arch/arm64/include/asm/cpufeature.h                |  18 +-
 arch/arm64/include/asm/daifflags.h                 |   2 +-
 arch/arm64/include/asm/debug-monitors.h            |   1 +
 arch/arm64/include/asm/el2_setup.h                 |  30 +
 arch/arm64/include/asm/esr.h                       |  28 +-
 arch/arm64/include/asm/exception.h                 |   3 +
 arch/arm64/include/asm/gcs.h                       | 107 +++
 arch/arm64/include/asm/hugetlb.h                   |   8 +
 arch/arm64/include/asm/hwcap.h                     |   7 +-
 arch/arm64/include/asm/insn.h                      |   6 +
 arch/arm64/include/asm/io.h                        |   8 +
 arch/arm64/include/asm/kernel-pgtable.h            |   1 -
 arch/arm64/include/asm/mem_encrypt.h               |   9 +
 arch/arm64/include/asm/mman.h                      |  25 +-
 arch/arm64/include/asm/mmu_context.h               |   9 +
 arch/arm64/include/asm/mte.h                       |  67 ++
 arch/arm64/include/asm/pgalloc.h                   |  12 +-
 arch/arm64/include/asm/pgtable-hwdef.h             |   4 +
 arch/arm64/include/asm/pgtable-prot.h              |  19 +-
 arch/arm64/include/asm/pgtable.h                   |  31 +-
 arch/arm64/include/asm/probes.h                    |  11 +-
 arch/arm64/include/asm/processor.h                 |  57 +-
 arch/arm64/include/asm/ptrace.h                    |  22 +-
 arch/arm64/include/asm/rsi.h                       |  68 ++
 arch/arm64/include/asm/rsi_cmds.h                  | 160 +++++
 arch/arm64/include/asm/rsi_smc.h                   | 193 ++++++
 arch/arm64/include/asm/scs.h                       |   8 +-
 arch/arm64/include/asm/set_memory.h                |   3 +
 arch/arm64/include/asm/stacktrace/common.h         |  74 ++-
 arch/arm64/include/asm/stacktrace/frame.h          |  48 ++
 arch/arm64/include/asm/sysreg.h                    |  20 +
 arch/arm64/include/asm/tlbflush.h                  |  43 +-
 arch/arm64/include/asm/uaccess.h                   |  40 ++
 arch/arm64/include/uapi/asm/hwcap.h                |   7 +-
 arch/arm64/include/uapi/asm/ptrace.h               |   8 +
 arch/arm64/include/uapi/asm/sigcontext.h           |   9 +
 arch/arm64/kernel/Makefile                         |   3 +-
 arch/arm64/kernel/asm-offsets.c                    |  27 +-
 arch/arm64/kernel/cpufeature.c                     |  45 ++
 arch/arm64/kernel/cpuinfo.c                        |   1 +
 arch/arm64/kernel/debug-monitors.c                 |  10 +-
 arch/arm64/kernel/efi.c                            |  12 +-
 arch/arm64/kernel/entry-common.c                   |  35 +
 arch/arm64/kernel/entry.S                          |  16 +-
 arch/arm64/kernel/fpsimd.c                         |   2 +-
 arch/arm64/kernel/head.S                           |   3 +
 arch/arm64/kernel/hibernate.c                      |   6 +
 arch/arm64/kernel/module.c                         |  10 +-
 arch/arm64/kernel/mte.c                            |  27 +-
 arch/arm64/kernel/pi/idreg-override.c              |  12 +
 arch/arm64/kernel/pi/map_range.c                   |   2 +-
 arch/arm64/kernel/pi/patch-scs.c                   |  95 ++-
 arch/arm64/kernel/probes/decode-insn.c             |  22 +-
 arch/arm64/kernel/probes/decode-insn.h             |   2 +-
 arch/arm64/kernel/probes/kprobes.c                 |  39 +-
 arch/arm64/kernel/probes/simulate-insn.c           |   6 +
 arch/arm64/kernel/probes/simulate-insn.h           |   1 +
 arch/arm64/kernel/probes/uprobes.c                 |  12 +-
 arch/arm64/kernel/process.c                        | 101 ++-
 arch/arm64/kernel/ptrace.c                         |  74 ++-
 arch/arm64/kernel/rsi.c                            | 142 ++++
 arch/arm64/kernel/setup.c                          |   3 +
 arch/arm64/kernel/signal.c                         | 235 ++++++-
 arch/arm64/kernel/stacktrace.c                     | 176 ++++-
 arch/arm64/kernel/traps.c                          |  18 +
 arch/arm64/kernel/vmlinux.lds.S                    |   6 +-
 arch/arm64/kvm/guest.c                             |  16 +-
 arch/arm64/kvm/mmu.c                               |  11 +
 arch/arm64/lib/Makefile                            |   2 +-
 arch/arm64/lib/clear_page.S                        |  13 +
 arch/arm64/lib/copy_page.S                         |  13 +
 arch/arm64/lib/crc32-glue.c                        |  82 +++
 arch/arm64/lib/crc32.S                             | 346 ++++++++--
 arch/arm64/lib/memcpy.S                            |  19 +-
 arch/arm64/lib/memset.S                            |  20 +-
 arch/arm64/mm/Makefile                             |   1 +
 arch/arm64/mm/copypage.c                           |  27 +-
 arch/arm64/mm/fault.c                              |  40 ++
 arch/arm64/mm/fixmap.c                             |   9 +-
 arch/arm64/mm/gcs.c                                | 254 +++++++
 arch/arm64/mm/hugetlbpage.c                        |  21 +-
 arch/arm64/mm/init.c                               |  10 +-
 arch/arm64/mm/mmap.c                               |   9 +-
 arch/arm64/mm/mmu.c                                |  10 +-
 arch/arm64/mm/pageattr.c                           |  98 ++-
 arch/arm64/mm/proc.S                               |  19 +-
 arch/arm64/mm/ptdump.c                             |   8 +-
 arch/arm64/tools/cpucaps                           |   2 +
 arch/arm64/tools/sysreg                            |  12 +
 arch/x86/Kconfig                                   |   1 +
 arch/x86/include/uapi/asm/mman.h                   |   3 -
 drivers/acpi/arm64/gtdt.c                          |  33 +-
 drivers/perf/Kconfig                               |   7 +
 drivers/perf/Makefile                              |   1 +
 drivers/perf/alibaba_uncore_drw_pmu.c              |   2 +-
 drivers/perf/amlogic/meson_g12_ddr_pmu.c           |   2 +-
 drivers/perf/arm-cci.c                             |   2 +-
 drivers/perf/arm-ccn.c                             |   2 +-
 drivers/perf/arm-cmn.c                             |   2 +-
 drivers/perf/arm_cspmu/arm_cspmu.c                 |   2 +-
 drivers/perf/arm_dmc620_pmu.c                      |   2 +-
 drivers/perf/arm_dsu_pmu.c                         |   2 +-
 drivers/perf/arm_pmuv3.c                           |  32 +-
 drivers/perf/arm_smmuv3_pmu.c                      |   2 +-
 drivers/perf/arm_spe_pmu.c                         |   2 +-
 drivers/perf/cxl_pmu.c                             |   9 +-
 drivers/perf/dwc_pcie_pmu.c                        |  16 +-
 drivers/perf/fsl_imx8_ddr_perf.c                   |   2 +-
 drivers/perf/fsl_imx9_ddr_perf.c                   |   7 +-
 drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c       |   2 +-
 drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c      |   2 +-
 drivers/perf/hisilicon/hisi_uncore_hha_pmu.c       |   2 +-
 drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c       |   2 +-
 drivers/perf/hisilicon/hisi_uncore_pa_pmu.c        |   2 +-
 drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c      |   2 +-
 drivers/perf/marvell_cn10k_ddr_pmu.c               |   2 +-
 drivers/perf/marvell_cn10k_tad_pmu.c               |   2 +-
 drivers/perf/marvell_pem_pmu.c                     | 425 ++++++++++++
 drivers/perf/qcom_l2_pmu.c                         |   2 +-
 drivers/perf/thunderx2_pmu.c                       |   2 +-
 drivers/perf/xgene_pmu.c                           |   2 +-
 drivers/virt/coco/Kconfig                          |   2 +
 drivers/virt/coco/Makefile                         |   1 +
 drivers/virt/coco/arm-cca-guest/Kconfig            |  11 +
 drivers/virt/coco/arm-cca-guest/Makefile           |   2 +
 drivers/virt/coco/arm-cca-guest/arm-cca-guest.c    | 224 +++++++
 fs/binfmt_elf.c                                    |   6 +
 fs/binfmt_elf_fdpic.c                              |   6 +
 fs/compat_binfmt_elf.c                             |  10 +
 fs/hugetlbfs/inode.c                               |   2 +-
 fs/proc/task_mmu.c                                 |   2 +-
 include/linux/cpuhotplug.h                         |   1 +
 include/linux/mm.h                                 |  18 +-
 include/linux/perf/arm_pmuv3.h                     |   1 +
 include/uapi/asm-generic/mman.h                    |   4 +
 include/uapi/linux/elf.h                           |   1 +
 include/uapi/linux/prctl.h                         |  22 +
 kernel/sys.c                                       |  30 +
 mm/Kconfig                                         |   6 +
 tools/testing/selftests/arm64/Makefile             |   2 +-
 tools/testing/selftests/arm64/abi/hwcap.c          |  25 +-
 tools/testing/selftests/arm64/abi/syscall-abi.c    |   8 +-
 tools/testing/selftests/arm64/fp/assembler.h       |  15 +
 tools/testing/selftests/arm64/fp/fp-ptrace-asm.S   |  41 +-
 tools/testing/selftests/arm64/fp/fp-ptrace.c       | 161 ++++-
 tools/testing/selftests/arm64/fp/fp-ptrace.h       |  12 +
 tools/testing/selftests/arm64/fp/fp-stress.c       |  49 +-
 tools/testing/selftests/arm64/fp/fpsimd-test.S     |   6 +-
 tools/testing/selftests/arm64/fp/kernel-test.c     |   4 +
 tools/testing/selftests/arm64/fp/sme-inst.h        |   2 +
 tools/testing/selftests/arm64/fp/sve-ptrace.c      |  16 +-
 tools/testing/selftests/arm64/fp/sve-test.S        |  10 +-
 tools/testing/selftests/arm64/fp/za-ptrace.c       |   8 +-
 tools/testing/selftests/arm64/fp/za-test.S         |  15 +-
 tools/testing/selftests/arm64/fp/zt-ptrace.c       |   8 +-
 tools/testing/selftests/arm64/fp/zt-test.S         |  15 +-
 tools/testing/selftests/arm64/gcs/.gitignore       |   7 +
 tools/testing/selftests/arm64/gcs/Makefile         |  30 +
 tools/testing/selftests/arm64/gcs/asm-offsets.h    |   0
 tools/testing/selftests/arm64/gcs/basic-gcs.c      | 357 ++++++++++
 tools/testing/selftests/arm64/gcs/gcs-locking.c    | 200 ++++++
 .../selftests/arm64/gcs/gcs-stress-thread.S        | 311 +++++++++
 tools/testing/selftests/arm64/gcs/gcs-stress.c     | 530 +++++++++++++++
 tools/testing/selftests/arm64/gcs/gcs-util.h       | 100 +++
 tools/testing/selftests/arm64/gcs/gcspushm.S       |  96 +++
 tools/testing/selftests/arm64/gcs/gcsstr.S         |  99 +++
 tools/testing/selftests/arm64/gcs/libc-gcs.c       | 728 +++++++++++++++++++++
 .../selftests/arm64/mte/check_buffer_fill.c        |   4 +-
 .../selftests/arm64/mte/check_hugetlb_options.c    | 285 ++++++++
 tools/testing/selftests/arm64/mte/check_prctl.c    |   2 +-
 .../selftests/arm64/mte/check_tags_inclusion.c     |   4 +-
 .../testing/selftests/arm64/mte/mte_common_util.c  |  29 +-
 .../testing/selftests/arm64/mte/mte_common_util.h  |   6 +-
 tools/testing/selftests/arm64/pauth/Makefile       |   6 +
 tools/testing/selftests/arm64/pauth/pac.c          |   5 +-
 tools/testing/selftests/arm64/signal/.gitignore    |   1 +
 tools/testing/selftests/arm64/signal/Makefile      |   2 +-
 tools/testing/selftests/arm64/signal/sve_helpers.h |  13 +
 .../testing/selftests/arm64/signal/test_signals.c  |  17 +-
 .../testing/selftests/arm64/signal/test_signals.h  |   6 +
 .../selftests/arm64/signal/test_signals_utils.c    |  32 +-
 .../selftests/arm64/signal/test_signals_utils.h    |  39 ++
 .../arm64/signal/testcases/gcs_exception_fault.c   |  62 ++
 .../selftests/arm64/signal/testcases/gcs_frame.c   |  88 +++
 .../arm64/signal/testcases/gcs_write_fault.c       |  67 ++
 .../selftests/arm64/signal/testcases/ssve_regs.c   |   5 +
 .../selftests/arm64/signal/testcases/testcases.c   |   7 +
 .../selftests/arm64/signal/testcases/testcases.h   |   1 +
 .../selftests/arm64/signal/testcases/za_regs.c     |   5 +
 tools/testing/selftests/mm/Makefile                |   8 +-
 tools/testing/selftests/mm/pkey-arm64.h            |   3 +-
 tools/testing/selftests/mm/pkey-helpers.h          |   7 +
 tools/testing/selftests/mm/pkey-x86.h              |   2 +
 tools/testing/selftests/mm/pkey_sighandler_tests.c | 115 +++-
 214 files changed, 7911 insertions(+), 585 deletions(-)

.
Subject: [PATCH v3 0/2] power: supply: max17042: cleanup and more features
From: Dzmitry Sankouski <dsankouski@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Marek Szyprowski <m.szyprowski@samsung.com>, 
 Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>, 
 Purism Kernel Team <kernel@puri.sm>, Sebastian Reichel <sre@kernel.org>, 
 Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, Shawn Guo <shawnguo@kernel.org>, 
 Sascha Hauer <s.hauer@pengutronix.de>, 
 Pengutronix Kernel Team <kernel@pengutronix.de>, 
 Fabio Estevam <festevam@gmail.com>, Bjorn Andersson <andersson@kernel.org>, 
 Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, 
 linux-arm-msm@vger.kernel.org, Dzmitry Sankouski <dsankouski@gmail.com>
Date: Mon, 18 Nov 2024 13:09:52 +0300

.
Subject: [PATCH RESEND v8 0/3] Add divisor computation feature for sdm845
 gp clocks
From: Dzmitry Sankouski <dsankouski@gmail.com>
To: Bjorn Andersson <andersson@kernel.org>, 
 Michael Turquette <mturquette@baylibre.com>, 
 Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, 
 linux-kernel@vger.kernel.org, Dzmitry Sankouski <dsankouski@gmail.com>
Date: Mon, 18 Nov 2024 13:15:18 +0300

.
Subject: [PATCH v2] fuse: check attributes staleness on fuse_iget()
From: Zhang Tianci <zhangtianci.1997@bytedance.com>
To: miklos@szeredi.hu
Cc: linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xieyongji@bytedance.com,
	Zhang Tianci <zhangtianci.1997@bytedance.com>,
	Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
Date: Mon, 18 Nov 2024 18:16:00 +0800

.
Subject: [GIT PULL] Thermal control updates for v6.13-rc1
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux PM <linux-pm@vger.kernel.org>, 
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>
Date: Mon, 18 Nov 2024 11:23:46 +0100

Hi Linus,

Please pull from the tag

 git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
 thermal-6.13-rc1

with top-most commit 0104dcdaad3a7afd141e79a5fb817a92ada910ac

 thermal: testing: Initialize some variables annoteded with _free()

on top of commit 5469a8deac05391781bcd27e7c40f2c35121ca09

 Merge tag 'thermal-v6.12-rc7' of
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux

to receive thermal control updates for 6.13-rc1.

These are thermal core changes, including the addition of support for
temperature thresholds that can be set from user space, fixes related
to thermal zone initialization, suspend/resume and exit, locking rework
and rearrangement of the code handling thermal zone temperature updates.

Specifics:

 - Add support for thermal thresholds that can be added and removed from
   user space via netlink along with a related library update (Daniel
   Lezcano).

 - Fix thermal zone initialization, suspend/resume and exit
   synchronization issues (Rafael Wysocki).

 - Rearrange locking in the thermal core to use guards (Rafael Wysocki).

 - Make the code handling thermal zone temperature updates use sorted
   lists of trip points to reduce the number of trip points table walks
   in the thermal core (Rafael Wysocki).

 - Fix and clean up the thermal testing facility code (Rafael Wysocki).

 - Fix a Power Allocator thermal governor issue (ZhengShaobo).

Thanks!


---------------

Daniel Lezcano (8):
      thermal: core: Add user thresholds support
      thermal: core: Connect the threshold with the core
      thermal: netlink: Add the commands and the events for the thresholds
      tools/lib/thermal: Make more generic the command encoding function
      tools/lib/thermal: Add the threshold netlink ABI
      tools/thermal/thermal-engine: Take into account the thresholds API
      thermal: thresholds: Fix thermal lock annotation issue
      thermal/lib: Fix memory leak on error in thermal_genl_auto()

Rafael J. Wysocki (36):
      thermal: core: Initialize thermal zones before registering them
      thermal: core: Rearrange PM notification code
      thermal: core: Represent suspend-related thermal zone flags as bits
      thermal: core: Mark thermal zones as initializing to start with
      thermal: core: Fix race between zone registration and system suspend
      thermal: core: Consolidate thermal zone locking during initialization
      thermal: core: Mark thermal zones as exiting before unregistration
      thermal: core: Consolidate thermal zone locking in the exit path
      thermal: core: Update thermal zones after cooling device binding
      thermal: core: Drop need_update field from struct thermal_zone_device
      thermal: core: Move lists of thermal instances to trip descriptors
      thermal: core: Pass trip descriptors to trip bind/unbind functions
      thermal: core: Add and use thermal zone guard
      thermal: core: Add and use a reverse thermal zone guard
      thermal: core: Separate code running under thermal_list_lock
      thermal: core: Manage thermal_list_lock using a mutex guard
      thermal: core: Call thermal_governor_update_tz() outside of cdev lock
      thermal: core: Introduce thermal_instance_add()
      thermal: core: Introduce thermal_instance_delete()
      thermal: core: Introduce thermal_cdev_update_nocheck()
      thermal: core: Add and use cooling device guard
      thermal: core: Separate thermal zone governor initialization
      thermal: core: Manage thermal_governor_lock using a mutex guard
      thermal: core: Build sorted lists instead of sorting them later
      thermal: core: Rename trip list node in struct thermal_trip_desc
      thermal: core: Prepare for moving trips between sorted lists
      thermal: core: Rearrange __thermal_zone_device_update()
      thermal: core: Pass trip descriptor to thermal_trip_crossed()
      thermal: core: Move some trip processing to thermal_trip_crossed()
      thermal: core: Relocate functions that update trip points
      thermal: core: Eliminate thermal_zone_trip_down()
      thermal: core: Use trip lists for trip crossing detection
      thermal: core: Relocate thermal zone initialization routine
      thermal: testing: Simplify tt_get_tt_zone()
      thermal: testing: Use DEFINE_FREE() and __free() to simplify code
      thermal: testing: Initialize some variables annoteded with _free()

ZhengShaobo (1):
      thermal: gov_power_allocator: Granted power set to max when
nobody request power

---------------

 drivers/thermal/Makefile                      |   1 +
 drivers/thermal/gov_bang_bang.c               |  15 +-
 drivers/thermal/gov_fair_share.c              |  20 +-
 drivers/thermal/gov_power_allocator.c         |  86 +--
 drivers/thermal/gov_step_wise.c               |  22 +-
 drivers/thermal/testing/zone.c                |  41 +-
 drivers/thermal/thermal_core.c                | 883 +++++++++++++++-----------
 drivers/thermal/thermal_core.h                |  41 +-
 drivers/thermal/thermal_debugfs.c             |  50 +-
 drivers/thermal/thermal_helpers.c             |  46 +-
 drivers/thermal/thermal_hwmon.c               |   5 +-
 drivers/thermal/thermal_netlink.c             | 253 +++++++-
 drivers/thermal/thermal_netlink.h             |  34 +
 drivers/thermal/thermal_sysfs.c               | 132 ++--
 drivers/thermal/thermal_thresholds.c          | 240 +++++++
 drivers/thermal/thermal_thresholds.h          |  19 +
 drivers/thermal/thermal_trip.c                |  48 +-
 include/linux/thermal.h                       |   6 +
 include/uapi/linux/thermal.h                  |  29 +-
 tools/lib/thermal/commands.c                  | 188 +++++-
 tools/lib/thermal/events.c                    |  55 +-
 tools/lib/thermal/include/thermal.h           |  40 ++
 tools/lib/thermal/libthermal.map              |   5 +
 tools/lib/thermal/thermal.c                   |  17 +
 tools/thermal/lib/Makefile                    |   2 +-
 tools/thermal/thermal-engine/thermal-engine.c | 105 ++-
 26 files changed, 1650 insertions(+), 733 deletions(-)

.
Subject: [GIT PULL] objtool changes for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Andrew Morton <akpm@linux-foundation.org>
Date: Mon, 18 Nov 2024 11:25:34 +0100


Linus,

Please pull the latest objtool/core Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git objtool-core-2024-11-18

   # HEAD: d5173f7537505315557d8580e3a648f07f17deda objtool: Exclude __tracepoints data from ENDBR checks

Objtool changes for v6.13:

 - Detect non-relocated text references for more robust
   IBT sealing (Josh Poimboeuf)

 - Fix build error when building stripped down
   UAPI headers (HONG Yifan)

 - Exclude __tracepoints data from ENDBR checks to fix
   false positives on clang builds (Peter Zijlstra)

 - Fix ORC unwind for newly forked tasks (Zheng Yejian)

 - Fix readelf related faddr2line regression (Carlos Llamas)

 Thanks,

	Ingo

------------------>
Carlos Llamas (1):
      Revert "scripts/faddr2line: Check only two symbols when calculating symbol size"

HONG Yifan (1):
      objtool: Also include tools/include/uapi

Josh Poimboeuf (1):
      objtool: Detect non-relocated text references

Peter Zijlstra (1):
      objtool: Exclude __tracepoints data from ENDBR checks

Zheng Yejian (1):
      x86/unwind/orc: Fix unwind for newly forked tasks


 arch/x86/kernel/acpi/wakeup_64.S     |   1 +
 arch/x86/kernel/head_64.S            |   1 +
 arch/x86/kernel/unwind_orc.c         |   2 +-
 scripts/faddr2line                   |   2 +-
 tools/objtool/Makefile               |   1 +
 tools/objtool/arch/x86/decode.c      |  15 +++--
 tools/objtool/check.c                | 113 ++++++++++++++++++++---------------
 tools/objtool/include/objtool/arch.h |   1 +
 8 files changed, 81 insertions(+), 55 deletions(-)

.
Subject: [RFC PATCH 0/8] zram: introduce multi-handle entries
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Date: Mon, 18 Nov 2024 19:30:31 +0900

.
Subject: [PATCH 0/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport
 fingerprint reader
From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>, 
 Konrad Dybcio <konradybcio@kernel.org>
Cc: Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, 
 Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, 
 linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
 Abel Vesa <abel.vesa@linaro.org>, Johan Hovold <johan@kernel.org>
Date: Mon, 18 Nov 2024 11:34:28 +0100

.
Subject: [syzbot] [tipc?] general protection fault in tipc_topsrv_exit_net (2)
From: syzbot <syzbot+2f6f00fd43edc2129fa5@syzkaller.appspotmail.com>
To: davem@davemloft.net, edumazet@google.com, horms@kernel.org, 
	jmaloy@redhat.com, kuba@kernel.org, linux-kernel@vger.kernel.org, 
	netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com, 
	tipc-discussion@lists.sourceforge.net, ying.xue@windriver.com
Date: Mon, 18 Nov 2024 02:38:24 -0800

.
Subject: [syzbot] Monthly serial report (Nov 2024)
From: syzbot <syzbot+list9f9a306663d445e9f873@syzkaller.appspotmail.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, 
	linux-serial@vger.kernel.org, syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:38:24 -0800

.
Subject: [syzbot] Monthly ext4 report (Nov 2024)
From: syzbot <syzbot+listd65c4312778884cf560a@syzkaller.appspotmail.com>
To: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:39:26 -0800

.
Subject: [PATCH v5 0/5] RAID 0/1/10 atomic write support
From: John Garry <john.g.garry@oracle.com>
To: axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com, hch@lst.de
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
        linux-raid@vger.kernel.org, martin.petersen@oracle.com,
        John Garry <john.g.garry@oracle.com>
Date: Mon, 18 Nov 2024 10:50:13 +0000

.
Subject: [GIT PULL] EDAC updates for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-edac <linux-edac@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 12:43:43 +0100

Hi Linus,

please pull the EDAC pile for v6.13.

Thx.

---

The following changes since commit 42f7652d3eb527d03665b09edac47f85fb600924:

  Linux 6.12-rc4 (2024-10-20 15:19:38 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git tags/edac_updates_for_v6.13

for you to fetch changes up to 1b38da0115598e30cc7cdd84761fc427c18b281f:

  Merge branch 'edac-misc' into edac-updates (2024-11-18 11:33:23 +0100)

----------------------------------------------------------------
- Add support for Bluefield-2 SOCs to bluefield_edac

- Add support for Intel Panther Lake-H to igen6_edac

- Add polling support to igen6_edac as some Intel M100 chips have trouble with
  error interrupts

- Add Kaby Lake-S support to ie31200_edac

- Fix memory source detection in the SKX common module which is used by
  a couple of Intel EDAC drivers

- Add support for the NXP i.MX9 memory controller to fsl_edac

- The usual fixes and cleanups all over the place

----------------------------------------------------------------
Borislav Petkov (AMD) (1):
      Merge branch 'edac-misc' into edac-updates

David Thompson (2):
      EDAC/bluefield: Fix potential integer overflow
      EDAC/bluefield: Use Arm SMC for EMI access on BlueField-2

Frank Li (3):
      EDAC/fsl_ddr: Pass down fsl_mc_pdata in ddr_in32() and ddr_out32()
      EDAC/fsl_ddr: Move global variables into struct fsl_mc_pdata
      dt-bindings: memory: fsl: Add compatible string nxp,imx9-memory-controller

James Ye (1):
      EDAC/ie31200: Add Kaby Lake-S dual-core host bridge ID

Krzysztof Kozlowski (1):
      MAINTAINERS: Change FSL DDR EDAC maintainership

Lili Li (1):
      EDAC/igen6: Add Intel Panther Lake-H SoCs support

Orange Kao (2):
      EDAC/igen6: Avoid segmentation fault on module unload
      EDAC/igen6: Add polling support

Priyanka Singh (1):
      EDAC/fsl_ddr: Fix bad bit shift operations

Qiuxu Zhuo (3):
      EDAC/skx_common: Differentiate memory error sources
      EDAC/{skx_common,i10nm}: Fix incorrect far-memory error source indicator
      EDAC/igen6: Initialize edac_op_state according to the configuration data

Yazen Ghannam (1):
      RAS/AMD/ATL: Add debug prints for DF register reads

Ye Li (1):
      EDAC/fsl_ddr: Add support for i.MX9 DDR controller

 CREDITS                                            |   4 +
 .../bindings/memory-controllers/fsl/fsl,ddr.yaml   |  31 +++-
 MAINTAINERS                                        |   3 +-
 drivers/edac/bluefield_edac.c                      | 170 ++++++++++++++++++---
 drivers/edac/fsl_ddr_edac.c                        | 141 +++++++++++------
 drivers/edac/fsl_ddr_edac.h                        |  13 ++
 drivers/edac/i10nm_base.c                          |   1 +
 drivers/edac/ie31200_edac.c                        |   8 +-
 drivers/edac/igen6_edac.c                          |  49 +++++-
 drivers/edac/layerscape_edac.c                     |   1 +
 drivers/edac/skx_common.c                          |  57 ++++---
 drivers/edac/skx_common.h                          |   8 +
 drivers/ras/amd/atl/access.c                       |   8 +-
 13 files changed, 398 insertions(+), 96 deletions(-)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: [syzbot] Monthly media report (Nov 2024)
From: syzbot <syzbot+list5a9a1a81d8075add9094@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:47:26 -0800

.
Subject: [syzbot] Monthly hfs report (Nov 2024)
From: syzbot <syzbot+list633574df4e9b6c4a50f7@syzkaller.appspotmail.com>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:47:26 -0800

.
Subject: [syzbot] Monthly udf report (Nov 2024)
From: syzbot <syzbot+listb2770ca7b7b9b9998f43@syzkaller.appspotmail.com>
To: jack@suse.com, linux-kernel@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 02:47:26 -0800

.
Subject: [net-next 0/3] Add Aspeed G7 MDIO support
From: Jacky Chou <jacky_chou@aspeedtech.com>
To: <andrew+netdev@lunn.ch>, <davem@davemloft.net>, <edumazet@google.com>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <robh@kernel.org>,
	<krzk+dt@kernel.org>, <conor+dt@kernel.org>, <joel@jms.id.au>,
	<andrew@codeconstruct.com.au>, <hkallweit1@gmail.com>,
	<linux@armlinux.org.uk>, <netdev@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
	<linux-aspeed@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 18:47:32 +0800

.
Subject: Efistub permanent warning depending on number of boot entries. Can
 anyone try to en-light me?
From: Eric Valette <eric.valette@free.fr>
To: LKML <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 11:55:00 +0100

.
Subject: [PATCH v3] setlocalversion: work around "git describe" performance
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Masahiro Yamada <masahiroy@kernel.org>,
	linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Jeff King <peff@peff.net>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sean Christopherson <seanjc@google.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>
Date: Mon, 18 Nov 2024 12:01:54 +0100

.
Subject: [GIT PULL] thermal drivers for v6.13-rc1
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
 Colin Ian King <colin.i.king@gmail.com>,
 =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@baylibre.com>,
 =?UTF-8?B?QmFybmFiw6FzIEN6w6ltw6Fu?= <barnabas.czeman@mainlining.org>,
 zhangjiao2 <zhangjiao2@cmss.chinamobile.com>,
 Rex Nie <rex.nie@jaguarmicro.com>,
 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
 Linux PM mailing list <linux-pm@vger.kernel.org>
Date: Mon, 18 Nov 2024 12:11:33 +0100

Hi Rafael,

please consider the following changes since commit 
c285b11e289dbe8973735ab8dc84210bde417673:

   Merge back thermal control material for 6.13 (2024-11-11 15:20:44 +0100)

are available in the Git repository at:

  
ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git 
tags/thermal-v6.13-rc1

for you to fetch changes up to d303e3dd8d4648f2a1bb19944d4fb1c4a5030354:

   tools/thermal: Fix common realloc mistake (2024-11-15 14:29:03 +0100)

----------------------------------------------------------------
- Add the SAR2130P compatible in the DT bindings for the QCom Tsens
   driver (Dmitry Baryshkov)

- Add the static annotation to the arrays describing the platform
   sensors on the LVTS Mediatek driver (Colin Ian King)

- Switch back to the struct platform_driver::remove() from the
   previous callbacks prototype rework (Uwe Kleine-KÃ¶nig)

- Add the MSM8937 compatible in the DT bindings and its support in the
   QCom Tsens driver (BarnabÃ¡s CzÃ©mÃ¡n)

- Remove a pointless sign test on an unsigned value in
   k3_bgp_read_temp() function on the k3_j72xx_bandgap driver (Rex Nie)

- Fix a pointer reference lost when the call to realloc() fails in the
   thermal library (Zhang Jiao)

----------------------------------------------------------------
BarnabÃ¡s CzÃ©mÃ¡n (2):
       dt-bindings: thermal: tsens: Add MSM8937
       thermal/drivers/qcom/tsens-v1: Add support for MSM8937 tsens

Colin Ian King (1):
       thermal/drivers/mediatek/lvts_thermal: Make read-only arrays 
static const

Dmitry Baryshkov (1):
       dt-bindings: thermal: qcom-tsens: Add SAR2130P compatible

Rex Nie (1):
       thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp()

Uwe Kleine-KÃ¶nig (1):
       thermal: Switch back to struct platform_driver::remove()

zhang jiao (1):
       tools/thermal: Fix common realloc mistake

  .../devicetree/bindings/thermal/qcom-tsens.yaml     |  2 ++
  drivers/thermal/amlogic_thermal.c                   |  2 +-
  drivers/thermal/armada_thermal.c                    |  2 +-
  drivers/thermal/broadcom/bcm2835_thermal.c          |  2 +-
  drivers/thermal/broadcom/ns-thermal.c               |  2 +-
  drivers/thermal/da9062-thermal.c                    |  6 +++---
  drivers/thermal/dove_thermal.c                      |  2 +-
  drivers/thermal/hisi_thermal.c                      |  4 ++--
  drivers/thermal/imx8mm_thermal.c                    |  2 +-
  drivers/thermal/imx_thermal.c                       |  2 +-
  .../thermal/intel/int340x_thermal/int3400_thermal.c |  2 +-
  .../thermal/intel/int340x_thermal/int3401_thermal.c |  2 +-
  .../thermal/intel/int340x_thermal/int3402_thermal.c |  2 +-
  .../thermal/intel/int340x_thermal/int3403_thermal.c |  2 +-
  .../thermal/intel/int340x_thermal/int3406_thermal.c |  2 +-
  drivers/thermal/k3_bandgap.c                        |  2 +-
  drivers/thermal/k3_j72xx_bandgap.c                  |  4 ++--
  drivers/thermal/kirkwood_thermal.c                  |  2 +-
  drivers/thermal/mediatek/lvts_thermal.c             |  6 +++---
  drivers/thermal/qcom/tsens-v1.c                     | 21 
++++++++++++++-------
  drivers/thermal/qcom/tsens.c                        |  5 ++++-
  drivers/thermal/qcom/tsens.h                        |  2 +-
  drivers/thermal/renesas/rcar_gen3_thermal.c         |  2 +-
  drivers/thermal/renesas/rcar_thermal.c              |  2 +-
  drivers/thermal/renesas/rzg2l_thermal.c             |  2 +-
  drivers/thermal/rockchip_thermal.c                  |  2 +-
  drivers/thermal/samsung/exynos_tmu.c                |  2 +-
  drivers/thermal/spear_thermal.c                     |  2 +-
  drivers/thermal/sprd_thermal.c                      |  2 +-
  drivers/thermal/st/st_thermal_memmap.c              |  2 +-
  drivers/thermal/st/stm_thermal.c                    |  2 +-
  drivers/thermal/tegra/soctherm.c                    |  2 +-
  drivers/thermal/tegra/tegra-bpmp-thermal.c          |  2 +-
  drivers/thermal/ti-soc-thermal/ti-bandgap.c         |  2 +-
  drivers/thermal/uniphier_thermal.c                  |  2 +-
  tools/thermal/thermometer/thermometer.c             |  7 ++++---
  36 files changed, 62 insertions(+), 49 deletions(-)


.
Subject: [PATCH sched-next] sched/cputime: Fix unused value issue
From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
To: mingo@redhat.com,
	peterz@infradead.org,
	juri.lelli@redhat.com,
	vincent.guittot@linaro.org,
	linux-kernel@vger.kernel.org
Cc: dietmar.eggemann@arm.com,
	rostedt@goodmis.org,
	bsegall@google.com,
	mgorman@suse.de,
	vschneid@redhat.com,
	Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Date: Mon, 18 Nov 2024 16:43:14 +0530

.
Subject: [PATCH v2 0/2] iio: adc: ad7124: Implement input validation
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@baylibre.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 12:19:54 +0100

.
Subject: [PATCH v2 1/4] powerpc/perf: Add perf interface to expose vpa counters
From: Kajol Jain <kjain@linux.ibm.com>
To: mpe@ellerman.id.au, maddy@linux.ibm.com
Cc: atrajeev@linux.vnet.ibm.com, kjain@linux.ibm.com, disgoel@linux.ibm.com,
        hbathini@linux.ibm.com, adubey@linux.ibm.com, gautam@linux.ibm.com,
        linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 17:11:11 +0530

.
Subject: [PATCH md-6.13 0/5] md/md-bitmap: move bitmap_{start,end}write to md upper layer
From: Yu Kuai <yukuai1@huaweicloud.com>
To: song@kernel.org,
	xni@redhat.com
Cc: linux-raid@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	yukuai3@huawei.com,
	yukuai1@huaweicloud.com,
	yi.zhang@huawei.com,
	yangerkun@huawei.com
Date: Mon, 18 Nov 2024 19:41:52 +0800

.
Subject: [RFC PATCH 0/6] KVM: x86: async PF user
From: Nikita Kalyazin <kalyazin@amazon.com>
To: <pbonzini@redhat.com>, <seanjc@google.com>, <corbet@lwn.net>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <hpa@zytor.com>, <rostedt@goodmis.org>,
	<mhiramat@kernel.org>, <mathieu.desnoyers@efficios.com>,
	<kvm@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-trace-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 12:39:42 +0000

.
Subject: [PATCH] arm64: disable ARCH_CORRECT_STACKTRACE_ON_KRETPROBE tests
From: Mark Rutland <mark.rutland@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: ardb@kernel.org,
	broonie@kernel.org,
	catalin.marinas@arm.com,
	jpoimboe@kernel.org,
	kaleshsingh@google.com,
	kristina.martsenko@arm.com,
	linux-kernel@vger.kernel.org,
	madvenka@linux.microsoft.com,
	mark.rutland@arm.com,
	maz@kernel.org,
	mbenes@suse.cz,
	mhiramat@kernel.org,
	puranjay12@gmail.com,
	rostedt@goodmis.org,
	will@kernel.org
Date: Mon, 18 Nov 2024 12:02:04 +0000

.
Subject: [PATCH v2 1/2] f2fs: fix changing cursegs if recovery fails on zoned device
From: Sheng Yong <shengyong@oppo.com>
To: jaegeuk@kernel.org,
	chao@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Sheng Yong <shengyong@oppo.com>,
	Song Feng <songfeng@oppo.com>,
	Yongpeng Yang <yangyongpeng1@oppo.com>
Date: Mon, 18 Nov 2024 20:05:16 +0800

.
Subject: [syzbot] [bcachefs?] KASAN: stack-out-of-bounds Read in do_encrypt
From: syzbot <syzbot+1e42728e2fb48752d6f2@syzkaller.appspotmail.com>
To: kent.overstreet@linux.dev, linux-bcachefs@vger.kernel.org, 
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 04:15:21 -0800

.
Subject: [PATCH v2 1/1] powerpc/8xx: Drop legacy-of-mm-gpiochip.h header
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Naveen N Rao <naveen@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>
Date: Mon, 18 Nov 2024 14:31:03 +0200

.
Subject: [syzbot] Monthly f2fs report (Nov 2024)
From: syzbot <syzbot+list9deb5e64e2106995cbb1@syzkaller.appspotmail.com>
To: chao@kernel.org, jaegeuk@kernel.org, 
	linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 04:39:22 -0800

.
Subject: [GIT PULL] ext4 updates for v6.13-rc1
From: "Theodore Ts'o" <tytso@mit.edu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Developers List <linux-kernel@vger.kernel.org>,
        Ext4 Developers List <linux-ext4@vger.kernel.org>
Date: Mon, 18 Nov 2024 07:39:42 -0500

The following changes since commit 42f7652d3eb527d03665b09edac47f85fb600924:

  Linux 6.12-rc4 (2024-10-20 15:19:38 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git tags/ext4_for_linus-6.13-rc1

for you to fetch changes up to 3e7c69cdb053f9edea95502853f35952ab6cbf06:

  jbd2: Fix comment describing journal_init_common() (2024-11-13 12:56:48 -0500)

----------------------------------------------------------------
A lot of miscellaneous ext4 bug fixes and cleanups this cycle, most
notably in the journaling code, bufered I/O, and compiler warning
cleanups.

----------------------------------------------------------------
Amir Goldstein (1):
      ext4: return error on syncfs after shutdown

Andy Shevchenko (1):
      ext4: mark ctx_*_flags() with __maybe_unused

Baokun Li (2):
      ext4: show the default enabled prefetch_block_bitmaps option
      ext4: WARN if a full dir leaf block has only one dentry

Brian Foster (2):
      ext4: partial zero eof block on unaligned inode size extension
      mm: zero range of eof folio exposed by inode size extension

Dan Carpenter (1):
      ext4: cleanup variable name in ext4_fc_del()

Daniel Martín Gómez (1):
      jbd2: Fix comment describing journal_init_common()

Gustavo A. R. Silva (1):
      jbd2: avoid dozens of -Wflex-array-member-not-at-end warnings

Jan Kara (1):
      ext4: avoid remount errors with 'abort' mount option

Jeongjun Park (1):
      ext4: supress data-race warnings in ext4_free_inodes_{count,set}()

Jiapeng Chong (1):
      ext4: simplify if condition

Jinliang Zheng (1):
      ext4: disambiguate the return value of ext4_dio_write_end_io()

Long Li (1):
      ext4: fix race in buffer_head read fault injection

Markus Elfring (1):
      ext4: Call ext4_journal_stop(handle) only once in ext4_dio_write_iter()

Mathieu Othacehe (1):
      ext4: prevent an infinite loop in the lazyinit thread

Nicolas Bretz (1):
      ext4: prevent delalloc to nodelalloc on remount

R Sundar (1):
      ext4: use string choices helpers

Theodore Ts'o (1):
      ext4: fix FS_IOC_GETFSMAP handling

Thorsten Blum (3):
      ext4: use str_yes_no() helper function
      ext4: annotate struct fname with __counted_by()
      ext4: use struct_size() to improve ext4_htree_store_dirent()

Ye Bin (6):
      jbd2: remove redundant judgments for check v1 checksum
      jbd2: unified release of buffer_head in do_one_pass()
      jbd2: refactor JBD2_COMMIT_BLOCK process in do_one_pass()
      jbd2: factor out jbd2_do_replay()
      jbd2: remove useless 'block_error' variable
      jbd2: remove the 'success' parameter from the jbd2_do_replay() function

Yu Jiaoliang (1):
      ext4: use ERR_CAST to return an error-valued pointer

Zhang Yi (1):
      ext4: don't pass full mapping flags to ext4_es_insert_extent()

Zhaoyang Huang (1):
      fs: ext4: Don't use CMA for buffer_head

Zhihao Cheng (1):
      jbd2: make b_frozen_data allocation always succeed

j.xia (1):
      ext4: pass write-hint for buffered IO

 fs/ext4/balloc.c         |   4 +-
 fs/ext4/dir.c            |   7 +-
 fs/ext4/ext4.h           |  12 +--
 fs/ext4/extents.c        |  13 +++-
 fs/ext4/extents_status.c |   8 +-
 fs/ext4/extents_status.h |   3 +-
 fs/ext4/fast_commit.c    |   8 +-
 fs/ext4/file.c           |  12 ++-
 fs/ext4/fsmap.c          |  54 ++++++++++++-
 fs/ext4/ialloc.c         |   5 +-
 fs/ext4/indirect.c       |   2 +-
 fs/ext4/inode.c          |  70 ++++++++++++-----
 fs/ext4/mballoc.c        |  22 ++++--
 fs/ext4/mballoc.h        |   1 +
 fs/ext4/mmp.c            |   2 +-
 fs/ext4/move_extent.c    |   2 +-
 fs/ext4/namei.c          |  18 ++++-
 fs/ext4/page-io.c        |   4 +-
 fs/ext4/resize.c         |   2 +-
 fs/ext4/super.c          |  80 ++++++++++++-------
 fs/jbd2/commit.c         |   4 -
 fs/jbd2/journal.c        |  15 ++--
 fs/jbd2/recovery.c       | 311 +++++++++++++++++++++++++++++++++++--------------------------------------
 include/linux/jbd2.h     |  15 ++--
 mm/truncate.c            |  15 ++++
 25 files changed, 402 insertions(+), 287 deletions(-)

.
Subject: [PATCH] virtio: remove the duplicate might_sleep()
From: xiaowuding_jaguarmicro <xiaowu.ding@jaguarmicro.com>
To: mst@redhat.com,
	jasowang@redhat.com
Cc: xuanzhuo@linux.alibaba.com,
	eperezma@redhat.com,
	virtualization@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	angus.chen@jaguarmicro.com,
	Xiaowu Ding <xiaowu.ding@jaguarmicro.com>
Date: Mon, 18 Nov 2024 20:40:56 +0800

.
Subject: [PATCH v2 0/1] KVM: arm64: Map GPU memory with no struct pages
From: <ankita@nvidia.com>
To: <ankita@nvidia.com>, <jgg@nvidia.com>, <maz@kernel.org>,
	<oliver.upton@linux.dev>, <joey.gouly@arm.com>, <suzuki.poulose@arm.com>,
	<yuzenghui@huawei.com>, <catalin.marinas@arm.com>, <will@kernel.org>,
	<ryan.roberts@arm.com>, <shahuang@redhat.com>, <lpieralisi@kernel.org>
Date: Mon, 18 Nov 2024 13:19:57 +0000

.
Subject: [PATCH] KVM: x86: async_pf: check earlier if can deliver async pf
From: Nikita Kalyazin <kalyazin@amazon.com>
To: <pbonzini@redhat.com>, <seanjc@google.com>, <tglx@linutronix.de>,
	<mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>,
	<hpa@zytor.com>, <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 13:04:03 +0000

.
Subject: [GIT PULL] m68k updates for v6.13
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org,
	linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Date: Mon, 18 Nov 2024 13:47:20 +0100

	Hi Linus,

The following changes since commit 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b:

  Linux 6.12-rc2 (2024-10-06 15:32:27 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git tags/m68k-for-v6.13-tag1

for you to fetch changes up to 647619b6bd27d2b7c3c6055f3f0d996e61884202:

  m68k: defconfig: Update defconfigs for v6.12-rc1 (2024-11-11 13:53:58 +0100)

----------------------------------------------------------------
m68k updates for v6.13

  - Revive SCSI and early console support on MVME147,
  - Fix early kernel parameters using static keys,
  - Prevent and improve handling of kernel configurations that lack
    specific platform, CPU, or MMU support, to avoid build failures,
  - Miscellaneous fixes and improvements,
  - Defconfig updates.

Thanks for pulling!

----------------------------------------------------------------
Arnd Bergmann (2):
      m68k: Move Sun 3 into a top-level platform option
      m68k: Select M68020 as fallback for classic

Daniel Palmer (3):
      m68k: mvme147: Make mvme147_sched_init() __init
      m68k: mvme147: Fix SCSI controller IRQ numbers
      m68k: mvme147: Reinstate early console

Geert Uytterhoeven (2):
      m68k: Make sure NR_IRQS is never zero
      m68k: defconfig: Update defconfigs for v6.12-rc1

Jean-Michel Hautbois (1):
      m68k: Initialize jump labels early during setup_arch()

Thorsten Blum (1):
      m68k: kernel: Use str_read_write() helper function

 arch/m68k/Kconfig                    | 11 +++++------
 arch/m68k/Kconfig.cpu                | 36 +++++++++++++++++++++++-------------
 arch/m68k/Kconfig.machine            | 25 -------------------------
 arch/m68k/configs/amiga_defconfig    |  1 +
 arch/m68k/configs/apollo_defconfig   |  1 +
 arch/m68k/configs/atari_defconfig    |  1 +
 arch/m68k/configs/bvme6000_defconfig |  1 +
 arch/m68k/configs/hp300_defconfig    |  1 +
 arch/m68k/configs/mac_defconfig      |  1 +
 arch/m68k/configs/multi_defconfig    |  1 +
 arch/m68k/configs/mvme147_defconfig  |  1 +
 arch/m68k/configs/mvme16x_defconfig  |  1 +
 arch/m68k/configs/q40_defconfig      |  1 +
 arch/m68k/configs/sun3_defconfig     |  1 +
 arch/m68k/configs/sun3x_defconfig    |  1 +
 arch/m68k/include/asm/irq.h          |  4 +---
 arch/m68k/include/asm/mvme147hw.h    |  4 ++--
 arch/m68k/kernel/Makefile            | 12 ++----------
 arch/m68k/kernel/early_printk.c      |  5 ++++-
 arch/m68k/kernel/setup_mm.c          |  6 +++++-
 arch/m68k/kernel/time.c              |  4 ++--
 arch/m68k/kernel/traps.c             | 16 ++++++++--------
 arch/m68k/mvme147/config.c           | 34 ++++++++++++++++++++++++++++++++--
 arch/m68k/mvme147/mvme147.h          |  6 ++++++
 24 files changed, 102 insertions(+), 73 deletions(-)
 create mode 100644 arch/m68k/mvme147/mvme147.h

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

.
Subject: [GIT PULL] gpio updates for v6.13-rc1
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Date: Mon, 18 Nov 2024 13:55:12 +0100

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Linus,

Here's the majority of changes for this merge window from the GPIO subsystem.

We have three new drivers, support for some new models in existing ones and
lots of various tweaks and improvements across the board (switching to using
recommended APIs, code shrink and simplification, etc.).

We also have a new feature in the character device uAPI where we now notify
the user-space about changes triggered by in-kernel users as well, not only
when they were done by other user-space agents.

Details are in the signed tag as usual.

The merge commits you'll see here were done to pull Intel changes from Andy,
MFD dependencies from Lee and to pull back upstream fixes to avoid conflicts.

The non-gpio commits in this PR are either pulled from the MFD tree or were
acked by relevant maintainers and concern the removal of a deprecated GPIO
symbol from various drivers across the kernel tree.

I will be picking up some more fixes over the course of this week so there'll
be another small PR in the second week.

Please pull.

Best Regards,
Bartosz Golaszewski

The following changes since commit 59b723cd2adbac2a34fc8e12c74ae26ae45bf230:

  Linux 6.12-rc6 (2024-11-03 14:05:52 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git tags/gpio-updates-for-v6.13-rc1

for you to fetch changes up to bef29ca3a6458582ac13320d47bf2646e5734dc8:

  gpio: tegra186: Allow to enable driver on Tegra234 (2024-11-18 11:45:06 +0100)

----------------------------------------------------------------
gpio updates for v6.13-rc1

GPIOLIB core:
- use the new mem_is_zero() instead of memchr_inv(s, 0, n)
- don't store debounce period twice needlessly
- clean-up debugfs handling
- remove leftover comments referring to no longer used spinlocks
- unduplicate some operations like SRCU locks and initializing GPIO descriptors
- constify the sysfs class struct
- use lock guards in GPIO sysfs code
- update GPIO uAPI internal flags all at once atomically for consistency with
  other places
- modify the behavior of the sysfs interface by no longer exporting lines that
  are named inside the driver code or board files with the sysfs links bearing
  the line names as this has for many years been largely unused due to the
  prevalence of DT, ACPI and firmware nodes over board files and made the API
  inconsistent
- for GPIO interrupt providers: free irqs that are still requested by users
  when removing the chip

GPIO uAPI:
- notify user-space about changes to GPIO lines' state (requested, released,
  reconfigured) triggered from the kernel as well (until now we'd only do
  this for changes triggered from user-space)
- to that end: modify the internal workings of the notification mechanism by
  switching to an atomic notifier which allows us to send events from atomic
  context
- also to that end store the debounce period in the GPIO descriptor struct
  and not in the character device context struct
- while at it, also cover the corner-case of users introducing changes over
  sysfs while others watch them via the character device
- don't report GPIO lines requested as interrupts as "used" to user-space as it
  can still request them as GPIOs

New drivers:
- add a driver for the GPIO functionality of the MFD Congatec Board Controller
- add a driver for the PolarFire GPIO controller
- add a driver supporting the GPIOs on FTDI FT2232H

Driver improvements:
- use generic device property accessors instead of OF-specific ones across
  many GPIO drivers (mpc8xxx, vf610, eic-sprd, davinci, ts4900, xilinx, mvebu)
- use devres helpers to simplify error paths and either shrink or entirely
  remove the driver's remove() callback (grgpio, amdpt, menz127, max730x,
  ftgpio010, 74x164, ljca)
- use helper variables to store the address of pdev->dev and avoid some
  line-breaks
- use device_for_each_child_node_scoped() to avoid having to put the fwnode
  on breaks or errors (gpio-sim, gpio-dwapb, gpiolib-acpi)
- use a scoped bitmap to simplify the code and drop goto labels in
  gpio-aggregator
- drop unneeded Kconfig dependencies on OF_GPIO (grgpio, mveby, xilinx)
- add support for new models to gpio-aspeed, gpio-rockchip and gpio-dwapb
- clean-up ACPI handling and some other bits in gpio-xgene-sb
- replace deprecated PCI functions in pcie-idio-24 and pci-idio-16
- allow to build davinci and mvebu drivers with COMPILE_TEST=y
- remove dead code in gpio-mb86s7x
- switch back to using platform_driver::remove() (after the conversion to
  remove_new()) across the GPIO drivers
- remove remaining uses of GPIOF_ACTIVE_LOW across the tree and drop this
  deprecated symbol
- convert the gpio-altera driver to no longer pull in the deprecated
  legacy-of-mm-gpiochip.h header
- use of_property_present() instead of of_property_read_bool() in gpiolib-of
  and gpio-rockchip
- allow to build the tegra186 driver on Tegra234 platforms in Kconfig

Late fixes:
- add a missing return value check after devm_kasprintf() to gpio-grgpio

DT bindings:
- document the ngpios property of gpio-mmio
- add support for a new aspeed model
- fix the example for st,nomadik-gpio

Other:
- kernel doc and comments tweaks
- fix typos in TODO
- reorder headers alphabetically in some drivers
- fix incorrect format specifiers in gpio tools

----------------------------------------------------------------
Andy Shevchenko (13):
      gpio: xgene-sb: Remove unneeded definitions for properties
      gpio: xgene-sb: Drop ACPI_PTR() and CONFIG_ACPI guards
      gpio: xgene-sb: Tidy up ACPI and OF ID tables
      gpio: xgene-sb: don't use "proxy" headers
      gpio: mpsse: Check for error code from devm_mutex_init() call
      gpio: altera: Drop legacy-of-mm-gpiochip.h header
      Input: gpio_keys - avoid using GPIOF_ACTIVE_LOW
      Input: gpio_keys_polled - avoid using GPIOF_ACTIVE_LOW
      leds: gpio: Avoid using GPIOF_ACTIVE_LOW
      pcmcia: soc_common: Avoid using GPIOF_ACTIVE_LOW
      USB: gadget: pxa27x_udc: Avoid using GPIOF_ACTIVE_LOW
      gpio: Get rid of GPIOF_ACTIVE_LOW
      gpiolib: cdev: use !mem_is_zero() instead of memchr_inv(s, 0, n)

Arnd Bergmann (1):
      gpiolib: avoid format string weakness in workqueue interface

Bartosz Golaszewski (52):
      gpio: free irqs that are still requested when the chip is being removed
      gpio: sysfs: make the sysfs export behavior consistent
      gpio: aggregator: simplify aggr_parse() with scoped bitmap
      gpio: mvebu: allow building the module with COMPILE_TEST=y
      gpio: mvebu: use generic device properties
      gpio: xilinx: drop dependency on GPIO_OF
      gpio: xilinx: use helper variable to store the address of pdev->dev
      gpio: xilinx: use generic device properties
      gpiolib: use v2 defines for line state change events
      gpiolib: unify two loops initializing GPIO descriptors
      gpio: cdev: update flags at once when reconfiguring from user-space
      Merge tag 'ib-mfd-gpio-i2c-watchdog-v6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next
      Merge tag 'v6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next
      gpio: mvebu: drop dependency on OF_GPIO
      gpio: ts4900: use generic device properties
      gpio: davinci: allow building the module with COMPILE_TEST=y
      gpio: davinci: use generic device properties
      gpio: eic-sprd: use generic device_get_match_data()
      gpio: vf610: use generic device_get_match_data()
      gpio: mpc8xxx: use a helper variable to store the address of pdev->dev
      gpio: mpc8xxx: use generic device_is_compatible()
      gpio: ljca: use devm_mutex_init() to simplify the error path and remove()
      gpio: sysfs: constify gpio class
      gpio: fold the Kconfig prompt into the option type for GPIO CDEV
      gpio: amdpt: remove remove()
      gpio: menz127: simplify error path and remove remove()
      gpio: 74x164: shrink code
      gpio: ftgpio010: shrink code
      gpio: max730x: use devres to shrink and simplify code
      gpiolib: notify user-space when a driver requests its own desc
      gpiolib: unduplicate chip guard in set_config path
      gpio: cdev: go back to storing debounce period in the GPIO descriptor
      gpio: cdev: prepare gpio_desc_to_lineinfo() for being called from atomic
      gpiolib: add a per-gpio_device line state notification workqueue
      gpio: cdev: put emitting the line state events on a workqueue
      gpiolib: switch the line state notifier to atomic
      gpiolib: notify user-space about in-kernel line state changes
      gpio: grgpio: drop Kconfig dependency on OF_GPIO
      gpio: grgpio: order headers alphabetically
      gpio: grgpio: use a helper variable to store the address of ofdev->dev
      gpio: grgpio: remove remove()
      gpiolib: fix a NULL-pointer dereference when setting direction
      gpiolib: remove leftover spinlock bits
      gpio: sysfs: demote warning messages on invalid user input to debug
      Merge tag 'v6.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next
      gpio: sysfs: use cleanup guards for gpiod_data::mutex
      gpio: sysfs: use cleanup guards for the sysfs_lock mutex
      gpio: sysfs: emit chardev line-state events on GPIO export
      gpio: sysfs: emit chardev line-state events on active-low changes
      gpio: sysfs: emit chardev line-state events on edge store
      gpio: cdev: don't report GPIOs requested as interrupts as used
      Merge tag 'intel-gpio-v6.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next

Billy Tsai (5):
      gpio: aspeed: Change the macro to support deferred probe
      gpio: aspeed: Remove the name for bank array
      gpio: aspeed: Create llops to handle hardware access
      dt-bindings: gpio: aspeed,ast2400-gpio: Support ast2700
      gpio: aspeed: Support G7 Aspeed gpio controller

Charles Han (1):
      gpio: grgpio: Add NULL check in grgpio_probe

Conor Dooley (2):
      MAINTAINERS: add gpio driver to PolarFire entry
      gpio: mpfs: add CoreGPIO support

Dan Carpenter (1):
      gpio: mb86s7x: remove some dead code in mb86s70_gpio_to_irq()

Javier Carrasco (3):
      gpio: acpi: switch to device_for_each_child_node_scoped()
      gpio: dwapb: switch to device_for_each_child_node_scoped()
      gpio: sim: switch to device_for_each_child_node_scoped()

Johan Hovold (1):
      gpiolib: clean up debugfs separator handling

Kent Gibson (2):
      gpiolib: cdev: Fix reference to linereq_set_config_unlocked()
      gpiolib: cdev: remove redundant store of debounce_period_us

Lars-Peter Clausen (1):
      gpio: tegra186: Allow to enable driver on Tegra234

Lewis Hanly (1):
      gpio: mpfs: add polarfire soc gpio support

Linus Walleij (1):
      dt-bindings: gpio-mmio: Add ngpios property

Luo Yifan (1):
      tools: gpio: Fix several incorrect format specifiers

Mary Strodl (1):
      gpio: add support for FTDI's MPSSE as GPIO

Rob Herring (Arm) (2):
      dt-bindings: gpio: st,nomadik-gpio: Add missing "#interrupt-cells" to example
      gpio: Use of_property_present() for non-boolean properties

Shivam Chaudhary (1):
      Fix typos in GPIO TODO document

Srikar Dronamraju (1):
      gpio: sloppy-logic-analyzer remove reference to rcu_momentary_dyntick_idle()

Thomas Richard (5):
      mfd: Add Congatec Board Controller driver
      gpio: Congatec Board Controller gpio driver
      i2c: Congatec Board Controller i2c bus driver
      watchdog: Congatec Board Controller watchdog timer driver
      MAINTAINERS: Add entry for Congatec Board Controller

Uwe Kleine-KÃ¶nig (1):
      gpio: Switch back to struct platform_driver::remove()

William Breathitt Gray (2):
      gpio: pci-idio-16: Replace deprecated PCI functions
      gpio: pcie-idio-24: Replace deprecated PCI functions

Ye Zhang (3):
      gpio: rockchip: explan the format of the GPIO version ID
      gpio: rockchip: change the GPIO version judgment logic
      gpio: rockchip: support new version GPIO

Yoshihiro Furudera (1):
      gpio: dwapb: Add ACPI HID for DWAPB GPIO controller on Fujitsu MONAKA

 .../bindings/gpio/aspeed,ast2400-gpio.yaml         |  19 +-
 .../devicetree/bindings/gpio/gpio-mmio.yaml        |  13 +-
 .../devicetree/bindings/gpio/st,nomadik-gpio.yaml  |   1 +
 MAINTAINERS                                        |  10 +
 drivers/gpio/Kconfig                               |  41 +-
 drivers/gpio/Makefile                              |   3 +
 drivers/gpio/TODO                                  |   4 +-
 drivers/gpio/gpio-74x164.c                         |  21 +-
 drivers/gpio/gpio-aggregator.c                     |  16 +-
 drivers/gpio/gpio-altera.c                         | 178 +++---
 drivers/gpio/gpio-amdpt.c                          |  10 +-
 drivers/gpio/gpio-aspeed.c                         | 618 +++++++++++++--------
 drivers/gpio/gpio-brcmstb.c                        |   2 +-
 drivers/gpio/gpio-cadence.c                        |   2 +-
 drivers/gpio/gpio-cgbc.c                           | 196 +++++++
 drivers/gpio/gpio-davinci.c                        |  10 +-
 drivers/gpio/gpio-dln2.c                           |   2 +-
 drivers/gpio/gpio-dwapb.c                          |   5 +-
 drivers/gpio/gpio-eic-sprd.c                       |   4 +-
 drivers/gpio/gpio-ftgpio010.c                      |  45 +-
 drivers/gpio/gpio-grgpio.c                         |  75 +--
 drivers/gpio/gpio-ljca.c                           |  17 +-
 drivers/gpio/gpio-lpc18xx.c                        |   2 +-
 drivers/gpio/gpio-max730x.c                        |  17 +-
 drivers/gpio/gpio-mb86s7x.c                        |   4 +-
 drivers/gpio/gpio-menz127.c                        |  58 +-
 drivers/gpio/gpio-mm-lantiq.c                      |   2 +-
 drivers/gpio/gpio-mpc5200.c                        |   4 +-
 drivers/gpio/gpio-mpc8xxx.c                        |  56 +-
 drivers/gpio/gpio-mpfs.c                           | 188 +++++++
 drivers/gpio/gpio-mpsse.c                          | 527 ++++++++++++++++++
 drivers/gpio/gpio-mvebu.c                          |   8 +-
 drivers/gpio/gpio-omap.c                           |   2 +-
 drivers/gpio/gpio-pci-idio-16.c                    |  17 +-
 drivers/gpio/gpio-pcie-idio-24.c                   |  19 +-
 drivers/gpio/gpio-rcar.c                           |   2 +-
 drivers/gpio/gpio-rockchip.c                       |  28 +-
 drivers/gpio/gpio-sim.c                            |   7 +-
 drivers/gpio/gpio-sloppy-logic-analyzer.c          |   2 +-
 drivers/gpio/gpio-tb10x.c                          |   2 +-
 drivers/gpio/gpio-ts4900.c                         |   6 +-
 drivers/gpio/gpio-ts5500.c                         |   2 +-
 drivers/gpio/gpio-uniphier.c                       |   2 +-
 drivers/gpio/gpio-vf610.c                          |   7 +-
 drivers/gpio/gpio-xgene-sb.c                       |  39 +-
 drivers/gpio/gpio-xgs-iproc.c                      |   2 +-
 drivers/gpio/gpio-xilinx.c                         |  51 +-
 drivers/gpio/gpio-zynq.c                           |   2 +-
 drivers/gpio/gpiolib-acpi.c                        |   4 +-
 drivers/gpio/gpiolib-cdev.c                        | 384 ++++++-------
 drivers/gpio/gpiolib-legacy.c                      |   3 -
 drivers/gpio/gpiolib-of.c                          |   2 +-
 drivers/gpio/gpiolib-sysfs.c                       | 182 +++---
 drivers/gpio/gpiolib.c                             | 202 +++++--
 drivers/gpio/gpiolib.h                             |  14 +-
 drivers/i2c/busses/Kconfig                         |  10 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-cgbc.c                      | 406 ++++++++++++++
 drivers/input/keyboard/gpio_keys.c                 |  10 +-
 drivers/input/keyboard/gpio_keys_polled.c          |  12 +-
 drivers/leds/leds-gpio.c                           |   9 +-
 drivers/mfd/Kconfig                                |  12 +
 drivers/mfd/Makefile                               |   1 +
 drivers/mfd/cgbc-core.c                            | 411 ++++++++++++++
 drivers/pcmcia/soc_common.c                        |  12 +-
 drivers/usb/gadget/udc/pxa27x_udc.c                |   7 +-
 drivers/watchdog/Kconfig                           |  10 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/cgbc_wdt.c                        | 211 +++++++
 include/linux/gpio.h                               |   3 -
 include/linux/mfd/cgbc.h                           |  44 ++
 tools/gpio/gpio-event-mon.c                        |   8 +-
 tools/gpio/gpio-sloppy-logic-analyzer.sh           |   2 +-
 73 files changed, 3245 insertions(+), 1064 deletions(-)
 create mode 100644 drivers/gpio/gpio-cgbc.c
 create mode 100644 drivers/gpio/gpio-mpfs.c
 create mode 100644 drivers/gpio/gpio-mpsse.c
 create mode 100644 drivers/i2c/busses/i2c-cgbc.c
 create mode 100644 drivers/mfd/cgbc-core.c
 create mode 100644 drivers/watchdog/cgbc_wdt.c
 create mode 100644 include/linux/mfd/cgbc.h

.
Subject: [PATCH net-next v3 0/8] net: lan969x: add RGMII support
From: Daniel Machon <daniel.machon@microchip.com>
To: <UNGLinuxDriver@microchip.com>, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, "Lars
 Povlsen" <lars.povlsen@microchip.com>, Steen Hegelund
	<Steen.Hegelund@microchip.com>, Horatiu Vultur
	<horatiu.vultur@microchip.com>, Russell King <linux@armlinux.org.uk>,
	<jacob.e.keller@intel.com>, <robh@kernel.org>, <krzk+dt@kernel.org>,
	<conor+dt@kernel.org>
Date: Mon, 18 Nov 2024 14:00:46 +0100

.
Subject: [GIT PULL] RAS updates for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 14:01:10 +0100

Hi Linus,

please pull the RAS updates for v6.13.

Thx.

---

The following changes since commit 81983758430957d9a5cb3333fe324fd70cf63e7e:

  Linux 6.12-rc5 (2024-10-27 12:52:02 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip tags/ras_core_for_v6.13

for you to fetch changes up to 612c2addff367ee461dc99ffca2bc786f105d2ec:

  EDAC/mce_amd: Add support for FRU text in MCA (2024-10-31 10:53:04 +0100)

----------------------------------------------------------------
- Log and handle twp new AMD-specific MCA registers: SYND1 and SYND2 and
  report the Field Replaceable Unit text info reported through them

- Add support for handling variable-sized SMCA BERT records

- Add the capability for reporting vendor-specific RAS error info without
  adding vendor-specific fields to struct mce

- Cleanups

----------------------------------------------------------------
Avadhut Naik (2):
      x86/mce: Add wrapper for struct mce to export vendor specific info
      x86/MCE/AMD: Add support for new MCA_SYND{1,2} registers

Qiuxu Zhuo (2):
      x86/mce/mcelog: Use xchg() to get and clear the flags
      x86/mce/intel: Use MCG_BANKCNT_MASK instead of 0xff

Steven Rostedt (1):
      tracing: Add __print_dynamic_array() helper

Yazen Ghannam (2):
      x86/mce/apei: Handle variable SMCA BERT record size
      EDAC/mce_amd: Add support for FRU text in MCA

 arch/x86/include/asm/mce.h                 |  36 ++++-
 arch/x86/include/uapi/asm/mce.h            |   3 +-
 arch/x86/kernel/cpu/mce/amd.c              |  30 ++--
 arch/x86/kernel/cpu/mce/apei.c             | 107 ++++++++++----
 arch/x86/kernel/cpu/mce/core.c             | 216 ++++++++++++++++-------------
 arch/x86/kernel/cpu/mce/dev-mcelog.c       |  11 +-
 arch/x86/kernel/cpu/mce/genpool.c          |  18 +--
 arch/x86/kernel/cpu/mce/inject.c           |   6 +-
 arch/x86/kernel/cpu/mce/intel.c            |   2 +-
 arch/x86/kernel/cpu/mce/internal.h         |   4 +-
 drivers/edac/mce_amd.c                     |  22 ++-
 include/trace/events/mce.h                 |  49 ++++---
 include/trace/stages/stage3_trace_output.h |   8 ++
 include/trace/stages/stage7_class_define.h |   1 +
 samples/trace_events/trace-events-sample.h |   7 +-
 15 files changed, 329 insertions(+), 191 deletions(-)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: [PATCH v2 00/21] Imagination BXS-4-64 MC1 GPU support
From: Matt Coster <matt.coster@imgtec.com>
To: Frank Binns <frank.binns@imgtec.com>,
        Matt Coster
	<matt.coster@imgtec.com>,
        David Airlie <airlied@gmail.com>, Simona Vetter
	<simona@ffwll.ch>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>, Rob Herring <robh@kernel.org>,
        Krzysztof Kozlowski <krzk+dt@kernel.org>,
        Conor Dooley <conor+dt@kernel.org>, Nishanth Menon <nm@ti.com>,
        "Vignesh
 Raghavendra" <vigneshr@ti.com>,
        Tero Kristo <kristo@kernel.org>
Date: Mon, 18 Nov 2024 13:01:52 +0000

.
Subject: [GIT PULL] livepatching for 6.13
From: Petr Mladek <pmladek@suse.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org
Date: Mon, 18 Nov 2024 14:04:19 +0100

Hi Linus,

please pull the latest changes for the kernel livepatching from

  git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git tags/livepatching-for-6.13

=============================================

- A new selftest for livepatching of a kprobed function.

----------------------------------------------------------------
Michael Vetter (3):
      selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR
      selftests: livepatch: save and restore kprobe state
      selftests: livepatch: test livepatching a kprobed function

 tools/testing/selftests/livepatch/Makefile         |  3 +-
 tools/testing/selftests/livepatch/functions.sh     | 29 ++++++----
 .../testing/selftests/livepatch/test-callbacks.sh  | 24 ++++-----
 tools/testing/selftests/livepatch/test-ftrace.sh   |  2 +-
 tools/testing/selftests/livepatch/test-kprobe.sh   | 62 ++++++++++++++++++++++
 .../testing/selftests/livepatch/test-livepatch.sh  | 12 ++---
 tools/testing/selftests/livepatch/test-state.sh    |  8 +--
 tools/testing/selftests/livepatch/test-syscall.sh  |  6 +--
 tools/testing/selftests/livepatch/test-sysfs.sh    |  8 +--
 .../selftests/livepatch/test_modules/Makefile      |  3 +-
 .../livepatch/test_modules/test_klp_kprobe.c       | 38 +++++++++++++
 11 files changed, 152 insertions(+), 43 deletions(-)
 create mode 100755 tools/testing/selftests/livepatch/test-kprobe.sh
 create mode 100644 tools/testing/selftests/livepatch/test_modules/test_klp_kprobe.c

.
Subject: [PATCH v2] arm64: qcom: qcs8300: Add ADSP and CDSP0 fastrpc nodes
From: Ling Xu <quic_lxu5@quicinc.com>
To: <andersson@kernel.org>, <konradybcio@kernel.org>, <robh@kernel.org>,
        <krzk+dt@kernel.org>, <conor+dt@kernel.org>
Date: Mon, 18 Nov 2024 18:33:43 +0530

.
Subject: drivers/clk/davinci/psc.c:281:10: error: incompatible integer to
 pointer conversion returning 'int' from a function with result type 'struct
 davinci_lpsc_clk *' [-Wint-conversion]
From: Naresh Kamboju <naresh.kamboju@linaro.org>
To: linux-clk <linux-clk@vger.kernel.org>, clang-built-linux <llvm@lists.linux.dev>, 
	open list <linux-kernel@vger.kernel.org>, lkft-triage@lists.linaro.org, 
	Linux Regressions <regressions@lists.linux.dev>
Cc: hanchunchao@inspur.com, Stephen Boyd <sboyd@kernel.org>, david@lechnology.com, 
	Michael Turquette <mturquette@baylibre.com>, Arnd Bergmann <arnd@arndb.de>, 
	Dan Carpenter <dan.carpenter@linaro.org>, Anders Roxell <anders.roxell@linaro.org>
Date: Mon, 18 Nov 2024 18:40:38 +0530

.
Subject: [GIT PULL] power sequencing updates for v6.13-rc1
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Date: Mon, 18 Nov 2024 14:21:24 +0100

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Linus,

Please pull the following set of changes for the power sequencing subsystem.
The first commit makes the QCom WCN pwrseq driver depend on CONFIG_OF and
the second extends its support for the wcn6855 BT/WLAN chip.

Best Regards,
Bartosz Golaszewski

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git tags/pwrseq-updates-for-v6.13-rc1

for you to fetch changes up to bd4c8bafcf50b6bd415c8bf04e98ebfba78071f9:

  power: sequencing: qcom-wcn: improve support for wcn6855 (2024-10-25 09:59:30 +0200)

----------------------------------------------------------------
power sequencing updates for v6.13-rc1

- extend support for the wcn6855 model in the pwrseq-qcom-wcn driver
- make this driver depend on CONFIG_OF=y as it uses some very
  OF-specific interfaces and depends on phandle parsing

----------------------------------------------------------------
Bartosz Golaszewski (2):
      power: sequencing: make the QCom PMU pwrseq driver depend on CONFIG_OF
      power: sequencing: qcom-wcn: improve support for wcn6855

 drivers/power/sequencing/Kconfig           |   1 +
 drivers/power/sequencing/pwrseq-qcom-wcn.c | 101 ++++++++++++++++++++++++++++-
 2 files changed, 99 insertions(+), 3 deletions(-)

.
Subject: [PATCH net-next 0/1] net/smc: Optimize rmbs/sndbufs lock
From: liqiang <liqiang64@huawei.com>
To: <wenjia@linux.ibm.com>, <jaka@linux.ibm.com>, <alibuda@linux.alibaba.com>,
	<tonylu@linux.alibaba.com>, <guwen@linux.alibaba.com>,
	<dust.li@linux.alibaba.com>
Date: Mon, 18 Nov 2024 21:21:46 +0800

.
Subject: [GIT PULL] MMC and MEMSTICK updates for v6.13
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Linus <torvalds@linux-foundation.org>,
	linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Date: Mon, 18 Nov 2024 14:26:13 +0100

Hi Linus,

Here's the pull-request with updates for MMC and MEMSTICK for v6.13. Details
about the highlights are as usual found in the signed tag.

Please pull this in!

Kind regards
Ulf Hansson


The following changes since commit 1635e407a4a64d08a8517ac59ca14ad4fc785e75:

  Revert "mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K" (2024-11-12 19:40:40 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git tags/mmc-v6.13

for you to fetch changes up to c0baf6ead75d6db16798ae48a4ac38c3af4e9280:

  mmc: Merge branch fixes into next (2024-11-12 19:41:24 +0100)

----------------------------------------------------------------
MMC core:
 - Add support for Ultra Capacity SD cards (SDUC, 2TB to 128TB)
 - Add support for Ultra High-Speed II SD cards (UHS-II)
 - Use a reset control for pwrseq_simple
 - Add SD card quirk for broken poweroff notification
 - Use GFP_NOIO for SD ACMD22

MMC host:
 - bcm2835: Introduce proper clock handling
 - mtk-sd: Add support for the Host-Software-Queue interface
 - mtk-sd: Add support for the mt7988/mt8196 variants
 - mtk-sd: Fix a couple of error paths in ->probe()
 - sdhci: Add interface to support UHS-II SD cards
 - sdhci_am654: Fixup support for changing the signal voltage level
 - sdhci-cadence: Add support for the Microchip PIC64GX variant
 - sdhci-esdhc-imx: Add support for eMMC HW-reset
 - sdhci-msm: Add support for the X1E80100/IPQ5424/SAR2130P/QCS615 variants
 - sdhci-of-arasan: Add support for eMMC HW-reset
 - sdhci-pci-gli: Add UHS-II support for the GL9767/GL9755 variants

MEMSTICK:
 - A couple of minor updates

----------------------------------------------------------------
Abel Vesa (1):
      dt-bindings: mmc: sdhci-msm: Document the X1E80100 SDHCI Controller

Andy-ld Lu (5):
      dt-bindings: mmc: mtk-sd: Add support for MT8196
      mmc: mtk-sd: Add stop_dly_sel and pop_en_cnt to platform data
      mmc: mtk-sd: Add support for MT8196
      mmc: mtk-sd: Fix error handle of probe function
      mmc: mtk-sd: Fix MMC_CAP2_CRYPTO flag setting

AngeloGioacchino Del Regno (1):
      mmc: mtk-sd: Implement Host Software Queue for eMMC and SD Card

Avri Altman (11):
      mmc: sd: SDUC Support Recognition
      mmc: sd: Add Extension memory addressing
      mmc: core: Don't use close-ended rw for SDUC
      mmc: core: Add open-ended Ext memory addressing
      mmc: core: Allow mmc erase to carry large addresses
      mmc: core: Add Ext memory addressing for erase
      mmc: core: Adjust ACMD22 to SDUC
      mmc: core: Disable SDUC for mmc_test
      mmc: core: Prevent HSQ from enabling for SDUC
      mmc: core: Enable SDUC
      mmc: core: Use GFP_NOIO in ACMD22

Bartosz Golaszewski (3):
      mmc: davinci: order includes alphabetically
      mmc: davinci: use generic device_get_match_data()
      mmc: mmc_spi: drop buggy snprintf()

Ben Chuang (2):
      mmc: sdhci-uhs2: add pre-detect_init hook
      mmc: sdhci-uhs2: Remove unnecessary NULL check

Catalin Popescu (1):
      mmc: pwrseq_simple: add support for one reset control

Christophe JAILLET (1):
      memstick: Constify struct memstick_device_id

Dmitry Baryshkov (1):
      dt-bindings: mmc: sdhci-msm: Add SAR2130P compatible

Frank Wunderlich (2):
      dt-bindings: mmc: mtk-sd: Add mt7988 SoC
      mmc: mtk-sd: add support for mt7988

Geert Uytterhoeven (1):
      mmc: sdhci: Make MMC_SDHCI_UHS2 config symbol invisible

Josua Mayer (2):
      mmc: sdhci-esdhc-imx: Implement emmc hardware reset
      mmc: sdhci-esdhc-imx: Update esdhc sysctl dtocv bitmask

Judith Mendez (1):
      mmc: sdhci_am654: Add sdhci_am654_start_signal_voltage_switch

Keita Aihara (1):
      mmc: core: Add SD card quirk for broken poweroff notification

Paul Alvin (1):
      mmc: sdhci-of-arasan: Support for emmc hardware reset

Peng Fan (1):
      mmc: sdhci-esdhc-imx: enable quirks SDHCI_QUIRK_NO_LED

Pierre-Henry Moussay (2):
      dt-bindings: mmc: cdns: document Microchip PIC64GX MMC/SDHCI controller
      dt-bindings: mmc: cdns,sdhci: ref sdhci-common.yaml

Rosen Penev (3):
      mmc: mtk-sd: use devm_mmc_alloc_host
      mmc: mtd-sd: use devm_platform_ioremap_resource
      mmc: mtk-sd: fix devm_clk_get_optional usage

Sricharan Ramabadhran (1):
      dt-bindings: mmc: sdhci-msm: add IPQ5424 compatible

Stefan Wahren (3):
      mmc: bcm2835: Fix type of current clock speed
      mmc: bcm2835: Introduce proper clock handling
      mmc: pwrseq_simple: Handle !RESET_CONTROLLER properly

Ulf Hansson (9):
      mmc: core: Cleanup printing of speed mode at card insertion
      mmc: core: Prepare to support SD UHS-II cards
      mmc: core: Announce successful insertion of an SD UHS-II card
      mmc: core: Extend support for mmc regulators with a vqmmc2
      mmc: Merge branch fixes into next
      mmc: core: Simplify sd_uhs2_power_up()
      mmc: core: Add error handling of sd_uhs2_power_up()
      mmc: core: Fix error paths for UHS-II card init and re-init
      mmc: Merge branch fixes into next

Uwe Kleine-KÃ¶nig (1):
      mmc: Switch back to struct platform_driver::remove()

Victor Shih (22):
      mmc: core: Add definitions for SD UHS-II cards
      mmc: core: Factor out some of the code in mmc_go_idle()
      mmc: core: Support UHS-II card control and access
      mmc: sdhci: add UHS-II related definitions in headers
      mmc: sdhci: add UHS-II module and add a kernel configuration
      mmc: sdhci-uhs2: dump UHS-II registers
      mmc: sdhci-uhs2: add reset function
      mmc: sdhci-uhs2: add set_power() to support vdd2
      mmc: sdhci-uhs2: add set_timeout()
      mmc: sdhci-uhs2: add add_host() and others to set up the driver
      mmc: sdhci-uhs2: add set_ios()
      mmc: sdhci-uhs2: add related functions to initialize the interface
      mmc: sdhci-uhs2: add irq() and others
      mmc: sdhci-uhs2: add request() and others
      mmc: sdhci-pci: add UHS-II support framework
      mmc: sdhci-pci-gli: enable UHS-II mode for GL9755
      mmc: sdhci-pci-gli: enable UHS-II mode for GL9767
      mmc: sdhci-uhs2: Correct incorrect type in argument
      mmc: sdhci-uhs2: Remove unnecessary variables
      mmc: sdhci-uhs2: correction a warning caused by incorrect type in argument
      mmc: core: Correct type in variable assignment for UHS-II
      mmc: core: Correction a warning caused by incorrect type in assignment for UHS-II

Wolfram Sang (1):
      mmc: sh_mmcif: correctly report success when obtaining DMA channels

Yu Jiaoliang (2):
      memstick: Fix typo in comment
      mmc: host: Fix typos in comments across various files

Yuanjie Yang (1):
      dt-bindings: mmc: Add sdhci compatible for QCS615

 .../devicetree/bindings/mmc/cdns,sdhci.yaml        |    3 +-
 Documentation/devicetree/bindings/mmc/mtk-sd.yaml  |   24 +
 .../devicetree/bindings/mmc/sdhci-msm.yaml         |    4 +
 drivers/memstick/core/memstick.c                   |    4 +-
 drivers/memstick/core/ms_block.c                   |    8 +-
 drivers/memstick/core/mspro_block.c                |    2 +-
 drivers/memstick/host/r592.c                       |    2 +-
 drivers/mmc/core/Makefile                          |    2 +-
 drivers/mmc/core/block.c                           |   39 +-
 drivers/mmc/core/bus.c                             |   42 +-
 drivers/mmc/core/card.h                            |   10 +
 drivers/mmc/core/core.c                            |   73 +-
 drivers/mmc/core/core.h                            |   17 +-
 drivers/mmc/core/mmc_ops.c                         |   24 +-
 drivers/mmc/core/mmc_ops.h                         |    1 +
 drivers/mmc/core/mmc_test.c                        |    6 +
 drivers/mmc/core/pwrseq_emmc.c                     |    2 +-
 drivers/mmc/core/pwrseq_sd8787.c                   |    2 +-
 drivers/mmc/core/pwrseq_simple.c                   |   48 +-
 drivers/mmc/core/quirks.h                          |    9 +
 drivers/mmc/core/regulator.c                       |   34 +
 drivers/mmc/core/sd.c                              |   44 +-
 drivers/mmc/core/sd.h                              |    4 +-
 drivers/mmc/core/sd_ops.c                          |   24 +
 drivers/mmc/core/sd_ops.h                          |    3 +
 drivers/mmc/core/sd_uhs2.c                         | 1304 ++++++++++++++++++++
 drivers/mmc/core/sdio.c                            |    2 +-
 drivers/mmc/host/Kconfig                           |   11 +
 drivers/mmc/host/Makefile                          |    1 +
 drivers/mmc/host/alcor.c                           |    2 +-
 drivers/mmc/host/atmel-mci.c                       |    4 +-
 drivers/mmc/host/au1xmmc.c                         |    4 +-
 drivers/mmc/host/bcm2835.c                         |   33 +-
 drivers/mmc/host/cavium-octeon.c                   |    4 +-
 drivers/mmc/host/cb710-mmc.c                       |    2 +-
 drivers/mmc/host/davinci_mmc.c                     |   25 +-
 drivers/mmc/host/dw_mmc-bluefield.c                |    2 +-
 drivers/mmc/host/dw_mmc-exynos.c                   |    2 +-
 drivers/mmc/host/dw_mmc-hi3798cv200.c              |    2 +-
 drivers/mmc/host/dw_mmc-hi3798mv200.c              |    2 +-
 drivers/mmc/host/dw_mmc-k3.c                       |    2 +-
 drivers/mmc/host/dw_mmc-pltfm.c                    |    2 +-
 drivers/mmc/host/dw_mmc-rockchip.c                 |    2 +-
 drivers/mmc/host/dw_mmc-starfive.c                 |    2 +-
 drivers/mmc/host/dw_mmc.c                          |    2 +-
 drivers/mmc/host/jz4740_mmc.c                      |    2 +-
 drivers/mmc/host/litex_mmc.c                       |    2 +-
 drivers/mmc/host/meson-gx-mmc.c                    |    4 +-
 drivers/mmc/host/meson-mx-sdhc-mmc.c               |    2 +-
 drivers/mmc/host/meson-mx-sdio.c                   |    2 +-
 drivers/mmc/host/mmc_spi.c                         |    9 +-
 drivers/mmc/host/mmci.h                            |    2 +-
 drivers/mmc/host/moxart-mmc.c                      |    2 +-
 drivers/mmc/host/mtk-sd.c                          |  292 +++--
 drivers/mmc/host/mvsdio.c                          |    2 +-
 drivers/mmc/host/mxcmmc.c                          |    2 +-
 drivers/mmc/host/mxs-mmc.c                         |    2 +-
 drivers/mmc/host/omap.c                            |    2 +-
 drivers/mmc/host/omap_hsmmc.c                      |    2 +-
 drivers/mmc/host/owl-mmc.c                         |    2 +-
 drivers/mmc/host/pxamci.c                          |    2 +-
 drivers/mmc/host/renesas_sdhi_internal_dmac.c      |    2 +-
 drivers/mmc/host/renesas_sdhi_sys_dmac.c           |    2 +-
 drivers/mmc/host/rtsx_pci_sdmmc.c                  |    2 +-
 drivers/mmc/host/rtsx_usb_sdmmc.c                  |    2 +-
 drivers/mmc/host/sdhci-acpi.c                      |    2 +-
 drivers/mmc/host/sdhci-bcm-kona.c                  |    2 +-
 drivers/mmc/host/sdhci-brcmstb.c                   |    2 +-
 drivers/mmc/host/sdhci-cadence.c                   |    2 +-
 drivers/mmc/host/sdhci-dove.c                      |    2 +-
 drivers/mmc/host/sdhci-esdhc-imx.c                 |   31 +-
 drivers/mmc/host/sdhci-esdhc-mcf.c                 |    2 +-
 drivers/mmc/host/sdhci-iproc.c                     |    2 +-
 drivers/mmc/host/sdhci-milbeaut.c                  |    2 +-
 drivers/mmc/host/sdhci-msm.c                       |    4 +-
 drivers/mmc/host/sdhci-npcm.c                      |    2 +-
 drivers/mmc/host/sdhci-of-arasan.c                 |   20 +-
 drivers/mmc/host/sdhci-of-aspeed.c                 |    4 +-
 drivers/mmc/host/sdhci-of-at91.c                   |    2 +-
 drivers/mmc/host/sdhci-of-dwcmshc.c                |    2 +-
 drivers/mmc/host/sdhci-of-esdhc.c                  |    2 +-
 drivers/mmc/host/sdhci-of-hlwd.c                   |    2 +-
 drivers/mmc/host/sdhci-of-ma35d1.c                 |    2 +-
 drivers/mmc/host/sdhci-of-sparx5.c                 |    2 +-
 drivers/mmc/host/sdhci-omap.c                      |    2 +-
 drivers/mmc/host/sdhci-pci-core.c                  |   16 +-
 drivers/mmc/host/sdhci-pci-gli.c                   |  437 ++++++-
 drivers/mmc/host/sdhci-pci.h                       |    3 +
 drivers/mmc/host/sdhci-pic32.c                     |    2 +-
 drivers/mmc/host/sdhci-pxav2.c                     |    2 +-
 drivers/mmc/host/sdhci-pxav3.c                     |    2 +-
 drivers/mmc/host/sdhci-s3c.c                       |    2 +-
 drivers/mmc/host/sdhci-spear.c                     |    2 +-
 drivers/mmc/host/sdhci-sprd.c                      |    2 +-
 drivers/mmc/host/sdhci-st.c                        |    2 +-
 drivers/mmc/host/sdhci-tegra.c                     |    2 +-
 drivers/mmc/host/sdhci-uhs2.c                      | 1250 +++++++++++++++++++
 drivers/mmc/host/sdhci-uhs2.h                      |  188 +++
 drivers/mmc/host/sdhci-xenon.c                     |    2 +-
 drivers/mmc/host/sdhci.c                           |  281 +++--
 drivers/mmc/host/sdhci.h                           |   75 +-
 drivers/mmc/host/sdhci_am654.c                     |   32 +-
 drivers/mmc/host/sdhci_f_sdh30.c                   |    2 +-
 drivers/mmc/host/sh_mmcif.c                        |    7 +-
 drivers/mmc/host/sunplus-mmc.c                     |    2 +-
 drivers/mmc/host/sunxi-mmc.c                       |    2 +-
 drivers/mmc/host/uniphier-sd.c                     |    2 +-
 drivers/mmc/host/usdhi6rol0.c                      |    2 +-
 drivers/mmc/host/wbsd.c                            |    2 +-
 drivers/mmc/host/wmt-sdmmc.c                       |    2 +-
 include/linux/memstick.h                           |    2 +-
 include/linux/mmc/card.h                           |   39 +-
 include/linux/mmc/core.h                           |   21 +
 include/linux/mmc/host.h                           |   80 ++
 include/linux/mmc/sd.h                             |    4 +
 include/linux/mmc/sd_uhs2.h                        |  240 ++++
 116 files changed, 4580 insertions(+), 398 deletions(-)
 create mode 100644 drivers/mmc/core/sd_uhs2.c
 create mode 100644 drivers/mmc/host/sdhci-uhs2.c
 create mode 100644 drivers/mmc/host/sdhci-uhs2.h
 create mode 100644 include/linux/mmc/sd_uhs2.h

.
Subject: [GIT PULL] regmap updates for v6.13
From: Mark Brown <broonie@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Date: Mon, 18 Nov 2024 13:32:32 +0000

The following changes since commit 8e929cb546ee42c9a61d24fae60605e9e3192354:

  Linux 6.12-rc3 (2024-10-13 14:33:32 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-v6.13

for you to fetch changes up to d1f4390dd28ba110f232615dc4610ac1bb2f39f2:

  regmap: provide regmap_assign_bits() (2024-11-08 15:39:31 +0000)

----------------------------------------------------------------
regmap: Updates for v6.13

The main thing for regmap this time around is some improvements of the
lockdep annotations which stop some false positives.  We also have one
new helper for setting a bitmask to the same value, and several test
improvements.

----------------------------------------------------------------
Andy Shevchenko (2):
      regmap-irq: Consistently use memset32() in regmap_irq_thread()
      regmap: irq: Set lockdep class for hierarchical IRQ domains

Bartosz Golaszewski (1):
      regmap: provide regmap_assign_bits()

Cheng-Cheng Lo (1):
      regmap: kunit: Fix repeated test param

Cristian Ciocaltea (1):
      regmap: maple: Provide lockdep (sub)class for maple tree's internal lock

Mark Brown (3):
      regmap: Specifically test writing 0 as a value to sparse caches
      regcache: Improve documentation of available cache types
      regmap: Merge up fixes from v6.12-rc3

 drivers/base/regmap/internal.h       |  1 +
 drivers/base/regmap/regcache-maple.c |  3 +++
 drivers/base/regmap/regmap-irq.c     |  9 ++++----
 drivers/base/regmap/regmap-kunit.c   | 45 +++++++++++++++++++++++++++++++++++-
 drivers/base/regmap/regmap.c         |  1 +
 include/linux/regmap.h               | 25 +++++++++++++++++++-
 6 files changed, 78 insertions(+), 6 deletions(-)

.
Subject: [GIT PULL] regulator updates for v6.13
From: Mark Brown <broonie@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Date: Mon, 18 Nov 2024 13:32:49 +0000

The following changes since commit 42f7652d3eb527d03665b09edac47f85fb600924:

  Linux 6.12-rc4 (2024-10-20 15:19:38 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git tags/regulator-v6.13

for you to fetch changes up to 21ccadc64dae18bd092f1255bdbaf595f53381d5:

  regulator: dt-bindings: qcom,rpmh: Correct PM8550VE supplies (2024-11-13 13:53:14 +0000)

----------------------------------------------------------------
regulator: Updates for v6.13

This was a quite quiet release for regulators on the drivers front, but
we do have two small but useful core improvements:

 - Improve handling of cases where DT platforms specify both DT and
   init_data based configuration for a single regulator.
 - A helper of_regulator_get_optional() to simplify writing generic
   bindings for regulator consumers in subsystems.

There's also some YAML conversions for the DT bindings which are a big
part of the diffstat.

----------------------------------------------------------------
Anna-Maria Behnsen (1):
      regulator: core: Use fsleep() to get best sleep mechanism

Bartosz Golaszewski (1):
      regulator: dt-bindings: qcom,qca6390-pmu: add more properties for wcn6855

Chen-Yu Tsai (2):
      regulator: Add of_regulator_get_optional() for pure DT regulator lookup
      regulator: Add devres version of of_regulator_get_optional()

Dragan Simic (3):
      regulator: rk808: Perform trivial code cleanups
      regulator: rk808: Use dev_err_probe() in the probe path
      regulator: rk808: Restrict DVS GPIOs to the RK808 variant only

Heiko Stuebner (1):
      regulator: dt-bindings: vctrl-regulator: convert to YAML

Jerome Brunet (5):
      regulator: core: do not silently ignore provided init_data
      regulator: core: add callback to perform runtime init
      regulator: core: remove machine init callback from config
      regulator: doc: add missing documentation for init_cb
      regulator: doc: remove documentation comment for regulator_init

Marek Vasut (1):
      regulator: dt-bindings: lltc,ltc3676: convert to YAML

Mark Brown (3):
      Add of_regulator_get_optional() and Fix MTK Power
      regulator: Merge up v6.12-rc2
      regulator: init_data handling update

Markus Elfring (1):
      regulator: Call of_node_put() only once in rzg2l_usb_vbus_regulator_probe()

Melody Olvera (1):
      regulator: dt-bindings: qcom,rpmh: Correct PM8550VE supplies

Min-Hua Chen (1):
      regulator: qcom-smd: make smd_vreg_rpm static

Patrick Rudolph (1):
      regulator: max5970: Drop unused structs

Uwe Kleine-KÃ¶nig (2):
      regulator: isl6271a: Drop explicit initialization of struct i2c_device_id::driver_data to 0
      regulator: Switch back to struct platform_driver::remove()

 .../bindings/regulator/lltc,ltc3676.yaml           | 167 +++++++++++++++++++++
 .../devicetree/bindings/regulator/ltc3676.txt      |  94 ------------
 .../bindings/regulator/qcom,qca6390-pmu.yaml       |  12 ++
 .../bindings/regulator/qcom,rpmh-regulator.yaml    |   2 +-
 .../bindings/regulator/vctrl-regulator.yaml        |  80 ++++++++++
 .../devicetree/bindings/regulator/vctrl.txt        |  49 ------
 drivers/regulator/arizona-ldo1.c                   |  12 +-
 drivers/regulator/bd9571mwv-regulator.c            |   2 +-
 drivers/regulator/core.c                           | 121 ++++++---------
 drivers/regulator/db8500-prcmu.c                   |   2 +-
 drivers/regulator/devres.c                         |  39 +++++
 drivers/regulator/internal.h                       |  18 ++-
 drivers/regulator/isl6271a-regulator.c             |   4 +-
 drivers/regulator/max5970-regulator.c              |  21 +--
 drivers/regulator/of_regulator.c                   |  51 ++++++-
 drivers/regulator/qcom_smd-regulator.c             |   2 +-
 drivers/regulator/renesas-usb-vbus-regulator.c     |   7 +-
 drivers/regulator/rk808-regulator.c                |  41 +++--
 drivers/regulator/stm32-vrefbuf.c                  |   2 +-
 drivers/regulator/uniphier-regulator.c             |   2 +-
 drivers/regulator/userspace-consumer.c             |   2 +-
 drivers/regulator/virtual.c                        |   2 +-
 drivers/regulator/wm8350-regulator.c               |   6 +-
 include/linux/mfd/max5970.h                        |  12 --
 include/linux/regulator/consumer.h                 |  37 +++++
 include/linux/regulator/driver.h                   |   7 +
 include/linux/regulator/machine.h                  |   5 +-
 27 files changed, 490 insertions(+), 309 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/lltc,ltc3676.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/ltc3676.txt
 create mode 100644 Documentation/devicetree/bindings/regulator/vctrl-regulator.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/vctrl.txt

.
Subject: [GIT PULL] SPI updates for v6.13
From: Mark Brown <broonie@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Date: Mon, 18 Nov 2024 13:33:05 +0000

The following changes since commit 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b:

  Linux 6.12-rc2 (2024-10-06 15:32:27 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-v6.13

for you to fetch changes up to 26470a2e87a6fc40750f4bfe962519e9ae9a9e72:

  spi: imx: support word delay in ecspi (2024-11-14 11:43:39 +0000)

----------------------------------------------------------------
spi: Updates for v6.13

The only real core work we've got this time around is the completion of
the transition to the new host/target naming for the core APIs, Kconfig
still needs doing but that's a lot less invasive.  Otherwise the big
changes are the new drivers that have been added:

 - Completion of the conversion to spi_alloc_host()/_target() and
   removal of the old naming.
 - Cleanups for Rockchip drivers, these brought in a new logging helper
   in the driver core for warnings during probe.
 - Support for configuration of the word delay via spidev_test.
 - Support for AMD HID2 controllers, Apple SPI controller and Realtek
   SPI-NAND controllers.

The Rockchip cleanups

----------------------------------------------------------------
Alain Volmat (1):
      spi: stm32: fix missing device mode capability in stm32mp25

Alexander Dahl (1):
      spi: atmel-quadspi: Add cs_hold and cs_inactive setting support

Alexander Usyskin (1):
      spi: intel: Add protected and locked attributes

Amit Kumar Mahapatra (1):
      dt-bindings: spi: zynqmp-qspi: Include two 'reg' properties only for the Zynq UltraScale QSPI

Bartosz Golaszewski (1):
      spi: make class structs const

Breno Leitao (1):
      spi: tegra210-quad: Avoid shift-out-of-bounds

Chris Packham (3):
      dt-bindings: spi: Add realtek,rtl9301-snand
      spi: spi-mem: Add Realtek SPI-NAND controller
      spi: spi-mem: rtl-snand: Correctly handle DMA transfers

Colin Ian King (1):
      spi: spi-ti-qspi: remove redundant assignment to variable ret

Dragan Simic (8):
      spi: rockchip: Perform trivial code cleanups
      spi: rockchip-sfc: Perform trivial code cleanups
      spi: rockchip-sfc: Use dev_err_probe() in the probe path
      spi: rockchip: Perform trivial code cleanups
      spi: rockchip-sfc: Perform trivial code cleanups
      spi: rockchip-sfc: Use dev_err_probe() in the probe path
      driver core: Add device probe log helper dev_warn_probe()
      spi: rockchip: Use dev_{err,warn}_probe() in the probe path

Hardevsinh Palaniya (2):
      spi: spi-fsl-dspi: Fix casting warnings
      spi: spi-imx: Fix casting warnings

Hector Martin (2):
      spi: dt-bindings: apple,spi: Add binding for Apple SPI controllers
      spi: apple: Add driver for Apple SPI controller

Ivaylo Ivanov (1):
      spi: dt-bindings: samsung: Add a compatible for samsung,exynos8895-spi

Jiapeng Chong (1):
      spi: apple: Remove unnecessary .owner for apple_spi_driver

Jinjie Ruan (2):
      spi: spi-fsl-lpspi: Use IRQF_NO_AUTOEN flag in request_irq()
      spi: zynqmp-gqspi: Undo runtime PM changes at driver exit timeâ€‹

Jonas Rebmann (3):
      spi: spidev_test: add support for word delay
      spi: imx: pass struct spi_transfer to prepare_transfer()
      spi: imx: support word delay

Karan Sanghavi (1):
      spi: dt-bindings: brcm,bcm2835-aux-spi: Convert to dtschema

Lorenzo Bianconi (1):
      spi: airoha: do not keep {tx,rx} dma buffer always mapped

Mark Brown (9):
      spi: spi_amd: Performance Optimization Patch Series
      spi: replace and remove
      Improve error handling in Rockchip SPI drivers
      spi: spi-fsl-lpspi: Some calculation improvements
      spi: Merge up v6.12
      Add dev_warn_probe() and improve error handling in
      Fix Sparse warnings
      Realtek SPI-NAND controller
      spi: imx: support word delay in ecspi

Markus Elfring (1):
      spi: slave-mt27xx: Call clk_disable_unprepare() only once in mtk_spi_slave_probe()

Philipp Stanner (1):
      spi: Replace deprecated PCI functions

Raju Rangoju (8):
      spi: spi_amd: Sort headers alphabetically
      spi: spi_amd: Enable dual and quad I/O modes
      spi: spi_amd: Replace ioread/iowrite calls
      spi: spi_amd: Updates to set tx/rx count functions
      spi: spi_amd: Optimize IO operations
      spi: spi_amd: Add support for HID2 SPI controller
      spi: spi_amd: Set controller address mode
      spi: spi_amd: Add HIDDMA basic read support

Rob Herring (Arm) (1):
      spi: Use of_property_present() for non-boolean properties

Simon Trimmer (1):
      spi: cs42l43: Add GPIO speaker id support to the bridge configuration

Stanislav Jakubek (1):
      dt-bindings: spi: sprd,sc9860-spi: convert to YAML

Stefan Wahren (3):
      spi: spi-fsl-lpspi: Adjust type of scldiv
      spi: spi-fsl-lpspi: Fix specifiers in fsl_lpspi_set_bitrate
      spi: spi-fsl-lpspi: support effective_speed_hz

Uwe Kleine-KÃ¶nig (3):
      spi: Switch back to struct platform_driver::remove()
      spi: Provide defer reason if getting irq during probe fails
      spi: axi-spi-engine: Emit trace events for spi transfers

Yan Zhen (1):
      spi: fix typo in the comment

Yang Yingliang (6):
      media: usb/msi2500: switch to use spi_alloc_host()
      media: netup_unidvb: switch to use devm_spi_alloc_host()
      spi: ch341: switch to use devm_spi_alloc_host()
      spi: slave-mt27xx: switch to use spi_alloc_target()
      video: fbdev: mmp: switch to use spi_alloc_host()
      spi: remove {devm_}spi_alloc_master/slave()

zhang jiao (1):
      spi: Delete useless checks

 Documentation/ABI/testing/sysfs-driver-spi-intel   |  20 +
 .../devicetree/bindings/spi/apple,spi.yaml         |  62 +++
 .../bindings/spi/brcm,bcm2835-aux-spi.txt          |  38 --
 .../bindings/spi/brcm,bcm2835-aux-spi.yaml         |  53 +++
 .../bindings/spi/realtek,rtl9301-snand.yaml        |  62 +++
 .../devicetree/bindings/spi/samsung,spi.yaml       |   4 +
 Documentation/devicetree/bindings/spi/spi-sprd.txt |  33 --
 .../devicetree/bindings/spi/spi-zynqmp-qspi.yaml   |  22 +-
 .../devicetree/bindings/spi/sprd,sc9860-spi.yaml   |  72 +++
 Documentation/driver-api/driver-model/devres.rst   |   4 +-
 MAINTAINERS                                        |   6 +
 drivers/base/core.c                                | 129 +++--
 drivers/media/pci/netup_unidvb/netup_unidvb_spi.c  |   6 +-
 drivers/media/usb/msi2500/msi2500.c                |   4 +-
 drivers/spi/Kconfig                                |  22 +
 drivers/spi/Makefile                               |   2 +
 drivers/spi/atmel-quadspi.c                        |  38 +-
 drivers/spi/spi-airoha-snfi.c                      | 154 +++---
 drivers/spi/spi-amd.c                              | 325 +++++++++++--
 drivers/spi/spi-apple.c                            | 529 +++++++++++++++++++++
 drivers/spi/spi-ar934x.c                           |   2 +-
 drivers/spi/spi-aspeed-smc.c                       |   2 +-
 drivers/spi/spi-at91-usart.c                       |   2 +-
 drivers/spi/spi-ath79.c                            |   2 +-
 drivers/spi/spi-atmel.c                            |   2 +-
 drivers/spi/spi-au1550.c                           |   2 +-
 drivers/spi/spi-axi-spi-engine.c                   |  15 +
 drivers/spi/spi-bcm2835.c                          |   2 +-
 drivers/spi/spi-bcm2835aux.c                       |   2 +-
 drivers/spi/spi-bcm63xx-hsspi.c                    |   2 +-
 drivers/spi/spi-bcm63xx.c                          |   2 +-
 drivers/spi/spi-bcmbca-hsspi.c                     |   2 +-
 drivers/spi/spi-brcmstb-qspi.c                     |   2 +-
 drivers/spi/spi-cadence-quadspi.c                  |   2 +-
 drivers/spi/spi-cadence.c                          |   2 +-
 drivers/spi/spi-cavium-octeon.c                    |   2 +-
 drivers/spi/spi-ch341.c                            |   2 +-
 drivers/spi/spi-coldfire-qspi.c                    |   2 +-
 drivers/spi/spi-cs42l43.c                          |  46 +-
 drivers/spi/spi-davinci.c                          |   2 +-
 drivers/spi/spi-dln2.c                             |   2 +-
 drivers/spi/spi-dw-bt1.c                           |   2 +-
 drivers/spi/spi-dw-mmio.c                          |   2 +-
 drivers/spi/spi-dw-pci.c                           |   9 +-
 drivers/spi/spi-ep93xx.c                           |   2 +-
 drivers/spi/spi-fsl-dspi.c                         |  10 +-
 drivers/spi/spi-fsl-espi.c                         |   2 +-
 drivers/spi/spi-fsl-lpspi.c                        |  29 +-
 drivers/spi/spi-fsl-qspi.c                         |   2 +-
 drivers/spi/spi-fsl-spi.c                          |   4 +-
 drivers/spi/spi-hisi-kunpeng.c                     |   2 +-
 drivers/spi/spi-hisi-sfc-v3xx.c                    |   2 +-
 drivers/spi/spi-img-spfi.c                         |   2 +-
 drivers/spi/spi-imx.c                              | 115 ++++-
 drivers/spi/spi-intel-pci.c                        |   1 +
 drivers/spi/spi-intel-platform.c                   |   1 +
 drivers/spi/spi-intel.c                            |  64 ++-
 drivers/spi/spi-intel.h                            |   2 +
 drivers/spi/spi-iproc-qspi.c                       |   2 +-
 drivers/spi/spi-lantiq-ssc.c                       |   4 +-
 drivers/spi/spi-loongson-pci.c                     |   5 +-
 drivers/spi/spi-meson-spicc.c                      |   2 +-
 drivers/spi/spi-meson-spifc.c                      |   2 +-
 drivers/spi/spi-microchip-core-qspi.c              |   2 +-
 drivers/spi/spi-microchip-core.c                   |   2 +-
 drivers/spi/spi-mpc52xx-psc.c                      |   4 +-
 drivers/spi/spi-mpc52xx.c                          |   2 +-
 drivers/spi/spi-mt65xx.c                           |   2 +-
 drivers/spi/spi-mtk-nor.c                          |   2 +-
 drivers/spi/spi-mtk-snfi.c                         |   2 +-
 drivers/spi/spi-mxic.c                             |   2 +-
 drivers/spi/spi-mxs.c                              |   2 +-
 drivers/spi/spi-npcm-fiu.c                         |   8 +-
 drivers/spi/spi-npcm-pspi.c                        |   2 +-
 drivers/spi/spi-nxp-fspi.c                         |   2 +-
 drivers/spi/spi-oc-tiny.c                          |   2 +-
 drivers/spi/spi-omap-uwire.c                       |   2 +-
 drivers/spi/spi-omap2-mcspi.c                      |   2 +-
 drivers/spi/spi-orion.c                            |   2 +-
 drivers/spi/spi-pic32-sqi.c                        |   4 +-
 drivers/spi/spi-pic32.c                            |   2 +-
 drivers/spi/spi-pl022.c                            |   2 +-
 drivers/spi/spi-ppc4xx.c                           |   2 +-
 drivers/spi/spi-pxa2xx-pci.c                       |   8 +-
 drivers/spi/spi-pxa2xx-platform.c                  |   2 +-
 drivers/spi/spi-qcom-qspi.c                        |   4 +-
 drivers/spi/spi-qup.c                              |   2 +-
 drivers/spi/spi-rb4xx.c                            |   2 +-
 drivers/spi/spi-realtek-rtl-snand.c                | 419 ++++++++++++++++
 drivers/spi/spi-rockchip-sfc.c                     |  25 +-
 drivers/spi/spi-rockchip.c                         |  59 ++-
 drivers/spi/spi-rpc-if.c                           |   2 +-
 drivers/spi/spi-rspi.c                             |   2 +-
 drivers/spi/spi-rzv2m-csi.c                        |   2 +-
 drivers/spi/spi-s3c64xx.c                          |   4 +-
 drivers/spi/spi-sh-hspi.c                          |   2 +-
 drivers/spi/spi-sh-msiof.c                         |   2 +-
 drivers/spi/spi-sh-sci.c                           |   2 +-
 drivers/spi/spi-sh.c                               |   2 +-
 drivers/spi/spi-sifive.c                           |   2 +-
 drivers/spi/spi-slave-mt27xx.c                     |  10 +-
 drivers/spi/spi-sn-f-ospi.c                        |   2 +-
 drivers/spi/spi-sprd.c                             |   4 +-
 drivers/spi/spi-st-ssc4.c                          |   2 +-
 drivers/spi/spi-stm32-qspi.c                       |   2 +-
 drivers/spi/spi-stm32.c                            |   3 +-
 drivers/spi/spi-sun4i.c                            |   2 +-
 drivers/spi/spi-sun6i.c                            |   2 +-
 drivers/spi/spi-sunplus-sp7021.c                   |   2 +-
 drivers/spi/spi-synquacer.c                        |   2 +-
 drivers/spi/spi-tegra114.c                         |   2 +-
 drivers/spi/spi-tegra20-sflash.c                   |   2 +-
 drivers/spi/spi-tegra20-slink.c                    |   4 +-
 drivers/spi/spi-tegra210-quad.c                    |   4 +-
 drivers/spi/spi-ti-qspi.c                          |   5 +-
 drivers/spi/spi-topcliff-pch.c                     |   2 +-
 drivers/spi/spi-uniphier.c                         |   2 +-
 drivers/spi/spi-xilinx.c                           |   2 +-
 drivers/spi/spi-xtensa-xtfpga.c                    |   2 +-
 drivers/spi/spi-zynq-qspi.c                        |   2 +-
 drivers/spi/spi-zynqmp-gqspi.c                     |   4 +-
 drivers/spi/spi.c                                  |  25 +-
 drivers/video/fbdev/mmp/hw/mmp_spi.c               |   6 +-
 include/linux/dev_printk.h                         |   1 +
 include/linux/spi/spi.h                            |  30 --
 tools/spi/spidev_test.c                            |  11 +-
 126 files changed, 2187 insertions(+), 489 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-spi-intel
 create mode 100644 Documentation/devicetree/bindings/spi/apple,spi.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.txt
 create mode 100644 Documentation/devicetree/bindings/spi/brcm,bcm2835-aux-spi.yaml
 create mode 100644 Documentation/devicetree/bindings/spi/realtek,rtl9301-snand.yaml
 delete mode 100644 Documentation/devicetree/bindings/spi/spi-sprd.txt
 create mode 100644 Documentation/devicetree/bindings/spi/sprd,sc9860-spi.yaml
 create mode 100644 drivers/spi/spi-apple.c
 create mode 100644 drivers/spi/spi-realtek-rtl-snand.c

.
Subject: [PATCH v3 00/15] media: stm32: introduction of CSI / DCMIPP for
 STM32MP25
From: Alain Volmat <alain.volmat@foss.st.com>
To: Hugues Fruchet <hugues.fruchet@foss.st.com>,
        Mauro Carvalho Chehab
	<mchehab@kernel.org>,
        Maxime Coquelin <mcoquelin.stm32@gmail.com>,
        Alexandre
 Torgue <alexandre.torgue@foss.st.com>,
        Hans Verkuil
	<hverkuil-cisco@xs4all.nl>,
        Sakari Ailus <sakari.ailus@linux.intel.com>,
        Rob
 Herring <robh@kernel.org>,
        Krzysztof Kozlowski <krzk+dt@kernel.org>,
        Conor
 Dooley <conor+dt@kernel.org>,
        Philipp Zabel <p.zabel@pengutronix.de>
Date: Mon, 18 Nov 2024 14:35:23 +0100

.
Subject: [PATCH v2] ACPI: platform-profile: Fix CFI violation when
 accessing sysfs files
From: Nathan Chancellor <nathan@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>, 
 Mark Pearson <markpearson@lenovo.com>, Kees Cook <kees@kernel.org>, 
 Sami Tolvanen <samitolvanen@google.com>, linux-acpi@vger.kernel.org, 
 linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, 
 stable@vger.kernel.org, John Rowley <lkml@johnrowley.me>, 
 Nathan Chancellor <nathan@kernel.org>
Date: Mon, 18 Nov 2024 07:39:32 -0700

.
Subject: [GIT PULL] printk for 6.13
From: Petr Mladek <pmladek@suse.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Peter Zijlstra <peterz@infradead.org>,
	Petr Mladek <pmladek@suse.com>, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 15:09:32 +0100

Hi Linus,

please pull the latest printk changes from

  git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git tags/printk-for-6.13

=================================

- Print more precise information about the printk log buffer memory usage.

- Make sure that the sysrq title is shown on the console even
  when deferred.

- Do not enable earlycon by `console=` which is meant to disable
  the default console.

----------------------------------------------------------------
Arnd Bergmann (1):
      printk: add dummy printk_force_console_enter/exit helpers

Isaac J. Manjarres (1):
      printk: Improve memory usage logging during boot

Marcos Paulo de Souza (2):
      printk: Introduce FORCE_CON flag
      tty: sysrq: Use printk_force_console context on __handle_sysrq

Petr Mladek (1):
      Merge branch 'for-6.13-force-console' into for-linus

Raul E Rangel (1):
      init: Don't proxy `console=` to earlycon

 drivers/tty/serial/earlycon.c | 23 +++++++++++++++++++++
 drivers/tty/sysrq.c           | 18 ++++++++---------
 include/linux/printk.h        | 11 ++++++++++
 init/main.c                   |  5 +----
 kernel/printk/internal.h      |  3 +++
 kernel/printk/printk.c        | 47 ++++++++++++++++++++++++++++++++++---------
 kernel/printk/printk_safe.c   | 18 +++++++++++++++++
 7 files changed, 102 insertions(+), 23 deletions(-)

.
Subject: [PATCH net] net/l2tp: fix warning in l2tp_exit_net found by syzbot
From: James Chapman <jchapman@katalix.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net,
	edumazet@google.com,
	guohui.study@gmail.com,
	horms@kernel.org,
	kuba@kernel.org,
	linux-kernel@vger.kernel.org,
	pabeni@redhat.com,
	syzkaller-bugs@googlegroups.com,
	syzbot+332fe1e67018625f63c9@syzkaller.appspotmail.com,
	tparkin@katalix.com
Date: Mon, 18 Nov 2024 14:04:11 +0000

.
Subject: [PATCH] ovl: Add check for missing lookup operation on inode
From: Vasiliy Kovalev <kovalev@altlinux.org>
To: Miklos Szeredi <miklos@szeredi.hu>,
	Amir Goldstein <amir73il@gmail.com>,
	linux-unionfs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: kovalev@altlinux.org
Date: Mon, 18 Nov 2024 17:17:03 +0300

.
Subject: [PATCH V4 net-next 0/7] Support some features for the HIBMCGE driver
From: Jijie Shao <shaojijie@huawei.com>
To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <andrew+netdev@lunn.ch>, <horms@kernel.org>
Date: Mon, 18 Nov 2024 22:13:32 +0800

.
Subject: Build failure with GCC 15 (-std=gnu23)
From: Kostadin Shishmanov <kostadinshishmanov@protonmail.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "sam@gentoo.org" <sam@gentoo.org>
Date: Mon, 18 Nov 2024 14:26:49 +0000

.
Subject: [PATCH v5 drm-dp 0/5] Add dp module in hibmc driver
From: Yongbang Shi <shiyongbang@huawei.com>
To: <xinliang.liu@linaro.org>, <tiantao6@hisilicon.com>,
	<maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
	<tzimmermann@suse.de>, <airlied@gmail.com>, <daniel@ffwll.ch>,
	<kong.kongxinwei@hisilicon.com>
Date: Mon, 18 Nov 2024 22:28:00 +0800

.
Subject: [PATCH v4 0/3] Untie the host lock entanglement - part 2
From: Avri Altman <avri.altman@wdc.com>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Bart Van Assche <bvanassche@acm.org>,
	Bean Huo <beanhuo@micron.com>,
	Avri Altman <avri.altman@wdc.com>
Date: Mon, 18 Nov 2024 16:41:14 +0200

.
Subject: [GIT PULL] x86/cache for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 15:44:56 +0100

Hi Linus,

please pull the x86/cache lineup for v6.13.

Thx.

---

The following changes since commit 8e929cb546ee42c9a61d24fae60605e9e3192354:

  Linux 6.12-rc3 (2024-10-13 14:33:32 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip tags/x86_cache_for_v6.13

for you to fetch changes up to 9bce6e94c4b39b6baa649784d92f908aa9168a45:

  x86/resctrl: Support Sub-NUMA cluster mode SNC6 (2024-11-06 10:49:04 +0100)

----------------------------------------------------------------
- Add support for 6-node sub-NUMA clustering on Intel

- Cleanup

----------------------------------------------------------------
Christophe JAILLET (1):
      x86/resctrl: Slightly clean-up mbm_config_show()

Tony Luck (1):
      x86/resctrl: Support Sub-NUMA cluster mode SNC6

 arch/x86/kernel/cpu/resctrl/monitor.c  | 3 ++-
 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: [PATCH v7 0/3] Add LED1202 LED Controller
From: Vicentiu Galanopulo <vicentiu.galanopulo@remote-tech.co.uk>
To: Pavel Machek <pavel@ucw.cz>,
	Lee Jones <lee@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Vicentiu Galanopulo <vicentiu.galanopulo@remote-tech.co.uk>,
	linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Date: Mon, 18 Nov 2024 14:54:42 +0000

.
Subject: [PATCH v8 0/3] Add LED1202 LED Controller
From: Vicentiu Galanopulo <vicentiu.galanopulo@remote-tech.co.uk>
To: Pavel Machek <pavel@ucw.cz>,
	Lee Jones <lee@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Vicentiu Galanopulo <vicentiu.galanopulo@remote-tech.co.uk>,
	linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Date: Mon, 18 Nov 2024 15:12:40 +0000

.
Subject: [PATCH v5] nfsd: allow for up to 32 callback session slots
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>, 
 Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: Olga Kornievskaia <okorniev@redhat.com>, linux-nfs@vger.kernel.org, 
 linux-kernel@vger.kernel.org, Jeff Layton <jlayton@kernel.org>
Date: Mon, 18 Nov 2024 09:54:34 -0500

.
Subject: [PATCH v3] ima: Suspend PCR extends and log appends when rebooting
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org,
        zohar@linux.ibm.com
Cc: linux-kernel@vger.kernel.org, roberto.sassu@huawei.com,
        Stefan Berger <stefanb@linux.ibm.com>,
        Tushar Sugandhi <tusharsu@linux.microsoft.com>
Date: Mon, 18 Nov 2024 09:57:31 -0500

.
Subject: [PATCH 0/3] sysfs: treewide: Remove spurious NULL in
 attribute_group definition
From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, 
 "Rafael J. Wysocki" <rafael@kernel.org>, 
 Robin Murphy <robin.murphy@arm.com>, Will Deacon <will@kernel.org>, 
 Mark Rutland <mark.rutland@arm.com>, Heiko Carstens <hca@linux.ibm.com>, 
 Vasily Gorbik <gor@linux.ibm.com>, 
 Alexander Gordeev <agordeev@linux.ibm.com>, 
 Christian Borntraeger <borntraeger@linux.ibm.com>, 
 Sven Schnelle <svens@linux.ibm.com>, Thomas Gleixner <tglx@linutronix.de>, 
 Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, 
 linux-s390@vger.kernel.org, 
 =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net>
Date: Mon, 18 Nov 2024 16:02:46 +0100

.
Subject: [GIT PULL] x86/microcode for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 16:03:27 +0100

Hi Linus,

please pull a single microcode loader optimization for v6.13.

Thx.

---

The following changes since commit 42f7652d3eb527d03665b09edac47f85fb600924:

  Linux 6.12-rc4 (2024-10-20 15:19:38 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip x86_microcode_for_v6.13

for you to fetch changes up to 9a819753b0209c6edebdea447a1aa53e8c697653:

  x86/microcode/intel: Remove unnecessary cache writeback and invalidation (2024-10-25 18:12:03 +0200)

----------------------------------------------------------------
- Remove the unconditional cache writeback and invalidation after loading the
  microcode patch on Intel as this was addressing a microcode bug for which
  there is a concrete microcode revision check instead

----------------------------------------------------------------
Chang S. Bae (1):
      x86/microcode/intel: Remove unnecessary cache writeback and invalidation

 arch/x86/kernel/cpu/microcode/intel.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: [PATCH v2] usb: dwc3: xilinx: make sure pipe clock is deselected in usb2 only mode
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
To: <Thinh.Nguyen@synopsys.com>, <gregkh@linuxfoundation.org>,
	<michal.simek@amd.com>, <robert.hancock@calian.com>
Date: Mon, 18 Nov 2024 20:38:11 +0530

.
Subject: [syzbot] [virt?] INFO: trying to register non-static key in stats_request
From: syzbot <syzbot+f303608297c771a7de35@syzkaller.appspotmail.com>
To: david@redhat.com, eperezma@redhat.com, jasowang@redhat.com, 
	linux-kernel@vger.kernel.org, mst@redhat.com, syzkaller-bugs@googlegroups.com, 
	virtualization@lists.linux.dev, xuanzhuo@linux.alibaba.com
Date: Mon, 18 Nov 2024 07:17:30 -0800

.
Subject: [PATCH] Bluetooth: hci_sync: fix LE init stage 3 failure
From: =?UTF-8?q?Andr=C3=A9=20Groenewald?= <andre.groenewald@streamunlimited.com>
To: marcel@holtmann.org,
	johan.hedberg@gmail.com,
	luiz.dentz@gmail.com,
	linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: =?UTF-8?q?Andr=C3=A9=20Groenewald?= <andre.groenewald@streamunlimited.com>
Date: Mon, 18 Nov 2024 16:19:47 +0100

.
Subject: [GIT PULL] x86/platform for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 16:22:04 +0100

Hi Linus,

please a single x86/platform cleanup for v6.13.

Thx.

---

The following changes since commit 2d5404caa8c7bb5c4e0435f94b28834ae5456623:

  Linux 6.12-rc7 (2024-11-10 14:19:35 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip x86_platform_for_v6.13

for you to fetch changes up to 90f1b42b179487ee77d182893408cc1c40d50b13:

  x86/platform/intel-mid: Replace deprecated PCI functions (2024-11-11 11:59:21 +0100)

----------------------------------------------------------------
- Replace deprecated PCI functions used in intel-mid

----------------------------------------------------------------
Philipp Stanner (1):
      x86/platform/intel-mid: Replace deprecated PCI functions

 arch/x86/platform/intel-mid/pwr.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: [PATCH v2] ARM: dts: imxrt1050: Fix clocks for mmc
From: Jesse Taube <mr.bossman075@gmail.com>
To: devicetree@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Jesse Taube <Mr.Bossman075@gmail.com>
Date: Mon, 18 Nov 2024 10:36:41 -0500

.
Subject: [GIT PULL] workqueue: Changes for v6.13
From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Lai Jiangshan <jiangshanlai@gmail.com>
Date: Mon, 18 Nov 2024 05:40:38 -1000

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git/ tags/wq-for-6.13

for you to fetch changes up to 85f0d8e39affb7b88401b1e0542230a7af985b96:

  workqueue: Reduce expensive locks for unbound workqueue (2024-11-15 06:43:39 -1000)

----------------------------------------------------------------
workqueue: Changes for v6.13

- Maximum concurrency limit of 512 which was set a long time ago is too low
  now. A legitimate use (BPF cgroup release) of system_wq could saturate it
  under stress test conditions leading to false dependencies and deadlocks.
  While the offending use was switched to a dedicated workqueue, use the
  opportunity to bump WQ_MAX_ACTIVE four fold and document that system
  workqueue shouldn't be saturated. Workqueue should add at least a warning
  mechanism for cases where system workqueues are saturated.

- Recent workqueue updates to support more flexible execution topology made
  unbound workqueues use per-cpu worker pool frontends which pushed up
  workqueue flush overhead. As consecutive CPUs are likely to be pointing to
  the same worker pool, reduce overhead by switching locks only when
  necessary.

----------------------------------------------------------------
Chen Ridong (2):
      workqueue: doc: Add a note saturating the system_wq is not permitted
      workqueue: Adjust WQ_MAX_ACTIVE from 512 to 2048

Wangyang Guo (1):
      workqueue: Reduce expensive locks for unbound workqueue

 Documentation/core-api/workqueue.rst |  9 +++++++--
 include/linux/workqueue.h            |  2 +-
 kernel/workqueue.c                   | 22 ++++++++++++++++++----
 3 files changed, 26 insertions(+), 7 deletions(-)

-- 
tejun

.
Subject: [PATCH v5 0/2] add NXP LINFlexD UART clock support for S32G2/S32G3
From: Ciprian Costea <ciprianmarian.costea@oss.nxp.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Chester Lin <chester62515@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org,
	devicetree@vger.kernel.org,
	imx@lists.linux.dev,
	NXP S32 Linux <s32@nxp.com>,
	Christophe Lizzi <clizzi@redhat.com>,
	Alberto Ruiz <aruizrui@redhat.com>,
	Enric Balletbo <eballetb@redhat.com>,
	Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
Date: Mon, 18 Nov 2024 17:44:46 +0200

.
Subject: [PATCH v1] firmware: microchip: fix UL_IAP lock check in mpfs_auto_update_state()
From: Valentina Fernandez <valentina.fernandezalanis@microchip.com>
To: <conor.dooley@microchip.com>, <daire.mcnamara@microchip.com>,
	<valentina.fernandezalanis@microchip.com>
Date: Mon, 18 Nov 2024 15:53:54 +0000

.
Subject: [PATCH v6] acpi: nfit: vmalloc-out-of-bounds Read in acpi_nfit_ctl
From: Suraj Sonawane <surajsonawane0215@gmail.com>
To: dan.j.williams@intel.com
Cc: vishal.l.verma@intel.com,
	dave.jiang@intel.com,
	ira.weiny@intel.com,
	rafael@kernel.org,
	lenb@kernel.org,
	nvdimm@lists.linux.dev,
	linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Suraj Sonawane <surajsonawane0215@gmail.com>,
	syzbot+7534f060ebda6b8b51b3@syzkaller.appspotmail.com
Date: Mon, 18 Nov 2024 21:56:09 +0530

.
Subject: [RELEASE] LTTng-modules 2.12.19 and 2.13.16 (Linux kernel tracer)
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: lttng-dev@lists.lttng.org, diamon-discuss@lists.linuxfoundation.org,
 linux-trace-users@vger.kernel.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 11:00:56 -0500

.
Subject: [GIT PULL] x86/sev for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 17:03:51 +0100

Hi Linus,

please pull the SEV lineup for v6.13.

Thx.

---

The following changes since commit 8e929cb546ee42c9a61d24fae60605e9e3192354:

  Linux 6.12-rc3 (2024-10-13 14:33:32 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip tags/x86_sev_for_v6.13

for you to fetch changes up to 8bca85cc1eb72e21a3544ab32e546a819d8674ca:

  x86/sev: Cleanup vc_handle_msr() (2024-11-07 12:10:01 +0100)

----------------------------------------------------------------
- Do the proper memory conversion of guest memory in order to be able to kexec
  kernels in SNP guests along with other adjustments and cleanups to that
  effect

- Start converting and moving functionality from the sev-guest driver into
  core code with the purpose of supporting the secure TSC SNP feature where
  the hypervisor cannot influence the TSC exposed to the guest anymore

- Add a "nosnp" cmdline option in order to be able to disable SNP support in
  the hypervisor and thus free-up resources which are not going to be used

- Cleanups

----------------------------------------------------------------
Ashish Kalra (3):
      x86/boot: Skip video memory access in the decompressor for SEV-ES/SNP
      x86/mm: Refactor __set_clr_pte_enc()
      x86/sev: Convert shared memory back to private on kexec

Borislav Petkov (AMD) (1):
      x86/sev: Cleanup vc_handle_msr()

Nikunj A Dadhania (6):
      virt: sev-guest: Use AES GCM crypto library
      x86/sev: Handle failures from snp_init()
      x86/sev: Cache the secrets page address
      virt: sev-guest: Consolidate SNP guest messaging parameters to a struct
      virt: sev-guest: Reduce the scope of SNP command mutex
      virt: sev-guest: Carve out SNP message context structure

Pavan Kumar Paluri (2):
      x86/virt: Move SEV-specific parsing into arch/x86/virt/svm
      x86/virt: Provide "nosnp" boot option for sev kernel command line

 Documentation/arch/x86/x86_64/boot-options.rst |   5 +
 arch/x86/boot/compressed/misc.c                |  15 +
 arch/x86/coco/sev/core.c                       | 269 ++++++++++------
 arch/x86/include/asm/sev-common.h              |  27 ++
 arch/x86/include/asm/sev.h                     |  67 +++-
 arch/x86/mm/mem_encrypt_amd.c                  |  77 +++--
 arch/x86/mm/mem_encrypt_identity.c             |  11 +-
 arch/x86/virt/svm/Makefile                     |   1 +
 arch/x86/virt/svm/cmdline.c                    |  45 +++
 drivers/virt/coco/sev-guest/Kconfig            |   4 +-
 drivers/virt/coco/sev-guest/sev-guest.c        | 416 ++++++++++---------------
 11 files changed, 543 insertions(+), 394 deletions(-)
 create mode 100644 arch/x86/virt/svm/cmdline.c


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: [GIT PULL] pmdomain updates for v6.13
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Linus <torvalds@linux-foundation.org>,
	linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Viresh Kumar <vireshk@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Date: Mon, 18 Nov 2024 17:04:44 +0100

Hi Linus,

Here's the pull-request with the pmdomain updates for v6.13. Details about
the highlights are as usual found in the signed tag.

Note that, this time there is also a signed-tag that I have pulled from Mark's
regulator tree.

Please pull this in!

Kind regards
Ulf Hansson


The following changes since commit d2fab3fc27cbca7ba65c539a2c5fc7f941231983:

  mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag (2024-11-12 19:45:25 +0100)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git tags/pmdomain-v6.13

for you to fetch changes up to 5812b95b7ff47d2ccc07b8f050652604ac54cdcf:

  pmdomain: Merge branch fixes into next (2024-11-12 19:46:55 +0100)

----------------------------------------------------------------
pmdomain core:
 - Set the required dev for a required OPP during genpd attach
 - Add support for required OPPs to dev_pm_domain_attach_list()

pmdomain providers:
 - ti: Enable GENPD_FLAG_ACTIVE_WAKEUP flag for ti_sci PM domains
 - mediatek: Add support for MT6735 PM domains
 - mediatek: Use OF-specific regulator API to get power domain supply
 - qcom: Add support for the SM8750/SAR2130P/qcs615/qcs8300 rpmhpds

pmdomain consumers:
 - Convert a couple of consumer drivers to *_pm_domain_attach|detach_list()

opp core:
 - Rework and cleanup some code that manages required OPPs
 - Remove *_opp_attach|detach_genpd()

----------------------------------------------------------------
Chen-Yu Tsai (3):
      regulator: Add of_regulator_get_optional() for pure DT regulator lookup
      regulator: Add devres version of of_regulator_get_optional()
      pmdomain: mediatek: Use OF-specific regulator API to get power domain supply

Dario Binacchi (1):
      pmdomain: imx: gpcv2: replace dev_err() with dev_err_probe()

Dmitry Baryshkov (2):
      dt-bindings: power: rpmpd: Add SAR2130P compatible
      pmdomain: qcom: rpmhpd: add support for SAR2130P

Jishnu Prakash (1):
      pmdomain: qcom: rpmhpd: Add rpmhpd support for SM8750

Rob Herring (Arm) (1):
      pmdomain: imx: Use of_property_present() for non-boolean properties

Taniya Das (1):
      dt-bindings: power: qcom,rpmpd: document the SM8750 RPMh Power Domains

Thomas Richard (1):
      pmdomain: ti-sci: set the GENPD_FLAG_ACTIVE_WAKEUP flag for all PM domains

Tingguo Cheng (4):
      dt-bindings: power: qcom,rpmpd: document qcs8300 RPMh power domains
      dt-bindings: power: qcom,rpmpd: document qcs615 RPMh power domains
      pmdomain: qcom: rpmhpd: Add qcs8300 power domains
      pmdomain: qcom: rpmhpd: Add qcs615 power domains

Ulf Hansson (17):
      Merge tag 'regulator-of-get-optional' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      pmdomain: Merge branch dt into next
      pmdomain: Merge branch fixes into next
      pmdomain: Merge branch fixes into next
      OPP: Rework _set_required_devs() to manage a single device per call
      PM: domains: Support required OPPs in dev_pm_domain_attach_list()
      pmdomain: core: Manage the default required OPP from a separate function
      pmdomain: core: Set the required dev for a required OPP during genpd attach
      OPP: Drop redundant code in _link_required_opps()
      drm/tegra: gr3d: Convert into devm_pm_domain_attach_list()
      media: venus: Convert into devm_pm_domain_attach_list() for OPP PM domain
      cpufreq: qcom-nvmem: Convert to dev_pm_domain_attach|detach_list()
      OPP: Drop redundant *_opp_attach|detach_genpd()
      pmdomain: Merge branch dt into next
      pmdomain: Merge branch fixes into next
      pmdomain: Merge branch fixes into next
      pmdomain: Merge branch fixes into next

Yassine Oudjana (2):
      dt-bindings: power: Add binding for MediaTek MT6735 power controller
      pmdomain: mediatek: Add support for MT6735

Zhang Zekun (2):
      pmdomain: ti-sci: Add missing of_node_put() for args.np
      pmdomain: ti-sci: Use scope based of_node_put() to simplify code.

 .../bindings/power/mediatek,power-controller.yaml  |   1 +
 .../devicetree/bindings/power/qcom,rpmpd.yaml      |   4 +
 .../devicetree/bindings/soc/mediatek/scpsys.txt    |   1 +
 drivers/base/power/common.c                        |  21 ++-
 drivers/cpufreq/qcom-cpufreq-nvmem.c               |  82 +++------
 drivers/gpu/drm/tegra/gr3d.c                       |  39 +---
 drivers/media/platform/qcom/venus/core.c           |   8 +-
 drivers/media/platform/qcom/venus/core.h           |   6 +-
 drivers/media/platform/qcom/venus/pm_helpers.c     |  44 ++---
 drivers/opp/core.c                                 | 199 +++++----------------
 drivers/opp/of.c                                   |  39 +---
 drivers/opp/opp.h                                  |   5 +-
 drivers/pmdomain/core.c                            |  76 ++++++--
 drivers/pmdomain/imx/gpc.c                         |   4 +-
 drivers/pmdomain/imx/gpcv2.c                       |   4 +-
 drivers/pmdomain/mediatek/mt6735-pm-domains.h      |  96 ++++++++++
 drivers/pmdomain/mediatek/mtk-pm-domains.c         |  17 +-
 drivers/pmdomain/mediatek/mtk-pm-domains.h         |   2 +
 drivers/pmdomain/qcom/rpmhpd.c                     |  87 +++++++++
 drivers/pmdomain/ti/ti_sci_pm_domains.c            |  25 ++-
 drivers/regulator/core.c                           |   4 +-
 drivers/regulator/devres.c                         |  39 ++++
 drivers/regulator/internal.h                       |  18 +-
 drivers/regulator/of_regulator.c                   |  51 +++++-
 .../power/mediatek,mt6735-power-controller.h       |  14 ++
 include/dt-bindings/power/qcom-rpmpd.h             |   2 +
 include/linux/pm_domain.h                          |   9 +
 include/linux/pm_opp.h                             |  42 +----
 include/linux/regulator/consumer.h                 |  37 ++++
 include/linux/soc/mediatek/infracfg.h              |   5 +
 30 files changed, 569 insertions(+), 412 deletions(-)
 create mode 100644 drivers/pmdomain/mediatek/mt6735-pm-domains.h
 create mode 100644 include/dt-bindings/power/mediatek,mt6735-power-controller.h

.
Subject: [GIT PULL] cgroup: Changes for v6.13
From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal =?iso-8859-1?Q?Koutn=FD?= <mkoutny@suse.com>
Date: Mon, 18 Nov 2024 06:06:27 -1000

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git/ tags/cgroup-for-6.13

for you to fetch changes up to fbfbf86685b3270dc27d1c5d6108532334aaf329:

  cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing (2024-11-14 08:44:03 -1000)

----------------------------------------------------------------
cgroup: Changes for v6.13

- cpu.stat now also shows niced CPU time.

- Freezer and cpuset optimizations.

- Other misc changes.

----------------------------------------------------------------
Chen Ridong (4):
      Revert "cgroup: Fix memory leak caused by missing cgroup_bpf_offline"
      cgroup/bpf: only cgroup v2 can be attached by bpf programs
      cgroup/freezer: Reduce redundant traversal for cgroup_freeze
      cgroup/freezer: Add cgroup CGRP_FROZEN flag update helper

Joshua Hahn (2):
      cgroup/rstat: Tracking cgroup-level niced CPU time
      cgroup/rstat: Selftests for niced CPU statistics

Waiman Long (4):
      cgroup/cpuset: Revert "Allow suppression of sched domain rebuild in update_cpumasks_hier()"
      cgroup/cpuset: Enforce at most one rebuild_sched_domains_locked() call per operation
      cgroup/cpuset: Further optimize code if CONFIG_CPUSETS_V1 not set
      cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing

Xiu Jianfeng (1):
      selftests/cgroup: Fix compile error in test_cpu.c

Zefan Li (1):
      MAINTAINERS: remove Zefan Li

everestkc (1):
      cgroup/cpuset: Fix spelling errors in file kernel/cgroup/cpuset.c

 CREDITS                                   |   3 +
 MAINTAINERS                               |   2 -
 include/linux/cgroup-defs.h               |   3 +-
 kernel/cgroup/cgroup.c                    |  21 ++--
 kernel/cgroup/cpuset.c                    | 157 +++++++++++++++++-------------
 kernel/cgroup/freezer.c                   |  97 +++++++++---------
 kernel/cgroup/rstat.c                     |  19 +++-
 tools/testing/selftests/cgroup/test_cpu.c |  75 ++++++++++++++
 8 files changed, 239 insertions(+), 138 deletions(-)

-- 
tejun

.
Subject: [PATCH 6.1.y v2 0/4] fix error handling in mmap_region() and refactor (hotfixes)
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: stable@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
        "Liam R . Howlett" <Liam.Howlett@oracle.com>,
        Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
        linux-kernel@vger.kernel.org, linux-mm@kvack.org,
        Linus Torvalds <torvalds@linux-foundation.org>,
        Peter Xu <peterx@redhat.com>,
        Catalin Marinas <catalin.marinas@arm.com>,
        Will Deacon <will@kernel.org>, Mark Brown <broonie@kernel.org>,
        "David S . Miller" <davem@davemloft.net>,
        Andreas Larsson <andreas@gaisler.com>,
        "James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
        Helge Deller <deller@gmx.de>
Date: Mon, 18 Nov 2024 16:17:24 +0000

.
Subject: [PATCH] xhci: Remove redundant parentheses when checking for port reset.
From: =?UTF-8?q?=E6=9D=8E=E5=93=B2?= <sensor1010@163.com>
To: mathias.nyman@intel.com,
	gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	=?UTF-8?q?=E6=9D=8E=E5=93=B2?= <sensor1010@163.com>
Date: Mon, 18 Nov 2024 08:25:56 -0800

.
Subject: [syzbot] [keyrings?] [lsm?] KASAN: slab-use-after-free Read in key_put
From: syzbot <syzbot+6105ffc1ded71d194d6d@syzkaller.appspotmail.com>
To: dhowells@redhat.com, jarkko@kernel.org, jmorris@namei.org, 
	keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, 
	linux-security-module@vger.kernel.org, paul@paul-moore.com, serge@hallyn.com, 
	syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 08:27:24 -0800

.
Subject: [PATCH v9 0/2] rust: xarray: Add a minimal abstraction for XArray
From: Tamir Duberstein <tamird@gmail.com>
To: Danilo Krummrich <dakr@kernel.org>, Miguel Ojeda <ojeda@kernel.org>, 
 Alex Gaynor <alex.gaynor@gmail.com>, Boqun Feng <boqun.feng@gmail.com>, 
 Gary Guo <gary@garyguo.net>, 
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, 
 Benno Lossin <benno.lossin@proton.me>, 
 Andreas Hindborg <a.hindborg@kernel.org>, Alice Ryhl <aliceryhl@google.com>, 
 Trevor Gross <tmgross@umich.edu>
Cc: =?utf-8?q?Ma=C3=ADra_Canal?= <mcanal@igalia.com>, 
 Asahi Lina <lina@asahilina.net>, rust-for-linux@vger.kernel.org, 
 linux-kernel@vger.kernel.org, Tamir Duberstein <tamird@gmail.com>
Date: Mon, 18 Nov 2024 11:33:34 -0500

.
Subject: [GIT PULL] ftrace: Updates for v6.13
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Mathieu
 Desnoyers <mathieu.desnoyers@efficios.com>, Donglin Peng
 <pengdonglin@xiaomi.com>, Oleg Nesterov <oleg@redhat.com>, Stephen Rothwell
 <sfr@canb.auug.org.au>
Date: Mon, 18 Nov 2024 11:38:07 -0500


Linus,

ftrace updates for v6.13:

- Merged tag ftrace-v6.12-rc4

  There was a fix to locking in register_ftrace_graph() for shadow stacks
  that was sent upstream. But this code was also being rewritten, and the
  locking fix was needed. Merging this fix was required to continue the
  work.

- Restructure the function graph shadow stack to prepare it for use with
  kretprobes

  With the goal of merging the shadow stack logic of function graph and
  kretprobes, some more restructuring of the function shadow stack is
  required.

  Move out function graph specific fields from the fgraph infrastructure and
  store it on the new stack variables that can pass data from the entry
  callback to the exit callback.

  Hopefully, with this change, the merge of kretprobes to use fgraph shadow
  stacks will be ready by the next merge window.

- Make shadow stack 4k instead of using PAGE_SIZE.

  Some architectures have very large PAGE_SIZE values which make its use for
  shadow stacks waste a lot of memory.

- Give shadow stacks its own kmem cache.

  When function graph is started, every task on the system gets a shadow
  stack. In the future, shadow stacks may not be 4K in size. Have it have
  its own kmem cache so that whatever size it becomes will still be
  efficient in allocations.

- Initialize profiler graph ops as it will be needed for new updates to fgraph

- Convert to use guard(mutex) for several ftrace and fgraph functions

- Add more comments and documentation

- Show function return address in function graph tracer

  Add an option to show the caller of a function at each entry of the
  function graph tracer, similar to what the function tracer does.

- Abstract out ftrace_regs from being used directly like pt_regs

  ftrace_regs was created to store a partial pt_regs. It holds only the
  registers and stack information to get to the function arguments and
  return values. On several archs, it is simply a wrapper around pt_regs.
  But some users would access ftrace_regs directly to get the pt_regs which
  will not work on all archs. Make ftrace_regs an abstract structure that
  requires all access to its fields be through accessor functions.

- Show how long it takes to do function code modifications

  When code modification for function hooks happen, it always had the time
  recorded in how long it took to do the conversion. But this value was
  never exported. Recently the code was touched due to new ROX modification
  handling that caused a large slow down in doing the modifications and
  had a significant impact on boot times.

  Expose the timings in the dyn_ftrace_total_info file. This file was
  created a while ago to show information about memory usage and such to
  implement dynamic function tracing. It's also an appropriate file to store
  the timings of this modification as well. This will make it easier to see
  the impact of changes to code modification on boot up timings.

- Other clean ups and small fixes


[
  NOTE: Reminder that this has a conflict with the powerpc tree.
  https://lore.kernel.org/all/20241106140414.760b502c@canb.auug.org.au/
]

Please pull the latest ftrace-v6.13 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
ftrace-v6.13

Tag SHA1: f66edaf1213965180f6935c52a303e5e478e8692
Head SHA1: 36a367b8912a3aac023d9e35c815f7b1e609f4a3


Donglin Peng (1):
      function_graph: Support recording and printing the function return address

Masami Hiramatsu (Google) (5):
      tracing: Fix function timing profiler to initialize hashtable
      tracing: Add a comment about ftrace_regs definition
      fgraph: Simplify return address printing in function graph tracer
      ftrace: Use arch_ftrace_regs() for ftrace_regs_*() macros
      ftrace: Rename ftrace_regs_return_value to ftrace_regs_get_return_value

Oleg Nesterov (1):
      function_graph: Remove unnecessary initialization in ftrace_graph_ret_addr()

Steven Rostedt (16):
      fgraph: Use fgraph data to store subtime for profiler
      ftrace: Use a running sleeptime instead of saving on shadow stack
      ftrace: Have calltime be saved in the fgraph storage
      fgragh: No need to invoke the function call_filter_check_discard()
      ftrace: Make ftrace_regs abstract from direct use
      ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs
      selftests/ftrace: Fix check of return value in fgraph-retval.tc test
      Merge tag 'ftrace-v6.12-rc4' into trace/ftrace/core
      fgraph: Separate size of ret_stack from PAGE_SIZE
      fgraph: Give ret_stack its own kmem cache
      fgraph: Use guard(mutex)(&ftrace_lock) for unregister_ftrace_graph()
      ftrace: Use guard for match_records()
      ftrace: Use guard to lock ftrace_lock in cache_mod()
      ftrace: Use guard to take the ftrace_lock in release_probe()
      ftrace: Use guard to take ftrace_lock in ftrace_graph_set_hash()
      ftrace: Show timings of how long nop patching took

----
 arch/arm64/include/asm/ftrace.h                    |  21 +-
 arch/arm64/kernel/asm-offsets.c                    |  22 +-
 arch/arm64/kernel/ftrace.c                         |  10 +-
 arch/loongarch/include/asm/ftrace.h                |  29 +--
 arch/loongarch/kernel/ftrace_dyn.c                 |   2 +-
 arch/powerpc/include/asm/ftrace.h                  |  27 +--
 arch/powerpc/kernel/trace/ftrace.c                 |   4 +-
 arch/powerpc/kernel/trace/ftrace_64_pg.c           |   2 +-
 arch/riscv/include/asm/ftrace.h                    |  22 +-
 arch/riscv/kernel/asm-offsets.c                    |  28 +--
 arch/riscv/kernel/ftrace.c                         |   2 +-
 arch/s390/include/asm/ftrace.h                     |  29 +--
 arch/s390/kernel/asm-offsets.c                     |   4 +-
 arch/s390/kernel/ftrace.c                          |   2 +-
 arch/s390/lib/test_unwind.c                        |   4 +-
 arch/x86/include/asm/ftrace.h                      |  30 +--
 arch/x86/kernel/ftrace.c                           |   2 +-
 include/linux/ftrace.h                             |  85 +++++--
 include/linux/ftrace_regs.h                        |  36 +++
 include/linux/sched.h                              |   1 +
 kernel/trace/Kconfig                               |  10 +
 kernel/trace/fgraph.c                              | 155 ++++++++----
 kernel/trace/ftrace.c                              | 115 ++++-----
 kernel/trace/trace.c                               |  15 +-
 kernel/trace/trace.h                               |  11 +
 kernel/trace/trace_entries.h                       |  29 ++-
 kernel/trace/trace_functions_graph.c               | 264 +++++++++++++++++----
 kernel/trace/trace_selftest.c                      |   1 +
 .../ftrace/test.d/ftrace/fgraph-retval.tc          |   2 +-
 29 files changed, 632 insertions(+), 332 deletions(-)
 create mode 100644 include/linux/ftrace_regs.h
---------------------------

.
Subject: [GIT PULL] kgdb changes for v6.13
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jason Wessel <jason.wessel@windriver.com>, linux-kernel@vger.kernel.org,
	Douglas Anderson <dianders@chromium.org>,
	Nir Lichtman <nir@lichtman.org>,
	Yuran Pereira <yuran.pereira@hotmail.com>
Date: Mon, 18 Nov 2024 16:41:18 +0000

The following changes since commit 81983758430957d9a5cb3333fe324fd70cf63e7e:

  Linux 6.12-rc5 (2024-10-27 12:52:02 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux.git/ tags/kgdb-6.13-rc1

for you to fetch changes up to 24b2455fe8fce17258fab4bb945d8e6929baeb77:

  kdb: fix ctrl+e/a/f/b/d/p/n broken in keyboard mode (2024-11-18 15:20:22 +0000)

----------------------------------------------------------------
kgdb patches for 6.13

A relatively modest collection of changes:

* Adopt kstrtoint() and kstrtol() instead of the simple_strtoXX family
  for better error checking of user input.
* Align the print behavour when breakpoints are enabled and disabled by
  adopting the current behaviour of breakpoint disable for both.
* Remove some of the (rather odd and user hostile) hex fallbacks and
  require kdb users to prefix with 0x instead.
* Tidy up (and fix) control code handling in kdb's keyboard code. This
  makes the control code handling at the keyboard behave the same way
  as it does via the UART.
* Switch my own entry in MAINTAINERS to my @kernel.org address.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>

----------------------------------------------------------------
Daniel Thompson (1):
      MAINTAINERS: Use Daniel Thompson's korg address for kgdb work

Nir Lichtman (3):
      kdb: Remove fallback interpretation of arbitrary numbers as hex
      kdb: Fix breakpoint enable to be silent if already enabled
      kdb: fix ctrl+e/a/f/b/d/p/n broken in keyboard mode

Yuran Pereira (2):
      kdb: Replace the use of simple_strto with safer kstrto in kdb_main
      trace: kdb: Replace simple_strtoul with kstrtoul in kdb_ftdump

 MAINTAINERS                     |  2 +-
 kernel/debug/kdb/kdb_bp.c       |  6 ++--
 kernel/debug/kdb/kdb_keyboard.c | 33 ++++++++++++++------
 kernel/debug/kdb/kdb_main.c     | 69 ++++++++++-------------------------------
 kernel/trace/trace_kdb.c        | 13 +++-----
 5 files changed, 51 insertions(+), 72 deletions(-)

.
Subject: [GIT PULL] sched_ext: Changes for v6.13
From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, David Vernet <void@manifault.com>
Date: Mon, 18 Nov 2024 06:45:19 -1000

The following changes since commit a759bf0dfc4db3cb6556fc79c7c98da3a46b2b80:

  sched_ext: Update scx_show_state.py to match scx_ops_bypass_depth's new type (2024-11-05 11:45:27 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git/ tags/sched_ext-for-6.13

for you to fetch changes up to 6b8950ef993bcf198d4a80cde0b2da805b75ed70:

  sched_ext: Replace scx_next_task_picked() with switch_class() in comment (2024-11-14 15:30:24 -1000)

----------------------------------------------------------------
sched_ext: Change for v6.13

- Improve the default select_cpu() implementation making it topology aware
  and handle WAKE_SYNC better.

- set_arg_maybe_null() was used to inform the verifier which ops args could
  be NULL in a rather hackish way. Use the new __nullable CFI stub tags
  instead.

- On Sapphire Rapids multi-socket systems, a BPF scheduler, by hammering on
  the same queue across sockets, could live-lock the system to the point
  where the system couldn't make reasonable forward progress. This could
  lead to soft-lockup triggered resets or stalling out bypass mode switch
  and thus BPF scheduler ejection for tens of minutes if not hours. After
  trying a number of mitigations, the following set worked reliably:

  - Injecting artificial cpu_relax() loops in two places while sched_ext is
    trying to turn on the bypass mode.

  - Triggering scheduler ejection when soft-lockup detection is imminent (a
    quarter of threshold left).

  While not the prettiest, the impact both in terms of code complexity and
  overhead is minimal.

- A common complaint on the API is the overuse of the word "dispatch" and
  the confusion around "consume". This is due to how the dispatch queues
  became more generic over time. Rename the affected kfuncs for clarity.
  Thanks to BPF's compatibility features, this change can be made in a way
  that's both forward and backward compatible. The compatibility code will
  be dropped in a few releases.

- Pull sched_ext/for-6.12-fixes to receive a prerequisite change. Other misc
  changes.

----------------------------------------------------------------
Andrea Righi (6):
      sched_ext: improve WAKE_SYNC behavior for default idle CPU selection
      sched_ext: Clarify ops.select_cpu() for single-CPU tasks
      sched_ext: Introduce LLC awareness to the default idle selection policy
      sched_ext: Introduce NUMA awareness to the default idle selection policy
      sched_ext: Do not enable LLC/NUMA optimizations when domains overlap
      sched_ext: Fix incorrect use of bitwise AND

Changwoo Min (2):
      sched_ext: Clarify sched_ext_ops table for userland scheduler
      sched_ext: add a missing rcu_read_lock/unlock pair at scx_select_cpu_dfl()

Tejun Heo (10):
      sched_ext: Factor out move_task_between_dsqs() from scx_dispatch_from_dsq()
      sched_ext: Rename CFI stubs to names that are recognized by BPF
      sched_ext: Replace set_arg_maybe_null() with __nullable CFI stub tags
      Merge branch 'for-6.12-fixes' into for-6.13
      sched_ext: Avoid live-locking bypass mode switching
      sched_ext: Enable the ops breather and eject BPF scheduler on softlockup
      sched_ext: scx_bpf_dispatch_from_dsq_set_*() are allowed from unlocked context
      sched_ext: Rename scx_bpf_dispatch[_vtime]() to scx_bpf_dsq_insert[_vtime]()
      sched_ext: Rename scx_bpf_consume() to scx_bpf_dsq_move_to_local()
      sched_ext: Rename scx_bpf_dispatch[_vtime]_from_dsq*() -> scx_bpf_dsq_move[_vtime]*()

Tianchen Ding (1):
      sched_ext: Use btf_ids to resolve task_struct

Zhang Qiao (2):
      sched/ext: Fix unmatch trailing comment of CONFIG_EXT_GROUP_SCHED
      sched/ext: Use tg_cgroup() to elieminate duplicate code

Zhao Mengmeng (1):
      sched_ext: Replace scx_next_task_picked() with switch_class() in comment

 Documentation/scheduler/sched-ext.rst    |  71 ++-
 include/linux/sched/ext.h                |   2 +
 kernel/sched/ext.c                       | 968 +++++++++++++++++++++----------
 kernel/watchdog.c                        |   8 +
 tools/sched_ext/include/scx/common.bpf.h |  18 +-
 tools/sched_ext/include/scx/compat.bpf.h | 117 +++-
 tools/sched_ext/scx_central.bpf.c        |  14 +-
 tools/sched_ext/scx_flatcg.bpf.c         |  20 +-
 tools/sched_ext/scx_qmap.bpf.c           |  36 +-
 tools/sched_ext/scx_show_state.py        |   2 +
 tools/sched_ext/scx_simple.bpf.c         |  16 +-
 11 files changed, 878 insertions(+), 394 deletions(-)

-- 
tejun

.
Subject: [PATCH 0/2] KVM: x86: Fix more KVM_X86 Kconfig bugs
From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, 
	Arnd Bergmann <arnd@arndb.de>
Date: Mon, 18 Nov 2024 09:20:00 -0800

.
Subject: [PATCH v2] docs/mm: add more warnings around page table access
From: Jann Horn <jannh@google.com>
To: Andrew Morton <akpm@linux-foundation.org>, 
 Jonathan Corbet <corbet@lwn.net>, 
 Lorenzo Stoakes <lorenzo.stoakes@oracle.com>, 
 "Liam R . Howlett" <Liam.Howlett@oracle.com>, 
 Vlastimil Babka <vbabka@suse.cz>
Cc: Alice Ryhl <aliceryhl@google.com>, Boqun Feng <boqun.feng@gmail.com>, 
 Matthew Wilcox <willy@infradead.org>, Mike Rapoport <rppt@kernel.org>, 
 Suren Baghdasaryan <surenb@google.com>, Hillf Danton <hdanton@sina.com>, 
 Qi Zheng <zhengqi.arch@bytedance.com>, SeongJae Park <sj@kernel.org>, 
 Bagas Sanjaya <bagasdotme@gmail.com>, linux-mm@kvack.org, 
 linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
 Matteo Rizzo <matteorizzo@google.com>, Jann Horn <jannh@google.com>
Date: Mon, 18 Nov 2024 17:47:08 +0100

.
Subject: [GIT PULL] Documentation for 6.13
From: Jonathan Corbet <corbet@lwn.net>
To: Linus Torvalds <torvalds@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Date: Mon, 18 Nov 2024 10:27:09 -0700

The following changes since commit 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b:

  Linux 6.12-rc2 (2024-10-06 15:32:27 -0700)

are available in the Git repository at:

  git://git.lwn.net/linux.git tags/docs-6.13

for you to fetch changes up to c818d5c64c9a8cc14853d716bf7ce6674a6126d0:

  Documentation/CoC: spell out enforcement for unacceptable behaviors (2024=
-11-15 14:31:59 -0700)

----------------------------------------------------------------
Another moderately busy cycle in docsland:

- Work on Chinese translations has picked up again.  Happily, they are
  maintaining the existing translations and not just adding new ones.

- Some maintenance of the Japanese and Italian translations as well.

- The removal of the venerable "dontdiff" file.  It has long outlived its
  usefulness and contained entries ("parse.*") that would actively mask
  actual source change.

- The addition of enforcement information to the code-of-conduct
  documentation.

Along with some build-system fixes and a lot of typo and language fixes.

----------------------------------------------------------------
Abhinav Saxena (1):
      docs: fix typos and whitespace in Documentation/process/backporting.r=
st

Akira Yokosawa (1):
      docs/ja_JP: howto: Catch up changes in v6.11

Andrew Kreimer (2):
      docs: backporting: fix a typo
      Documentation/maintainer-tip: Fix typos

Andr=C3=A9 Almeida (1):
      scripts/kernel-doc: Fix build time warnings

Bernhard M. Wiedemann (1):
      docs/zh_TW+zh_CN: Make rst references unique

Carlos Bilbao (1):
      kernel-docs: Add new section for Rust learning materials

Changhuang Liang (1):
      Documentation: kgdb: Correct parameter error

Chen-Yu Tsai (1):
      scripts/kernel-doc: Do not track section counter across processed fil=
es

Dongliang Mu (15):
      docs/zh_CN: add the translation of kbuild/kconfig.rst
      docs/zh_CN: add the translation of kbuild/kbuild.rst
      docs/zh_CN: add the translations of kbuild/reproducible-builds.rst
      docs/zh_CN: update the translation of process/submitting-patches.rst
      docs/zh_CN: update the translation of process/email-clients.rst
      docs/zh_CN: update the translation of process/coding-style.rst
      docs/zh_CN: update the translation of mm/hmm.rst
      docs/zh_CN: update the translation of mm/active_mm.rst
      docs/zh_CN: update the translation of mm/admon/faq.rst
      docs/zh_CN: update the translation of mm/overcommit-accounting.rst
      docs/zh_CN: update the translation of mm/page_table_check.rst
      docs/zh_CN: update the translation of mm/page_owner.rst
      docs/zh_CN: update the translation of process/programming-language.rst
      docs/zh_CN: add the translation of kbuild/llvm.rst
      docs/zh_CN: fix one sentence in llvm.rst

Eder Zulian (1):
      docs/core-api: swiotlb: fix typos

Federico Vaga (2):
      doc:it_IT: update I2C summary
      doc:it_IT: update documents in process/

Gabriele Monaco (1):
      tracing: doc: Fix typo in ftrace histogram

Guilherme G. Piccoli (1):
      Documentation: Improve crash_kexec_post_notifiers description

Haoyang Liu (2):
      docs/dev-tools: fix a typo
      docs/zh_CN: add translation of dev-tools/kmsan.rst

Jonathan Corbet (2):
      Add Yanteng Si to .mailmap
      docs: remove Documentation/dontdiff

Lucas De Marchi (1):
      Documentation: core-api/cpuhotplug: Fix missing prefix

Matthieu Baerts (NGI0) (1):
      docs: gcov: fix link to LCOV website

Nihar Chaithanya (1):
      docs:process:changes: fix version command for btrfs-progs

Nir Lichtman (2):
      Documentation: English fixes in kgdb/kdb article
      Documentation: Fix incorrect paths/magic in magic numbers rst

Pengyu Zhang (4):
      Docs/mm: Fix a mistake for pfn in page_tables.rst
      Docs/zh_CN: Translate page_tables.rst to Simplified Chinese
      Docs/zh_CN: Fix the pfn calculation error in page_tables.rst
      docs/zh_CN: Add a entry in Chinese glossary

Randy Dunlap (2):
      kernel-doc: allow object-like macros in ReST output
      Documentation: admin: reorganize kernel-parameters intro

Sergio Gonz=C3=A1lez Collado (1):
      docs/sp_SP: Add translation for scheduler/sched-bwc.rst

Shuah Khan (1):
      Documentation/CoC: spell out enforcement for unacceptable behaviors

Steven Rostedt (1):
      Documentation/tracing: Mention that RESET_ATTACK_MITIGATION can clear=
 memory

SurajSonawane2415 (1):
      docs: fix WARNING document not included in any toctree

Thorsten Blum (1):
      docs: Remove redundant word "for"

Thorsten Leemhuis (1):
      docs: bug-bisect: add a note about bisecting -next

Vishnu Sanal T (1):
      fix grammar on false-sharing.rst

Yaxin Wang (1):
      Docs/zh_CN: Translate physical_memory.rst to Simplified Chinese

 .mailmap                                           |   1 +
 Documentation/admin-guide/bug-bisect.rst           |  21 ++
 Documentation/admin-guide/kernel-parameters.rst    |  36 +-
 Documentation/admin-guide/kernel-parameters.txt    |  22 +-
 Documentation/core-api/cpu_hotplug.rst             |   2 +-
 Documentation/core-api/swiotlb.rst                 |   4 +-
 Documentation/dev-tools/gcov.rst                   |   2 +-
 Documentation/dev-tools/kgdb.rst                   |  20 +-
 Documentation/dev-tools/kmsan.rst                  |   2 +-
 Documentation/dontdiff                             | 271 --------------
 Documentation/kernel-hacking/false-sharing.rst     |   4 +-
 Documentation/maintainer/pull-requests.rst         |   2 +-
 Documentation/mm/page_tables.rst                   |   2 +-
 Documentation/process/5.Posting.rst                |   5 -
 Documentation/process/backporting.rst              |   8 +-
 Documentation/process/changes.rst                  |   2 +-
 .../process/code-of-conduct-interpretation.rst     |  87 +++++
 Documentation/process/kernel-docs.rst              | 163 ++++++++-
 Documentation/process/maintainer-tip.rst           |   4 +-
 Documentation/rust/index.rst                       |   3 +
 Documentation/staging/magic-number.rst             |   6 +-
 Documentation/trace/histogram.rst                  |   2 +-
 Documentation/trace/index.rst                      |   1 +
 .../it_IT/{process =3D> dev-tools}/clang-format.rst  |   0
 .../translations/it_IT/dev-tools/index.rst         |  17 +
 Documentation/translations/it_IT/i2c/summary.rst   |  72 ++--
 Documentation/translations/it_IT/index.rst         |   8 +-
 .../translations/it_IT/process/2.Process.rst       |   6 +-
 .../translations/it_IT/process/4.Coding.rst        |   2 +-
 .../translations/it_IT/process/5.Posting.rst       |   5 -
 .../translations/it_IT/process/changes.rst         |  33 +-
 .../translations/it_IT/process/coding-style.rst    |  37 +-
 .../translations/it_IT/process/email-clients.rst   |  33 +-
 Documentation/translations/it_IT/process/howto.rst |  10 +-
 Documentation/translations/it_IT/process/index.rst |  10 -
 .../it_IT/process/submit-checklist.rst             | 167 ++++-----
 .../it_IT/process/submitting-patches.rst           |  23 +-
 Documentation/translations/it_IT/staging/index.rst |  13 +
 .../it_IT/{process =3D> staging}/magic-number.rst    |   0
 Documentation/translations/ja_JP/process/howto.rst |  10 +-
 .../translations/sp_SP/scheduler/index.rst         |   1 +
 .../translations/sp_SP/scheduler/sched-bwc.rst     | 287 +++++++++++++++
 .../translations/zh_CN/dev-tools/gcov.rst          |   8 +-
 .../translations/zh_CN/dev-tools/index.rst         |   2 +-
 .../translations/zh_CN/dev-tools/kmsan.rst         | 392 +++++++++++++++++=
++++
 Documentation/translations/zh_CN/glossary.rst      |   1 +
 Documentation/translations/zh_CN/kbuild/index.rst  |   9 +-
 Documentation/translations/zh_CN/kbuild/kbuild.rst | 304 ++++++++++++++++
 .../translations/zh_CN/kbuild/kconfig.rst          | 259 ++++++++++++++
 Documentation/translations/zh_CN/kbuild/llvm.rst   | 203 +++++++++++
 .../zh_CN/kbuild/reproducible-builds.rst           | 114 ++++++
 Documentation/translations/zh_CN/mm/active_mm.rst  |   5 +
 Documentation/translations/zh_CN/mm/damon/faq.rst  |  17 -
 Documentation/translations/zh_CN/mm/hmm.rst        |   8 +-
 Documentation/translations/zh_CN/mm/index.rst      |   2 +
 .../zh_CN/mm/overcommit-accounting.rst             |   3 +-
 Documentation/translations/zh_CN/mm/page_owner.rst |  46 +++
 .../translations/zh_CN/mm/page_table_check.rst     |  13 +
 .../translations/zh_CN/mm/page_tables.rst          | 221 ++++++++++++
 .../translations/zh_CN/mm/physical_memory.rst      | 356 +++++++++++++++++=
++
 .../translations/zh_CN/process/5.Posting.rst       |   4 -
 .../translations/zh_CN/process/coding-style.rst    |  11 -
 .../translations/zh_CN/process/email-clients.rst   |   9 +-
 .../zh_CN/process/programming-language.rst         |  78 ++--
 .../zh_CN/process/submitting-patches.rst           |  19 +-
 .../translations/zh_TW/dev-tools/gcov.rst          |   8 +-
 .../translations/zh_TW/process/5.Posting.rst       |   4 -
 scripts/kernel-doc                                 |  49 ++-
 68 files changed, 2892 insertions(+), 657 deletions(-)
 delete mode 100644 Documentation/dontdiff
 rename Documentation/translations/it_IT/{process =3D> dev-tools}/clang-for=
mat.rst (100%)
 create mode 100644 Documentation/translations/it_IT/dev-tools/index.rst
 create mode 100644 Documentation/translations/it_IT/staging/index.rst
 rename Documentation/translations/it_IT/{process =3D> staging}/magic-numbe=
r.rst (100%)
 create mode 100644 Documentation/translations/sp_SP/scheduler/sched-bwc.rst
 create mode 100644 Documentation/translations/zh_CN/dev-tools/kmsan.rst
 create mode 100644 Documentation/translations/zh_CN/kbuild/kbuild.rst
 create mode 100644 Documentation/translations/zh_CN/kbuild/kconfig.rst
 create mode 100644 Documentation/translations/zh_CN/kbuild/llvm.rst
 create mode 100644 Documentation/translations/zh_CN/kbuild/reproducible-bu=
ilds.rst
 create mode 100644 Documentation/translations/zh_CN/mm/page_tables.rst
 create mode 100644 Documentation/translations/zh_CN/mm/physical_memory.rst

.
Subject: [PATCH v3 0/2] media: uvcvideo: Support partial control reads and
 minor changes
From: Ricardo Ribalda <ribalda@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, 
 Hans de Goede <hdegoede@redhat.com>, 
 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, 
 Ricardo Ribalda <ribalda@chromium.org>, 
 Sakari Ailus <sakari.ailus@linux.intel.com>, stable@vger.kernel.org
Date: Mon, 18 Nov 2024 17:16:50 +0000

.
Subject: [PATCH] spi: rockchip-sfc: Embedded DMA only support 4B aligned address
From: Jon Lin <jon.lin@rock-chips.com>
To: broonie@kernel.org
Cc: linux-rockchip@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	heiko@sntech.de,
	jon.lin@rock-chips.com,
	linux-arm-kernel@lists.infradead.org,
	linux-spi@vger.kernel.org
Date: Mon, 18 Nov 2024 22:56:46 +0800

.
Subject: [PATCH V11 00/10] AMD XDNA driver
From: Lizhi Hou <lizhi.hou@amd.com>
To: <ogabbay@kernel.org>, <quic_jhugo@quicinc.com>,
	<dri-devel@lists.freedesktop.org>
Date: Mon, 18 Nov 2024 09:29:32 -0800

.
Subject: [GIT PULL] Performance events changes for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org
Date: Mon, 18 Nov 2024 18:29:57 +0100

Linus,

Please pull the latest perf/core Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-core-2024-11-18

   # HEAD: 2c47e7a74f445426d156278e339b7abb259e50de perf/core: Correct perf sampling with guest VMs

Performance events changes for v6.13:

 - Uprobes:
    - Add BPF session support (Jiri Olsa)
    - Switch to RCU Tasks Trace flavor for better performance (Andrii Nakryiko)
    - Massively increase uretprobe SMP scalability by SRCU-protecting
      the uretprobe lifetime (Andrii Nakryiko)
    - Kill xol_area->slot_count (Oleg Nesterov)

 - Core facilities:
    - Implement targeted high-frequency profiling by adding the ability
      for an event to "pause" or "resume" AUX area tracing (Adrian Hunter)

 - VM profiling/sampling:
    - Correct perf sampling with guest VMs (Colton Lewis)

 - New hardware support:
    - x86/intel: Add PMU support for Intel ArrowLake-H CPUs (Dapeng Mi)

 - Misc fixes and enhancements:
    - x86/intel/pt: Fix buffer full but size is 0 case (Adrian Hunter)
    - x86/amd: Warn only on new bits set (Breno Leitao)
    - x86/amd/uncore: Avoid a false positive warning about snprintf
                      truncation in amd_uncore_umc_ctx_init (Jean Delvare)
    - uprobes: Re-order struct uprobe_task to save some space (Christophe JAILLET)
    - x86/rapl: Move the pmu allocation out of CPU hotplug (Kan Liang)
    - x86/rapl: Clean up cpumask and hotplug (Kan Liang)
    - uprobes: Deuglify xol_get_insn_slot/xol_free_insn_slot paths (Oleg Nesterov)

 Thanks,

	Ingo

------------------>
Adrian Hunter (4):
      perf/x86/intel/pt: Fix buffer full but size is 0 case
      perf/core: Add aux_pause, aux_resume, aux_start_paused
      perf/x86/intel/pt: Add support for pause / resume
      perf/x86/intel: Do not enable large PEBS for events with aux actions or aux sampling

Andrii Nakryiko (3):
      uprobes: switch to RCU Tasks Trace flavor for better performance
      uprobes: allow put_uprobe() from non-sleepable softirq context
      uprobes: SRCU-protect uretprobe lifetime (with timeout)

Breno Leitao (1):
      perf/x86/amd: Warn only on new bits set

Christophe JAILLET (1):
      uprobes: Re-order struct uprobe_task to save some space

Colton Lewis (5):
      perf/arm: Drop unused functions
      perf/core: Hoist perf_instruction_pointer() and perf_misc_flags()
      perf/powerpc: Use perf_arch_instruction_pointer()
      perf/x86: Refactor misc flag assignments
      perf/core: Correct perf sampling with guest VMs

Dapeng Mi (4):
      perf/x86: Refine hybrid_pmu_type defination
      x86/cpu/intel: Define helper to get CPU core native ID
      perf/x86/intel: Support hybrid PMU with multiple atom uarchs
      perf/x86/intel: Add PMU support for ArrowLake-H

Jean Delvare (1):
      perf/x86/amd/uncore: Avoid a false positive warning about snprintf truncation in amd_uncore_umc_ctx_init

Jiri Olsa (2):
      uprobe: Add data pointer to consumer handlers
      uprobe: Add support for session consumer

Kan Liang (2):
      perf/x86/rapl: Move the pmu allocation out of CPU hotplug
      perf/x86/rapl: Clean up cpumask and hotplug

Oleg Nesterov (9):
      uprobes: don't abuse get_utask() in pre_ssout() and prepare_uretprobe()
      uprobes: sanitiize xol_free_insn_slot()
      uprobes: kill the unnecessary put_uprobe/xol_free_insn_slot in uprobe_free_utask()
      uprobes: simplify xol_take_insn_slot() and its caller
      uprobes: move the initialization of utask->xol_vaddr from pre_ssout() to xol_get_insn_slot()
      uprobes: pass utask to xol_get_insn_slot() and xol_free_insn_slot()
      uprobes: deny mremap(xol_vma)
      uprobes: kill xol_area->slot_count
      uprobes: fold xol_take_insn_slot() into xol_get_insn_slot()


 arch/Kconfig                                       |   1 +
 arch/arm/include/asm/perf_event.h                  |   7 -
 arch/arm/kernel/perf_callchain.c                   |  17 -
 arch/arm64/include/asm/perf_event.h                |   4 -
 arch/arm64/kernel/perf_callchain.c                 |  28 -
 arch/powerpc/include/asm/perf_event_server.h       |   6 +-
 arch/powerpc/perf/callchain.c                      |   2 +-
 arch/powerpc/perf/callchain_32.c                   |   2 +-
 arch/powerpc/perf/callchain_64.c                   |   2 +-
 arch/powerpc/perf/core-book3s.c                    |   4 +-
 arch/s390/include/asm/perf_event.h                 |   6 +-
 arch/s390/kernel/perf_event.c                      |   4 +-
 arch/x86/events/amd/core.c                         |  10 +-
 arch/x86/events/amd/uncore.c                       |   5 +-
 arch/x86/events/core.c                             |  64 ++-
 arch/x86/events/intel/core.c                       | 137 ++++-
 arch/x86/events/intel/ds.c                         |  21 +
 arch/x86/events/intel/pt.c                         |  84 ++-
 arch/x86/events/intel/pt.h                         |   6 +
 arch/x86/events/perf_event.h                       |  34 +-
 arch/x86/events/rapl.c                             | 130 ++---
 arch/x86/include/asm/cpu.h                         |   6 +
 arch/x86/include/asm/perf_event.h                  |  12 +-
 arch/x86/kernel/cpu/intel.c                        |  15 +
 include/linux/cpuhotplug.h                         |   1 -
 include/linux/perf_event.h                         |  54 +-
 include/linux/uprobes.h                            |  83 ++-
 include/uapi/linux/perf_event.h                    |  11 +-
 kernel/events/core.c                               | 102 +++-
 kernel/events/internal.h                           |   1 +
 kernel/events/uprobes.c                            | 608 +++++++++++++++------
 kernel/trace/bpf_trace.c                           |   6 +-
 kernel/trace/trace_uprobe.c                        |  12 +-
 .../selftests/bpf/bpf_testmod/bpf_testmod.c        |   2 +-
 34 files changed, 1069 insertions(+), 418 deletions(-)

.
Subject: kernel/bpf/verifier.c:19160:44: sparse: sparse: cast truncates bits
 from constant value (ffffffc000000000 becomes 0)
From: kernel test robot <lkp@intel.com>
To: Alexei Starovoitov <ast@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Daniel Borkmann <daniel@iogearbox.net>
Date: Tue, 19 Nov 2024 01:43:05 +0800

.
Subject: Queries regarding consolidated picture of virtualization and SPT/EPT/IOMMU/DMAR/PT
From: Ajay Garg <ajaygargnsit@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, iommu@lists.linux-foundation.org, 
	kvm@vger.kernel.org, Linux Memory Management List <linux-mm@kvack.org>
Date: Mon, 18 Nov 2024 23:30:32 +0530

.
Subject: [PATCH v14 0/9] drm/vkms: Reimplement line-per-line pixel
 conversion for plane reading
From: Louis Chauvet <louis.chauvet@bootlin.com>
To: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, 
 Melissa Wen <melissa.srw@gmail.com>, 
 =?utf-8?q?Ma=C3=ADra_Canal?= <mairacanal@riseup.net>, 
 Haneen Mohammed <hamohammed.sa@gmail.com>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Jonathan Corbet <corbet@lwn.net>, 
 Louis Chauvet <louis.chauvet@bootlin.com>, Simona Vetter <simona@ffwll.ch>, 
 Helen Koike <helen.koike@collabora.com>, rdunlap@infradead.org, 
 arthurgrillo@riseup.net, pekka.paalanen@haloniitty.fi, 
 Simona Vetter <simona.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, 
 linux-doc@vger.kernel.org, thomas.petazzoni@bootlin.com, 
 jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, 
 seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, 
 Pekka Paalanen <pekka.paalanen@collabora.com>, 
 =?utf-8?q?Ma=C3=ADra_Canal?= <mcanal@igalia.com>, 
 =?utf-8?q?Jos=C3=A9_Exp=C3=B3sito?= <jose.exposito89@gmail.com>
Date: Mon, 18 Nov 2024 19:28:15 +0100

.
Subject: [PATCH][next] fs: nfs: acl: Avoid -Wflex-array-member-not-at-end
 warning
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>,
	Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>, Neil Brown <neilb@suse.de>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-hardening@vger.kernel.org
Date: Mon, 18 Nov 2024 12:01:17 -0600

.
Subject: [PATCH] befs: Fix incorrect superblock consistency check
From: =?UTF-8?q?Daniel=20Mart=C3=ADn=20G=C3=B3mez?= <dalmemail@gmail.com>
To: dalmemail@gmail.com
Cc: Luis de Bethencourt <luisbg@kernel.org>,
	Salah Triki <salah.triki@gmail.com>,
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 18:45:19 +0100

.
Subject: [PATCH] mm: correct typo in MMAP_STATE() macro
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Liam R . Howlett" <Liam.Howlett@oracle.com>,
        Vlastimil Babka <vbabka@suse.cz>, Jann Horn <jannh@google.com>,
        linux-mm@kvack.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 17:54:14 +0000

.
Subject: [GIT PULL] Scheduler changes for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>, Tejun Heo <tj@kernel.org>
Date: Mon, 18 Nov 2024 18:55:46 +0100


Linus,

Please pull the latest sched/core Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-core-2024-11-18

   # HEAD: 771d271b2b908cf660d6789bb4355ed553250edc sched, x86: Update the comment for TIF_NEED_RESCHED_LAZY.

Scheduler changes for v6.13:

 - Core facilities:

    - Add the "Lazy preemption" model (CONFIG_PREEMPT_LAZY=y), which optimizes
      fair-class preemption by delaying preemption requests to the
      tick boundary, while working as full preemption for RR/FIFO/DEADLINE
      classes. (Peter Zijlstra)

        - x86:   Enable Lazy preemption (Peter Zijlstra)
        - riscv: Enable Lazy preemption (Jisheng Zhang)

    - Initialize idle tasks only once (Thomas Gleixner)

    - sched/ext: Remove sched_fork() hack (Thomas Gleixner)

 - Fair scheduler:
    - Optimize the PLACE_LAG when se->vlag is zero (Huang Shijie)

 - Idle loop:
      Optimize the generic idle loop by removing unnecessary
      memory barrier (Zhongqiu Han)

 - RSEQ:
    - Improve cache locality of RSEQ concurrency IDs for
      intermittent workloads (Mathieu Desnoyers)

 - Waitqueues:
    - Make wake_up_{bit,var} less fragile (Neil Brown)

 - PSI:
    - Pass enqueue/dequeue flags to psi callbacks directly (Johannes Weiner)

 - Preparatory patches for proxy execution:
    - core: Add move_queued_task_locked helper (Connor O'Brien)
    - core: Consolidate pick_*_task to task_is_pushable helper (Connor O'Brien)
    - core: Split out __schedule() deactivate task logic into a helper (John Stultz)
    - core: Split scheduler and execution contexts (Peter Zijlstra)
    - locking/mutex: Make mutex::wait_lock irq safe (Juri Lelli)
    - locking/mutex: Expose __mutex_owner() (Juri Lelli)
    - locking/mutex: Remove wakeups from under mutex::wait_lock (Peter Zijlstra)

 - Misc fixes and cleanups:
    - core: Remove unused __HAVE_THREAD_FUNCTIONS hook support (David Disseldorp)
    - core: Update the comment for TIF_NEED_RESCHED_LAZY (Sebastian Andrzej Siewior)
    - wait: Remove unused bit_wait_io_timeout (Dr. David Alan Gilbert)
    - fair: remove the DOUBLE_TICK feature (Huang Shijie)
    - fair: fix the comment for PREEMPT_SHORT (Huang Shijie)
    - uclamp: Fix unnused variable warning (Christian Loehle)
    - rt: No PREEMPT_RT=y for all{yes,mod}config

 Thanks,

	Ingo

------------------>
Christian Loehle (1):
      sched/uclamp: Fix unnused variable warning

Connor O'Brien (2):
      sched: Add move_queued_task_locked helper
      sched: Consolidate pick_*_task to task_is_pushable helper

David Disseldorp (1):
      sched: remove unused __HAVE_THREAD_FUNCTIONS hook support

Dr. David Alan Gilbert (1):
      sched/wait: Remove unused bit_wait_io_timeout

Huang Shijie (3):
      sched/fair: remove the DOUBLE_TICK feature
      sched/fair: optimize the PLACE_LAG when se->vlag is zero
      sched/fair: fix the comment for PREEMPT_SHORT

Ingo Molnar (1):
      fs/bcachefs: Fix __wait_on_freeing_inode() definition of waitqueue entry

Jisheng Zhang (1):
      riscv: add PREEMPT_LAZY support

Johannes Weiner (1):
      sched: psi: pass enqueue/dequeue flags to psi callbacks directly

John Stultz (1):
      sched: Split out __schedule() deactivate task logic into a helper

Juri Lelli (2):
      locking/mutex: Make mutex::wait_lock irq safe
      locking/mutex: Expose __mutex_owner()

Mathieu Desnoyers (1):
      sched: Improve cache locality of RSEQ concurrency IDs for intermittent workloads

NeilBrown (7):
      sched: change wake_up_bit() and related function to expect unsigned long *
      sched: Improve documentation for wake_up_bit/wait_on_bit family of functions
      sched: Document wait_var_event() family of functions and wake_up_var()
      sched: Add test_and_clear_wake_up_bit() and atomic_dec_and_wake_up()
      sched: Add wait/wake interface for variable updated under a lock.
      sched: add wait_var_event_io()
      softirq: use bit waits instead of var waits.

Peter Zijlstra (7):
      locking/mutex: Remove wakeups from under mutex::wait_lock
      sched: Split scheduler and execution contexts
      sched: Add TIF_NEED_RESCHED_LAZY infrastructure
      sched: Add Lazy preemption model
      sched: Enable PREEMPT_DYNAMIC for PREEMPT_RT
      sched, x86: Enable Lazy preemption
      sched: No PREEMPT_RT=y for all{yes,mod}config

Sebastian Andrzej Siewior (1):
      sched, x86: Update the comment for TIF_NEED_RESCHED_LAZY.

Thomas Gleixner (2):
      sched: Initialize idle tasks only once
      sched/ext: Remove sched_fork() hack

Zhongqiu Han (1):
      sched: idle: Optimize the generic idle loop by removing needless memory barrier


 arch/riscv/Kconfig                   |   1 +
 arch/riscv/include/asm/thread_info.h |  10 +-
 arch/x86/Kconfig                     |   1 +
 arch/x86/include/asm/thread_info.h   |   6 +-
 fs/exec.c                            |   2 +-
 include/linux/entry-common.h         |   3 +-
 include/linux/entry-kvm.h            |   5 +-
 include/linux/mm_types.h             |  72 +++++-
 include/linux/preempt.h              |   8 +-
 include/linux/sched.h                |   5 +-
 include/linux/sched/ext.h            |   1 -
 include/linux/sched/task_stack.h     |   2 +-
 include/linux/thread_info.h          |  21 +-
 include/linux/wait_bit.h             | 444 ++++++++++++++++++++++++++++-------
 kernel/Kconfig.preempt               |  27 ++-
 kernel/entry/common.c                |   2 +-
 kernel/entry/kvm.c                   |   4 +-
 kernel/fork.c                        |   2 +-
 kernel/futex/pi.c                    |   6 +-
 kernel/locking/mutex.c               |  59 ++---
 kernel/locking/mutex.h               |  27 +++
 kernel/locking/rtmutex.c             |  51 ++--
 kernel/locking/rtmutex_api.c         |  12 +-
 kernel/locking/rtmutex_common.h      |   3 +-
 kernel/locking/rwbase_rt.c           |   8 +-
 kernel/locking/rwsem.c               |   4 +-
 kernel/locking/spinlock_rt.c         |   5 +-
 kernel/locking/ww_mutex.h            |  51 ++--
 kernel/sched/core.c                  | 289 +++++++++++++++--------
 kernel/sched/deadline.c              |  57 ++---
 kernel/sched/debug.c                 |   7 +-
 kernel/sched/ext.c                   |   7 +-
 kernel/sched/fair.c                  |  42 ++--
 kernel/sched/features.h              |   3 +-
 kernel/sched/idle.c                  |   1 -
 kernel/sched/pelt.c                  |   2 +-
 kernel/sched/rt.c                    |  67 +++---
 kernel/sched/sched.h                 | 155 ++++++++----
 kernel/sched/stats.h                 |  29 ++-
 kernel/sched/syscalls.c              |   4 +-
 kernel/sched/wait_bit.c              |  90 ++++---
 kernel/softirq.c                     |  14 +-
 42 files changed, 1105 insertions(+), 504 deletions(-)

.
Subject: [GIT PULL] x86/splitlock changes for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Date: Mon, 18 Nov 2024 19:02:30 +0100

Linus,

Please pull the latest x86/splitlock Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-splitlock-2024-11-18

   # HEAD: 408eb7417a92c5354c7be34f7425b305dfe30ad9 x86/bus_lock: Add support for AMD

x86/splitlock changes for v6.13:

 - Move Split and Bus lock code to a dedicated file (Ravi Bangoria)
 - Add split/bus lock support for AMD (Ravi Bangoria)

 Thanks,

	Ingo

------------------>
Ravi Bangoria (2):
      x86/split_lock: Move Split and Bus lock code to a dedicated file
      x86/bus_lock: Add support for AMD


 Documentation/arch/x86/buslock.rst |   3 +-
 arch/x86/Kconfig                   |   8 +
 arch/x86/include/asm/cpu.h         |  11 +-
 arch/x86/kernel/cpu/Makefile       |   2 +
 arch/x86/kernel/cpu/bus_lock.c     | 406 ++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/cpu/common.c       |   2 +
 arch/x86/kernel/cpu/intel.c        | 407 -------------------------------------
 include/linux/sched.h              |   2 +-
 kernel/fork.c                      |   2 +-
 9 files changed, 431 insertions(+), 412 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/bus_lock.c

.
Subject: [GIT PULL] x86/cleanups for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, the arch/x86 maintainers <x86@kernel.org>
Date: Mon, 18 Nov 2024 19:06:01 +0100

Linus,

Please pull the latest x86/cleanups Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-cleanups-2024-11-18

   # HEAD: 97ecb260d9c19aa044871ae2c89408c340717b61 x86/boot: Remove unused function atou()

x86 cleanups for v6.13:

  - x86/boot: Remove unused function atou() (Dr. David Alan Gilbert)
  - x86/cpu: Use str_yes_no() helper in show_cpuinfo_misc() (Thorsten Blum)
  - x86/platform: Switch back to struct platform_driver::remove() (Uwe Kleine-König)

 Thanks,

	Ingo

------------------>
Dr. David Alan Gilbert (1):
      x86/boot: Remove unused function atou()

Thorsten Blum (1):
      x86/cpu: Use str_yes_no() helper in show_cpuinfo_misc()

Uwe Kleine-König (1):
      x86/platform: Switch back to struct platform_driver::remove()


 arch/x86/boot/boot.h                  |  1 -
 arch/x86/boot/string.c                |  8 --------
 arch/x86/boot/string.h                |  1 -
 arch/x86/kernel/cpu/proc.c            | 10 +++++-----
 arch/x86/platform/iris/iris.c         |  2 +-
 arch/x86/platform/olpc/olpc-xo1-pm.c  |  4 ++--
 arch/x86/platform/olpc/olpc-xo1-sci.c |  2 +-
 7 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 148ba5c5106e..0f24f7ebec9b 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -305,7 +305,6 @@ void initregs(struct biosregs *regs);
 int strcmp(const char *str1, const char *str2);
 int strncmp(const char *cs, const char *ct, size_t count);
 size_t strnlen(const char *s, size_t maxlen);
-unsigned int atou(const char *s);
 unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base);
 size_t strlen(const char *s);
 char *strchr(const char *s, int c);
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index c23f3b9c84fe..84f7a883ce1e 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -88,14 +88,6 @@ size_t strnlen(const char *s, size_t maxlen)
 	return (es - s);
 }
 
-unsigned int atou(const char *s)
-{
-	unsigned int i = 0;
-	while (isdigit(*s))
-		i = i * 10 + (*s++ - '0');
-	return i;
-}
-
 /* Works only for digits and letters, but small and fast */
 #define TOLOWER(x) ((x) | 0x20)
 
diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
index e5d2c6b8c2f1..a5b05ebc037d 100644
--- a/arch/x86/boot/string.h
+++ b/arch/x86/boot/string.h
@@ -24,7 +24,6 @@ extern size_t strlen(const char *s);
 extern char *strstr(const char *s1, const char *s2);
 extern char *strchr(const char *s, int c);
 extern size_t strnlen(const char *s, size_t maxlen);
-extern unsigned int atou(const char *s);
 extern unsigned long long simple_strtoull(const char *cp, char **endp,
 					  unsigned int base);
 long simple_strtol(const char *cp, char **endp, unsigned int base);
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index e65fae63660e..41ed01f46bd9 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -41,11 +41,11 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 		   "fpu_exception\t: %s\n"
 		   "cpuid level\t: %d\n"
 		   "wp\t\t: yes\n",
-		   boot_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no",
-		   boot_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
-		   boot_cpu_has_bug(X86_BUG_COMA) ? "yes" : "no",
-		   boot_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
-		   boot_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
+		   str_yes_no(boot_cpu_has_bug(X86_BUG_FDIV)),
+		   str_yes_no(boot_cpu_has_bug(X86_BUG_F00F)),
+		   str_yes_no(boot_cpu_has_bug(X86_BUG_COMA)),
+		   str_yes_no(boot_cpu_has(X86_FEATURE_FPU)),
+		   str_yes_no(boot_cpu_has(X86_FEATURE_FPU)),
 		   c->cpuid_level);
 }
 #else
diff --git a/arch/x86/platform/iris/iris.c b/arch/x86/platform/iris/iris.c
index c5f3bbdbdcfe..5591a2d9cfe8 100644
--- a/arch/x86/platform/iris/iris.c
+++ b/arch/x86/platform/iris/iris.c
@@ -73,7 +73,7 @@ static struct platform_driver iris_driver = {
 		.name   = "iris",
 	},
 	.probe          = iris_probe,
-	.remove_new     = iris_remove,
+	.remove         = iris_remove,
 };
 
 static struct resource iris_resources[] = {
diff --git a/arch/x86/platform/olpc/olpc-xo1-pm.c b/arch/x86/platform/olpc/olpc-xo1-pm.c
index 6a9c42de74e7..424eeae12759 100644
--- a/arch/x86/platform/olpc/olpc-xo1-pm.c
+++ b/arch/x86/platform/olpc/olpc-xo1-pm.c
@@ -159,7 +159,7 @@ static struct platform_driver cs5535_pms_driver = {
 		.name = "cs5535-pms",
 	},
 	.probe = xo1_pm_probe,
-	.remove_new = xo1_pm_remove,
+	.remove = xo1_pm_remove,
 };
 
 static struct platform_driver cs5535_acpi_driver = {
@@ -167,7 +167,7 @@ static struct platform_driver cs5535_acpi_driver = {
 		.name = "olpc-xo1-pm-acpi",
 	},
 	.probe = xo1_pm_probe,
-	.remove_new = xo1_pm_remove,
+	.remove = xo1_pm_remove,
 };
 
 static int __init xo1_pm_init(void)
diff --git a/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc/olpc-xo1-sci.c
index 46d42ff6e18a..ccb23c73cbe8 100644
--- a/arch/x86/platform/olpc/olpc-xo1-sci.c
+++ b/arch/x86/platform/olpc/olpc-xo1-sci.c
@@ -616,7 +616,7 @@ static struct platform_driver xo1_sci_driver = {
 		.dev_groups = lid_groups,
 	},
 	.probe = xo1_sci_probe,
-	.remove_new = xo1_sci_remove,
+	.remove = xo1_sci_remove,
 	.suspend = xo1_sci_suspend,
 	.resume = xo1_sci_resume,
 };

.
Subject: [GIT PULL] x86/mm changes for v6.13
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, the arch/x86 maintainers <x86@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Date: Mon, 18 Nov 2024 19:10:32 +0100

Linus,

Please pull the latest x86/mm Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-mm-2024-11-18

   # HEAD: 7e33001b8b9a78062679e0fdf5b0842a49063135 x86/mm/tlb: Put cpumask_test_cpu() check in switch_mm_irqs_off() under CONFIG_DEBUG_VM

x86/mm changes for v6.13:

 - x86/mm/tlb: Put cpumask_test_cpu() check in switch_mm_irqs_off()
               under CONFIG_DEBUG_VM, to micro-optimize the context-switching
	       code (Rik van Riel)

 - x86/mm/doc: Add missing details in virtual memory layout (Kirill A. Shutemov)

 Thanks,

	Ingo

------------------>
Kirill A. Shutemov (1):
      x86/mm/doc: Add missing details in virtual memory layout

Rik van Riel (1):
      x86/mm/tlb: Put cpumask_test_cpu() check in switch_mm_irqs_off() under CONFIG_DEBUG_VM


 Documentation/arch/x86/x86_64/mm.rst | 35 +++++++++++++++++++++++++++++------
 arch/x86/mm/tlb.c                    |  2 +-
 2 files changed, 30 insertions(+), 7 deletions(-)

.
Subject: [RFC PATCH 0/3] arm64: support FEAT_BBM level 2 and large block mapping when rodata=full
From: Yang Shi <yang@os.amperecomputing.com>
To: catalin.marinas@arm.com,
	will@kernel.org
Cc: cl@gentwo.org,
	scott@os.amperecomputing.com,
	yang@os.amperecomputing.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 10:16:07 -0800

.
Subject: Report "KASAN: null-ptr-deref in __rb_erase_color"
From: reveliofuzzing <reveliofuzzing@gmail.com>
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 13:28:04 -0500

.
Subject: [PATCH v13 0/7] drm/vkms: Add support for YUV and DRM_FORMAT_R*
From: Louis Chauvet <louis.chauvet@bootlin.com>
To: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, 
 Melissa Wen <melissa.srw@gmail.com>, 
 =?utf-8?q?Ma=C3=ADra_Canal?= <mairacanal@riseup.net>, 
 Haneen Mohammed <hamohammed.sa@gmail.com>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, rdunlap@infradead.org, 
 arthurgrillo@riseup.net, Jonathan Corbet <corbet@lwn.net>, 
 pekka.paalanen@haloniitty.fi, Simona Vetter <simona.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, 
 jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, 
 thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, 
 nicolejadeyee@google.com, Louis Chauvet <louis.chauvet@bootlin.com>, 
 Pekka Paalanen <pekka.paalanen@collabora.com>
Date: Mon, 18 Nov 2024 19:43:13 +0100

.
Subject: [v8 PATCH 0/2] PCI/ACPI: Support Microsoft's "DmaProperty"
From: Joshua Peraza <jperaza@google.com>
To: gregkh@linuxfoundation.org
Cc: baolu.lu@linux.intel.com, bhelgaas@google.com, dtor@google.com, 
	dwmw2@infradead.org, helgaas@kernel.org, iommu@lists.linux-foundation.org, 
	jean-philippe@linaro.org, joro@8bytes.org, jperaza@google.com, 
	jsbarnes@google.com, lenb@kernel.org, linux-acpi@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, 
	mika.westerberg@linux.intel.com, oohall@gmail.com, pavel@denx.de, 
	rafael.j.wysocki@intel.com, rafael@kernel.org, rajatja@google.com, 
	rajatxjain@gmail.com, will@kernel.org
Date: Mon, 18 Nov 2024 19:30:22 +0000

.
Subject: [PATCH] docs: clk: describe userspace debugging facilities
From: Yao Zi <ziyao@disroot.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: Yao Zi <ziyao@disroot.org>,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 19:25:27 +0000

.
Subject: [PATCH v1] i2c-mlxbf: Add repeated start condition support
From: Chris Babroski <cbabroski@nvidia.com>
To: <andi.shyti@kernel.org>, <kblaiech@nvidia.com>, <asmaa@nvidia.com>
Date: Mon, 18 Nov 2024 19:28:33 +0000

.
Subject: [PATCH] f2fs: adjust unusable cap before checkpoint=disable mode
From: Daeho Jeong <daeho43@gmail.com>
To: linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	kernel-team@android.com
Cc: Daeho Jeong <daehojeong@google.com>
Date: Mon, 18 Nov 2024 10:45:35 -0800

.
Subject: [PATCH v2 0/4] Timestamp and PulSAR support for ad4000
From: Marcelo Schmitt <marcelo.schmitt@analog.com>
To: <lars@metafoo.de>, <Michael.Hennerich@analog.com>,
        <marcelo.schmitt@analog.com>, <jic23@kernel.org>, <robh@kernel.org>,
        <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
        <marcelo.schmitt1@gmail.com>
Date: Mon, 18 Nov 2024 15:52:11 -0300

.
Subject: [PATCH next 0/7] minmax.h: Cleanups and minor optimisations
From: David Laight <David.Laight@ACULAB.COM>
To: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 18 Nov 2024 19:09:06 +0000

.
Subject: [GIT PULL] KUnit update for Linux 6.13-rc1
From: Shuah Khan <skhan@linuxfoundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: shuah <shuah@kernel.org>, Shuah Khan <skhan@linuxfoundation.org>,
 linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
 Brendan Higgins <brendan.higgins@linux.dev>, David Gow <davidgow@google.com>
Date: Mon, 18 Nov 2024 12:19:50 -0700

This is a multi-part message in MIME format.
--------------5MyL7j8NBMXiDrebLsUfm4or
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Linus,

Please pull the following kunit update for Linux 6.13-rc1.

kunit update for Linux 6.13-rc1

-- fixes user-after-free (UAF) bug in kunit_init_suite()

-- adds option to kunit tool to print just the summary of test results

-- adds option to kunit tool to print just the failed test results

-- fixes kunit_zalloc_skb() to use user passed in gfp value instead of
    hardcoding GFP_KERNEL

-- fixes kunit_zalloc_skb() kernel doc to include allocation flags variable

diff is attached.

Tests passed on my kunit repo:

- Build make allmodconfig

./tools/testing/kunit/kunit.py run
./tools/testing/kunit/kunit.py run --alltests

./tools/testing/kunit/kunit.py run --arch x86_64
./tools/testing/kunit/kunit.py run --alltests --arch x86_64

thanks,
-- Shuah

----------------------------------------------------------------
The following changes since commit 2d5404caa8c7bb5c4e0435f94b28834ae5456623:

   Linux 6.12-rc7 (2024-11-10 14:19:35 -0800)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-kunit-6.13-rc1

for you to fetch changes up to 67b6d342fb6d5abfbeb71e0f23141b9b96cf7bb1:

   kunit: tool: print failed tests only (2024-11-14 09:38:19 -0700)

----------------------------------------------------------------
linux_kselftest-kunit-6.13-rc1

kunit update for Linux 6.13-rc1

-- fixes user-after-free (UAF) bug in kunit_init_suite()

-- adds option to kunit tool to print just the summary of test results

-- adds option to kunit tool to print just the failed test results

-- fixes kunit_zalloc_skb() to use user passed in gfp value instead of
    hardcoding GFP_KERNEL

-- fixes kunit_zalloc_skb() kernel doc to include allocation flags variable

----------------------------------------------------------------
Dan Carpenter (2):
       kunit: skb: use "gfp" variable instead of hardcoding GFP_KERNEL
       kunit: skb: add gfp to kernel doc for kunit_zalloc_skb()

David Gow (1):
       kunit: tool: Only print the summary

Jinjie Ruan (1):
       kunit: string-stream: Fix a UAF bug in kunit_init_suite()

Rae Moar (1):
       kunit: tool: print failed tests only

  include/kunit/skbuff.h                 |   5 +-
  lib/kunit/string-stream.c              |   1 +
  tools/testing/kunit/kunit.py           |  28 ++++++-
  tools/testing/kunit/kunit_parser.py    | 134 +++++++++++++++++++++------------
  tools/testing/kunit/kunit_printer.py   |  14 +++-
  tools/testing/kunit/kunit_tool_test.py |  55 +++++++-------
  6 files changed, 151 insertions(+), 86 deletions(-)

----------------------------------------------------------------
--------------5MyL7j8NBMXiDrebLsUfm4or
Content-Type: text/x-patch; charset=UTF-8;
 name="linux_kselftest-kunit-6.13-rc1.diff"
Content-Disposition: attachment;
 filename="linux_kselftest-kunit-6.13-rc1.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2luY2x1ZGUva3VuaXQvc2tidWZmLmggYi9pbmNsdWRlL2t1bml0L3Nr
YnVmZi5oCmluZGV4IDQ0ZDEyMzcwOTM5YS4uMDc3ODQ2OTQzNTdjIDEwMDY0NAotLS0gYS9p
bmNsdWRlL2t1bml0L3NrYnVmZi5oCisrKyBiL2luY2x1ZGUva3VuaXQvc2tidWZmLmgKQEAg
LTIwLDggKzIwLDkgQEAgc3RhdGljIHZvaWQga3VuaXRfYWN0aW9uX2tmcmVlX3NrYih2b2lk
ICpwKQogICoga3VuaXRfemFsbG9jX3NrYigpIC0gQWxsb2NhdGUgYW5kIGluaXRpYWxpemUg
YSByZXNvdXJjZSBtYW5hZ2VkIHNrYi4KICAqIEB0ZXN0OiBUaGUgdGVzdCBjYXNlIHRvIHdo
aWNoIHRoZSBza2IgYmVsb25ncwogICogQGxlbjogc2l6ZSB0byBhbGxvY2F0ZQorICogQGdm
cDogYWxsb2NhdGlvbiBmbGFncwogICoKLSAqIEFsbG9jYXRlIGEgbmV3IHN0cnVjdCBza19i
dWZmIHdpdGggR0ZQX0tFUk5FTCwgemVybyBmaWxsIHRoZSBnaXZlIGxlbmd0aAorICogQWxs
b2NhdGUgYSBuZXcgc3RydWN0IHNrX2J1ZmYgd2l0aCBnZnAgZmxhZ3MsIHplcm8gZmlsbCB0
aGUgZ2l2ZW4gbGVuZ3RoCiAgKiBhbmQgYWRkIGl0IGFzIGEgcmVzb3VyY2UgdG8gdGhlIGt1
bml0IHRlc3QgZm9yIGF1dG9tYXRpYyBjbGVhbnVwLgogICoKICAqIFJldHVybnM6IG5ld2x5
IGFsbG9jYXRlZCBTS0IsIG9yICVOVUxMIG9uIGV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/debugobjects for v6.13-rc1
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Date: Mon, 18 Nov 2024 20:21:47 +0100 (CET)

Linus,

please pull the latest core/debugobjects branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-debugobject=
s-2024-11-18

up to:  ff8d523cc452: debugobjects: Track object usage to avoid premature fre=
eing of objects

A set of changes for debugobjects:

  - Prevent destroying the kmem_cache on early failure.

    Destroying a kmem_cache requires work queues to be set up, but in the
    early failure case they are not yet initializated. So rather leak the
    cache instead of triggering a BUG.

  - Reduce parallel pool fill attempts.

    Refilling the object pool requires to take the global pool lock, which
    causes a massive performance issue when a large number of CPUs attempt
    to refill concurrently. It turns out that it's sufficient to let one
    CPU handle the refill from the to free list and in case there are not
    enough objects on it to allocate new objects from the kmem cache.

    This also splits the free list handling from the actual allocation path
    as that yields better results on RT where allocation is restricted to
    preemptible code paths. The refill from free list has no such
    restrictions.

  - Consolidate the global and the per CPU pools to use the same data
    structure, so all helper functions can be shared.

  - Simplify the object allocation/free logic.

    The allocation/free logic is an incomprehensible maze, which tries to
    utilize the to free list and the global pool in the best way. This all
    can be simplified into a straight forward comprehensible code flow.

  - Convert the allocation/free mechanism to batch mode.

    Transferring objects from the global pool to the per CPU pools or vice
    versa is done by walking the hlist and moving object by object. That
    not only increases the pool lock held time, it also dirties up to 17
    cache lines.

    This can be avoided by storing the pointer to the first object in a
    batch of 16 objects in the objects themself and propagate it through
    the batch when an object is enqueued into a pool or to a temporary
    hlist head on allocation.

    This allows to move batches of objects with at max four cache lines
    dirtied and reduces the pool lock held time and therefore contention
    significantly.

  - Improve the object reusage

    The current implementation is too agressively freeing unused objects,
    which is counterproductive on bursty workloads like a kernel compile.

    Address this by:

    	* increasing the per CPU pool size

	* refilling the per CPU pool from the to be freed pool when the per
          CPU pool emptied a batch

	* keeping track of object usage with a exponentially wheighted
          moving average which prevents the work queue callback to free
          objects prematuraly.

    This combined reduces the allocation/free rate for a full kernel
    compile significantly:

                kmem_cache_alloc()  kmem_cache_free()
    Baseline:   380k                330k
    Improved:   170k                117k

  - A few cleanups and a more cache line friendly layout of debug
    information on top.

Thanks,

	tglx

------------------>
Thomas Gleixner (22):
      debugobjects: Dont destroy kmem cache in init()
      debugobjects: Remove pointless hlist initialization
      debugobjects: Dont free objects directly on CPU hotplug
      debugobjects: Reuse put_objects() on OOM
      debugobjects: Remove pointless debug printk
      debugobjects: Provide and use free_object_list()
      debugobjects: Make debug_objects_enabled bool
      debugobjects: Move pools into a datastructure
      debugobjects: Use separate list head for boot pool
      debugobjects: Rename and tidy up per CPU pools
      debugobjects: Move min/max count into pool struct
      debugobjects: Rework object allocation
      debugobjects: Rework object freeing
      debugobjects: Rework free_object_work()
      debugobjects: Use static key for boot pool selection
      debugobjects: Prepare for batching
      debugobjects: Prepare kmem_cache allocations for batching
      debugobjects: Implement batch processing
      debugobjects: Move pool statistics into global_pool struct
      debugobjects: Double the per CPU slots
      debugobjects: Refill per CPU pool more agressively
      debugobjects: Track object usage to avoid premature freeing of objects

Zhen Lei (3):
      debugobjects: Delete a piece of redundant code
      debugobjects: Collect newly allocated objects in a list to reduce lock =
contention
      debugobjects: Reduce parallel pool fill attempts


 include/linux/debugobjects.h |  12 +-
 lib/debugobjects.c           | 849 ++++++++++++++++++++++++-----------------=
--
 2 files changed, 486 insertions(+), 375 deletions(-)

diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
index 32444686b6ff..8b95545e7924 100644
--- a/include/linux/debugobjects.h
+++ b/include/linux/debugobjects.h
@@ -23,13 +23,17 @@ struct debug_obj_descr;
  * @state:	tracked object state
  * @astate:	current active state
  * @object:	pointer to the real object
+ * @batch_last:	pointer to the last hlist node in a batch
  * @descr:	pointer to an object type specific debug description structure
  */
 struct debug_obj {
-	struct hlist_node	node;
-	enum debug_obj_state	state;
-	unsigned int		astate;
-	void			*object;
+	struct hlist_node		node;
+	enum debug_obj_state		state;
+	unsigned int			astate;
+	union {
+		void			*object;
+		struct hlist_node	*batch_last;
+	};
 	const struct debug_obj_descr *descr;
 };
=20
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 5ce473ad499b..7f50c4480a4e 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -7,25 +7,30 @@
=20
 #define pr_fmt(fmt) "ODEBUG: " fmt
=20
+#include <linux/cpu.h>
 #include <linux/debugobjects.h>
-#include <linux/interrupt.h>
+#include <linux/debugfs.h>
+#include <linux/hash.h>
+#include <linux/kmemleak.h>
 #include <linux/sched.h>
+#include <linux/sched/loadavg.h>
 #include <linux/sched/task_stack.h>
 #include <linux/seq_file.h>
-#include <linux/debugfs.h>
 #include <linux/slab.h>
-#include <linux/hash.h>
-#include <linux/kmemleak.h>
-#include <linux/cpu.h>
+#include <linux/static_key.h>
=20
 #define ODEBUG_HASH_BITS	14
 #define ODEBUG_HASH_SIZE	(1 << ODEBUG_HASH_BITS)
=20
-#define ODEBUG_POOL_SIZE	1024
-#define ODEBUG_POOL_MIN_LEVEL	256
-#define ODEBUG_POOL_PERCPU_SIZE	64
+/* Must be power of two */
 #define ODEBUG_BATCH_SIZE	16
=20
+/* Initial values. Must all be a multiple of batch size */
+#define ODEBUG_POOL_SIZE	(64 * ODEBUG_BATCH_SIZE)
+#define ODEBUG_POOL_MIN_LEVEL	(ODEBUG_POOL_SIZE / 4)
+
+#define ODEBUG_POOL_PERCPU_SIZE	(8 * ODEBUG_BATCH_SIZE)
+
 #define ODEBUG_CHUNK_SHIFT	PAGE_SHIFT
 #define ODEBUG_CHUNK_SIZE	(1 << ODEBUG_CHUNK_SHIFT)
 #define ODEBUG_CHUNK_MASK	(~(ODEBUG_CHUNK_SIZE - 1))
@@ -35,7 +40,7 @@
  * frequency of 10Hz and about 1024 objects for each freeing operation.
  * So it is freeing at most 10k debug objects per second.
  */
-#define ODEBUG_FREE_WORK_MAX	1024
+#define ODEBUG_FREE_WORK_MAX	(1024 / ODEBUG_BATCH_SIZE)
 #define ODEBUG_FREE_WORK_DELAY	DIV_ROUND_UP(HZ, 10)
=20
 struct debug_bucket {
@@ -43,16 +48,24 @@ struct debug_bucket {
 	raw_spinlock_t		lock;
 };
=20
-/*
- * Debug object percpu free list
- * Access is protected by disabling irq
- */
-struct debug_percpu_free {
-	struct hlist_head	free_objs;
-	int			obj_free;
+struct pool_stats {
+	unsigned int		cur_used;
+	unsigned int		max_used;
+	unsigned int		min_fill;
 };
=20
-static DEFINE_PER_CPU(struct debug_percpu_free, percpu_obj_pool);
+struct obj_pool {
+	struct hlist_head	objects;
+	unsigned int		cnt;
+	unsigned int		min_cnt;
+	unsigned int		max_cnt;
+	struct pool_stats	stats;
+} ____cacheline_aligned;
+
+
+static DEFINE_PER_CPU_ALIGNED(struct obj_pool, pool_pcpu)  =3D {
+	.max_cnt	=3D ODEBUG_POOL_PERCPU_SIZE,
+};
=20
 static struct debug_bucket	obj_hash[ODEBUG_HASH_SIZE];
=20
@@ -60,37 +73,32 @@ static struct debug_obj		obj_static_pool[ODEBUG_POOL_SIZE=
] __initdata;
=20
 static DEFINE_RAW_SPINLOCK(pool_lock);
=20
-static HLIST_HEAD(obj_pool);
-static HLIST_HEAD(obj_to_free);
+static struct obj_pool pool_global =3D {
+	.min_cnt		=3D ODEBUG_POOL_MIN_LEVEL,
+	.max_cnt		=3D ODEBUG_POOL_SIZE,
+	.stats			=3D {
+		.min_fill	=3D ODEBUG_POOL_SIZE,
+	},
+};
=20
-/*
- * Because of the presence of percpu free pools, obj_pool_free will
- * under-count those in the percpu free pools. Similarly, obj_pool_used
- * will over-count those in the percpu free pools. Adjustments will be
- * made at debug_stats_show(). Both obj_pool_min_free and obj_pool_max_used
- * can be off.
- */
-static int __data_racy		obj_pool_min_free =3D ODEBUG_POOL_SIZE;
-static int __data_racy		obj_pool_free =3D ODEBUG_POOL_SIZE;
-static int			obj_pool_used;
-static int __data_racy		obj_pool_max_used;
+static struct obj_pool pool_to_free =3D {
+	.max_cnt	=3D UINT_MAX,
+};
+
+static HLIST_HEAD(pool_boot);
+
+static unsigned long		avg_usage;
 static bool			obj_freeing;
-/* The number of objs on the global free list */
-static int			obj_nr_tofree;
=20
 static int __data_racy			debug_objects_maxchain __read_mostly;
 static int __data_racy __maybe_unused	debug_objects_maxchecked __read_mostly;
 static int __data_racy			debug_objects_fixups __read_mostly;
 static int __data_racy			debug_objects_warnings __read_mostly;
-static int __data_racy			debug_objects_enabled __read_mostly
+static bool __data_racy			debug_objects_enabled __read_mostly
 					=3D CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT;
-static int				debug_objects_pool_size __ro_after_init
-					=3D ODEBUG_POOL_SIZE;
-static int				debug_objects_pool_min_level __ro_after_init
-					=3D ODEBUG_POOL_MIN_LEVEL;
=20
-static const struct debug_obj_descr *descr_test  __read_mostly;
-static struct kmem_cache	*obj_cache __ro_after_init;
+static const struct debug_obj_descr	*descr_test  __read_mostly;
+static struct kmem_cache		*obj_cache __ro_after_init;
=20
 /*
  * Track numbers of kmem_cache_alloc()/free() calls done.
@@ -101,19 +109,20 @@ static int __data_racy		debug_objects_freed;
 static void free_obj_work(struct work_struct *work);
 static DECLARE_DELAYED_WORK(debug_obj_work, free_obj_work);
=20
+static DEFINE_STATIC_KEY_FALSE(obj_cache_enabled);
+
 static int __init enable_object_debug(char *str)
 {
-	debug_objects_enabled =3D 1;
+	debug_objects_enabled =3D true;
 	return 0;
 }
+early_param("debug_objects", enable_object_debug);
=20
 static int __init disable_object_debug(char *str)
 {
-	debug_objects_enabled =3D 0;
+	debug_objects_enabled =3D false;
 	return 0;
 }
-
-early_param("debug_objects", enable_object_debug);
 early_param("no_debug_objects", disable_object_debug);
=20
 static const char *obj_states[ODEBUG_STATE_MAX] =3D {
@@ -125,61 +134,280 @@ static const char *obj_states[ODEBUG_STATE_MAX] =3D {
 	[ODEBUG_STATE_NOTAVAILABLE]	=3D "not available",
 };
=20
-static void fill_pool(void)
+static __always_inline unsigned int pool_count(struct obj_pool *pool)
+{
+	return READ_ONCE(pool->cnt);
+}
+
+static __always_inline bool pool_should_refill(struct obj_pool *pool)
+{
+	return pool_count(pool) < pool->min_cnt;
+}
+
+static __always_inline bool pool_must_refill(struct obj_pool *pool)
+{
+	return pool_count(pool) < pool->min_cnt / 2;
+}
+
+static bool pool_move_batch(struct obj_pool *dst, struct obj_pool *src)
 {
-	gfp_t gfp =3D __GFP_HIGH | __GFP_NOWARN;
+	struct hlist_node *last, *next_batch, *first_batch;
 	struct debug_obj *obj;
-	unsigned long flags;
=20
-	if (likely(READ_ONCE(obj_pool_free) >=3D debug_objects_pool_min_level))
+	if (dst->cnt >=3D dst->max_cnt || !src->cnt)
+		return false;
+
+	first_batch =3D src->objects.first;
+	obj =3D hlist_entry(first_batch, typeof(*obj), node);
+	last =3D obj->batch_last;
+	next_batch =3D last->next;
+
+	/* Move the next batch to the front of the source pool */
+	src->objects.first =3D next_batch;
+	if (next_batch)
+		next_batch->pprev =3D &src->objects.first;
+
+	/* Add the extracted batch to the destination pool */
+	last->next =3D dst->objects.first;
+	if (last->next)
+		last->next->pprev =3D &last->next;
+	first_batch->pprev =3D &dst->objects.first;
+	dst->objects.first =3D first_batch;
+
+	WRITE_ONCE(src->cnt, src->cnt - ODEBUG_BATCH_SIZE);
+	WRITE_ONCE(dst->cnt, dst->cnt + ODEBUG_BATCH_SIZE);
+	return true;
+}
+
+static bool pool_push_batch(struct obj_pool *dst, struct hlist_head *head)
+{
+	struct hlist_node *last;
+	struct debug_obj *obj;
+
+	if (dst->cnt >=3D dst->max_cnt)
+		return false;
+
+	obj =3D hlist_entry(head->first, typeof(*obj), node);
+	last =3D obj->batch_last;
+
+	hlist_splice_init(head, last, &dst->objects);
+	WRITE_ONCE(dst->cnt, dst->cnt + ODEBUG_BATCH_SIZE);
+	return true;
+}
+
+static bool pool_pop_batch(struct hlist_head *head, struct obj_pool *src)
+{
+	struct hlist_node *last, *next;
+	struct debug_obj *obj;
+
+	if (!src->cnt)
+		return false;
+
+	/* Move the complete list to the head */
+	hlist_move_list(&src->objects, head);
+
+	obj =3D hlist_entry(head->first, typeof(*obj), node);
+	last =3D obj->batch_last;
+	next =3D last->next;
+	/* Disconnect the batch from the list */
+	last->next =3D NULL;
+
+	/* Move the node after last back to the source pool. */
+	src->objects.first =3D next;
+	if (next)
+		next->pprev =3D &src->objects.first;
+
+	WRITE_ONCE(src->cnt, src->cnt - ODEBUG_BATCH_SIZE);
+	return true;
+}
+
+static struct debug_obj *__alloc_object(struct hlist_head *list)
+{
+	struct debug_obj *obj;
+
+	if (unlikely(!list->first))
+		return NULL;
+
+	obj =3D hlist_entry(list->first, typeof(*obj), node);
+	hlist_del(&obj->node);
+	return obj;
+}
+
+static void pcpu_refill_stats(void)
+{
+	struct pool_stats *stats =3D &pool_global.stats;
+
+	WRITE_ONCE(stats->cur_used, stats->cur_used + ODEBUG_BATCH_SIZE);
+
+	if (stats->cur_used > stats->max_used)
+		stats->max_used =3D stats->cur_used;
+
+	if (pool_global.cnt < stats->min_fill)
+		stats->min_fill =3D pool_global.cnt;
+}
+
+static struct debug_obj *pcpu_alloc(void)
+{
+	struct obj_pool *pcp =3D this_cpu_ptr(&pool_pcpu);
+
+	lockdep_assert_irqs_disabled();
+
+	for (;;) {
+		struct debug_obj *obj =3D __alloc_object(&pcp->objects);
+
+		if (likely(obj)) {
+			pcp->cnt--;
+			/*
+			 * If this emptied a batch try to refill from the
+			 * free pool. Don't do that if this was the top-most
+			 * batch as pcpu_free() expects the per CPU pool
+			 * to be less than ODEBUG_POOL_PERCPU_SIZE.
+			 */
+			if (unlikely(pcp->cnt < (ODEBUG_POOL_PERCPU_SIZE - ODEBUG_BATCH_SIZE) &&
+				     !(pcp->cnt % ODEBUG_BATCH_SIZE))) {
+				/*
+				 * Don't try to allocate from the regular pool here
+				 * to not exhaust it prematurely.
+				 */
+				if (pool_count(&pool_to_free)) {
+					guard(raw_spinlock)(&pool_lock);
+					pool_move_batch(pcp, &pool_to_free);
+					pcpu_refill_stats();
+				}
+			}
+			return obj;
+		}
+
+		guard(raw_spinlock)(&pool_lock);
+		if (!pool_move_batch(pcp, &pool_to_free)) {
+			if (!pool_move_batch(pcp, &pool_global))
+				return NULL;
+		}
+		pcpu_refill_stats();
+	}
+}
+
+static void pcpu_free(struct debug_obj *obj)
+{
+	struct obj_pool *pcp =3D this_cpu_ptr(&pool_pcpu);
+	struct debug_obj *first;
+
+	lockdep_assert_irqs_disabled();
+
+	if (!(pcp->cnt % ODEBUG_BATCH_SIZE)) {
+		obj->batch_last =3D &obj->node;
+	} else {
+		first =3D hlist_entry(pcp->objects.first, typeof(*first), node);
+		obj->batch_last =3D first->batch_last;
+	}
+	hlist_add_head(&obj->node, &pcp->objects);
+	pcp->cnt++;
+
+	/* Pool full ? */
+	if (pcp->cnt < ODEBUG_POOL_PERCPU_SIZE)
 		return;
=20
+	/* Remove a batch from the per CPU pool */
+	guard(raw_spinlock)(&pool_lock);
+	/* Try to fit the batch into the pool_global first */
+	if (!pool_move_batch(&pool_global, pcp))
+		pool_move_batch(&pool_to_free, pcp);
+	WRITE_ONCE(pool_global.stats.cur_used, pool_global.stats.cur_used - ODEBUG_=
BATCH_SIZE);
+}
+
+static void free_object_list(struct hlist_head *head)
+{
+	struct hlist_node *tmp;
+	struct debug_obj *obj;
+	int cnt =3D 0;
+
+	hlist_for_each_entry_safe(obj, tmp, head, node) {
+		hlist_del(&obj->node);
+		kmem_cache_free(obj_cache, obj);
+		cnt++;
+	}
+	debug_objects_freed +=3D cnt;
+}
+
+static void fill_pool_from_freelist(void)
+{
+	static unsigned long state;
+
 	/*
 	 * Reuse objs from the global obj_to_free list; they will be
 	 * reinitialized when allocating.
-	 *
-	 * obj_nr_tofree is checked locklessly; the READ_ONCE() pairs with
-	 * the WRITE_ONCE() in pool_lock critical sections.
 	 */
-	if (READ_ONCE(obj_nr_tofree)) {
-		raw_spin_lock_irqsave(&pool_lock, flags);
-		/*
-		 * Recheck with the lock held as the worker thread might have
-		 * won the race and freed the global free list already.
-		 */
-		while (obj_nr_tofree && (obj_pool_free < debug_objects_pool_min_level)) {
-			obj =3D hlist_entry(obj_to_free.first, typeof(*obj), node);
-			hlist_del(&obj->node);
-			WRITE_ONCE(obj_nr_tofree, obj_nr_tofree - 1);
-			hlist_add_head(&obj->node, &obj_pool);
-			WRITE_ONCE(obj_pool_free, obj_pool_free + 1);
+	if (!pool_count(&pool_to_free))
+		return;
+
+	/*
+	 * Prevent the context from being scheduled or interrupted after
+	 * setting the state flag;
+	 */
+	guard(irqsave)();
+
+	/*
+	 * Avoid lock contention on &pool_lock and avoid making the cache
+	 * line exclusive by testing the bit before attempting to set it.
+	 */
+	if (test_bit(0, &state) || test_and_set_bit(0, &state))
+		return;
+
+	/* Avoid taking the lock when there is no work to do */
+	while (pool_should_refill(&pool_global) && pool_count(&pool_to_free)) {
+		guard(raw_spinlock)(&pool_lock);
+		/* Move a batch if possible */
+		pool_move_batch(&pool_global, &pool_to_free);
+	}
+	clear_bit(0, &state);
+}
+
+static bool kmem_alloc_batch(struct hlist_head *head, struct kmem_cache *cac=
he, gfp_t gfp)
+{
+	struct hlist_node *last =3D NULL;
+	struct debug_obj *obj;
+
+	for (int cnt =3D 0; cnt < ODEBUG_BATCH_SIZE; cnt++) {
+		obj =3D kmem_cache_zalloc(cache, gfp);
+		if (!obj) {
+			free_object_list(head);
+			return false;
 		}
-		raw_spin_unlock_irqrestore(&pool_lock, flags);
+		debug_objects_allocated++;
+
+		if (!last)
+			last =3D &obj->node;
+		obj->batch_last =3D last;
+
+		hlist_add_head(&obj->node, head);
 	}
+	return true;
+}
+
+static void fill_pool(void)
+{
+	static atomic_t cpus_allocating;
=20
-	if (unlikely(!obj_cache))
+	/*
+	 * Avoid allocation and lock contention when:
+	 *   - One other CPU is already allocating
+	 *   - the global pool has not reached the critical level yet
+	 */
+	if (!pool_must_refill(&pool_global) && atomic_read(&cpus_allocating))
 		return;
=20
-	while (READ_ONCE(obj_pool_free) < debug_objects_pool_min_level) {
-		struct debug_obj *new[ODEBUG_BATCH_SIZE];
-		int cnt;
+	atomic_inc(&cpus_allocating);
+	while (pool_should_refill(&pool_global)) {
+		HLIST_HEAD(head);
=20
-		for (cnt =3D 0; cnt < ODEBUG_BATCH_SIZE; cnt++) {
-			new[cnt] =3D kmem_cache_zalloc(obj_cache, gfp);
-			if (!new[cnt])
-				break;
-		}
-		if (!cnt)
-			return;
+		if (!kmem_alloc_batch(&head, obj_cache, __GFP_HIGH | __GFP_NOWARN))
+			break;
=20
-		raw_spin_lock_irqsave(&pool_lock, flags);
-		while (cnt) {
-			hlist_add_head(&new[--cnt]->node, &obj_pool);
-			debug_objects_allocated++;
-			WRITE_ONCE(obj_pool_free, obj_pool_free + 1);
-		}
-		raw_spin_unlock_irqrestore(&pool_lock, flags);
+		guard(raw_spinlock_irqsave)(&pool_lock);
+		if (!pool_push_batch(&pool_global, &head))
+			pool_push_batch(&pool_to_free, &head);
 	}
+	atomic_dec(&cpus_allocating);
 }
=20
 /*
@@ -201,72 +429,37 @@ static struct debug_obj *lookup_object(void *addr, stru=
ct debug_bucket *b)
 	return NULL;
 }
=20
-/*
- * Allocate a new object from the hlist
- */
-static struct debug_obj *__alloc_object(struct hlist_head *list)
+static void calc_usage(void)
 {
-	struct debug_obj *obj =3D NULL;
+	static DEFINE_RAW_SPINLOCK(avg_lock);
+	static unsigned long avg_period;
+	unsigned long cur, now =3D jiffies;
=20
-	if (list->first) {
-		obj =3D hlist_entry(list->first, typeof(*obj), node);
-		hlist_del(&obj->node);
-	}
+	if (!time_after_eq(now, READ_ONCE(avg_period)))
+		return;
=20
-	return obj;
+	if (!raw_spin_trylock(&avg_lock))
+		return;
+
+	WRITE_ONCE(avg_period, now + msecs_to_jiffies(10));
+	cur =3D READ_ONCE(pool_global.stats.cur_used) * ODEBUG_FREE_WORK_MAX;
+	WRITE_ONCE(avg_usage, calc_load(avg_usage, EXP_5, cur));
+	raw_spin_unlock(&avg_lock);
 }
=20
-static struct debug_obj *
-alloc_object(void *addr, struct debug_bucket *b, const struct debug_obj_desc=
r *descr)
+static struct debug_obj *alloc_object(void *addr, struct debug_bucket *b,
+				      const struct debug_obj_descr *descr)
 {
-	struct debug_percpu_free *percpu_pool =3D this_cpu_ptr(&percpu_obj_pool);
 	struct debug_obj *obj;
=20
-	if (likely(obj_cache)) {
-		obj =3D __alloc_object(&percpu_pool->free_objs);
-		if (obj) {
-			percpu_pool->obj_free--;
-			goto init_obj;
-		}
-	}
-
-	raw_spin_lock(&pool_lock);
-	obj =3D __alloc_object(&obj_pool);
-	if (obj) {
-		obj_pool_used++;
-		WRITE_ONCE(obj_pool_free, obj_pool_free - 1);
-
-		/*
-		 * Looking ahead, allocate one batch of debug objects and
-		 * put them into the percpu free pool.
-		 */
-		if (likely(obj_cache)) {
-			int i;
-
-			for (i =3D 0; i < ODEBUG_BATCH_SIZE; i++) {
-				struct debug_obj *obj2;
-
-				obj2 =3D __alloc_object(&obj_pool);
-				if (!obj2)
-					break;
-				hlist_add_head(&obj2->node,
-					       &percpu_pool->free_objs);
-				percpu_pool->obj_free++;
-				obj_pool_used++;
-				WRITE_ONCE(obj_pool_free, obj_pool_free - 1);
-			}
-		}
-
-		if (obj_pool_used > obj_pool_max_used)
-			obj_pool_max_used =3D obj_pool_used;
+	calc_usage();
=20
-		if (obj_pool_free < obj_pool_min_free)
-			obj_pool_min_free =3D obj_pool_free;
-	}
-	raw_spin_unlock(&pool_lock);
+	if (static_branch_likely(&obj_cache_enabled))
+		obj =3D pcpu_alloc();
+	else
+		obj =3D __alloc_object(&pool_boot);
=20
-init_obj:
-	if (obj) {
+	if (likely(obj)) {
 		obj->object =3D addr;
 		obj->descr  =3D descr;
 		obj->state  =3D ODEBUG_STATE_NONE;
@@ -276,142 +469,58 @@ alloc_object(void *addr, struct debug_bucket *b, const=
 struct debug_obj_descr *d
 	return obj;
 }
=20
-/*
- * workqueue function to free objects.
- *
- * To reduce contention on the global pool_lock, the actual freeing of
- * debug objects will be delayed if the pool_lock is busy.
- */
+/* workqueue function to free objects. */
 static void free_obj_work(struct work_struct *work)
 {
-	struct hlist_node *tmp;
-	struct debug_obj *obj;
-	unsigned long flags;
-	HLIST_HEAD(tofree);
+	static unsigned long last_use_avg;
+	unsigned long cur_used, last_used, delta;
+	unsigned int max_free =3D 0;
=20
 	WRITE_ONCE(obj_freeing, false);
-	if (!raw_spin_trylock_irqsave(&pool_lock, flags))
-		return;
=20
-	if (obj_pool_free >=3D debug_objects_pool_size)
-		goto free_objs;
+	/* Rate limit freeing based on current use average */
+	cur_used =3D READ_ONCE(avg_usage);
+	last_used =3D last_use_avg;
+	last_use_avg =3D cur_used;
=20
-	/*
-	 * The objs on the pool list might be allocated before the work is
-	 * run, so recheck if pool list it full or not, if not fill pool
-	 * list from the global free list. As it is likely that a workload
-	 * may be gearing up to use more and more objects, don't free any
-	 * of them until the next round.
-	 */
-	while (obj_nr_tofree && obj_pool_free < debug_objects_pool_size) {
-		obj =3D hlist_entry(obj_to_free.first, typeof(*obj), node);
-		hlist_del(&obj->node);
-		hlist_add_head(&obj->node, &obj_pool);
-		WRITE_ONCE(obj_pool_free, obj_pool_free + 1);
-		WRITE_ONCE(obj_nr_tofree, obj_nr_tofree - 1);
-	}
-	raw_spin_unlock_irqrestore(&pool_lock, flags);
-	return;
+	if (!pool_count(&pool_to_free))
+		return;
=20
-free_objs:
-	/*
-	 * Pool list is already full and there are still objs on the free
-	 * list. Move remaining free objs to a temporary list to free the
-	 * memory outside the pool_lock held region.
-	 */
-	if (obj_nr_tofree) {
-		hlist_move_list(&obj_to_free, &tofree);
-		debug_objects_freed +=3D obj_nr_tofree;
-		WRITE_ONCE(obj_nr_tofree, 0);
+	if (cur_used <=3D last_used) {
+		delta =3D (last_used - cur_used) / ODEBUG_FREE_WORK_MAX;
+		max_free =3D min(delta, ODEBUG_FREE_WORK_MAX);
 	}
-	raw_spin_unlock_irqrestore(&pool_lock, flags);
=20
-	hlist_for_each_entry_safe(obj, tmp, &tofree, node) {
-		hlist_del(&obj->node);
-		kmem_cache_free(obj_cache, obj);
+	for (int cnt =3D 0; cnt < ODEBUG_FREE_WORK_MAX; cnt++) {
+		HLIST_HEAD(tofree);
+
+		/* Acquire and drop the lock for each batch */
+		scoped_guard(raw_spinlock_irqsave, &pool_lock) {
+			if (!pool_to_free.cnt)
+				return;
+
+			/* Refill the global pool if possible */
+			if (pool_move_batch(&pool_global, &pool_to_free)) {
+				/* Don't free as there seems to be demand */
+				max_free =3D 0;
+			} else if (max_free) {
+				pool_pop_batch(&tofree, &pool_to_free);
+				max_free--;
+			} else {
+				return;
+			}
+		}
+		free_object_list(&tofree);
 	}
 }
=20
 static void __free_object(struct debug_obj *obj)
 {
-	struct debug_obj *objs[ODEBUG_BATCH_SIZE];
-	struct debug_percpu_free *percpu_pool;
-	int lookahead_count =3D 0;
-	unsigned long flags;
-	bool work;
-
-	local_irq_save(flags);
-	if (!obj_cache)
-		goto free_to_obj_pool;
-
-	/*
-	 * Try to free it into the percpu pool first.
-	 */
-	percpu_pool =3D this_cpu_ptr(&percpu_obj_pool);
-	if (percpu_pool->obj_free < ODEBUG_POOL_PERCPU_SIZE) {
-		hlist_add_head(&obj->node, &percpu_pool->free_objs);
-		percpu_pool->obj_free++;
-		local_irq_restore(flags);
-		return;
-	}
-
-	/*
-	 * As the percpu pool is full, look ahead and pull out a batch
-	 * of objects from the percpu pool and free them as well.
-	 */
-	for (; lookahead_count < ODEBUG_BATCH_SIZE; lookahead_count++) {
-		objs[lookahead_count] =3D __alloc_object(&percpu_pool->free_objs);
-		if (!objs[lookahead_count])
-			break;
-		percpu_pool->obj_free--;
-	}
-
-free_to_obj_pool:
-	raw_spin_lock(&pool_lock);
-	work =3D (obj_pool_free > debug_objects_pool_size) && obj_cache &&
-	       (obj_nr_tofree < ODEBUG_FREE_WORK_MAX);
-	obj_pool_used--;
-
-	if (work) {
-		WRITE_ONCE(obj_nr_tofree, obj_nr_tofree + 1);
-		hlist_add_head(&obj->node, &obj_to_free);
-		if (lookahead_count) {
-			WRITE_ONCE(obj_nr_tofree, obj_nr_tofree + lookahead_count);
-			obj_pool_used -=3D lookahead_count;
-			while (lookahead_count) {
-				hlist_add_head(&objs[--lookahead_count]->node,
-					       &obj_to_free);
-			}
-		}
-
-		if ((obj_pool_free > debug_objects_pool_size) &&
-		    (obj_nr_tofree < ODEBUG_FREE_WORK_MAX)) {
-			int i;
-
-			/*
-			 * Free one more batch of objects from obj_pool.
-			 */
-			for (i =3D 0; i < ODEBUG_BATCH_SIZE; i++) {
-				obj =3D __alloc_object(&obj_pool);
-				hlist_add_head(&obj->node, &obj_to_free);
-				WRITE_ONCE(obj_pool_free, obj_pool_free - 1);
-				WRITE_ONCE(obj_nr_tofree, obj_nr_tofree + 1);
-			}
-		}
-	} else {
-		WRITE_ONCE(obj_pool_free, obj_pool_free + 1);
-		hlist_add_head(&obj->node, &obj_pool);
-		if (lookahead_count) {
-			WRITE_ONCE(obj_pool_free, obj_pool_free + lookahead_count);
-			obj_pool_used -=3D lookahead_count;
-			while (lookahead_count) {
-				hlist_add_head(&objs[--lookahead_count]->node,
-					       &obj_pool);
-			}
-		}
-	}
-	raw_spin_unlock(&pool_lock);
-	local_irq_restore(flags);
+	guard(irqsave)();
+	if (static_branch_likely(&obj_cache_enabled))
+		pcpu_free(obj);
+	else
+		hlist_add_head(&obj->node, &pool_boot);
 }
=20
 /*
@@ -421,63 +530,52 @@ static void __free_object(struct debug_obj *obj)
 static void free_object(struct debug_obj *obj)
 {
 	__free_object(obj);
-	if (!READ_ONCE(obj_freeing) && READ_ONCE(obj_nr_tofree)) {
+	if (!READ_ONCE(obj_freeing) && pool_count(&pool_to_free)) {
 		WRITE_ONCE(obj_freeing, true);
 		schedule_delayed_work(&debug_obj_work, ODEBUG_FREE_WORK_DELAY);
 	}
 }
=20
-#ifdef CONFIG_HOTPLUG_CPU
-static int object_cpu_offline(unsigned int cpu)
+static void put_objects(struct hlist_head *list)
 {
-	struct debug_percpu_free *percpu_pool;
 	struct hlist_node *tmp;
 	struct debug_obj *obj;
-	unsigned long flags;
=20
-	/* Remote access is safe as the CPU is dead already */
-	percpu_pool =3D per_cpu_ptr(&percpu_obj_pool, cpu);
-	hlist_for_each_entry_safe(obj, tmp, &percpu_pool->free_objs, node) {
+	/*
+	 * Using free_object() puts the objects into reuse or schedules
+	 * them for freeing and it get's all the accounting correct.
+	 */
+	hlist_for_each_entry_safe(obj, tmp, list, node) {
 		hlist_del(&obj->node);
-		kmem_cache_free(obj_cache, obj);
+		free_object(obj);
 	}
+}
=20
-	raw_spin_lock_irqsave(&pool_lock, flags);
-	obj_pool_used -=3D percpu_pool->obj_free;
-	debug_objects_freed +=3D percpu_pool->obj_free;
-	raw_spin_unlock_irqrestore(&pool_lock, flags);
-
-	percpu_pool->obj_free =3D 0;
+#ifdef CONFIG_HOTPLUG_CPU
+static int object_cpu_offline(unsigned int cpu)
+{
+	/* Remote access is safe as the CPU is dead already */
+	struct obj_pool *pcp =3D per_cpu_ptr(&pool_pcpu, cpu);
=20
+	put_objects(&pcp->objects);
+	pcp->cnt =3D 0;
 	return 0;
 }
 #endif
=20
-/*
- * We run out of memory. That means we probably have tons of objects
- * allocated.
- */
+/* Out of memory. Free all objects from hash */
 static void debug_objects_oom(void)
 {
 	struct debug_bucket *db =3D obj_hash;
-	struct hlist_node *tmp;
 	HLIST_HEAD(freelist);
-	struct debug_obj *obj;
-	unsigned long flags;
-	int i;
=20
 	pr_warn("Out of memory. ODEBUG disabled\n");
=20
-	for (i =3D 0; i < ODEBUG_HASH_SIZE; i++, db++) {
-		raw_spin_lock_irqsave(&db->lock, flags);
-		hlist_move_list(&db->list, &freelist);
-		raw_spin_unlock_irqrestore(&db->lock, flags);
+	for (int i =3D 0; i < ODEBUG_HASH_SIZE; i++, db++) {
+		scoped_guard(raw_spinlock_irqsave, &db->lock)
+			hlist_move_list(&db->list, &freelist);
=20
-		/* Now free them */
-		hlist_for_each_entry_safe(obj, tmp, &freelist, node) {
-			hlist_del(&obj->node);
-			free_object(obj);
-		}
+		put_objects(&freelist);
 	}
 }
=20
@@ -592,12 +690,24 @@ static struct debug_obj *lookup_object_or_alloc(void *a=
ddr, struct debug_bucket
 	}
=20
 	/* Out of memory. Do the cleanup outside of the locked region */
-	debug_objects_enabled =3D 0;
+	debug_objects_enabled =3D false;
 	return NULL;
 }
=20
 static void debug_objects_fill_pool(void)
 {
+	if (!static_branch_likely(&obj_cache_enabled))
+		return;
+
+	if (likely(!pool_should_refill(&pool_global)))
+		return;
+
+	/* Try reusing objects from obj_to_free_list */
+	fill_pool_from_freelist();
+
+	if (likely(!pool_should_refill(&pool_global)))
+		return;
+
 	/*
 	 * On RT enabled kernels the pool refill must happen in preemptible
 	 * context -- for !RT kernels we rely on the fact that spinlock_t and
@@ -1007,7 +1117,7 @@ static void __debug_check_no_obj_freed(const void *addr=
ess, unsigned long size)
 		debug_objects_maxchecked =3D objs_checked;
=20
 	/* Schedule work to actually kmem_cache_free() objects */
-	if (!READ_ONCE(obj_freeing) && READ_ONCE(obj_nr_tofree)) {
+	if (!READ_ONCE(obj_freeing) && pool_count(&pool_to_free)) {
 		WRITE_ONCE(obj_freeing, true);
 		schedule_delayed_work(&debug_obj_work, ODEBUG_FREE_WORK_DELAY);
 	}
@@ -1024,23 +1134,33 @@ void debug_check_no_obj_freed(const void *address, un=
signed long size)
=20
 static int debug_stats_show(struct seq_file *m, void *v)
 {
-	int cpu, obj_percpu_free =3D 0;
+	unsigned int cpu, pool_used, pcp_free =3D 0;
=20
+	/*
+	 * pool_global.stats.cur_used is the number of batches currently
+	 * handed out to per CPU pools. Convert it to number of objects
+	 * and subtract the number of free objects in the per CPU pools.
+	 * As this is lockless the number is an estimate.
+	 */
 	for_each_possible_cpu(cpu)
-		obj_percpu_free +=3D per_cpu(percpu_obj_pool.obj_free, cpu);
-
-	seq_printf(m, "max_chain     :%d\n", debug_objects_maxchain);
-	seq_printf(m, "max_checked   :%d\n", debug_objects_maxchecked);
-	seq_printf(m, "warnings      :%d\n", debug_objects_warnings);
-	seq_printf(m, "fixups        :%d\n", debug_objects_fixups);
-	seq_printf(m, "pool_free     :%d\n", READ_ONCE(obj_pool_free) + obj_percpu_=
free);
-	seq_printf(m, "pool_pcp_free :%d\n", obj_percpu_free);
-	seq_printf(m, "pool_min_free :%d\n", obj_pool_min_free);
-	seq_printf(m, "pool_used     :%d\n", obj_pool_used - obj_percpu_free);
-	seq_printf(m, "pool_max_used :%d\n", obj_pool_max_used);
-	seq_printf(m, "on_free_list  :%d\n", READ_ONCE(obj_nr_tofree));
-	seq_printf(m, "objs_allocated:%d\n", debug_objects_allocated);
-	seq_printf(m, "objs_freed    :%d\n", debug_objects_freed);
+		pcp_free +=3D per_cpu(pool_pcpu.cnt, cpu);
+
+	pool_used =3D READ_ONCE(pool_global.stats.cur_used);
+	pcp_free =3D min(pool_used, pcp_free);
+	pool_used -=3D pcp_free;
+
+	seq_printf(m, "max_chain     : %d\n", debug_objects_maxchain);
+	seq_printf(m, "max_checked   : %d\n", debug_objects_maxchecked);
+	seq_printf(m, "warnings      : %d\n", debug_objects_warnings);
+	seq_printf(m, "fixups        : %d\n", debug_objects_fixups);
+	seq_printf(m, "pool_free     : %u\n", pool_count(&pool_global) + pcp_free);
+	seq_printf(m, "pool_pcp_free : %u\n", pcp_free);
+	seq_printf(m, "pool_min_free : %u\n", data_race(pool_global.stats.min_fill)=
);
+	seq_printf(m, "pool_used     : %u\n", pool_used);
+	seq_printf(m, "pool_max_used : %u\n", data_race(pool_global.stats.max_used)=
);
+	seq_printf(m, "on_free_list  : %u\n", pool_count(&pool_to_free));
+	seq_printf(m, "objs_allocated: %d\n", debug_objects_allocated);
+	seq_printf(m, "objs_freed    : %d\n", debug_objects_freed);
 	return 0;
 }
 DEFINE_SHOW_ATTRIBUTE(debug_stats);
@@ -1194,7 +1314,7 @@ check_results(void *addr, enum debug_obj_state state, i=
nt fixups, int warnings)
 out:
 	raw_spin_unlock_irqrestore(&db->lock, flags);
 	if (res)
-		debug_objects_enabled =3D 0;
+		debug_objects_enabled =3D false;
 	return res;
 }
=20
@@ -1209,7 +1329,7 @@ static __initconst const struct debug_obj_descr descr_t=
ype_test =3D {
=20
 static __initdata struct self_test obj =3D { .static_init =3D 0 };
=20
-static void __init debug_objects_selftest(void)
+static bool __init debug_objects_selftest(void)
 {
 	int fixups, oldfixups, warnings, oldwarnings;
 	unsigned long flags;
@@ -1278,9 +1398,10 @@ static void __init debug_objects_selftest(void)
 	descr_test =3D NULL;
=20
 	local_irq_restore(flags);
+	return debug_objects_enabled;
 }
 #else
-static inline void debug_objects_selftest(void) { }
+static inline bool debug_objects_selftest(void) { return true; }
 #endif
=20
 /*
@@ -1295,65 +1416,54 @@ void __init debug_objects_early_init(void)
 	for (i =3D 0; i < ODEBUG_HASH_SIZE; i++)
 		raw_spin_lock_init(&obj_hash[i].lock);
=20
+	/* Keep early boot simple and add everything to the boot list */
 	for (i =3D 0; i < ODEBUG_POOL_SIZE; i++)
-		hlist_add_head(&obj_static_pool[i].node, &obj_pool);
+		hlist_add_head(&obj_static_pool[i].node, &pool_boot);
 }
=20
 /*
- * Convert the statically allocated objects to dynamic ones:
+ * Convert the statically allocated objects to dynamic ones.
+ * debug_objects_mem_init() is called early so only one CPU is up and
+ * interrupts are disabled, which means it is safe to replace the active
+ * object references.
  */
-static int __init debug_objects_replace_static_objects(void)
+static bool __init debug_objects_replace_static_objects(struct kmem_cache *c=
ache)
 {
 	struct debug_bucket *db =3D obj_hash;
 	struct hlist_node *tmp;
-	struct debug_obj *obj, *new;
+	struct debug_obj *obj;
 	HLIST_HEAD(objects);
-	int i, cnt =3D 0;
+	int i;
=20
-	for (i =3D 0; i < ODEBUG_POOL_SIZE; i++) {
-		obj =3D kmem_cache_zalloc(obj_cache, GFP_KERNEL);
-		if (!obj)
+	for (i =3D 0; i < ODEBUG_POOL_SIZE; i +=3D ODEBUG_BATCH_SIZE) {
+		if (!kmem_alloc_batch(&objects, cache, GFP_KERNEL))
 			goto free;
-		hlist_add_head(&obj->node, &objects);
+		pool_push_batch(&pool_global, &objects);
 	}
=20
-	debug_objects_allocated +=3D i;
-
-	/*
-	 * debug_objects_mem_init() is now called early that only one CPU is up
-	 * and interrupts have been disabled, so it is safe to replace the
-	 * active object references.
-	 */
-
-	/* Remove the statically allocated objects from the pool */
-	hlist_for_each_entry_safe(obj, tmp, &obj_pool, node)
-		hlist_del(&obj->node);
-	/* Move the allocated objects to the pool */
-	hlist_move_list(&objects, &obj_pool);
+	/* Disconnect the boot pool. */
+	pool_boot.first =3D NULL;
=20
 	/* Replace the active object references */
 	for (i =3D 0; i < ODEBUG_HASH_SIZE; i++, db++) {
 		hlist_move_list(&db->list, &objects);
=20
 		hlist_for_each_entry(obj, &objects, node) {
-			new =3D hlist_entry(obj_pool.first, typeof(*obj), node);
-			hlist_del(&new->node);
+			struct debug_obj *new =3D pcpu_alloc();
+
 			/* copy object data */
 			*new =3D *obj;
 			hlist_add_head(&new->node, &db->list);
-			cnt++;
 		}
 	}
-
-	pr_debug("%d of %d active objects replaced\n",
-		 cnt, obj_pool_used);
-	return 0;
+	return true;
 free:
-	hlist_for_each_entry_safe(obj, tmp, &objects, node) {
+	/* Can't use free_object_list() as the cache is not populated yet */
+	hlist_for_each_entry_safe(obj, tmp, &pool_global.objects, node) {
 		hlist_del(&obj->node);
-		kmem_cache_free(obj_cache, obj);
+		kmem_cache_free(cache, obj);
 	}
-	return -ENOMEM;
+	return false;
 }
=20
 /*
@@ -1364,43 +1474,40 @@ static int __init debug_objects_replace_static_object=
s(void)
  */
 void __init debug_objects_mem_init(void)
 {
-	int cpu, extras;
+	struct kmem_cache *cache;
+	int extras;
=20
 	if (!debug_objects_enabled)
 		return;
=20
-	/*
-	 * Initialize the percpu object pools
-	 *
-	 * Initialization is not strictly necessary, but was done for
-	 * completeness.
-	 */
-	for_each_possible_cpu(cpu)
-		INIT_HLIST_HEAD(&per_cpu(percpu_obj_pool.free_objs, cpu));
+	if (!debug_objects_selftest())
+		return;
=20
-	obj_cache =3D kmem_cache_create("debug_objects_cache",
-				      sizeof (struct debug_obj), 0,
-				      SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE,
-				      NULL);
+	cache =3D kmem_cache_create("debug_objects_cache", sizeof (struct debug_obj=
), 0,
+				  SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE, NULL);
=20
-	if (!obj_cache || debug_objects_replace_static_objects()) {
-		debug_objects_enabled =3D 0;
-		kmem_cache_destroy(obj_cache);
-		pr_warn("out of memory.\n");
+	if (!cache || !debug_objects_replace_static_objects(cache)) {
+		debug_objects_enabled =3D false;
+		pr_warn("Out of memory.\n");
 		return;
-	} else
-		debug_objects_selftest();
-
-#ifdef CONFIG_HOTPLUG_CPU
-	cpuhp_setup_state_nocalls(CPUHP_DEBUG_OBJ_DEAD, "object:offline", NULL,
-					object_cpu_offline);
-#endif
+	}
=20
 	/*
-	 * Increase the thresholds for allocating and freeing objects
-	 * according to the number of possible CPUs available in the system.
+	 * Adjust the thresholds for allocating and freeing objects
+	 * according to the number of possible CPUs available in the
+	 * system.
 	 */
 	extras =3D num_possible_cpus() * ODEBUG_BATCH_SIZE;
-	debug_objects_pool_size +=3D extras;
-	debug_objects_pool_min_level +=3D extras;
+	pool_global.max_cnt +=3D extras;
+	pool_global.min_cnt +=3D extras;
+
+	/* Everything worked. Expose the cache */
+	obj_cache =3D cache;
+	static_branch_enable(&obj_cache_enabled);
+
+#ifdef CONFIG_HOTPLUG_CPU
+	cpuhp_setup_state_nocalls(CPUHP_DEBUG_OBJ_DEAD, "object:offline", NULL,
+				  object_cpu_offline);
+#endif
+	return;
 }


.
Subject: [GIT pull] irq/core for v6.13-rc1
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Date: Mon, 18 Nov 2024 20:21:52 +0100 (CET)

Linus,

please pull the latest irq/core branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-core-2024-11=
-18

up to:  1f181d1cda56: irqchip/riscv-aplic: Prevent crash when MSI domain is m=
issing

A set of updates for the interrupt subsystem:

  - Tree wide:

    * Make nr_irqs static to the core code and provide accessor functions
      to remove existing and prevent future aliasing problems with local
      variables or function arguments of the same name.

  - Core code:

    * Prevent freeing an interrupt in the devres code which is not managed
      by devres in the first place.

    * Use seq_put_decimal_ull_width() for decimal values output in
      /proc/interrupts which increases performance significantly as it
      avoids parsing the format strings over and over.

    * Optimize raising the timer and hrtimer soft interrupts by using the
      'set bit only' variants instead of the combined version which checks
      whether ksoftirqd should be woken up. The latter is a pointless
      exercise as both soft interrupts are raised in the context of the
      timer interrupt and therefore never wake up ksoftirqd.

    * Delegate timer/hrtimer soft interrupt processing to a dedicated thread
      on RT.

      Timer and hrtimer soft interrupts are always processed in ksoftirqd
      on RT enabled kernels. This can lead to high latencies when other
      soft interrupts are delegated to ksoftirqd as well.

      The separate thread allows to run them seperately under a RT
      scheduling policy to reduce the latency overhead.

  - Drivers:

    * New drivers or extensions of existing drivers to support Renesas
      RZ/V2H(P), Aspeed AST27XX, T-HEAD C900 and ATMEL sam9x7 interrupt
      chips

    * Support for multi-cluster GICs on MIPS.

      MIPS CPUs can come with multiple CPU clusters, where each CPU cluster
      has its own GIC (Generic Interrupt Controller). This requires to
      access the GIC of a remote cluster through a redirect register block.

      This is encapsulated into a set of helper functions to keep the
      complexity out of the actual code paths which handle the GIC details.

    * Support for encrypted guests in the ARM GICV3 ITS driver

      The ITS page needs to be shared with the hypervisor and therefore
      must be decrypted.

    * Small cleanups and fixes all over the place

Thanks,

	tglx

------------------>
Bart Van Assche (22):
      genirq: Introduce irq_get_nr_irqs() and irq_set_nr_irqs()
      ARM: Switch to irq_get_nr_irqs() / irq_set_nr_irqs()
      LoongArch: Switch to irq_set_nr_irqs()
      powerpc/cell: Switch to irq_get_nr_irqs()
      s390/irq: Switch to irq_get_nr_irqs()
      x86/acpi: Switch to irq_get_nr_irqs() and irq_set_nr_irqs()
      hpet: Switch to irq_get_nr_irqs()
      net: 3com: 3c59x: Switch to irq_get_nr_irqs()
      net: hamradio: baycom_ser_fdx: Switch to irq_get_nr_irqs()
      net: hamradio: scc: Switch to irq_get_nr_irqs()
      scsi: aha152x: Switch to irq_get_nr_irqs()
      serial: core: Switch to irq_get_nr_irqs()
      serial: 8250: Switch to irq_get_nr_irqs()
      serial: amba-pl010: Switch to irq_get_nr_irqs()
      serial: amba-pl011: Switch to irq_get_nr_irqs()
      serial: cpm_uart: Switch to irq_get_nr_irqs()
      serial: ucc_uart: Switch to irq_get_nr_irqs()
      sh: intc: Switch to irq_get_nr_irqs()
      xen/events: Switch to irq_get_nr_irqs()
      fs/procfs: Switch to irq_get_nr_irqs()
      genirq: Switch to irq_get_nr_irqs()
      genirq: Unexport nr_irqs

Chao-ying Fu (1):
      irqchip/mips-gic: Setup defaults in each cluster

David Wang (1):
      genirq/proc: Use seq_put_decimal_ull_width() for decimal values

Fabrizio Castro (3):
      dt-bindings: interrupt-controller: Add Renesas RZ/V2H(P) Interrupt Cont=
roller
      irqchip: Add RZ/V2H(P) Interrupt Control Unit (ICU) driver
      arm64: dts: renesas: r9a09g057: Add ICU node

Gregory CLEMENT (1):
      irqchip/mips-gic: Prevent indirect access to clusters without CPU cores

Hari Prasath (1):
      irqchip/atmel-aic5: Add support for sam9x7 aic

Hongbo Li (1):
      irqchip/sifive-plic: Make use of __assign_bit()

Inochi Amaoto (3):
      dt-bindings: interrupt-controller: Add T-HEAD C900 ACLINT SSWI device
      irqchip: Add T-HEAD C900 ACLINT SSWI driver
      riscv: defconfig: Enable T-HEAD C900 ACLINT SSWI drivers

Kevin Chen (2):
      dt-bindings: interrupt-controller: Add support for ASPEED AST27XX INTC
      irqchip/aspeed-intc: Add AST27XX INTC support

Nathan Chancellor (1):
      irqchip/mips-gic: Fix selection of GENERIC_IRQ_EFFECTIVE_AFF_MASK

Paul Burton (3):
      irqchip/mips-gic: Replace open coded online CPU iterations
      irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic()
      irqchip/mips-gic: Multi-cluster support

Rob Herring (Arm) (1):
      irqchip/stm32mp-exti: Use of_property_present() for non-boolean propert=
ies

Samuel Holland (1):
      irqchip/riscv-aplic: Prevent crash when MSI domain is missing

Sebastian Andrzej Siewior (3):
      hrtimer: Use __raise_softirq_irqoff() to raise the softirq
      timers: Use __raise_softirq_irqoff() to raise the softirq.
      softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

Steven Price (3):
      irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor
      irqchip/gic-v3-its: Rely on genpool alignment
      irqchip/gic-v3-its: Fix over allocation in itt_alloc_pool()

Thorsten Blum (1):
      genirq/irqdesc: Use str_enabled_disabled() helper in wakeup_show()

Varshini Rajendran (1):
      dt-bindings: interrupt-controller: Add support for sam9x7 aic

Zijun Hu (1):
      genirq/devres: Don't free interrupt which is not managed by devres


 .../interrupt-controller/aspeed,ast2700-intc.yaml  |  86 ++++
 .../bindings/interrupt-controller/atmel,aic.yaml   |   1 +
 .../interrupt-controller/renesas,rzv2h-icu.yaml    | 278 +++++++++++
 .../thead,c900-aclint-sswi.yaml                    |  58 +++
 arch/arm/kernel/irq.c                              |   5 +-
 arch/arm64/boot/dts/renesas/r9a09g057.dtsi         |  90 ++++
 arch/loongarch/kernel/irq.c                        |   4 +-
 arch/powerpc/platforms/cell/axon_msi.c             |   2 +-
 arch/riscv/configs/defconfig                       |   1 +
 arch/s390/kernel/irq.c                             |   2 +-
 arch/x86/kernel/acpi/boot.c                        |   6 +-
 arch/x86/kernel/apic/vector.c                      |   8 +-
 drivers/char/hpet.c                                |   1 +
 drivers/irqchip/Kconfig                            |  20 +
 drivers/irqchip/Makefile                           |   3 +
 drivers/irqchip/irq-aspeed-intc.c                  | 139 ++++++
 drivers/irqchip/irq-atmel-aic5.c                   |   9 +
 drivers/irqchip/irq-gic-v3-its.c                   | 141 +++++-
 drivers/irqchip/irq-mips-gic.c                     | 269 +++++++++--
 drivers/irqchip/irq-renesas-rzv2h.c                | 513 +++++++++++++++++++=
++
 drivers/irqchip/irq-riscv-aplic-main.c             |   3 +-
 drivers/irqchip/irq-riscv-aplic-msi.c              |   3 +
 drivers/irqchip/irq-sifive-plic.c                  |   9 +-
 drivers/irqchip/irq-stm32mp-exti.c                 |   3 +-
 drivers/irqchip/irq-thead-c900-aclint-sswi.c       | 176 +++++++
 drivers/net/ethernet/3com/3c59x.c                  |   2 +-
 drivers/net/hamradio/baycom_ser_fdx.c              |   1 +
 drivers/net/hamradio/scc.c                         |   4 +-
 drivers/scsi/aha152x.c                             |   2 +-
 drivers/sh/intc/virq-debugfs.c                     |   1 +
 drivers/soc/renesas/Kconfig                        |   1 +
 drivers/tty/serial/8250/8250_port.c                |   2 +-
 drivers/tty/serial/amba-pl010.c                    |   2 +-
 drivers/tty/serial/amba-pl011.c                    |   2 +-
 drivers/tty/serial/cpm_uart.c                      |   2 +-
 drivers/tty/serial/serial_core.c                   |   2 +-
 drivers/tty/serial/ucc_uart.c                      |   2 +-
 drivers/xen/events/events_base.c                   |   2 +-
 fs/proc/interrupts.c                               |   4 +-
 fs/proc/stat.c                                     |   4 +-
 include/linux/cpuhotplug.h                         |   1 +
 include/linux/interrupt.h                          |  47 ++
 include/linux/irqnr.h                              |  36 +-
 kernel/irq/devres.c                                |   3 +-
 kernel/irq/irqdesc.c                               |  30 +-
 kernel/irq/irqdomain.c                             |   2 +-
 kernel/irq/proc.c                                  |  12 +-
 kernel/rcu/rcutorture.c                            |   8 +
 kernel/softirq.c                                   |  69 ++-
 kernel/time/hrtimer.c                              |   4 +-
 kernel/time/tick-sched.c                           |   2 +-
 kernel/time/timer.c                                |   2 +-
 52 files changed, 1945 insertions(+), 134 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/as=
peed,ast2700-intc.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/re=
nesas,rzv2h-icu.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/th=
ead,c900-aclint-sswi.yaml
 create mode 100644 drivers/irqchip/irq-aspeed-intc.c
 create mode 100644 drivers/irqchip/irq-renesas-rzv2h.c
 create mode 100644 drivers/irqchip/irq-thead-c900-aclint-sswi.c

diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,as=
t2700-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/aspe=
ed,ast2700-intc.yaml
new file mode 100644
index 000000000000..55636d06a674
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-i=
ntc.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/aspeed,ast2700-intc.=
yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aspeed AST2700 Interrupt Controller
+
+description:
+  This interrupt controller hardware is second level interrupt controller th=
at
+  is hooked to a parent interrupt controller. It's useful to combine multiple
+  interrupt sources into 1 interrupt to parent interrupt controller.
+
+maintainers:
+  - Kevin Chen <kevin_chen@aspeedtech.com>
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2700-intc-ic
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+    description:
+      The first cell is the IRQ number, the second cell is the trigger
+      type as defined in interrupt.txt in this directory.
+
+  interrupts:
+    maxItems: 6
+    description: |
+      Depend to which INTC0 or INTC1 used.
+      INTC0 and INTC1 are two kinds of interrupt controller with enable and =
raw
+      status registers for use.
+      INTC0 is used to assert GIC if interrupt in INTC1 asserted.
+      INTC1 is used to assert INTC0 if interrupt of modules asserted.
+      +-----+   +-------+     +---------+---module0
+      | GIC |---| INTC0 |--+--| INTC1_0 |---module2
+      |     |   |       |  |  |         |---...
+      +-----+   +-------+  |  +---------+---module31
+                           |
+                           |   +---------+---module0
+                           +---| INTC1_1 |---module2
+                           |   |         |---...
+                           |   +---------+---module31
+                          ...
+                           |   +---------+---module0
+                           +---| INTC1_5 |---module2
+                               |         |---...
+                               +---------+---module31
+
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    bus {
+        #address-cells =3D <2>;
+        #size-cells =3D <2>;
+
+        interrupt-controller@12101b00 {
+            compatible =3D "aspeed,ast2700-intc-ic";
+            reg =3D <0 0x12101b00 0 0x10>;
+            #interrupt-cells =3D <2>;
+            interrupt-controller;
+            interrupts =3D <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic=
.yaml b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml
index d4658fe3867c..d671ed884c9e 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/atmel,aic.yaml
@@ -23,6 +23,7 @@ properties:
       - atmel,sama5d3-aic
       - atmel,sama5d4-aic
       - microchip,sam9x60-aic
+      - microchip,sam9x7-aic
=20
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,r=
zv2h-icu.yaml b/Documentation/devicetree/bindings/interrupt-controller/renesa=
s,rzv2h-icu.yaml
new file mode 100644
index 000000000000..d7ef4f1323a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzv2h-ic=
u.yaml
@@ -0,0 +1,278 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/renesas,rzv2h-icu.ya=
ml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/V2H(P) Interrupt Control Unit
+
+maintainers:
+  - Fabrizio Castro <fabrizio.castro.jz@renesas.com>
+  - Geert Uytterhoeven <geert+renesas@glider.be>
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+description:
+  The Interrupt Control Unit (ICU) handles external interrupts (NMI, IRQ, and
+  TINT), error interrupts, DMAC requests, GPT interrupts, and internal
+  interrupts.
+
+properties:
+  compatible:
+    const: renesas,r9a09g057-icu # RZ/V2H(P)
+
+  '#interrupt-cells':
+    description: The first cell is the SPI number of the NMI or the
+      PORT_IRQ[0-15] interrupt, as per user manual. The second cell is used =
to
+      specify the flag.
+    const: 2
+
+  '#address-cells':
+    const: 0
+
+  interrupt-controller: true
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 58
+    items:
+      - description: NMI interrupt
+      - description: PORT_IRQ0 interrupt
+      - description: PORT_IRQ1 interrupt
+      - description: PORT_IRQ2 interrupt
+      - description: PORT_IRQ3 interrupt
+      - description: PORT_IRQ4 interrupt
+      - description: PORT_IRQ5 interrupt
+      - description: PORT_IRQ6 interrupt
+      - description: PORT_IRQ7 interrupt
+      - description: PORT_IRQ8 interrupt
+      - description: PORT_IRQ9 interrupt
+      - description: PORT_IRQ10 interrupt
+      - description: PORT_IRQ11 interrupt
+      - description: PORT_IRQ12 interrupt
+      - description: PORT_IRQ13 interrupt
+      - description: PORT_IRQ14 interrupt
+      - description: PORT_IRQ15 interrupt
+      - description: GPIO interrupt, TINT0
+      - description: GPIO interrupt, TINT1
+      - description: GPIO interrupt, TINT2
+      - description: GPIO interrupt, TINT3
+      - description: GPIO interrupt, TINT4
+      - description: GPIO interrupt, TINT5
+      - description: GPIO interrupt, TINT6
+      - description: GPIO interrupt, TINT7
+      - description: GPIO interrupt, TINT8
+      - description: GPIO interrupt, TINT9
+      - description: GPIO interrupt, TINT10
+      - description: GPIO interrupt, TINT11
+      - description: GPIO interrupt, TINT12
+      - description: GPIO interrupt, TINT13
+      - description: GPIO interrupt, TINT14
+      - description: GPIO interrupt, TINT15
+      - description: GPIO interrupt, TINT16
+      - description: GPIO interrupt, TINT17
+      - description: GPIO interrupt, TINT18
+      - description: GPIO interrupt, TINT19
+      - description: GPIO interrupt, TINT20
+      - description: GPIO interrupt, TINT21
+      - description: GPIO interrupt, TINT22
+      - description: GPIO interrupt, TINT23
+      - description: GPIO interrupt, TINT24
+      - description: GPIO interrupt, TINT25
+      - description: GPIO interrupt, TINT26
+      - description: GPIO interrupt, TINT27
+      - description: GPIO interrupt, TINT28
+      - description: GPIO interrupt, TINT29
+      - description: GPIO interrupt, TINT30
+      - description: GPIO interrupt, TINT31
+      - description: Software interrupt, INTA55_0
+      - description: Software interrupt, INTA55_1
+      - description: Software interrupt, INTA55_2
+      - description: Software interrupt, INTA55_3
+      - description: Error interrupt to CA55
+      - description: GTCCRA compare match/input capture (U0)
+      - description: GTCCRB compare match/input capture (U0)
+      - description: GTCCRA compare match/input capture (U1)
+      - description: GTCCRB compare match/input capture (U1)
+
+  interrupt-names:
+    minItems: 58
+    items:
+      - const: nmi
+      - const: port_irq0
+      - const: port_irq1
+      - const: port_irq2
+      - const: port_irq3
+      - const: port_irq4
+      - const: port_irq5
+      - const: port_irq6
+      - const: port_irq7
+      - const: port_irq8
+      - const: port_irq9
+      - const: port_irq10
+      - const: port_irq11
+      - const: port_irq12
+      - const: port_irq13
+      - const: port_irq14
+      - const: port_irq15
+      - const: tint0
+      - const: tint1
+      - const: tint2
+      - const: tint3
+      - const: tint4
+      - const: tint5
+      - const: tint6
+      - const: tint7
+      - const: tint8
+      - const: tint9
+      - const: tint10
+      - const: tint11
+      - const: tint12
+      - const: tint13
+      - const: tint14
+      - const: tint15
+      - const: tint16
+      - const: tint17
+      - const: tint18
+      - const: tint19
+      - const: tint20
+      - const: tint21
+      - const: tint22
+      - const: tint23
+      - const: tint24
+      - const: tint25
+      - const: tint26
+      - const: tint27
+      - const: tint28
+      - const: tint29
+      - const: tint30
+      - const: tint31
+      - const: int-ca55-0
+      - const: int-ca55-1
+      - const: int-ca55-2
+      - const: int-ca55-3
+      - const: icu-error-ca55
+      - const: gpt-u0-gtciada
+      - const: gpt-u0-gtciadb
+      - const: gpt-u1-gtciada
+      - const: gpt-u1-gtciadb
+
+  clocks:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - '#interrupt-cells'
+  - '#address-cells'
+  - interrupt-controller
+  - interrupts
+  - interrupt-names
+  - clocks
+  - power-domains
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+    icu: interrupt-controller@10400000 {
+        compatible =3D "renesas,r9a09g057-icu";
+        reg =3D <0x10400000 0x10000>;
+        #interrupt-cells =3D <2>;
+        #address-cells =3D <0>;
+        interrupt-controller;
+        interrupts =3D <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 427 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 428 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 433 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 434 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 435 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 436 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 437 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 438 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 439 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 441 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 442 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 443 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 445 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 446 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 447 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 449 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 450 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 262 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 263 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 264 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 265 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 453 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 454 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names =3D "nmi",
+                          "port_irq0", "port_irq1", "port_irq2",
+                          "port_irq3", "port_irq4", "port_irq5",
+                          "port_irq6", "port_irq7", "port_irq8",
+                          "port_irq9", "port_irq10", "port_irq11",
+                          "port_irq12", "port_irq13", "port_irq14",
+                          "port_irq15",
+                          "tint0", "tint1", "tint2", "tint3",
+                          "tint4", "tint5", "tint6", "tint7",
+                          "tint8", "tint9", "tint10", "tint11",
+                          "tint12", "tint13", "tint14", "tint15",
+                          "tint16", "tint17", "tint18", "tint19",
+                          "tint20", "tint21", "tint22", "tint23",
+                          "tint24", "tint25", "tint26", "tint27",
+                          "tint28", "tint29", "tint30", "tint31",
+                          "int-ca55-0", "int-ca55-1",
+                          "int-ca55-2", "int-ca55-3",
+                          "icu-error-ca55",
+                          "gpt-u0-gtciada", "gpt-u0-gtciadb",
+                          "gpt-u1-gtciada", "gpt-u1-gtciadb";
+        clocks =3D <&cpg CPG_MOD 0x5>;
+        power-domains =3D <&cpg>;
+        resets =3D <&cpg 0x36>;
+    };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/thead,c90=
0-aclint-sswi.yaml b/Documentation/devicetree/bindings/interrupt-controller/t=
head,c900-aclint-sswi.yaml
new file mode 100644
index 000000000000..8d330906bbbd
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclin=
t-sswi.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/thead,c900-aclint-ss=
wi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: T-HEAD C900 ACLINT Supervisor-level Software Interrupt Device
+
+maintainers:
+  - Inochi Amaoto <inochiama@outlook.com>
+
+description:
+  The SSWI device is a part of the THEAD ACLINT device. It provides
+  supervisor-level IPI functionality for a set of HARTs on a THEAD
+  platform. It provides a register to set an IPI (SETSSIP) for each
+  HART connected to the SSWI device.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - sophgo,sg2044-aclint-sswi
+      - const: thead,c900-aclint-sswi
+
+  reg:
+    maxItems: 1
+
+  "#interrupt-cells":
+    const: 0
+
+  interrupt-controller: true
+
+  interrupts-extended:
+    minItems: 1
+    maxItems: 4095
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - "#interrupt-cells"
+  - interrupt-controller
+  - interrupts-extended
+
+examples:
+  - |
+    interrupt-controller@94000000 {
+      compatible =3D "sophgo,sg2044-aclint-sswi", "thead,c900-aclint-sswi";
+      reg =3D <0x94000000 0x00004000>;
+      #interrupt-cells =3D <0>;
+      interrupt-controller;
+      interrupts-extended =3D <&cpu1intc 1>,
+                            <&cpu2intc 1>,
+                            <&cpu3intc 1>,
+                            <&cpu4intc 1>;
+    };
+...
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index dab42d066d06..e1993e28a9ec 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -111,7 +111,7 @@ void handle_IRQ(unsigned int irq, struct pt_regs *regs)
 	 * Some hardware gives randomly wrong interrupts.  Rather
 	 * than crashing, do something sensible.
 	 */
-	if (unlikely(!irq || irq >=3D nr_irqs))
+	if (unlikely(!irq || irq >=3D irq_get_nr_irqs()))
 		desc =3D NULL;
 	else
 		desc =3D irq_to_desc(irq);
@@ -151,7 +151,6 @@ void __init init_IRQ(void)
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {
-	nr_irqs =3D machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS;
-	return nr_irqs;
+	return irq_set_nr_irqs(machine_desc->nr_irqs ? : NR_IRQS);
 }
 #endif
diff --git a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi b/arch/arm64/boot/dts=
/renesas/r9a09g057.dtsi
index 1ad5a1b6917f..abcdef3ba5bc 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
@@ -90,6 +90,95 @@ soc: soc {
 		#size-cells =3D <2>;
 		ranges;
=20
+		icu: interrupt-controller@10400000 {
+			compatible =3D "renesas,r9a09g057-icu";
+			reg =3D <0 0x10400000 0 0x10000>;
+			#interrupt-cells =3D <2>;
+			#address-cells =3D <0>;
+			interrupt-controller;
+			interrupts =3D <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 427 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 428 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 433 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 434 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 435 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 436 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 437 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 438 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 439 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 441 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 442 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 443 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 445 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 446 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 447 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 449 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 450 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 262 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 263 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 264 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 265 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 453 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 454 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names =3D "nmi",
+					  "port_irq0", "port_irq1", "port_irq2",
+					  "port_irq3", "port_irq4", "port_irq5",
+					  "port_irq6", "port_irq7", "port_irq8",
+					  "port_irq9", "port_irq10", "port_irq11",
+					  "port_irq12", "port_irq13", "port_irq14",
+					  "port_irq15",
+					  "tint0", "tint1", "tint2", "tint3",
+					  "tint4", "tint5", "tint6", "tint7",
+					  "tint8", "tint9", "tint10", "tint11",
+					  "tint12", "tint13", "tint14", "tint15",
+					  "tint16", "tint17", "tint18", "tint19",
+					  "tint20", "tint21", "tint22", "tint23",
+					  "tint24", "tint25", "tint26", "tint27",
+					  "tint28", "tint29", "tint30", "tint31",
+					  "int-ca55-0", "int-ca55-1",
+					  "int-ca55-2", "int-ca55-3",
+					  "icu-error-ca55",
+					  "gpt-u0-gtciada", "gpt-u0-gtciadb",
+					  "gpt-u1-gtciada", "gpt-u1-gtciadb";
+			clocks =3D <&cpg CPG_MOD 0x5>;
+			power-domains =3D <&cpg>;
+			resets =3D <&cpg 0x36>;
+		};
+
 		pinctrl: pinctrl@10410000 {
 			compatible =3D "renesas,r9a09g057-pinctrl";
 			reg =3D <0 0x10410000 0 0x10000>;
@@ -99,6 +188,7 @@ pinctrl: pinctrl@10410000 {
 			gpio-ranges =3D <&pinctrl 0 0 96>;
 			#interrupt-cells =3D <2>;
 			interrupt-controller;
+			interrupt-parent =3D <&icu>;
 			power-domains =3D <&cpg>;
 			resets =3D <&cpg 0xa5>, <&cpg 0xa6>;
 		};
diff --git a/arch/loongarch/kernel/irq.c b/arch/loongarch/kernel/irq.c
index d129039b368b..80946cafaec1 100644
--- a/arch/loongarch/kernel/irq.c
+++ b/arch/loongarch/kernel/irq.c
@@ -92,9 +92,9 @@ int __init arch_probe_nr_irqs(void)
 	int nr_io_pics =3D bitmap_weight(loongson_sysconf.cores_io_master, NR_CPUS);
=20
 	if (!cpu_has_avecint)
-		nr_irqs =3D (64 + NR_VECTORS * nr_io_pics);
+		irq_set_nr_irqs(64 + NR_VECTORS * nr_io_pics);
 	else
-		nr_irqs =3D (64 + NR_VECTORS * (nr_cpu_ids + nr_io_pics));
+		irq_set_nr_irqs(64 + NR_VECTORS * (nr_cpu_ids + nr_io_pics));
=20
 	return NR_IRQS_LEGACY;
 }
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/=
cell/axon_msi.c
index 28dc86744cac..d243f7fd8982 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -112,7 +112,7 @@ static void axon_msi_cascade(struct irq_desc *desc)
 		pr_devel("axon_msi: woff %x roff %x msi %x\n",
 			  write_offset, msic->read_offset, msi);
=20
-		if (msi < nr_irqs && irq_get_chip_data(msi) =3D=3D msic) {
+		if (msi < irq_get_nr_irqs() && irq_get_chip_data(msi) =3D=3D msic) {
 			generic_handle_irq(msi);
 			msic->fifo_virt[idx] =3D cpu_to_le32(0xffffffff);
 		} else {
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 2341393cfac1..5b1d6325df85 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -256,6 +256,7 @@ CONFIG_RPMSG_CTRL=3Dy
 CONFIG_RPMSG_VIRTIO=3Dy
 CONFIG_PM_DEVFREQ=3Dy
 CONFIG_IIO=3Dy
+CONFIG_THEAD_C900_ACLINT_SSWI=3Dy
 CONFIG_PHY_SUN4I_USB=3Dm
 CONFIG_PHY_STARFIVE_JH7110_DPHY_RX=3Dm
 CONFIG_PHY_STARFIVE_JH7110_PCIE=3Dm
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index 2639a3d12736..a2c867181b5a 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -253,7 +253,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		seq_putc(p, '\n');
 		goto out;
 	}
-	if (index < nr_irqs) {
+	if (index < irq_get_nr_irqs()) {
 		show_msi_interrupt(p, index);
 		goto out;
 	}
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4efecac49863..3a44a9dc3fb7 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1171,7 +1171,8 @@ static int __init acpi_parse_madt_ioapic_entries(void)
 	}
=20
 	count =3D acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE,
-				      acpi_parse_int_src_ovr, nr_irqs);
+				      acpi_parse_int_src_ovr,
+				      irq_get_nr_irqs());
 	if (count < 0) {
 		pr_err("Error parsing interrupt source overrides entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
@@ -1191,7 +1192,8 @@ static int __init acpi_parse_madt_ioapic_entries(void)
 	mp_config_acpi_legacy_irqs();
=20
 	count =3D acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE,
-				      acpi_parse_nmi_src, nr_irqs);
+				      acpi_parse_nmi_src,
+				      irq_get_nr_irqs());
 	if (count < 0) {
 		pr_err("Error parsing NMI SRC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 557318145038..736f62812f5c 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -712,8 +712,8 @@ int __init arch_probe_nr_irqs(void)
 {
 	int nr;
=20
-	if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
-		nr_irqs =3D NR_VECTORS * nr_cpu_ids;
+	if (irq_get_nr_irqs() > NR_VECTORS * nr_cpu_ids)
+		irq_set_nr_irqs(NR_VECTORS * nr_cpu_ids);
=20
 	nr =3D (gsi_top + nr_legacy_irqs()) + 8 * nr_cpu_ids;
 #if defined(CONFIG_PCI_MSI)
@@ -725,8 +725,8 @@ int __init arch_probe_nr_irqs(void)
 	else
 		nr +=3D gsi_top * 16;
 #endif
-	if (nr < nr_irqs)
-		nr_irqs =3D nr;
+	if (nr < irq_get_nr_irqs())
+		irq_set_nr_irqs(nr);
=20
 	/*
 	 * We don't know if PIC is present at this point so we need to do
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index e904e476e49a..48fe96ab4649 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -162,6 +162,7 @@ static irqreturn_t hpet_interrupt(int irq, void *data)
=20
 static void hpet_timer_set_irq(struct hpet_dev *devp)
 {
+	const unsigned int nr_irqs =3D irq_get_nr_irqs();
 	unsigned long v;
 	int irq, gsi;
 	struct hpet_timer __iomem *timer;
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 341cd9ca5a05..9cac13663871 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -265,6 +265,13 @@ config RENESAS_RZG2L_IRQC
 	  Enable support for the Renesas RZ/G2L (and alike SoC) Interrupt Controller
 	  for external devices.
=20
+config RENESAS_RZV2H_ICU
+	bool "Renesas RZ/V2H(P) ICU support" if COMPILE_TEST
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN_HIERARCHY
+	help
+	  Enable support for the Renesas RZ/V2H(P) Interrupt Control Unit (ICU)
+
 config SL28CPLD_INTC
 	bool "Kontron sl28cpld IRQ controller"
 	depends on MFD_SL28CPLD=3Dy || COMPILE_TEST
@@ -345,6 +352,7 @@ config KEYSTONE_IRQ
=20
 config MIPS_GIC
 	bool
+	select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 	select GENERIC_IRQ_IPI if SMP
 	select IRQ_DOMAIN_HIERARCHY
 	select MIPS_CM
@@ -611,6 +619,18 @@ config STARFIVE_JH8100_INTC
=20
 	  If you don't know what to do here, say Y.
=20
+config THEAD_C900_ACLINT_SSWI
+	bool "THEAD C9XX ACLINT S-mode IPI Interrupt Controller"
+	depends on RISCV
+	depends on SMP
+	select IRQ_DOMAIN_HIERARCHY
+	select GENERIC_IRQ_IPI_MUX
+	help
+	  This enables support for T-HEAD specific ACLINT SSWI device
+	  support.
+
+	  If you don't know what to do here, say Y.
+
 config EXYNOS_IRQ_COMBINER
 	bool "Samsung Exynos IRQ combiner support" if COMPILE_TEST
 	depends on (ARCH_EXYNOS && ARM) || COMPILE_TEST
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index e3679ec2b9f7..25e9ad29b8c4 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_RENESAS_INTC_IRQPIN)	+=3D irq-renesas-intc-irq=
pin.o
 obj-$(CONFIG_RENESAS_IRQC)		+=3D irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)		+=3D irq-renesas-rza1.o
 obj-$(CONFIG_RENESAS_RZG2L_IRQC)	+=3D irq-renesas-rzg2l.o
+obj-$(CONFIG_RENESAS_RZV2H_ICU)		+=3D irq-renesas-rzv2h.o
 obj-$(CONFIG_VERSATILE_FPGA_IRQ)	+=3D irq-versatile-fpga.o
 obj-$(CONFIG_ARCH_NSPIRE)		+=3D irq-zevio.o
 obj-$(CONFIG_ARCH_VT8500)		+=3D irq-vt8500.o
@@ -84,6 +85,7 @@ obj-$(CONFIG_MVEBU_SEI)			+=3D irq-mvebu-sei.o
 obj-$(CONFIG_LS_EXTIRQ)			+=3D irq-ls-extirq.o
 obj-$(CONFIG_LS_SCFG_MSI)		+=3D irq-ls-scfg-msi.o
 obj-$(CONFIG_ARCH_ASPEED)		+=3D irq-aspeed-vic.o irq-aspeed-i2c-ic.o irq-asp=
eed-scu-ic.o
+obj-$(CONFIG_ARCH_ASPEED)		+=3D irq-aspeed-intc.o
 obj-$(CONFIG_STM32MP_EXTI)		+=3D irq-stm32mp-exti.o
 obj-$(CONFIG_STM32_EXTI) 		+=3D irq-stm32-exti.o
 obj-$(CONFIG_QCOM_IRQ_COMBINER)		+=3D qcom-irq-combiner.o
@@ -101,6 +103,7 @@ obj-$(CONFIG_RISCV_APLIC_MSI)		+=3D irq-riscv-aplic-msi.o
 obj-$(CONFIG_RISCV_IMSIC)		+=3D irq-riscv-imsic-state.o irq-riscv-imsic-earl=
y.o irq-riscv-imsic-platform.o
 obj-$(CONFIG_SIFIVE_PLIC)		+=3D irq-sifive-plic.o
 obj-$(CONFIG_STARFIVE_JH8100_INTC)	+=3D irq-starfive-jh8100-intc.o
+obj-$(CONFIG_THEAD_C900_ACLINT_SSWI)	+=3D irq-thead-c900-aclint-sswi.o
 obj-$(CONFIG_IMX_IRQSTEER)		+=3D irq-imx-irqsteer.o
 obj-$(CONFIG_IMX_INTMUX)		+=3D irq-imx-intmux.o
 obj-$(CONFIG_IMX_MU_MSI)		+=3D irq-imx-mu-msi.o
diff --git a/drivers/irqchip/irq-aspeed-intc.c b/drivers/irqchip/irq-aspeed-i=
ntc.c
new file mode 100644
index 000000000000..bd3b759b4b2c
--- /dev/null
+++ b/drivers/irqchip/irq-aspeed-intc.c
@@ -0,0 +1,139 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ *  Aspeed Interrupt Controller.
+ *
+ *  Copyright (C) 2023 ASPEED Technology Inc.
+ */
+
+#include <linux/bitops.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/irqdomain.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/io.h>
+#include <linux/spinlock.h>
+
+#define INTC_INT_ENABLE_REG	0x00
+#define INTC_INT_STATUS_REG	0x04
+#define INTC_IRQS_PER_WORD	32
+
+struct aspeed_intc_ic {
+	void __iomem		*base;
+	raw_spinlock_t		gic_lock;
+	raw_spinlock_t		intc_lock;
+	struct irq_domain	*irq_domain;
+};
+
+static void aspeed_intc_ic_irq_handler(struct irq_desc *desc)
+{
+	struct aspeed_intc_ic *intc_ic =3D irq_desc_get_handler_data(desc);
+	struct irq_chip *chip =3D irq_desc_get_chip(desc);
+
+	chained_irq_enter(chip, desc);
+
+	scoped_guard(raw_spinlock, &intc_ic->gic_lock) {
+		unsigned long bit, status;
+
+		status =3D readl(intc_ic->base + INTC_INT_STATUS_REG);
+		for_each_set_bit(bit, &status, INTC_IRQS_PER_WORD) {
+			generic_handle_domain_irq(intc_ic->irq_domain, bit);
+			writel(BIT(bit), intc_ic->base + INTC_INT_STATUS_REG);
+		}
+	}
+
+	chained_irq_exit(chip, desc);
+}
+
+static void aspeed_intc_irq_mask(struct irq_data *data)
+{
+	struct aspeed_intc_ic *intc_ic =3D irq_data_get_irq_chip_data(data);
+	unsigned int mask =3D readl(intc_ic->base + INTC_INT_ENABLE_REG) & ~BIT(dat=
a->hwirq);
+
+	guard(raw_spinlock)(&intc_ic->intc_lock);
+	writel(mask, intc_ic->base + INTC_INT_ENABLE_REG);
+}
+
+static void aspeed_intc_irq_unmask(struct irq_data *data)
+{
+	struct aspeed_intc_ic *intc_ic =3D irq_data_get_irq_chip_data(data);
+	unsigned int unmask =3D readl(intc_ic->base + INTC_INT_ENABLE_REG) | BIT(da=
ta->hwirq);
+
+	guard(raw_spinlock)(&intc_ic->intc_lock);
+	writel(unmask, intc_ic->base + INTC_INT_ENABLE_REG);
+}
+
+static struct irq_chip aspeed_intc_chip =3D {
+	.name			=3D "ASPEED INTC",
+	.irq_mask		=3D aspeed_intc_irq_mask,
+	.irq_unmask		=3D aspeed_intc_irq_unmask,
+};
+
+static int aspeed_intc_ic_map_irq_domain(struct irq_domain *domain, unsigned=
 int irq,
+					 irq_hw_number_t hwirq)
+{
+	irq_set_chip_and_handler(irq, &aspeed_intc_chip, handle_level_irq);
+	irq_set_chip_data(irq, domain->host_data);
+
+	return 0;
+}
+
+static const struct irq_domain_ops aspeed_intc_ic_irq_domain_ops =3D {
+	.map =3D aspeed_intc_ic_map_irq_domain,
+};
+
+static int __init aspeed_intc_ic_of_init(struct device_node *node,
+					 struct device_node *parent)
+{
+	struct aspeed_intc_ic *intc_ic;
+	int irq, i, ret =3D 0;
+
+	intc_ic =3D kzalloc(sizeof(*intc_ic), GFP_KERNEL);
+	if (!intc_ic)
+		return -ENOMEM;
+
+	intc_ic->base =3D of_iomap(node, 0);
+	if (!intc_ic->base) {
+		pr_err("Failed to iomap intc_ic base\n");
+		ret =3D -ENOMEM;
+		goto err_free_ic;
+	}
+	writel(0xffffffff, intc_ic->base + INTC_INT_STATUS_REG);
+	writel(0x0, intc_ic->base + INTC_INT_ENABLE_REG);
+
+	intc_ic->irq_domain =3D irq_domain_add_linear(node, INTC_IRQS_PER_WORD,
+						    &aspeed_intc_ic_irq_domain_ops, intc_ic);
+	if (!intc_ic->irq_domain) {
+		ret =3D -ENOMEM;
+		goto err_iounmap;
+	}
+
+	raw_spin_lock_init(&intc_ic->gic_lock);
+	raw_spin_lock_init(&intc_ic->intc_lock);
+
+	/* Check all the irq numbers valid. If not, unmaps all the base and frees t=
he data. */
+	for (i =3D 0; i < of_irq_count(node); i++) {
+		irq =3D irq_of_parse_and_map(node, i);
+		if (!irq) {
+			pr_err("Failed to get irq number\n");
+			ret =3D -EINVAL;
+			goto err_iounmap;
+		}
+	}
+
+	for (i =3D 0; i < of_irq_count(node); i++) {
+		irq =3D irq_of_parse_and_map(node, i);
+		irq_set_chained_handler_and_data(irq, aspeed_intc_ic_irq_handler, intc_ic);
+	}
+
+	return 0;
+
+err_iounmap:
+	iounmap(intc_ic->base);
+err_free_ic:
+	kfree(intc_ic);
+	return ret;
+}
+
+IRQCHIP_DECLARE(ast2700_intc_ic, "aspeed,ast2700-intc-ic", aspeed_intc_ic_of=
_init);
diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic=
5.c
index c0f55dc7b050..e98c2875af9e 100644
--- a/drivers/irqchip/irq-atmel-aic5.c
+++ b/drivers/irqchip/irq-atmel-aic5.c
@@ -319,6 +319,7 @@ static const struct of_device_id aic5_irq_fixups[] __init=
const =3D {
 	{ .compatible =3D "atmel,sama5d3", .data =3D sama5d3_aic_irq_fixup },
 	{ .compatible =3D "atmel,sama5d4", .data =3D sama5d3_aic_irq_fixup },
 	{ .compatible =3D "microchip,sam9x60", .data =3D sam9x60_aic_irq_fixup },
+	{ .compatible =3D "microchip,sam9x7", .data =3D sam9x60_aic_irq_fixup },
 	{ /* sentinel */ },
 };
=20
@@ -405,3 +406,11 @@ static int __init sam9x60_aic5_of_init(struct device_nod=
e *node,
 	return aic5_of_init(node, parent, NR_SAM9X60_IRQS);
 }
 IRQCHIP_DECLARE(sam9x60_aic5, "microchip,sam9x60-aic", sam9x60_aic5_of_init);
+
+#define NR_SAM9X7_IRQS		70
+
+static int __init sam9x7_aic5_of_init(struct device_node *node, struct devic=
e_node *parent)
+{
+	return aic5_of_init(node, parent, NR_SAM9X7_IRQS);
+}
+IRQCHIP_DECLARE(sam9x7_aic5, "microchip,sam9x7-aic", sam9x7_aic5_of_init);
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-it=
s.c
index fdec478ba5e7..395961fb2180 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -12,12 +12,14 @@
 #include <linux/crash_dump.h>
 #include <linux/delay.h>
 #include <linux/efi.h>
+#include <linux/genalloc.h>
 #include <linux/interrupt.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
 #include <linux/irqdomain.h>
 #include <linux/list.h>
 #include <linux/log2.h>
+#include <linux/mem_encrypt.h>
 #include <linux/memblock.h>
 #include <linux/mm.h>
 #include <linux/msi.h>
@@ -27,6 +29,7 @@
 #include <linux/of_pci.h>
 #include <linux/of_platform.h>
 #include <linux/percpu.h>
+#include <linux/set_memory.h>
 #include <linux/slab.h>
 #include <linux/syscore_ops.h>
=20
@@ -164,6 +167,7 @@ struct its_device {
 	struct its_node		*its;
 	struct event_lpi_map	event_map;
 	void			*itt;
+	u32			itt_sz;
 	u32			nr_ites;
 	u32			device_id;
 	bool			shared;
@@ -199,6 +203,87 @@ static DEFINE_IDA(its_vpeid_ida);
 #define gic_data_rdist_rd_base()	(gic_data_rdist()->rd_base)
 #define gic_data_rdist_vlpi_base()	(gic_data_rdist_rd_base() + SZ_128K)
=20
+static struct page *its_alloc_pages_node(int node, gfp_t gfp,
+					 unsigned int order)
+{
+	struct page *page;
+	int ret =3D 0;
+
+	page =3D alloc_pages_node(node, gfp, order);
+
+	if (!page)
+		return NULL;
+
+	ret =3D set_memory_decrypted((unsigned long)page_address(page),
+				   1 << order);
+	/*
+	 * If set_memory_decrypted() fails then we don't know what state the
+	 * page is in, so we can't free it. Instead we leak it.
+	 * set_memory_decrypted() will already have WARNed.
+	 */
+	if (ret)
+		return NULL;
+
+	return page;
+}
+
+static struct page *its_alloc_pages(gfp_t gfp, unsigned int order)
+{
+	return its_alloc_pages_node(NUMA_NO_NODE, gfp, order);
+}
+
+static void its_free_pages(void *addr, unsigned int order)
+{
+	/*
+	 * If the memory cannot be encrypted again then we must leak the pages.
+	 * set_memory_encrypted() will already have WARNed.
+	 */
+	if (set_memory_encrypted((unsigned long)addr, 1 << order))
+		return;
+	free_pages((unsigned long)addr, order);
+}
+
+static struct gen_pool *itt_pool;
+
+static void *itt_alloc_pool(int node, int size)
+{
+	unsigned long addr;
+	struct page *page;
+
+	if (size >=3D PAGE_SIZE) {
+		page =3D its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, get_order(siz=
e));
+
+		return page ? page_address(page) : NULL;
+	}
+
+	do {
+		addr =3D gen_pool_alloc(itt_pool, size);
+		if (addr)
+			break;
+
+		page =3D its_alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO, 0);
+		if (!page)
+			break;
+
+		gen_pool_add(itt_pool, (unsigned long)page_address(page), PAGE_SIZE, node);
+	} while (!addr);
+
+	return (void *)addr;
+}
+
+static void itt_free_pool(void *addr, int size)
+{
+	if (!addr)
+		return;
+
+	if (size >=3D PAGE_SIZE) {
+		its_free_pages(addr, get_order(size));
+		return;
+	}
+
+	gen_pool_free(itt_pool, (unsigned long)addr, size);
+}
+
 /*
  * Skip ITSs that have no vLPIs mapped, unless we're on GICv4.1, as we
  * always have vSGIs mapped.
@@ -621,7 +706,6 @@ static struct its_collection *its_build_mapd_cmd(struct i=
ts_node *its,
 	u8 size =3D ilog2(desc->its_mapd_cmd.dev->nr_ites);
=20
 	itt_addr =3D virt_to_phys(desc->its_mapd_cmd.dev->itt);
-	itt_addr =3D ALIGN(itt_addr, ITS_ITT_ALIGN);
=20
 	its_encode_cmd(cmd, GITS_CMD_MAPD);
 	its_encode_devid(cmd, desc->its_mapd_cmd.dev->device_id);
@@ -2181,7 +2265,8 @@ static struct page *its_allocate_prop_table(gfp_t gfp_f=
lags)
 {
 	struct page *prop_page;
=20
-	prop_page =3D alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ));
+	prop_page =3D its_alloc_pages(gfp_flags,
+				    get_order(LPI_PROPBASE_SZ));
 	if (!prop_page)
 		return NULL;
=20
@@ -2192,8 +2277,7 @@ static struct page *its_allocate_prop_table(gfp_t gfp_f=
lags)
=20
 static void its_free_prop_table(struct page *prop_page)
 {
-	free_pages((unsigned long)page_address(prop_page),
-		   get_order(LPI_PROPBASE_SZ));
+	its_free_pages(page_address(prop_page), get_order(LPI_PROPBASE_SZ));
 }
=20
 static bool gic_check_reserved_range(phys_addr_t addr, unsigned long size)
@@ -2315,7 +2399,7 @@ static int its_setup_baser(struct its_node *its, struct=
 its_baser *baser,
 		order =3D get_order(GITS_BASER_PAGES_MAX * psz);
 	}
=20
-	page =3D alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO, order);
+	page =3D its_alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO, orde=
r);
 	if (!page)
 		return -ENOMEM;
=20
@@ -2328,7 +2412,7 @@ static int its_setup_baser(struct its_node *its, struct=
 its_baser *baser,
 		/* 52bit PA is supported only when PageSize=3D64K */
 		if (psz !=3D SZ_64K) {
 			pr_err("ITS: no 52bit PA support when psz=3D%d\n", psz);
-			free_pages((unsigned long)base, order);
+			its_free_pages(base, order);
 			return -ENXIO;
 		}
=20
@@ -2384,7 +2468,7 @@ static int its_setup_baser(struct its_node *its, struct=
 its_baser *baser,
 		pr_err("ITS@%pa: %s doesn't stick: %llx %llx\n",
 		       &its->phys_base, its_base_type_string[type],
 		       val, tmp);
-		free_pages((unsigned long)base, order);
+		its_free_pages(base, order);
 		return -ENXIO;
 	}
=20
@@ -2523,8 +2607,7 @@ static void its_free_tables(struct its_node *its)
=20
 	for (i =3D 0; i < GITS_BASER_NR_REGS; i++) {
 		if (its->tables[i].base) {
-			free_pages((unsigned long)its->tables[i].base,
-				   its->tables[i].order);
+			its_free_pages(its->tables[i].base, its->tables[i].order);
 			its->tables[i].base =3D NULL;
 		}
 	}
@@ -2790,7 +2873,7 @@ static bool allocate_vpe_l2_table(int cpu, u32 id)
=20
 	/* Allocate memory for 2nd level table */
 	if (!table[idx]) {
-		page =3D alloc_pages(GFP_KERNEL | __GFP_ZERO, get_order(psz));
+		page =3D its_alloc_pages(GFP_KERNEL | __GFP_ZERO, get_order(psz));
 		if (!page)
 			return false;
=20
@@ -2909,7 +2992,7 @@ static int allocate_vpe_l1_table(void)
=20
 	pr_debug("np =3D %d, npg =3D %lld, psz =3D %d, epp =3D %d, esz =3D %d\n",
 		 np, npg, psz, epp, esz);
-	page =3D alloc_pages(GFP_ATOMIC | __GFP_ZERO, get_order(np * PAGE_SIZE));
+	page =3D its_alloc_pages(GFP_ATOMIC | __GFP_ZERO, get_order(np * PAGE_SIZE)=
);
 	if (!page)
 		return -ENOMEM;
=20
@@ -2955,8 +3038,7 @@ static struct page *its_allocate_pending_table(gfp_t gf=
p_flags)
 {
 	struct page *pend_page;
=20
-	pend_page =3D alloc_pages(gfp_flags | __GFP_ZERO,
-				get_order(LPI_PENDBASE_SZ));
+	pend_page =3D its_alloc_pages(gfp_flags | __GFP_ZERO, get_order(LPI_PENDBAS=
E_SZ));
 	if (!pend_page)
 		return NULL;
=20
@@ -2968,7 +3050,7 @@ static struct page *its_allocate_pending_table(gfp_t gf=
p_flags)
=20
 static void its_free_pending_table(struct page *pt)
 {
-	free_pages((unsigned long)page_address(pt), get_order(LPI_PENDBASE_SZ));
+	its_free_pages(page_address(pt), get_order(LPI_PENDBASE_SZ));
 }
=20
 /*
@@ -3303,8 +3385,8 @@ static bool its_alloc_table_entry(struct its_node *its,
=20
 	/* Allocate memory for 2nd level table */
 	if (!table[idx]) {
-		page =3D alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
-					get_order(baser->psz));
+		page =3D its_alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
+					    get_order(baser->psz));
 		if (!page)
 			return false;
=20
@@ -3399,15 +3481,18 @@ static struct its_device *its_create_device(struct it=
s_node *its, u32 dev_id,
 	if (WARN_ON(!is_power_of_2(nvecs)))
 		nvecs =3D roundup_pow_of_two(nvecs);
=20
-	dev =3D kzalloc(sizeof(*dev), GFP_KERNEL);
 	/*
 	 * Even if the device wants a single LPI, the ITT must be
 	 * sized as a power of two (and you need at least one bit...).
 	 */
 	nr_ites =3D max(2, nvecs);
 	sz =3D nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1);
-	sz =3D max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1;
-	itt =3D kzalloc_node(sz, GFP_KERNEL, its->numa_node);
+	sz =3D max(sz, ITS_ITT_ALIGN);
+
+	itt =3D itt_alloc_pool(its->numa_node, sz);
+
+	dev =3D kzalloc(sizeof(*dev), GFP_KERNEL);
+
 	if (alloc_lpis) {
 		lpi_map =3D its_lpi_alloc(nvecs, &lpi_base, &nr_lpis);
 		if (lpi_map)
@@ -3419,9 +3504,9 @@ static struct its_device *its_create_device(struct its_=
node *its, u32 dev_id,
 		lpi_base =3D 0;
 	}
=20
-	if (!dev || !itt ||  !col_map || (!lpi_map && alloc_lpis)) {
+	if (!dev || !itt || !col_map || (!lpi_map && alloc_lpis)) {
 		kfree(dev);
-		kfree(itt);
+		itt_free_pool(itt, sz);
 		bitmap_free(lpi_map);
 		kfree(col_map);
 		return NULL;
@@ -3431,6 +3516,7 @@ static struct its_device *its_create_device(struct its_=
node *its, u32 dev_id,
=20
 	dev->its =3D its;
 	dev->itt =3D itt;
+	dev->itt_sz =3D sz;
 	dev->nr_ites =3D nr_ites;
 	dev->event_map.lpi_map =3D lpi_map;
 	dev->event_map.col_map =3D col_map;
@@ -3458,7 +3544,7 @@ static void its_free_device(struct its_device *its_dev)
 	list_del(&its_dev->entry);
 	raw_spin_unlock_irqrestore(&its_dev->its->lock, flags);
 	kfree(its_dev->event_map.col_map);
-	kfree(its_dev->itt);
+	itt_free_pool(its_dev->itt, its_dev->itt_sz);
 	kfree(its_dev);
 }
=20
@@ -5116,8 +5202,9 @@ static int __init its_probe_one(struct its_node *its)
 		}
 	}
=20
-	page =3D alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
-				get_order(ITS_CMD_QUEUE_SZ));
+	page =3D its_alloc_pages_node(its->numa_node,
+				    GFP_KERNEL | __GFP_ZERO,
+				    get_order(ITS_CMD_QUEUE_SZ));
 	if (!page) {
 		err =3D -ENOMEM;
 		goto out_unmap_sgir;
@@ -5181,7 +5268,7 @@ static int __init its_probe_one(struct its_node *its)
 out_free_tables:
 	its_free_tables(its);
 out_free_cmd:
-	free_pages((unsigned long)its->cmd_base, get_order(ITS_CMD_QUEUE_SZ));
+	its_free_pages(its->cmd_base, get_order(ITS_CMD_QUEUE_SZ));
 out_unmap_sgir:
 	if (its->sgir_base)
 		iounmap(its->sgir_base);
@@ -5667,6 +5754,10 @@ int __init its_init(struct fwnode_handle *handle, stru=
ct rdists *rdists,
 	bool has_v4_1 =3D false;
 	int err;
=20
+	itt_pool =3D gen_pool_create(get_order(ITS_ITT_ALIGN), -1);
+	if (!itt_pool)
+		return -ENOMEM;
+
 	gic_rdists =3D rdists;
=20
 	lpi_prop_prio =3D irq_prio;
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 76253e864f23..bca8053864b2 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -66,6 +66,87 @@ static struct gic_all_vpes_chip_data {
 	bool	mask;
 } gic_all_vpes_chip_data[GIC_NUM_LOCAL_INTRS];
=20
+static int __gic_with_next_online_cpu(int prev)
+{
+	unsigned int cpu;
+
+	/* Discover the next online CPU */
+	cpu =3D cpumask_next(prev, cpu_online_mask);
+
+	/* If there isn't one, we're done */
+	if (cpu >=3D nr_cpu_ids)
+		return cpu;
+
+	/*
+	 * Move the access lock to the next CPU's GIC local register block.
+	 *
+	 * Set GIC_VL_OTHER. Since the caller holds gic_lock nothing can
+	 * clobber the written value.
+	 */
+	write_gic_vl_other(mips_cm_vp_id(cpu));
+
+	return cpu;
+}
+
+static inline void gic_unlock_cluster(void)
+{
+	if (mips_cps_multicluster_cpus())
+		mips_cm_unlock_other();
+}
+
+/**
+ * for_each_online_cpu_gic() - Iterate over online CPUs, access local regist=
ers
+ * @cpu: An integer variable to hold the current CPU number
+ * @gic_lock: A pointer to raw spin lock used as a guard
+ *
+ * Iterate over online CPUs & configure the other/redirect register region to
+ * access each CPUs GIC local register block, which can be accessed from the
+ * loop body using read_gic_vo_*() or write_gic_vo_*() accessor functions or
+ * their derivatives.
+ */
+#define for_each_online_cpu_gic(cpu, gic_lock)		\
+	guard(raw_spinlock_irqsave)(gic_lock);		\
+	for ((cpu) =3D __gic_with_next_online_cpu(-1);	\
+	     (cpu) < nr_cpu_ids;			\
+	     gic_unlock_cluster(),			\
+	     (cpu) =3D __gic_with_next_online_cpu(cpu))
+
+/**
+ * gic_irq_lock_cluster() - Lock redirect block access to IRQ's cluster
+ * @d: struct irq_data corresponding to the interrupt we're interested in
+ *
+ * Locks redirect register block access to the global register block of the =
GIC
+ * within the remote cluster that the IRQ corresponding to @d is affine to,
+ * returning true when this redirect block setup & locking has been performe=
d.
+ *
+ * If @d is affine to the local cluster then no locking is performed and this
+ * function will return false, indicating to the caller that it should access
+ * the local clusters registers without the overhead of indirection through =
the
+ * redirect block.
+ *
+ * In summary, if this function returns true then the caller should access G=
IC
+ * registers using redirect register block accessors & then call
+ * mips_cm_unlock_other() when done. If this function returns false then the
+ * caller should trivially access GIC registers in the local cluster.
+ *
+ * Returns true if locking performed, else false.
+ */
+static bool gic_irq_lock_cluster(struct irq_data *d)
+{
+	unsigned int cpu, cl;
+
+	cpu =3D cpumask_first(irq_data_get_effective_affinity_mask(d));
+	BUG_ON(cpu >=3D NR_CPUS);
+
+	cl =3D cpu_cluster(&cpu_data[cpu]);
+	if (cl =3D=3D cpu_cluster(&current_cpu_data))
+		return false;
+	if (mips_cps_numcores(cl) =3D=3D 0)
+		return false;
+	mips_cm_lock_other(cl, 0, 0, CM_GCR_Cx_OTHER_BLOCK_GLOBAL);
+	return true;
+}
+
 static void gic_clear_pcpu_masks(unsigned int intr)
 {
 	unsigned int i;
@@ -112,7 +193,12 @@ static void gic_send_ipi(struct irq_data *d, unsigned in=
t cpu)
 {
 	irq_hw_number_t hwirq =3D GIC_HWIRQ_TO_SHARED(irqd_to_hwirq(d));
=20
-	write_gic_wedge(GIC_WEDGE_RW | hwirq);
+	if (gic_irq_lock_cluster(d)) {
+		write_gic_redir_wedge(GIC_WEDGE_RW | hwirq);
+		mips_cm_unlock_other();
+	} else {
+		write_gic_wedge(GIC_WEDGE_RW | hwirq);
+	}
 }
=20
 int gic_get_c0_compare_int(void)
@@ -180,7 +266,13 @@ static void gic_mask_irq(struct irq_data *d)
 {
 	unsigned int intr =3D GIC_HWIRQ_TO_SHARED(d->hwirq);
=20
-	write_gic_rmask(intr);
+	if (gic_irq_lock_cluster(d)) {
+		write_gic_redir_rmask(intr);
+		mips_cm_unlock_other();
+	} else {
+		write_gic_rmask(intr);
+	}
+
 	gic_clear_pcpu_masks(intr);
 }
=20
@@ -189,7 +281,12 @@ static void gic_unmask_irq(struct irq_data *d)
 	unsigned int intr =3D GIC_HWIRQ_TO_SHARED(d->hwirq);
 	unsigned int cpu;
=20
-	write_gic_smask(intr);
+	if (gic_irq_lock_cluster(d)) {
+		write_gic_redir_smask(intr);
+		mips_cm_unlock_other();
+	} else {
+		write_gic_smask(intr);
+	}
=20
 	gic_clear_pcpu_masks(intr);
 	cpu =3D cpumask_first(irq_data_get_effective_affinity_mask(d));
@@ -200,7 +297,12 @@ static void gic_ack_irq(struct irq_data *d)
 {
 	unsigned int irq =3D GIC_HWIRQ_TO_SHARED(d->hwirq);
=20
-	write_gic_wedge(irq);
+	if (gic_irq_lock_cluster(d)) {
+		write_gic_redir_wedge(irq);
+		mips_cm_unlock_other();
+	} else {
+		write_gic_wedge(irq);
+	}
 }
=20
 static int gic_set_type(struct irq_data *d, unsigned int type)
@@ -240,9 +342,16 @@ static int gic_set_type(struct irq_data *d, unsigned int=
 type)
 		break;
 	}
=20
-	change_gic_pol(irq, pol);
-	change_gic_trig(irq, trig);
-	change_gic_dual(irq, dual);
+	if (gic_irq_lock_cluster(d)) {
+		change_gic_redir_pol(irq, pol);
+		change_gic_redir_trig(irq, trig);
+		change_gic_redir_dual(irq, dual);
+		mips_cm_unlock_other();
+	} else {
+		change_gic_pol(irq, pol);
+		change_gic_trig(irq, trig);
+		change_gic_dual(irq, dual);
+	}
=20
 	if (trig =3D=3D GIC_TRIG_EDGE)
 		irq_set_chip_handler_name_locked(d, &gic_edge_irq_controller,
@@ -260,25 +369,72 @@ static int gic_set_affinity(struct irq_data *d, const s=
truct cpumask *cpumask,
 			    bool force)
 {
 	unsigned int irq =3D GIC_HWIRQ_TO_SHARED(d->hwirq);
+	unsigned int cpu, cl, old_cpu, old_cl;
 	unsigned long flags;
-	unsigned int cpu;
=20
+	/*
+	 * The GIC specifies that we can only route an interrupt to one VP(E),
+	 * ie. CPU in Linux parlance, at a time. Therefore we always route to
+	 * the first online CPU in the mask.
+	 */
 	cpu =3D cpumask_first_and(cpumask, cpu_online_mask);
 	if (cpu >=3D NR_CPUS)
 		return -EINVAL;
=20
-	/* Assumption : cpumask refers to a single CPU */
-	raw_spin_lock_irqsave(&gic_lock, flags);
+	old_cpu =3D cpumask_first(irq_data_get_effective_affinity_mask(d));
+	old_cl =3D cpu_cluster(&cpu_data[old_cpu]);
+	cl =3D cpu_cluster(&cpu_data[cpu]);
=20
-	/* Re-route this IRQ */
-	write_gic_map_vp(irq, BIT(mips_cm_vp_id(cpu)));
+	raw_spin_lock_irqsave(&gic_lock, flags);
=20
-	/* Update the pcpu_masks */
-	gic_clear_pcpu_masks(irq);
-	if (read_gic_mask(irq))
-		set_bit(irq, per_cpu_ptr(pcpu_masks, cpu));
+	/*
+	 * If we're moving affinity between clusters, stop routing the
+	 * interrupt to any VP(E) in the old cluster.
+	 */
+	if (cl !=3D old_cl) {
+		if (gic_irq_lock_cluster(d)) {
+			write_gic_redir_map_vp(irq, 0);
+			mips_cm_unlock_other();
+		} else {
+			write_gic_map_vp(irq, 0);
+		}
+	}
=20
+	/*
+	 * Update effective affinity - after this gic_irq_lock_cluster() will
+	 * begin operating on the new cluster.
+	 */
 	irq_data_update_effective_affinity(d, cpumask_of(cpu));
+
+	/*
+	 * If we're moving affinity between clusters, configure the interrupt
+	 * trigger type in the new cluster.
+	 */
+	if (cl !=3D old_cl)
+		gic_set_type(d, irqd_get_trigger_type(d));
+
+	/* Route the interrupt to its new VP(E) */
+	if (gic_irq_lock_cluster(d)) {
+		write_gic_redir_map_pin(irq,
+					GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin);
+		write_gic_redir_map_vp(irq, BIT(mips_cm_vp_id(cpu)));
+
+		/* Update the pcpu_masks */
+		gic_clear_pcpu_masks(irq);
+		if (read_gic_redir_mask(irq))
+			set_bit(irq, per_cpu_ptr(pcpu_masks, cpu));
+
+		mips_cm_unlock_other();
+	} else {
+		write_gic_map_pin(irq, GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin);
+		write_gic_map_vp(irq, BIT(mips_cm_vp_id(cpu)));
+
+		/* Update the pcpu_masks */
+		gic_clear_pcpu_masks(irq);
+		if (read_gic_mask(irq))
+			set_bit(irq, per_cpu_ptr(pcpu_masks, cpu));
+	}
+
 	raw_spin_unlock_irqrestore(&gic_lock, flags);
=20
 	return IRQ_SET_MASK_OK;
@@ -350,37 +506,33 @@ static struct irq_chip gic_local_irq_controller =3D {
 static void gic_mask_local_irq_all_vpes(struct irq_data *d)
 {
 	struct gic_all_vpes_chip_data *cd;
-	unsigned long flags;
 	int intr, cpu;
=20
+	if (!mips_cps_multicluster_cpus())
+		return;
+
 	intr =3D GIC_HWIRQ_TO_LOCAL(d->hwirq);
 	cd =3D irq_data_get_irq_chip_data(d);
 	cd->mask =3D false;
=20
-	raw_spin_lock_irqsave(&gic_lock, flags);
-	for_each_online_cpu(cpu) {
-		write_gic_vl_other(mips_cm_vp_id(cpu));
+	for_each_online_cpu_gic(cpu, &gic_lock)
 		write_gic_vo_rmask(BIT(intr));
-	}
-	raw_spin_unlock_irqrestore(&gic_lock, flags);
 }
=20
 static void gic_unmask_local_irq_all_vpes(struct irq_data *d)
 {
 	struct gic_all_vpes_chip_data *cd;
-	unsigned long flags;
 	int intr, cpu;
=20
+	if (!mips_cps_multicluster_cpus())
+		return;
+
 	intr =3D GIC_HWIRQ_TO_LOCAL(d->hwirq);
 	cd =3D irq_data_get_irq_chip_data(d);
 	cd->mask =3D true;
=20
-	raw_spin_lock_irqsave(&gic_lock, flags);
-	for_each_online_cpu(cpu) {
-		write_gic_vl_other(mips_cm_vp_id(cpu));
+	for_each_online_cpu_gic(cpu, &gic_lock)
 		write_gic_vo_smask(BIT(intr));
-	}
-	raw_spin_unlock_irqrestore(&gic_lock, flags);
 }
=20
 static void gic_all_vpes_irq_cpu_online(void)
@@ -436,11 +588,21 @@ static int gic_shared_irq_domain_map(struct irq_domain =
*d, unsigned int virq,
 	unsigned long flags;
=20
 	data =3D irq_get_irq_data(virq);
+	irq_data_update_effective_affinity(data, cpumask_of(cpu));
=20
 	raw_spin_lock_irqsave(&gic_lock, flags);
-	write_gic_map_pin(intr, GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin);
-	write_gic_map_vp(intr, BIT(mips_cm_vp_id(cpu)));
-	irq_data_update_effective_affinity(data, cpumask_of(cpu));
+
+	/* Route the interrupt to its VP(E) */
+	if (gic_irq_lock_cluster(data)) {
+		write_gic_redir_map_pin(intr,
+					GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin);
+		write_gic_redir_map_vp(intr, BIT(mips_cm_vp_id(cpu)));
+		mips_cm_unlock_other();
+	} else {
+		write_gic_map_pin(intr, GIC_MAP_PIN_MAP_TO_PIN | gic_cpu_pin);
+		write_gic_map_vp(intr, BIT(mips_cm_vp_id(cpu)));
+	}
+
 	raw_spin_unlock_irqrestore(&gic_lock, flags);
=20
 	return 0;
@@ -469,7 +631,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsig=
ned int virq,
 			      irq_hw_number_t hwirq)
 {
 	struct gic_all_vpes_chip_data *cd;
-	unsigned long flags;
 	unsigned int intr;
 	int err, cpu;
 	u32 map;
@@ -533,12 +694,10 @@ static int gic_irq_domain_map(struct irq_domain *d, uns=
igned int virq,
 	if (!gic_local_irq_is_routable(intr))
 		return -EPERM;
=20
-	raw_spin_lock_irqsave(&gic_lock, flags);
-	for_each_online_cpu(cpu) {
-		write_gic_vl_other(mips_cm_vp_id(cpu));
-		write_gic_vo_map(mips_gic_vx_map_reg(intr), map);
+	if (mips_cps_multicluster_cpus()) {
+		for_each_online_cpu_gic(cpu, &gic_lock)
+			write_gic_vo_map(mips_gic_vx_map_reg(intr), map);
 	}
-	raw_spin_unlock_irqrestore(&gic_lock, flags);
=20
 	return 0;
 }
@@ -621,6 +780,9 @@ static int gic_ipi_domain_alloc(struct irq_domain *d, uns=
igned int virq,
 		if (ret)
 			goto error;
=20
+		/* Set affinity to cpu.  */
+		irq_data_update_effective_affinity(irq_get_irq_data(virq + i),
+						   cpumask_of(cpu));
 		ret =3D irq_set_irq_type(virq + i, IRQ_TYPE_EDGE_RISING);
 		if (ret)
 			goto error;
@@ -734,7 +896,7 @@ static int gic_cpu_startup(unsigned int cpu)
 static int __init gic_of_init(struct device_node *node,
 			      struct device_node *parent)
 {
-	unsigned int cpu_vec, i, gicconfig;
+	unsigned int cpu_vec, i, gicconfig, cl, nclusters;
 	unsigned long reserved;
 	phys_addr_t gic_base;
 	struct resource res;
@@ -815,11 +977,32 @@ static int __init gic_of_init(struct device_node *node,
=20
 	board_bind_eic_interrupt =3D &gic_bind_eic_interrupt;
=20
-	/* Setup defaults */
-	for (i =3D 0; i < gic_shared_intrs; i++) {
-		change_gic_pol(i, GIC_POL_ACTIVE_HIGH);
-		change_gic_trig(i, GIC_TRIG_LEVEL);
-		write_gic_rmask(i);
+	/*
+	 * Initialise each cluster's GIC shared registers to sane default
+	 * values.
+	 * Otherwise, the IPI set up will be erased if we move code
+	 * to gic_cpu_startup for each cpu.
+	 */
+	nclusters =3D mips_cps_numclusters();
+	for (cl =3D 0; cl < nclusters; cl++) {
+		if (cl =3D=3D cpu_cluster(&current_cpu_data)) {
+			for (i =3D 0; i < gic_shared_intrs; i++) {
+				change_gic_pol(i, GIC_POL_ACTIVE_HIGH);
+				change_gic_trig(i, GIC_TRIG_LEVEL);
+				write_gic_rmask(i);
+			}
+		} else if (mips_cps_numcores(cl) !=3D 0) {
+			mips_cm_lock_other(cl, 0, 0, CM_GCR_Cx_OTHER_BLOCK_GLOBAL);
+			for (i =3D 0; i < gic_shared_intrs; i++) {
+				change_gic_redir_pol(i, GIC_POL_ACTIVE_HIGH);
+				change_gic_redir_trig(i, GIC_TRIG_LEVEL);
+				write_gic_redir_rmask(i);
+			}
+			mips_cm_unlock_other();
+
+		} else {
+			pr_warn("No CPU cores on the cluster %d skip it\n", cl);
+		}
 	}
=20
 	return cpuhp_setup_state(CPUHP_AP_IRQ_MIPS_GIC_STARTING,
diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesa=
s-rzv2h.c
new file mode 100644
index 000000000000..fe2d29e91026
--- /dev/null
+++ b/drivers/irqchip/irq-renesas-rzv2h.c
@@ -0,0 +1,513 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Renesas RZ/V2H(P) ICU Driver
+ *
+ * Based on irq-renesas-rzg2l.c
+ *
+ * Copyright (C) 2024 Renesas Electronics Corporation.
+ *
+ * Author: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/cleanup.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/irqchip.h>
+#include <linux/irqdomain.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/pm_runtime.h>
+#include <linux/reset.h>
+#include <linux/spinlock.h>
+#include <linux/syscore_ops.h>
+
+/* DT "interrupts" indexes */
+#define ICU_IRQ_START				1
+#define ICU_IRQ_COUNT				16
+#define ICU_TINT_START				(ICU_IRQ_START + ICU_IRQ_COUNT)
+#define ICU_TINT_COUNT				32
+#define ICU_NUM_IRQ				(ICU_TINT_START + ICU_TINT_COUNT)
+
+/* Registers */
+#define ICU_NSCNT				0x00
+#define ICU_NSCLR				0x04
+#define ICU_NITSR				0x08
+#define ICU_ISCTR				0x10
+#define ICU_ISCLR				0x14
+#define ICU_IITSR				0x18
+#define ICU_TSCTR				0x20
+#define ICU_TSCLR				0x24
+#define ICU_TITSR(k)				(0x28 + (k) * 4)
+#define ICU_TSSR(k)				(0x30 + (k) * 4)
+
+/* NMI */
+#define ICU_NMI_EDGE_FALLING			0
+#define ICU_NMI_EDGE_RISING			1
+
+#define ICU_NSCLR_NCLR				BIT(0)
+
+/* IRQ */
+#define ICU_IRQ_LEVEL_LOW			0
+#define ICU_IRQ_EDGE_FALLING			1
+#define ICU_IRQ_EDGE_RISING			2
+#define ICU_IRQ_EDGE_BOTH			3
+
+#define ICU_IITSR_IITSEL_PREP(iitsel, n)	((iitsel) << ((n) * 2))
+#define ICU_IITSR_IITSEL_GET(iitsr, n)		(((iitsr) >> ((n) * 2)) & 0x03)
+#define ICU_IITSR_IITSEL_MASK(n)		ICU_IITSR_IITSEL_PREP(0x03, n)
+
+/* TINT */
+#define ICU_TINT_EDGE_RISING			0
+#define ICU_TINT_EDGE_FALLING			1
+#define ICU_TINT_LEVEL_HIGH			2
+#define ICU_TINT_LEVEL_LOW			3
+
+#define ICU_TSSR_K(tint_nr)			((tint_nr) / 4)
+#define ICU_TSSR_TSSEL_N(tint_nr)		((tint_nr) % 4)
+#define ICU_TSSR_TSSEL_PREP(tssel, n)		((tssel) << ((n) * 8))
+#define ICU_TSSR_TSSEL_MASK(n)			ICU_TSSR_TSSEL_PREP(0x7F, n)
+#define ICU_TSSR_TIEN(n)			(BIT(7) << ((n) * 8))
+
+#define ICU_TITSR_K(tint_nr)			((tint_nr) / 16)
+#define ICU_TITSR_TITSEL_N(tint_nr)		((tint_nr) % 16)
+#define ICU_TITSR_TITSEL_PREP(titsel, n)	ICU_IITSR_IITSEL_PREP(titsel, n)
+#define ICU_TITSR_TITSEL_MASK(n)		ICU_IITSR_IITSEL_MASK(n)
+#define ICU_TITSR_TITSEL_GET(titsr, n)		ICU_IITSR_IITSEL_GET(titsr, n)
+
+#define ICU_TINT_EXTRACT_HWIRQ(x)		FIELD_GET(GENMASK(15, 0), (x))
+#define ICU_TINT_EXTRACT_GPIOINT(x)		FIELD_GET(GENMASK(31, 16), (x))
+#define ICU_PB5_TINT				0x55
+
+/**
+ * struct rzv2h_icu_priv - Interrupt Control Unit controller private data st=
ructure.
+ * @base:	Controller's base address
+ * @irqchip:	Pointer to struct irq_chip
+ * @fwspec:	IRQ firmware specific data
+ * @lock:	Lock to serialize access to hardware registers
+ */
+struct rzv2h_icu_priv {
+	void __iomem			*base;
+	const struct irq_chip		*irqchip;
+	struct irq_fwspec		fwspec[ICU_NUM_IRQ];
+	raw_spinlock_t			lock;
+};
+
+static inline struct rzv2h_icu_priv *irq_data_to_priv(struct irq_data *data)
+{
+	return data->domain->host_data;
+}
+
+static void rzv2h_icu_eoi(struct irq_data *d)
+{
+	struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d);
+	unsigned int hw_irq =3D irqd_to_hwirq(d);
+	unsigned int tintirq_nr;
+	u32 bit;
+
+	scoped_guard(raw_spinlock, &priv->lock) {
+		if (hw_irq >=3D ICU_TINT_START) {
+			tintirq_nr =3D hw_irq - ICU_TINT_START;
+			bit =3D BIT(tintirq_nr);
+			if (!irqd_is_level_type(d))
+				writel_relaxed(bit, priv->base + ICU_TSCLR);
+		} else if (hw_irq >=3D ICU_IRQ_START) {
+			tintirq_nr =3D hw_irq - ICU_IRQ_START;
+			bit =3D BIT(tintirq_nr);
+			if (!irqd_is_level_type(d))
+				writel_relaxed(bit, priv->base + ICU_ISCLR);
+		} else {
+			writel_relaxed(ICU_NSCLR_NCLR, priv->base + ICU_NSCLR);
+		}
+	}
+
+	irq_chip_eoi_parent(d);
+}
+
+static void rzv2h_tint_irq_endisable(struct irq_data *d, bool enable)
+{
+	struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d);
+	unsigned int hw_irq =3D irqd_to_hwirq(d);
+	u32 tint_nr, tssel_n, k, tssr;
+
+	if (hw_irq < ICU_TINT_START)
+		return;
+
+	tint_nr =3D hw_irq - ICU_TINT_START;
+	k =3D ICU_TSSR_K(tint_nr);
+	tssel_n =3D ICU_TSSR_TSSEL_N(tint_nr);
+
+	guard(raw_spinlock)(&priv->lock);
+	tssr =3D readl_relaxed(priv->base + ICU_TSSR(k));
+	if (enable)
+		tssr |=3D ICU_TSSR_TIEN(tssel_n);
+	else
+		tssr &=3D ~ICU_TSSR_TIEN(tssel_n);
+	writel_relaxed(tssr, priv->base + ICU_TSSR(k));
+}
+
+static void rzv2h_icu_irq_disable(struct irq_data *d)
+{
+	irq_chip_disable_parent(d);
+	rzv2h_tint_irq_endisable(d, false);
+}
+
+static void rzv2h_icu_irq_enable(struct irq_data *d)
+{
+	rzv2h_tint_irq_endisable(d, true);
+	irq_chip_enable_parent(d);
+}
+
+static int rzv2h_nmi_set_type(struct irq_data *d, unsigned int type)
+{
+	struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d);
+	u32 sense;
+
+	switch (type & IRQ_TYPE_SENSE_MASK) {
+	case IRQ_TYPE_EDGE_FALLING:
+		sense =3D ICU_NMI_EDGE_FALLING;
+		break;
+
+	case IRQ_TYPE_EDGE_RISING:
+		sense =3D ICU_NMI_EDGE_RISING;
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	writel_relaxed(sense, priv->base + ICU_NITSR);
+
+	return 0;
+}
+
+static void rzv2h_clear_irq_int(struct rzv2h_icu_priv *priv, unsigned int hw=
irq)
+{
+	unsigned int irq_nr =3D hwirq - ICU_IRQ_START;
+	u32 isctr, iitsr, iitsel;
+	u32 bit =3D BIT(irq_nr);
+
+	isctr =3D readl_relaxed(priv->base + ICU_ISCTR);
+	iitsr =3D readl_relaxed(priv->base + ICU_IITSR);
+	iitsel =3D ICU_IITSR_IITSEL_GET(iitsr, irq_nr);
+
+	/*
+	 * When level sensing is used, the interrupt flag gets automatically cleare=
d when the
+	 * interrupt signal is de-asserted by the source of the interrupt request, =
therefore clear
+	 * the interrupt only for edge triggered interrupts.
+	 */
+	if ((isctr & bit) && (iitsel !=3D ICU_IRQ_LEVEL_LOW))
+		writel_relaxed(bit, priv->base + ICU_ISCLR);
+}
+
+static int rzv2h_irq_set_type(struct irq_data *d, unsigned int type)
+{
+	struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d);
+	unsigned int hwirq =3D irqd_to_hwirq(d);
+	u32 irq_nr =3D hwirq - ICU_IRQ_START;
+	u32 iitsr, sense;
+
+	switch (type & IRQ_TYPE_SENSE_MASK) {
+	case IRQ_TYPE_LEVEL_LOW:
+		sense =3D ICU_IRQ_LEVEL_LOW;
+		break;
+
+	case IRQ_TYPE_EDGE_FALLING:
+		sense =3D ICU_IRQ_EDGE_FALLING;
+		break;
+
+	case IRQ_TYPE_EDGE_RISING:
+		sense =3D ICU_IRQ_EDGE_RISING;
+		break;
+
+	case IRQ_TYPE_EDGE_BOTH:
+		sense =3D ICU_IRQ_EDGE_BOTH;
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	guard(raw_spinlock)(&priv->lock);
+	iitsr =3D readl_relaxed(priv->base + ICU_IITSR);
+	iitsr &=3D ~ICU_IITSR_IITSEL_MASK(irq_nr);
+	iitsr |=3D ICU_IITSR_IITSEL_PREP(sense, irq_nr);
+	rzv2h_clear_irq_int(priv, hwirq);
+	writel_relaxed(iitsr, priv->base + ICU_IITSR);
+
+	return 0;
+}
+
+static void rzv2h_clear_tint_int(struct rzv2h_icu_priv *priv, unsigned int h=
wirq)
+{
+	unsigned int tint_nr =3D hwirq - ICU_TINT_START;
+	int titsel_n =3D ICU_TITSR_TITSEL_N(tint_nr);
+	u32 tsctr, titsr, titsel;
+	u32 bit =3D BIT(tint_nr);
+	int k =3D tint_nr / 16;
+
+	tsctr =3D readl_relaxed(priv->base + ICU_TSCTR);
+	titsr =3D readl_relaxed(priv->base + ICU_TITSR(k));
+	titsel =3D ICU_TITSR_TITSEL_GET(titsr, titsel_n);
+
+	/*
+	 * Writing 1 to the corresponding flag from register ICU_TSCTR only has eff=
ect if
+	 * TSTATn =3D 1b and if it's a rising edge or a falling edge interrupt.
+	 */
+	if ((tsctr & bit) && ((titsel =3D=3D ICU_TINT_EDGE_RISING) ||
+			      (titsel =3D=3D ICU_TINT_EDGE_FALLING)))
+		writel_relaxed(bit, priv->base + ICU_TSCLR);
+}
+
+static int rzv2h_tint_set_type(struct irq_data *d, unsigned int type)
+{
+	u32 titsr, titsr_k, titsel_n, tien;
+	struct rzv2h_icu_priv *priv;
+	u32 tssr, tssr_k, tssel_n;
+	unsigned int hwirq;
+	u32 tint, sense;
+	int tint_nr;
+
+	switch (type & IRQ_TYPE_SENSE_MASK) {
+	case IRQ_TYPE_LEVEL_LOW:
+		sense =3D ICU_TINT_LEVEL_LOW;
+		break;
+
+	case IRQ_TYPE_LEVEL_HIGH:
+		sense =3D ICU_TINT_LEVEL_HIGH;
+		break;
+
+	case IRQ_TYPE_EDGE_RISING:
+		sense =3D ICU_TINT_EDGE_RISING;
+		break;
+
+	case IRQ_TYPE_EDGE_FALLING:
+		sense =3D ICU_TINT_EDGE_FALLING;
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	tint =3D (u32)(uintptr_t)irq_data_get_irq_chip_data(d);
+	if (tint > ICU_PB5_TINT)
+		return -EINVAL;
+
+	priv =3D irq_data_to_priv(d);
+	hwirq =3D irqd_to_hwirq(d);
+
+	tint_nr =3D hwirq - ICU_TINT_START;
+
+	tssr_k =3D ICU_TSSR_K(tint_nr);
+	tssel_n =3D ICU_TSSR_TSSEL_N(tint_nr);
+
+	titsr_k =3D ICU_TITSR_K(tint_nr);
+	titsel_n =3D ICU_TITSR_TITSEL_N(tint_nr);
+	tien =3D ICU_TSSR_TIEN(titsel_n);
+
+	guard(raw_spinlock)(&priv->lock);
+
+	tssr =3D readl_relaxed(priv->base + ICU_TSSR(tssr_k));
+	tssr &=3D ~(ICU_TSSR_TSSEL_MASK(tssel_n) | tien);
+	tssr |=3D ICU_TSSR_TSSEL_PREP(tint, tssel_n);
+
+	writel_relaxed(tssr, priv->base + ICU_TSSR(tssr_k));
+
+	titsr =3D readl_relaxed(priv->base + ICU_TITSR(titsr_k));
+	titsr &=3D ~ICU_TITSR_TITSEL_MASK(titsel_n);
+	titsr |=3D ICU_TITSR_TITSEL_PREP(sense, titsel_n);
+
+	writel_relaxed(titsr, priv->base + ICU_TITSR(titsr_k));
+
+	rzv2h_clear_tint_int(priv, hwirq);
+
+	writel_relaxed(tssr | tien, priv->base + ICU_TSSR(tssr_k));
+
+	return 0;
+}
+
+static int rzv2h_icu_set_type(struct irq_data *d, unsigned int type)
+{
+	unsigned int hw_irq =3D irqd_to_hwirq(d);
+	int ret;
+
+	if (hw_irq >=3D ICU_TINT_START)
+		ret =3D rzv2h_tint_set_type(d, type);
+	else if (hw_irq >=3D ICU_IRQ_START)
+		ret =3D rzv2h_irq_set_type(d, type);
+	else
+		ret =3D rzv2h_nmi_set_type(d, type);
+
+	if (ret)
+		return ret;
+
+	return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH);
+}
+
+static const struct irq_chip rzv2h_icu_chip =3D {
+	.name			=3D "rzv2h-icu",
+	.irq_eoi		=3D rzv2h_icu_eoi,
+	.irq_mask		=3D irq_chip_mask_parent,
+	.irq_unmask		=3D irq_chip_unmask_parent,
+	.irq_disable		=3D rzv2h_icu_irq_disable,
+	.irq_enable		=3D rzv2h_icu_irq_enable,
+	.irq_get_irqchip_state	=3D irq_chip_get_parent_state,
+	.irq_set_irqchip_state	=3D irq_chip_set_parent_state,
+	.irq_retrigger		=3D irq_chip_retrigger_hierarchy,
+	.irq_set_type		=3D rzv2h_icu_set_type,
+	.irq_set_affinity	=3D irq_chip_set_affinity_parent,
+	.flags			=3D IRQCHIP_SET_TYPE_MASKED,
+};
+
+static int rzv2h_icu_alloc(struct irq_domain *domain, unsigned int virq, uns=
igned int nr_irqs,
+			   void *arg)
+{
+	struct rzv2h_icu_priv *priv =3D domain->host_data;
+	unsigned long tint =3D 0;
+	irq_hw_number_t hwirq;
+	unsigned int type;
+	int ret;
+
+	ret =3D irq_domain_translate_twocell(domain, arg, &hwirq, &type);
+	if (ret)
+		return ret;
+
+	/*
+	 * For TINT interrupts the hwirq and TINT are encoded in
+	 * fwspec->param[0].
+	 * hwirq is embedded in bits 0-15.
+	 * TINT is embedded in bits 16-31.
+	 */
+	if (hwirq >=3D ICU_TINT_START) {
+		tint =3D ICU_TINT_EXTRACT_GPIOINT(hwirq);
+		hwirq =3D ICU_TINT_EXTRACT_HWIRQ(hwirq);
+
+		if (hwirq < ICU_TINT_START)
+			return -EINVAL;
+	}
+
+	if (hwirq > (ICU_NUM_IRQ - 1))
+		return -EINVAL;
+
+	ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, priv->irqchip,
+					    (void *)(uintptr_t)tint);
+	if (ret)
+		return ret;
+
+	return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &priv->fwspec[hw=
irq]);
+}
+
+static const struct irq_domain_ops rzv2h_icu_domain_ops =3D {
+	.alloc		=3D rzv2h_icu_alloc,
+	.free		=3D irq_domain_free_irqs_common,
+	.translate	=3D irq_domain_translate_twocell,
+};
+
+static int rzv2h_icu_parse_interrupts(struct rzv2h_icu_priv *priv, struct de=
vice_node *np)
+{
+	struct of_phandle_args map;
+	unsigned int i;
+	int ret;
+
+	for (i =3D 0; i < ICU_NUM_IRQ; i++) {
+		ret =3D of_irq_parse_one(np, i, &map);
+		if (ret)
+			return ret;
+
+		of_phandle_args_to_fwspec(np, map.args, map.args_count, &priv->fwspec[i]);
+	}
+
+	return 0;
+}
+
+static int rzv2h_icu_init(struct device_node *node, struct device_node *pare=
nt)
+{
+	struct irq_domain *irq_domain, *parent_domain;
+	struct rzv2h_icu_priv *rzv2h_icu_data;
+	struct platform_device *pdev;
+	struct reset_control *resetn;
+	int ret;
+
+	pdev =3D of_find_device_by_node(node);
+	if (!pdev)
+		return -ENODEV;
+
+	parent_domain =3D irq_find_host(parent);
+	if (!parent_domain) {
+		dev_err(&pdev->dev, "cannot find parent domain\n");
+		ret =3D -ENODEV;
+		goto put_dev;
+	}
+
+	rzv2h_icu_data =3D devm_kzalloc(&pdev->dev, sizeof(*rzv2h_icu_data), GFP_KE=
RNEL);
+	if (!rzv2h_icu_data) {
+		ret =3D -ENOMEM;
+		goto put_dev;
+	}
+
+	rzv2h_icu_data->irqchip =3D &rzv2h_icu_chip;
+
+	rzv2h_icu_data->base =3D devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NU=
LL);
+	if (IS_ERR(rzv2h_icu_data->base)) {
+		ret =3D PTR_ERR(rzv2h_icu_data->base);
+		goto put_dev;
+	}
+
+	ret =3D rzv2h_icu_parse_interrupts(rzv2h_icu_data, node);
+	if (ret) {
+		dev_err(&pdev->dev, "cannot parse interrupts: %d\n", ret);
+		goto put_dev;
+	}
+
+	resetn =3D devm_reset_control_get_exclusive(&pdev->dev, NULL);
+	if (IS_ERR(resetn)) {
+		ret =3D PTR_ERR(resetn);
+		goto put_dev;
+	}
+
+	ret =3D reset_control_deassert(resetn);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to deassert resetn pin, %d\n", ret);
+		goto put_dev;
+	}
+
+	pm_runtime_enable(&pdev->dev);
+	ret =3D pm_runtime_resume_and_get(&pdev->dev);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "pm_runtime_resume_and_get failed: %d\n", ret);
+		goto pm_disable;
+	}
+
+	raw_spin_lock_init(&rzv2h_icu_data->lock);
+
+	irq_domain =3D irq_domain_add_hierarchy(parent_domain, 0, ICU_NUM_IRQ, node,
+					      &rzv2h_icu_domain_ops, rzv2h_icu_data);
+	if (!irq_domain) {
+		dev_err(&pdev->dev, "failed to add irq domain\n");
+		ret =3D -ENOMEM;
+		goto pm_put;
+	}
+
+	/*
+	 * coccicheck complains about a missing put_device call before returning, b=
ut it's a false
+	 * positive. We still need &pdev->dev after successfully returning from thi=
s function.
+	 */
+	return 0;
+
+pm_put:
+	pm_runtime_put(&pdev->dev);
+pm_disable:
+	pm_runtime_disable(&pdev->dev);
+	reset_control_assert(resetn);
+put_dev:
+	put_device(&pdev->dev);
+
+	return ret;
+}
+
+IRQCHIP_PLATFORM_DRIVER_BEGIN(rzv2h_icu)
+IRQCHIP_MATCH("renesas,r9a09g057-icu", rzv2h_icu_init)
+IRQCHIP_PLATFORM_DRIVER_END(rzv2h_icu)
+MODULE_AUTHOR("Fabrizio Castro <fabrizio.castro.jz@renesas.com>");
+MODULE_DESCRIPTION("Renesas RZ/V2H(P) ICU Driver");
diff --git a/drivers/irqchip/irq-riscv-aplic-main.c b/drivers/irqchip/irq-ris=
cv-aplic-main.c
index 900e72541db9..93e7c51f944a 100644
--- a/drivers/irqchip/irq-riscv-aplic-main.c
+++ b/drivers/irqchip/irq-riscv-aplic-main.c
@@ -207,7 +207,8 @@ static int aplic_probe(struct platform_device *pdev)
 	else
 		rc =3D aplic_direct_setup(dev, regs);
 	if (rc)
-		dev_err(dev, "failed to setup APLIC in %s mode\n", msi_mode ? "MSI" : "dir=
ect");
+		dev_err_probe(dev, rc, "failed to setup APLIC in %s mode\n",
+			      msi_mode ? "MSI" : "direct");
=20
 #ifdef CONFIG_ACPI
 	if (!acpi_disabled)
diff --git a/drivers/irqchip/irq-riscv-aplic-msi.c b/drivers/irqchip/irq-risc=
v-aplic-msi.c
index 945bff28265c..fb8d1838609f 100644
--- a/drivers/irqchip/irq-riscv-aplic-msi.c
+++ b/drivers/irqchip/irq-riscv-aplic-msi.c
@@ -266,6 +266,9 @@ int aplic_msi_setup(struct device *dev, void __iomem *reg=
s)
 			if (msi_domain)
 				dev_set_msi_domain(dev, msi_domain);
 		}
+
+		if (!dev_get_msi_domain(dev))
+			return -EPROBE_DEFER;
 	}
=20
 	if (!msi_create_device_irq_domain(dev, MSI_DEFAULT_DOMAIN, &aplic_msi_templ=
ate,
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-p=
lic.c
index 2f6ef5c495bd..a3b199dd16ef 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -251,11 +251,10 @@ static int plic_irq_suspend(void)
=20
 	priv =3D per_cpu_ptr(&plic_handlers, smp_processor_id())->priv;
=20
-	for (i =3D 0; i < priv->nr_irqs; i++)
-		if (readl(priv->regs + PRIORITY_BASE + i * PRIORITY_PER_ID))
-			__set_bit(i, priv->prio_save);
-		else
-			__clear_bit(i, priv->prio_save);
+	for (i =3D 0; i < priv->nr_irqs; i++) {
+		__assign_bit(i, priv->prio_save,
+			     readl(priv->regs + PRIORITY_BASE + i * PRIORITY_PER_ID));
+	}
=20
 	for_each_cpu(cpu, cpu_present_mask) {
 		struct plic_handler *handler =3D per_cpu_ptr(&plic_handlers, cpu);
diff --git a/drivers/irqchip/irq-stm32mp-exti.c b/drivers/irqchip/irq-stm32mp=
-exti.c
index 33e0cfdea654..cb83d6cc6113 100644
--- a/drivers/irqchip/irq-stm32mp-exti.c
+++ b/drivers/irqchip/irq-stm32mp-exti.c
@@ -696,8 +696,7 @@ static int stm32mp_exti_probe(struct platform_device *pde=
v)
 	if (ret)
 		return ret;
=20
-	if (of_property_read_bool(np, "interrupts-extended"))
-		host_data->dt_has_irqs_desc =3D true;
+	host_data->dt_has_irqs_desc =3D of_property_present(np, "interrupts-extende=
d");
=20
 	return 0;
 }
diff --git a/drivers/irqchip/irq-thead-c900-aclint-sswi.c b/drivers/irqchip/i=
rq-thead-c900-aclint-sswi.c
new file mode 100644
index 000000000000..b0e366ade427
--- /dev/null
+++ b/drivers/irqchip/irq-thead-c900-aclint-sswi.c
@@ -0,0 +1,176 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2024 Inochi Amaoto <inochiama@gmail.com>
+ */
+
+#define pr_fmt(fmt) "thead-c900-aclint-sswi: " fmt
+#include <linux/cpu.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/pci.h>
+#include <linux/spinlock.h>
+#include <linux/smp.h>
+#include <linux/string_choices.h>
+#include <asm/sbi.h>
+#include <asm/vendorid_list.h>
+
+#define THEAD_ACLINT_xSWI_REGISTER_SIZE		4
+
+#define THEAD_C9XX_CSR_SXSTATUS			0x5c0
+#define THEAD_C9XX_SXSTATUS_CLINTEE		BIT(17)
+
+static int sswi_ipi_virq __ro_after_init;
+static DEFINE_PER_CPU(void __iomem *, sswi_cpu_regs);
+
+static void thead_aclint_sswi_ipi_send(unsigned int cpu)
+{
+	writel_relaxed(0x1, per_cpu(sswi_cpu_regs, cpu));
+}
+
+static void thead_aclint_sswi_ipi_clear(void)
+{
+	writel_relaxed(0x0, this_cpu_read(sswi_cpu_regs));
+}
+
+static void thead_aclint_sswi_ipi_handle(struct irq_desc *desc)
+{
+	struct irq_chip *chip =3D irq_desc_get_chip(desc);
+
+	chained_irq_enter(chip, desc);
+
+	csr_clear(CSR_IP, IE_SIE);
+	thead_aclint_sswi_ipi_clear();
+
+	ipi_mux_process();
+
+	chained_irq_exit(chip, desc);
+}
+
+static int thead_aclint_sswi_starting_cpu(unsigned int cpu)
+{
+	enable_percpu_irq(sswi_ipi_virq, irq_get_trigger_type(sswi_ipi_virq));
+
+	return 0;
+}
+
+static int thead_aclint_sswi_dying_cpu(unsigned int cpu)
+{
+	thead_aclint_sswi_ipi_clear();
+
+	disable_percpu_irq(sswi_ipi_virq);
+
+	return 0;
+}
+
+static int __init thead_aclint_sswi_parse_irq(struct fwnode_handle *fwnode,
+					      void __iomem *reg)
+{
+	struct of_phandle_args parent;
+	unsigned long hartid;
+	u32 contexts, i;
+	int rc, cpu;
+
+	contexts =3D of_irq_count(to_of_node(fwnode));
+	if (!(contexts)) {
+		pr_err("%pfwP: no ACLINT SSWI context available\n", fwnode);
+		return -EINVAL;
+	}
+
+	for (i =3D 0; i < contexts; i++) {
+		rc =3D of_irq_parse_one(to_of_node(fwnode), i, &parent);
+		if (rc)
+			return rc;
+
+		rc =3D riscv_of_parent_hartid(parent.np, &hartid);
+		if (rc)
+			return rc;
+
+		if (parent.args[0] !=3D RV_IRQ_SOFT)
+			return -ENOTSUPP;
+
+		cpu =3D riscv_hartid_to_cpuid(hartid);
+
+		per_cpu(sswi_cpu_regs, cpu) =3D reg + i * THEAD_ACLINT_xSWI_REGISTER_SIZE;
+	}
+
+	pr_info("%pfwP: register %u CPU%s\n", fwnode, contexts, str_plural(contexts=
));
+
+	return 0;
+}
+
+static int __init thead_aclint_sswi_probe(struct fwnode_handle *fwnode)
+{
+	struct irq_domain *domain;
+	void __iomem *reg;
+	int virq, rc;
+
+	/* If it is T-HEAD CPU, check whether SSWI is enabled */
+	if (riscv_cached_mvendorid(0) =3D=3D THEAD_VENDOR_ID &&
+	    !(csr_read(THEAD_C9XX_CSR_SXSTATUS) & THEAD_C9XX_SXSTATUS_CLINTEE))
+		return -ENOTSUPP;
+
+	if (!is_of_node(fwnode))
+		return -EINVAL;
+
+	reg =3D of_iomap(to_of_node(fwnode), 0);
+	if (!reg)
+		return -ENOMEM;
+
+	/* Parse SSWI setting */
+	rc =3D thead_aclint_sswi_parse_irq(fwnode, reg);
+	if (rc < 0)
+		return rc;
+
+	/* If mulitple SSWI devices are present, do not register irq again */
+	if (sswi_ipi_virq)
+		return 0;
+
+	/* Find riscv intc domain and create IPI irq mapping */
+	domain =3D irq_find_matching_fwnode(riscv_get_intc_hwnode(), DOMAIN_BUS_ANY=
);
+	if (!domain) {
+		pr_err("%pfwP: Failed to find INTC domain\n", fwnode);
+		return -ENOENT;
+	}
+
+	sswi_ipi_virq =3D irq_create_mapping(domain, RV_IRQ_SOFT);
+	if (!sswi_ipi_virq) {
+		pr_err("unable to create ACLINT SSWI IRQ mapping\n");
+		return -ENOMEM;
+	}
+
+	/* Register SSWI irq and handler */
+	virq =3D ipi_mux_create(BITS_PER_BYTE, thead_aclint_sswi_ipi_send);
+	if (virq <=3D 0) {
+		pr_err("unable to create muxed IPIs\n");
+		irq_dispose_mapping(sswi_ipi_virq);
+		return virq < 0 ? virq : -ENOMEM;
+	}
+
+	irq_set_chained_handler(sswi_ipi_virq, thead_aclint_sswi_ipi_handle);
+
+	cpuhp_setup_state(CPUHP_AP_IRQ_THEAD_ACLINT_SSWI_STARTING,
+			  "irqchip/thead-aclint-sswi:starting",
+			  thead_aclint_sswi_starting_cpu,
+			  thead_aclint_sswi_dying_cpu);
+
+	riscv_ipi_set_virq_range(virq, BITS_PER_BYTE);
+
+	/* Announce that SSWI is providing IPIs */
+	pr_info("providing IPIs using THEAD ACLINT SSWI\n");
+
+	return 0;
+}
+
+static int __init thead_aclint_sswi_early_probe(struct device_node *node,
+						struct device_node *parent)
+{
+	return thead_aclint_sswi_probe(&node->fwnode);
+}
+IRQCHIP_DECLARE(thead_aclint_sswi, "thead,c900-aclint-sswi", thead_aclint_ss=
wi_early_probe);
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c=
59x.c
index 082388bb6169..790270912913 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1302,7 +1302,7 @@ static int vortex_probe1(struct device *gendev, void __=
iomem *ioaddr, int irq,
 	if (print_info)
 		pr_cont(", IRQ %d\n", dev->irq);
 	/* Tell them about an invalid IRQ. */
-	if (dev->irq <=3D 0 || dev->irq >=3D nr_irqs)
+	if (dev->irq <=3D 0 || dev->irq >=3D irq_get_nr_irqs())
 		pr_warn(" *** Warning: IRQ %d is unlikely to work! ***\n",
 			dev->irq);
=20
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/bay=
com_ser_fdx.c
index 646f605e358f..799f8ece7824 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -373,6 +373,7 @@ static enum uart ser12_check_uart(unsigned int iobase)
=20
 static int ser12_open(struct net_device *dev)
 {
+	const unsigned int nr_irqs =3D irq_get_nr_irqs();
 	struct baycom_state *bc =3D netdev_priv(dev);
 	enum uart u;
=20
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index a9184a78650b..c71e52249289 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1460,6 +1460,7 @@ scc_start_calibrate(struct scc_channel *scc, int durati=
on, unsigned char pattern
=20
 static void z8530_init(void)
 {
+	const unsigned int nr_irqs =3D irq_get_nr_irqs();
 	struct scc_channel *scc;
 	int chip, k;
 	unsigned long flags;
@@ -1735,7 +1736,7 @@ static int scc_net_siocdevprivate(struct net_device *de=
v,
=20
 			if (hwcfg.irq =3D=3D 2) hwcfg.irq =3D 9;
=20
-			if (hwcfg.irq < 0 || hwcfg.irq >=3D nr_irqs)
+			if (hwcfg.irq < 0 || hwcfg.irq >=3D irq_get_nr_irqs())
 				return -EINVAL;
 			=09
 			if (!Ivec[hwcfg.irq].used && hwcfg.irq)
@@ -2117,6 +2118,7 @@ static int __init scc_init_driver (void)
=20
 static void __exit scc_cleanup_driver(void)
 {
+	const unsigned int nr_irqs =3D irq_get_nr_irqs();
 	io_port ctrl;
 	int k;
 	struct scc_channel *scc;
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index a0fb330b8df5..4276f868cd91 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -295,7 +295,7 @@ CMD_INC_RESID(struct scsi_cmnd *cmd, int inc)
 #else
 #define IRQ_MIN 9
 #if defined(__PPC)
-#define IRQ_MAX (nr_irqs-1)
+#define IRQ_MAX (irq_get_nr_irqs()-1)
 #else
 #define IRQ_MAX 12
 #endif
diff --git a/drivers/sh/intc/virq-debugfs.c b/drivers/sh/intc/virq-debugfs.c
index 939915a07d99..5dd8febe6da5 100644
--- a/drivers/sh/intc/virq-debugfs.c
+++ b/drivers/sh/intc/virq-debugfs.c
@@ -18,6 +18,7 @@
=20
 static int intc_irq_xlate_show(struct seq_file *m, void *priv)
 {
+	const unsigned int nr_irqs =3D irq_get_nr_irqs();
 	int i;
=20
 	seq_printf(m, "%-5s  %-7s  %-15s\n", "irq", "enum", "chip name");
diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig
index 5d94c3f31494..9f7fe02310b9 100644
--- a/drivers/soc/renesas/Kconfig
+++ b/drivers/soc/renesas/Kconfig
@@ -347,6 +347,7 @@ config ARCH_R9A09G011
=20
 config ARCH_R9A09G057
 	bool "ARM64 Platform support for RZ/V2H(P)"
+	select RENESAS_RZV2H_ICU
 	help
 	  This enables support for the Renesas RZ/V2H(P) SoC variants.
=20
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/82=
50_port.c
index 3509af7dc52b..0b886c0924da 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -3176,7 +3176,7 @@ static void serial8250_config_port(struct uart_port *po=
rt, int flags)
 static int
 serial8250_verify_port(struct uart_port *port, struct serial_struct *ser)
 {
-	if (ser->irq >=3D nr_irqs || ser->irq < 0 ||
+	if (ser->irq >=3D irq_get_nr_irqs() || ser->irq < 0 ||
 	    ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
 	    ser->type >=3D ARRAY_SIZE(uart_config) || ser->type =3D=3D PORT_CIRRUS =
||
 	    ser->type =3D=3D PORT_STARTECH)
diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index eabbf8afc9b5..c3a7fad02ac9 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -499,7 +499,7 @@ static int pl010_verify_port(struct uart_port *port, stru=
ct serial_struct *ser)
 	int ret =3D 0;
 	if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_AMBA)
 		ret =3D -EINVAL;
-	if (ser->irq < 0 || ser->irq >=3D nr_irqs)
+	if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs())
 		ret =3D -EINVAL;
 	if (ser->baud_base < 9600)
 		ret =3D -EINVAL;
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 7d0134ecd82f..1c60850030b1 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2202,7 +2202,7 @@ static int pl011_verify_port(struct uart_port *port, st=
ruct serial_struct *ser)
=20
 	if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_AMBA)
 		ret =3D -EINVAL;
-	if (ser->irq < 0 || ser->irq >=3D nr_irqs)
+	if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs())
 		ret =3D -EINVAL;
 	if (ser->baud_base < 9600)
 		ret =3D -EINVAL;
diff --git a/drivers/tty/serial/cpm_uart.c b/drivers/tty/serial/cpm_uart.c
index a927478f581d..6eb8625de435 100644
--- a/drivers/tty/serial/cpm_uart.c
+++ b/drivers/tty/serial/cpm_uart.c
@@ -631,7 +631,7 @@ static int cpm_uart_verify_port(struct uart_port *port,
=20
 	if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_CPM)
 		ret =3D -EINVAL;
-	if (ser->irq < 0 || ser->irq >=3D nr_irqs)
+	if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs())
 		ret =3D -EINVAL;
 	if (ser->baud_base < 9600)
 		ret =3D -EINVAL;
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_cor=
e.c
index d94d73e45fb6..74fa02b23772 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -919,7 +919,7 @@ static int uart_set_info(struct tty_struct *tty, struct t=
ty_port *port,
 	if (uport->ops->verify_port)
 		retval =3D uport->ops->verify_port(uport, new_info);
=20
-	if ((new_info->irq >=3D nr_irqs) || (new_info->irq < 0) ||
+	if ((new_info->irq >=3D irq_get_nr_irqs()) || (new_info->irq < 0) ||
 	    (new_info->baud_base < 9600))
 		retval =3D -EINVAL;
=20
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index 53bb8c5ef499..4eed909468ff 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1045,7 +1045,7 @@ static int qe_uart_verify_port(struct uart_port *port,
 	if (ser->type !=3D PORT_UNKNOWN && ser->type !=3D PORT_CPM)
 		return -EINVAL;
=20
-	if (ser->irq < 0 || ser->irq >=3D nr_irqs)
+	if (ser->irq < 0 || ser->irq >=3D irq_get_nr_irqs())
 		return -EINVAL;
=20
 	if (ser->baud_base < 9600)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_bas=
e.c
index 81effbd53dc5..985e155ebe4b 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -411,7 +411,7 @@ static evtchn_port_t evtchn_from_irq(unsigned int irq)
 {
 	const struct irq_info *info =3D NULL;
=20
-	if (likely(irq < nr_irqs))
+	if (likely(irq < irq_get_nr_irqs()))
 		info =3D info_for_irq(irq);
 	if (!info)
 		return 0;
diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c
index cb0edc7cbf09..714a22ded8a8 100644
--- a/fs/proc/interrupts.c
+++ b/fs/proc/interrupts.c
@@ -11,13 +11,13 @@
  */
 static void *int_seq_start(struct seq_file *f, loff_t *pos)
 {
-	return (*pos <=3D nr_irqs) ? pos : NULL;
+	return *pos <=3D irq_get_nr_irqs() ? pos : NULL;
 }
=20
 static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
 {
 	(*pos)++;
-	if (*pos > nr_irqs)
+	if (*pos > irq_get_nr_irqs())
 		return NULL;
 	return pos;
 }
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index da60956b2915..8b444e862319 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -76,7 +76,7 @@ static void show_all_irqs(struct seq_file *p)
 		seq_put_decimal_ull(p, " ", kstat_irqs_usr(i));
 		next =3D i + 1;
 	}
-	show_irq_gap(p, nr_irqs - next);
+	show_irq_gap(p, irq_get_nr_irqs() - next);
 }
=20
 static int show_stat(struct seq_file *p, void *v)
@@ -196,7 +196,7 @@ static int stat_open(struct inode *inode, struct file *fi=
le)
 	unsigned int size =3D 1024 + 128 * num_online_cpus();
=20
 	/* minimum size to display an interrupt count : 2 bytes */
-	size +=3D 2 * nr_irqs;
+	size +=3D 2 * irq_get_nr_irqs();
 	return single_open_size(file, show_stat, NULL, size);
 }
=20
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 2361ed4d2b15..799052249c7b 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -147,6 +147,7 @@ enum cpuhp_state {
 	CPUHP_AP_IRQ_EIOINTC_STARTING,
 	CPUHP_AP_IRQ_AVECINTC_STARTING,
 	CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
+	CPUHP_AP_IRQ_THEAD_ACLINT_SSWI_STARTING,
 	CPUHP_AP_IRQ_RISCV_IMSIC_STARTING,
 	CPUHP_AP_IRQ_RISCV_SBI_IPI_STARTING,
 	CPUHP_AP_ARM_MVEBU_COHERENCY,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 457151f9f263..8cd9327e4e78 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -616,6 +616,53 @@ extern void __raise_softirq_irqoff(unsigned int nr);
 extern void raise_softirq_irqoff(unsigned int nr);
 extern void raise_softirq(unsigned int nr);
=20
+/*
+ * With forced-threaded interrupts enabled a raised softirq is deferred to
+ * ksoftirqd unless it can be handled within the threaded interrupt. This
+ * affects timer_list timers and hrtimers which are explicitly marked with
+ * HRTIMER_MODE_SOFT.
+ * With PREEMPT_RT enabled more hrtimers are moved to softirq for processing
+ * which includes all timers which are not explicitly marked HRTIMER_MODE_HA=
RD.
+ * Userspace controlled timers (like the clock_nanosleep() interface) is div=
ided
+ * into two categories: Tasks with elevated scheduling policy including
+ * SCHED_{FIFO|RR|DL} and the remaining scheduling policy. The tasks with the
+ * elevated scheduling policy are woken up directly from the HARDIRQ while a=
ll
+ * other wake ups are delayed to softirq and so to ksoftirqd.
+ *
+ * The ksoftirqd runs at SCHED_OTHER policy at which it should remain since =
it
+ * handles the softirq in an overloaded situation (not handled everything
+ * within its last run).
+ * If the timers are handled at SCHED_OTHER priority then they competes with=
 all
+ * other SCHED_OTHER tasks for CPU resources are possibly delayed.
+ * Moving timers softirqs to a low priority SCHED_FIFO thread instead ensures
+ * that timer are performed before scheduling any SCHED_OTHER thread.
+ */
+DECLARE_PER_CPU(struct task_struct *, ktimerd);
+DECLARE_PER_CPU(unsigned long, pending_timer_softirq);
+void raise_ktimers_thread(unsigned int nr);
+
+static inline unsigned int local_timers_pending_force_th(void)
+{
+	return __this_cpu_read(pending_timer_softirq);
+}
+
+static inline void raise_timer_softirq(unsigned int nr)
+{
+	lockdep_assert_in_irq();
+	if (force_irqthreads())
+		raise_ktimers_thread(nr);
+	else
+		__raise_softirq_irqoff(nr);
+}
+
+static inline unsigned int local_timers_pending(void)
+{
+	if (force_irqthreads())
+		return local_timers_pending_force_th();
+	else
+		return local_softirq_pending();
+}
+
 DECLARE_PER_CPU(struct task_struct *, ksoftirqd);
=20
 static inline struct task_struct *this_cpu_ksoftirqd(void)
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 3496baa0b07f..e97206c721a0 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -5,30 +5,36 @@
 #include <uapi/linux/irqnr.h>
=20
=20
-extern int nr_irqs;
+unsigned int irq_get_nr_irqs(void) __pure;
+unsigned int irq_set_nr_irqs(unsigned int nr);
 extern struct irq_desc *irq_to_desc(unsigned int irq);
 unsigned int irq_get_next_irq(unsigned int offset);
=20
-# define for_each_irq_desc(irq, desc)					\
-	for (irq =3D 0, desc =3D irq_to_desc(irq); irq < nr_irqs;		\
-	     irq++, desc =3D irq_to_desc(irq))				\
-		if (!desc)						\
-			;						\
-		else
-
+#define for_each_irq_desc(irq, desc)                                      \
+	for (unsigned int __nr_irqs__ =3D irq_get_nr_irqs(); __nr_irqs__;   \
+	     __nr_irqs__ =3D 0)                                             \
+		for (irq =3D 0, desc =3D irq_to_desc(irq); irq < __nr_irqs__; \
+		     irq++, desc =3D irq_to_desc(irq))                      \
+			if (!desc)                                        \
+				;                                         \
+			else
=20
 # define for_each_irq_desc_reverse(irq, desc)				\
-	for (irq =3D nr_irqs - 1, desc =3D irq_to_desc(irq); irq >=3D 0;	\
-	     irq--, desc =3D irq_to_desc(irq))				\
+	for (irq =3D irq_get_nr_irqs() - 1, desc =3D irq_to_desc(irq);	\
+	     irq >=3D 0; irq--, desc =3D irq_to_desc(irq))			\
 		if (!desc)						\
 			;						\
 		else
=20
-# define for_each_active_irq(irq)			\
-	for (irq =3D irq_get_next_irq(0); irq < nr_irqs;	\
-	     irq =3D irq_get_next_irq(irq + 1))
+#define for_each_active_irq(irq)                                        \
+	for (unsigned int __nr_irqs__ =3D irq_get_nr_irqs(); __nr_irqs__; \
+	     __nr_irqs__ =3D 0)                                           \
+		for (irq =3D irq_get_next_irq(0); irq < __nr_irqs__;      \
+		     irq =3D irq_get_next_irq(irq + 1))
=20
-#define for_each_irq_nr(irq)                   \
-       for (irq =3D 0; irq < nr_irqs; irq++)
+#define for_each_irq_nr(irq)                                            \
+	for (unsigned int __nr_irqs__ =3D irq_get_nr_irqs(); __nr_irqs__; \
+	     __nr_irqs__ =3D 0)                                           \
+		for (irq =3D 0; irq < __nr_irqs__; irq++)
=20
 #endif
diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c
index b3e98668f4dd..eb16a58e0322 100644
--- a/kernel/irq/devres.c
+++ b/kernel/irq/devres.c
@@ -141,9 +141,8 @@ void devm_free_irq(struct device *dev, unsigned int irq, =
void *dev_id)
 {
 	struct irq_devres match_data =3D { irq, dev_id };
=20
-	WARN_ON(devres_destroy(dev, devm_irq_release, devm_irq_match,
+	WARN_ON(devres_release(dev, devm_irq_release, devm_irq_match,
 			       &match_data));
-	free_irq(irq, dev_id);
 }
 EXPORT_SYMBOL(devm_free_irq);
=20
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 1dee88ba0ae4..0253e77fcd9a 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -15,6 +15,7 @@
 #include <linux/maple_tree.h>
 #include <linux/irqdomain.h>
 #include <linux/sysfs.h>
+#include <linux/string_choices.h>
=20
 #include "internals.h"
=20
@@ -138,8 +139,30 @@ static void desc_set_defaults(unsigned int irq, struct i=
rq_desc *desc, int node,
 	desc_smp_init(desc, node, affinity);
 }
=20
-int nr_irqs =3D NR_IRQS;
-EXPORT_SYMBOL_GPL(nr_irqs);
+static unsigned int nr_irqs =3D NR_IRQS;
+
+/**
+ * irq_get_nr_irqs() - Number of interrupts supported by the system.
+ */
+unsigned int irq_get_nr_irqs(void)
+{
+	return nr_irqs;
+}
+EXPORT_SYMBOL_GPL(irq_get_nr_irqs);
+
+/**
+ * irq_set_nr_irqs() - Set the number of interrupts supported by the system.
+ * @nr: New number of interrupts.
+ *
+ * Return: @nr.
+ */
+unsigned int irq_set_nr_irqs(unsigned int nr)
+{
+	nr_irqs =3D nr;
+
+	return nr;
+}
+EXPORT_SYMBOL_GPL(irq_set_nr_irqs);
=20
 static DEFINE_MUTEX(sparse_irq_lock);
 static struct maple_tree sparse_irqs =3D MTREE_INIT_EXT(sparse_irqs,
@@ -298,8 +321,7 @@ static ssize_t wakeup_show(struct kobject *kobj,
 	ssize_t ret =3D 0;
=20
 	raw_spin_lock_irq(&desc->lock);
-	ret =3D sprintf(buf, "%s\n",
-		      irqd_is_wakeup_set(&desc->irq_data) ? "enabled" : "disabled");
+	ret =3D sprintf(buf, "%s\n", str_enabled_disabled(irqd_is_wakeup_set(&desc-=
>irq_data)));
 	raw_spin_unlock_irq(&desc->lock);
=20
 	return ret;
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index e0bff21f30e0..ec6d8e72d980 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -1225,7 +1225,7 @@ int irq_domain_alloc_descs(int virq, unsigned int cnt, =
irq_hw_number_t hwirq,
 		virq =3D __irq_alloc_descs(virq, virq, cnt, node, THIS_MODULE,
 					 affinity);
 	} else {
-		hint =3D hwirq % nr_irqs;
+		hint =3D hwirq % irq_get_nr_irqs();
 		if (hint =3D=3D 0)
 			hint++;
 		virq =3D __irq_alloc_descs(-1, hint, cnt, node, THIS_MODULE,
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 9081ada81c3d..f36c33bd2da4 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -457,11 +457,12 @@ int __weak arch_show_interrupts(struct seq_file *p, int=
 prec)
 }
=20
 #ifndef ACTUAL_NR_IRQS
-# define ACTUAL_NR_IRQS nr_irqs
+# define ACTUAL_NR_IRQS irq_get_nr_irqs()
 #endif
=20
 int show_interrupts(struct seq_file *p, void *v)
 {
+	const unsigned int nr_irqs =3D irq_get_nr_irqs();
 	static int prec;
=20
 	int i =3D *(loff_t *) v, j;
@@ -494,9 +495,12 @@ int show_interrupts(struct seq_file *p, void *v)
 	if (!desc->action || irq_desc_is_chained(desc) || !desc->kstat_irqs)
 		goto outsparse;
=20
-	seq_printf(p, "%*d: ", prec, i);
-	for_each_online_cpu(j)
-		seq_printf(p, "%10u ", desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, j=
) : 0);
+	seq_printf(p, "%*d:", prec, i);
+	for_each_online_cpu(j) {
+		unsigned int cnt =3D desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, j) =
: 0;
+
+		seq_put_decimal_ull_width(p, " ", cnt, 10);
+	}
=20
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	if (desc->irq_data.chip) {
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index bb75dbf5c800..270c31a1e857 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2440,6 +2440,14 @@ static int rcutorture_booster_init(unsigned int cpu)
 		WARN_ON_ONCE(!t);
 		sp.sched_priority =3D 2;
 		sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
+#ifdef CONFIG_IRQ_FORCED_THREADING
+		if (force_irqthreads()) {
+			t =3D per_cpu(ktimerd, cpu);
+			WARN_ON_ONCE(!t);
+			sp.sched_priority =3D 2;
+			sched_setscheduler_nocheck(t, SCHED_FIFO, &sp);
+		}
+#endif
 	}
=20
 	/* Don't allow time recalculation while creating a new task. */
diff --git a/kernel/softirq.c b/kernel/softirq.c
index d082e7840f88..7b525c904462 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -624,6 +624,24 @@ static inline void tick_irq_exit(void)
 #endif
 }
=20
+#ifdef CONFIG_IRQ_FORCED_THREADING
+DEFINE_PER_CPU(struct task_struct *, ktimerd);
+DEFINE_PER_CPU(unsigned long, pending_timer_softirq);
+
+static void wake_timersd(void)
+{
+	struct task_struct *tsk =3D __this_cpu_read(ktimerd);
+
+	if (tsk)
+		wake_up_process(tsk);
+}
+
+#else
+
+static inline void wake_timersd(void) { }
+
+#endif
+
 static inline void __irq_exit_rcu(void)
 {
 #ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED
@@ -636,6 +654,10 @@ static inline void __irq_exit_rcu(void)
 	if (!in_interrupt() && local_softirq_pending())
 		invoke_softirq();
=20
+	if (IS_ENABLED(CONFIG_IRQ_FORCED_THREADING) && force_irqthreads() &&
+	    local_timers_pending_force_th() && !(in_nmi() | in_hardirq()))
+		wake_timersd();
+
 	tick_irq_exit();
 }
=20
@@ -971,12 +993,57 @@ static struct smp_hotplug_thread softirq_threads =3D {
 	.thread_comm		=3D "ksoftirqd/%u",
 };
=20
+#ifdef CONFIG_IRQ_FORCED_THREADING
+static void ktimerd_setup(unsigned int cpu)
+{
+	/* Above SCHED_NORMAL to handle timers before regular tasks. */
+	sched_set_fifo_low(current);
+}
+
+static int ktimerd_should_run(unsigned int cpu)
+{
+	return local_timers_pending_force_th();
+}
+
+void raise_ktimers_thread(unsigned int nr)
+{
+	trace_softirq_raise(nr);
+	__this_cpu_or(pending_timer_softirq, BIT(nr));
+}
+
+static void run_ktimerd(unsigned int cpu)
+{
+	unsigned int timer_si;
+
+	ksoftirqd_run_begin();
+
+	timer_si =3D local_timers_pending_force_th();
+	__this_cpu_write(pending_timer_softirq, 0);
+	or_softirq_pending(timer_si);
+
+	__do_softirq();
+
+	ksoftirqd_run_end();
+}
+
+static struct smp_hotplug_thread timer_thread =3D {
+	.store			=3D &ktimerd,
+	.setup			=3D ktimerd_setup,
+	.thread_should_run	=3D ktimerd_should_run,
+	.thread_fn		=3D run_ktimerd,
+	.thread_comm		=3D "ktimers/%u",
+};
+#endif
+
 static __init int spawn_ksoftirqd(void)
 {
 	cpuhp_setup_state_nocalls(CPUHP_SOFTIRQ_DEAD, "softirq:dead", NULL,
 				  takeover_tasklets);
 	BUG_ON(smpboot_register_percpu_thread(&softirq_threads));
-
+#ifdef CONFIG_IRQ_FORCED_THREADING
+	if (force_irqthreads())
+		BUG_ON(smpboot_register_percpu_thread(&timer_thread));
+#endif
 	return 0;
 }
 early_initcall(spawn_ksoftirqd);
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index cddcd08ea827..d9911516e743 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1811,7 +1811,7 @@ void hrtimer_interrupt(struct clock_event_device *dev)
 	if (!ktime_before(now, cpu_base->softirq_expires_next)) {
 		cpu_base->softirq_expires_next =3D KTIME_MAX;
 		cpu_base->softirq_activated =3D 1;
-		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+		raise_timer_softirq(HRTIMER_SOFTIRQ);
 	}
=20
 	__hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD);
@@ -1906,7 +1906,7 @@ void hrtimer_run_queues(void)
 	if (!ktime_before(now, cpu_base->softirq_expires_next)) {
 		cpu_base->softirq_expires_next =3D KTIME_MAX;
 		cpu_base->softirq_activated =3D 1;
-		raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+		raise_timer_softirq(HRTIMER_SOFTIRQ);
 	}
=20
 	__hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 753a184c7090..976a212cca2e 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -859,7 +859,7 @@ static void tick_nohz_restart(struct tick_sched *ts, ktim=
e_t now)
=20
 static inline bool local_timer_softirq_pending(void)
 {
-	return local_softirq_pending() & BIT(TIMER_SOFTIRQ);
+	return local_timers_pending() & BIT(TIMER_SOFTIRQ);
 }
=20
 /*
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 0fc9d066a7be..06f0bc1db6d9 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -2499,7 +2499,7 @@ static void run_local_timers(void)
 		 */
 		if (time_after_eq(jiffies, READ_ONCE(base->next_expiry)) ||
 		    (i =3D=3D BASE_DEF && tmigr_requires_handle_remote())) {
-			raise_softirq(TIMER_SOFTIRQ);
+			raise_timer_softirq(TIMER_SOFTIRQ);
 			return;
 		}
 	}


.
Subject: [GIT pull] timers/vdso for v6.13-rc1
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Date: Mon, 18 Nov 2024 20:22:02 +0100 (CET)

Linus,

please pull the latest timers/vdso branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-vdso-2024=
-11-18

up to:  7fa3c36ea270: x86/vdso: Add missing brackets in switch case


First step of consolidating the VDSO data page handling:

  The VDSO data page handling is architecture specific for historical
  reasons, but there is no real technical reason to do so.

  Aside of that VDSO data has become a dump ground for various mechanisms
  and fail to provide a clear separation of the functionalities.

  Clean this up by:

    * consolidating the VDSO page data by getting rid of architecture
      specific warts especially in x86 and PowerPC.

    * removing the last includes of header files which are pulling in other
      headers outside of the VDSO namespace.

    * seperating timekeeping and other VDSO data accordingly.

  Further consolidation of the VDSO page handling is done in subsequent
  changes scheduled for the next merge window.

  This also lays the ground for expanding the VDSO time getters for
  independent PTP clocks in a generic way without making every architecture
  add support seperately.

Thanks,

	tglx

------------------>
Arnd Bergmann (1):
      vdso: Change PAGE_MASK to signed on all 32-bit architectures

Nam Cao (1):
      vdso: Rename struct arch_vdso_data to arch_vdso_time_data

Thomas Gleixner (1):
      x86/vdso: Add missing brackets in switch case

Thomas Wei=C3=9Fschuh (36):
      vdso: Remove timekeeper argument of __arch_update_vsyscall()
      arm: vdso: Remove timekeeper includes
      arm64: vdso: Remove timekeeper include
      powerpc/vdso: Remove timekeeper includes
      riscv: vdso: Remove timekeeper include
      s390/vdso: Remove timekeeper includes
      x86/vdso: Remove timekeeper include
      LoongArch: vdso: Remove timekeeper includes
      MIPS: vdso: Remove timekeeper includes
      csky/vdso: Remove gettimeofday() and friends from VDSO
      csky/vdso: Remove arch_vma_name()
      s390/vdso: Drop LBASE_VDSO
      arm64: vdso: Drop LBASE_VDSO
      arm64: vdso: Use only one single vvar mapping
      riscv: vdso: Use only one single vvar mapping
      ARM: vdso: Remove assembly for datapage access
      LoongArch: vDSO: Use vdso/datapage.h to access vDSO data
      MIPS: vdso: Avoid name conflict around "vdso_data"
      x86/mm/mmap: Remove arch_vma_name()
      x86/vdso: Use __arch_get_vdso_data() to access vdso data
      x86/vdso: Place vdso_data at beginning of vvar page
      x86/vdso: Access rng data from kernel without vvar
      x86/vdso: Allocate vvar page from C code
      x86/vdso: Access timens vdso data without vvar.h
      x86/vdso: Access rng vdso data without vvar.h
      x86/vdso: Move the rng offset to vsyscall.h
      x86/vdso: Access vdso data without vvar.h
      x86/vdso: Delete vvar.h
      x86/vdso: Split virtual clock pages into dedicated mapping
      powerpc/vdso: Remove offset comment from 32bit vdso_arch_data
      powerpc/procfs: Propagate error of remap_pfn_range()
      powerpc/pseries/lparcfg: Fix printing of system_active_processors
      powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processo=
rs
      powerpc: Add kconfig option for the systemcfg page
      powerpc: Split systemcfg data out of vdso data page
      powerpc: Split systemcfg struct definitions out from vdso

Vincenzo Frascino (3):
      drm: i915: Change fault type to unsigned long
      vdso: Introduce vdso/page.h
      s390: Remove remaining _PAGE_* macros


 arch/Kconfig                                       |   2 +-
 arch/alpha/include/asm/page.h                      |   6 +-
 arch/arc/include/uapi/asm/page.h                   |   7 +-
 arch/arm/include/asm/page.h                        |   5 +-
 arch/arm/include/asm/vdso/gettimeofday.h           |   4 +-
 arch/arm/include/asm/vdso/vsyscall.h               |   4 -
 arch/arm/kernel/vdso.c                             |   1 -
 arch/arm/vdso/Makefile                             |   2 +-
 arch/arm/vdso/datapage.S                           |  16 ---
 arch/arm/vdso/vdso.lds.S                           |   3 +-
 arch/arm64/include/asm/page-def.h                  |   5 +-
 arch/arm64/include/asm/vdso.h                      |   9 +-
 arch/arm64/include/asm/vdso/vsyscall.h             |   3 +-
 arch/arm64/kernel/vdso.c                           |  44 +++-----
 arch/arm64/kernel/vdso/vdso.lds.S                  |   2 +-
 arch/arm64/kernel/vdso32/vdso.lds.S                |   2 +-
 arch/csky/Kconfig                                  |   4 -
 arch/csky/include/asm/page.h                       |   8 +-
 arch/csky/include/asm/vdso/clocksource.h           |   9 --
 arch/csky/include/asm/vdso/gettimeofday.h          | 114 -------------------=
--
 arch/csky/include/asm/vdso/processor.h             |  12 ---
 arch/csky/include/asm/vdso/vsyscall.h              |  22 ----
 arch/csky/kernel/vdso.c                            |  31 +-----
 arch/csky/kernel/vdso/Makefile                     |   1 -
 arch/csky/kernel/vdso/vdso.lds.S                   |   4 -
 arch/csky/kernel/vdso/vgettimeofday.c              |  30 ------
 arch/hexagon/include/asm/page.h                    |   4 +-
 arch/loongarch/include/asm/page.h                  |   7 +-
 arch/loongarch/include/asm/vdso/getrandom.h        |   3 +-
 arch/loongarch/include/asm/vdso/gettimeofday.h     |   4 +-
 arch/loongarch/include/asm/vdso/vdso.h             |  18 +---
 arch/loongarch/include/asm/vdso/vsyscall.h         |   4 -
 arch/loongarch/kernel/asm-offsets.c                |   9 ++
 arch/loongarch/kernel/vdso.c                       |   1 -
 arch/loongarch/vdso/vdso.lds.S                     |   8 +-
 arch/loongarch/vdso/vgetcpu.c                      |   2 +-
 arch/m68k/include/asm/page.h                       |   6 +-
 arch/microblaze/include/asm/page.h                 |   5 +-
 arch/mips/include/asm/page.h                       |   7 +-
 arch/mips/include/asm/vdso/vsyscall.h              |   1 -
 arch/mips/kernel/vdso.c                            |   1 -
 arch/mips/vdso/genvdso.c                           |   4 +-
 arch/nios2/include/asm/page.h                      |   7 +-
 arch/openrisc/include/asm/page.h                   |  11 +-
 arch/parisc/include/asm/page.h                     |   4 +-
 arch/powerpc/Kconfig                               |   8 ++
 arch/powerpc/include/asm/page.h                    |  10 +-
 arch/powerpc/include/asm/systemcfg.h               |  52 ++++++++++
 arch/powerpc/include/asm/vdso/vsyscall.h           |   4 -
 arch/powerpc/include/asm/vdso_datapage.h           |  61 +----------
 arch/powerpc/kernel/proc_powerpc.c                 |  37 +++++--
 arch/powerpc/kernel/setup-common.c                 |   5 +-
 arch/powerpc/kernel/smp.c                          |  11 +-
 arch/powerpc/kernel/time.c                         |   5 +-
 arch/powerpc/kernel/vdso.c                         |  20 ----
 arch/powerpc/platforms/powernv/smp.c               |   5 +-
 arch/powerpc/platforms/pseries/hotplug-cpu.c       |   5 +-
 arch/powerpc/platforms/pseries/lparcfg.c           |   5 +-
 arch/riscv/Kconfig                                 |   2 +-
 arch/riscv/include/asm/page.h                      |   4 +-
 .../riscv/include/asm/vdso/{data.h =3D> time_data.h} |   8 +-
 arch/riscv/include/asm/vdso/vsyscall.h             |   4 -
 arch/riscv/kernel/sys_hwprobe.c                    |   2 +-
 arch/riscv/kernel/vdso.c                           |  52 +++-------
 arch/riscv/kernel/vdso/hwprobe.c                   |   4 +-
 arch/s390/Kconfig                                  |   2 +-
 arch/s390/include/asm/page.h                       |  10 +-
 arch/s390/include/asm/pgtable.h                    |   2 +-
 arch/s390/include/asm/vdso.h                       |   3 -
 arch/s390/include/asm/vdso/data.h                  |  12 ---
 arch/s390/include/asm/vdso/time_data.h             |  12 +++
 arch/s390/include/asm/vdso/vsyscall.h              |   5 -
 arch/s390/kernel/time.c                            |   1 -
 arch/s390/kernel/vdso32/vdso32.lds.S               |   2 +-
 arch/s390/kernel/vdso64/vdso64.lds.S               |   2 +-
 arch/s390/mm/fault.c                               |   2 +-
 arch/s390/mm/gmap.c                                |   6 +-
 arch/s390/mm/pgalloc.c                             |   4 +-
 arch/sh/include/asm/page.h                         |   6 +-
 arch/sparc/include/asm/page_32.h                   |   4 +-
 arch/sparc/include/asm/page_64.h                   |   4 +-
 arch/um/include/asm/page.h                         |   5 +-
 arch/x86/entry/vdso/vdso-layout.lds.S              |  20 ++--
 arch/x86/entry/vdso/vma.c                          |  92 +++++++++++------
 arch/x86/include/asm/page_types.h                  |   5 +-
 arch/x86/include/asm/vdso/getrandom.h              |  10 +-
 arch/x86/include/asm/vdso/gettimeofday.h           |  12 ++-
 arch/x86/include/asm/vdso/vsyscall.h               |  15 ++-
 arch/x86/include/asm/vvar.h                        |  71 -------------
 arch/x86/kernel/vmlinux.lds.S                      |  23 -----
 arch/x86/mm/mmap.c                                 |   5 -
 arch/x86/tools/relocs.c                            |   1 -
 arch/xtensa/include/asm/page.h                     |   8 +-
 drivers/gpu/drm/i915/gt/intel_gt.c                 |   6 +-
 include/asm-generic/vdso/vsyscall.h                |   3 +-
 include/vdso/datapage.h                            |   8 +-
 include/vdso/page.h                                |  31 ++++++
 kernel/time/vsyscall.c                             |   2 +-
 98 files changed, 372 insertions(+), 782 deletions(-)
 delete mode 100644 arch/arm/vdso/datapage.S
 delete mode 100644 arch/csky/include/asm/vdso/clocksource.h
 delete mode 100644 arch/csky/include/asm/vdso/gettimeofday.h
 delete mode 100644 arch/csky/include/asm/vdso/processor.h
 delete mode 100644 arch/csky/include/asm/vdso/vsyscall.h
 delete mode 100644 arch/csky/kernel/vdso/vgettimeofday.c
 create mode 100644 arch/powerpc/include/asm/systemcfg.h
 rename arch/riscv/include/asm/vdso/{data.h =3D> time_data.h} (71%)
 delete mode 100644 arch/s390/include/asm/vdso/data.h
 create mode 100644 arch/s390/include/asm/vdso/time_data.h
 delete mode 100644 arch/x86/include/asm/vvar.h
 create mode 100644 include/vdso/page.h

diff --git a/arch/Kconfig b/arch/Kconfig
index 8af374ea1adc..7f1ec327b587 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1530,7 +1530,7 @@ config HAVE_SPARSE_SYSCALL_NR
 	  entries at 4000, 5000 and 6000 locations. This option turns on syscall
 	  related optimizations for a given architecture.
=20
-config ARCH_HAS_VDSO_DATA
+config ARCH_HAS_VDSO_TIME_DATA
 	bool
=20
 config HAVE_STATIC_CALL
diff --git a/arch/alpha/include/asm/page.h b/arch/alpha/include/asm/page.h
index 70419e6be1a3..261af54fd601 100644
--- a/arch/alpha/include/asm/page.h
+++ b/arch/alpha/include/asm/page.h
@@ -4,11 +4,7 @@
=20
 #include <linux/const.h>
 #include <asm/pal.h>
-
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #ifndef __ASSEMBLY__
=20
diff --git a/arch/arc/include/uapi/asm/page.h b/arch/arc/include/uapi/asm/pag=
e.h
index 7fd9e741b527..4606a326af5c 100644
--- a/arch/arc/include/uapi/asm/page.h
+++ b/arch/arc/include/uapi/asm/page.h
@@ -14,7 +14,7 @@
=20
 /* PAGE_SHIFT determines the page size */
 #ifdef __KERNEL__
-#define PAGE_SHIFT CONFIG_PAGE_SHIFT
+#include <vdso/page.h>
 #else
 /*
  * Default 8k
@@ -24,11 +24,10 @@
  * not available
  */
 #define PAGE_SHIFT 13
+#define PAGE_SIZE	_BITUL(PAGE_SHIFT)	/* Default 8K */
+#define PAGE_MASK	(~(PAGE_SIZE-1))
 #endif
=20
-#define PAGE_SIZE	_BITUL(PAGE_SHIFT)	/* Default 8K */
 #define PAGE_OFFSET	_AC(0x80000000, UL)	/* Kernel starts at 2G onwrds */
=20
-#define PAGE_MASK	(~(PAGE_SIZE-1))
-
 #endif /* _UAPI__ASM_ARC_PAGE_H */
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index 62af9f7f9e96..ef11b721230e 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -7,10 +7,7 @@
 #ifndef _ASMARM_PAGE_H
 #define _ASMARM_PAGE_H
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT		CONFIG_PAGE_SHIFT
-#define PAGE_SIZE		(_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK		(~((1 << PAGE_SHIFT) - 1))
+#include <vdso/page.h>
=20
 #ifndef __ASSEMBLY__
=20
diff --git a/arch/arm/include/asm/vdso/gettimeofday.h b/arch/arm/include/asm/=
vdso/gettimeofday.h
index 2134cbd5469f..592d3d015ca7 100644
--- a/arch/arm/include/asm/vdso/gettimeofday.h
+++ b/arch/arm/include/asm/vdso/gettimeofday.h
@@ -15,8 +15,6 @@
=20
 #define VDSO_HAS_CLOCK_GETRES		1
=20
-extern struct vdso_data *__get_datapage(void);
-
 static __always_inline int gettimeofday_fallback(
 				struct __kernel_old_timeval *_tv,
 				struct timezone *_tz)
@@ -139,7 +137,7 @@ static __always_inline u64 __arch_get_hw_counter(int cloc=
k_mode,
=20
 static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
 {
-	return __get_datapage();
+	return _vdso_data;
 }
=20
 #endif /* !__ASSEMBLY__ */
diff --git a/arch/arm/include/asm/vdso/vsyscall.h b/arch/arm/include/asm/vdso=
/vsyscall.h
index 47e41ae8ccd0..705414710dcd 100644
--- a/arch/arm/include/asm/vdso/vsyscall.h
+++ b/arch/arm/include/asm/vdso/vsyscall.h
@@ -4,16 +4,12 @@
=20
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
 #include <asm/cacheflush.h>
=20
 extern struct vdso_data *vdso_data;
 extern bool cntvct_ok;
=20
-/*
- * Update the vDSO data page to keep in sync with kernel timekeeping.
- */
 static __always_inline
 struct vdso_data *__arm_get_k_vdso_data(void)
 {
diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c
index d499ad461b00..29dd2f3c62fe 100644
--- a/arch/arm/kernel/vdso.c
+++ b/arch/arm/kernel/vdso.c
@@ -14,7 +14,6 @@
 #include <linux/of.h>
 #include <linux/printk.h>
 #include <linux/slab.h>
-#include <linux/timekeeper_internal.h>
 #include <linux/vmalloc.h>
 #include <asm/arch_timer.h>
 #include <asm/barrier.h>
diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile
index 01067a2bc43b..8a306bbec4a0 100644
--- a/arch/arm/vdso/Makefile
+++ b/arch/arm/vdso/Makefile
@@ -5,7 +5,7 @@ include $(srctree)/lib/vdso/Makefile
=20
 hostprogs :=3D vdsomunge
=20
-obj-vdso :=3D vgettimeofday.o datapage.o note.o
+obj-vdso :=3D vgettimeofday.o note.o
=20
 # Build rules
 targets :=3D $(obj-vdso) vdso.so vdso.so.dbg vdso.so.raw vdso.lds
diff --git a/arch/arm/vdso/datapage.S b/arch/arm/vdso/datapage.S
deleted file mode 100644
index 9cd73b725d9f..000000000000
--- a/arch/arm/vdso/datapage.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-
-	.align 2
-.L_vdso_data_ptr:
-	.long	_start - . - VDSO_DATA_SIZE
-
-ENTRY(__get_datapage)
-	.fnstart
-	adr	r0, .L_vdso_data_ptr
-	ldr	r1, [r0]
-	add	r0, r0, r1
-	bx	lr
-	.fnend
-ENDPROC(__get_datapage)
diff --git a/arch/arm/vdso/vdso.lds.S b/arch/arm/vdso/vdso.lds.S
index 165d1d2eb76b..9bfa0f52923c 100644
--- a/arch/arm/vdso/vdso.lds.S
+++ b/arch/arm/vdso/vdso.lds.S
@@ -11,6 +11,7 @@
  */
=20
 #include <linux/const.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/vdso.h>
=20
@@ -19,7 +20,7 @@ OUTPUT_ARCH(arm)
=20
 SECTIONS
 {
-	PROVIDE(_start =3D .);
+	PROVIDE(_vdso_data =3D . - VDSO_DATA_SIZE);
=20
 	. =3D SIZEOF_HEADERS;
=20
diff --git a/arch/arm64/include/asm/page-def.h b/arch/arm64/include/asm/page-=
def.h
index 792e9fe881dc..d402e08442ee 100644
--- a/arch/arm64/include/asm/page-def.h
+++ b/arch/arm64/include/asm/page-def.h
@@ -10,9 +10,6 @@
=20
 #include <linux/const.h>
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT		CONFIG_PAGE_SHIFT
-#define PAGE_SIZE		(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK		(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #endif /* __ASM_PAGE_DEF_H */
diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
index 4305995c8f82..3e3c3fdb1842 100644
--- a/arch/arm64/include/asm/vdso.h
+++ b/arch/arm64/include/asm/vdso.h
@@ -5,13 +5,6 @@
 #ifndef __ASM_VDSO_H
 #define __ASM_VDSO_H
=20
-/*
- * Default link address for the vDSO.
- * Since we randomise the VDSO mapping, there's little point in trying
- * to prelink this.
- */
-#define VDSO_LBASE	0x0
-
 #define __VVAR_PAGES    2
=20
 #ifndef __ASSEMBLY__
@@ -20,7 +13,7 @@
=20
 #define VDSO_SYMBOL(base, name)						   \
 ({									   \
-	(void *)(vdso_offset_##name - VDSO_LBASE + (unsigned long)(base)); \
+	(void *)(vdso_offset_##name + (unsigned long)(base)); \
 })
=20
 extern char vdso_start[], vdso_end[];
diff --git a/arch/arm64/include/asm/vdso/vsyscall.h b/arch/arm64/include/asm/=
vdso/vsyscall.h
index 5b6d0dd3cef5..eea51946d45a 100644
--- a/arch/arm64/include/asm/vdso/vsyscall.h
+++ b/arch/arm64/include/asm/vdso/vsyscall.h
@@ -6,7 +6,6 @@
=20
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
=20
 enum vvar_pages {
@@ -37,7 +36,7 @@ struct vdso_rng_data *__arm64_get_k_vdso_rnd_data(void)
 #define __arch_get_k_vdso_rng_data __arm64_get_k_vdso_rnd_data
=20
 static __always_inline
-void __arm64_update_vsyscall(struct vdso_data *vdata, struct timekeeper *tk)
+void __arm64_update_vsyscall(struct vdso_data *vdata)
 {
 	vdata[CS_HRES_COARSE].mask	=3D VDSO_PRECISION_MASK;
 	vdata[CS_RAW].mask		=3D VDSO_PRECISION_MASK;
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
index 706c9c3a7a50..e8ed8e5b713b 100644
--- a/arch/arm64/kernel/vdso.c
+++ b/arch/arm64/kernel/vdso.c
@@ -19,7 +19,6 @@
 #include <linux/signal.h>
 #include <linux/slab.h>
 #include <linux/time_namespace.h>
-#include <linux/timekeeper_internal.h>
 #include <linux/vmalloc.h>
 #include <vdso/datapage.h>
 #include <vdso/helpers.h>
@@ -39,8 +38,6 @@ struct vdso_abi_info {
 	const char *vdso_code_start;
 	const char *vdso_code_end;
 	unsigned long vdso_pages;
-	/* Data Mapping */
-	struct vm_special_mapping *dm;
 	/* Code Mapping */
 	struct vm_special_mapping *cm;
 };
@@ -113,6 +110,8 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
 	return (struct vdso_data *)(vvar_page);
 }
=20
+static const struct vm_special_mapping vvar_map;
+
 /*
  * The vvar mapping contains data for a specific time namespace, so when a t=
ask
  * changes namespace we must unmap its vvar data for the old namespace.
@@ -129,12 +128,8 @@ int vdso_join_timens(struct task_struct *task, struct ti=
me_namespace *ns)
 	mmap_read_lock(mm);
=20
 	for_each_vma(vmi, vma) {
-		if (vma_is_special_mapping(vma, vdso_info[VDSO_ABI_AA64].dm))
-			zap_vma_pages(vma);
-#ifdef CONFIG_COMPAT_VDSO
-		if (vma_is_special_mapping(vma, vdso_info[VDSO_ABI_AA32].dm))
+		if (vma_is_special_mapping(vma, &vvar_map))
 			zap_vma_pages(vma);
-#endif
 	}
=20
 	mmap_read_unlock(mm);
@@ -176,6 +171,11 @@ static vm_fault_t vvar_fault(const struct vm_special_map=
ping *sm,
 	return vmf_insert_pfn(vma, vmf->address, pfn);
 }
=20
+static const struct vm_special_mapping vvar_map =3D {
+	.name   =3D "[vvar]",
+	.fault =3D vvar_fault,
+};
+
 static int __setup_additional_pages(enum vdso_abi abi,
 				    struct mm_struct *mm,
 				    struct linux_binprm *bprm,
@@ -199,7 +199,7 @@ static int __setup_additional_pages(enum vdso_abi abi,
=20
 	ret =3D _install_special_mapping(mm, vdso_base, VVAR_NR_PAGES * PAGE_SIZE,
 				       VM_READ|VM_MAYREAD|VM_PFNMAP,
-				       vdso_info[abi].dm);
+				       &vvar_map);
 	if (IS_ERR(ret))
 		goto up_fail;
=20
@@ -229,7 +229,6 @@ static int __setup_additional_pages(enum vdso_abi abi,
 enum aarch32_map {
 	AA32_MAP_VECTORS, /* kuser helpers */
 	AA32_MAP_SIGPAGE,
-	AA32_MAP_VVAR,
 	AA32_MAP_VDSO,
 };
=20
@@ -254,10 +253,6 @@ static struct vm_special_mapping aarch32_vdso_maps[] =3D=
 {
 		.pages	=3D &aarch32_sig_page,
 		.mremap	=3D aarch32_sigpage_mremap,
 	},
-	[AA32_MAP_VVAR] =3D {
-		.name =3D "[vvar]",
-		.fault =3D vvar_fault,
-	},
 	[AA32_MAP_VDSO] =3D {
 		.name =3D "[vdso]",
 		.mremap =3D vdso_mremap,
@@ -307,7 +302,6 @@ static int __init __aarch32_alloc_vdso_pages(void)
 	if (!IS_ENABLED(CONFIG_COMPAT_VDSO))
 		return 0;
=20
-	vdso_info[VDSO_ABI_AA32].dm =3D &aarch32_vdso_maps[AA32_MAP_VVAR];
 	vdso_info[VDSO_ABI_AA32].cm =3D &aarch32_vdso_maps[AA32_MAP_VDSO];
=20
 	return __vdso_init(VDSO_ABI_AA32);
@@ -402,26 +396,14 @@ int aarch32_setup_additional_pages(struct linux_binprm =
*bprm, int uses_interp)
 }
 #endif /* CONFIG_COMPAT */
=20
-enum aarch64_map {
-	AA64_MAP_VVAR,
-	AA64_MAP_VDSO,
-};
-
-static struct vm_special_mapping aarch64_vdso_maps[] __ro_after_init =3D {
-	[AA64_MAP_VVAR] =3D {
-		.name	=3D "[vvar]",
-		.fault =3D vvar_fault,
-	},
-	[AA64_MAP_VDSO] =3D {
-		.name	=3D "[vdso]",
-		.mremap =3D vdso_mremap,
-	},
+static struct vm_special_mapping aarch64_vdso_map __ro_after_init =3D {
+	.name	=3D "[vdso]",
+	.mremap =3D vdso_mremap,
 };
=20
 static int __init vdso_init(void)
 {
-	vdso_info[VDSO_ABI_AA64].dm =3D &aarch64_vdso_maps[AA64_MAP_VVAR];
-	vdso_info[VDSO_ABI_AA64].cm =3D &aarch64_vdso_maps[AA64_MAP_VDSO];
+	vdso_info[VDSO_ABI_AA64].cm =3D &aarch64_vdso_map;
=20
 	return __vdso_init(VDSO_ABI_AA64);
 }
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.=
lds.S
index f204a9ddc833..4ec32e86a8da 100644
--- a/arch/arm64/kernel/vdso/vdso.lds.S
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
@@ -25,7 +25,7 @@ SECTIONS
 #ifdef CONFIG_TIME_NS
 	PROVIDE(_timens_data =3D _vdso_data + PAGE_SIZE);
 #endif
-	. =3D VDSO_LBASE + SIZEOF_HEADERS;
+	. =3D SIZEOF_HEADERS;
=20
 	.hash		: { *(.hash) }			:text
 	.gnu.hash	: { *(.gnu.hash) }
diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/v=
dso.lds.S
index 8d95d7d35057..732702a187e9 100644
--- a/arch/arm64/kernel/vdso32/vdso.lds.S
+++ b/arch/arm64/kernel/vdso32/vdso.lds.S
@@ -22,7 +22,7 @@ SECTIONS
 #ifdef CONFIG_TIME_NS
 	PROVIDE_HIDDEN(_timens_data =3D _vdso_data + PAGE_SIZE);
 #endif
-	. =3D VDSO_LBASE + SIZEOF_HEADERS;
+	. =3D SIZEOF_HEADERS;
=20
 	.hash		: { *(.hash) }			:text
 	.gnu.hash	: { *(.gnu.hash) }
diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
index 5479707eb5d1..acc431c331b0 100644
--- a/arch/csky/Kconfig
+++ b/arch/csky/Kconfig
@@ -64,9 +64,6 @@ config CSKY
 	select GENERIC_IRQ_MULTI_HANDLER
 	select GENERIC_SCHED_CLOCK
 	select GENERIC_SMP_IDLE_THREAD
-	select GENERIC_TIME_VSYSCALL
-	select GENERIC_VDSO_32
-	select GENERIC_GETTIMEOFDAY
 	select GX6605S_TIMER if CPU_CK610
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_ARCH_AUDITSYSCALL
@@ -80,7 +77,6 @@ config CSKY
 	select HAVE_DEBUG_KMEMLEAK
 	select HAVE_DYNAMIC_FTRACE
 	select HAVE_DYNAMIC_FTRACE_WITH_REGS
-	select HAVE_GENERIC_VDSO
 	select HAVE_FUNCTION_TRACER
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_ERROR_INJECTION
diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h
index 0ca6c408c07f..f8beae295afb 100644
--- a/arch/csky/include/asm/page.h
+++ b/arch/csky/include/asm/page.h
@@ -7,12 +7,8 @@
 #include <asm/cache.h>
 #include <linux/const.h>
=20
-/*
- * PAGE_SHIFT determines the page size: 4KB
- */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE - 1))
+#include <vdso/page.h>
+
 #define THREAD_SIZE	(PAGE_SIZE * 2)
 #define THREAD_MASK	(~(THREAD_SIZE - 1))
 #define THREAD_SHIFT	(PAGE_SHIFT + 1)
diff --git a/arch/csky/include/asm/vdso/clocksource.h b/arch/csky/include/asm=
/vdso/clocksource.h
deleted file mode 100644
index dfca7b4724b7..000000000000
--- a/arch/csky/include/asm/vdso/clocksource.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_VDSO_CSKY_CLOCKSOURCE_H
-#define __ASM_VDSO_CSKY_CLOCKSOURCE_H
-
-#define VDSO_ARCH_CLOCKMODES	\
-	VDSO_CLOCKMODE_ARCHTIMER
-
-#endif /* __ASM_VDSO_CSKY_CLOCKSOURCE_H */
diff --git a/arch/csky/include/asm/vdso/gettimeofday.h b/arch/csky/include/as=
m/vdso/gettimeofday.h
deleted file mode 100644
index 6c4f1446944f..000000000000
--- a/arch/csky/include/asm/vdso/gettimeofday.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_VDSO_CSKY_GETTIMEOFDAY_H
-#define __ASM_VDSO_CSKY_GETTIMEOFDAY_H
-
-#ifndef __ASSEMBLY__
-
-#include <asm/barrier.h>
-#include <asm/unistd.h>
-#include <abi/regdef.h>
-#include <uapi/linux/time.h>
-
-#define VDSO_HAS_CLOCK_GETRES	1
-
-static __always_inline
-int gettimeofday_fallback(struct __kernel_old_timeval *_tv,
-			  struct timezone *_tz)
-{
-	register struct __kernel_old_timeval *tv asm("a0") =3D _tv;
-	register struct timezone *tz asm("a1") =3D _tz;
-	register long ret asm("a0");
-	register long nr asm(syscallid) =3D __NR_gettimeofday;
-
-	asm volatile ("trap 0\n"
-		      : "=3Dr" (ret)
-		      : "r"(tv), "r"(tz), "r"(nr)
-		      : "memory");
-
-	return ret;
-}
-
-static __always_inline
-long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
-{
-	register clockid_t clkid asm("a0") =3D _clkid;
-	register struct __kernel_timespec *ts asm("a1") =3D _ts;
-	register long ret asm("a0");
-	register long nr asm(syscallid) =3D __NR_clock_gettime64;
-
-	asm volatile ("trap 0\n"
-		      : "=3Dr" (ret)
-		      : "r"(clkid), "r"(ts), "r"(nr)
-		      : "memory");
-
-	return ret;
-}
-
-static __always_inline
-long clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
-{
-	register clockid_t clkid asm("a0") =3D _clkid;
-	register struct old_timespec32 *ts asm("a1") =3D _ts;
-	register long ret asm("a0");
-	register long nr asm(syscallid) =3D __NR_clock_gettime;
-
-	asm volatile ("trap 0\n"
-		      : "=3Dr" (ret)
-		      : "r"(clkid), "r"(ts), "r"(nr)
-		      : "memory");
-
-	return ret;
-}
-
-static __always_inline
-int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
-{
-	register clockid_t clkid asm("a0") =3D _clkid;
-	register struct __kernel_timespec *ts asm("a1") =3D _ts;
-	register long ret asm("a0");
-	register long nr asm(syscallid) =3D __NR_clock_getres_time64;
-
-	asm volatile ("trap 0\n"
-		      : "=3Dr" (ret)
-		      : "r"(clkid), "r"(ts), "r"(nr)
-		      : "memory");
-
-	return ret;
-}
-
-static __always_inline
-int clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
-{
-	register clockid_t clkid asm("a0") =3D _clkid;
-	register struct old_timespec32 *ts asm("a1") =3D _ts;
-	register long ret asm("a0");
-	register long nr asm(syscallid) =3D __NR_clock_getres;
-
-	asm volatile ("trap 0\n"
-		      : "=3Dr" (ret)
-		      : "r"(clkid), "r"(ts), "r"(nr)
-		      : "memory");
-
-	return ret;
-}
-
-uint64_t csky_pmu_read_cc(void);
-static __always_inline u64 __arch_get_hw_counter(s32 clock_mode,
-						 const struct vdso_data *vd)
-{
-#ifdef CONFIG_CSKY_PMU_V1
-	return csky_pmu_read_cc();
-#else
-	return 0;
-#endif
-}
-
-static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
-{
-	return _vdso_data;
-}
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_CSKY_GETTIMEOFDAY_H */
diff --git a/arch/csky/include/asm/vdso/processor.h b/arch/csky/include/asm/v=
dso/processor.h
deleted file mode 100644
index 39a6b561d0cc..000000000000
--- a/arch/csky/include/asm/vdso/processor.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __ASM_VDSO_CSKY_PROCESSOR_H
-#define __ASM_VDSO_CSKY_PROCESSOR_H
-
-#ifndef __ASSEMBLY__
-
-#define cpu_relax()	barrier()
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_CSKY_PROCESSOR_H */
diff --git a/arch/csky/include/asm/vdso/vsyscall.h b/arch/csky/include/asm/vd=
so/vsyscall.h
deleted file mode 100644
index c276211a7c4d..000000000000
--- a/arch/csky/include/asm/vdso/vsyscall.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_VDSO_CSKY_VSYSCALL_H
-#define __ASM_VDSO_CSKY_VSYSCALL_H
-
-#ifndef __ASSEMBLY__
-
-#include <vdso/datapage.h>
-
-extern struct vdso_data *vdso_data;
-
-static __always_inline struct vdso_data *__csky_get_k_vdso_data(void)
-{
-	return vdso_data;
-}
-#define __arch_get_k_vdso_data __csky_get_k_vdso_data
-
-#include <asm-generic/vdso/vsyscall.h>
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_CSKY_VSYSCALL_H */
diff --git a/arch/csky/kernel/vdso.c b/arch/csky/kernel/vdso.c
index 5c9ef63c29f1..c54d019d66bc 100644
--- a/arch/csky/kernel/vdso.c
+++ b/arch/csky/kernel/vdso.c
@@ -8,23 +8,19 @@
 #include <linux/slab.h>
=20
 #include <asm/page.h>
-#include <vdso/datapage.h>
=20
 extern char vdso_start[], vdso_end[];
=20
 static unsigned int vdso_pages;
 static struct page **vdso_pagelist;
=20
-static union vdso_data_store vdso_data_store __page_aligned_data;
-struct vdso_data *vdso_data =3D vdso_data_store.data;
-
 static int __init vdso_init(void)
 {
 	unsigned int i;
=20
 	vdso_pages =3D (vdso_end - vdso_start) >> PAGE_SHIFT;
 	vdso_pagelist =3D
-		kcalloc(vdso_pages + 1, sizeof(struct page *), GFP_KERNEL);
+		kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL);
 	if (unlikely(vdso_pagelist =3D=3D NULL)) {
 		pr_err("vdso: pagelist allocation failed\n");
 		return -ENOMEM;
@@ -36,7 +32,6 @@ static int __init vdso_init(void)
 		pg =3D virt_to_page(vdso_start + (i << PAGE_SHIFT));
 		vdso_pagelist[i] =3D pg;
 	}
-	vdso_pagelist[i] =3D virt_to_page(vdso_data);
=20
 	return 0;
 }
@@ -52,11 +47,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
 	static struct vm_special_mapping vdso_mapping =3D {
 		.name =3D "[vdso]",
 	};
-	static struct vm_special_mapping vvar_mapping =3D {
-		.name =3D "[vvar]",
-	};
=20
-	vdso_len =3D (vdso_pages + 1) << PAGE_SHIFT;
+	vdso_len =3D vdso_pages << PAGE_SHIFT;
=20
 	mmap_write_lock(mm);
 	vdso_base =3D get_unmapped_area(NULL, 0, vdso_len, 0, 0);
@@ -85,27 +77,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
 	}
=20
 	vdso_base +=3D (vdso_pages << PAGE_SHIFT);
-	vvar_mapping.pages =3D &vdso_pagelist[vdso_pages];
-	vma =3D _install_special_mapping(mm, vdso_base, PAGE_SIZE,
-		(VM_READ | VM_MAYREAD), &vvar_mapping);
-
-	if (IS_ERR(vma)) {
-		ret =3D PTR_ERR(vma);
-		mm->context.vdso =3D NULL;
-		goto end;
-	}
 	ret =3D 0;
 end:
 	mmap_write_unlock(mm);
 	return ret;
 }
-
-const char *arch_vma_name(struct vm_area_struct *vma)
-{
-	if (vma->vm_mm && (vma->vm_start =3D=3D (long)vma->vm_mm->context.vdso))
-		return "[vdso]";
-	if (vma->vm_mm && (vma->vm_start =3D=3D
-			   (long)vma->vm_mm->context.vdso + PAGE_SIZE))
-		return "[vdso_data]";
-	return NULL;
-}
diff --git a/arch/csky/kernel/vdso/Makefile b/arch/csky/kernel/vdso/Makefile
index bc2261f5a8d4..069ef0b17fe5 100644
--- a/arch/csky/kernel/vdso/Makefile
+++ b/arch/csky/kernel/vdso/Makefile
@@ -5,7 +5,6 @@ include $(srctree)/lib/vdso/Makefile
=20
 # Symbols present in the vdso
 vdso-syms  +=3D rt_sigreturn
-vdso-syms  +=3D vgettimeofday
=20
 # Files to link into the vdso
 obj-vdso =3D $(patsubst %, %.o, $(vdso-syms)) note.o
diff --git a/arch/csky/kernel/vdso/vdso.lds.S b/arch/csky/kernel/vdso/vdso.ld=
s.S
index 590a6c79fff7..8d226252d439 100644
--- a/arch/csky/kernel/vdso/vdso.lds.S
+++ b/arch/csky/kernel/vdso/vdso.lds.S
@@ -49,10 +49,6 @@ VERSION
 	LINUX_5.10 {
 	global:
 		__vdso_rt_sigreturn;
-		__vdso_clock_gettime;
-		__vdso_clock_gettime64;
-		__vdso_gettimeofday;
-		__vdso_clock_getres;
 	local: *;
 	};
 }
diff --git a/arch/csky/kernel/vdso/vgettimeofday.c b/arch/csky/kernel/vdso/vg=
ettimeofday.c
deleted file mode 100644
index 55af30e83752..000000000000
--- a/arch/csky/kernel/vdso/vgettimeofday.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-
-#include <linux/time.h>
-#include <linux/types.h>
-#include <vdso/gettime.h>
-
-extern
-int __vdso_clock_gettime(clockid_t clock,
-			 struct old_timespec32 *ts)
-{
-	return __cvdso_clock_gettime32(clock, ts);
-}
-
-int __vdso_clock_gettime64(clockid_t clock,
-			   struct __kernel_timespec *ts)
-{
-	return __cvdso_clock_gettime(clock, ts);
-}
-
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
-			struct timezone *tz)
-{
-	return __cvdso_gettimeofday(tv, tz);
-}
-
-int __vdso_clock_getres(clockid_t clock_id,
-			struct old_timespec32 *res)
-{
-	return __cvdso_clock_getres_time32(clock_id, res);
-}
diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h
index 8a6af57274c2..b01f8df69dd4 100644
--- a/arch/hexagon/include/asm/page.h
+++ b/arch/hexagon/include/asm/page.h
@@ -45,9 +45,7 @@
 #define HVM_HUGEPAGE_SIZE 0x5
 #endif
=20
-#define PAGE_SHIFT CONFIG_PAGE_SHIFT
-#define PAGE_SIZE  (1UL << PAGE_SHIFT)
-#define PAGE_MASK  (~((1 << PAGE_SHIFT) - 1))
+#include <vdso/page.h>
=20
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff --git a/arch/loongarch/include/asm/page.h b/arch/loongarch/include/asm/p=
age.h
index e85df33f11c7..83f3533e31a4 100644
--- a/arch/loongarch/include/asm/page.h
+++ b/arch/loongarch/include/asm/page.h
@@ -8,12 +8,7 @@
 #include <linux/const.h>
 #include <asm/addrspace.h>
=20
-/*
- * PAGE_SHIFT determines the page size
- */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE - 1))
+#include <vdso/page.h>
=20
 #define HPAGE_SHIFT	(PAGE_SHIFT + PAGE_SHIFT - 3)
 #define HPAGE_SIZE	(_AC(1, UL) << HPAGE_SHIFT)
diff --git a/arch/loongarch/include/asm/vdso/getrandom.h b/arch/loongarch/inc=
lude/asm/vdso/getrandom.h
index 02f36772541b..e80f3c4ac748 100644
--- a/arch/loongarch/include/asm/vdso/getrandom.h
+++ b/arch/loongarch/include/asm/vdso/getrandom.h
@@ -30,8 +30,7 @@ static __always_inline ssize_t getrandom_syscall(void *_buf=
fer, size_t _len, uns
=20
 static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(=
void)
 {
-	return (const struct vdso_rng_data *)(get_vdso_data() + VVAR_LOONGARCH_PAGE=
S_START *
-	       PAGE_SIZE + offsetof(struct loongarch_vdso_data, rng_data));
+	return &_loongarch_data.rng_data;
 }
=20
 #endif /* !__ASSEMBLY__ */
diff --git a/arch/loongarch/include/asm/vdso/gettimeofday.h b/arch/loongarch/=
include/asm/vdso/gettimeofday.h
index 89e6b222c2f2..7eb3f041af76 100644
--- a/arch/loongarch/include/asm/vdso/gettimeofday.h
+++ b/arch/loongarch/include/asm/vdso/gettimeofday.h
@@ -91,14 +91,14 @@ static inline bool loongarch_vdso_hres_capable(void)
=20
 static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
 {
-	return (const struct vdso_data *)get_vdso_data();
+	return _vdso_data;
 }
=20
 #ifdef CONFIG_TIME_NS
 static __always_inline
 const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *=
vd)
 {
-	return (const struct vdso_data *)(get_vdso_data() + VVAR_TIMENS_PAGE_OFFSET=
 * PAGE_SIZE);
+	return _timens_data;
 }
 #endif
 #endif /* !__ASSEMBLY__ */
diff --git a/arch/loongarch/include/asm/vdso/vdso.h b/arch/loongarch/include/=
asm/vdso/vdso.h
index e31ac7474513..1c183a9b2115 100644
--- a/arch/loongarch/include/asm/vdso/vdso.h
+++ b/arch/loongarch/include/asm/vdso/vdso.h
@@ -48,23 +48,7 @@ enum vvar_pages {
=20
 #define VVAR_SIZE (VVAR_NR_PAGES << PAGE_SHIFT)
=20
-static inline unsigned long get_vdso_base(void)
-{
-	unsigned long addr;
-
-	__asm__(
-	" la.pcrel %0, _start\n"
-	: "=3Dr" (addr)
-	:
-	:);
-
-	return addr;
-}
-
-static inline unsigned long get_vdso_data(void)
-{
-	return get_vdso_base() - VVAR_SIZE;
-}
+extern struct loongarch_vdso_data _loongarch_data __attribute__((visibility(=
"hidden")));
=20
 #endif /* __ASSEMBLY__ */
=20
diff --git a/arch/loongarch/include/asm/vdso/vsyscall.h b/arch/loongarch/incl=
ude/asm/vdso/vsyscall.h
index b1273ce6f140..8987e951d0a9 100644
--- a/arch/loongarch/include/asm/vdso/vsyscall.h
+++ b/arch/loongarch/include/asm/vdso/vsyscall.h
@@ -4,15 +4,11 @@
=20
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
=20
 extern struct vdso_data *vdso_data;
 extern struct vdso_rng_data *vdso_rng_data;
=20
-/*
- * Update the vDSO data page to keep in sync with kernel timekeeping.
- */
 static __always_inline
 struct vdso_data *__loongarch_get_k_vdso_data(void)
 {
diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/asm-=
offsets.c
index bee9f7a3108f..049c5c3e370c 100644
--- a/arch/loongarch/kernel/asm-offsets.c
+++ b/arch/loongarch/kernel/asm-offsets.c
@@ -14,6 +14,7 @@
 #include <asm/ptrace.h>
 #include <asm/processor.h>
 #include <asm/ftrace.h>
+#include <vdso/datapage.h>
=20
 static void __used output_ptreg_defines(void)
 {
@@ -321,3 +322,11 @@ static void __used output_kvm_defines(void)
 	OFFSET(KVM_GPGD, kvm, arch.pgd);
 	BLANK();
 }
+
+static void __used output_vdso_defines(void)
+{
+	COMMENT("LoongArch vDSO offsets.");
+
+	DEFINE(__VVAR_PAGES, VVAR_NR_PAGES);
+	BLANK();
+}
diff --git a/arch/loongarch/kernel/vdso.c b/arch/loongarch/kernel/vdso.c
index f6fcc52aefae..4d7cb9425dc3 100644
--- a/arch/loongarch/kernel/vdso.c
+++ b/arch/loongarch/kernel/vdso.c
@@ -15,7 +15,6 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/time_namespace.h>
-#include <linux/timekeeper_internal.h>
=20
 #include <asm/page.h>
 #include <asm/vdso.h>
diff --git a/arch/loongarch/vdso/vdso.lds.S b/arch/loongarch/vdso/vdso.lds.S
index 6b441bde4026..160cfaef2de4 100644
--- a/arch/loongarch/vdso/vdso.lds.S
+++ b/arch/loongarch/vdso/vdso.lds.S
@@ -3,6 +3,8 @@
  * Author: Huacai Chen <chenhuacai@loongson.cn>
  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  */
+#include <asm/page.h>
+#include <generated/asm-offsets.h>
=20
 OUTPUT_FORMAT("elf64-loongarch", "elf64-loongarch", "elf64-loongarch")
=20
@@ -10,7 +12,11 @@ OUTPUT_ARCH(loongarch)
=20
 SECTIONS
 {
-	PROVIDE(_start =3D .);
+	PROVIDE(_vdso_data =3D . - __VVAR_PAGES * PAGE_SIZE);
+#ifdef CONFIG_TIME_NS
+	PROVIDE(_timens_data =3D _vdso_data + PAGE_SIZE);
+#endif
+	PROVIDE(_loongarch_data =3D _vdso_data + 2 * PAGE_SIZE);
 	. =3D SIZEOF_HEADERS;
=20
 	.hash		: { *(.hash) }			:text
diff --git a/arch/loongarch/vdso/vgetcpu.c b/arch/loongarch/vdso/vgetcpu.c
index 9e445be39763..0db51258b2a7 100644
--- a/arch/loongarch/vdso/vgetcpu.c
+++ b/arch/loongarch/vdso/vgetcpu.c
@@ -21,7 +21,7 @@ static __always_inline int read_cpu_id(void)
=20
 static __always_inline const struct vdso_pcpu_data *get_pcpu_data(void)
 {
-	return (struct vdso_pcpu_data *)(get_vdso_data() + VVAR_LOONGARCH_PAGES_STA=
RT * PAGE_SIZE);
+	return _loongarch_data.pdata;
 }
=20
 extern
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h
index 8cfb84b49975..b173ba27d36f 100644
--- a/arch/m68k/include/asm/page.h
+++ b/arch/m68k/include/asm/page.h
@@ -6,10 +6,8 @@
 #include <asm/setup.h>
 #include <asm/page_offset.h>
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
+
 #define PAGE_OFFSET	(PAGE_OFFSET_RAW)
=20
 #ifndef __ASSEMBLY__
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm=
/page.h
index 8810f4f1c3b0..d1ec3806edab 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -19,10 +19,7 @@
=20
 #ifdef __KERNEL__
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(ASM_CONST(1) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #define LOAD_OFFSET	ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR))
=20
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 4609cb0326cf..bc3e3484c1bf 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -14,12 +14,7 @@
 #include <linux/kernel.h>
 #include <asm/mipsregs.h>
=20
-/*
- * PAGE_SHIFT determines the page size
- */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~((1 << PAGE_SHIFT) - 1))
+#include <vdso/page.h>
=20
 /*
  * This is used for calculating the real page sizes
diff --git a/arch/mips/include/asm/vdso/vsyscall.h b/arch/mips/include/asm/vd=
so/vsyscall.h
index 47168aaf1eff..a4582870aaea 100644
--- a/arch/mips/include/asm/vdso/vsyscall.h
+++ b/arch/mips/include/asm/vdso/vsyscall.h
@@ -4,7 +4,6 @@
=20
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
=20
 extern struct vdso_data *vdso_data;
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c
index dda36fa26307..4c8e3c0aa210 100644
--- a/arch/mips/kernel/vdso.c
+++ b/arch/mips/kernel/vdso.c
@@ -14,7 +14,6 @@
 #include <linux/random.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
-#include <linux/timekeeper_internal.h>
=20
 #include <asm/abi.h>
 #include <asm/mips-cps.h>
diff --git a/arch/mips/vdso/genvdso.c b/arch/mips/vdso/genvdso.c
index 09e30eb4be86..d47412ea6e67 100644
--- a/arch/mips/vdso/genvdso.c
+++ b/arch/mips/vdso/genvdso.c
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
=20
 	/* Write out the stripped VDSO data. */
 	fprintf(out_file,
-		"static unsigned char vdso_data[PAGE_ALIGN(%zu)] __page_aligned_data =3D {=
\n\t",
+		"static unsigned char vdso_image_data[PAGE_ALIGN(%zu)] __page_aligned_data=
 =3D {\n\t",
 		vdso_size);
 	for (i =3D 0; i < vdso_size; i++) {
 		if (!(i % 10))
@@ -286,7 +286,7 @@ int main(int argc, char **argv)
=20
 	fprintf(out_file, "struct mips_vdso_image vdso_image%s%s =3D {\n",
 		(vdso_name[0]) ? "_" : "", vdso_name);
-	fprintf(out_file, "\t.data =3D vdso_data,\n");
+	fprintf(out_file, "\t.data =3D vdso_image_data,\n");
 	fprintf(out_file, "\t.size =3D PAGE_ALIGN(%zu),\n", vdso_size);
 	fprintf(out_file, "\t.mapping =3D {\n");
 	fprintf(out_file, "\t\t.name =3D \"[vdso]\",\n");
diff --git a/arch/nios2/include/asm/page.h b/arch/nios2/include/asm/page.h
index 0722f88e63cc..2897ec1b74f6 100644
--- a/arch/nios2/include/asm/page.h
+++ b/arch/nios2/include/asm/page.h
@@ -18,12 +18,7 @@
 #include <linux/pfn.h>
 #include <linux/const.h>
=20
-/*
- * PAGE_SHIFT determines the page size
- */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE - 1))
+#include <vdso/page.h>
=20
 /*
  * PAGE_OFFSET -- the first address of the first page of memory.
diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/pag=
e.h
index 1d5913f67c31..124a2db4b160 100644
--- a/arch/openrisc/include/asm/page.h
+++ b/arch/openrisc/include/asm/page.h
@@ -15,16 +15,7 @@
 #ifndef __ASM_OPENRISC_PAGE_H
 #define __ASM_OPENRISC_PAGE_H
=20
-
-/* PAGE_SHIFT determines the page size */
-
-#define PAGE_SHIFT      CONFIG_PAGE_SHIFT
-#ifdef __ASSEMBLY__
-#define PAGE_SIZE       (1 << PAGE_SHIFT)
-#else
-#define PAGE_SIZE       (1UL << PAGE_SHIFT)
-#endif
-#define PAGE_MASK       (~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #define PAGE_OFFSET	0xc0000000
 #define KERNELBASE	PAGE_OFFSET
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h
index 4bea2e95798f..6c4836fb5407 100644
--- a/arch/parisc/include/asm/page.h
+++ b/arch/parisc/include/asm/page.h
@@ -4,9 +4,7 @@
=20
 #include <linux/const.h>
=20
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
=20
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8094a01974cc..5d348e1f09d7 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1298,6 +1298,14 @@ config MODULES_SIZE
=20
 endmenu
=20
+config PPC64_PROC_SYSTEMCFG
+	def_bool y
+	depends on PPC64 && PROC_FS
+	help
+	  This option enables the presence of /proc/ppc64/systemcfg through
+	  which the systemcfg page can be accessed.
+	  This interface only exists for backwards-compatibility.
+
 if PPC64
 # This value must have zeroes in the bottom 60 bits otherwise lots will break
 config PAGE_OFFSET
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 83d0a4fc5f75..af9a2628d1df 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -21,8 +21,7 @@
  * page size. When using 64K pages however, whether we are really supporting
  * 64K pages in HW or not is irrelevant to those definitions.
  */
-#define PAGE_SHIFT		CONFIG_PAGE_SHIFT
-#define PAGE_SIZE		(ASM_CONST(1) << PAGE_SHIFT)
+#include <vdso/page.h>
=20
 #ifndef __ASSEMBLY__
 #ifndef CONFIG_HUGETLB_PAGE
@@ -41,13 +40,6 @@ extern unsigned int hpage_shift;
 #define HUGE_MAX_HSTATE		(MMU_PAGE_COUNT-1)
 #endif
=20
-/*
- * Subtle: (1 << PAGE_SHIFT) is an int, not an unsigned long. So if we
- * assign PAGE_MASK to a larger type it gets extended the way we want
- * (i.e. with 1s in the high bits)
- */
-#define PAGE_MASK      (~((1 << PAGE_SHIFT) - 1))
-
 /*
  * KERNELBASE is the virtual address of the start of the kernel, it's often
  * the same as PAGE_OFFSET, but _might not be_.
diff --git a/arch/powerpc/include/asm/systemcfg.h b/arch/powerpc/include/asm/=
systemcfg.h
new file mode 100644
index 000000000000..2f9b1d6a5c98
--- /dev/null
+++ b/arch/powerpc/include/asm/systemcfg.h
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _SYSTEMCFG_H
+#define _SYSTEMCFG_H
+
+/*
+ * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM
+ * Copyright (C) 2005 Benjamin Herrenschmidy <benh@kernel.crashing.org>,
+ * 		      IBM Corp.
+ */
+
+#ifdef CONFIG_PPC64
+
+/*
+ * If the major version changes we are incompatible.
+ * Minor version changes are a hint.
+ */
+#define SYSTEMCFG_MAJOR 1
+#define SYSTEMCFG_MINOR 1
+
+#include <linux/types.h>
+
+struct systemcfg {
+	__u8  eye_catcher[16];		/* Eyecatcher: SYSTEMCFG:PPC64	0x00 */
+	struct {			/* Systemcfg version numbers	     */
+		__u32 major;		/* Major number			0x10 */
+		__u32 minor;		/* Minor number			0x14 */
+	} version;
+
+	/* Note about the platform flags: it now only contains the lpar
+	 * bit. The actual platform number is dead and buried
+	 */
+	__u32 platform;			/* Platform flags		0x18 */
+	__u32 processor;		/* Processor type		0x1C */
+	__u64 processorCount;		/* # of physical processors	0x20 */
+	__u64 physicalMemorySize;	/* Size of real memory(B)	0x28 */
+	__u64 tb_orig_stamp;		/* (NU) Timebase at boot	0x30 */
+	__u64 tb_ticks_per_sec;		/* Timebase tics / sec		0x38 */
+	__u64 tb_to_xs;			/* (NU) Inverse of TB to 2^20	0x40 */
+	__u64 stamp_xsec;		/* (NU)				0x48 */
+	__u64 tb_update_count;		/* (NU) Timebase atomicity ctr	0x50 */
+	__u32 tz_minuteswest;		/* (NU) Min. west of Greenwich	0x58 */
+	__u32 tz_dsttime;		/* (NU) Type of dst correction	0x5C */
+	__u32 dcache_size;		/* L1 d-cache size		0x60 */
+	__u32 dcache_line_size;		/* L1 d-cache line size		0x64 */
+	__u32 icache_size;		/* L1 i-cache size		0x68 */
+	__u32 icache_line_size;		/* L1 i-cache line size		0x6C */
+};
+
+extern struct systemcfg *systemcfg;
+
+#endif /* CONFIG_PPC64 */
+#endif /* _SYSTEMCFG_H */
diff --git a/arch/powerpc/include/asm/vdso/vsyscall.h b/arch/powerpc/include/=
asm/vdso/vsyscall.h
index 92f480d8cc6d..48560a119559 100644
--- a/arch/powerpc/include/asm/vdso/vsyscall.h
+++ b/arch/powerpc/include/asm/vdso/vsyscall.h
@@ -4,12 +4,8 @@
=20
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <asm/vdso_datapage.h>
=20
-/*
- * Update the vDSO data page to keep in sync with kernel timekeeping.
- */
 static __always_inline
 struct vdso_data *__arch_get_k_vdso_data(void)
 {
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/=
asm/vdso_datapage.h
index 248dee138f7b..a9686310be2c 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -9,29 +9,6 @@
  * 		      IBM Corp.
  */
=20
-
-/*
- * Note about this structure:
- *
- * This structure was historically called systemcfg and exposed to
- * userland via /proc/ppc64/systemcfg. Unfortunately, this became an
- * ABI issue as some proprietary software started relying on being able
- * to mmap() it, thus we have to keep the base layout at least for a
- * few kernel versions.
- *
- * However, since ppc32 doesn't suffer from this backward handicap,
- * a simpler version of the data structure is used there with only the
- * fields actually used by the vDSO.
- *
- */
-
-/*
- * If the major version changes we are incompatible.
- * Minor version changes are a hint.
- */
-#define SYSTEMCFG_MAJOR 1
-#define SYSTEMCFG_MINOR 1
-
 #ifndef __ASSEMBLY__
=20
 #include <linux/unistd.h>
@@ -40,41 +17,10 @@
=20
 #define SYSCALL_MAP_SIZE      ((NR_syscalls + 31) / 32)
=20
-/*
- * So here is the ppc64 backward compatible version
- */
-
 #ifdef CONFIG_PPC64
=20
 struct vdso_arch_data {
-	__u8  eye_catcher[16];		/* Eyecatcher: SYSTEMCFG:PPC64	0x00 */
-	struct {			/* Systemcfg version numbers	     */
-		__u32 major;		/* Major number			0x10 */
-		__u32 minor;		/* Minor number			0x14 */
-	} version;
-
-	/* Note about the platform flags: it now only contains the lpar
-	 * bit. The actual platform number is dead and buried
-	 */
-	__u32 platform;			/* Platform flags		0x18 */
-	__u32 processor;		/* Processor type		0x1C */
-	__u64 processorCount;		/* # of physical processors	0x20 */
-	__u64 physicalMemorySize;	/* Size of real memory(B)	0x28 */
-	__u64 tb_orig_stamp;		/* (NU) Timebase at boot	0x30 */
-	__u64 tb_ticks_per_sec;		/* Timebase tics / sec		0x38 */
-	__u64 tb_to_xs;			/* (NU) Inverse of TB to 2^20	0x40 */
-	__u64 stamp_xsec;		/* (NU)				0x48 */
-	__u64 tb_update_count;		/* (NU) Timebase atomicity ctr	0x50 */
-	__u32 tz_minuteswest;		/* (NU) Min. west of Greenwich	0x58 */
-	__u32 tz_dsttime;		/* (NU) Type of dst correction	0x5C */
-	__u32 dcache_size;		/* L1 d-cache size		0x60 */
-	__u32 dcache_line_size;		/* L1 d-cache line size		0x64 */
-	__u32 icache_size;		/* L1 i-cache size		0x68 */
-	__u32 icache_line_size;		/* L1 i-cache line size		0x6C */
-
-	/* those additional ones don't have to be located anywhere
-	 * special as they were not part of the original systemcfg
-	 */
+	__u64 tb_ticks_per_sec;			/* Timebase tics / sec */
 	__u32 dcache_block_size;		/* L1 d-cache block size     */
 	__u32 icache_block_size;		/* L1 i-cache block size     */
 	__u32 dcache_log_block_size;		/* L1 d-cache log block size */
@@ -88,11 +34,8 @@ struct vdso_arch_data {
=20
 #else /* CONFIG_PPC64 */
=20
-/*
- * And here is the simpler 32 bits version
- */
 struct vdso_arch_data {
-	__u64 tb_ticks_per_sec;		/* Timebase tics / sec		0x38 */
+	__u64 tb_ticks_per_sec;		/* Timebase tics / sec */
 	__u32 syscall_map[SYSCALL_MAP_SIZE]; /* Map of syscalls */
 	__u32 compat_syscall_map[0];	/* No compat syscalls on PPC32 */
 	struct vdso_data data[CS_BASES];
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_po=
werpc.c
index b109cd7b5d01..3816a2bf2b84 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -4,6 +4,7 @@
  */
=20
 #include <linux/init.h>
+#include <linux/memblock.h>
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
@@ -12,9 +13,10 @@
 #include <asm/machdep.h>
 #include <asm/vdso_datapage.h>
 #include <asm/rtas.h>
+#include <asm/systemcfg.h>
 #include <linux/uaccess.h>
=20
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
=20
 static loff_t page_map_seek(struct file *file, loff_t off, int whence)
 {
@@ -33,10 +35,9 @@ static int page_map_mmap( struct file *file, struct vm_are=
a_struct *vma )
 	if ((vma->vm_end - vma->vm_start) > PAGE_SIZE)
 		return -EINVAL;
=20
-	remap_pfn_range(vma, vma->vm_start,
-			__pa(pde_data(file_inode(file))) >> PAGE_SHIFT,
-			PAGE_SIZE, vma->vm_page_prot);
-	return 0;
+	return remap_pfn_range(vma, vma->vm_start,
+			       __pa(pde_data(file_inode(file))) >> PAGE_SHIFT,
+			       PAGE_SIZE, vma->vm_page_prot);
 }
=20
 static const struct proc_ops page_map_proc_ops =3D {
@@ -45,13 +46,35 @@ static const struct proc_ops page_map_proc_ops =3D {
 	.proc_mmap	=3D page_map_mmap,
 };
=20
+static union {
+	struct systemcfg	data;
+	u8			page[PAGE_SIZE];
+} systemcfg_data_store __page_aligned_data;
+struct systemcfg *systemcfg =3D &systemcfg_data_store.data;
=20
 static int __init proc_ppc64_init(void)
 {
 	struct proc_dir_entry *pde;
=20
+	strcpy((char *)systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
+	systemcfg->version.major =3D SYSTEMCFG_MAJOR;
+	systemcfg->version.minor =3D SYSTEMCFG_MINOR;
+	systemcfg->processor =3D mfspr(SPRN_PVR);
+	/*
+	 * Fake the old platform number for pSeries and add
+	 * in LPAR bit if necessary
+	 */
+	systemcfg->platform =3D 0x100;
+	if (firmware_has_feature(FW_FEATURE_LPAR))
+		systemcfg->platform |=3D 1;
+	systemcfg->physicalMemorySize =3D memblock_phys_mem_size();
+	systemcfg->dcache_size =3D ppc64_caches.l1d.size;
+	systemcfg->dcache_line_size =3D ppc64_caches.l1d.line_size;
+	systemcfg->icache_size =3D ppc64_caches.l1i.size;
+	systemcfg->icache_line_size =3D ppc64_caches.l1i.line_size;
+
 	pde =3D proc_create_data("powerpc/systemcfg", S_IFREG | 0444, NULL,
-			       &page_map_proc_ops, vdso_data);
+			       &page_map_proc_ops, systemcfg);
 	if (!pde)
 		return 1;
 	proc_set_size(pde, PAGE_SIZE);
@@ -60,7 +83,7 @@ static int __init proc_ppc64_init(void)
 }
 __initcall(proc_ppc64_init);
=20
-#endif /* CONFIG_PPC64 */
+#endif /* CONFIG_PPC64_PROC_SYSTEMCFG */
=20
 /*
  * Create the ppc64 and ppc64/rtas directories early. This allows us to
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-c=
ommon.c
index 943430077375..0b732d3b283b 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -67,6 +67,7 @@
 #include <asm/cpu_has_feature.h>
 #include <asm/kasan.h>
 #include <asm/mce.h>
+#include <asm/systemcfg.h>
=20
 #include "setup.h"
=20
@@ -560,7 +561,9 @@ void __init smp_setup_cpu_maps(void)
 	out:
 		of_node_put(dn);
 	}
-	vdso_data->processorCount =3D num_present_cpus();
+#endif
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+	systemcfg->processorCount =3D num_present_cpus();
 #endif /* CONFIG_PPC64 */
=20
         /* Initialize CPU <=3D> thread mapping/
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 4ab9b8cee77a..5ac7084eebc0 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -61,6 +61,7 @@
 #include <asm/ftrace.h>
 #include <asm/kup.h>
 #include <asm/fadump.h>
+#include <asm/systemcfg.h>
=20
 #include <trace/events/ipi.h>
=20
@@ -1186,8 +1187,8 @@ int generic_cpu_disable(void)
 		return -EBUSY;
=20
 	set_cpu_online(cpu, false);
-#ifdef CONFIG_PPC64
-	vdso_data->processorCount--;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+	systemcfg->processorCount--;
 #endif
 	/* Update affinity of all IRQs previously aimed at this CPU */
 	irq_migrate_all_off_this_cpu();
@@ -1642,10 +1643,12 @@ void start_secondary(void *unused)
=20
 	secondary_cpu_time_init();
=20
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
 	if (system_state =3D=3D SYSTEM_RUNNING)
-		vdso_data->processorCount++;
+		systemcfg->processorCount++;
+#endif
=20
+#ifdef CONFIG_PPC64
 	vdso_getcpu_init();
 #endif
 	set_numa_node(numa_cpu_lookup_table[cpu]);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 0ff9f038e800..0727332ad86f 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -71,11 +71,11 @@
 #include <asm/vdso_datapage.h>
 #include <asm/firmware.h>
 #include <asm/mce.h>
+#include <asm/systemcfg.h>
=20
 /* powerpc clocksource/clockevent code */
=20
 #include <linux/clockchips.h>
-#include <linux/timekeeper_internal.h>
=20
 static u64 timebase_read(struct clocksource *);
 static struct clocksource clocksource_timebase =3D {
@@ -951,6 +951,9 @@ void __init time_init(void)
 	}
=20
 	vdso_data->tb_ticks_per_sec =3D tb_ticks_per_sec;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+	systemcfg->tb_ticks_per_sec =3D tb_ticks_per_sec;
+#endif
=20
 	/* initialise and enable the large decrementer (if we have one) */
 	set_decrementer_max();
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ee4b9d676cff..924f7f4fa597 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -16,7 +16,6 @@
 #include <linux/user.h>
 #include <linux/elf.h>
 #include <linux/security.h>
-#include <linux/memblock.h>
 #include <linux/syscalls.h>
 #include <linux/time_namespace.h>
 #include <vdso/datapage.h>
@@ -349,25 +348,6 @@ static struct page ** __init vdso_setup_pages(void *star=
t, void *end)
 static int __init vdso_init(void)
 {
 #ifdef CONFIG_PPC64
-	/*
-	 * Fill up the "systemcfg" stuff for backward compatibility
-	 */
-	strcpy((char *)vdso_data->eye_catcher, "SYSTEMCFG:PPC64");
-	vdso_data->version.major =3D SYSTEMCFG_MAJOR;
-	vdso_data->version.minor =3D SYSTEMCFG_MINOR;
-	vdso_data->processor =3D mfspr(SPRN_PVR);
-	/*
-	 * Fake the old platform number for pSeries and add
-	 * in LPAR bit if necessary
-	 */
-	vdso_data->platform =3D 0x100;
-	if (firmware_has_feature(FW_FEATURE_LPAR))
-		vdso_data->platform |=3D 1;
-	vdso_data->physicalMemorySize =3D memblock_phys_mem_size();
-	vdso_data->dcache_size =3D ppc64_caches.l1d.size;
-	vdso_data->dcache_line_size =3D ppc64_caches.l1d.line_size;
-	vdso_data->icache_size =3D ppc64_caches.l1i.size;
-	vdso_data->icache_line_size =3D ppc64_caches.l1i.line_size;
 	vdso_data->dcache_block_size =3D ppc64_caches.l1d.block_size;
 	vdso_data->icache_block_size =3D ppc64_caches.l1i.block_size;
 	vdso_data->dcache_log_block_size =3D ppc64_caches.l1d.log_block_size;
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/po=
wernv/smp.c
index 8f14f0581a21..2e9da58195f5 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -36,6 +36,7 @@
 #include <asm/kexec.h>
 #include <asm/reg.h>
 #include <asm/powernv.h>
+#include <asm/systemcfg.h>
=20
 #include "powernv.h"
=20
@@ -136,7 +137,9 @@ static int pnv_smp_cpu_disable(void)
 	 * the generic fixup_irqs. --BenH.
 	 */
 	set_cpu_online(cpu, false);
-	vdso_data->processorCount--;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+	systemcfg->processorCount--;
+#endif
 	if (cpu =3D=3D boot_cpuid)
 		boot_cpuid =3D cpumask_any(cpu_online_mask);
 	if (xive_enabled())
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/plat=
forms/pseries/hotplug-cpu.c
index 6838a0fcda29..bc6926dbf148 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -33,6 +33,7 @@
 #include <asm/xive.h>
 #include <asm/plpar_wrappers.h>
 #include <asm/topology.h>
+#include <asm/systemcfg.h>
=20
 #include "pseries.h"
=20
@@ -83,7 +84,9 @@ static int pseries_cpu_disable(void)
 	int cpu =3D smp_processor_id();
=20
 	set_cpu_online(cpu, false);
-	vdso_data->processorCount--;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+	systemcfg->processorCount--;
+#endif
=20
 	/*fix boot_cpuid here*/
 	if (cpu =3D=3D boot_cpuid)
diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platform=
s/pseries/lparcfg.c
index 62da20f9700a..cc22924f159f 100644
--- a/arch/powerpc/platforms/pseries/lparcfg.c
+++ b/arch/powerpc/platforms/pseries/lparcfg.c
@@ -29,7 +29,6 @@
 #include <asm/firmware.h>
 #include <asm/rtas.h>
 #include <asm/time.h>
-#include <asm/vdso_datapage.h>
 #include <asm/vio.h>
 #include <asm/mmu.h>
 #include <asm/machdep.h>
@@ -530,7 +529,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void =
*v)
 		lrdrp =3D of_get_property(rtas_node, "ibm,lrdr-capacity", NULL);
=20
 	if (lrdrp =3D=3D NULL) {
-		partition_potential_processors =3D vdso_data->processorCount;
+		partition_potential_processors =3D num_possible_cpus();
 	} else {
 		partition_potential_processors =3D be32_to_cpup(lrdrp + 4);
 	}
@@ -553,7 +552,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void =
*v)
 	} else {		/* non SPLPAR case */
=20
 		seq_printf(m, "system_active_processors=3D%d\n",
-			   partition_potential_processors);
+			   partition_active_processors);
=20
 		seq_printf(m, "system_potential_processors=3D%d\n",
 			   partition_potential_processors);
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 62545946ecf4..c278280c134f 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -50,7 +50,7 @@ config RISCV
 	select ARCH_HAS_SYSCALL_WRAPPER
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAS_UBSAN
-	select ARCH_HAS_VDSO_DATA
+	select ARCH_HAS_VDSO_TIME_DATA
 	select ARCH_KEEP_MEMBLOCK if ACPI
 	select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE	if 64BIT && MMU
 	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h
index 32d308a3355f..9875399827c7 100644
--- a/arch/riscv/include/asm/page.h
+++ b/arch/riscv/include/asm/page.h
@@ -12,9 +12,7 @@
 #include <linux/pfn.h>
 #include <linux/const.h>
=20
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE - 1))
+#include <vdso/page.h>
=20
 #define HPAGE_SHIFT		PMD_SHIFT
 #define HPAGE_SIZE		(_AC(1, UL) << HPAGE_SHIFT)
diff --git a/arch/riscv/include/asm/vdso/data.h b/arch/riscv/include/asm/vdso=
/time_data.h
similarity index 71%
rename from arch/riscv/include/asm/vdso/data.h
rename to arch/riscv/include/asm/vdso/time_data.h
index dc2f76f58b76..dfa65228999b 100644
--- a/arch/riscv/include/asm/vdso/data.h
+++ b/arch/riscv/include/asm/vdso/time_data.h
@@ -1,12 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __RISCV_ASM_VDSO_DATA_H
-#define __RISCV_ASM_VDSO_DATA_H
+#ifndef __RISCV_ASM_VDSO_TIME_DATA_H
+#define __RISCV_ASM_VDSO_TIME_DATA_H
=20
 #include <linux/types.h>
 #include <vdso/datapage.h>
 #include <asm/hwprobe.h>
=20
-struct arch_vdso_data {
+struct arch_vdso_time_data {
 	/* Stash static answers to the hwprobe queries when all CPUs are selected. =
*/
 	__u64 all_cpu_hwprobe_values[RISCV_HWPROBE_MAX_KEY + 1];
=20
@@ -14,4 +14,4 @@ struct arch_vdso_data {
 	__u8 homogeneous_cpus;
 };
=20
-#endif /* __RISCV_ASM_VDSO_DATA_H */
+#endif /* __RISCV_ASM_VDSO_TIME_DATA_H */
diff --git a/arch/riscv/include/asm/vdso/vsyscall.h b/arch/riscv/include/asm/=
vdso/vsyscall.h
index 82fd5d83bd60..e8a9c4b53c0c 100644
--- a/arch/riscv/include/asm/vdso/vsyscall.h
+++ b/arch/riscv/include/asm/vdso/vsyscall.h
@@ -4,14 +4,10 @@
=20
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
=20
 extern struct vdso_data *vdso_data;
=20
-/*
- * Update the vDSO data page to keep in sync with kernel timekeeping.
- */
 static __always_inline struct vdso_data *__riscv_get_k_vdso_data(void)
 {
 	return vdso_data;
diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c
index cea0ca2bf2a2..711a31f27c3d 100644
--- a/arch/riscv/kernel/sys_hwprobe.c
+++ b/arch/riscv/kernel/sys_hwprobe.c
@@ -402,7 +402,7 @@ static int do_riscv_hwprobe(struct riscv_hwprobe __user *=
pairs,
 static int __init init_hwprobe_vdso_data(void)
 {
 	struct vdso_data *vd =3D __arch_get_k_vdso_data();
-	struct arch_vdso_data *avd =3D &vd->arch_data;
+	struct arch_vdso_time_data *avd =3D &vd->arch_data;
 	u64 id_bitsmash =3D 0;
 	struct riscv_hwprobe pair;
 	int key;
diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 98315b98256d..3ca3ae4277e1 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -23,11 +23,6 @@ enum vvar_pages {
 	VVAR_NR_PAGES,
 };
=20
-enum rv_vdso_map {
-	RV_VDSO_MAP_VVAR,
-	RV_VDSO_MAP_VDSO,
-};
-
 #define VVAR_SIZE  (VVAR_NR_PAGES << PAGE_SHIFT)
=20
 static union vdso_data_store vdso_data_store __page_aligned_data;
@@ -38,8 +33,6 @@ struct __vdso_info {
 	const char *vdso_code_start;
 	const char *vdso_code_end;
 	unsigned long vdso_pages;
-	/* Data Mapping */
-	struct vm_special_mapping *dm;
 	/* Code Mapping */
 	struct vm_special_mapping *cm;
 };
@@ -92,6 +85,8 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
 	return (struct vdso_data *)(vvar_page);
 }
=20
+static const struct vm_special_mapping rv_vvar_map;
+
 /*
  * The vvar mapping contains data for a specific time namespace, so when a t=
ask
  * changes namespace we must unmap its vvar data for the old namespace.
@@ -108,12 +103,8 @@ int vdso_join_timens(struct task_struct *task, struct ti=
me_namespace *ns)
 	mmap_read_lock(mm);
=20
 	for_each_vma(vmi, vma) {
-		if (vma_is_special_mapping(vma, vdso_info.dm))
-			zap_vma_pages(vma);
-#ifdef CONFIG_COMPAT
-		if (vma_is_special_mapping(vma, compat_vdso_info.dm))
+		if (vma_is_special_mapping(vma, &rv_vvar_map))
 			zap_vma_pages(vma);
-#endif
 	}
=20
 	mmap_read_unlock(mm);
@@ -155,43 +146,34 @@ static vm_fault_t vvar_fault(const struct vm_special_ma=
pping *sm,
 	return vmf_insert_pfn(vma, vmf->address, pfn);
 }
=20
-static struct vm_special_mapping rv_vdso_maps[] __ro_after_init =3D {
-	[RV_VDSO_MAP_VVAR] =3D {
-		.name   =3D "[vvar]",
-		.fault =3D vvar_fault,
-	},
-	[RV_VDSO_MAP_VDSO] =3D {
-		.name   =3D "[vdso]",
-		.mremap =3D vdso_mremap,
-	},
+static const struct vm_special_mapping rv_vvar_map =3D {
+	.name   =3D "[vvar]",
+	.fault =3D vvar_fault,
+};
+
+static struct vm_special_mapping rv_vdso_map __ro_after_init =3D {
+	.name   =3D "[vdso]",
+	.mremap =3D vdso_mremap,
 };
=20
 static struct __vdso_info vdso_info __ro_after_init =3D {
 	.name =3D "vdso",
 	.vdso_code_start =3D vdso_start,
 	.vdso_code_end =3D vdso_end,
-	.dm =3D &rv_vdso_maps[RV_VDSO_MAP_VVAR],
-	.cm =3D &rv_vdso_maps[RV_VDSO_MAP_VDSO],
+	.cm =3D &rv_vdso_map,
 };
=20
 #ifdef CONFIG_COMPAT
-static struct vm_special_mapping rv_compat_vdso_maps[] __ro_after_init =3D {
-	[RV_VDSO_MAP_VVAR] =3D {
-		.name   =3D "[vvar]",
-		.fault =3D vvar_fault,
-	},
-	[RV_VDSO_MAP_VDSO] =3D {
-		.name   =3D "[vdso]",
-		.mremap =3D vdso_mremap,
-	},
+static struct vm_special_mapping rv_compat_vdso_map __ro_after_init =3D {
+	.name   =3D "[vdso]",
+	.mremap =3D vdso_mremap,
 };
=20
 static struct __vdso_info compat_vdso_info __ro_after_init =3D {
 	.name =3D "compat_vdso",
 	.vdso_code_start =3D compat_vdso_start,
 	.vdso_code_end =3D compat_vdso_end,
-	.dm =3D &rv_compat_vdso_maps[RV_VDSO_MAP_VVAR],
-	.cm =3D &rv_compat_vdso_maps[RV_VDSO_MAP_VDSO],
+	.cm =3D &rv_compat_vdso_map,
 };
 #endif
=20
@@ -227,7 +209,7 @@ static int __setup_additional_pages(struct mm_struct *mm,
 	}
=20
 	ret =3D _install_special_mapping(mm, vdso_base, VVAR_SIZE,
-		(VM_READ | VM_MAYREAD | VM_PFNMAP), vdso_info->dm);
+		(VM_READ | VM_MAYREAD | VM_PFNMAP), &rv_vvar_map);
 	if (IS_ERR(ret))
 		goto up_fail;
=20
diff --git a/arch/riscv/kernel/vdso/hwprobe.c b/arch/riscv/kernel/vdso/hwprob=
e.c
index 1e926e4b5881..a158c029344f 100644
--- a/arch/riscv/kernel/vdso/hwprobe.c
+++ b/arch/riscv/kernel/vdso/hwprobe.c
@@ -17,7 +17,7 @@ static int riscv_vdso_get_values(struct riscv_hwprobe *pair=
s, size_t pair_count,
 				 unsigned int flags)
 {
 	const struct vdso_data *vd =3D __arch_get_vdso_data();
-	const struct arch_vdso_data *avd =3D &vd->arch_data;
+	const struct arch_vdso_time_data *avd =3D &vd->arch_data;
 	bool all_cpus =3D !cpusetsize && !cpus;
 	struct riscv_hwprobe *p =3D pairs;
 	struct riscv_hwprobe *end =3D pairs + pair_count;
@@ -52,7 +52,7 @@ static int riscv_vdso_get_cpus(struct riscv_hwprobe *pairs,=
 size_t pair_count,
 			       unsigned int flags)
 {
 	const struct vdso_data *vd =3D __arch_get_vdso_data();
-	const struct arch_vdso_data *avd =3D &vd->arch_data;
+	const struct arch_vdso_time_data *avd =3D &vd->arch_data;
 	struct riscv_hwprobe *p =3D pairs;
 	struct riscv_hwprobe *end =3D pairs + pair_count;
 	unsigned char *c =3D (unsigned char *)cpus;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index d339fe4fdedf..8cdd8359e00c 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -88,7 +88,7 @@ config S390
 	select ARCH_HAS_STRICT_MODULE_RWX
 	select ARCH_HAS_SYSCALL_WRAPPER
 	select ARCH_HAS_UBSAN
-	select ARCH_HAS_VDSO_DATA
+	select ARCH_HAS_VDSO_TIME_DATA
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select ARCH_INLINE_READ_LOCK
 	select ARCH_INLINE_READ_LOCK_BH
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 73e1e03317b4..b7ba87f89761 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -11,14 +11,8 @@
 #include <linux/const.h>
 #include <asm/types.h>
=20
-#define _PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define _PAGE_SIZE	(_AC(1, UL) << _PAGE_SHIFT)
-#define _PAGE_MASK	(~(_PAGE_SIZE - 1))
-
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	_PAGE_SHIFT
-#define PAGE_SIZE	_PAGE_SIZE
-#define PAGE_MASK	_PAGE_MASK
+#include <vdso/page.h>
+
 #define PAGE_DEFAULT_ACC	_AC(0, UL)
 /* storage-protection override */
 #define PAGE_SPO_ACC		9
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 0ffbaf741955..8b67036edb69 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -338,7 +338,7 @@ static inline int is_module_addr(void *addr)
 #define _REGION2_INDEX	(0x7ffUL << _REGION2_SHIFT)
 #define _REGION3_INDEX	(0x7ffUL << _REGION3_SHIFT)
 #define _SEGMENT_INDEX	(0x7ffUL << _SEGMENT_SHIFT)
-#define _PAGE_INDEX	(0xffUL  << _PAGE_SHIFT)
+#define _PAGE_INDEX	(0xffUL  << PAGE_SHIFT)
=20
 #define _REGION1_SIZE	(1UL << _REGION1_SHIFT)
 #define _REGION2_SIZE	(1UL << _REGION2_SHIFT)
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
index 91061f0279be..92c73e4d97a9 100644
--- a/arch/s390/include/asm/vdso.h
+++ b/arch/s390/include/asm/vdso.h
@@ -12,9 +12,6 @@ int vdso_getcpu_init(void);
=20
 #endif /* __ASSEMBLY__ */
=20
-/* Default link address for the vDSO */
-#define VDSO_LBASE	0
-
 #define __VVAR_PAGES	2
=20
 #define VDSO_VERSION_STRING	LINUX_2.6.29
diff --git a/arch/s390/include/asm/vdso/data.h b/arch/s390/include/asm/vdso/d=
ata.h
deleted file mode 100644
index 0e2b40ef69b0..000000000000
--- a/arch/s390/include/asm/vdso/data.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __S390_ASM_VDSO_DATA_H
-#define __S390_ASM_VDSO_DATA_H
-
-#include <linux/types.h>
-
-struct arch_vdso_data {
-	__s64 tod_steering_delta;
-	__u64 tod_steering_end;
-};
-
-#endif /* __S390_ASM_VDSO_DATA_H */
diff --git a/arch/s390/include/asm/vdso/time_data.h b/arch/s390/include/asm/v=
dso/time_data.h
new file mode 100644
index 000000000000..8a08752422e6
--- /dev/null
+++ b/arch/s390/include/asm/vdso/time_data.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __S390_ASM_VDSO_TIME_DATA_H
+#define __S390_ASM_VDSO_TIME_DATA_H
+
+#include <linux/types.h>
+
+struct arch_vdso_time_data {
+	__s64 tod_steering_delta;
+	__u64 tod_steering_end;
+};
+
+#endif /* __S390_ASM_VDSO_TIME_DATA_H */
diff --git a/arch/s390/include/asm/vdso/vsyscall.h b/arch/s390/include/asm/vd=
so/vsyscall.h
index 3c5d5e47814e..3eb576ecd3bd 100644
--- a/arch/s390/include/asm/vdso/vsyscall.h
+++ b/arch/s390/include/asm/vdso/vsyscall.h
@@ -7,7 +7,6 @@
 #ifndef __ASSEMBLY__
=20
 #include <linux/hrtimer.h>
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
 #include <asm/vdso.h>
=20
@@ -17,10 +16,6 @@ enum vvar_pages {
 	VVAR_NR_PAGES
 };
=20
-/*
- * Update the vDSO data page to keep in sync with kernel timekeeping.
- */
-
 static __always_inline struct vdso_data *__s390_get_k_vdso_data(void)
 {
 	return vdso_data;
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index b713effe0579..4fae6c701784 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -36,7 +36,6 @@
 #include <linux/profile.h>
 #include <linux/timex.h>
 #include <linux/notifier.h>
-#include <linux/timekeeper_internal.h>
 #include <linux/clockchips.h>
 #include <linux/gfp.h>
 #include <linux/kprobes.h>
diff --git a/arch/s390/kernel/vdso32/vdso32.lds.S b/arch/s390/kernel/vdso32/v=
dso32.lds.S
index 65b9513a5a0e..c916c4f73f76 100644
--- a/arch/s390/kernel/vdso32/vdso32.lds.S
+++ b/arch/s390/kernel/vdso32/vdso32.lds.S
@@ -16,7 +16,7 @@ SECTIONS
 #ifdef CONFIG_TIME_NS
 	PROVIDE(_timens_data =3D _vdso_data + PAGE_SIZE);
 #endif
-	. =3D VDSO_LBASE + SIZEOF_HEADERS;
+	. =3D SIZEOF_HEADERS;
=20
 	.hash		: { *(.hash) }			:text
 	.gnu.hash	: { *(.gnu.hash) }
diff --git a/arch/s390/kernel/vdso64/vdso64.lds.S b/arch/s390/kernel/vdso64/v=
dso64.lds.S
index 753040a4b5ab..ec42b7d9cb53 100644
--- a/arch/s390/kernel/vdso64/vdso64.lds.S
+++ b/arch/s390/kernel/vdso64/vdso64.lds.S
@@ -18,7 +18,7 @@ SECTIONS
 #ifdef CONFIG_TIME_NS
 	PROVIDE(_timens_data =3D _vdso_data + PAGE_SIZE);
 #endif
-	. =3D VDSO_LBASE + SIZEOF_HEADERS;
+	. =3D SIZEOF_HEADERS;
=20
 	.hash		: { *(.hash) }			:text
 	.gnu.hash	: { *(.gnu.hash) }
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index ad8b0d6b77ea..12e10269dfcd 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -147,7 +147,7 @@ static void dump_pagetable(unsigned long asce, unsigned l=
ong address)
 			goto out;
 		table =3D __va(entry & _SEGMENT_ENTRY_ORIGIN);
 	}
-	table +=3D (address & _PAGE_INDEX) >> _PAGE_SHIFT;
+	table +=3D (address & _PAGE_INDEX) >> PAGE_SHIFT;
 	if (get_kernel_nofault(entry, table))
 		goto bad;
 	pr_cont("P:%016lx ", entry);
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index eb0b51a36be0..346ec059c8bd 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -851,7 +851,7 @@ static inline unsigned long *gmap_table_walk(struct gmap =
*gmap,
 		if (*table & _REGION_ENTRY_INVALID)
 			return NULL;
 		table =3D __va(*table & _SEGMENT_ENTRY_ORIGIN);
-		table +=3D (gaddr & _PAGE_INDEX) >> _PAGE_SHIFT;
+		table +=3D (gaddr & _PAGE_INDEX) >> PAGE_SHIFT;
 	}
 	return table;
 }
@@ -1317,7 +1317,7 @@ static void gmap_unshadow_page(struct gmap *sg, unsigne=
d long raddr)
 	table =3D gmap_table_walk(sg, raddr, 0); /* get page table pointer */
 	if (!table || *table & _PAGE_INVALID)
 		return;
-	gmap_call_notifier(sg, raddr, raddr + _PAGE_SIZE - 1);
+	gmap_call_notifier(sg, raddr, raddr + PAGE_SIZE - 1);
 	ptep_unshadow_pte(sg->mm, raddr, (pte_t *) table);
 }
=20
@@ -1335,7 +1335,7 @@ static void __gmap_unshadow_pgt(struct gmap *sg, unsign=
ed long raddr,
 	int i;
=20
 	BUG_ON(!gmap_is_shadow(sg));
-	for (i =3D 0; i < _PAGE_ENTRIES; i++, raddr +=3D _PAGE_SIZE)
+	for (i =3D 0; i < _PAGE_ENTRIES; i++, raddr +=3D PAGE_SIZE)
 		pgt[i] =3D _PAGE_INVALID;
 }
=20
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c
index f691e0fb66a2..58696a0c4e4a 100644
--- a/arch/s390/mm/pgalloc.c
+++ b/arch/s390/mm/pgalloc.c
@@ -278,7 +278,7 @@ static inline unsigned long base_##NAME##_addr_end(unsign=
ed long addr,	\
 	return (next - 1) < (end - 1) ? next : end;			\
 }
=20
-BASE_ADDR_END_FUNC(page,    _PAGE_SIZE)
+BASE_ADDR_END_FUNC(page,    PAGE_SIZE)
 BASE_ADDR_END_FUNC(segment, _SEGMENT_SIZE)
 BASE_ADDR_END_FUNC(region3, _REGION3_SIZE)
 BASE_ADDR_END_FUNC(region2, _REGION2_SIZE)
@@ -302,7 +302,7 @@ static int base_page_walk(unsigned long *origin, unsigned=
 long addr,
 	if (!alloc)
 		return 0;
 	pte =3D origin;
-	pte +=3D (addr & _PAGE_INDEX) >> _PAGE_SHIFT;
+	pte +=3D (addr & _PAGE_INDEX) >> PAGE_SHIFT;
 	do {
 		next =3D base_page_addr_end(addr, end);
 		*pte =3D base_lra(addr);
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
index f780b467e75d..fc39b8171bfb 100644
--- a/arch/sh/include/asm/page.h
+++ b/arch/sh/include/asm/page.h
@@ -8,10 +8,8 @@
=20
 #include <linux/const.h>
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
+
 #define PTE_MASK	PAGE_MASK
=20
 #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)
diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_3=
2.h
index 9977c77374cd..9954254ea569 100644
--- a/arch/sparc/include/asm/page_32.h
+++ b/arch/sparc/include/asm/page_32.h
@@ -11,9 +11,7 @@
=20
 #include <linux/const.h>
=20
-#define PAGE_SHIFT   CONFIG_PAGE_SHIFT
-#define PAGE_SIZE    (_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK    (~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #ifndef __ASSEMBLY__
=20
diff --git a/arch/sparc/include/asm/page_64.h b/arch/sparc/include/asm/page_6=
4.h
index e9bd24821c93..2a68ff5b6eab 100644
--- a/arch/sparc/include/asm/page_64.h
+++ b/arch/sparc/include/asm/page_64.h
@@ -4,9 +4,7 @@
=20
 #include <linux/const.h>
=20
-#define PAGE_SHIFT   CONFIG_PAGE_SHIFT
-#define PAGE_SIZE    (_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK    (~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 /* Flushing for D-cache alias handling is only needed if
  * the page size is smaller than 16K.
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
index 9ef9a8aedfa6..834313ecd3d6 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -9,10 +9,7 @@
=20
 #include <linux/const.h>
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #ifndef __ASSEMBLY__
=20
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso=
-layout.lds.S
index bafa73f09e92..872947c1004c 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #include <asm/vdso.h>
+#include <asm/vdso/vsyscall.h>
=20
 /*
  * Linker script for vDSO.  This is an ELF shared object prelinked to
@@ -16,23 +17,16 @@ SECTIONS
 	 * segment.
 	 */
=20
-	vvar_start =3D . - 4 * PAGE_SIZE;
+	vvar_start =3D . - __VVAR_PAGES * PAGE_SIZE;
 	vvar_page  =3D vvar_start;
=20
-	/* Place all vvars at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset) vvar_ ## name =3D vvar_page + offset;
-#include <asm/vvar.h>
-#undef EMIT_VVAR
+	vdso_rng_data =3D vvar_page + __VDSO_RND_DATA_OFFSET;
=20
-	pvclock_page =3D vvar_start + PAGE_SIZE;
-	hvclock_page =3D vvar_start + 2 * PAGE_SIZE;
-	timens_page  =3D vvar_start + 3 * PAGE_SIZE;
+	timens_page  =3D vvar_start + PAGE_SIZE;
=20
-#undef _ASM_X86_VVAR_H
-	/* Place all vvars in timens too at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset) timens_ ## name =3D timens_page + offset;
-#include <asm/vvar.h>
-#undef EMIT_VVAR
+	vclock_pages =3D vvar_start + VDSO_NR_VCLOCK_PAGES * PAGE_SIZE;
+	pvclock_page =3D vclock_pages + VDSO_PAGE_PVCLOCK_OFFSET * PAGE_SIZE;
+	hvclock_page =3D vclock_pages + VDSO_PAGE_HVCLOCK_OFFSET * PAGE_SIZE;
=20
 	. =3D SIZEOF_HEADERS;
=20
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index b8fed8b8b9cc..bfc7cabf4017 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -20,26 +20,20 @@
 #include <asm/vgtod.h>
 #include <asm/proto.h>
 #include <asm/vdso.h>
-#include <asm/vvar.h>
 #include <asm/tlb.h>
 #include <asm/page.h>
 #include <asm/desc.h>
 #include <asm/cpufeature.h>
+#include <asm/vdso/vsyscall.h>
 #include <clocksource/hyperv_timer.h>
=20
-#undef _ASM_X86_VVAR_H
-#define EMIT_VVAR(name, offset)	\
-	const size_t name ## _offset =3D offset;
-#include <asm/vvar.h>
-
 struct vdso_data *arch_get_vdso_data(void *vvar_page)
 {
-	return (struct vdso_data *)(vvar_page + _vdso_data_offset);
+	return (struct vdso_data *)vvar_page;
 }
-#undef EMIT_VVAR
=20
-DEFINE_VVAR(struct vdso_data, _vdso_data);
-DEFINE_VVAR_SINGLE(struct vdso_rng_data, _vdso_rng_data);
+static union vdso_data_store vdso_data_store __page_aligned_data;
+struct vdso_data *vdso_data =3D vdso_data_store.data;
=20
 unsigned int vclocks_used __read_mostly;
=20
@@ -154,7 +148,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapp=
ing *sm,
 	if (sym_offset =3D=3D image->sym_vvar_page) {
 		struct page *timens_page =3D find_timens_vvar_page(vma);
=20
-		pfn =3D __pa_symbol(&__vvar_page) >> PAGE_SHIFT;
+		pfn =3D __pa_symbol(vdso_data) >> PAGE_SHIFT;
=20
 		/*
 		 * If a task belongs to a time namespace then a namespace
@@ -182,32 +176,52 @@ static vm_fault_t vvar_fault(const struct vm_special_ma=
pping *sm,
 		}
=20
 		return vmf_insert_pfn(vma, vmf->address, pfn);
-	} else if (sym_offset =3D=3D image->sym_pvclock_page) {
-		struct pvclock_vsyscall_time_info *pvti =3D
-			pvclock_get_pvti_cpu0_va();
-		if (pvti && vclock_was_used(VDSO_CLOCKMODE_PVCLOCK)) {
-			return vmf_insert_pfn_prot(vma, vmf->address,
-					__pa(pvti) >> PAGE_SHIFT,
-					pgprot_decrypted(vma->vm_page_prot));
-		}
-	} else if (sym_offset =3D=3D image->sym_hvclock_page) {
-		pfn =3D hv_get_tsc_pfn();
=20
-		if (pfn && vclock_was_used(VDSO_CLOCKMODE_HVCLOCK))
-			return vmf_insert_pfn(vma, vmf->address, pfn);
 	} else if (sym_offset =3D=3D image->sym_timens_page) {
 		struct page *timens_page =3D find_timens_vvar_page(vma);
=20
 		if (!timens_page)
 			return VM_FAULT_SIGBUS;
=20
-		pfn =3D __pa_symbol(&__vvar_page) >> PAGE_SHIFT;
+		pfn =3D __pa_symbol(vdso_data) >> PAGE_SHIFT;
 		return vmf_insert_pfn(vma, vmf->address, pfn);
 	}
=20
 	return VM_FAULT_SIGBUS;
 }
=20
+static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
+				    struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+	switch (vmf->pgoff) {
+#ifdef CONFIG_PARAVIRT_CLOCK
+	case VDSO_PAGE_PVCLOCK_OFFSET:
+	{
+		struct pvclock_vsyscall_time_info *pvti =3D
+			pvclock_get_pvti_cpu0_va();
+
+		if (pvti && vclock_was_used(VDSO_CLOCKMODE_PVCLOCK))
+			return vmf_insert_pfn_prot(vma, vmf->address,
+					__pa(pvti) >> PAGE_SHIFT,
+					pgprot_decrypted(vma->vm_page_prot));
+		break;
+	}
+#endif /* CONFIG_PARAVIRT_CLOCK */
+#ifdef CONFIG_HYPERV_TIMER
+	case VDSO_PAGE_HVCLOCK_OFFSET:
+	{
+		unsigned long pfn =3D hv_get_tsc_pfn();
+
+		if (pfn && vclock_was_used(VDSO_CLOCKMODE_HVCLOCK))
+			return vmf_insert_pfn(vma, vmf->address, pfn);
+		break;
+	}
+#endif /* CONFIG_HYPERV_TIMER */
+	}
+
+	return VM_FAULT_SIGBUS;
+}
+
 static const struct vm_special_mapping vdso_mapping =3D {
 	.name =3D "[vdso]",
 	.fault =3D vdso_fault,
@@ -217,6 +231,10 @@ static const struct vm_special_mapping vvar_mapping =3D {
 	.name =3D "[vvar]",
 	.fault =3D vvar_fault,
 };
+static const struct vm_special_mapping vvar_vclock_mapping =3D {
+	.name =3D "[vvar_vclock]",
+	.fault =3D vvar_vclock_fault,
+};
=20
 /*
  * Add vdso and vvar mappings to current process.
@@ -259,7 +277,7 @@ static int map_vdso(const struct vdso_image *image, unsig=
ned long addr)
=20
 	vma =3D _install_special_mapping(mm,
 				       addr,
-				       -image->sym_vvar_start,
+				       (__VVAR_PAGES - VDSO_NR_VCLOCK_PAGES) * PAGE_SIZE,
 				       VM_READ|VM_MAYREAD|VM_IO|VM_DONTDUMP|
 				       VM_PFNMAP,
 				       &vvar_mapping);
@@ -267,11 +285,26 @@ static int map_vdso(const struct vdso_image *image, uns=
igned long addr)
 	if (IS_ERR(vma)) {
 		ret =3D PTR_ERR(vma);
 		do_munmap(mm, text_start, image->size, NULL);
-	} else {
-		current->mm->context.vdso =3D (void __user *)text_start;
-		current->mm->context.vdso_image =3D image;
+		goto up_fail;
 	}
=20
+	vma =3D _install_special_mapping(mm,
+				       addr + (__VVAR_PAGES - VDSO_NR_VCLOCK_PAGES) * PAGE_SIZE,
+				       VDSO_NR_VCLOCK_PAGES * PAGE_SIZE,
+				       VM_READ|VM_MAYREAD|VM_IO|VM_DONTDUMP|
+				       VM_PFNMAP,
+				       &vvar_vclock_mapping);
+
+	if (IS_ERR(vma)) {
+		ret =3D PTR_ERR(vma);
+		do_munmap(mm, text_start, image->size, NULL);
+		do_munmap(mm, addr, image->size, NULL);
+		goto up_fail;
+	}
+
+	current->mm->context.vdso =3D (void __user *)text_start;
+	current->mm->context.vdso_image =3D image;
+
 up_fail:
 	mmap_write_unlock(mm);
 	return ret;
@@ -293,7 +326,8 @@ int map_vdso_once(const struct vdso_image *image, unsigne=
d long addr)
 	 */
 	for_each_vma(vmi, vma) {
 		if (vma_is_special_mapping(vma, &vdso_mapping) ||
-				vma_is_special_mapping(vma, &vvar_mapping)) {
+				vma_is_special_mapping(vma, &vvar_mapping) ||
+				vma_is_special_mapping(vma, &vvar_vclock_mapping)) {
 			mmap_write_unlock(mm);
 			return -EEXIST;
 		}
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_ty=
pes.h
index 52f1b4ff0cc1..974688973cf6 100644
--- a/arch/x86/include/asm/page_types.h
+++ b/arch/x86/include/asm/page_types.h
@@ -6,10 +6,7 @@
 #include <linux/types.h>
 #include <linux/mem_encrypt.h>
=20
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT		CONFIG_PAGE_SHIFT
-#define PAGE_SIZE		(_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK		(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #define __VIRTUAL_MASK		((1UL << __VIRTUAL_MASK_SHIFT) - 1)
=20
diff --git a/arch/x86/include/asm/vdso/getrandom.h b/arch/x86/include/asm/vds=
o/getrandom.h
index ff5334ad32a0..2bf9c0e970c3 100644
--- a/arch/x86/include/asm/vdso/getrandom.h
+++ b/arch/x86/include/asm/vdso/getrandom.h
@@ -8,7 +8,6 @@
 #ifndef __ASSEMBLY__
=20
 #include <asm/unistd.h>
-#include <asm/vvar.h>
=20
 /**
  * getrandom_syscall - Invoke the getrandom() syscall.
@@ -28,13 +27,14 @@ static __always_inline ssize_t getrandom_syscall(void *bu=
ffer, size_t len, unsig
 	return ret;
 }
=20
-#define __vdso_rng_data (VVAR(_vdso_rng_data))
+extern struct vdso_rng_data vdso_rng_data
+	__attribute__((visibility("hidden")));
=20
 static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(=
void)
 {
-	if (IS_ENABLED(CONFIG_TIME_NS) && __vdso_data->clock_mode =3D=3D VDSO_CLOCK=
MODE_TIMENS)
-		return (void *)&__vdso_rng_data + ((void *)&__timens_vdso_data - (void *)&=
__vdso_data);
-	return &__vdso_rng_data;
+	if (IS_ENABLED(CONFIG_TIME_NS) && __arch_get_vdso_data()->clock_mode =3D=3D=
 VDSO_CLOCKMODE_TIMENS)
+		return (void *)&vdso_rng_data + ((void *)&timens_page - (void *)__arch_get=
_vdso_data());
+	return &vdso_rng_data;
 }
=20
 #endif /* !__ASSEMBLY__ */
diff --git a/arch/x86/include/asm/vdso/gettimeofday.h b/arch/x86/include/asm/=
vdso/gettimeofday.h
index b2d2df026f6e..375a34b0f365 100644
--- a/arch/x86/include/asm/vdso/gettimeofday.h
+++ b/arch/x86/include/asm/vdso/gettimeofday.h
@@ -14,14 +14,16 @@
=20
 #include <uapi/linux/time.h>
 #include <asm/vgtod.h>
-#include <asm/vvar.h>
 #include <asm/unistd.h>
 #include <asm/msr.h>
 #include <asm/pvclock.h>
 #include <clocksource/hyperv_timer.h>
=20
-#define __vdso_data (VVAR(_vdso_data))
-#define __timens_vdso_data (TIMENS(_vdso_data))
+extern struct vdso_data vvar_page
+	__attribute__((visibility("hidden")));
+
+extern struct vdso_data timens_page
+	__attribute__((visibility("hidden")));
=20
 #define VDSO_HAS_TIME 1
=20
@@ -61,7 +63,7 @@ extern struct ms_hyperv_tsc_page hvclock_page
 static __always_inline
 const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *=
vd)
 {
-	return __timens_vdso_data;
+	return &timens_page;
 }
 #endif
=20
@@ -275,7 +277,7 @@ static inline u64 __arch_get_hw_counter(s32 clock_mode,
=20
 static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
 {
-	return __vdso_data;
+	return &vvar_page;
 }
=20
 static inline bool arch_vdso_clocksource_ok(const struct vdso_data *vd)
diff --git a/arch/x86/include/asm/vdso/vsyscall.h b/arch/x86/include/asm/vdso=
/vsyscall.h
index 67fedf1698b5..37b4a70559a8 100644
--- a/arch/x86/include/asm/vdso/vsyscall.h
+++ b/arch/x86/include/asm/vdso/vsyscall.h
@@ -2,12 +2,19 @@
 #ifndef __ASM_VDSO_VSYSCALL_H
 #define __ASM_VDSO_VSYSCALL_H
=20
+#define __VDSO_RND_DATA_OFFSET  640
+#define __VVAR_PAGES	4
+
+#define VDSO_NR_VCLOCK_PAGES	2
+#define VDSO_PAGE_PVCLOCK_OFFSET	0
+#define VDSO_PAGE_HVCLOCK_OFFSET	1
+
 #ifndef __ASSEMBLY__
=20
-#include <linux/timekeeper_internal.h>
 #include <vdso/datapage.h>
 #include <asm/vgtod.h>
-#include <asm/vvar.h>
+
+extern struct vdso_data *vdso_data;
=20
 /*
  * Update the vDSO data page to keep in sync with kernel timekeeping.
@@ -15,14 +22,14 @@
 static __always_inline
 struct vdso_data *__x86_get_k_vdso_data(void)
 {
-	return _vdso_data;
+	return vdso_data;
 }
 #define __arch_get_k_vdso_data __x86_get_k_vdso_data
=20
 static __always_inline
 struct vdso_rng_data *__x86_get_k_vdso_rng_data(void)
 {
-	return &_vdso_rng_data;
+	return (void *)vdso_data + __VDSO_RND_DATA_OFFSET;
 }
 #define __arch_get_k_vdso_rng_data __x86_get_k_vdso_rng_data
=20
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
deleted file mode 100644
index 9d9af37f7cab..000000000000
--- a/arch/x86/include/asm/vvar.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * vvar.h: Shared vDSO/kernel variable declarations
- * Copyright (c) 2011 Andy Lutomirski
- *
- * A handful of variables are accessible (read-only) from userspace
- * code in the vsyscall page and the vdso.  They are declared here.
- * Some other file must define them with DEFINE_VVAR.
- *
- * In normal kernel code, they are used like any other variable.
- * In user code, they are accessed through the VVAR macro.
- *
- * These variables live in a page of kernel data that has an extra RO
- * mapping for userspace.  Each variable needs a unique offset within
- * that page; specify that offset with the DECLARE_VVAR macro.  (If
- * you mess up, the linker will catch it.)
- */
-
-#ifndef _ASM_X86_VVAR_H
-#define _ASM_X86_VVAR_H
-
-#ifdef EMIT_VVAR
-/*
- * EMIT_VVAR() is used by the kernel linker script to put vvars in the
- * right place. Also, it's used by kernel code to import offsets values.
- */
-#define DECLARE_VVAR(offset, type, name) \
-	EMIT_VVAR(name, offset)
-#define DECLARE_VVAR_SINGLE(offset, type, name) \
-	EMIT_VVAR(name, offset)
-
-#else
-
-extern char __vvar_page;
-
-#define DECLARE_VVAR(offset, type, name)				\
-	extern type vvar_ ## name[CS_BASES]				\
-	__attribute__((visibility("hidden")));				\
-	extern type timens_ ## name[CS_BASES]				\
-	__attribute__((visibility("hidden")));				\
-
-#define DECLARE_VVAR_SINGLE(offset, type, name)				\
-	extern type vvar_ ## name					\
-	__attribute__((visibility("hidden")));				\
-
-#define VVAR(name) (vvar_ ## name)
-#define TIMENS(name) (timens_ ## name)
-
-#define DEFINE_VVAR(type, name)						\
-	type name[CS_BASES]						\
-	__attribute__((section(".vvar_" #name), aligned(16))) __visible
-
-#define DEFINE_VVAR_SINGLE(type, name)					\
-	type name							\
-	__attribute__((section(".vvar_" #name), aligned(16))) __visible
-
-#endif
-
-/* DECLARE_VVAR(offset, type, name) */
-
-DECLARE_VVAR(128, struct vdso_data, _vdso_data)
-
-#if !defined(_SINGLE_DATA)
-#define _SINGLE_DATA
-DECLARE_VVAR_SINGLE(640, struct vdso_rng_data, _vdso_rng_data)
-#endif
-
-#undef DECLARE_VVAR
-#undef DECLARE_VVAR_SINGLE
-
-#endif
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 6726be89b7a6..e7e19842736a 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -193,29 +193,6 @@ SECTIONS
=20
 	ORC_UNWIND_TABLE
=20
-	. =3D ALIGN(PAGE_SIZE);
-	__vvar_page =3D .;
-
-	.vvar : AT(ADDR(.vvar) - LOAD_OFFSET) {
-		/* work around gold bug 13023 */
-		__vvar_beginning_hack =3D .;
-
-		/* Place all vvars at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset)				\
-		. =3D __vvar_beginning_hack + offset;	\
-		*(.vvar_ ## name)
-#include <asm/vvar.h>
-#undef EMIT_VVAR
-
-		/*
-		 * Pad the rest of the page with zeros.  Otherwise the loader
-		 * can leave garbage here.
-		 */
-		. =3D __vvar_beginning_hack + PAGE_SIZE;
-	} :data
-
-	. =3D ALIGN(__vvar_page + PAGE_SIZE, PAGE_SIZE);
-
 	/* Init code and data - will be freed after init */
 	. =3D ALIGN(PAGE_SIZE);
 	.init.begin : AT(ADDR(.init.begin) - LOAD_OFFSET) {
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index a2cabb1c81e1..b8a6ffffb451 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -163,11 +163,6 @@ unsigned long get_mmap_base(int is_legacy)
 	return is_legacy ? mm->mmap_legacy_base : mm->mmap_base;
 }
=20
-const char *arch_vma_name(struct vm_area_struct *vma)
-{
-	return NULL;
-}
-
 /**
  * mmap_address_hint_valid - Validate the address hint of mmap
  * @addr:	Address hint
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index c101bed61940..6afe2e5e9102 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -89,7 +89,6 @@ static const char * const	sym_regex_kernel[S_NSYMTYPES] =3D=
 {
 	"init_per_cpu__.*|"
 	"__end_rodata_hpage_align|"
 #endif
-	"__vvar_page|"
 	"_end)$"
 };
=20
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
index 4db56ef052d2..595c1037b738 100644
--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -18,13 +18,7 @@
 #include <asm/cache.h>
 #include <asm/kmem_layout.h>
=20
-/*
- * PAGE_SHIFT determines the page size
- */
-
-#define PAGE_SHIFT	CONFIG_PAGE_SHIFT
-#define PAGE_SIZE	(__XTENSA_UL_CONST(1) << PAGE_SHIFT)
-#define PAGE_MASK	(~(PAGE_SIZE-1))
+#include <vdso/page.h>
=20
 #ifdef CONFIG_MMU
 #define PAGE_OFFSET	XCHAL_KSEG_CACHED_VADDR
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/int=
el_gt.c
index a6c69a706fd7..bb29f361110e 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -302,7 +302,7 @@ static void gen6_check_faults(struct intel_gt *gt)
 {
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
-	u32 fault;
+	unsigned long fault;
=20
 	for_each_engine(engine, gt, id) {
 		fault =3D GEN6_RING_FAULT_REG_READ(engine);
@@ -310,8 +310,8 @@ static void gen6_check_faults(struct intel_gt *gt)
 			gt_dbg(gt, "Unexpected fault\n"
 			       "\tAddr: 0x%08lx\n"
 			       "\tAddress space: %s\n"
-			       "\tSource ID: %d\n"
-			       "\tType: %d\n",
+			       "\tSource ID: %ld\n"
+			       "\tType: %ld\n",
 			       fault & PAGE_MASK,
 			       fault & RING_FAULT_GTTSEL_MASK ?
 			       "GGTT" : "PPGTT",
diff --git a/include/asm-generic/vdso/vsyscall.h b/include/asm-generic/vdso/v=
syscall.h
index c835607f78ae..01dafd604188 100644
--- a/include/asm-generic/vdso/vsyscall.h
+++ b/include/asm-generic/vdso/vsyscall.h
@@ -12,8 +12,7 @@ static __always_inline struct vdso_data *__arch_get_k_vdso_=
data(void)
 #endif /* __arch_get_k_vdso_data */
=20
 #ifndef __arch_update_vsyscall
-static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata,
-						   struct timekeeper *tk)
+static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata)
 {
 }
 #endif /* __arch_update_vsyscall */
diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
index b85f24cac3f5..d967baa0cd0c 100644
--- a/include/vdso/datapage.h
+++ b/include/vdso/datapage.h
@@ -19,10 +19,10 @@
 #include <vdso/time32.h>
 #include <vdso/time64.h>
=20
-#ifdef CONFIG_ARCH_HAS_VDSO_DATA
-#include <asm/vdso/data.h>
+#ifdef CONFIG_ARCH_HAS_VDSO_TIME_DATA
+#include <asm/vdso/time_data.h>
 #else
-struct arch_vdso_data {};
+struct arch_vdso_time_data {};
 #endif
=20
 #define VDSO_BASES	(CLOCK_TAI + 1)
@@ -114,7 +114,7 @@ struct vdso_data {
 	u32			hrtimer_res;
 	u32			__unused;
=20
-	struct arch_vdso_data	arch_data;
+	struct arch_vdso_time_data arch_data;
 };
=20
 /**
diff --git a/include/vdso/page.h b/include/vdso/page.h
new file mode 100644
index 000000000000..710ae2414e68
--- /dev/null
+++ b/include/vdso/page.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __VDSO_PAGE_H
+#define __VDSO_PAGE_H
+
+#include <uapi/linux/const.h>
+
+/*
+ * PAGE_SHIFT determines the page size.
+ *
+ * Note: This definition is required because PAGE_SHIFT is used
+ * in several places throuout the codebase.
+ */
+#define PAGE_SHIFT      CONFIG_PAGE_SHIFT
+
+#define PAGE_SIZE	(_AC(1,UL) << CONFIG_PAGE_SHIFT)
+
+#if !defined(CONFIG_64BIT)
+/*
+ * Applies only to 32-bit architectures.
+ *
+ * Subtle: (1 << CONFIG_PAGE_SHIFT) is an int, not an unsigned long.
+ * So if we assign PAGE_MASK to a larger type it gets extended the
+ * way we want (i.e. with 1s in the high bits) while masking a
+ * 64-bit value such as phys_addr_t.
+ */
+#define PAGE_MASK	(~((1 << CONFIG_PAGE_SHIFT) - 1))
+#else
+#define PAGE_MASK	(~(PAGE_SIZE - 1))
+#endif
+
+#endif	/* __VDSO_PAGE_H */
diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c
index 9193d6133e5d..28706a13c222 100644
--- a/kernel/time/vsyscall.c
+++ b/kernel/time/vsyscall.c
@@ -119,7 +119,7 @@ void update_vsyscall(struct timekeeper *tk)
 	if (clock_mode !=3D VDSO_CLOCKMODE_NONE)
 		update_vdso_data(vdata, tk);
=20
-	__arch_update_vsyscall(vdata, tk);
+	__arch_update_vsyscall(vdata);
=20
 	vdso_write_end(vdata);
=20


.
Subject: [GIT pull] timers/core for v6.13-rc1
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Date: Mon, 18 Nov 2024 20:21:57 +0100 (CET)

Linus,

please pull the latest timers/core branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-core-2024=
-11-18

up to:  cdc905d16b07: posix-timers: Fix spurious warning on double enqueue ve=
rsus do_exit()


A rather large update for timekeeping and timers:

  - The final step to get rid of auto-rearming posix-timers

    posix-timers are currently auto-rearmed by the kernel when the signal
    of the timer is ignored so that the timer signal can be delivered once
    the corresponding signal is unignored.

    This requires to throttle the timer to prevent a DoS by small intervals
    and keeps the system pointlessly out of low power states for no value.
    This is a long standing non-trivial problem due to the lock order of
    posix-timer lock and the sighand lock along with life time issues as
    the timer and the sigqueue have different life time rules.

    Cure this by:

     * Embedding the sigqueue into the timer struct to have the same life
       time rules. Aside of that this also avoids the lookup of the timer
       in the signal delivery and rearm path as it's just a always valid
       container_of() now.

     * Queuing ignored timer signals onto a seperate ignored list.

     * Moving queued timer signals onto the ignored list when the signal is
       switched to SIG_IGN before it could be delivered.

     * Walking the ignored list when SIG_IGN is lifted and requeue the
       signals to the actual signal lists. This allows the signal delivery
       code to rearm the timer.

    This also required to consolidate the signal delivery rules so they are
    consistent across all situations. With that all self test scenarios
    finally succeed.


  - Core infrastructure for VFS multigrain timestamping

    This is required to allow the kernel to use coarse grained time stamps
    by default and switch to fine grained time stamps when inode attributes
    are actively observed via getattr().

    These changes have been provided to the VFS tree as well, so that the
    VFS specific infrastructure could be built on top.


  - Cleanup and consolidation of the sleep() infrastructure

    * Move all sleep and timeout functions into one file

    * Rework udelay() and ndelay() into proper documented inline functions
      and replace the hardcoded magic numbers by proper defines.

    * Rework the fsleep() implementation to take the reality of the timer
      wheel granularity on different HZ values into account. Right now the
      boundaries are hard coded time ranges which fail to provide the
      requested accuracy on different HZ settings.

    * Update documentation for all sleep/timeout related functions and fix
      up stale documentation links all over the place

    * Fixup a few usage sites


  - Rework of timekeeping and adjtimex(2) to prepare for multiple PTP clocks

    A system can have multiple PTP clocks which are participating in
    seperate and independent PTP clock domains. So far the kernel only
    considers the PTP clock which is based on CLOCK TAI relevant as that's
    the clock which drives the timekeeping adjustments via the various user
    space daemons through adjtimex(2).

    The non TAI based clock domains are accessible via the file descriptor
    based posix clocks, but their usability is very limited. They can't be
    accessed fast as they always go all the way out to the hardware and
    they cannot be utilized in the kernel itself.

    As Time Sensitive Networking (TSN) gains traction it is required to
    provide fast user and kernel space access to these clocks.

    The approach taken is to utilize the timekeeping and adjtimex(2)
    infrastructure to provide this access in a similar way how the kernel
    provides access to clock MONOTONIC, REALTIME etc.

    Instead of creating a duplicated infrastructure this rework converts
    timekeeping and adjtimex(2) into generic functionality which operates
    on pointers to data structures instead of using static variables.

    This allows to provide time accessors and adjtimex(2) functionality for
    the independent PTP clocks in a subsequent step.


  - Consolidate hrtimer initialization

    hrtimers are set up by initializing the data structure and then
    seperately setting the callback function for historical reasons.

    That's an extra unnecessary step and makes Rust support less straight
    forward than it should be.

    Provide a new set of hrtimer_setup*() functions and convert the core
    code and a few usage sites of the less frequently used interfaces over.

    The bulk of the htimer_init() to hrtimer_setup() conversion is already
    prepared and scheduled for the next merge window.


  - Drivers:

    * Ensure that the global timekeeping clocksource is utilizing the
      cluster 0 timer on MIPS multi-cluster systems.

      Otherwise CPUs on different clusters use their cluster specific
      clocksource which is not guaranteed to be synchronized with other
      clusters.

    * Mostly boring cleanups, fixes, improvements and code movement

Thanks,

	tglx

------------------>
Anna-Maria Behnsen (32):
      ntp: Cleanup formatting of code
      MAINTAINERS: Add missing file include/linux/delay.h
      timers: Move *sleep*() and timeout functions into a separate file
      timers: Update schedule_[hr]timeout*() related function descriptions
      timers: Rename usleep_idle_range() to usleep_range_idle()
      timers: Update function descriptions of sleep/delay related functions
      delay: Rework udelay and ndelay
      timers: Adjust flseep() to reflect reality
      mm/damon/core: Use generic upper bound recommondation for usleep_range()
      timers: Add a warning to usleep_range_state() for wrong order of argume=
nts
      checkpatch: Remove links to outdated documentation
      iopoll/regmap/phy/snd: Fix comment referencing outdated timer documenta=
tion
      powerpc/rtas: Use fsleep() to minimize additional sleep duration
      media: anysee: Fix and remove outdated comment
      timers/Documentation: Cleanup delay/sleep documentation
      timekeeping: Avoid duplicate leap state update
      timekeeping: Move timekeeper_lock into tk_core
      timekeeping: Define a struct type for tk_core to make it reusable
      timekeeping: Introduce tkd_basic_setup() to make lock and seqcount init=
 reusable
      timekeeping: Add struct tk_data as argument to timekeeping_update()
      timekeeping: Split out timekeeper update of timekeeping_advanced()
      timekeeping: Introduce combined timekeeping action flag
      timekeeping: Rework do_settimeofday64() to use shadow_timekeeper
      timekeeping: Rework timekeeping_inject_offset() to use shadow_timekeeper
      timekeeping: Rework change_clocksource() to use shadow_timekeeper
      timekeeping: Rework timekeeping_init() to use shadow_timekeeper
      timekeeping: Rework timekeeping_inject_sleeptime64() to use shadow_time=
keeper
      timekeeping: Rework timekeeping_resume() to use shadow_timekeeper
      timekeeping: Rework timekeeping_suspend() to use shadow_timekeeper
      timekeeping: Rework do_adjtimex() to use shadow_timekeeper
      timekeeping: Remove TK_MIRROR timekeeping_update() action
      timekeeping: Merge timekeeping_update_staged() and timekeeping_update()

Dr. David Alan Gilbert (2):
      clocksource: Remove unused clocksource_change_rating
      clocksource/drivers/dw_apb: Remove unused dw_apb_clockevent functions

Easwar Hariharan (1):
      jiffies: Define secs_to_jiffies()

Frederic Weisbecker (11):
      clockevents: Improve clockevents_notify_released() comment
      clockevents: Shutdown and unregister current clockevents at CPUHP_AP_TI=
CK_DYING
      tick: Remove now unneeded low-res tick stop on CPUHP_AP_TICK_DYING
      ARM: smp_twd: Remove clockevents shutdown call on offlining
      clocksource/drivers/arm_arch_timer: Remove clockevents shutdown call on=
 offlining
      clocksource/drivers/arm_global_timer: Remove clockevents shutdown call =
on offlining
      clocksource/drivers/exynos_mct: Remove clockevents shutdown call on off=
lining
      clocksource/drivers/armada-370-xp: Remove clockevents shutdown call on =
offlining
      clocksource/drivers/qcom: Remove clockevents shutdown call on offlining
      clocksource/drivers/timer-tegra: Remove clockevents shutdown call on of=
flining
      posix-timers: Fix spurious warning on double enqueue versus do_exit()

Ivaylo Ivanov (1):
      dt-bindings: timer: actions,owl-timer: convert to YAML

Javier Carrasco (1):
      clocksource/drivers/timer-ti-dm: Fix child node refcount handling

Jeff Layton (3):
      timekeeping: Don't use seqcount loop in ktime_mono_to_any() on 64-bit s=
ystems
      timekeeping: Add interfaces for handling timestamps with a floor value
      timekeeping: Add percpu counter for tracking floor swap events

Judith Mendez (1):
      clocksource/drivers/timer-ti-dm: Don't fail probe if int not found

Julia Lawall (1):
      posix-timers: Replace call_rcu() by kfree_rcu() for simple kmem_cache_f=
ree() callback

Mark Brown (1):
      clocksource/drivers:sp804: Make user selectable

Miguel Ojeda (2):
      time: Partially revert cleanup on msecs_to_jiffies() documentation
      time: Fix references to _msecs_to_jiffies() handling of values

Nam Cao (19):
      hrtimers: Add missing hrtimer_init() trace points
      drm/i915/request: Remove unnecessary modification of hrtimer:: Function
      KVM: x86/xen: Initialize hrtimer in kvm_xen_init_vcpu()
      _RESEND_PATCH_v2_04_19_wifi_rt2x00_Remove_redundant_hrtimer_init_
      io_uring: Remove redundant hrtimer's callback function setup
      hrtimers: Introduce hrtimer_setup() to replace hrtimer_init()
      hrtimers: Introduce hrtimer_setup_on_stack()
      hrtimers: Introduce hrtimer_setup_sleeper_on_stack()
      hrtimers: Introduce hrtimer_update_function()
      fs/aio: Switch to use hrtimer_setup_sleeper_on_stack()
      futex: Switch to use hrtimer_setup_sleeper_on_stack()
      net: pktgen: Switch to use hrtimer_setup_sleeper_on_stack()
      timers: Switch to use hrtimer_setup_sleeper_on_stack()
      wait: Switch to use hrtimer_setup_sleeper_on_stack()
      hrtimers: Delete hrtimer_init_sleeper_on_stack()
      sched/idle: Switch to use hrtimer_setup_on_stack()
      io_uring: Switch to use hrtimer_setup_on_stack()
      alarmtimer: Switch to use hrtimer_setup() and hrtimer_setup_on_stack()
      hrtimers: Delete hrtimer_init_on_stack()

Paul Burton (1):
      clocksource/drivers/mips-gic-timer: Always use cluster 0 counter as clo=
cksource

Rob Herring (Arm) (1):
      clocksource/drivers/arm_arch_timer: Use of_property_present() for non-b=
oolean properties

Sergio Paracuellos (1):
      clocksource/drivers/ralink: Add Ralink System Tick Counter driver

Tang Bin (1):
      clocksource/drivers/gpx: Remove redundant casts

Thomas Gleixner (59):
      ntp: Remove unused tick_nsec
      ntp: Make tick_usec static
      ntp: Clean up comments
      ntp: Convert functions with only two states to bool
      ntp: Read reference time only once
      ntp: Introduce struct ntp_data
      ntp: Move tick_length* into ntp_data
      ntp: Move tick_stat* into ntp_data
      ntp: Move time_offset/constant into ntp_data
      ntp: Move time_max/esterror into ntp_data
      ntp: Move time_freq/reftime into ntp_data
      ntp: Move time_adj/ntp_tick_adj into ntp_data
      ntp: Move ntp_next_leap_sec into ntp_data
      ntp: Move pps_valid into ntp_data
      ntp: Move pps_ft into ntp_data
      ntp: Move pps_jitter into ntp_data
      ntp: Move pps_fbase into ntp_data
      ntp: Move pps_shift/intcnt into ntp_data
      ntp: Move pps_freq/stabil into ntp_data
      ntp: Move pps monitors into ntp_data
      timekeeping: Read NTP tick length only once
      timekeeping: Don't stop time readers across hard_pps() update
      timekeeping: Abort clocksource change in case of failure
      timekeeping: Simplify code in timekeeping_advance()
      timekeeping: Reorder struct timekeeper
      timekeeping: Move shadow_timekeeper into tk_core
      timekeeping: Encapsulate locking/unlocking of timekeeper_lock
      timekeeping: Provide timekeeping_restore_shadow()
      signal: Confine POSIX_TIMERS properly
      signal: Cleanup flush_sigqueue_mask()
      posix-timers: Cure si_sys_private race
      signal: Allow POSIX timer signals to be dropped
      posix-timers: Drop signal if timer has been deleted or reprogrammed
      posix-timers: Rename k_itimer:: It_requeue_pending
      posix-timers: Add proper state tracking
      timers: Add missing READ_ONCE() in __run_timer_base()
      timekeeping: Remove CONFIG_DEBUG_TIMEKEEPING
      timekeeping: Always check for negative motion
      posix-cpu-timers: Correctly update timer status in posix_cpu_timer_del()
      posix-timers: Make signal delivery consistent
      posix-timers: Make signal overrun accounting sensible
      posix-cpu-timers: Cleanup the firing logic
      posix-cpu-timers: Use dedicated flag for CPU timer nanosleep
      posix-timers: Add a refcount to struct k_itimer
      signal: Split up __sigqueue_alloc()
      signal: Provide posixtimer_sigqueue_init()
      posix-timers: Store PID type in the timer
      signal: Refactor send_sigqueue()
      signal: Replace resched_timer logic
      posix-timers: Embed sigqueue in struct k_itimer
      signal: Cleanup unused posix-timer leftovers
      posix-timers: Move sequence logic into struct k_itimer
      signal: Provide ignored_posix_timers list
      posix-timers: Handle ignored list on delete and exit
      signal: Handle ignored signals in do_sigaction(action !=3D SIG_IGN)
      signal: Queue ignored posixtimers on ignore list
      posix-timers: Cleanup SIG_IGN workaround leftovers
      alarmtimers: Remove the throttle mechanism from alarm_forward_now()
      alarmtimers: Remove return value from alarm functions

Vincent Donnefort (1):
      timekeeping: Add the boot clock to system time snapshot

Wang Jinchao (1):
      time: Remove '%' from numeric constant in kernel-doc comment


 Documentation/dev-tools/checkpatch.rst             |   2 -
 .../bindings/timer/actions,owl-timer.txt           |  21 -
 .../bindings/timer/actions,owl-timer.yaml          | 107 +++
 Documentation/timers/delay_sleep_functions.rst     | 121 +++
 Documentation/timers/index.rst                     |   2 +-
 Documentation/timers/timers-howto.rst              | 115 ---
 MAINTAINERS                                        |   4 +-
 arch/arm/kernel/smp_twd.c                          |   1 -
 arch/mips/ralink/Kconfig                           |   7 -
 arch/mips/ralink/Makefile                          |   2 -
 arch/powerpc/kernel/rtas.c                         |  21 +-
 arch/riscv/configs/defconfig                       |   1 -
 arch/x86/Kconfig                                   |   1 -
 arch/x86/include/asm/timer.h                       |   2 -
 arch/x86/kvm/xen.c                                 |  12 +-
 drivers/clocksource/Kconfig                        |  12 +-
 drivers/clocksource/Makefile                       |   1 +
 drivers/clocksource/arm_arch_timer.c               |   4 +-
 drivers/clocksource/arm_global_timer.c             |   1 -
 drivers/clocksource/dw_apb_timer.c                 |  39 -
 drivers/clocksource/exynos_mct.c                   |   1 -
 drivers/clocksource/mips-gic-timer.c               |  39 +-
 drivers/clocksource/timer-armada-370-xp.c          |   1 -
 drivers/clocksource/timer-gxp.c                    |   2 +-
 drivers/clocksource/timer-qcom.c                   |   1 -
 .../clocksource/timer-ralink.c                     |  11 +-
 drivers/clocksource/timer-tegra.c                  |   1 -
 drivers/clocksource/timer-ti-dm-systimer.c         |   8 +-
 drivers/clocksource/timer-ti-dm.c                  |   8 +-
 drivers/gpu/drm/i915/i915_request.c                |  17 +-
 drivers/media/usb/dvb-usb-v2/anysee.c              |  17 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c     |   2 -
 drivers/power/supply/charger-manager.c             |   3 +-
 fs/aio.c                                           |   2 +-
 fs/proc/base.c                                     |   4 +-
 fs/timerfd.c                                       |   4 +-
 include/asm-generic/delay.h                        |  96 ++-
 include/linux/alarmtimer.h                         |  10 +-
 include/linux/clocksource.h                        |   1 -
 include/linux/delay.h                              |  79 +-
 include/linux/dw_apb_timer.h                       |   3 -
 include/linux/hrtimer.h                            |  51 +-
 include/linux/iopoll.h                             |  52 +-
 include/linux/jiffies.h                            |  15 +-
 include/linux/phy.h                                |   9 +-
 include/linux/posix-timers.h                       |  72 +-
 include/linux/regmap.h                             |  38 +-
 include/linux/sched/signal.h                       |   4 +-
 include/linux/tick.h                               |   2 -
 include/linux/timekeeper_internal.h                | 114 +--
 include/linux/timekeeping.h                        |   7 +
 include/linux/timex.h                              |   8 -
 include/linux/wait.h                               |   4 +-
 include/uapi/asm-generic/siginfo.h                 |   2 +-
 init/init_task.c                                   |   5 +-
 io_uring/io_uring.c                                |   7 +-
 io_uring/timeout.c                                 |   1 -
 kernel/cpu.c                                       |   2 -
 kernel/fork.c                                      |   1 +
 kernel/futex/core.c                                |   6 +-
 kernel/sched/idle.c                                |   4 +-
 kernel/signal.c                                    | 494 +++++++-----
 kernel/time/Kconfig                                |   5 -
 kernel/time/Makefile                               |   2 +-
 kernel/time/alarmtimer.c                           |  96 +--
 kernel/time/clockevents.c                          |  42 +-
 kernel/time/clocksource.c                          |  40 +-
 kernel/time/hrtimer.c                              | 230 ++----
 kernel/time/itimer.c                               |  22 +-
 kernel/time/ntp.c                                  | 840 ++++++++++---------=
--
 kernel/time/posix-cpu-timers.c                     |  72 +-
 kernel/time/posix-timers.c                         | 267 ++++---
 kernel/time/posix-timers.h                         |   8 +-
 kernel/time/sleep_timeout.c                        | 377 +++++++++
 kernel/time/tick-internal.h                        |   3 +-
 kernel/time/tick-sched.c                           |  25 +-
 kernel/time/time.c                                 |  20 +-
 kernel/time/timekeeping.c                          | 637 ++++++++--------
 kernel/time/timekeeping_debug.c                    |  13 +
 kernel/time/timekeeping_internal.h                 |  25 +-
 kernel/time/timer.c                                | 195 +----
 kernel/time/vsyscall.c                             |   5 +-
 lib/Kconfig.debug                                  |  13 -
 mm/damon/core.c                                    |   5 +-
 net/bluetooth/hci_event.c                          |   2 -
 net/core/pktgen.c                                  |   2 +-
 net/netfilter/xt_IDLETIMER.c                       |   4 +-
 scripts/checkpatch.pl                              |  10 +-
 sound/soc/sof/ops.h                                |   8 +-
 .../testing/selftests/wireguard/qemu/debug.config  |   1 -
 90 files changed, 2494 insertions(+), 2159 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/timer/actions,owl-timer=
.txt
 create mode 100644 Documentation/devicetree/bindings/timer/actions,owl-timer=
.yaml
 create mode 100644 Documentation/timers/delay_sleep_functions.rst
 delete mode 100644 Documentation/timers/timers-howto.rst
 rename arch/mips/ralink/cevt-rt3352.c =3D> drivers/clocksource/timer-ralink.=
c (91%)
 create mode 100644 kernel/time/sleep_timeout.c

diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools=
/checkpatch.rst
index a9fac978a525..abb3ff682076 100644
--- a/Documentation/dev-tools/checkpatch.rst
+++ b/Documentation/dev-tools/checkpatch.rst
@@ -470,8 +470,6 @@ API usage
     usleep_range() should be preferred over udelay(). The proper way of
     using usleep_range() is mentioned in the kernel docs.
=20
-    See: https://www.kernel.org/doc/html/latest/timers/timers-howto.html#del=
ays-information-on-the-various-kernel-delay-sleep-mechanisms
-
=20
 Comments
 --------
diff --git a/Documentation/devicetree/bindings/timer/actions,owl-timer.txt b/=
Documentation/devicetree/bindings/timer/actions,owl-timer.txt
deleted file mode 100644
index 977054f87563..000000000000
--- a/Documentation/devicetree/bindings/timer/actions,owl-timer.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Actions Semi Owl Timer
-
-Required properties:
-- compatible      :  "actions,s500-timer" for S500
-                     "actions,s700-timer" for S700
-                     "actions,s900-timer" for S900
-- reg             :  Offset and length of the register set for the device.
-- interrupts      :  Should contain the interrupts.
-- interrupt-names :  Valid names are: "2hz0", "2hz1",
-                                      "timer0", "timer1", "timer2", "timer3"
-                     See ../resource-names.txt
-
-Example:
-
-		timer@b0168000 {
-			compatible =3D "actions,s500-timer";
-			reg =3D <0xb0168000 0x100>;
-			interrupts =3D <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
-			             <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names =3D "timer0", "timer1";
-		};
diff --git a/Documentation/devicetree/bindings/timer/actions,owl-timer.yaml b=
/Documentation/devicetree/bindings/timer/actions,owl-timer.yaml
new file mode 100644
index 000000000000..646c554a390a
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/actions,owl-timer.yaml
@@ -0,0 +1,107 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/actions,owl-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl timer
+
+maintainers:
+  - Andreas F=C3=A4rber <afaerber@suse.de>
+
+description:
+  Actions Semi Owl SoCs provide 32bit and 2Hz timers.
+  The 32bit timers support dynamic irq, as well as one-shot mode.
+
+properties:
+  compatible:
+    enum:
+      - actions,s500-timer
+      - actions,s700-timer
+      - actions,s900-timer
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 6
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 6
+    items:
+      enum:
+        - 2hz0
+        - 2hz1
+        - timer0
+        - timer1
+        - timer2
+        - timer3
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - clocks
+  - interrupts
+  - interrupt-names
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - actions,s500-timer
+    then:
+      properties:
+        interrupts:
+          minItems: 4
+          maxItems: 4
+        interrupt-names:
+          items:
+            - const: 2hz0
+            - const: 2hz1
+            - const: timer0
+            - const: timer1
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - actions,s700-timer
+              - actions,s900-timer
+    then:
+      properties:
+        interrupts:
+          minItems: 1
+          maxItems: 1
+        interrupt-names:
+          items:
+            - const: timer1
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    soc {
+      #address-cells =3D <1>;
+      #size-cells =3D <1>;
+      timer@b0168000 {
+        compatible =3D "actions,s500-timer";
+        reg =3D <0xb0168000 0x100>;
+        clocks =3D <&hosc>;
+        interrupts =3D <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names =3D "2hz0", "2hz1", "timer0", "timer1";
+      };
+    };
+...
diff --git a/Documentation/timers/delay_sleep_functions.rst b/Documentation/t=
imers/delay_sleep_functions.rst
new file mode 100644
index 000000000000..49d603a3f113
--- /dev/null
+++ b/Documentation/timers/delay_sleep_functions.rst
@@ -0,0 +1,121 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Delay and sleep mechanisms
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
+
+This document seeks to answer the common question: "What is the
+RightWay (TM) to insert a delay?"
+
+This question is most often faced by driver writers who have to
+deal with hardware delays and who may not be the most intimately
+familiar with the inner workings of the Linux Kernel.
+
+The following table gives a rough overview about the existing function
+'families' and their limitations. This overview table does not replace the
+reading of the function description before usage!
+
+.. list-table::
+   :widths: 20 20 20 20 20
+   :header-rows: 2
+
+   * -
+     - `*delay()`
+     - `usleep_range*()`
+     - `*sleep()`
+     - `fsleep()`
+   * -
+     - busy-wait loop
+     - hrtimers based
+     - timer list timers based
+     - combines the others
+   * - Usage in atomic Context
+     - yes
+     - no
+     - no
+     - no
+   * - precise on "short intervals"
+     - yes
+     - yes
+     - depends
+     - yes
+   * - precise on "long intervals"
+     - Do not use!
+     - yes
+     - max 12.5% slack
+     - yes
+   * - interruptible variant
+     - no
+     - yes
+     - yes
+     - no
+
+A generic advice for non atomic contexts could be:
+
+#. Use `fsleep()` whenever unsure (as it combines all the advantages of the
+   others)
+#. Use `*sleep()` whenever possible
+#. Use `usleep_range*()` whenever accuracy of `*sleep()` is not sufficient
+#. Use `*delay()` for very, very short delays
+
+Find some more detailed information about the function 'families' in the next
+sections.
+
+`*delay()` family of functions
+------------------------------
+
+These functions use the jiffy estimation of clock speed and will busy wait f=
or
+enough loop cycles to achieve the desired delay. udelay() is the basic
+implementation and ndelay() as well as mdelay() are variants.
+
+These functions are mainly used to add a delay in atomic context. Please make
+sure to ask yourself before adding a delay in atomic context: Is this really
+required?
+
+.. kernel-doc:: include/asm-generic/delay.h
+	:identifiers: udelay ndelay
+
+.. kernel-doc:: include/linux/delay.h
+	:identifiers: mdelay
+
+
+`usleep_range*()` and `*sleep()` family of functions
+----------------------------------------------------
+
+These functions use hrtimers or timer list timers to provide the requested
+sleeping duration. In order to decide which function is the right one to use,
+take some basic information into account:
+
+#. hrtimers are more expensive as they are using an rb-tree (instead of hash=
ing)
+#. hrtimers are more expensive when the requested sleeping duration is the f=
irst
+   timer which means real hardware has to be programmed
+#. timer list timers always provide some sort of slack as they are jiffy bas=
ed
+
+The generic advice is repeated here:
+
+#. Use `fsleep()` whenever unsure (as it combines all the advantages of the
+   others)
+#. Use `*sleep()` whenever possible
+#. Use `usleep_range*()` whenever accuracy of `*sleep()` is not sufficient
+
+First check fsleep() function description and to learn more about accuracy,
+please check msleep() function description.
+
+
+`usleep_range*()`
+~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: include/linux/delay.h
+	:identifiers: usleep_range usleep_range_idle
+
+.. kernel-doc:: kernel/time/sleep_timeout.c
+	:identifiers: usleep_range_state
+
+
+`*sleep()`
+~~~~~~~~~~
+
+.. kernel-doc:: kernel/time/sleep_timeout.c
+       :identifiers: msleep msleep_interruptible
+
+.. kernel-doc:: include/linux/delay.h
+	:identifiers: ssleep fsleep
diff --git a/Documentation/timers/index.rst b/Documentation/timers/index.rst
index 983f91f8f023..4e88116e4dcf 100644
--- a/Documentation/timers/index.rst
+++ b/Documentation/timers/index.rst
@@ -12,7 +12,7 @@ Timers
     hrtimers
     no_hz
     timekeeping
-    timers-howto
+    delay_sleep_functions
=20
 .. only::  subproject and html
=20
diff --git a/Documentation/timers/timers-howto.rst b/Documentation/timers/tim=
ers-howto.rst
deleted file mode 100644
index ef7a4652ccc9..000000000000
--- a/Documentation/timers/timers-howto.rst
+++ /dev/null
@@ -1,115 +0,0 @@
-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-delays - Information on the various kernel delay / sleep mechanisms
-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-
-This document seeks to answer the common question: "What is the
-RightWay (TM) to insert a delay?"
-
-This question is most often faced by driver writers who have to
-deal with hardware delays and who may not be the most intimately
-familiar with the inner workings of the Linux Kernel.
-
-
-Inserting Delays
-----------------
-
-The first, and most important, question you need to ask is "Is my
-code in an atomic context?"  This should be followed closely by "Does
-it really need to delay in atomic context?" If so...
-
-ATOMIC CONTEXT:
-	You must use the `*delay` family of functions. These
-	functions use the jiffy estimation of clock speed
-	and will busy wait for enough loop cycles to achieve
-	the desired delay:
-
-	ndelay(unsigned long nsecs)
-	udelay(unsigned long usecs)
-	mdelay(unsigned long msecs)
-
-	udelay is the generally preferred API; ndelay-level
-	precision may not actually exist on many non-PC devices.
-
-	mdelay is macro wrapper around udelay, to account for
-	possible overflow when passing large arguments to udelay.
-	In general, use of mdelay is discouraged and code should
-	be refactored to allow for the use of msleep.
-
-NON-ATOMIC CONTEXT:
-	You should use the `*sleep[_range]` family of functions.
-	There are a few more options here, while any of them may
-	work correctly, using the "right" sleep function will
-	help the scheduler, power management, and just make your
-	driver better :)
-
-	-- Backed by busy-wait loop:
-
-		udelay(unsigned long usecs)
-
-	-- Backed by hrtimers:
-
-		usleep_range(unsigned long min, unsigned long max)
-
-	-- Backed by jiffies / legacy_timers
-
-		msleep(unsigned long msecs)
-		msleep_interruptible(unsigned long msecs)
-
-	Unlike the `*delay` family, the underlying mechanism
-	driving each of these calls varies, thus there are
-	quirks you should be aware of.
-
-
-	SLEEPING FOR "A FEW" USECS ( < ~10us? ):
-		* Use udelay
-
-		- Why not usleep?
-			On slower systems, (embedded, OR perhaps a speed-
-			stepped PC!) the overhead of setting up the hrtimers
-			for usleep *may* not be worth it. Such an evaluation
-			will obviously depend on your specific situation, but
-			it is something to be aware of.
-
-	SLEEPING FOR ~USECS OR SMALL MSECS ( 10us - 20ms):
-		* Use usleep_range
-
-		- Why not msleep for (1ms - 20ms)?
-			Explained originally here:
-				https://lore.kernel.org/r/15327.1186166232@lwn.net
-
-			msleep(1~20) may not do what the caller intends, and
-			will often sleep longer (~20 ms actual sleep for any
-			value given in the 1~20ms range). In many cases this
-			is not the desired behavior.
-
-		- Why is there no "usleep" / What is a good range?
-			Since usleep_range is built on top of hrtimers, the
-			wakeup will be very precise (ish), thus a simple
-			usleep function would likely introduce a large number
-			of undesired interrupts.
-
-			With the introduction of a range, the scheduler is
-			free to coalesce your wakeup with any other wakeup
-			that may have happened for other reasons, or at the
-			worst case, fire an interrupt for your upper bound.
-
-			The larger a range you supply, the greater a chance
-			that you will not trigger an interrupt; this should
-			be balanced with what is an acceptable upper bound on
-			delay / performance for your specific code path. Exact
-			tolerances here are very situation specific, thus it
-			is left to the caller to determine a reasonable range.
-
-	SLEEPING FOR LARGER MSECS ( 10ms+ )
-		* Use msleep or possibly msleep_interruptible
-
-		- What's the difference?
-			msleep sets the current task to TASK_UNINTERRUPTIBLE
-			whereas msleep_interruptible sets the current task to
-			TASK_INTERRUPTIBLE before scheduling the sleep. In
-			short, the difference is whether the sleep can be ended
-			early by a signal. In general, just use msleep unless
-			you know you have a need for the interruptible variant.
-
-	FLEXIBLE SLEEPING (any delay, uninterruptible)
-		* Use fsleep
diff --git a/MAINTAINERS b/MAINTAINERS
index c27f3190737f..3a24287712f1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2004,7 +2004,7 @@ F:	Documentation/devicetree/bindings/mmc/owl-mmc.yaml
 F:	Documentation/devicetree/bindings/net/actions,owl-emac.yaml
 F:	Documentation/devicetree/bindings/pinctrl/actions,*
 F:	Documentation/devicetree/bindings/power/actions,owl-sps.txt
-F:	Documentation/devicetree/bindings/timer/actions,owl-timer.txt
+F:	Documentation/devicetree/bindings/timer/actions,owl-timer.yaml
 F:	arch/arm/boot/dts/actions/
 F:	arch/arm/mach-actions/
 F:	arch/arm64/boot/dts/actions/
@@ -10162,10 +10162,12 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
 F:	Documentation/timers/
 F:	include/linux/clockchips.h
+F:	include/linux/delay.h
 F:	include/linux/hrtimer.h
 F:	include/linux/timer.h
 F:	kernel/time/clockevents.c
 F:	kernel/time/hrtimer.c
+F:	kernel/time/sleep_timeout.c
 F:	kernel/time/timer.c
 F:	kernel/time/timer_list.c
 F:	kernel/time/timer_migration.*
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 9a14f721a2b0..42a3706e16a6 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -93,7 +93,6 @@ static void twd_timer_stop(void)
 {
 	struct clock_event_device *clk =3D raw_cpu_ptr(twd_evt);
=20
-	twd_shutdown(clk);
 	disable_percpu_irq(clk->irq);
 }
=20
diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
index 08c012a2591f..910d059ec70b 100644
--- a/arch/mips/ralink/Kconfig
+++ b/arch/mips/ralink/Kconfig
@@ -1,13 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 if RALINK
=20
-config CLKEVT_RT3352
-	bool
-	depends on SOC_RT305X || SOC_MT7620
-	default y
-	select TIMER_OF
-	select CLKSRC_MMIO
-
 config RALINK_ILL_ACC
 	bool
 	depends on SOC_RT305X
diff --git a/arch/mips/ralink/Makefile b/arch/mips/ralink/Makefile
index 26fabbdea1f1..0c109eae1953 100644
--- a/arch/mips/ralink/Makefile
+++ b/arch/mips/ralink/Makefile
@@ -10,8 +10,6 @@ ifndef CONFIG_MIPS_GIC
 	obj-y +=3D clk.o timer.o
 endif
=20
-obj-$(CONFIG_CLKEVT_RT3352) +=3D cevt-rt3352.o
-
 obj-$(CONFIG_RALINK_ILL_ACC) +=3D ill_acc.o
=20
 obj-$(CONFIG_IRQ_INTC) +=3D irq.o
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index f7e86e09c49f..d31c9799cab2 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1390,21 +1390,14 @@ bool __ref rtas_busy_delay(int status)
 		 */
 		ms =3D clamp(ms, 1U, 1000U);
 		/*
-		 * The delay hint is an order-of-magnitude suggestion, not
-		 * a minimum. It is fine, possibly even advantageous, for
-		 * us to pause for less time than hinted. For small values,
-		 * use usleep_range() to ensure we don't sleep much longer
-		 * than actually needed.
-		 *
-		 * See Documentation/timers/timers-howto.rst for
-		 * explanation of the threshold used here. In effect we use
-		 * usleep_range() for 9900 and 9901, msleep() for
-		 * 9902-9905.
+		 * The delay hint is an order-of-magnitude suggestion, not a
+		 * minimum. It is fine, possibly even advantageous, for us to
+		 * pause for less time than hinted. To make sure pause time will
+		 * not be way longer than requested independent of HZ
+		 * configuration, use fsleep(). See fsleep() for details of
+		 * used sleeping functions.
 		 */
-		if (ms <=3D 20)
-			usleep_range(ms * 100, ms * 1000);
-		else
-			msleep(ms);
+		fsleep(ms * 1000);
 		break;
 	case RTAS_BUSY:
 		ret =3D true;
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 2341393cfac1..26c01b9e3434 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -301,7 +301,6 @@ CONFIG_DEBUG_MEMORY_INIT=3Dy
 CONFIG_DEBUG_PER_CPU_MAPS=3Dy
 CONFIG_SOFTLOCKUP_DETECTOR=3Dy
 CONFIG_WQ_WATCHDOG=3Dy
-CONFIG_DEBUG_TIMEKEEPING=3Dy
 CONFIG_DEBUG_RT_MUTEXES=3Dy
 CONFIG_DEBUG_SPINLOCK=3Dy
 CONFIG_DEBUG_MUTEXES=3Dy
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2852fcd82cbd..53a5eda8219c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -145,7 +145,6 @@ config X86
 	select ARCH_HAS_PARANOID_L1D_FLUSH
 	select BUILDTIME_TABLE_SORT
 	select CLKEVT_I8253
-	select CLOCKSOURCE_VALIDATE_LAST_CYCLE
 	select CLOCKSOURCE_WATCHDOG
 	# Word-size accesses may read uninitialized data past the trailing \0
 	# in strings and cause false KMSAN reports.
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index 7365dd4acffb..23baf8c9b34c 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -6,8 +6,6 @@
 #include <linux/interrupt.h>
 #include <linux/math64.h>
=20
-#define TICK_SIZE (tick_nsec / 1000)
-
 unsigned long long native_sched_clock(void);
 extern void recalibrate_cpu_khz(void);
=20
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index 622fe24da910..a909b817b9c0 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -263,13 +263,6 @@ static void kvm_xen_stop_timer(struct kvm_vcpu *vcpu)
 	atomic_set(&vcpu->arch.xen.timer_pending, 0);
 }
=20
-static void kvm_xen_init_timer(struct kvm_vcpu *vcpu)
-{
-	hrtimer_init(&vcpu->arch.xen.timer, CLOCK_MONOTONIC,
-		     HRTIMER_MODE_ABS_HARD);
-	vcpu->arch.xen.timer.function =3D xen_timer_callback;
-}
-
 static void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, bool atomic)
 {
 	struct kvm_vcpu_xen *vx =3D &v->arch.xen;
@@ -1070,9 +1063,6 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct=
 kvm_xen_vcpu_attr *data)
 			break;
 		}
=20
-		if (!vcpu->arch.xen.timer.function)
-			kvm_xen_init_timer(vcpu);
-
 		/* Stop the timer (if it's running) before changing the vector */
 		kvm_xen_stop_timer(vcpu);
 		vcpu->arch.xen.timer_virq =3D data->u.timer.port;
@@ -2235,6 +2225,8 @@ void kvm_xen_init_vcpu(struct kvm_vcpu *vcpu)
 	vcpu->arch.xen.poll_evtchn =3D 0;
=20
 	timer_setup(&vcpu->arch.xen.poll_timer, cancel_evtchn_poll, 0);
+	hrtimer_init(&vcpu->arch.xen.timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD);
+	vcpu->arch.xen.timer.function =3D xen_timer_callback;
=20
 	kvm_gpc_init(&vcpu->arch.xen.runstate_cache, vcpu->kvm);
 	kvm_gpc_init(&vcpu->arch.xen.runstate2_cache, vcpu->kvm);
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 95dd4660b5b6..487c85259967 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -400,7 +400,8 @@ config ARM_GT_INITIAL_PRESCALER_VAL
 	  This affects CPU_FREQ max delta from the initial frequency.
=20
 config ARM_TIMER_SP804
-	bool "Support for Dual Timer SP804 module" if COMPILE_TEST
+	bool "Support for Dual Timer SP804 module"
+	depends on ARM || ARM64 || COMPILE_TEST
 	depends on GENERIC_SCHED_CLOCK && HAVE_CLK
 	select CLKSRC_MMIO
 	select TIMER_OF if OF
@@ -753,4 +754,13 @@ config EP93XX_TIMER
 	  Enables support for the Cirrus Logic timer block
 	  EP93XX.
=20
+config RALINK_TIMER
+	bool "Ralink System Tick Counter"
+	depends on SOC_RT305X || SOC_MT7620 || COMPILE_TEST
+	select CLKSRC_MMIO
+	select TIMER_OF
+	help
+	  Enables support for system tick counter present on
+	  Ralink SoCs RT3352 and MT7620.
+
 endmenu
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 22743785299e..43ef16a4efa6 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -91,3 +91,4 @@ obj-$(CONFIG_GOLDFISH_TIMER)		+=3D timer-goldfish.o
 obj-$(CONFIG_GXP_TIMER)			+=3D timer-gxp.o
 obj-$(CONFIG_CLKSRC_LOONGSON1_PWM)	+=3D timer-loongson1-pwm.o
 obj-$(CONFIG_EP93XX_TIMER)		+=3D timer-ep93xx.o
+obj-$(CONFIG_RALINK_TIMER)		+=3D timer-ralink.o
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_a=
rch_timer.c
index 03733101e231..808f259781fd 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1179,8 +1179,6 @@ static void arch_timer_stop(struct clock_event_device *=
clk)
 	disable_percpu_irq(arch_timer_ppi[arch_timer_uses_ppi]);
 	if (arch_timer_has_nonsecure_ppi())
 		disable_percpu_irq(arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]);
-
-	clk->set_state_shutdown(clk);
 }
=20
 static int arch_timer_dying_cpu(unsigned int cpu)
@@ -1430,7 +1428,7 @@ static int __init arch_timer_of_init(struct device_node=
 *np)
=20
 	arch_timers_present |=3D ARCH_TIMER_TYPE_CP15;
=20
-	has_names =3D of_property_read_bool(np, "interrupt-names");
+	has_names =3D of_property_present(np, "interrupt-names");
=20
 	for (i =3D ARCH_TIMER_PHYS_SECURE_PPI; i < ARCH_TIMER_MAX_TIMER_PPI; i++) {
 		if (has_names)
diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm=
_global_timer.c
index a05cfaab5f84..2d86bbc2764a 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -195,7 +195,6 @@ static int gt_dying_cpu(unsigned int cpu)
 {
 	struct clock_event_device *clk =3D this_cpu_ptr(gt_evt);
=20
-	gt_clockevent_shutdown(clk);
 	disable_percpu_irq(clk->irq);
 	return 0;
 }
diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_=
timer.c
index f5f24a95ee82..3a55ae5fe225 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -68,25 +68,6 @@ static inline void apbt_writel_relaxed(struct dw_apb_timer=
 *timer, u32 val,
 	writel_relaxed(val, timer->base + offs);
 }
=20
-static void apbt_disable_int(struct dw_apb_timer *timer)
-{
-	u32 ctrl =3D apbt_readl(timer, APBTMR_N_CONTROL);
-
-	ctrl |=3D APBTMR_CONTROL_INT;
-	apbt_writel(timer, ctrl, APBTMR_N_CONTROL);
-}
-
-/**
- * dw_apb_clockevent_pause() - stop the clock_event_device from running
- *
- * @dw_ced:	The APB clock to stop generating events.
- */
-void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced)
-{
-	disable_irq(dw_ced->timer.irq);
-	apbt_disable_int(&dw_ced->timer);
-}
-
 static void apbt_eoi(struct dw_apb_timer *timer)
 {
 	apbt_readl_relaxed(timer, APBTMR_N_EOI);
@@ -284,26 +265,6 @@ dw_apb_clockevent_init(int cpu, const char *name, unsign=
ed rating,
 	return dw_ced;
 }
=20
-/**
- * dw_apb_clockevent_resume() - resume a clock that has been paused.
- *
- * @dw_ced:	The APB clock to resume.
- */
-void dw_apb_clockevent_resume(struct dw_apb_clock_event_device *dw_ced)
-{
-	enable_irq(dw_ced->timer.irq);
-}
-
-/**
- * dw_apb_clockevent_stop() - stop the clock_event_device and release the IR=
Q.
- *
- * @dw_ced:	The APB clock to stop generating the events.
- */
-void dw_apb_clockevent_stop(struct dw_apb_clock_event_device *dw_ced)
-{
-	free_irq(dw_ced->timer.irq, &dw_ced->ced);
-}
-
 /**
  * dw_apb_clockevent_register() - register the clock with the generic layer
  *
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mc=
t.c
index ef8cb1b71be4..e6a02e351d77 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -496,7 +496,6 @@ static int exynos4_mct_dying_cpu(unsigned int cpu)
 		per_cpu_ptr(&percpu_mct_tick, cpu);
 	struct clock_event_device *evt =3D &mevt->evt;
=20
-	evt->set_state_shutdown(evt);
 	if (mct_int_type =3D=3D MCT_INT_SPI) {
 		if (evt->irq !=3D -1)
 			disable_irq_nosync(evt->irq);
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-=
gic-timer.c
index 110347707ff9..7907b740497a 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -166,6 +166,37 @@ static u64 gic_hpt_read(struct clocksource *cs)
 	return gic_read_count();
 }
=20
+static u64 gic_hpt_read_multicluster(struct clocksource *cs)
+{
+	unsigned int hi, hi2, lo;
+	u64 count;
+
+	mips_cm_lock_other(0, 0, 0, CM_GCR_Cx_OTHER_BLOCK_GLOBAL);
+
+	if (mips_cm_is64) {
+		count =3D read_gic_redir_counter();
+		goto out;
+	}
+
+	hi =3D read_gic_redir_counter_32h();
+	while (true) {
+		lo =3D read_gic_redir_counter_32l();
+
+		/* If hi didn't change then lo didn't wrap & we're done */
+		hi2 =3D read_gic_redir_counter_32h();
+		if (hi2 =3D=3D hi)
+			break;
+
+		/* Otherwise, repeat with the latest hi value */
+		hi =3D hi2;
+	}
+
+	count =3D (((u64)hi) << 32) + lo;
+out:
+	mips_cm_unlock_other();
+	return count;
+}
+
 static struct clocksource gic_clocksource =3D {
 	.name			=3D "GIC",
 	.read			=3D gic_hpt_read,
@@ -203,6 +234,11 @@ static int __init __gic_clocksource_init(void)
 		gic_clocksource.rating =3D 200;
 	gic_clocksource.rating +=3D clamp(gic_frequency / 10000000, 0, 99);
=20
+	if (mips_cps_multicluster_cpus()) {
+		gic_clocksource.read =3D &gic_hpt_read_multicluster;
+		gic_clocksource.vdso_clock_mode =3D VDSO_CLOCKMODE_NONE;
+	}
+
 	ret =3D clocksource_register_hz(&gic_clocksource, gic_frequency);
 	if (ret < 0)
 		pr_warn("Unable to register clocksource\n");
@@ -261,7 +297,8 @@ static int __init gic_clocksource_of_init(struct device_n=
ode *node)
 	 * stable CPU frequency or on the platforms with CM3 and CPU frequency
 	 * change performed by the CPC core clocks divider.
 	 */
-	if (mips_cm_revision() >=3D CM_REV_CM3 || !IS_ENABLED(CONFIG_CPU_FREQ)) {
+	if ((mips_cm_revision() >=3D CM_REV_CM3 || !IS_ENABLED(CONFIG_CPU_FREQ)) &&
+	     !mips_cps_multicluster_cpus()) {
 		sched_clock_register(mips_cm_is64 ?
 				     gic_read_count_64 : gic_read_count_2x32,
 				     gic_count_width, gic_frequency);
diff --git a/drivers/clocksource/timer-armada-370-xp.c b/drivers/clocksource/=
timer-armada-370-xp.c
index 6ec565d6939a..54284c1c0651 100644
--- a/drivers/clocksource/timer-armada-370-xp.c
+++ b/drivers/clocksource/timer-armada-370-xp.c
@@ -201,7 +201,6 @@ static int armada_370_xp_timer_dying_cpu(unsigned int cpu)
 {
 	struct clock_event_device *evt =3D per_cpu_ptr(armada_370_xp_evt, cpu);
=20
-	evt->set_state_shutdown(evt);
 	disable_percpu_irq(evt->irq);
 	return 0;
 }
diff --git a/drivers/clocksource/timer-gxp.c b/drivers/clocksource/timer-gxp.c
index 57aa2e2cce53..48a73c101eb8 100644
--- a/drivers/clocksource/timer-gxp.c
+++ b/drivers/clocksource/timer-gxp.c
@@ -85,7 +85,7 @@ static int __init gxp_timer_init(struct device_node *node)
=20
 	clk =3D of_clk_get(node, 0);
 	if (IS_ERR(clk)) {
-		ret =3D (int)PTR_ERR(clk);
+		ret =3D PTR_ERR(clk);
 		pr_err("%pOFn clock not found: %d\n", node, ret);
 		goto err_free;
 	}
diff --git a/drivers/clocksource/timer-qcom.c b/drivers/clocksource/timer-qco=
m.c
index eac4c95c6127..ddb1debe6a6b 100644
--- a/drivers/clocksource/timer-qcom.c
+++ b/drivers/clocksource/timer-qcom.c
@@ -130,7 +130,6 @@ static int msm_local_timer_dying_cpu(unsigned int cpu)
 {
 	struct clock_event_device *evt =3D per_cpu_ptr(msm_evt, cpu);
=20
-	evt->set_state_shutdown(evt);
 	disable_percpu_irq(evt->irq);
 	return 0;
 }
diff --git a/arch/mips/ralink/cevt-rt3352.c b/drivers/clocksource/timer-ralin=
k.c
similarity index 91%
rename from arch/mips/ralink/cevt-rt3352.c
rename to drivers/clocksource/timer-ralink.c
index 269d4877d120..6ecdb4228f76 100644
--- a/arch/mips/ralink/cevt-rt3352.c
+++ b/drivers/clocksource/timer-ralink.c
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
+ * Ralink System Tick Counter driver present on RT3352 and MT7620 SoCs.
  *
  * Copyright (C) 2013 by John Crispin <john@phrozen.org>
  */
@@ -16,8 +15,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
=20
-#include <asm/mach-ralink/ralink_regs.h>
-
 #define SYSTICK_FREQ		(50 * 1000)
=20
 #define SYSTICK_CONFIG		0x00
@@ -40,7 +37,7 @@ static int systick_set_oneshot(struct clock_event_device *e=
vt);
 static int systick_shutdown(struct clock_event_device *evt);
=20
 static int systick_next_event(unsigned long delta,
-				struct clock_event_device *evt)
+			      struct clock_event_device *evt)
 {
 	struct systick_device *sdev;
 	u32 count;
@@ -60,7 +57,7 @@ static void systick_event_handler(struct clock_event_device=
 *dev)
=20
 static irqreturn_t systick_interrupt(int irq, void *dev_id)
 {
-	struct clock_event_device *dev =3D (struct clock_event_device *) dev_id;
+	struct clock_event_device *dev =3D (struct clock_event_device *)dev_id;
=20
 	dev->event_handler(dev);
=20
diff --git a/drivers/clocksource/timer-tegra.c b/drivers/clocksource/timer-te=
gra.c
index e9635c25eef4..35b6ce9deffa 100644
--- a/drivers/clocksource/timer-tegra.c
+++ b/drivers/clocksource/timer-tegra.c
@@ -158,7 +158,6 @@ static int tegra_timer_stop(unsigned int cpu)
 {
 	struct timer_of *to =3D per_cpu_ptr(&tegra_to, cpu);
=20
-	to->clkevt.set_state_shutdown(&to->clkevt);
 	disable_irq_nosync(to->clkevt.irq);
=20
 	return 0;
diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource=
/timer-ti-dm-systimer.c
index c2dcd8d68e45..985a6d08512b 100644
--- a/drivers/clocksource/timer-ti-dm-systimer.c
+++ b/drivers/clocksource/timer-ti-dm-systimer.c
@@ -202,10 +202,10 @@ static bool __init dmtimer_is_preferred(struct device_n=
ode *np)
=20
 	/* Secure gptimer12 is always clocked with a fixed source */
 	if (!of_property_read_bool(np, "ti,timer-secure")) {
-		if (!of_property_read_bool(np, "assigned-clocks"))
+		if (!of_property_present(np, "assigned-clocks"))
 			return false;
=20
-		if (!of_property_read_bool(np, "assigned-clock-parents"))
+		if (!of_property_present(np, "assigned-clock-parents"))
 			return false;
 	}
=20
@@ -686,9 +686,9 @@ subsys_initcall(dmtimer_percpu_timer_startup);
=20
 static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
 {
-	struct device_node *arm_timer;
+	struct device_node *arm_timer __free(device_node) =3D
+		of_find_compatible_node(NULL, NULL, "arm,armv7-timer");
=20
-	arm_timer =3D of_find_compatible_node(NULL, NULL, "arm,armv7-timer");
 	if (of_device_is_available(arm_timer)) {
 		pr_warn_once("ARM architected timer wrap issue i940 detected\n");
 		return 0;
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti=
-dm.c
index b7a34b1a975e..3666d94cc8dd 100644
--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -1104,8 +1104,12 @@ static int omap_dm_timer_probe(struct platform_device =
*pdev)
 		return  -ENOMEM;
=20
 	timer->irq =3D platform_get_irq(pdev, 0);
-	if (timer->irq < 0)
-		return timer->irq;
+	if (timer->irq < 0) {
+		if (of_property_read_bool(dev->of_node, "ti,timer-pwm"))
+			dev_info(dev, "Did not find timer interrupt, timer usable in PWM mode onl=
y\n");
+		else
+			return timer->irq;
+	}
=20
 	timer->io_base =3D devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(timer->io_base))
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_=
request.c
index 519e096c607c..8f62cfa23fb7 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -273,11 +273,6 @@ i915_request_active_engine(struct i915_request *rq,
 	return ret;
 }
=20
-static void __rq_init_watchdog(struct i915_request *rq)
-{
-	rq->watchdog.timer.function =3D NULL;
-}
-
 static enum hrtimer_restart __rq_watchdog_expired(struct hrtimer *hrtimer)
 {
 	struct i915_request *rq =3D
@@ -294,6 +289,14 @@ static enum hrtimer_restart __rq_watchdog_expired(struct=
 hrtimer *hrtimer)
 	return HRTIMER_NORESTART;
 }
=20
+static void __rq_init_watchdog(struct i915_request *rq)
+{
+	struct i915_request_watchdog *wdg =3D &rq->watchdog;
+
+	hrtimer_init(&wdg->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	wdg->timer.function =3D __rq_watchdog_expired;
+}
+
 static void __rq_arm_watchdog(struct i915_request *rq)
 {
 	struct i915_request_watchdog *wdg =3D &rq->watchdog;
@@ -304,8 +307,6 @@ static void __rq_arm_watchdog(struct i915_request *rq)
=20
 	i915_request_get(rq);
=20
-	hrtimer_init(&wdg->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-	wdg->timer.function =3D __rq_watchdog_expired;
 	hrtimer_start_range_ns(&wdg->timer,
 			       ns_to_ktime(ce->watchdog.timeout_us *
 					   NSEC_PER_USEC),
@@ -317,7 +318,7 @@ static void __rq_cancel_watchdog(struct i915_request *rq)
 {
 	struct i915_request_watchdog *wdg =3D &rq->watchdog;
=20
-	if (wdg->timer.function && hrtimer_try_to_cancel(&wdg->timer) > 0)
+	if (hrtimer_try_to_cancel(&wdg->timer) > 0)
 		i915_request_put(rq);
 }
=20
diff --git a/drivers/media/usb/dvb-usb-v2/anysee.c b/drivers/media/usb/dvb-us=
b-v2/anysee.c
index 8699846eb416..bea12cdc85e8 100644
--- a/drivers/media/usb/dvb-usb-v2/anysee.c
+++ b/drivers/media/usb/dvb-usb-v2/anysee.c
@@ -46,24 +46,15 @@ static int anysee_ctrl_msg(struct dvb_usb_device *d,
=20
 	dev_dbg(&d->udev->dev, "%s: >>> %*ph\n", __func__, slen, state->buf);
=20
-	/* We need receive one message more after dvb_usb_generic_rw due
-	   to weird transaction flow, which is 1 x send + 2 x receive. */
+	/*
+	 * We need receive one message more after dvb_usbv2_generic_rw_locked()
+	 * due to weird transaction flow, which is 1 x send + 2 x receive.
+	 */
 	ret =3D dvb_usbv2_generic_rw_locked(d, state->buf, sizeof(state->buf),
 			state->buf, sizeof(state->buf));
 	if (ret)
 		goto error_unlock;
=20
-	/* TODO FIXME: dvb_usb_generic_rw() fails rarely with error code -32
-	 * (EPIPE, Broken pipe). Function supports currently msleep() as a
-	 * parameter but I would not like to use it, since according to
-	 * Documentation/timers/timers-howto.rst it should not be used such
-	 * short, under < 20ms, sleeps. Repeating failed message would be
-	 * better choice as not to add unwanted delays...
-	 * Fixing that correctly is one of those or both;
-	 * 1) use repeat if possible
-	 * 2) add suitable delay
-	 */
-
 	/* get answer, retry few times if error returned */
 	for (i =3D 0; i < 3; i++) {
 		/* receive 2nd answer */
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wir=
eless/ralink/rt2x00/rt2x00usb.c
index 8fd22c69855f..a6d50149e0c3 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
@@ -823,8 +823,6 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,
=20
 	INIT_WORK(&rt2x00dev->rxdone_work, rt2x00usb_work_rxdone);
 	INIT_WORK(&rt2x00dev->txdone_work, rt2x00usb_work_txdone);
-	hrtimer_init(&rt2x00dev->txstatus_timer, CLOCK_MONOTONIC,
-		     HRTIMER_MODE_REL);
=20
 	retval =3D rt2x00usb_alloc_reg(rt2x00dev);
 	if (retval)
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/ch=
arger-manager.c
index 96f0a7fbf105..09ec0ecf1486 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1412,10 +1412,9 @@ static inline struct charger_desc *cm_get_drv_data(str=
uct platform_device *pdev)
 	return dev_get_platdata(&pdev->dev);
 }
=20
-static enum alarmtimer_restart cm_timer_func(struct alarm *alarm, ktime_t no=
w)
+static void cm_timer_func(struct alarm *alarm, ktime_t now)
 {
 	cm_timer_set =3D false;
-	return ALARMTIMER_NORESTART;
 }
=20
 static int charger_manager_probe(struct platform_device *pdev)
diff --git a/fs/aio.c b/fs/aio.c
index e8920178b50f..a5d331f29943 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1335,7 +1335,7 @@ static long read_events(struct kioctx *ctx, long min_nr=
, long nr,
 	if (until =3D=3D 0 || ret < 0 || ret >=3D min_nr)
 		return ret;
=20
-	hrtimer_init_sleeper_on_stack(&t, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+	hrtimer_setup_sleeper_on_stack(&t, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	if (until !=3D KTIME_MAX) {
 		hrtimer_set_expires_range_ns(&t.timer, until, current->timer_slack_ns);
 		hrtimer_sleeper_start_expires(&t, HRTIMER_MODE_REL);
diff --git a/fs/proc/base.c b/fs/proc/base.c
index b31283d81c52..6a37a43241e4 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2553,8 +2553,8 @@ static int show_timer(struct seq_file *m, void *v)
=20
 	seq_printf(m, "ID: %d\n", timer->it_id);
 	seq_printf(m, "signal: %d/%px\n",
-		   timer->sigq->info.si_signo,
-		   timer->sigq->info.si_value.sival_ptr);
+		   timer->sigq.info.si_signo,
+		   timer->sigq.info.si_value.sival_ptr);
 	seq_printf(m, "notify: %s/%s.%d\n",
 		   nstr[notify & ~SIGEV_THREAD_ID],
 		   (notify & SIGEV_THREAD_ID) ? "tid" : "pid",
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 137523e0bb21..f10c99ad5c60 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -79,13 +79,11 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtime=
r *htmr)
 	return HRTIMER_NORESTART;
 }
=20
-static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm,
-	ktime_t now)
+static void timerfd_alarmproc(struct alarm *alarm, ktime_t now)
 {
 	struct timerfd_ctx *ctx =3D container_of(alarm, struct timerfd_ctx,
 					       t.alarm);
 	timerfd_triggered(ctx);
-	return ALARMTIMER_NORESTART;
 }
=20
 /*
diff --git a/include/asm-generic/delay.h b/include/asm-generic/delay.h
index e448ac61430c..76cf237b6e4c 100644
--- a/include/asm-generic/delay.h
+++ b/include/asm-generic/delay.h
@@ -2,6 +2,9 @@
 #ifndef __ASM_GENERIC_DELAY_H
 #define __ASM_GENERIC_DELAY_H
=20
+#include <linux/math.h>
+#include <vdso/time64.h>
+
 /* Undefined functions to get compile-time errors */
 extern void __bad_udelay(void);
 extern void __bad_ndelay(void);
@@ -12,34 +15,73 @@ extern void __const_udelay(unsigned long xloops);
 extern void __delay(unsigned long loops);
=20
 /*
- * The weird n/20000 thing suppresses a "comparison is always false due to
- * limited range of data type" warning with non-const 8-bit arguments.
+ * The microseconds/nanosecond delay multiplicators are used to convert a
+ * constant microseconds/nanoseconds value to a value which can be used by t=
he
+ * architectures specific implementation to transform it into loops.
+ */
+#define UDELAY_CONST_MULT	((unsigned long)DIV_ROUND_UP(1ULL << 32, USEC_PER_=
SEC))
+#define NDELAY_CONST_MULT	((unsigned long)DIV_ROUND_UP(1ULL << 32, NSEC_PER_=
SEC))
+
+/*
+ * The maximum constant udelay/ndelay value picked out of thin air to prevent
+ * too long constant udelays/ndelays.
  */
+#define DELAY_CONST_MAX   20000
=20
-/* 0x10c7 is 2**32 / 1000000 (rounded up) */
-#define udelay(n)							\
-	({								\
-		if (__builtin_constant_p(n)) {				\
-			if ((n) / 20000 >=3D 1)				\
-				 __bad_udelay();			\
-			else						\
-				__const_udelay((n) * 0x10c7ul);		\
-		} else {						\
-			__udelay(n);					\
-		}							\
-	})
-
-/* 0x5 is 2**32 / 1000000000 (rounded up) */
-#define ndelay(n)							\
-	({								\
-		if (__builtin_constant_p(n)) {				\
-			if ((n) / 20000 >=3D 1)				\
-				__bad_ndelay();				\
-			else						\
-				__const_udelay((n) * 5ul);		\
-		} else {						\
-			__ndelay(n);					\
-		}							\
-	})
+/**
+ * udelay - Inserting a delay based on microseconds with busy waiting
+ * @usec:	requested delay in microseconds
+ *
+ * When delaying in an atomic context ndelay(), udelay() and mdelay() are the
+ * only valid variants of delaying/sleeping to go with.
+ *
+ * When inserting delays in non atomic context which are shorter than the ti=
me
+ * which is required to queue e.g. an hrtimer and to enter then the schedule=
r,
+ * it is also valuable to use udelay(). But it is not simple to specify a
+ * generic threshold for this which will fit for all systems. An approximati=
on
+ * is a threshold for all delays up to 10 microseconds.
+ *
+ * When having a delay which is larger than the architecture specific
+ * %MAX_UDELAY_MS value, please make sure mdelay() is used. Otherwise a over=
flow
+ * risk is given.
+ *
+ * Please note that ndelay(), udelay() and mdelay() may return early for sev=
eral
+ * reasons (https://lists.openwall.net/linux-kernel/2011/01/09/56):
+ *
+ * #. computed loops_per_jiffy too low (due to the time taken to execute the
+ *    timer interrupt.)
+ * #. cache behaviour affecting the time it takes to execute the loop functi=
on.
+ * #. CPU clock rate changes.
+ */
+static __always_inline void udelay(unsigned long usec)
+{
+	if (__builtin_constant_p(usec)) {
+		if (usec >=3D DELAY_CONST_MAX)
+			__bad_udelay();
+		else
+			__const_udelay(usec * UDELAY_CONST_MULT);
+	} else {
+		__udelay(usec);
+	}
+}
+
+/**
+ * ndelay - Inserting a delay based on nanoseconds with busy waiting
+ * @nsec:	requested delay in nanoseconds
+ *
+ * See udelay() for basic information about ndelay() and it's variants.
+ */
+static __always_inline void ndelay(unsigned long nsec)
+{
+	if (__builtin_constant_p(nsec)) {
+		if (nsec >=3D DELAY_CONST_MAX)
+			__bad_udelay();
+		else
+			__const_udelay(nsec * NDELAY_CONST_MULT);
+	} else {
+		__udelay(nsec);
+	}
+}
+#define ndelay(x) ndelay(x)
=20
 #endif /* __ASM_GENERIC_DELAY_H */
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index 05e758b8b894..3ffa5341dce2 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -20,12 +20,6 @@ enum alarmtimer_type {
 	ALARM_BOOTTIME_FREEZER,
 };
=20
-enum alarmtimer_restart {
-	ALARMTIMER_NORESTART,
-	ALARMTIMER_RESTART,
-};
-
-
 #define ALARMTIMER_STATE_INACTIVE	0x00
 #define ALARMTIMER_STATE_ENQUEUED	0x01
=20
@@ -42,14 +36,14 @@ enum alarmtimer_restart {
 struct alarm {
 	struct timerqueue_node	node;
 	struct hrtimer		timer;
-	enum alarmtimer_restart	(*function)(struct alarm *, ktime_t now);
+	void			(*function)(struct alarm *, ktime_t now);
 	enum alarmtimer_type	type;
 	int			state;
 	void			*data;
 };
=20
 void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
-		enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
+		void (*function)(struct alarm *, ktime_t));
 void alarm_start(struct alarm *alarm, ktime_t start);
 void alarm_start_relative(struct alarm *alarm, ktime_t start);
 void alarm_restart(struct alarm *alarm);
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index d35b677b08fe..ef1b16da6ad5 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -215,7 +215,6 @@ static inline s64 clocksource_cyc2ns(u64 cycles, u32 mult=
, u32 shift)
=20
 extern int clocksource_unregister(struct clocksource*);
 extern void clocksource_touch_watchdog(void);
-extern void clocksource_change_rating(struct clocksource *cs, int rating);
 extern void clocksource_suspend(void);
 extern void clocksource_resume(void);
 extern struct clocksource * __init clocksource_default_clock(void);
diff --git a/include/linux/delay.h b/include/linux/delay.h
index ff9cda975e30..89866bab100d 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -6,21 +6,12 @@
  * Copyright (C) 1993 Linus Torvalds
  *
  * Delay routines, using a pre-computed "loops_per_jiffy" value.
- *
- * Please note that ndelay(), udelay() and mdelay() may return early for
- * several reasons:
- *  1. computed loops_per_jiffy too low (due to the time taken to
- *     execute the timer interrupt.)
- *  2. cache behaviour affecting the time it takes to execute the
- *     loop function.
- *  3. CPU clock rate changes.
- *
- * Please see this thread:
- *   https://lists.openwall.net/linux-kernel/2011/01/09/56
+ * Sleep routines using timer list timers or hrtimers.
  */
=20
 #include <linux/math.h>
 #include <linux/sched.h>
+#include <linux/jiffies.h>
=20
 extern unsigned long loops_per_jiffy;
=20
@@ -35,12 +26,21 @@ extern unsigned long loops_per_jiffy;
  * The 2nd mdelay() definition ensures GCC will optimize away the=20
  * while loop for the common cases where n <=3D MAX_UDELAY_MS  --  Paul G.
  */
-
 #ifndef MAX_UDELAY_MS
 #define MAX_UDELAY_MS	5
 #endif
=20
 #ifndef mdelay
+/**
+ * mdelay - Inserting a delay based on milliseconds with busy waiting
+ * @n:	requested delay in milliseconds
+ *
+ * See udelay() for basic information about mdelay() and it's variants.
+ *
+ * Please double check, whether mdelay() is the right way to go or whether a
+ * refactoring of the code is the better variant to be able to use msleep()
+ * instead.
+ */
 #define mdelay(n) (\
 	(__builtin_constant_p(n) && (n)<=3DMAX_UDELAY_MS) ? udelay((n)*1000) : \
 	({unsigned long __ms=3D(n); while (__ms--) udelay(1000);}))
@@ -63,30 +63,75 @@ unsigned long msleep_interruptible(unsigned int msecs);
 void usleep_range_state(unsigned long min, unsigned long max,
 			unsigned int state);
=20
+/**
+ * usleep_range - Sleep for an approximate time
+ * @min:	Minimum time in microseconds to sleep
+ * @max:	Maximum time in microseconds to sleep
+ *
+ * For basic information please refere to usleep_range_state().
+ *
+ * The task will be in the state TASK_UNINTERRUPTIBLE during the sleep.
+ */
 static inline void usleep_range(unsigned long min, unsigned long max)
 {
 	usleep_range_state(min, max, TASK_UNINTERRUPTIBLE);
 }
=20
-static inline void usleep_idle_range(unsigned long min, unsigned long max)
+/**
+ * usleep_range_idle - Sleep for an approximate time with idle time accounti=
ng
+ * @min:	Minimum time in microseconds to sleep
+ * @max:	Maximum time in microseconds to sleep
+ *
+ * For basic information please refere to usleep_range_state().
+ *
+ * The sleeping task has the state TASK_IDLE during the sleep to prevent
+ * contribution to the load avarage.
+ */
+static inline void usleep_range_idle(unsigned long min, unsigned long max)
 {
 	usleep_range_state(min, max, TASK_IDLE);
 }
=20
+/**
+ * ssleep - wrapper for seconds around msleep
+ * @seconds:	Requested sleep duration in seconds
+ *
+ * Please refere to msleep() for detailed information.
+ */
 static inline void ssleep(unsigned int seconds)
 {
 	msleep(seconds * 1000);
 }
=20
-/* see Documentation/timers/timers-howto.rst for the thresholds */
+static const unsigned int max_slack_shift =3D 2;
+#define USLEEP_RANGE_UPPER_BOUND	((TICK_NSEC << max_slack_shift) / NSEC_PER_=
USEC)
+
+/**
+ * fsleep - flexible sleep which autoselects the best mechanism
+ * @usecs:	requested sleep duration in microseconds
+ *
+ * flseep() selects the best mechanism that will provide maximum 25% slack
+ * to the requested sleep duration. Therefore it uses:
+ *
+ * * udelay() loop for sleep durations <=3D 10 microseconds to avoid hrtimer
+ *   overhead for really short sleep durations.
+ * * usleep_range() for sleep durations which would lead with the usage of
+ *   msleep() to a slack larger than 25%. This depends on the granularity of
+ *   jiffies.
+ * * msleep() for all other sleep durations.
+ *
+ * Note: When %CONFIG_HIGH_RES_TIMERS is not set, all sleeps are processed w=
ith
+ * the granularity of jiffies and the slack might exceed 25% especially for
+ * short sleep durations.
+ */
 static inline void fsleep(unsigned long usecs)
 {
 	if (usecs <=3D 10)
 		udelay(usecs);
-	else if (usecs <=3D 20000)
-		usleep_range(usecs, 2 * usecs);
+	else if (usecs < USLEEP_RANGE_UPPER_BOUND)
+		usleep_range(usecs, usecs + (usecs >> max_slack_shift));
 	else
-		msleep(DIV_ROUND_UP(usecs, 1000));
+		msleep(DIV_ROUND_UP(usecs, USEC_PER_MSEC));
 }
=20
 #endif /* defined(_LINUX_DELAY_H) */
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
index 82ebf9223948..f8811c46b89e 100644
--- a/include/linux/dw_apb_timer.h
+++ b/include/linux/dw_apb_timer.h
@@ -34,9 +34,6 @@ struct dw_apb_clocksource {
 };
=20
 void dw_apb_clockevent_register(struct dw_apb_clock_event_device *dw_ced);
-void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced);
-void dw_apb_clockevent_resume(struct dw_apb_clock_event_device *dw_ced);
-void dw_apb_clockevent_stop(struct dw_apb_clock_event_device *dw_ced);
=20
 struct dw_apb_clock_event_device *
 dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index aa1e65ccb615..7ef5f7ef31a9 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -228,32 +228,17 @@ static inline void hrtimer_cancel_wait_running(struct h=
rtimer *timer)
 /* Initialize timers: */
 extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
 			 enum hrtimer_mode mode);
-extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock=
_id,
-				 enum hrtimer_mode mode);
+extern void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*func=
tion)(struct hrtimer *),
+			  clockid_t clock_id, enum hrtimer_mode mode);
+extern void hrtimer_setup_on_stack(struct hrtimer *timer,
+				   enum hrtimer_restart (*function)(struct hrtimer *),
+				   clockid_t clock_id, enum hrtimer_mode mode);
+extern void hrtimer_setup_sleeper_on_stack(struct hrtimer_sleeper *sl, clock=
id_t clock_id,
+					   enum hrtimer_mode mode);
=20
 #ifdef CONFIG_DEBUG_OBJECTS_TIMERS
-extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clo=
ck,
-				  enum hrtimer_mode mode);
-extern void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl,
-					  clockid_t clock_id,
-					  enum hrtimer_mode mode);
-
 extern void destroy_hrtimer_on_stack(struct hrtimer *timer);
 #else
-static inline void hrtimer_init_on_stack(struct hrtimer *timer,
-					 clockid_t which_clock,
-					 enum hrtimer_mode mode)
-{
-	hrtimer_init(timer, which_clock, mode);
-}
-
-static inline void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl,
-						 clockid_t clock_id,
-						 enum hrtimer_mode mode)
-{
-	hrtimer_init_sleeper(sl, clock_id, mode);
-}
-
 static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
 #endif
=20
@@ -337,6 +322,28 @@ static inline int hrtimer_callback_running(struct hrtime=
r *timer)
 	return timer->base->running =3D=3D timer;
 }
=20
+/**
+ * hrtimer_update_function - Update the timer's callback function
+ * @timer:	Timer to update
+ * @function:	New callback function
+ *
+ * Only safe to call if the timer is not enqueued. Can be called in the call=
back function if the
+ * timer is not enqueued at the same time (see the comments above HRTIMER_ST=
ATE_ENQUEUED).
+ */
+static inline void hrtimer_update_function(struct hrtimer *timer,
+					   enum hrtimer_restart (*function)(struct hrtimer *))
+{
+	guard(raw_spinlock_irqsave)(&timer->base->cpu_base->lock);
+
+	if (WARN_ON_ONCE(hrtimer_is_queued(timer)))
+		return;
+
+	if (WARN_ON_ONCE(!function))
+		return;
+
+	timer->function =3D function;
+}
+
 /* Forward a hrtimer so it expires after now: */
 extern u64
 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h
index 19a7b00baff4..91324c331a4b 100644
--- a/include/linux/iopoll.h
+++ b/include/linux/iopoll.h
@@ -19,19 +19,19 @@
  * @op: accessor function (takes @args as its arguments)
  * @val: Variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @sleep_us: Maximum time to sleep between reads in us (0
- *            tight-loops).  Should be less than ~20ms since usleep_range
- *            is used (see Documentation/timers/timers-howto.rst).
+ * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Ple=
ase
+ *            read usleep_range() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  * @sleep_before_read: if it is true, sleep @sleep_us before read.
  * @args: arguments for @op poll
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
- * case, the last read value at @args is stored in @val. Must not
- * be called from atomic context if sleep_us or timeout_us are used.
- *
  * When available, you'll probably want to use one of the specialized
  * macros defined below rather than this macro directly.
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either
+ * case, the last read value at @args is stored in @val. Must not
+ * be called from atomic context if sleep_us or timeout_us are used.
  */
 #define read_poll_timeout(op, val, cond, sleep_us, timeout_us, \
 				sleep_before_read, args...) \
@@ -64,22 +64,22 @@
  * @op: accessor function (takes @args as its arguments)
  * @val: Variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @delay_us: Time to udelay between reads in us (0 tight-loops).  Should
- *            be less than ~10us since udelay is used (see
- *            Documentation/timers/timers-howto.rst).
+ * @delay_us: Time to udelay between reads in us (0 tight-loops). Please
+ *            read udelay() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  * @delay_before_read: if it is true, delay @delay_us before read.
  * @args: arguments for @op poll
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
- * case, the last read value at @args is stored in @val.
- *
  * This macro does not rely on timekeeping.  Hence it is safe to call even w=
hen
  * timekeeping is suspended, at the expense of an underestimation of wall cl=
ock
  * time, which is rather minimal with a non-zero delay_us.
  *
  * When available, you'll probably want to use one of the specialized
  * macros defined below rather than this macro directly.
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either
+ * case, the last read value at @args is stored in @val.
  */
 #define read_poll_timeout_atomic(op, val, cond, delay_us, timeout_us, \
 					delay_before_read, args...) \
@@ -119,17 +119,17 @@
  * @addr: Address to poll
  * @val: Variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @sleep_us: Maximum time to sleep between reads in us (0
- *            tight-loops).  Should be less than ~20ms since usleep_range
- *            is used (see Documentation/timers/timers-howto.rst).
+ * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Ple=
ase
+ *            read usleep_range() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
- * case, the last read value at @addr is stored in @val. Must not
- * be called from atomic context if sleep_us or timeout_us are used.
- *
  * When available, you'll probably want to use one of the specialized
  * macros defined below rather than this macro directly.
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either
+ * case, the last read value at @addr is stored in @val. Must not
+ * be called from atomic context if sleep_us or timeout_us are used.
  */
 #define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us)	\
 	read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
@@ -140,16 +140,16 @@
  * @addr: Address to poll
  * @val: Variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @delay_us: Time to udelay between reads in us (0 tight-loops).  Should
- *            be less than ~10us since udelay is used (see
- *            Documentation/timers/timers-howto.rst).
+ * @delay_us: Time to udelay between reads in us (0 tight-loops). Please
+ *            read udelay() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
- * case, the last read value at @addr is stored in @val.
- *
  * When available, you'll probably want to use one of the specialized
  * macros defined below rather than this macro directly.
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either
+ * case, the last read value at @addr is stored in @val.
  */
 #define readx_poll_timeout_atomic(op, addr, val, cond, delay_us, timeout_us)=
 \
 	read_poll_timeout_atomic(op, val, cond, delay_us, timeout_us, false, addr)
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 1220f0fbe5bf..ed945f42e064 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -502,7 +502,7 @@ static inline unsigned long _msecs_to_jiffies(const unsig=
ned int m)
  * - all other values are converted to jiffies by either multiplying
  *   the input value by a factor or dividing it with a factor and
  *   handling any 32-bit overflows.
- *   for the details see __msecs_to_jiffies()
+ *   for the details see _msecs_to_jiffies()
  *
  * msecs_to_jiffies() checks for the passed in value being a constant
  * via __builtin_constant_p() allowing gcc to eliminate most of the
@@ -526,6 +526,19 @@ static __always_inline unsigned long msecs_to_jiffies(co=
nst unsigned int m)
 	}
 }
=20
+/**
+ * secs_to_jiffies: - convert seconds to jiffies
+ * @_secs: time in seconds
+ *
+ * Conversion is done by simple multiplication with HZ
+ *
+ * secs_to_jiffies() is defined as a macro rather than a static inline
+ * function so it can be used in static initializers.
+ *
+ * Return: jiffies value
+ */
+#define secs_to_jiffies(_secs) ((_secs) * HZ)
+
 extern unsigned long __usecs_to_jiffies(const unsigned int u);
 #if !(USEC_PER_SEC % HZ)
 static inline unsigned long _usecs_to_jiffies(const unsigned int u)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index a98bc91a0cde..504766d4b2d5 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1378,12 +1378,13 @@ int phy_read_mmd(struct phy_device *phydev, int devad=
, u32 regnum);
  * @regnum: The register on the MMD to read
  * @val: Variable to read the register into
  * @cond: Break condition (usually involving @val)
- * @sleep_us: Maximum time to sleep between reads in us (0
- *            tight-loops).  Should be less than ~20ms since usleep_range
- *            is used (see Documentation/timers/timers-howto.rst).
+ * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Ple=
ase
+ *            read usleep_range() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  * @sleep_before_read: if it is true, sleep @sleep_us before read.
- * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either
  * case, the last read value at @args is stored in @val. Must not
  * be called from atomic context if sleep_us or timeout_us are used.
  */
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 453691710839..f11f10c97bd9 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -5,12 +5,16 @@
 #include <linux/alarmtimer.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
+#include <linux/pid.h>
 #include <linux/posix-timers_types.h>
+#include <linux/rcuref.h>
 #include <linux/spinlock.h>
 #include <linux/timerqueue.h>
=20
 struct kernel_siginfo;
 struct task_struct;
+struct sigqueue;
+struct k_itimer;
=20
 static inline clockid_t make_process_cpuclock(const unsigned int pid,
 		const clockid_t clock)
@@ -35,6 +39,8 @@ static inline int clockid_to_fd(const clockid_t clk)
=20
 #ifdef CONFIG_POSIX_TIMERS
=20
+#include <linux/signal_types.h>
+
 /**
  * cpu_timer - Posix CPU timer representation for k_itimer
  * @node:	timerqueue node to queue in the task/sig
@@ -42,6 +48,7 @@ static inline int clockid_to_fd(const clockid_t clk)
  * @pid:	Pointer to target task PID
  * @elist:	List head for the expiry list
  * @firing:	Timer is currently firing
+ * @nanosleep:	Timer is used for nanosleep and is not a regular posix-timer
  * @handling:	Pointer to the task which handles expiry
  */
 struct cpu_timer {
@@ -49,7 +56,8 @@ struct cpu_timer {
 	struct timerqueue_head		*head;
 	struct pid			*pid;
 	struct list_head		elist;
-	int				firing;
+	bool				firing;
+	bool				nanosleep;
 	struct task_struct __rcu	*handling;
 };
=20
@@ -101,6 +109,12 @@ static inline void posix_cputimers_rt_watchdog(struct po=
six_cputimers *pct,
 	pct->bases[CPUCLOCK_SCHED].nextevt =3D runtime;
 }
=20
+void posixtimer_rearm_itimer(struct task_struct *p);
+bool posixtimer_init_sigqueue(struct sigqueue *q);
+void posixtimer_send_sigqueue(struct k_itimer *tmr);
+bool posixtimer_deliver_signal(struct kernel_siginfo *info, struct sigqueue =
*timer_sigq);
+void posixtimer_free_timer(struct k_itimer *timer);
+
 /* Init task static initializer */
 #define INIT_CPU_TIMERBASE(b) {						\
 	.nextevt	=3D U64_MAX,					\
@@ -122,6 +136,10 @@ struct cpu_timer { };
 static inline void posix_cputimers_init(struct posix_cputimers *pct) { }
 static inline void posix_cputimers_group_init(struct posix_cputimers *pct,
 					      u64 cpu_limit) { }
+static inline void posixtimer_rearm_itimer(struct task_struct *p) { }
+static inline bool posixtimer_deliver_signal(struct kernel_siginfo *info,
+					     struct sigqueue *timer_sigq) { return false; }
+static inline void posixtimer_free_timer(struct k_itimer *timer) { }
 #endif
=20
 #ifdef CONFIG_POSIX_CPU_TIMERS_TASK_WORK
@@ -132,50 +150,56 @@ static inline void clear_posix_cputimers_work(struct ta=
sk_struct *p) { }
 static inline void posix_cputimers_init_work(void) { }
 #endif
=20
-#define REQUEUE_PENDING 1
-
 /**
  * struct k_itimer - POSIX.1b interval timer structure.
- * @list:		List head for binding the timer to signals->posix_timers
+ * @list:		List node for binding the timer to tsk::signal::posix_timers
+ * @ignored_list:	List node for tracking ignored timers in tsk::signal::igno=
red_posix_timers
  * @t_hash:		Entry in the posix timer hash table
  * @it_lock:		Lock protecting the timer
  * @kclock:		Pointer to the k_clock struct handling this timer
  * @it_clock:		The posix timer clock id
  * @it_id:		The posix timer id for identifying the timer
- * @it_active:		Marker that timer is active
+ * @it_status:		The status of the timer
+ * @it_sig_periodic:	The periodic status at signal delivery
  * @it_overrun:		The overrun counter for pending signals
  * @it_overrun_last:	The overrun at the time of the last delivered signal
- * @it_requeue_pending:	Indicator that timer waits for being requeued on
- *			signal delivery
+ * @it_signal_seq:	Sequence count to control signal delivery
+ * @it_sigqueue_seq:	The sequence count at the point where the signal was qu=
eued
  * @it_sigev_notify:	The notify word of sigevent struct for signal delivery
  * @it_interval:	The interval for periodic timers
  * @it_signal:		Pointer to the creators signal struct
  * @it_pid:		The pid of the process/task targeted by the signal
  * @it_process:		The task to wakeup on clock_nanosleep (CPU timers)
- * @sigq:		Pointer to preallocated sigqueue
+ * @rcuref:		Reference count for life time management
+ * @sigq:		Embedded sigqueue
  * @it:			Union representing the various posix timer type
  *			internals.
  * @rcu:		RCU head for freeing the timer.
  */
 struct k_itimer {
 	struct hlist_node	list;
+	struct hlist_node	ignored_list;
 	struct hlist_node	t_hash;
 	spinlock_t		it_lock;
 	const struct k_clock	*kclock;
 	clockid_t		it_clock;
 	timer_t			it_id;
-	int			it_active;
+	int			it_status;
+	bool			it_sig_periodic;
 	s64			it_overrun;
 	s64			it_overrun_last;
-	int			it_requeue_pending;
+	unsigned int		it_signal_seq;
+	unsigned int		it_sigqueue_seq;
 	int			it_sigev_notify;
+	enum pid_type		it_pid_type;
 	ktime_t			it_interval;
 	struct signal_struct	*it_signal;
 	union {
 		struct pid		*it_pid;
 		struct task_struct	*it_process;
 	};
-	struct sigqueue		*sigq;
+	struct sigqueue		sigq;
+	rcuref_t		rcuref;
 	union {
 		struct {
 			struct hrtimer	timer;
@@ -196,5 +220,29 @@ void set_process_cpu_timer(struct task_struct *task, uns=
igned int clock_idx,
=20
 int update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new);
=20
-void posixtimer_rearm(struct kernel_siginfo *info);
+#ifdef CONFIG_POSIX_TIMERS
+static inline void posixtimer_putref(struct k_itimer *tmr)
+{
+	if (rcuref_put(&tmr->rcuref))
+		posixtimer_free_timer(tmr);
+}
+
+static inline void posixtimer_sigqueue_getref(struct sigqueue *q)
+{
+	struct k_itimer *tmr =3D container_of(q, struct k_itimer, sigq);
+
+	WARN_ON_ONCE(!rcuref_get(&tmr->rcuref));
+}
+
+static inline void posixtimer_sigqueue_putref(struct sigqueue *q)
+{
+	struct k_itimer *tmr =3D container_of(q, struct k_itimer, sigq);
+
+	posixtimer_putref(tmr);
+}
+#else  /* CONFIG_POSIX_TIMERS */
+static inline void posixtimer_sigqueue_getref(struct sigqueue *q) { }
+static inline void posixtimer_sigqueue_putref(struct sigqueue *q) { }
+#endif /* !CONFIG_POSIX_TIMERS */
+
 #endif
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index f9ccad32fc5c..75f162b60ba1 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -106,17 +106,17 @@ struct reg_sequence {
  * @addr: Address to poll
  * @val: Unsigned integer variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @sleep_us: Maximum time to sleep between reads in us (0
- *            tight-loops).  Should be less than ~20ms since usleep_range
- *            is used (see Documentation/timers/timers-howto.rst).
+ * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Ple=
ase
+ *            read usleep_range() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
+ * This is modelled after the readx_poll_timeout macros in linux/iopoll.h.
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
  * error return value in case of a error read. In the two former cases,
  * the last read value at @addr is stored in @val. Must not be called
  * from atomic context if sleep_us or timeout_us are used.
- *
- * This is modelled after the readx_poll_timeout macros in linux/iopoll.h.
  */
 #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us)=
 \
 ({ \
@@ -133,20 +133,20 @@ struct reg_sequence {
  * @addr: Address to poll
  * @val: Unsigned integer variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @delay_us: Time to udelay between reads in us (0 tight-loops).
- *            Should be less than ~10us since udelay is used
- *            (see Documentation/timers/timers-howto.rst).
+ * @delay_us: Time to udelay between reads in us (0 tight-loops). Please
+ *            read udelay() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
- * error return value in case of a error read. In the two former cases,
- * the last read value at @addr is stored in @val.
- *
  * This is modelled after the readx_poll_timeout_atomic macros in linux/iopo=
ll.h.
  *
  * Note: In general regmap cannot be used in atomic context. If you want to =
use
  * this macro then first setup your regmap for atomic use (flat or no cache
  * and MMIO regmap).
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
+ * error return value in case of a error read. In the two former cases,
+ * the last read value at @addr is stored in @val.
  */
 #define regmap_read_poll_timeout_atomic(map, addr, val, cond, delay_us, time=
out_us) \
 ({ \
@@ -177,17 +177,17 @@ struct reg_sequence {
  * @field: Regmap field to read from
  * @val: Unsigned integer variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @sleep_us: Maximum time to sleep between reads in us (0
- *            tight-loops).  Should be less than ~20ms since usleep_range
- *            is used (see Documentation/timers/timers-howto.rst).
+ * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Ple=
ase
+ *            read usleep_range() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_field_re=
ad
+ * This is modelled after the readx_poll_timeout macros in linux/iopoll.h.
+ *
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout or the regmap_field_r=
ead
  * error return value in case of a error read. In the two former cases,
  * the last read value at @addr is stored in @val. Must not be called
  * from atomic context if sleep_us or timeout_us are used.
- *
- * This is modelled after the readx_poll_timeout macros in linux/iopoll.h.
  */
 #define regmap_field_read_poll_timeout(field, val, cond, sleep_us, timeout_u=
s) \
 ({ \
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index c8ed09ac29ac..d5d03d919df8 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -138,6 +138,7 @@ struct signal_struct {
 	/* POSIX.1b Interval Timers */
 	unsigned int		next_posix_timer_id;
 	struct hlist_head	posix_timers;
+	struct hlist_head	ignored_posix_timers;
=20
 	/* ITIMER_REAL timer for the process */
 	struct hrtimer real_timer;
@@ -338,9 +339,6 @@ extern void force_fatal_sig(int);
 extern void force_exit_sig(int);
 extern int send_sig(int, struct task_struct *, int);
 extern int zap_other_threads(struct task_struct *p);
-extern struct sigqueue *sigqueue_alloc(void);
-extern void sigqueue_free(struct sigqueue *);
-extern int send_sigqueue(struct sigqueue *, struct pid *, enum pid_type);
 extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
=20
 static inline void clear_notify_signal(void)
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 72744638c5b0..b0c74bfe0600 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -20,12 +20,10 @@ extern void __init tick_init(void);
 extern void tick_suspend_local(void);
 /* Should be core only, but XEN resume magic and ARM BL switcher require it =
*/
 extern void tick_resume_local(void);
-extern void tick_cleanup_dead_cpu(int cpu);
 #else /* CONFIG_GENERIC_CLOCKEVENTS */
 static inline void tick_init(void) { }
 static inline void tick_suspend_local(void) { }
 static inline void tick_resume_local(void) { }
-static inline void tick_cleanup_dead_cpu(int cpu) { }
 #endif /* !CONFIG_GENERIC_CLOCKEVENTS */
=20
 #if defined(CONFIG_GENERIC_CLOCKEVENTS) && defined(CONFIG_HOTPLUG_CPU)
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_i=
nternal.h
index 902c20ef495a..e39d4d563b19 100644
--- a/include/linux/timekeeper_internal.h
+++ b/include/linux/timekeeper_internal.h
@@ -26,7 +26,7 @@
  * occupies a single 64byte cache line.
  *
  * The struct is separate from struct timekeeper as it is also used
- * for a fast NMI safe accessors.
+ * for the fast NMI safe accessors.
  *
  * @base_real is for the fast NMI safe accessor to allow reading clock
  * realtime from any context.
@@ -44,33 +44,38 @@ struct tk_read_base {
=20
 /**
  * struct timekeeper - Structure holding internal timekeeping values.
- * @tkr_mono:		The readout base structure for CLOCK_MONOTONIC
- * @tkr_raw:		The readout base structure for CLOCK_MONOTONIC_RAW
- * @xtime_sec:		Current CLOCK_REALTIME time in seconds
- * @ktime_sec:		Current CLOCK_MONOTONIC time in seconds
- * @wall_to_monotonic:	CLOCK_REALTIME to CLOCK_MONOTONIC offset
- * @offs_real:		Offset clock monotonic -> clock realtime
- * @offs_boot:		Offset clock monotonic -> clock boottime
- * @offs_tai:		Offset clock monotonic -> clock tai
- * @tai_offset:		The current UTC to TAI offset in seconds
- * @clock_was_set_seq:	The sequence number of clock was set events
- * @cs_was_changed_seq:	The sequence number of clocksource change events
- * @next_leap_ktime:	CLOCK_MONOTONIC time value of a pending leap-second
- * @raw_sec:		CLOCK_MONOTONIC_RAW  time in seconds
- * @monotonic_to_boot:	CLOCK_MONOTONIC to CLOCK_BOOTTIME offset
- * @cycle_interval:	Number of clock cycles in one NTP interval
- * @xtime_interval:	Number of clock shifted nano seconds in one NTP
- *			interval.
- * @xtime_remainder:	Shifted nano seconds left over when rounding
- *			@cycle_interval
- * @raw_interval:	Shifted raw nano seconds accumulated per NTP interval.
- * @ntp_error:		Difference between accumulated time and NTP time in ntp
- *			shifted nano seconds.
- * @ntp_error_shift:	Shift conversion between clock shifted nano seconds and
- *			ntp shifted nano seconds.
- * @last_warning:	Warning ratelimiter (DEBUG_TIMEKEEPING)
- * @underflow_seen:	Underflow warning flag (DEBUG_TIMEKEEPING)
- * @overflow_seen:	Overflow warning flag (DEBUG_TIMEKEEPING)
+ * @tkr_mono:			The readout base structure for CLOCK_MONOTONIC
+ * @xtime_sec:			Current CLOCK_REALTIME time in seconds
+ * @ktime_sec:			Current CLOCK_MONOTONIC time in seconds
+ * @wall_to_monotonic:		CLOCK_REALTIME to CLOCK_MONOTONIC offset
+ * @offs_real:			Offset clock monotonic -> clock realtime
+ * @offs_boot:			Offset clock monotonic -> clock boottime
+ * @offs_tai:			Offset clock monotonic -> clock tai
+ * @tai_offset:			The current UTC to TAI offset in seconds
+ * @tkr_raw:			The readout base structure for CLOCK_MONOTONIC_RAW
+ * @raw_sec:			CLOCK_MONOTONIC_RAW  time in seconds
+ * @clock_was_set_seq:		The sequence number of clock was set events
+ * @cs_was_changed_seq:		The sequence number of clocksource change events
+ * @monotonic_to_boot:		CLOCK_MONOTONIC to CLOCK_BOOTTIME offset
+ * @cycle_interval:		Number of clock cycles in one NTP interval
+ * @xtime_interval:		Number of clock shifted nano seconds in one NTP
+ *				interval.
+ * @xtime_remainder:		Shifted nano seconds left over when rounding
+ *				@cycle_interval
+ * @raw_interval:		Shifted raw nano seconds accumulated per NTP interval.
+ * @next_leap_ktime:		CLOCK_MONOTONIC time value of a pending leap-second
+ * @ntp_tick:			The ntp_tick_length() value currently being
+ *				used. This cached copy ensures we consistently
+ *				apply the tick length for an entire tick, as
+ *				ntp_tick_length may change mid-tick, and we don't
+ *				want to apply that new value to the tick in
+ *				progress.
+ * @ntp_error:			Difference between accumulated time and NTP time in ntp
+ *				shifted nano seconds.
+ * @ntp_error_shift:		Shift conversion between clock shifted nano seconds and
+ *				ntp shifted nano seconds.
+ * @ntp_err_mult:		Multiplication factor for scaled math conversion
+ * @skip_second_overflow:	Flag used to avoid updating NTP twice with same se=
cond
  *
  * Note: For timespec(64) based interfaces wall_to_monotonic is what
  * we need to add to xtime (or xtime corrected for sub jiffy times)
@@ -88,10 +93,28 @@ struct tk_read_base {
  *
  * @monotonic_to_boottime is a timespec64 representation of @offs_boot to
  * accelerate the VDSO update for CLOCK_BOOTTIME.
+ *
+ * The cacheline ordering of the structure is optimized for in kernel usage =
of
+ * the ktime_get() and ktime_get_ts64() family of time accessors. Struct
+ * timekeeper is prepended in the core timekeeping code with a sequence coun=
t,
+ * which results in the following cacheline layout:
+ *
+ * 0:	seqcount, tkr_mono
+ * 1:	xtime_sec ... tai_offset
+ * 2:	tkr_raw, raw_sec
+ * 3,4: Internal variables
+ *
+ * Cacheline 0,1 contain the data which is used for accessing
+ * CLOCK_MONOTONIC/REALTIME/BOOTTIME/TAI, while cacheline 2 contains the
+ * data for accessing CLOCK_MONOTONIC_RAW.  Cacheline 3,4 are internal
+ * variables which are only accessed during timekeeper updates once per
+ * tick.
  */
 struct timekeeper {
+	/* Cacheline 0 (together with prepended seqcount of timekeeper core): */
 	struct tk_read_base	tkr_mono;
-	struct tk_read_base	tkr_raw;
+
+	/* Cacheline 1: */
 	u64			xtime_sec;
 	unsigned long		ktime_sec;
 	struct timespec64	wall_to_monotonic;
@@ -99,43 +122,28 @@ struct timekeeper {
 	ktime_t			offs_boot;
 	ktime_t			offs_tai;
 	s32			tai_offset;
+
+	/* Cacheline 2: */
+	struct tk_read_base	tkr_raw;
+	u64			raw_sec;
+
+	/* Cachline 3 and 4 (timekeeping internal variables): */
 	unsigned int		clock_was_set_seq;
 	u8			cs_was_changed_seq;
-	ktime_t			next_leap_ktime;
-	u64			raw_sec;
+
 	struct timespec64	monotonic_to_boot;
=20
-	/* The following members are for timekeeping internal use */
 	u64			cycle_interval;
 	u64			xtime_interval;
 	s64			xtime_remainder;
 	u64			raw_interval;
-	/* The ntp_tick_length() value currently being used.
-	 * This cached copy ensures we consistently apply the tick
-	 * length for an entire tick, as ntp_tick_length may change
-	 * mid-tick, and we don't want to apply that new value to
-	 * the tick in progress.
-	 */
+
+	ktime_t			next_leap_ktime;
 	u64			ntp_tick;
-	/* Difference between accumulated time and NTP time in ntp
-	 * shifted nano seconds. */
 	s64			ntp_error;
 	u32			ntp_error_shift;
 	u32			ntp_err_mult;
-	/* Flag used to avoid updating NTP twice with same second */
 	u32			skip_second_overflow;
-#ifdef CONFIG_DEBUG_TIMEKEEPING
-	long			last_warning;
-	/*
-	 * These simple flag variables are managed
-	 * without locks, which is racy, but they are
-	 * ok since we don't really care about being
-	 * super precise about how many events were
-	 * seen, just that a problem was observed.
-	 */
-	int			underflow_seen;
-	int			overflow_seen;
-#endif
 };
=20
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index fc12a9ba2c88..0e035f675efe 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -45,6 +45,11 @@ extern void ktime_get_real_ts64(struct timespec64 *tv);
 extern void ktime_get_coarse_ts64(struct timespec64 *ts);
 extern void ktime_get_coarse_real_ts64(struct timespec64 *ts);
=20
+/* Multigrain timestamp interfaces */
+extern void ktime_get_coarse_real_ts64_mg(struct timespec64 *ts);
+extern void ktime_get_real_ts64_mg(struct timespec64 *ts);
+extern unsigned long timekeeping_get_mg_floor_swaps(void);
+
 void getboottime64(struct timespec64 *ts);
=20
 /*
@@ -275,6 +280,7 @@ struct ktime_timestamps {
  *				 counter value
  * @cycles:	Clocksource counter value to produce the system times
  * @real:	Realtime system time
+ * @boot:	Boot time
  * @raw:	Monotonic raw system time
  * @cs_id:	Clocksource ID
  * @clock_was_set_seq:	The sequence number of clock-was-set events
@@ -283,6 +289,7 @@ struct ktime_timestamps {
 struct system_time_snapshot {
 	u64			cycles;
 	ktime_t			real;
+	ktime_t			boot;
 	ktime_t			raw;
 	enum clocksource_ids	cs_id;
 	unsigned int		clock_was_set_seq;
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 3871b06bd302..4ee32eff3f22 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -139,14 +139,6 @@ unsigned long random_get_entropy_fallback(void);
 #define MAXSEC 2048		/* max interval between updates (s) */
 #define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dis=
persion */
=20
-/*
- * kernel variables
- * Note: maximum error =3D NTP sync distance =3D dispersion + delay / 2;
- * estimated error =3D NTP dispersion.
- */
-extern unsigned long tick_usec;		/* USER_HZ period (usec) */
-extern unsigned long tick_nsec;		/* SHIFTED_HZ period (nsec) */
-
 /* Required to safely shift negative values */
 #define shift_right(x, s) ({	\
 	__typeof__(x) __x =3D (x);	\
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 8aa3372f21a0..643b7c7bf376 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -541,8 +541,8 @@ do {										\
 	int __ret =3D 0;								\
 	struct hrtimer_sleeper __t;						\
 										\
-	hrtimer_init_sleeper_on_stack(&__t, CLOCK_MONOTONIC,			\
-				      HRTIMER_MODE_REL);			\
+	hrtimer_setup_sleeper_on_stack(&__t, CLOCK_MONOTONIC,			\
+				       HRTIMER_MODE_REL);			\
 	if ((timeout) !=3D KTIME_MAX) {						\
 		hrtimer_set_expires_range_ns(&__t.timer, timeout,		\
 					current->timer_slack_ns);		\
diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/si=
ginfo.h
index b7bc545ec3b2..5a1ca43b5fc6 100644
--- a/include/uapi/asm-generic/siginfo.h
+++ b/include/uapi/asm-generic/siginfo.h
@@ -46,7 +46,7 @@ union __sifields {
 		__kernel_timer_t _tid;	/* timer id */
 		int _overrun;		/* overrun count */
 		sigval_t _sigval;	/* same as below */
-		int _sys_private;       /* not to be passed to user */
+		int _sys_private;       /* Not used by the kernel. Historic leftover. Alwa=
ys 0. */
 	} _timer;
=20
 	/* POSIX.1b signals */
diff --git a/init/init_task.c b/init/init_task.c
index 136a8231355a..e557f622bd90 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -30,8 +30,9 @@ static struct signal_struct init_signals =3D {
 	.cred_guard_mutex =3D __MUTEX_INITIALIZER(init_signals.cred_guard_mutex),
 	.exec_update_lock =3D __RWSEM_INITIALIZER(init_signals.exec_update_lock),
 #ifdef CONFIG_POSIX_TIMERS
-	.posix_timers	=3D HLIST_HEAD_INIT,
-	.cputimer	=3D {
+	.posix_timers		=3D HLIST_HEAD_INIT,
+	.ignored_posix_timers	=3D HLIST_HEAD_INIT,
+	.cputimer		=3D {
 		.cputime_atomic	=3D INIT_CPUTIME_ATOMIC,
 	},
 #endif
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index feb61d68dca6..0842aa3f60e7 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2435,13 +2435,14 @@ static int io_cqring_schedule_timeout(struct io_wait_=
queue *iowq,
 {
 	ktime_t timeout;
=20
-	hrtimer_init_on_stack(&iowq->t, clock_id, HRTIMER_MODE_ABS);
 	if (iowq->min_timeout) {
 		timeout =3D ktime_add_ns(iowq->min_timeout, start_time);
-		iowq->t.function =3D io_cqring_min_timer_wakeup;
+		hrtimer_setup_on_stack(&iowq->t, io_cqring_min_timer_wakeup, clock_id,
+				       HRTIMER_MODE_ABS);
 	} else {
 		timeout =3D iowq->timeout;
-		iowq->t.function =3D io_cqring_timer_wakeup;
+		hrtimer_setup_on_stack(&iowq->t, io_cqring_timer_wakeup, clock_id,
+				       HRTIMER_MODE_ABS);
 	}
=20
 	hrtimer_set_expires_range_ns(&iowq->t, timeout, 0);
diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index 9973876d91b0..2ffe5e1dc68a 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -76,7 +76,6 @@ static void io_timeout_complete(struct io_kiocb *req, struc=
t io_tw_state *ts)
 			/* re-arm timer */
 			spin_lock_irq(&ctx->timeout_lock);
 			list_add(&timeout->list, ctx->timeout_list.prev);
-			data->timer.function =3D io_timeout_fn;
 			hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), data->mode);
 			spin_unlock_irq(&ctx->timeout_lock);
 			return;
diff --git a/kernel/cpu.c b/kernel/cpu.c
index d293d52a3e00..895f3287e3f3 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1338,8 +1338,6 @@ static int takedown_cpu(unsigned int cpu)
=20
 	cpuhp_bp_sync_dead(cpu);
=20
-	tick_cleanup_dead_cpu(cpu);
-
 	/*
 	 * Callbacks must be re-integrated right away to the RCU state machine.
 	 * Otherwise an RCU callback could block a further teardown function
diff --git a/kernel/fork.c b/kernel/fork.c
index 60c0b4868fd4..c2bd8367a850 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1864,6 +1864,7 @@ static int copy_signal(unsigned long clone_flags, struc=
t task_struct *tsk)
=20
 #ifdef CONFIG_POSIX_TIMERS
 	INIT_HLIST_HEAD(&sig->posix_timers);
+	INIT_HLIST_HEAD(&sig->ignored_posix_timers);
 	hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	sig->real_timer.function =3D it_real_fn;
 #endif
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 136768ae2637..fb7214c7a36f 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -140,9 +140,9 @@ futex_setup_timer(ktime_t *time, struct hrtimer_sleeper *=
timeout,
 	if (!time)
 		return NULL;
=20
-	hrtimer_init_sleeper_on_stack(timeout, (flags & FLAGS_CLOCKRT) ?
-				      CLOCK_REALTIME : CLOCK_MONOTONIC,
-				      HRTIMER_MODE_ABS);
+	hrtimer_setup_sleeper_on_stack(timeout,
+				       (flags & FLAGS_CLOCKRT) ? CLOCK_REALTIME : CLOCK_MONOTONIC,
+				       HRTIMER_MODE_ABS);
 	/*
 	 * If range_ns is 0, calling hrtimer_set_expires_range_ns() is
 	 * effectively the same as calling hrtimer_set_expires().
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index d2f096bb274c..631e42802925 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -399,8 +399,8 @@ void play_idle_precise(u64 duration_ns, u64 latency_ns)
 	cpuidle_use_deepest_state(latency_ns);
=20
 	it.done =3D 0;
-	hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
-	it.timer.function =3D idle_inject_timer_fn;
+	hrtimer_setup_on_stack(&it.timer, idle_inject_timer_fn, CLOCK_MONOTONIC,
+			       HRTIMER_MODE_REL_HARD);
 	hrtimer_start(&it.timer, ns_to_ktime(duration_ns),
 		      HRTIMER_MODE_REL_PINNED_HARD);
=20
diff --git a/kernel/signal.c b/kernel/signal.c
index 4344860ffcac..10b464b9d91f 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -59,6 +59,8 @@
 #include <asm/cacheflush.h>
 #include <asm/syscall.h>	/* for syscall_get_* */
=20
+#include "time/posix-timers.h"
+
 /*
  * SLAB caches for signal bits.
  */
@@ -396,16 +398,9 @@ void task_join_group_stop(struct task_struct *task)
 	task_set_jobctl_pending(task, mask | JOBCTL_STOP_PENDING);
 }
=20
-/*
- * allocate a new signal queue record
- * - this may be called without locks if and only if t =3D=3D current, other=
wise an
- *   appropriate lock must be held to stop the target task from exiting
- */
-static struct sigqueue *
-__sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags,
-		 int override_rlimit, const unsigned int sigqueue_flags)
+static struct ucounts *sig_get_ucounts(struct task_struct *t, int sig,
+				       int override_rlimit)
 {
-	struct sigqueue *q =3D NULL;
 	struct ucounts *ucounts;
 	long sigpending;
=20
@@ -424,26 +419,53 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t =
gfp_flags,
 	if (!sigpending)
 		return NULL;
=20
-	if (override_rlimit || likely(sigpending <=3D task_rlimit(t, RLIMIT_SIGPEND=
ING))) {
-		q =3D kmem_cache_alloc(sigqueue_cachep, gfp_flags);
-	} else {
+	if (unlikely(!override_rlimit && sigpending > task_rlimit(t, RLIMIT_SIGPEND=
ING))) {
+		dec_rlimit_put_ucounts(ucounts, UCOUNT_RLIMIT_SIGPENDING);
 		print_dropped_signal(sig);
+		return NULL;
 	}
=20
-	if (unlikely(q =3D=3D NULL)) {
+	return ucounts;
+}
+
+static void __sigqueue_init(struct sigqueue *q, struct ucounts *ucounts,
+			    const unsigned int sigqueue_flags)
+{
+	INIT_LIST_HEAD(&q->list);
+	q->flags =3D sigqueue_flags;
+	q->ucounts =3D ucounts;
+}
+
+/*
+ * allocate a new signal queue record
+ * - this may be called without locks if and only if t =3D=3D current, other=
wise an
+ *   appropriate lock must be held to stop the target task from exiting
+ */
+static struct sigqueue *sigqueue_alloc(int sig, struct task_struct *t, gfp_t=
 gfp_flags,
+				       int override_rlimit)
+{
+	struct ucounts *ucounts =3D sig_get_ucounts(t, sig, override_rlimit);
+	struct sigqueue *q;
+
+	if (!ucounts)
+		return NULL;
+
+	q =3D kmem_cache_alloc(sigqueue_cachep, gfp_flags);
+	if (!q) {
 		dec_rlimit_put_ucounts(ucounts, UCOUNT_RLIMIT_SIGPENDING);
-	} else {
-		INIT_LIST_HEAD(&q->list);
-		q->flags =3D sigqueue_flags;
-		q->ucounts =3D ucounts;
+		return NULL;
 	}
+
+	__sigqueue_init(q, ucounts, 0);
 	return q;
 }
=20
 static void __sigqueue_free(struct sigqueue *q)
 {
-	if (q->flags & SIGQUEUE_PREALLOC)
+	if (q->flags & SIGQUEUE_PREALLOC) {
+		posixtimer_sigqueue_putref(q);
 		return;
+	}
 	if (q->ucounts) {
 		dec_rlimit_put_ucounts(q->ucounts, UCOUNT_RLIMIT_SIGPENDING);
 		q->ucounts =3D NULL;
@@ -478,42 +500,6 @@ void flush_signals(struct task_struct *t)
 }
 EXPORT_SYMBOL(flush_signals);
=20
-#ifdef CONFIG_POSIX_TIMERS
-static void __flush_itimer_signals(struct sigpending *pending)
-{
-	sigset_t signal, retain;
-	struct sigqueue *q, *n;
-
-	signal =3D pending->signal;
-	sigemptyset(&retain);
-
-	list_for_each_entry_safe(q, n, &pending->list, list) {
-		int sig =3D q->info.si_signo;
-
-		if (likely(q->info.si_code !=3D SI_TIMER)) {
-			sigaddset(&retain, sig);
-		} else {
-			sigdelset(&signal, sig);
-			list_del_init(&q->list);
-			__sigqueue_free(q);
-		}
-	}
-
-	sigorsets(&pending->signal, &signal, &retain);
-}
-
-void flush_itimer_signals(void)
-{
-	struct task_struct *tsk =3D current;
-	unsigned long flags;
-
-	spin_lock_irqsave(&tsk->sighand->siglock, flags);
-	__flush_itimer_signals(&tsk->pending);
-	__flush_itimer_signals(&tsk->signal->shared_pending);
-	spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
-}
-#endif
-
 void ignore_signals(struct task_struct *t)
 {
 	int i;
@@ -563,7 +549,7 @@ bool unhandled_signal(struct task_struct *tsk, int sig)
 }
=20
 static void collect_signal(int sig, struct sigpending *list, kernel_siginfo_=
t *info,
-			   bool *resched_timer)
+			   struct sigqueue **timer_sigq)
 {
 	struct sigqueue *q, *first =3D NULL;
=20
@@ -586,12 +572,17 @@ static void collect_signal(int sig, struct sigpending *=
list, kernel_siginfo_t *i
 		list_del_init(&first->list);
 		copy_siginfo(info, &first->info);
=20
-		*resched_timer =3D
-			(first->flags & SIGQUEUE_PREALLOC) &&
-			(info->si_code =3D=3D SI_TIMER) &&
-			(info->si_sys_private);
-
-		__sigqueue_free(first);
+		/*
+		 * posix-timer signals are preallocated and freed when the last
+		 * reference count is dropped in posixtimer_deliver_signal() or
+		 * immediately on timer deletion when the signal is not pending.
+		 * Spare the extra round through __sigqueue_free() which is
+		 * ignoring preallocated signals.
+		 */
+		if (unlikely((first->flags & SIGQUEUE_PREALLOC) && (info->si_code =3D=3D S=
I_TIMER)))
+			*timer_sigq =3D first;
+		else
+			__sigqueue_free(first);
 	} else {
 		/*
 		 * Ok, it wasn't in the queue.  This must be
@@ -608,12 +599,12 @@ static void collect_signal(int sig, struct sigpending *=
list, kernel_siginfo_t *i
 }
=20
 static int __dequeue_signal(struct sigpending *pending, sigset_t *mask,
-			kernel_siginfo_t *info, bool *resched_timer)
+			    kernel_siginfo_t *info, struct sigqueue **timer_sigq)
 {
 	int sig =3D next_signal(pending, mask);
=20
 	if (sig)
-		collect_signal(sig, pending, info, resched_timer);
+		collect_signal(sig, pending, info, timer_sigq);
 	return sig;
 }
=20
@@ -625,42 +616,22 @@ static int __dequeue_signal(struct sigpending *pending,=
 sigset_t *mask,
 int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info, enum pid_type *ty=
pe)
 {
 	struct task_struct *tsk =3D current;
-	bool resched_timer =3D false;
+	struct sigqueue *timer_sigq;
 	int signr;
=20
 	lockdep_assert_held(&tsk->sighand->siglock);
=20
+again:
 	*type =3D PIDTYPE_PID;
-	signr =3D __dequeue_signal(&tsk->pending, mask, info, &resched_timer);
+	timer_sigq =3D NULL;
+	signr =3D __dequeue_signal(&tsk->pending, mask, info, &timer_sigq);
 	if (!signr) {
 		*type =3D PIDTYPE_TGID;
 		signr =3D __dequeue_signal(&tsk->signal->shared_pending,
-					 mask, info, &resched_timer);
-#ifdef CONFIG_POSIX_TIMERS
-		/*
-		 * itimer signal ?
-		 *
-		 * itimers are process shared and we restart periodic
-		 * itimers in the signal delivery path to prevent DoS
-		 * attacks in the high resolution timer case. This is
-		 * compliant with the old way of self-restarting
-		 * itimers, as the SIGALRM is a legacy signal and only
-		 * queued once. Changing the restart behaviour to
-		 * restart the timer in the signal dequeue path is
-		 * reducing the timer noise on heavy loaded !highres
-		 * systems too.
-		 */
-		if (unlikely(signr =3D=3D SIGALRM)) {
-			struct hrtimer *tmr =3D &tsk->signal->real_timer;
-
-			if (!hrtimer_is_queued(tmr) &&
-			    tsk->signal->it_real_incr !=3D 0) {
-				hrtimer_forward(tmr, tmr->base->get_time(),
-						tsk->signal->it_real_incr);
-				hrtimer_restart(tmr);
-			}
-		}
-#endif
+					 mask, info, &timer_sigq);
+
+		if (unlikely(signr =3D=3D SIGALRM))
+			posixtimer_rearm_itimer(tsk);
 	}
=20
 	recalc_sigpending();
@@ -682,22 +653,12 @@ int dequeue_signal(sigset_t *mask, kernel_siginfo_t *in=
fo, enum pid_type *type)
 		 */
 		current->jobctl |=3D JOBCTL_STOP_DEQUEUED;
 	}
-#ifdef CONFIG_POSIX_TIMERS
-	if (resched_timer) {
-		/*
-		 * Release the siglock to ensure proper locking order
-		 * of timer locks outside of siglocks.  Note, we leave
-		 * irqs disabled here, since the posix-timers code is
-		 * about to disable them again anyway.
-		 */
-		spin_unlock(&tsk->sighand->siglock);
-		posixtimer_rearm(info);
-		spin_lock(&tsk->sighand->siglock);
=20
-		/* Don't expose the si_sys_private value to userspace */
-		info->si_sys_private =3D 0;
+	if (IS_ENABLED(CONFIG_POSIX_TIMERS) && unlikely(timer_sigq)) {
+		if (!posixtimer_deliver_signal(info, timer_sigq))
+			goto again;
 	}
-#endif
+
 	return signr;
 }
 EXPORT_SYMBOL_GPL(dequeue_signal);
@@ -772,17 +733,24 @@ void signal_wake_up_state(struct task_struct *t, unsign=
ed int state)
 		kick_process(t);
 }
=20
-/*
- * Remove signals in mask from the pending set and queue.
- * Returns 1 if any signals were found.
- *
- * All callers must be holding the siglock.
- */
-static void flush_sigqueue_mask(sigset_t *mask, struct sigpending *s)
+static inline void posixtimer_sig_ignore(struct task_struct *tsk, struct sig=
queue *q);
+
+static void sigqueue_free_ignored(struct task_struct *tsk, struct sigqueue *=
q)
+{
+	if (likely(!(q->flags & SIGQUEUE_PREALLOC) || q->info.si_code !=3D SI_TIMER=
))
+		__sigqueue_free(q);
+	else
+		posixtimer_sig_ignore(tsk, q);
+}
+
+/* Remove signals in mask from the pending set and queue. */
+static void flush_sigqueue_mask(struct task_struct *p, sigset_t *mask, struc=
t sigpending *s)
 {
 	struct sigqueue *q, *n;
 	sigset_t m;
=20
+	lockdep_assert_held(&p->sighand->siglock);
+
 	sigandsets(&m, mask, &s->signal);
 	if (sigisemptyset(&m))
 		return;
@@ -791,7 +759,7 @@ static void flush_sigqueue_mask(sigset_t *mask, struct si=
gpending *s)
 	list_for_each_entry_safe(q, n, &s->list, list) {
 		if (sigismember(mask, q->info.si_signo)) {
 			list_del_init(&q->list);
-			__sigqueue_free(q);
+			sigqueue_free_ignored(p, q);
 		}
 	}
 }
@@ -916,18 +884,18 @@ static bool prepare_signal(int sig, struct task_struct =
*p, bool force)
 		 * This is a stop signal.  Remove SIGCONT from all queues.
 		 */
 		siginitset(&flush, sigmask(SIGCONT));
-		flush_sigqueue_mask(&flush, &signal->shared_pending);
+		flush_sigqueue_mask(p, &flush, &signal->shared_pending);
 		for_each_thread(p, t)
-			flush_sigqueue_mask(&flush, &t->pending);
+			flush_sigqueue_mask(p, &flush, &t->pending);
 	} else if (sig =3D=3D SIGCONT) {
 		unsigned int why;
 		/*
 		 * Remove all stop signals from all queues, wake all threads.
 		 */
 		siginitset(&flush, SIG_KERNEL_STOP_MASK);
-		flush_sigqueue_mask(&flush, &signal->shared_pending);
+		flush_sigqueue_mask(p, &flush, &signal->shared_pending);
 		for_each_thread(p, t) {
-			flush_sigqueue_mask(&flush, &t->pending);
+			flush_sigqueue_mask(p, &flush, &t->pending);
 			task_clear_jobctl_pending(t, JOBCTL_STOP_PENDING);
 			if (likely(!(t->ptrace & PT_SEIZED))) {
 				t->jobctl &=3D ~JOBCTL_STOPPED;
@@ -1114,7 +1082,7 @@ static int __send_signal_locked(int sig, struct kernel_=
siginfo *info,
 	else
 		override_rlimit =3D 0;
=20
-	q =3D __sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit, 0);
+	q =3D sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit);
=20
 	if (q) {
 		list_add_tail(&q->list, &pending->list);
@@ -1922,112 +1890,242 @@ int kill_pid(struct pid *pid, int sig, int priv)
 }
 EXPORT_SYMBOL(kill_pid);
=20
+#ifdef CONFIG_POSIX_TIMERS
 /*
- * These functions support sending signals using preallocated sigqueue
- * structures.  This is needed "because realtime applications cannot
- * afford to lose notifications of asynchronous events, like timer
- * expirations or I/O completions".  In the case of POSIX Timers
- * we allocate the sigqueue structure from the timer_create.  If this
- * allocation fails we are able to report the failure to the application
- * with an EAGAIN error.
+ * These functions handle POSIX timer signals. POSIX timers use
+ * preallocated sigqueue structs for sending signals.
  */
-struct sigqueue *sigqueue_alloc(void)
+static void __flush_itimer_signals(struct sigpending *pending)
 {
-	return __sigqueue_alloc(-1, current, GFP_KERNEL, 0, SIGQUEUE_PREALLOC);
+	sigset_t signal, retain;
+	struct sigqueue *q, *n;
+
+	signal =3D pending->signal;
+	sigemptyset(&retain);
+
+	list_for_each_entry_safe(q, n, &pending->list, list) {
+		int sig =3D q->info.si_signo;
+
+		if (likely(q->info.si_code !=3D SI_TIMER)) {
+			sigaddset(&retain, sig);
+		} else {
+			sigdelset(&signal, sig);
+			list_del_init(&q->list);
+			__sigqueue_free(q);
+		}
+	}
+
+	sigorsets(&pending->signal, &signal, &retain);
 }
=20
-void sigqueue_free(struct sigqueue *q)
+void flush_itimer_signals(void)
 {
-	spinlock_t *lock =3D &current->sighand->siglock;
-	unsigned long flags;
+	struct task_struct *tsk =3D current;
=20
-	if (WARN_ON_ONCE(!(q->flags & SIGQUEUE_PREALLOC)))
-		return;
-	/*
-	 * We must hold ->siglock while testing q->list
-	 * to serialize with collect_signal() or with
-	 * __exit_signal()->flush_sigqueue().
-	 */
-	spin_lock_irqsave(lock, flags);
-	q->flags &=3D ~SIGQUEUE_PREALLOC;
-	/*
-	 * If it is queued it will be freed when dequeued,
-	 * like the "regular" sigqueue.
-	 */
-	if (!list_empty(&q->list))
-		q =3D NULL;
-	spin_unlock_irqrestore(lock, flags);
+	guard(spinlock_irqsave)(&tsk->sighand->siglock);
+	__flush_itimer_signals(&tsk->pending);
+	__flush_itimer_signals(&tsk->signal->shared_pending);
+}
=20
-	if (q)
-		__sigqueue_free(q);
+bool posixtimer_init_sigqueue(struct sigqueue *q)
+{
+	struct ucounts *ucounts =3D sig_get_ucounts(current, -1, 0);
+
+	if (!ucounts)
+		return false;
+	clear_siginfo(&q->info);
+	__sigqueue_init(q, ucounts, SIGQUEUE_PREALLOC);
+	return true;
 }
=20
-int send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type)
+static void posixtimer_queue_sigqueue(struct sigqueue *q, struct task_struct=
 *t, enum pid_type type)
 {
-	int sig =3D q->info.si_signo;
 	struct sigpending *pending;
+	int sig =3D q->info.si_signo;
+
+	signalfd_notify(t, sig);
+	pending =3D (type !=3D PIDTYPE_PID) ? &t->signal->shared_pending : &t->pend=
ing;
+	list_add_tail(&q->list, &pending->list);
+	sigaddset(&pending->signal, sig);
+	complete_signal(sig, t, type);
+}
+
+/*
+ * This function is used by POSIX timers to deliver a timer signal.
+ * Where type is PIDTYPE_PID (such as for timers with SIGEV_THREAD_ID
+ * set), the signal must be delivered to the specific thread (queues
+ * into t->pending).
+ *
+ * Where type is not PIDTYPE_PID, signals must be delivered to the
+ * process. In this case, prefer to deliver to current if it is in
+ * the same thread group as the target process, which avoids
+ * unnecessarily waking up a potentially idle task.
+ */
+static inline struct task_struct *posixtimer_get_target(struct k_itimer *tmr)
+{
+	struct task_struct *t =3D pid_task(tmr->it_pid, tmr->it_pid_type);
+
+	if (t && tmr->it_pid_type !=3D PIDTYPE_PID && same_thread_group(t, current))
+		t =3D current;
+	return t;
+}
+
+void posixtimer_send_sigqueue(struct k_itimer *tmr)
+{
+	struct sigqueue *q =3D &tmr->sigq;
+	int sig =3D q->info.si_signo;
 	struct task_struct *t;
 	unsigned long flags;
-	int ret, result;
+	int result;
=20
-	if (WARN_ON_ONCE(!(q->flags & SIGQUEUE_PREALLOC)))
-		return 0;
-	if (WARN_ON_ONCE(q->info.si_code !=3D SI_TIMER))
-		return 0;
+	guard(rcu)();
=20
-	ret =3D -1;
-	rcu_read_lock();
+	t =3D posixtimer_get_target(tmr);
+	if (!t)
+		return;
+
+	if (!likely(lock_task_sighand(t, &flags)))
+		return;
=20
 	/*
-	 * This function is used by POSIX timers to deliver a timer signal.
-	 * Where type is PIDTYPE_PID (such as for timers with SIGEV_THREAD_ID
-	 * set), the signal must be delivered to the specific thread (queues
-	 * into t->pending).
-	 *
-	 * Where type is not PIDTYPE_PID, signals must be delivered to the
-	 * process. In this case, prefer to deliver to current if it is in
-	 * the same thread group as the target process, which avoids
-	 * unnecessarily waking up a potentially idle task.
+	 * Update @tmr::sigqueue_seq for posix timer signals with sighand
+	 * locked to prevent a race against dequeue_signal().
 	 */
-	t =3D pid_task(pid, type);
-	if (!t)
-		goto ret;
-	if (type !=3D PIDTYPE_PID && same_thread_group(t, current))
-		t =3D current;
-	if (!likely(lock_task_sighand(t, &flags)))
-		goto ret;
+	tmr->it_sigqueue_seq =3D tmr->it_signal_seq;
=20
-	ret =3D 1; /* the signal is ignored */
-	result =3D TRACE_SIGNAL_IGNORED;
-	if (!prepare_signal(sig, t, false))
+	/*
+	 * Set the signal delivery status under sighand lock, so that the
+	 * ignored signal handling can distinguish between a periodic and a
+	 * non-periodic timer.
+	 */
+	tmr->it_sig_periodic =3D tmr->it_status =3D=3D POSIX_TIMER_REQUEUE_PENDING;
+
+	if (!prepare_signal(sig, t, false)) {
+		result =3D TRACE_SIGNAL_IGNORED;
+
+		if (!list_empty(&q->list)) {
+			/*
+			 * If task group is exiting with the signal already pending,
+			 * wait for __exit_signal() to do its job. Otherwise if
+			 * ignored, it's not supposed to be queued. Try to survive.
+			 */
+			WARN_ON_ONCE(!(t->signal->flags & SIGNAL_GROUP_EXIT));
+			goto out;
+		}
+
+		/* Periodic timers with SIG_IGN are queued on the ignored list */
+		if (tmr->it_sig_periodic) {
+			/*
+			 * Already queued means the timer was rearmed after
+			 * the previous expiry got it on the ignore list.
+			 * Nothing to do for that case.
+			 */
+			if (hlist_unhashed(&tmr->ignored_list)) {
+				/*
+				 * Take a signal reference and queue it on
+				 * the ignored list.
+				 */
+				posixtimer_sigqueue_getref(q);
+				posixtimer_sig_ignore(t, q);
+			}
+		} else if (!hlist_unhashed(&tmr->ignored_list)) {
+			/*
+			 * Covers the case where a timer was periodic and
+			 * then the signal was ignored. Later it was rearmed
+			 * as oneshot timer. The previous signal is invalid
+			 * now, and this oneshot signal has to be dropped.
+			 * Remove it from the ignored list and drop the
+			 * reference count as the signal is not longer
+			 * queued.
+			 */
+			hlist_del_init(&tmr->ignored_list);
+			posixtimer_putref(tmr);
+		}
 		goto out;
+	}
+
+	/* This should never happen and leaks a reference count */
+	if (WARN_ON_ONCE(!hlist_unhashed(&tmr->ignored_list)))
+		hlist_del_init(&tmr->ignored_list);
=20
-	ret =3D 0;
 	if (unlikely(!list_empty(&q->list))) {
-		/*
-		 * If an SI_TIMER entry is already queue just increment
-		 * the overrun count.
-		 */
-		q->info.si_overrun++;
+		/* This holds a reference count already */
 		result =3D TRACE_SIGNAL_ALREADY_PENDING;
 		goto out;
 	}
-	q->info.si_overrun =3D 0;
=20
-	signalfd_notify(t, sig);
-	pending =3D (type !=3D PIDTYPE_PID) ? &t->signal->shared_pending : &t->pend=
ing;
-	list_add_tail(&q->list, &pending->list);
-	sigaddset(&pending->signal, sig);
-	complete_signal(sig, t, type);
+	posixtimer_sigqueue_getref(q);
+	posixtimer_queue_sigqueue(q, t, tmr->it_pid_type);
 	result =3D TRACE_SIGNAL_DELIVERED;
 out:
-	trace_signal_generate(sig, &q->info, t, type !=3D PIDTYPE_PID, result);
+	trace_signal_generate(sig, &q->info, t, tmr->it_pid_type !=3D PIDTYPE_PID, =
result);
 	unlock_task_sighand(t, &flags);
-ret:
-	rcu_read_unlock();
-	return ret;
 }
=20
+static inline void posixtimer_sig_ignore(struct task_struct *tsk, struct sig=
queue *q)
+{
+	struct k_itimer *tmr =3D container_of(q, struct k_itimer, sigq);
+
+	/*
+	 * If the timer is marked deleted already or the signal originates
+	 * from a non-periodic timer, then just drop the reference
+	 * count. Otherwise queue it on the ignored list.
+	 */
+	if (tmr->it_signal && tmr->it_sig_periodic)
+		hlist_add_head(&tmr->ignored_list, &tsk->signal->ignored_posix_timers);
+	else
+		posixtimer_putref(tmr);
+}
+
+static void posixtimer_sig_unignore(struct task_struct *tsk, int sig)
+{
+	struct hlist_head *head =3D &tsk->signal->ignored_posix_timers;
+	struct hlist_node *tmp;
+	struct k_itimer *tmr;
+
+	if (likely(hlist_empty(head)))
+		return;
+
+	/*
+	 * Rearming a timer with sighand lock held is not possible due to
+	 * lock ordering vs. tmr::it_lock. Just stick the sigqueue back and
+	 * let the signal delivery path deal with it whether it needs to be
+	 * rearmed or not. This cannot be decided here w/o dropping sighand
+	 * lock and creating a loop retry horror show.
+	 */
+	hlist_for_each_entry_safe(tmr, tmp , head, ignored_list) {
+		struct task_struct *target;
+
+		/*
+		 * tmr::sigq.info.si_signo is immutable, so accessing it
+		 * without holding tmr::it_lock is safe.
+		 */
+		if (tmr->sigq.info.si_signo !=3D sig)
+			continue;
+
+		hlist_del_init(&tmr->ignored_list);
+
+		/* This should never happen and leaks a reference count */
+		if (WARN_ON_ONCE(!list_empty(&tmr->sigq.list)))
+			continue;
+
+		/*
+		 * Get the target for the signal. If target is a thread and
+		 * has exited by now, drop the reference count.
+		 */
+		guard(rcu)();
+		target =3D posixtimer_get_target(tmr);
+		if (target)
+			posixtimer_queue_sigqueue(&tmr->sigq, target, tmr->it_pid_type);
+		else
+			posixtimer_putref(tmr);
+	}
+}
+#else /* CONFIG_POSIX_TIMERS */
+static inline void posixtimer_sig_ignore(struct task_struct *tsk, struct sig=
queue *q) { }
+static inline void posixtimer_sig_unignore(struct task_struct *tsk, int sig)=
 { }
+#endif /* !CONFIG_POSIX_TIMERS */
+
 void do_notify_pidfd(struct task_struct *task)
 {
 	struct pid *pid =3D task_pid(task);
@@ -4153,8 +4251,8 @@ void kernel_sigaction(int sig, __sighandler_t action)
 		sigemptyset(&mask);
 		sigaddset(&mask, sig);
=20
-		flush_sigqueue_mask(&mask, &current->signal->shared_pending);
-		flush_sigqueue_mask(&mask, &current->pending);
+		flush_sigqueue_mask(current, &mask, &current->signal->shared_pending);
+		flush_sigqueue_mask(current, &mask, &current->pending);
 		recalc_sigpending();
 	}
 	spin_unlock_irq(&current->sighand->siglock);
@@ -4204,6 +4302,8 @@ int do_sigaction(int sig, struct k_sigaction *act, stru=
ct k_sigaction *oact)
 	sigaction_compat_abi(act, oact);
=20
 	if (act) {
+		bool was_ignored =3D k->sa.sa_handler =3D=3D SIG_IGN;
+
 		sigdelsetmask(&act->sa.sa_mask,
 			      sigmask(SIGKILL) | sigmask(SIGSTOP));
 		*k =3D *act;
@@ -4221,9 +4321,11 @@ int do_sigaction(int sig, struct k_sigaction *act, str=
uct k_sigaction *oact)
 		if (sig_handler_ignored(sig_handler(p, sig), sig)) {
 			sigemptyset(&mask);
 			sigaddset(&mask, sig);
-			flush_sigqueue_mask(&mask, &p->signal->shared_pending);
+			flush_sigqueue_mask(p, &mask, &p->signal->shared_pending);
 			for_each_thread(p, t)
-				flush_sigqueue_mask(&mask, &t->pending);
+				flush_sigqueue_mask(p, &mask, &t->pending);
+		} else if (was_ignored) {
+			posixtimer_sig_unignore(p, sig);
 		}
 	}
=20
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 8ebb6d5a106b..b0b97a60aaa6 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -17,11 +17,6 @@ config ARCH_CLOCKSOURCE_DATA
 config ARCH_CLOCKSOURCE_INIT
 	bool
=20
-# Clocksources require validation of the clocksource against the last
-# cycle update - x86/TSC misfeature
-config CLOCKSOURCE_VALIDATE_LAST_CYCLE
-	bool
-
 # Timekeeping vsyscall support
 config GENERIC_TIME_VSYSCALL
 	bool
diff --git a/kernel/time/Makefile b/kernel/time/Makefile
index 4af2a264a160..fe0ae82124fe 100644
--- a/kernel/time/Makefile
+++ b/kernel/time/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-y +=3D time.o timer.o hrtimer.o
+obj-y +=3D time.o timer.o hrtimer.o sleep_timeout.o
 obj-y +=3D timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o
 obj-y +=3D timeconv.o timecounter.o alarmtimer.o
=20
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 8bf888641694..0ddccdff119a 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -197,28 +197,15 @@ static enum hrtimer_restart alarmtimer_fired(struct hrt=
imer *timer)
 {
 	struct alarm *alarm =3D container_of(timer, struct alarm, timer);
 	struct alarm_base *base =3D &alarm_bases[alarm->type];
-	unsigned long flags;
-	int ret =3D HRTIMER_NORESTART;
-	int restart =3D ALARMTIMER_NORESTART;
=20
-	spin_lock_irqsave(&base->lock, flags);
-	alarmtimer_dequeue(base, alarm);
-	spin_unlock_irqrestore(&base->lock, flags);
+	scoped_guard (spinlock_irqsave, &base->lock)
+		alarmtimer_dequeue(base, alarm);
=20
 	if (alarm->function)
-		restart =3D alarm->function(alarm, base->get_ktime());
-
-	spin_lock_irqsave(&base->lock, flags);
-	if (restart !=3D ALARMTIMER_NORESTART) {
-		hrtimer_set_expires(&alarm->timer, alarm->node.expires);
-		alarmtimer_enqueue(base, alarm);
-		ret =3D HRTIMER_RESTART;
-	}
-	spin_unlock_irqrestore(&base->lock, flags);
+		alarm->function(alarm, base->get_ktime());
=20
 	trace_alarmtimer_fired(alarm, base->get_ktime());
-	return ret;
-
+	return HRTIMER_NORESTART;
 }
=20
 ktime_t alarm_expires_remaining(const struct alarm *alarm)
@@ -334,10 +321,9 @@ static int alarmtimer_resume(struct device *dev)
=20
 static void
 __alarm_init(struct alarm *alarm, enum alarmtimer_type type,
-	     enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
+	     void (*function)(struct alarm *, ktime_t))
 {
 	timerqueue_init(&alarm->node);
-	alarm->timer.function =3D alarmtimer_fired;
 	alarm->function =3D function;
 	alarm->type =3D type;
 	alarm->state =3D ALARMTIMER_STATE_INACTIVE;
@@ -350,10 +336,10 @@ __alarm_init(struct alarm *alarm, enum alarmtimer_type =
type,
  * @function: callback that is run when the alarm fires
  */
 void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
-		enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
+		void (*function)(struct alarm *, ktime_t))
 {
-	hrtimer_init(&alarm->timer, alarm_bases[type].base_clockid,
-		     HRTIMER_MODE_ABS);
+	hrtimer_setup(&alarm->timer, alarmtimer_fired, alarm_bases[type].base_clock=
id,
+		      HRTIMER_MODE_ABS);
 	__alarm_init(alarm, type, function);
 }
 EXPORT_SYMBOL_GPL(alarm_init);
@@ -480,35 +466,11 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, kti=
me_t interval)
 }
 EXPORT_SYMBOL_GPL(alarm_forward);
=20
-static u64 __alarm_forward_now(struct alarm *alarm, ktime_t interval, bool t=
hrottle)
+u64 alarm_forward_now(struct alarm *alarm, ktime_t interval)
 {
 	struct alarm_base *base =3D &alarm_bases[alarm->type];
-	ktime_t now =3D base->get_ktime();
-
-	if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && throttle) {
-		/*
-		 * Same issue as with posix_timer_fn(). Timers which are
-		 * periodic but the signal is ignored can starve the system
-		 * with a very small interval. The real fix which was
-		 * promised in the context of posix_timer_fn() never
-		 * materialized, but someone should really work on it.
-		 *
-		 * To prevent DOS fake @now to be 1 jiffy out which keeps
-		 * the overrun accounting correct but creates an
-		 * inconsistency vs. timer_gettime(2).
-		 */
-		ktime_t kj =3D NSEC_PER_SEC / HZ;
=20
-		if (interval < kj)
-			now =3D ktime_add(now, kj);
-	}
-
-	return alarm_forward(alarm, now, interval);
-}
-
-u64 alarm_forward_now(struct alarm *alarm, ktime_t interval)
-{
-	return __alarm_forward_now(alarm, interval, false);
+	return alarm_forward(alarm, base->get_ktime(), interval);
 }
 EXPORT_SYMBOL_GPL(alarm_forward_now);
=20
@@ -567,30 +529,12 @@ static enum alarmtimer_type clock2alarm(clockid_t clock=
id)
  *
  * Return: whether the timer is to be restarted
  */
-static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
-							ktime_t now)
+static void alarm_handle_timer(struct alarm *alarm, ktime_t now)
 {
-	struct k_itimer *ptr =3D container_of(alarm, struct k_itimer,
-					    it.alarm.alarmtimer);
-	enum alarmtimer_restart result =3D ALARMTIMER_NORESTART;
-	unsigned long flags;
+	struct k_itimer *ptr =3D container_of(alarm, struct k_itimer, it.alarm.alar=
mtimer);
=20
-	spin_lock_irqsave(&ptr->it_lock, flags);
-
-	if (posix_timer_queue_signal(ptr) && ptr->it_interval) {
-		/*
-		 * Handle ignored signals and rearm the timer. This will go
-		 * away once we handle ignored signals proper. Ensure that
-		 * small intervals cannot starve the system.
-		 */
-		ptr->it_overrun +=3D __alarm_forward_now(alarm, ptr->it_interval, true);
-		++ptr->it_requeue_pending;
-		ptr->it_active =3D 1;
-		result =3D ALARMTIMER_RESTART;
-	}
-	spin_unlock_irqrestore(&ptr->it_lock, flags);
-
-	return result;
+	guard(spinlock_irqsave)(&ptr->it_lock);
+	posix_timer_queue_signal(ptr);
 }
=20
 /**
@@ -751,18 +695,14 @@ static int alarm_timer_create(struct k_itimer *new_time=
r)
  * @now: time at the timer expiration
  *
  * Wakes up the task that set the alarmtimer
- *
- * Return: ALARMTIMER_NORESTART
  */
-static enum alarmtimer_restart alarmtimer_nsleep_wakeup(struct alarm *alarm,
-								ktime_t now)
+static void alarmtimer_nsleep_wakeup(struct alarm *alarm, ktime_t now)
 {
 	struct task_struct *task =3D alarm->data;
=20
 	alarm->data =3D NULL;
 	if (task)
 		wake_up_process(task);
-	return ALARMTIMER_NORESTART;
 }
=20
 /**
@@ -814,10 +754,10 @@ static int alarmtimer_do_nsleep(struct alarm *alarm, kt=
ime_t absexp,
=20
 static void
 alarm_init_on_stack(struct alarm *alarm, enum alarmtimer_type type,
-		    enum alarmtimer_restart (*function)(struct alarm *, ktime_t))
+		    void (*function)(struct alarm *, ktime_t))
 {
-	hrtimer_init_on_stack(&alarm->timer, alarm_bases[type].base_clockid,
-			      HRTIMER_MODE_ABS);
+	hrtimer_setup_on_stack(&alarm->timer, alarmtimer_fired, alarm_bases[type].b=
ase_clockid,
+			       HRTIMER_MODE_ABS);
 	__alarm_init(alarm, type, function);
 }
=20
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 78c7bd64d0dd..f3e831f62906 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -337,13 +337,21 @@ int clockevents_program_event(struct clock_event_device=
 *dev, ktime_t expires,
 }
=20
 /*
- * Called after a notify add to make devices available which were
- * released from the notifier call.
+ * Called after a clockevent has been added which might
+ * have replaced a current regular or broadcast device. A
+ * released normal device might be a suitable replacement
+ * for the current broadcast device. Similarly a released
+ * broadcast device might be a suitable replacement for a
+ * normal device.
  */
 static void clockevents_notify_released(void)
 {
 	struct clock_event_device *dev;
=20
+	/*
+	 * Keep iterating as long as tick_check_new_device()
+	 * replaces a device.
+	 */
 	while (!list_empty(&clockevents_released)) {
 		dev =3D list_entry(clockevents_released.next,
 				 struct clock_event_device, list);
@@ -610,39 +618,30 @@ void clockevents_resume(void)
=20
 #ifdef CONFIG_HOTPLUG_CPU
=20
-# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
 /**
- * tick_offline_cpu - Take CPU out of the broadcast mechanism
+ * tick_offline_cpu - Shutdown all clock events related
+ *                    to this CPU and take it out of the
+ *                    broadcast mechanism.
  * @cpu:	The outgoing CPU
  *
- * Called on the outgoing CPU after it took itself offline.
+ * Called by the dying CPU during teardown.
  */
 void tick_offline_cpu(unsigned int cpu)
-{
-	raw_spin_lock(&clockevents_lock);
-	tick_broadcast_offline(cpu);
-	raw_spin_unlock(&clockevents_lock);
-}
-# endif
-
-/**
- * tick_cleanup_dead_cpu - Cleanup the tick and clockevents of a dead cpu
- * @cpu:	The dead CPU
- */
-void tick_cleanup_dead_cpu(int cpu)
 {
 	struct clock_event_device *dev, *tmp;
-	unsigned long flags;
=20
-	raw_spin_lock_irqsave(&clockevents_lock, flags);
+	raw_spin_lock(&clockevents_lock);
=20
+	tick_broadcast_offline(cpu);
 	tick_shutdown(cpu);
+
 	/*
 	 * Unregister the clock event devices which were
-	 * released from the users in the notify chain.
+	 * released above.
 	 */
 	list_for_each_entry_safe(dev, tmp, &clockevents_released, list)
 		list_del(&dev->list);
+
 	/*
 	 * Now check whether the CPU has left unused per cpu devices
 	 */
@@ -654,7 +653,8 @@ void tick_cleanup_dead_cpu(int cpu)
 			list_del(&dev->list);
 		}
 	}
-	raw_spin_unlock_irqrestore(&clockevents_lock, flags);
+
+	raw_spin_unlock(&clockevents_lock);
 }
 #endif
=20
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 23336eecb4f4..aab6472853fa 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -20,6 +20,8 @@
 #include "tick-internal.h"
 #include "timekeeping_internal.h"
=20
+static void clocksource_enqueue(struct clocksource *cs);
+
 static noinline u64 cycles_to_nsec_safe(struct clocksource *cs, u64 start, u=
64 end)
 {
 	u64 delta =3D clocksource_delta(end, start, cs->mask);
@@ -171,7 +173,6 @@ static inline void clocksource_watchdog_unlock(unsigned l=
ong *flags)
 }
=20
 static int clocksource_watchdog_kthread(void *data);
-static void __clocksource_change_rating(struct clocksource *cs, int rating);
=20
 static void clocksource_watchdog_work(struct work_struct *work)
 {
@@ -191,6 +192,13 @@ static void clocksource_watchdog_work(struct work_struct=
 *work)
 	kthread_run(clocksource_watchdog_kthread, NULL, "kwatchdog");
 }
=20
+static void clocksource_change_rating(struct clocksource *cs, int rating)
+{
+	list_del(&cs->list);
+	cs->rating =3D rating;
+	clocksource_enqueue(cs);
+}
+
 static void __clocksource_unstable(struct clocksource *cs)
 {
 	cs->flags &=3D ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG);
@@ -697,7 +705,7 @@ static int __clocksource_watchdog_kthread(void)
 	list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) {
 		if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
 			list_del_init(&cs->wd_list);
-			__clocksource_change_rating(cs, 0);
+			clocksource_change_rating(cs, 0);
 			select =3D 1;
 		}
 		if (cs->flags & CLOCK_SOURCE_RESELECT) {
@@ -1255,34 +1263,6 @@ int __clocksource_register_scale(struct clocksource *c=
s, u32 scale, u32 freq)
 }
 EXPORT_SYMBOL_GPL(__clocksource_register_scale);
=20
-static void __clocksource_change_rating(struct clocksource *cs, int rating)
-{
-	list_del(&cs->list);
-	cs->rating =3D rating;
-	clocksource_enqueue(cs);
-}
-
-/**
- * clocksource_change_rating - Change the rating of a registered clocksource
- * @cs:		clocksource to be changed
- * @rating:	new rating
- */
-void clocksource_change_rating(struct clocksource *cs, int rating)
-{
-	unsigned long flags;
-
-	mutex_lock(&clocksource_mutex);
-	clocksource_watchdog_lock(&flags);
-	__clocksource_change_rating(cs, rating);
-	clocksource_watchdog_unlock(&flags);
-
-	clocksource_select();
-	clocksource_select_watchdog(false);
-	clocksource_suspend_select(false);
-	mutex_unlock(&clocksource_mutex);
-}
-EXPORT_SYMBOL(clocksource_change_rating);
-
 /*
  * Unbind clocksource @cs. Called with clocksource_mutex held
  */
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index cddcd08ea827..55e9ffbcd49a 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -417,6 +417,11 @@ static inline void debug_hrtimer_init(struct hrtimer *ti=
mer)
 	debug_object_init(timer, &hrtimer_debug_descr);
 }
=20
+static inline void debug_hrtimer_init_on_stack(struct hrtimer *timer)
+{
+	debug_object_init_on_stack(timer, &hrtimer_debug_descr);
+}
+
 static inline void debug_hrtimer_activate(struct hrtimer *timer,
 					  enum hrtimer_mode mode)
 {
@@ -428,28 +433,6 @@ static inline void debug_hrtimer_deactivate(struct hrtim=
er *timer)
 	debug_object_deactivate(timer, &hrtimer_debug_descr);
 }
=20
-static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
-			   enum hrtimer_mode mode);
-
-void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t clock_id,
-			   enum hrtimer_mode mode)
-{
-	debug_object_init_on_stack(timer, &hrtimer_debug_descr);
-	__hrtimer_init(timer, clock_id, mode);
-}
-EXPORT_SYMBOL_GPL(hrtimer_init_on_stack);
-
-static void __hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
-				   clockid_t clock_id, enum hrtimer_mode mode);
-
-void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl,
-				   clockid_t clock_id, enum hrtimer_mode mode)
-{
-	debug_object_init_on_stack(&sl->timer, &hrtimer_debug_descr);
-	__hrtimer_init_sleeper(sl, clock_id, mode);
-}
-EXPORT_SYMBOL_GPL(hrtimer_init_sleeper_on_stack);
-
 void destroy_hrtimer_on_stack(struct hrtimer *timer)
 {
 	debug_object_free(timer, &hrtimer_debug_descr);
@@ -459,6 +442,7 @@ EXPORT_SYMBOL_GPL(destroy_hrtimer_on_stack);
 #else
=20
 static inline void debug_hrtimer_init(struct hrtimer *timer) { }
+static inline void debug_hrtimer_init_on_stack(struct hrtimer *timer) { }
 static inline void debug_hrtimer_activate(struct hrtimer *timer,
 					  enum hrtimer_mode mode) { }
 static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { }
@@ -472,6 +456,13 @@ debug_init(struct hrtimer *timer, clockid_t clockid,
 	trace_hrtimer_init(timer, clockid, mode);
 }
=20
+static inline void debug_init_on_stack(struct hrtimer *timer, clockid_t cloc=
kid,
+				       enum hrtimer_mode mode)
+{
+	debug_hrtimer_init_on_stack(timer);
+	trace_hrtimer_init(timer, clockid, mode);
+}
+
 static inline void debug_activate(struct hrtimer *timer,
 				  enum hrtimer_mode mode)
 {
@@ -1544,6 +1535,11 @@ static inline int hrtimer_clockid_to_base(clockid_t cl=
ock_id)
 	return HRTIMER_BASE_MONOTONIC;
 }
=20
+static enum hrtimer_restart hrtimer_dummy_timeout(struct hrtimer *unused)
+{
+	return HRTIMER_NORESTART;
+}
+
 static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 			   enum hrtimer_mode mode)
 {
@@ -1580,6 +1576,18 @@ static void __hrtimer_init(struct hrtimer *timer, cloc=
kid_t clock_id,
 	timerqueue_init(&timer->node);
 }
=20
+static void __hrtimer_setup(struct hrtimer *timer,
+			    enum hrtimer_restart (*function)(struct hrtimer *),
+			    clockid_t clock_id, enum hrtimer_mode mode)
+{
+	__hrtimer_init(timer, clock_id, mode);
+
+	if (WARN_ON_ONCE(!function))
+		timer->function =3D hrtimer_dummy_timeout;
+	else
+		timer->function =3D function;
+}
+
 /**
  * hrtimer_init - initialize a timer to the given clock
  * @timer:	the timer to be initialized
@@ -1600,6 +1608,46 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clo=
ck_id,
 }
 EXPORT_SYMBOL_GPL(hrtimer_init);
=20
+/**
+ * hrtimer_setup - initialize a timer to the given clock
+ * @timer:	the timer to be initialized
+ * @function:	the callback function
+ * @clock_id:	the clock to be used
+ * @mode:       The modes which are relevant for initialization:
+ *              HRTIMER_MODE_ABS, HRTIMER_MODE_REL, HRTIMER_MODE_ABS_SOFT,
+ *              HRTIMER_MODE_REL_SOFT
+ *
+ *              The PINNED variants of the above can be handed in,
+ *              but the PINNED bit is ignored as pinning happens
+ *              when the hrtimer is started
+ */
+void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)(s=
truct hrtimer *),
+		   clockid_t clock_id, enum hrtimer_mode mode)
+{
+	debug_init(timer, clock_id, mode);
+	__hrtimer_setup(timer, function, clock_id, mode);
+}
+EXPORT_SYMBOL_GPL(hrtimer_setup);
+
+/**
+ * hrtimer_setup_on_stack - initialize a timer on stack memory
+ * @timer:	The timer to be initialized
+ * @function:	the callback function
+ * @clock_id:	The clock to be used
+ * @mode:       The timer mode
+ *
+ * Similar to hrtimer_setup(), except that this one must be used if struct h=
rtimer is in stack
+ * memory.
+ */
+void hrtimer_setup_on_stack(struct hrtimer *timer,
+			    enum hrtimer_restart (*function)(struct hrtimer *),
+			    clockid_t clock_id, enum hrtimer_mode mode)
+{
+	debug_init_on_stack(timer, clock_id, mode);
+	__hrtimer_setup(timer, function, clock_id, mode);
+}
+EXPORT_SYMBOL_GPL(hrtimer_setup_on_stack);
+
 /*
  * A timer is active, when it is enqueued into the rbtree or the
  * callback function is running or it's in the state of being migrated
@@ -1944,7 +1992,7 @@ void hrtimer_sleeper_start_expires(struct hrtimer_sleep=
er *sl,
 	 * Make the enqueue delivery mode check work on RT. If the sleeper
 	 * was initialized for hard interrupt delivery, force the mode bit.
 	 * This is a special case for hrtimer_sleepers because
-	 * hrtimer_init_sleeper() determines the delivery mode on RT so the
+	 * __hrtimer_init_sleeper() determines the delivery mode on RT so the
 	 * fiddling with this decision is avoided at the call sites.
 	 */
 	if (IS_ENABLED(CONFIG_PREEMPT_RT) && sl->timer.is_hard)
@@ -1987,19 +2035,18 @@ static void __hrtimer_init_sleeper(struct hrtimer_sle=
eper *sl,
 }
=20
 /**
- * hrtimer_init_sleeper - initialize sleeper to the given clock
+ * hrtimer_setup_sleeper_on_stack - initialize a sleeper in stack memory
  * @sl:		sleeper to be initialized
  * @clock_id:	the clock to be used
  * @mode:	timer mode abs/rel
  */
-void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock_id,
-			  enum hrtimer_mode mode)
+void hrtimer_setup_sleeper_on_stack(struct hrtimer_sleeper *sl,
+				    clockid_t clock_id, enum hrtimer_mode mode)
 {
-	debug_init(&sl->timer, clock_id, mode);
+	debug_init_on_stack(&sl->timer, clock_id, mode);
 	__hrtimer_init_sleeper(sl, clock_id, mode);
-
 }
-EXPORT_SYMBOL_GPL(hrtimer_init_sleeper);
+EXPORT_SYMBOL_GPL(hrtimer_setup_sleeper_on_stack);
=20
 int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts)
 {
@@ -2060,8 +2107,7 @@ static long __sched hrtimer_nanosleep_restart(struct re=
start_block *restart)
 	struct hrtimer_sleeper t;
 	int ret;
=20
-	hrtimer_init_sleeper_on_stack(&t, restart->nanosleep.clockid,
-				      HRTIMER_MODE_ABS);
+	hrtimer_setup_sleeper_on_stack(&t, restart->nanosleep.clockid, HRTIMER_MODE=
_ABS);
 	hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires);
 	ret =3D do_nanosleep(&t, HRTIMER_MODE_ABS);
 	destroy_hrtimer_on_stack(&t.timer);
@@ -2075,7 +2121,7 @@ long hrtimer_nanosleep(ktime_t rqtp, const enum hrtimer=
_mode mode,
 	struct hrtimer_sleeper t;
 	int ret =3D 0;
=20
-	hrtimer_init_sleeper_on_stack(&t, clockid, mode);
+	hrtimer_setup_sleeper_on_stack(&t, clockid, mode);
 	hrtimer_set_expires_range_ns(&t.timer, rqtp, current->timer_slack_ns);
 	ret =3D do_nanosleep(&t, mode);
 	if (ret !=3D -ERESTART_RESTARTBLOCK)
@@ -2242,123 +2288,3 @@ void __init hrtimers_init(void)
 	hrtimers_prepare_cpu(smp_processor_id());
 	open_softirq(HRTIMER_SOFTIRQ, hrtimer_run_softirq);
 }
-
-/**
- * schedule_hrtimeout_range_clock - sleep until timeout
- * @expires:	timeout value (ktime_t)
- * @delta:	slack in expires timeout (ktime_t)
- * @mode:	timer mode
- * @clock_id:	timer clock to be used
- */
-int __sched
-schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta,
-			       const enum hrtimer_mode mode, clockid_t clock_id)
-{
-	struct hrtimer_sleeper t;
-
-	/*
-	 * Optimize when a zero timeout value is given. It does not
-	 * matter whether this is an absolute or a relative time.
-	 */
-	if (expires && *expires =3D=3D 0) {
-		__set_current_state(TASK_RUNNING);
-		return 0;
-	}
-
-	/*
-	 * A NULL parameter means "infinite"
-	 */
-	if (!expires) {
-		schedule();
-		return -EINTR;
-	}
-
-	hrtimer_init_sleeper_on_stack(&t, clock_id, mode);
-	hrtimer_set_expires_range_ns(&t.timer, *expires, delta);
-	hrtimer_sleeper_start_expires(&t, mode);
-
-	if (likely(t.task))
-		schedule();
-
-	hrtimer_cancel(&t.timer);
-	destroy_hrtimer_on_stack(&t.timer);
-
-	__set_current_state(TASK_RUNNING);
-
-	return !t.task ? 0 : -EINTR;
-}
-EXPORT_SYMBOL_GPL(schedule_hrtimeout_range_clock);
-
-/**
- * schedule_hrtimeout_range - sleep until timeout
- * @expires:	timeout value (ktime_t)
- * @delta:	slack in expires timeout (ktime_t)
- * @mode:	timer mode
- *
- * Make the current task sleep until the given expiry time has
- * elapsed. The routine will return immediately unless
- * the current task state has been set (see set_current_state()).
- *
- * The @delta argument gives the kernel the freedom to schedule the
- * actual wakeup to a time that is both power and performance friendly
- * for regular (non RT/DL) tasks.
- * The kernel give the normal best effort behavior for "@expires+@delta",
- * but may decide to fire the timer earlier, but no earlier than @expires.
- *
- * You can set the task state as follows -
- *
- * %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
- * pass before the routine returns unless the current task is explicitly
- * woken up, (e.g. by wake_up_process()).
- *
- * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
- * delivered to the current task or the current task is explicitly woken
- * up.
- *
- * The current task state is guaranteed to be TASK_RUNNING when this
- * routine returns.
- *
- * Returns 0 when the timer has expired. If the task was woken before the
- * timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
- * by an explicit wakeup, it returns -EINTR.
- */
-int __sched schedule_hrtimeout_range(ktime_t *expires, u64 delta,
-				     const enum hrtimer_mode mode)
-{
-	return schedule_hrtimeout_range_clock(expires, delta, mode,
-					      CLOCK_MONOTONIC);
-}
-EXPORT_SYMBOL_GPL(schedule_hrtimeout_range);
-
-/**
- * schedule_hrtimeout - sleep until timeout
- * @expires:	timeout value (ktime_t)
- * @mode:	timer mode
- *
- * Make the current task sleep until the given expiry time has
- * elapsed. The routine will return immediately unless
- * the current task state has been set (see set_current_state()).
- *
- * You can set the task state as follows -
- *
- * %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
- * pass before the routine returns unless the current task is explicitly
- * woken up, (e.g. by wake_up_process()).
- *
- * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
- * delivered to the current task or the current task is explicitly woken
- * up.
- *
- * The current task state is guaranteed to be TASK_RUNNING when this
- * routine returns.
- *
- * Returns 0 when the timer has expired. If the task was woken before the
- * timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
- * by an explicit wakeup, it returns -EINTR.
- */
-int __sched schedule_hrtimeout(ktime_t *expires,
-			       const enum hrtimer_mode mode)
-{
-	return schedule_hrtimeout_range(expires, 0, mode);
-}
-EXPORT_SYMBOL_GPL(schedule_hrtimeout);
diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c
index 00629e658ca1..876d389b2e21 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
@@ -151,7 +151,27 @@ COMPAT_SYSCALL_DEFINE2(getitimer, int, which,
 #endif
=20
 /*
- * The timer is automagically restarted, when interval !=3D 0
+ * Invoked from dequeue_signal() when SIG_ALRM is delivered.
+ *
+ * Restart the ITIMER_REAL timer if it is armed as periodic timer.  Doing
+ * this in the signal delivery path instead of self rearming prevents a DoS
+ * with small increments in the high reolution timer case and reduces timer
+ * noise in general.
+ */
+void posixtimer_rearm_itimer(struct task_struct *tsk)
+{
+	struct hrtimer *tmr =3D &tsk->signal->real_timer;
+
+	if (!hrtimer_is_queued(tmr) && tsk->signal->it_real_incr !=3D 0) {
+		hrtimer_forward(tmr, tmr->base->get_time(),
+				tsk->signal->it_real_incr);
+		hrtimer_restart(tmr);
+	}
+}
+
+/*
+ * Interval timers are restarted in the signal delivery path.  See
+ * posixtimer_rearm_itimer().
  */
 enum hrtimer_restart it_real_fn(struct hrtimer *timer)
 {
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 802b336f4b8c..b550ebe0f03b 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -22,22 +22,79 @@
 #include "ntp_internal.h"
 #include "timekeeping_internal.h"
=20
-
-/*
- * NTP timekeeping variables:
+/**
+ * struct ntp_data - Structure holding all NTP related state
+ * @tick_usec:		USER_HZ period in microseconds
+ * @tick_length:	Adjusted tick length
+ * @tick_length_base:	Base value for @tick_length
+ * @time_state:		State of the clock synchronization
+ * @time_status:	Clock status bits
+ * @time_offset:	Time adjustment in nanoseconds
+ * @time_constant:	PLL time constant
+ * @time_maxerror:	Maximum error in microseconds holding the NTP sync distan=
ce
+ *			(NTP dispersion + delay / 2)
+ * @time_esterror:	Estimated error in microseconds holding NTP dispersion
+ * @time_freq:		Frequency offset scaled nsecs/secs
+ * @time_reftime:	Time at last adjustment in seconds
+ * @time_adjust:	Adjustment value
+ * @ntp_tick_adj:	Constant boot-param configurable NTP tick adjustment (upsc=
aled)
+ * @ntp_next_leap_sec:	Second value of the next pending leapsecond, or TIME6=
4_MAX if no leap
  *
- * Note: All of the NTP state is protected by the timekeeping locks.
+ * @pps_valid:		PPS signal watchdog counter
+ * @pps_tf:		PPS phase median filter
+ * @pps_jitter:		PPS current jitter in nanoseconds
+ * @pps_fbase:		PPS beginning of the last freq interval
+ * @pps_shift:		PPS current interval duration in seconds (shift value)
+ * @pps_intcnt:		PPS interval counter
+ * @pps_freq:		PPS frequency offset in scaled ns/s
+ * @pps_stabil:		PPS current stability in scaled ns/s
+ * @pps_calcnt:		PPS monitor: calibration intervals
+ * @pps_jitcnt:		PPS monitor: jitter limit exceeded
+ * @pps_stbcnt:		PPS monitor: stability limit exceeded
+ * @pps_errcnt:		PPS monitor: calibration errors
+ *
+ * Protected by the timekeeping locks.
  */
+struct ntp_data {
+	unsigned long		tick_usec;
+	u64			tick_length;
+	u64			tick_length_base;
+	int			time_state;
+	int			time_status;
+	s64			time_offset;
+	long			time_constant;
+	long			time_maxerror;
+	long			time_esterror;
+	s64			time_freq;
+	time64_t		time_reftime;
+	long			time_adjust;
+	s64			ntp_tick_adj;
+	time64_t		ntp_next_leap_sec;
+#ifdef CONFIG_NTP_PPS
+	int			pps_valid;
+	long			pps_tf[3];
+	long			pps_jitter;
+	struct timespec64	pps_fbase;
+	int			pps_shift;
+	int			pps_intcnt;
+	s64			pps_freq;
+	long			pps_stabil;
+	long			pps_calcnt;
+	long			pps_jitcnt;
+	long			pps_stbcnt;
+	long			pps_errcnt;
+#endif
+};
=20
-
-/* USER_HZ period (usecs): */
-unsigned long			tick_usec =3D USER_TICK_USEC;
-
-/* SHIFTED_HZ period (nsecs): */
-unsigned long			tick_nsec;
-
-static u64			tick_length;
-static u64			tick_length_base;
+static struct ntp_data tk_ntp_data =3D {
+	.tick_usec		=3D USER_TICK_USEC,
+	.time_state		=3D TIME_OK,
+	.time_status		=3D STA_UNSYNC,
+	.time_constant		=3D 2,
+	.time_maxerror		=3D NTP_PHASE_LIMIT,
+	.time_esterror		=3D NTP_PHASE_LIMIT,
+	.ntp_next_leap_sec	=3D TIME64_MAX,
+};
=20
 #define SECS_PER_DAY		86400
 #define MAX_TICKADJ		500LL		/* usecs */
@@ -45,46 +102,6 @@ static u64			tick_length_base;
 	(((MAX_TICKADJ * NSEC_PER_USEC) << NTP_SCALE_SHIFT) / NTP_INTERVAL_FREQ)
 #define MAX_TAI_OFFSET		100000
=20
-/*
- * phase-lock loop variables
- */
-
-/*
- * clock synchronization status
- *
- * (TIME_ERROR prevents overwriting the CMOS clock)
- */
-static int			time_state =3D TIME_OK;
-
-/* clock status bits:							*/
-static int			time_status =3D STA_UNSYNC;
-
-/* time adjustment (nsecs):						*/
-static s64			time_offset;
-
-/* pll time constant:							*/
-static long			time_constant =3D 2;
-
-/* maximum error (usecs):						*/
-static long			time_maxerror =3D NTP_PHASE_LIMIT;
-
-/* estimated error (usecs):						*/
-static long			time_esterror =3D NTP_PHASE_LIMIT;
-
-/* frequency offset (scaled nsecs/secs):				*/
-static s64			time_freq;
-
-/* time at last adjustment (secs):					*/
-static time64_t		time_reftime;
-
-static long			time_adjust;
-
-/* constant (boot-param configurable) NTP tick adjustment (upscaled)	*/
-static s64			ntp_tick_adj;
-
-/* second value of the next pending leapsecond, or TIME64_MAX if no leap */
-static time64_t			ntp_next_leap_sec =3D TIME64_MAX;
-
 #ifdef CONFIG_NTP_PPS
=20
 /*
@@ -101,128 +118,115 @@ static time64_t			ntp_next_leap_sec =3D TIME64_MAX;
 				   intervals to decrease it */
 #define PPS_MAXWANDER	100000	/* max PPS freq wander (ns/s) */
=20
-static int pps_valid;		/* signal watchdog counter */
-static long pps_tf[3];		/* phase median filter */
-static long pps_jitter;		/* current jitter (ns) */
-static struct timespec64 pps_fbase; /* beginning of the last freq interval */
-static int pps_shift;		/* current interval duration (s) (shift) */
-static int pps_intcnt;		/* interval counter */
-static s64 pps_freq;		/* frequency offset (scaled ns/s) */
-static long pps_stabil;		/* current stability (scaled ns/s) */
-
 /*
- * PPS signal quality monitors
- */
-static long pps_calcnt;		/* calibration intervals */
-static long pps_jitcnt;		/* jitter limit exceeded */
-static long pps_stbcnt;		/* stability limit exceeded */
-static long pps_errcnt;		/* calibration errors */
-
-
-/* PPS kernel consumer compensates the whole phase error immediately.
+ * PPS kernel consumer compensates the whole phase error immediately.
  * Otherwise, reduce the offset by a fixed factor times the time constant.
  */
-static inline s64 ntp_offset_chunk(s64 offset)
+static inline s64 ntp_offset_chunk(struct ntp_data *ntpdata, s64 offset)
 {
-	if (time_status & STA_PPSTIME && time_status & STA_PPSSIGNAL)
+	if (ntpdata->time_status & STA_PPSTIME && ntpdata->time_status & STA_PPSSIG=
NAL)
 		return offset;
 	else
-		return shift_right(offset, SHIFT_PLL + time_constant);
+		return shift_right(offset, SHIFT_PLL + ntpdata->time_constant);
 }
=20
-static inline void pps_reset_freq_interval(void)
+static inline void pps_reset_freq_interval(struct ntp_data *ntpdata)
 {
-	/* the PPS calibration interval may end
-	   surprisingly early */
-	pps_shift =3D PPS_INTMIN;
-	pps_intcnt =3D 0;
+	/* The PPS calibration interval may end surprisingly early */
+	ntpdata->pps_shift =3D PPS_INTMIN;
+	ntpdata->pps_intcnt =3D 0;
 }
=20
 /**
  * pps_clear - Clears the PPS state variables
+ * @ntpdata:	Pointer to ntp data
  */
-static inline void pps_clear(void)
+static inline void pps_clear(struct ntp_data *ntpdata)
 {
-	pps_reset_freq_interval();
-	pps_tf[0] =3D 0;
-	pps_tf[1] =3D 0;
-	pps_tf[2] =3D 0;
-	pps_fbase.tv_sec =3D pps_fbase.tv_nsec =3D 0;
-	pps_freq =3D 0;
+	pps_reset_freq_interval(ntpdata);
+	ntpdata->pps_tf[0] =3D 0;
+	ntpdata->pps_tf[1] =3D 0;
+	ntpdata->pps_tf[2] =3D 0;
+	ntpdata->pps_fbase.tv_sec =3D ntpdata->pps_fbase.tv_nsec =3D 0;
+	ntpdata->pps_freq =3D 0;
 }
=20
-/* Decrease pps_valid to indicate that another second has passed since
- * the last PPS signal. When it reaches 0, indicate that PPS signal is
- * missing.
+/*
+ * Decrease pps_valid to indicate that another second has passed since the
+ * last PPS signal. When it reaches 0, indicate that PPS signal is missing.
  */
-static inline void pps_dec_valid(void)
+static inline void pps_dec_valid(struct ntp_data *ntpdata)
 {
-	if (pps_valid > 0)
-		pps_valid--;
-	else {
-		time_status &=3D ~(STA_PPSSIGNAL | STA_PPSJITTER |
-				 STA_PPSWANDER | STA_PPSERROR);
-		pps_clear();
+	if (ntpdata->pps_valid > 0) {
+		ntpdata->pps_valid--;
+	} else {
+		ntpdata->time_status &=3D ~(STA_PPSSIGNAL | STA_PPSJITTER |
+					  STA_PPSWANDER | STA_PPSERROR);
+		pps_clear(ntpdata);
 	}
 }
=20
-static inline void pps_set_freq(s64 freq)
+static inline void pps_set_freq(struct ntp_data *ntpdata)
 {
-	pps_freq =3D freq;
+	ntpdata->pps_freq =3D ntpdata->time_freq;
 }
=20
-static inline int is_error_status(int status)
+static inline bool is_error_status(int status)
 {
 	return (status & (STA_UNSYNC|STA_CLOCKERR))
-		/* PPS signal lost when either PPS time or
-		 * PPS frequency synchronization requested
+		/*
+		 * PPS signal lost when either PPS time or PPS frequency
+		 * synchronization requested
 		 */
 		|| ((status & (STA_PPSFREQ|STA_PPSTIME))
 			&& !(status & STA_PPSSIGNAL))
-		/* PPS jitter exceeded when
-		 * PPS time synchronization requested */
+		/*
+		 * PPS jitter exceeded when PPS time synchronization
+		 * requested
+		 */
 		|| ((status & (STA_PPSTIME|STA_PPSJITTER))
 			=3D=3D (STA_PPSTIME|STA_PPSJITTER))
-		/* PPS wander exceeded or calibration error when
-		 * PPS frequency synchronization requested
+		/*
+		 * PPS wander exceeded or calibration error when PPS
+		 * frequency synchronization requested
 		 */
 		|| ((status & STA_PPSFREQ)
 			&& (status & (STA_PPSWANDER|STA_PPSERROR)));
 }
=20
-static inline void pps_fill_timex(struct __kernel_timex *txc)
+static inline void pps_fill_timex(struct ntp_data *ntpdata, struct __kernel_=
timex *txc)
 {
-	txc->ppsfreq	   =3D shift_right((pps_freq >> PPM_SCALE_INV_SHIFT) *
+	txc->ppsfreq	   =3D shift_right((ntpdata->pps_freq >> PPM_SCALE_INV_SHIFT) *
 					 PPM_SCALE_INV, NTP_SCALE_SHIFT);
-	txc->jitter	   =3D pps_jitter;
-	if (!(time_status & STA_NANO))
-		txc->jitter =3D pps_jitter / NSEC_PER_USEC;
-	txc->shift	   =3D pps_shift;
-	txc->stabil	   =3D pps_stabil;
-	txc->jitcnt	   =3D pps_jitcnt;
-	txc->calcnt	   =3D pps_calcnt;
-	txc->errcnt	   =3D pps_errcnt;
-	txc->stbcnt	   =3D pps_stbcnt;
+	txc->jitter	   =3D ntpdata->pps_jitter;
+	if (!(ntpdata->time_status & STA_NANO))
+		txc->jitter =3D ntpdata->pps_jitter / NSEC_PER_USEC;
+	txc->shift	   =3D ntpdata->pps_shift;
+	txc->stabil	   =3D ntpdata->pps_stabil;
+	txc->jitcnt	   =3D ntpdata->pps_jitcnt;
+	txc->calcnt	   =3D ntpdata->pps_calcnt;
+	txc->errcnt	   =3D ntpdata->pps_errcnt;
+	txc->stbcnt	   =3D ntpdata->pps_stbcnt;
 }
=20
 #else /* !CONFIG_NTP_PPS */
=20
-static inline s64 ntp_offset_chunk(s64 offset)
+static inline s64 ntp_offset_chunk(struct ntp_data *ntpdata, s64 offset)
 {
-	return shift_right(offset, SHIFT_PLL + time_constant);
+	return shift_right(offset, SHIFT_PLL + ntpdata->time_constant);
 }
=20
-static inline void pps_reset_freq_interval(void) {}
-static inline void pps_clear(void) {}
-static inline void pps_dec_valid(void) {}
-static inline void pps_set_freq(s64 freq) {}
+static inline void pps_reset_freq_interval(struct ntp_data *ntpdata) {}
+static inline void pps_clear(struct ntp_data *ntpdata) {}
+static inline void pps_dec_valid(struct ntp_data *ntpdata) {}
+static inline void pps_set_freq(struct ntp_data *ntpdata) {}
=20
-static inline int is_error_status(int status)
+static inline bool is_error_status(int status)
 {
 	return status & (STA_UNSYNC|STA_CLOCKERR);
 }
=20
-static inline void pps_fill_timex(struct __kernel_timex *txc)
+static inline void pps_fill_timex(struct ntp_data *ntpdata, struct __kernel_=
timex *txc)
 {
 	/* PPS is not implemented, so these are zero */
 	txc->ppsfreq	   =3D 0;
@@ -237,138 +241,123 @@ static inline void pps_fill_timex(struct __kernel_tim=
ex *txc)
=20
 #endif /* CONFIG_NTP_PPS */
=20
-
-/**
- * ntp_synced - Returns 1 if the NTP status is not UNSYNC
- *
- */
-static inline int ntp_synced(void)
-{
-	return !(time_status & STA_UNSYNC);
-}
-
-
 /*
- * NTP methods:
+ * Update tick_length and tick_length_base, based on tick_usec, ntp_tick_adj=
 and
+ * time_freq:
  */
-
-/*
- * Update (tick_length, tick_length_base, tick_nsec), based
- * on (tick_usec, ntp_tick_adj, time_freq):
- */
-static void ntp_update_frequency(void)
+static void ntp_update_frequency(struct ntp_data *ntpdata)
 {
-	u64 second_length;
-	u64 new_base;
+	u64 second_length, new_base, tick_usec =3D (u64)ntpdata->tick_usec;
=20
-	second_length		 =3D (u64)(tick_usec * NSEC_PER_USEC * USER_HZ)
-						<< NTP_SCALE_SHIFT;
+	second_length		 =3D (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) << NTP_SCALE=
_SHIFT;
=20
-	second_length		+=3D ntp_tick_adj;
-	second_length		+=3D time_freq;
+	second_length		+=3D ntpdata->ntp_tick_adj;
+	second_length		+=3D ntpdata->time_freq;
=20
-	tick_nsec		 =3D div_u64(second_length, HZ) >> NTP_SCALE_SHIFT;
 	new_base		 =3D div_u64(second_length, NTP_INTERVAL_FREQ);
=20
 	/*
-	 * Don't wait for the next second_overflow, apply
-	 * the change to the tick length immediately:
+	 * Don't wait for the next second_overflow, apply the change to the
+	 * tick length immediately:
 	 */
-	tick_length		+=3D new_base - tick_length_base;
-	tick_length_base	 =3D new_base;
+	ntpdata->tick_length		+=3D new_base - ntpdata->tick_length_base;
+	ntpdata->tick_length_base	 =3D new_base;
 }
=20
-static inline s64 ntp_update_offset_fll(s64 offset64, long secs)
+static inline s64 ntp_update_offset_fll(struct ntp_data *ntpdata, s64 offset=
64, long secs)
 {
-	time_status &=3D ~STA_MODE;
+	ntpdata->time_status &=3D ~STA_MODE;
=20
 	if (secs < MINSEC)
 		return 0;
=20
-	if (!(time_status & STA_FLL) && (secs <=3D MAXSEC))
+	if (!(ntpdata->time_status & STA_FLL) && (secs <=3D MAXSEC))
 		return 0;
=20
-	time_status |=3D STA_MODE;
+	ntpdata->time_status |=3D STA_MODE;
=20
 	return div64_long(offset64 << (NTP_SCALE_SHIFT - SHIFT_FLL), secs);
 }
=20
-static void ntp_update_offset(long offset)
+static void ntp_update_offset(struct ntp_data *ntpdata, long offset)
 {
-	s64 freq_adj;
-	s64 offset64;
-	long secs;
+	s64 freq_adj, offset64;
+	long secs, real_secs;
=20
-	if (!(time_status & STA_PLL))
+	if (!(ntpdata->time_status & STA_PLL))
 		return;
=20
-	if (!(time_status & STA_NANO)) {
+	if (!(ntpdata->time_status & STA_NANO)) {
 		/* Make sure the multiplication below won't overflow */
 		offset =3D clamp(offset, -USEC_PER_SEC, USEC_PER_SEC);
 		offset *=3D NSEC_PER_USEC;
 	}
=20
-	/*
-	 * Scale the phase adjustment and
-	 * clamp to the operating range.
-	 */
+	/* Scale the phase adjustment and clamp to the operating range. */
 	offset =3D clamp(offset, -MAXPHASE, MAXPHASE);
=20
 	/*
 	 * Select how the frequency is to be controlled
 	 * and in which mode (PLL or FLL).
 	 */
-	secs =3D (long)(__ktime_get_real_seconds() - time_reftime);
-	if (unlikely(time_status & STA_FREQHOLD))
+	real_secs =3D __ktime_get_real_seconds();
+	secs =3D (long)(real_secs - ntpdata->time_reftime);
+	if (unlikely(ntpdata->time_status & STA_FREQHOLD))
 		secs =3D 0;
=20
-	time_reftime =3D __ktime_get_real_seconds();
+	ntpdata->time_reftime =3D real_secs;
=20
 	offset64    =3D offset;
-	freq_adj    =3D ntp_update_offset_fll(offset64, secs);
+	freq_adj    =3D ntp_update_offset_fll(ntpdata, offset64, secs);
=20
 	/*
 	 * Clamp update interval to reduce PLL gain with low
 	 * sampling rate (e.g. intermittent network connection)
 	 * to avoid instability.
 	 */
-	if (unlikely(secs > 1 << (SHIFT_PLL + 1 + time_constant)))
-		secs =3D 1 << (SHIFT_PLL + 1 + time_constant);
+	if (unlikely(secs > 1 << (SHIFT_PLL + 1 + ntpdata->time_constant)))
+		secs =3D 1 << (SHIFT_PLL + 1 + ntpdata->time_constant);
=20
 	freq_adj    +=3D (offset64 * secs) <<
-			(NTP_SCALE_SHIFT - 2 * (SHIFT_PLL + 2 + time_constant));
+			(NTP_SCALE_SHIFT - 2 * (SHIFT_PLL + 2 + ntpdata->time_constant));
=20
-	freq_adj    =3D min(freq_adj + time_freq, MAXFREQ_SCALED);
+	freq_adj    =3D min(freq_adj + ntpdata->time_freq, MAXFREQ_SCALED);
=20
-	time_freq   =3D max(freq_adj, -MAXFREQ_SCALED);
+	ntpdata->time_freq   =3D max(freq_adj, -MAXFREQ_SCALED);
=20
-	time_offset =3D div_s64(offset64 << NTP_SCALE_SHIFT, NTP_INTERVAL_FREQ);
+	ntpdata->time_offset =3D div_s64(offset64 << NTP_SCALE_SHIFT, NTP_INTERVAL_=
FREQ);
 }
=20
-/**
- * ntp_clear - Clears the NTP state variables
- */
-void ntp_clear(void)
+static void __ntp_clear(struct ntp_data *ntpdata)
 {
-	time_adjust	=3D 0;		/* stop active adjtime() */
-	time_status	|=3D STA_UNSYNC;
-	time_maxerror	=3D NTP_PHASE_LIMIT;
-	time_esterror	=3D NTP_PHASE_LIMIT;
+	/* Stop active adjtime() */
+	ntpdata->time_adjust	=3D 0;
+	ntpdata->time_status	|=3D STA_UNSYNC;
+	ntpdata->time_maxerror	=3D NTP_PHASE_LIMIT;
+	ntpdata->time_esterror	=3D NTP_PHASE_LIMIT;
=20
-	ntp_update_frequency();
+	ntp_update_frequency(ntpdata);
=20
-	tick_length	=3D tick_length_base;
-	time_offset	=3D 0;
+	ntpdata->tick_length	=3D ntpdata->tick_length_base;
+	ntpdata->time_offset	=3D 0;
=20
-	ntp_next_leap_sec =3D TIME64_MAX;
+	ntpdata->ntp_next_leap_sec =3D TIME64_MAX;
 	/* Clear PPS state variables */
-	pps_clear();
+	pps_clear(ntpdata);
+}
+
+/**
+ * ntp_clear - Clears the NTP state variables
+ */
+void ntp_clear(void)
+{
+	__ntp_clear(&tk_ntp_data);
 }
=20
=20
 u64 ntp_tick_length(void)
 {
-	return tick_length;
+	return tk_ntp_data.tick_length;
 }
=20
 /**
@@ -379,16 +368,17 @@ u64 ntp_tick_length(void)
  */
 ktime_t ntp_get_next_leap(void)
 {
+	struct ntp_data *ntpdata =3D &tk_ntp_data;
 	ktime_t ret;
=20
-	if ((time_state =3D=3D TIME_INS) && (time_status & STA_INS))
-		return ktime_set(ntp_next_leap_sec, 0);
+	if ((ntpdata->time_state =3D=3D TIME_INS) && (ntpdata->time_status & STA_IN=
S))
+		return ktime_set(ntpdata->ntp_next_leap_sec, 0);
 	ret =3D KTIME_MAX;
 	return ret;
 }
=20
 /*
- * this routine handles the overflow of the microsecond field
+ * This routine handles the overflow of the microsecond field
  *
  * The tricky bits of code to handle the accurate clock support
  * were provided by Dave Mills (Mills@UDEL.EDU) of NTP fame.
@@ -399,6 +389,7 @@ ktime_t ntp_get_next_leap(void)
  */
 int second_overflow(time64_t secs)
 {
+	struct ntp_data *ntpdata =3D &tk_ntp_data;
 	s64 delta;
 	int leap =3D 0;
 	s32 rem;
@@ -408,87 +399,84 @@ int second_overflow(time64_t secs)
 	 * day, the system clock is set back one second; if in leap-delete
 	 * state, the system clock is set ahead one second.
 	 */
-	switch (time_state) {
+	switch (ntpdata->time_state) {
 	case TIME_OK:
-		if (time_status & STA_INS) {
-			time_state =3D TIME_INS;
+		if (ntpdata->time_status & STA_INS) {
+			ntpdata->time_state =3D TIME_INS;
 			div_s64_rem(secs, SECS_PER_DAY, &rem);
-			ntp_next_leap_sec =3D secs + SECS_PER_DAY - rem;
-		} else if (time_status & STA_DEL) {
-			time_state =3D TIME_DEL;
+			ntpdata->ntp_next_leap_sec =3D secs + SECS_PER_DAY - rem;
+		} else if (ntpdata->time_status & STA_DEL) {
+			ntpdata->time_state =3D TIME_DEL;
 			div_s64_rem(secs + 1, SECS_PER_DAY, &rem);
-			ntp_next_leap_sec =3D secs + SECS_PER_DAY - rem;
+			ntpdata->ntp_next_leap_sec =3D secs + SECS_PER_DAY - rem;
 		}
 		break;
 	case TIME_INS:
-		if (!(time_status & STA_INS)) {
-			ntp_next_leap_sec =3D TIME64_MAX;
-			time_state =3D TIME_OK;
-		} else if (secs =3D=3D ntp_next_leap_sec) {
+		if (!(ntpdata->time_status & STA_INS)) {
+			ntpdata->ntp_next_leap_sec =3D TIME64_MAX;
+			ntpdata->time_state =3D TIME_OK;
+		} else if (secs =3D=3D ntpdata->ntp_next_leap_sec) {
 			leap =3D -1;
-			time_state =3D TIME_OOP;
-			printk(KERN_NOTICE
-				"Clock: inserting leap second 23:59:60 UTC\n");
+			ntpdata->time_state =3D TIME_OOP;
+			pr_notice("Clock: inserting leap second 23:59:60 UTC\n");
 		}
 		break;
 	case TIME_DEL:
-		if (!(time_status & STA_DEL)) {
-			ntp_next_leap_sec =3D TIME64_MAX;
-			time_state =3D TIME_OK;
-		} else if (secs =3D=3D ntp_next_leap_sec) {
+		if (!(ntpdata->time_status & STA_DEL)) {
+			ntpdata->ntp_next_leap_sec =3D TIME64_MAX;
+			ntpdata->time_state =3D TIME_OK;
+		} else if (secs =3D=3D ntpdata->ntp_next_leap_sec) {
 			leap =3D 1;
-			ntp_next_leap_sec =3D TIME64_MAX;
-			time_state =3D TIME_WAIT;
-			printk(KERN_NOTICE
-				"Clock: deleting leap second 23:59:59 UTC\n");
+			ntpdata->ntp_next_leap_sec =3D TIME64_MAX;
+			ntpdata->time_state =3D TIME_WAIT;
+			pr_notice("Clock: deleting leap second 23:59:59 UTC\n");
 		}
 		break;
 	case TIME_OOP:
-		ntp_next_leap_sec =3D TIME64_MAX;
-		time_state =3D TIME_WAIT;
+		ntpdata->ntp_next_leap_sec =3D TIME64_MAX;
+		ntpdata->time_state =3D TIME_WAIT;
 		break;
 	case TIME_WAIT:
-		if (!(time_status & (STA_INS | STA_DEL)))
-			time_state =3D TIME_OK;
+		if (!(ntpdata->time_status & (STA_INS | STA_DEL)))
+			ntpdata->time_state =3D TIME_OK;
 		break;
 	}
=20
-
 	/* Bump the maxerror field */
-	time_maxerror +=3D MAXFREQ / NSEC_PER_USEC;
-	if (time_maxerror > NTP_PHASE_LIMIT) {
-		time_maxerror =3D NTP_PHASE_LIMIT;
-		time_status |=3D STA_UNSYNC;
+	ntpdata->time_maxerror +=3D MAXFREQ / NSEC_PER_USEC;
+	if (ntpdata->time_maxerror > NTP_PHASE_LIMIT) {
+		ntpdata->time_maxerror =3D NTP_PHASE_LIMIT;
+		ntpdata->time_status |=3D STA_UNSYNC;
 	}
=20
 	/* Compute the phase adjustment for the next second */
-	tick_length	 =3D tick_length_base;
+	ntpdata->tick_length	 =3D ntpdata->tick_length_base;
=20
-	delta		 =3D ntp_offset_chunk(time_offset);
-	time_offset	-=3D delta;
-	tick_length	+=3D delta;
+	delta			 =3D ntp_offset_chunk(ntpdata, ntpdata->time_offset);
+	ntpdata->time_offset	-=3D delta;
+	ntpdata->tick_length	+=3D delta;
=20
 	/* Check PPS signal */
-	pps_dec_valid();
+	pps_dec_valid(ntpdata);
=20
-	if (!time_adjust)
+	if (!ntpdata->time_adjust)
 		goto out;
=20
-	if (time_adjust > MAX_TICKADJ) {
-		time_adjust -=3D MAX_TICKADJ;
-		tick_length +=3D MAX_TICKADJ_SCALED;
+	if (ntpdata->time_adjust > MAX_TICKADJ) {
+		ntpdata->time_adjust -=3D MAX_TICKADJ;
+		ntpdata->tick_length +=3D MAX_TICKADJ_SCALED;
 		goto out;
 	}
=20
-	if (time_adjust < -MAX_TICKADJ) {
-		time_adjust +=3D MAX_TICKADJ;
-		tick_length -=3D MAX_TICKADJ_SCALED;
+	if (ntpdata->time_adjust < -MAX_TICKADJ) {
+		ntpdata->time_adjust +=3D MAX_TICKADJ;
+		ntpdata->tick_length -=3D MAX_TICKADJ_SCALED;
 		goto out;
 	}
=20
-	tick_length +=3D (s64)(time_adjust * NSEC_PER_USEC / NTP_INTERVAL_FREQ)
-							 << NTP_SCALE_SHIFT;
-	time_adjust =3D 0;
+	ntpdata->tick_length +=3D (s64)(ntpdata->time_adjust * NSEC_PER_USEC / NTP_=
INTERVAL_FREQ)
+				<< NTP_SCALE_SHIFT;
+	ntpdata->time_adjust =3D 0;
=20
 out:
 	return leap;
@@ -611,6 +599,15 @@ static inline int update_rtc(struct timespec64 *to_set, =
unsigned long *offset_ns
 }
 #endif
=20
+/**
+ * ntp_synced - Tells whether the NTP status is not UNSYNC
+ * Returns:	true if not UNSYNC, false otherwise
+ */
+static inline bool ntp_synced(void)
+{
+	return !(tk_ntp_data.time_status & STA_UNSYNC);
+}
+
 /*
  * If we have an externally synchronized Linux clock, then update RTC clock
  * accordingly every ~11 minutes. Generally RTCs can only store second
@@ -691,162 +688,156 @@ static inline void __init ntp_init_cmos_sync(void) { }
 /*
  * Propagate a new txc->status value into the NTP state:
  */
-static inline void process_adj_status(const struct __kernel_timex *txc)
+static inline void process_adj_status(struct ntp_data *ntpdata, const struct=
 __kernel_timex *txc)
 {
-	if ((time_status & STA_PLL) && !(txc->status & STA_PLL)) {
-		time_state =3D TIME_OK;
-		time_status =3D STA_UNSYNC;
-		ntp_next_leap_sec =3D TIME64_MAX;
-		/* restart PPS frequency calibration */
-		pps_reset_freq_interval();
+	if ((ntpdata->time_status & STA_PLL) && !(txc->status & STA_PLL)) {
+		ntpdata->time_state =3D TIME_OK;
+		ntpdata->time_status =3D STA_UNSYNC;
+		ntpdata->ntp_next_leap_sec =3D TIME64_MAX;
+		/* Restart PPS frequency calibration */
+		pps_reset_freq_interval(ntpdata);
 	}
=20
 	/*
 	 * If we turn on PLL adjustments then reset the
 	 * reference time to current time.
 	 */
-	if (!(time_status & STA_PLL) && (txc->status & STA_PLL))
-		time_reftime =3D __ktime_get_real_seconds();
+	if (!(ntpdata->time_status & STA_PLL) && (txc->status & STA_PLL))
+		ntpdata->time_reftime =3D __ktime_get_real_seconds();
=20
 	/* only set allowed bits */
-	time_status &=3D STA_RONLY;
-	time_status |=3D txc->status & ~STA_RONLY;
+	ntpdata->time_status &=3D STA_RONLY;
+	ntpdata->time_status |=3D txc->status & ~STA_RONLY;
 }
=20
-
-static inline void process_adjtimex_modes(const struct __kernel_timex *txc,
+static inline void process_adjtimex_modes(struct ntp_data *ntpdata, const st=
ruct __kernel_timex *txc,
 					  s32 *time_tai)
 {
 	if (txc->modes & ADJ_STATUS)
-		process_adj_status(txc);
+		process_adj_status(ntpdata, txc);
=20
 	if (txc->modes & ADJ_NANO)
-		time_status |=3D STA_NANO;
+		ntpdata->time_status |=3D STA_NANO;
=20
 	if (txc->modes & ADJ_MICRO)
-		time_status &=3D ~STA_NANO;
+		ntpdata->time_status &=3D ~STA_NANO;
=20
 	if (txc->modes & ADJ_FREQUENCY) {
-		time_freq =3D txc->freq * PPM_SCALE;
-		time_freq =3D min(time_freq, MAXFREQ_SCALED);
-		time_freq =3D max(time_freq, -MAXFREQ_SCALED);
-		/* update pps_freq */
-		pps_set_freq(time_freq);
+		ntpdata->time_freq =3D txc->freq * PPM_SCALE;
+		ntpdata->time_freq =3D min(ntpdata->time_freq, MAXFREQ_SCALED);
+		ntpdata->time_freq =3D max(ntpdata->time_freq, -MAXFREQ_SCALED);
+		/* Update pps_freq */
+		pps_set_freq(ntpdata);
 	}
=20
 	if (txc->modes & ADJ_MAXERROR)
-		time_maxerror =3D clamp(txc->maxerror, 0, NTP_PHASE_LIMIT);
+		ntpdata->time_maxerror =3D clamp(txc->maxerror, 0, NTP_PHASE_LIMIT);
=20
 	if (txc->modes & ADJ_ESTERROR)
-		time_esterror =3D clamp(txc->esterror, 0, NTP_PHASE_LIMIT);
+		ntpdata->time_esterror =3D clamp(txc->esterror, 0, NTP_PHASE_LIMIT);
=20
 	if (txc->modes & ADJ_TIMECONST) {
-		time_constant =3D clamp(txc->constant, 0, MAXTC);
-		if (!(time_status & STA_NANO))
-			time_constant +=3D 4;
-		time_constant =3D clamp(time_constant, 0, MAXTC);
+		ntpdata->time_constant =3D clamp(txc->constant, 0, MAXTC);
+		if (!(ntpdata->time_status & STA_NANO))
+			ntpdata->time_constant +=3D 4;
+		ntpdata->time_constant =3D clamp(ntpdata->time_constant, 0, MAXTC);
 	}
=20
-	if (txc->modes & ADJ_TAI &&
-			txc->constant >=3D 0 && txc->constant <=3D MAX_TAI_OFFSET)
+	if (txc->modes & ADJ_TAI && txc->constant >=3D 0 && txc->constant <=3D MAX_=
TAI_OFFSET)
 		*time_tai =3D txc->constant;
=20
 	if (txc->modes & ADJ_OFFSET)
-		ntp_update_offset(txc->offset);
+		ntp_update_offset(ntpdata, txc->offset);
=20
 	if (txc->modes & ADJ_TICK)
-		tick_usec =3D txc->tick;
+		ntpdata->tick_usec =3D txc->tick;
=20
 	if (txc->modes & (ADJ_TICK|ADJ_FREQUENCY|ADJ_OFFSET))
-		ntp_update_frequency();
+		ntp_update_frequency(ntpdata);
 }
=20
-
 /*
- * adjtimex mainly allows reading (and writing, if superuser) of
+ * adjtimex() mainly allows reading (and writing, if superuser) of
  * kernel time-keeping variables. used by xntpd.
  */
 int __do_adjtimex(struct __kernel_timex *txc, const struct timespec64 *ts,
 		  s32 *time_tai, struct audit_ntp_data *ad)
 {
+	struct ntp_data *ntpdata =3D &tk_ntp_data;
 	int result;
=20
 	if (txc->modes & ADJ_ADJTIME) {
-		long save_adjust =3D time_adjust;
+		long save_adjust =3D ntpdata->time_adjust;
=20
 		if (!(txc->modes & ADJ_OFFSET_READONLY)) {
 			/* adjtime() is independent from ntp_adjtime() */
-			time_adjust =3D txc->offset;
-			ntp_update_frequency();
+			ntpdata->time_adjust =3D txc->offset;
+			ntp_update_frequency(ntpdata);
=20
 			audit_ntp_set_old(ad, AUDIT_NTP_ADJUST,	save_adjust);
-			audit_ntp_set_new(ad, AUDIT_NTP_ADJUST,	time_adjust);
+			audit_ntp_set_new(ad, AUDIT_NTP_ADJUST,	ntpdata->time_adjust);
 		}
 		txc->offset =3D save_adjust;
 	} else {
 		/* If there are input parameters, then process them: */
 		if (txc->modes) {
-			audit_ntp_set_old(ad, AUDIT_NTP_OFFSET,	time_offset);
-			audit_ntp_set_old(ad, AUDIT_NTP_FREQ,	time_freq);
-			audit_ntp_set_old(ad, AUDIT_NTP_STATUS,	time_status);
+			audit_ntp_set_old(ad, AUDIT_NTP_OFFSET,	ntpdata->time_offset);
+			audit_ntp_set_old(ad, AUDIT_NTP_FREQ,	ntpdata->time_freq);
+			audit_ntp_set_old(ad, AUDIT_NTP_STATUS,	ntpdata->time_status);
 			audit_ntp_set_old(ad, AUDIT_NTP_TAI,	*time_tai);
-			audit_ntp_set_old(ad, AUDIT_NTP_TICK,	tick_usec);
+			audit_ntp_set_old(ad, AUDIT_NTP_TICK,	ntpdata->tick_usec);
=20
-			process_adjtimex_modes(txc, time_tai);
+			process_adjtimex_modes(ntpdata, txc, time_tai);
=20
-			audit_ntp_set_new(ad, AUDIT_NTP_OFFSET,	time_offset);
-			audit_ntp_set_new(ad, AUDIT_NTP_FREQ,	time_freq);
-			audit_ntp_set_new(ad, AUDIT_NTP_STATUS,	time_status);
+			audit_ntp_set_new(ad, AUDIT_NTP_OFFSET,	ntpdata->time_offset);
+			audit_ntp_set_new(ad, AUDIT_NTP_FREQ,	ntpdata->time_freq);
+			audit_ntp_set_new(ad, AUDIT_NTP_STATUS,	ntpdata->time_status);
 			audit_ntp_set_new(ad, AUDIT_NTP_TAI,	*time_tai);
-			audit_ntp_set_new(ad, AUDIT_NTP_TICK,	tick_usec);
+			audit_ntp_set_new(ad, AUDIT_NTP_TICK,	ntpdata->tick_usec);
 		}
=20
-		txc->offset =3D shift_right(time_offset * NTP_INTERVAL_FREQ,
-				  NTP_SCALE_SHIFT);
-		if (!(time_status & STA_NANO))
+		txc->offset =3D shift_right(ntpdata->time_offset * NTP_INTERVAL_FREQ, NTP_=
SCALE_SHIFT);
+		if (!(ntpdata->time_status & STA_NANO))
 			txc->offset =3D (u32)txc->offset / NSEC_PER_USEC;
 	}
=20
-	result =3D time_state;	/* mostly `TIME_OK' */
-	/* check for errors */
-	if (is_error_status(time_status))
+	result =3D ntpdata->time_state;
+	if (is_error_status(ntpdata->time_status))
 		result =3D TIME_ERROR;
=20
-	txc->freq	   =3D shift_right((time_freq >> PPM_SCALE_INV_SHIFT) *
+	txc->freq	   =3D shift_right((ntpdata->time_freq >> PPM_SCALE_INV_SHIFT) *
 					 PPM_SCALE_INV, NTP_SCALE_SHIFT);
-	txc->maxerror	   =3D time_maxerror;
-	txc->esterror	   =3D time_esterror;
-	txc->status	   =3D time_status;
-	txc->constant	   =3D time_constant;
+	txc->maxerror	   =3D ntpdata->time_maxerror;
+	txc->esterror	   =3D ntpdata->time_esterror;
+	txc->status	   =3D ntpdata->time_status;
+	txc->constant	   =3D ntpdata->time_constant;
 	txc->precision	   =3D 1;
 	txc->tolerance	   =3D MAXFREQ_SCALED / PPM_SCALE;
-	txc->tick	   =3D tick_usec;
+	txc->tick	   =3D ntpdata->tick_usec;
 	txc->tai	   =3D *time_tai;
=20
-	/* fill PPS status fields */
-	pps_fill_timex(txc);
+	/* Fill PPS status fields */
+	pps_fill_timex(ntpdata, txc);
=20
 	txc->time.tv_sec =3D ts->tv_sec;
 	txc->time.tv_usec =3D ts->tv_nsec;
-	if (!(time_status & STA_NANO))
+	if (!(ntpdata->time_status & STA_NANO))
 		txc->time.tv_usec =3D ts->tv_nsec / NSEC_PER_USEC;
=20
 	/* Handle leapsec adjustments */
-	if (unlikely(ts->tv_sec >=3D ntp_next_leap_sec)) {
-		if ((time_state =3D=3D TIME_INS) && (time_status & STA_INS)) {
+	if (unlikely(ts->tv_sec >=3D ntpdata->ntp_next_leap_sec)) {
+		if ((ntpdata->time_state =3D=3D TIME_INS) && (ntpdata->time_status & STA_I=
NS)) {
 			result =3D TIME_OOP;
 			txc->tai++;
 			txc->time.tv_sec--;
 		}
-		if ((time_state =3D=3D TIME_DEL) && (time_status & STA_DEL)) {
+		if ((ntpdata->time_state =3D=3D TIME_DEL) && (ntpdata->time_status & STA_D=
EL)) {
 			result =3D TIME_WAIT;
 			txc->tai--;
 			txc->time.tv_sec++;
 		}
-		if ((time_state =3D=3D TIME_OOP) &&
-					(ts->tv_sec =3D=3D ntp_next_leap_sec)) {
+		if ((ntpdata->time_state =3D=3D TIME_OOP) && (ts->tv_sec =3D=3D ntpdata->n=
tp_next_leap_sec))
 			result =3D TIME_WAIT;
-		}
 	}
=20
 	return result;
@@ -854,17 +845,21 @@ int __do_adjtimex(struct __kernel_timex *txc, const str=
uct timespec64 *ts,
=20
 #ifdef	CONFIG_NTP_PPS
=20
-/* actually struct pps_normtime is good old struct timespec, but it is
+/*
+ * struct pps_normtime is basically a struct timespec, but it is
  * semantically different (and it is the reason why it was invented):
  * pps_normtime.nsec has a range of ( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ]
- * while timespec.tv_nsec has a range of [0, NSEC_PER_SEC) */
+ * while timespec.tv_nsec has a range of [0, NSEC_PER_SEC)
+ */
 struct pps_normtime {
 	s64		sec;	/* seconds */
 	long		nsec;	/* nanoseconds */
 };
=20
-/* normalize the timestamp so that nsec is in the
-   ( -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ] interval */
+/*
+ * Normalize the timestamp so that nsec is in the
+ * [ -NSEC_PER_SEC / 2, NSEC_PER_SEC / 2 ] interval
+ */
 static inline struct pps_normtime pps_normalize_ts(struct timespec64 ts)
 {
 	struct pps_normtime norm =3D {
@@ -880,54 +875,57 @@ static inline struct pps_normtime pps_normalize_ts(stru=
ct timespec64 ts)
 	return norm;
 }
=20
-/* get current phase correction and jitter */
-static inline long pps_phase_filter_get(long *jitter)
+/* Get current phase correction and jitter */
+static inline long pps_phase_filter_get(struct ntp_data *ntpdata, long *jitt=
er)
 {
-	*jitter =3D pps_tf[0] - pps_tf[1];
+	*jitter =3D ntpdata->pps_tf[0] - ntpdata->pps_tf[1];
 	if (*jitter < 0)
 		*jitter =3D -*jitter;
=20
 	/* TODO: test various filters */
-	return pps_tf[0];
+	return ntpdata->pps_tf[0];
 }
=20
-/* add the sample to the phase filter */
-static inline void pps_phase_filter_add(long err)
+/* Add the sample to the phase filter */
+static inline void pps_phase_filter_add(struct ntp_data *ntpdata, long err)
 {
-	pps_tf[2] =3D pps_tf[1];
-	pps_tf[1] =3D pps_tf[0];
-	pps_tf[0] =3D err;
+	ntpdata->pps_tf[2] =3D ntpdata->pps_tf[1];
+	ntpdata->pps_tf[1] =3D ntpdata->pps_tf[0];
+	ntpdata->pps_tf[0] =3D err;
 }
=20
-/* decrease frequency calibration interval length.
- * It is halved after four consecutive unstable intervals.
+/*
+ * Decrease frequency calibration interval length. It is halved after four
+ * consecutive unstable intervals.
  */
-static inline void pps_dec_freq_interval(void)
+static inline void pps_dec_freq_interval(struct ntp_data *ntpdata)
 {
-	if (--pps_intcnt <=3D -PPS_INTCOUNT) {
-		pps_intcnt =3D -PPS_INTCOUNT;
-		if (pps_shift > PPS_INTMIN) {
-			pps_shift--;
-			pps_intcnt =3D 0;
+	if (--ntpdata->pps_intcnt <=3D -PPS_INTCOUNT) {
+		ntpdata->pps_intcnt =3D -PPS_INTCOUNT;
+		if (ntpdata->pps_shift > PPS_INTMIN) {
+			ntpdata->pps_shift--;
+			ntpdata->pps_intcnt =3D 0;
 		}
 	}
 }
=20
-/* increase frequency calibration interval length.
- * It is doubled after four consecutive stable intervals.
+/*
+ * Increase frequency calibration interval length. It is doubled after
+ * four consecutive stable intervals.
  */
-static inline void pps_inc_freq_interval(void)
+static inline void pps_inc_freq_interval(struct ntp_data *ntpdata)
 {
-	if (++pps_intcnt >=3D PPS_INTCOUNT) {
-		pps_intcnt =3D PPS_INTCOUNT;
-		if (pps_shift < PPS_INTMAX) {
-			pps_shift++;
-			pps_intcnt =3D 0;
+	if (++ntpdata->pps_intcnt >=3D PPS_INTCOUNT) {
+		ntpdata->pps_intcnt =3D PPS_INTCOUNT;
+		if (ntpdata->pps_shift < PPS_INTMAX) {
+			ntpdata->pps_shift++;
+			ntpdata->pps_intcnt =3D 0;
 		}
 	}
 }
=20
-/* update clock frequency based on MONOTONIC_RAW clock PPS signal
+/*
+ * Update clock frequency based on MONOTONIC_RAW clock PPS signal
  * timestamps
  *
  * At the end of the calibration interval the difference between the
@@ -936,90 +934,88 @@ static inline void pps_inc_freq_interval(void)
  * too long, the data are discarded.
  * Returns the difference between old and new frequency values.
  */
-static long hardpps_update_freq(struct pps_normtime freq_norm)
+static long hardpps_update_freq(struct ntp_data *ntpdata, struct pps_normtim=
e freq_norm)
 {
 	long delta, delta_mod;
 	s64 ftemp;
=20
-	/* check if the frequency interval was too long */
-	if (freq_norm.sec > (2 << pps_shift)) {
-		time_status |=3D STA_PPSERROR;
-		pps_errcnt++;
-		pps_dec_freq_interval();
-		printk_deferred(KERN_ERR
-			"hardpps: PPSERROR: interval too long - %lld s\n",
-			freq_norm.sec);
+	/* Check if the frequency interval was too long */
+	if (freq_norm.sec > (2 << ntpdata->pps_shift)) {
+		ntpdata->time_status |=3D STA_PPSERROR;
+		ntpdata->pps_errcnt++;
+		pps_dec_freq_interval(ntpdata);
+		printk_deferred(KERN_ERR "hardpps: PPSERROR: interval too long - %lld s\n",
+				freq_norm.sec);
 		return 0;
 	}
=20
-	/* here the raw frequency offset and wander (stability) is
-	 * calculated. If the wander is less than the wander threshold
-	 * the interval is increased; otherwise it is decreased.
+	/*
+	 * Here the raw frequency offset and wander (stability) is
+	 * calculated. If the wander is less than the wander threshold the
+	 * interval is increased; otherwise it is decreased.
 	 */
 	ftemp =3D div_s64(((s64)(-freq_norm.nsec)) << NTP_SCALE_SHIFT,
 			freq_norm.sec);
-	delta =3D shift_right(ftemp - pps_freq, NTP_SCALE_SHIFT);
-	pps_freq =3D ftemp;
+	delta =3D shift_right(ftemp - ntpdata->pps_freq, NTP_SCALE_SHIFT);
+	ntpdata->pps_freq =3D ftemp;
 	if (delta > PPS_MAXWANDER || delta < -PPS_MAXWANDER) {
-		printk_deferred(KERN_WARNING
-				"hardpps: PPSWANDER: change=3D%ld\n", delta);
-		time_status |=3D STA_PPSWANDER;
-		pps_stbcnt++;
-		pps_dec_freq_interval();
-	} else {	/* good sample */
-		pps_inc_freq_interval();
+		printk_deferred(KERN_WARNING "hardpps: PPSWANDER: change=3D%ld\n", delta);
+		ntpdata->time_status |=3D STA_PPSWANDER;
+		ntpdata->pps_stbcnt++;
+		pps_dec_freq_interval(ntpdata);
+	} else {
+		/* Good sample */
+		pps_inc_freq_interval(ntpdata);
 	}
=20
-	/* the stability metric is calculated as the average of recent
-	 * frequency changes, but is used only for performance
-	 * monitoring
+	/*
+	 * The stability metric is calculated as the average of recent
+	 * frequency changes, but is used only for performance monitoring
 	 */
 	delta_mod =3D delta;
 	if (delta_mod < 0)
 		delta_mod =3D -delta_mod;
-	pps_stabil +=3D (div_s64(((s64)delta_mod) <<
-				(NTP_SCALE_SHIFT - SHIFT_USEC),
-				NSEC_PER_USEC) - pps_stabil) >> PPS_INTMIN;
-
-	/* if enabled, the system clock frequency is updated */
-	if ((time_status & STA_PPSFREQ) !=3D 0 &&
-	    (time_status & STA_FREQHOLD) =3D=3D 0) {
-		time_freq =3D pps_freq;
-		ntp_update_frequency();
+	ntpdata->pps_stabil +=3D (div_s64(((s64)delta_mod) << (NTP_SCALE_SHIFT - SH=
IFT_USEC),
+				     NSEC_PER_USEC) - ntpdata->pps_stabil) >> PPS_INTMIN;
+
+	/* If enabled, the system clock frequency is updated */
+	if ((ntpdata->time_status & STA_PPSFREQ) && !(ntpdata->time_status & STA_FR=
EQHOLD)) {
+		ntpdata->time_freq =3D ntpdata->pps_freq;
+		ntp_update_frequency(ntpdata);
 	}
=20
 	return delta;
 }
=20
-/* correct REALTIME clock phase error against PPS signal */
-static void hardpps_update_phase(long error)
+/* Correct REALTIME clock phase error against PPS signal */
+static void hardpps_update_phase(struct ntp_data *ntpdata, long error)
 {
 	long correction =3D -error;
 	long jitter;
=20
-	/* add the sample to the median filter */
-	pps_phase_filter_add(correction);
-	correction =3D pps_phase_filter_get(&jitter);
+	/* Add the sample to the median filter */
+	pps_phase_filter_add(ntpdata, correction);
+	correction =3D pps_phase_filter_get(ntpdata, &jitter);
=20
-	/* Nominal jitter is due to PPS signal noise. If it exceeds the
+	/*
+	 * Nominal jitter is due to PPS signal noise. If it exceeds the
 	 * threshold, the sample is discarded; otherwise, if so enabled,
 	 * the time offset is updated.
 	 */
-	if (jitter > (pps_jitter << PPS_POPCORN)) {
-		printk_deferred(KERN_WARNING
-				"hardpps: PPSJITTER: jitter=3D%ld, limit=3D%ld\n",
-				jitter, (pps_jitter << PPS_POPCORN));
-		time_status |=3D STA_PPSJITTER;
-		pps_jitcnt++;
-	} else if (time_status & STA_PPSTIME) {
-		/* correct the time using the phase offset */
-		time_offset =3D div_s64(((s64)correction) << NTP_SCALE_SHIFT,
-				NTP_INTERVAL_FREQ);
-		/* cancel running adjtime() */
-		time_adjust =3D 0;
+	if (jitter > (ntpdata->pps_jitter << PPS_POPCORN)) {
+		printk_deferred(KERN_WARNING "hardpps: PPSJITTER: jitter=3D%ld, limit=3D%l=
d\n",
+				jitter, (ntpdata->pps_jitter << PPS_POPCORN));
+		ntpdata->time_status |=3D STA_PPSJITTER;
+		ntpdata->pps_jitcnt++;
+	} else if (ntpdata->time_status & STA_PPSTIME) {
+		/* Correct the time using the phase offset */
+		ntpdata->time_offset =3D div_s64(((s64)correction) << NTP_SCALE_SHIFT,
+					       NTP_INTERVAL_FREQ);
+		/* Cancel running adjtime() */
+		ntpdata->time_adjust =3D 0;
 	}
-	/* update jitter */
-	pps_jitter +=3D (jitter - pps_jitter) >> PPS_INTMIN;
+	/* Update jitter */
+	ntpdata->pps_jitter +=3D (jitter - ntpdata->pps_jitter) >> PPS_INTMIN;
 }
=20
 /*
@@ -1037,60 +1033,62 @@ static void hardpps_update_phase(long error)
 void __hardpps(const struct timespec64 *phase_ts, const struct timespec64 *r=
aw_ts)
 {
 	struct pps_normtime pts_norm, freq_norm;
+	struct ntp_data *ntpdata =3D &tk_ntp_data;
=20
 	pts_norm =3D pps_normalize_ts(*phase_ts);
=20
-	/* clear the error bits, they will be set again if needed */
-	time_status &=3D ~(STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR);
+	/* Clear the error bits, they will be set again if needed */
+	ntpdata->time_status &=3D ~(STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR);
=20
 	/* indicate signal presence */
-	time_status |=3D STA_PPSSIGNAL;
-	pps_valid =3D PPS_VALID;
+	ntpdata->time_status |=3D STA_PPSSIGNAL;
+	ntpdata->pps_valid =3D PPS_VALID;
=20
-	/* when called for the first time,
-	 * just start the frequency interval */
-	if (unlikely(pps_fbase.tv_sec =3D=3D 0)) {
-		pps_fbase =3D *raw_ts;
+	/*
+	 * When called for the first time, just start the frequency
+	 * interval
+	 */
+	if (unlikely(ntpdata->pps_fbase.tv_sec =3D=3D 0)) {
+		ntpdata->pps_fbase =3D *raw_ts;
 		return;
 	}
=20
-	/* ok, now we have a base for frequency calculation */
-	freq_norm =3D pps_normalize_ts(timespec64_sub(*raw_ts, pps_fbase));
-
-	/* check that the signal is in the range
-	 * [1s - MAXFREQ us, 1s + MAXFREQ us], otherwise reject it */
-	if ((freq_norm.sec =3D=3D 0) ||
-			(freq_norm.nsec > MAXFREQ * freq_norm.sec) ||
-			(freq_norm.nsec < -MAXFREQ * freq_norm.sec)) {
-		time_status |=3D STA_PPSJITTER;
-		/* restart the frequency calibration interval */
-		pps_fbase =3D *raw_ts;
+	/* Ok, now we have a base for frequency calculation */
+	freq_norm =3D pps_normalize_ts(timespec64_sub(*raw_ts, ntpdata->pps_fbase));
+
+	/*
+	 * Check that the signal is in the range
+	 * [1s - MAXFREQ us, 1s + MAXFREQ us], otherwise reject it
+	 */
+	if ((freq_norm.sec =3D=3D 0) || (freq_norm.nsec > MAXFREQ * freq_norm.sec) =
||
+	    (freq_norm.nsec < -MAXFREQ * freq_norm.sec)) {
+		ntpdata->time_status |=3D STA_PPSJITTER;
+		/* Restart the frequency calibration interval */
+		ntpdata->pps_fbase =3D *raw_ts;
 		printk_deferred(KERN_ERR "hardpps: PPSJITTER: bad pulse\n");
 		return;
 	}
=20
-	/* signal is ok */
-
-	/* check if the current frequency interval is finished */
-	if (freq_norm.sec >=3D (1 << pps_shift)) {
-		pps_calcnt++;
-		/* restart the frequency calibration interval */
-		pps_fbase =3D *raw_ts;
-		hardpps_update_freq(freq_norm);
+	/* Signal is ok. Check if the current frequency interval is finished */
+	if (freq_norm.sec >=3D (1 << ntpdata->pps_shift)) {
+		ntpdata->pps_calcnt++;
+		/* Restart the frequency calibration interval */
+		ntpdata->pps_fbase =3D *raw_ts;
+		hardpps_update_freq(ntpdata, freq_norm);
 	}
=20
-	hardpps_update_phase(pts_norm.nsec);
+	hardpps_update_phase(ntpdata, pts_norm.nsec);
=20
 }
 #endif	/* CONFIG_NTP_PPS */
=20
 static int __init ntp_tick_adj_setup(char *str)
 {
-	int rc =3D kstrtos64(str, 0, &ntp_tick_adj);
+	int rc =3D kstrtos64(str, 0, &tk_ntp_data.ntp_tick_adj);
 	if (rc)
 		return rc;
=20
-	ntp_tick_adj <<=3D NTP_SCALE_SHIFT;
+	tk_ntp_data.ntp_tick_adj <<=3D NTP_SCALE_SHIFT;
 	return 1;
 }
=20
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 6bcee4704059..50e8d04ab661 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -453,7 +453,6 @@ static void disarm_timer(struct k_itimer *timer, struct t=
ask_struct *p)
 	struct cpu_timer *ctmr =3D &timer->it.cpu;
 	struct posix_cputimer_base *base;
=20
-	timer->it_active =3D 0;
 	if (!cpu_timer_dequeue(ctmr))
 		return;
=20
@@ -494,19 +493,28 @@ static int posix_cpu_timer_del(struct k_itimer *timer)
 		 */
 		WARN_ON_ONCE(ctmr->head || timerqueue_node_queued(&ctmr->node));
 	} else {
-		if (timer->it.cpu.firing)
+		if (timer->it.cpu.firing) {
+			/*
+			 * Prevent signal delivery. The timer cannot be dequeued
+			 * because it is on the firing list which is not protected
+			 * by sighand->lock. The delivery path is waiting for
+			 * the timer lock. So go back, unlock and retry.
+			 */
+			timer->it.cpu.firing =3D false;
 			ret =3D TIMER_RETRY;
-		else
+		} else {
 			disarm_timer(timer, p);
-
+		}
 		unlock_task_sighand(p, &flags);
 	}
=20
 out:
 	rcu_read_unlock();
-	if (!ret)
-		put_pid(ctmr->pid);
=20
+	if (!ret) {
+		put_pid(ctmr->pid);
+		timer->it_status =3D POSIX_TIMER_DISARMED;
+	}
 	return ret;
 }
=20
@@ -560,7 +568,7 @@ static void arm_timer(struct k_itimer *timer, struct task=
_struct *p)
 	struct cpu_timer *ctmr =3D &timer->it.cpu;
 	u64 newexp =3D cpu_timer_getexpires(ctmr);
=20
-	timer->it_active =3D 1;
+	timer->it_status =3D POSIX_TIMER_ARMED;
 	if (!cpu_timer_enqueue(&base->tqhead, ctmr))
 		return;
=20
@@ -586,29 +594,20 @@ static void cpu_timer_fire(struct k_itimer *timer)
 {
 	struct cpu_timer *ctmr =3D &timer->it.cpu;
=20
-	timer->it_active =3D 0;
-	if (unlikely(timer->sigq =3D=3D NULL)) {
+	timer->it_status =3D POSIX_TIMER_DISARMED;
+
+	if (unlikely(ctmr->nanosleep)) {
 		/*
 		 * This a special case for clock_nanosleep,
 		 * not a normal timer from sys_timer_create.
 		 */
 		wake_up_process(timer->it_process);
 		cpu_timer_setexpires(ctmr, 0);
-	} else if (!timer->it_interval) {
-		/*
-		 * One-shot timer.  Clear it as soon as it's fired.
-		 */
+	} else {
 		posix_timer_queue_signal(timer);
-		cpu_timer_setexpires(ctmr, 0);
-	} else if (posix_timer_queue_signal(timer)) {
-		/*
-		 * The signal did not get queued because the signal
-		 * was ignored, so we won't get any callback to
-		 * reload the timer.  But we need to keep it
-		 * ticking in case the signal is deliverable next time.
-		 */
-		posix_cpu_timer_rearm(timer);
-		++timer->it_requeue_pending;
+		/* Disable oneshot timers */
+		if (!timer->it_interval)
+			cpu_timer_setexpires(ctmr, 0);
 	}
 }
=20
@@ -667,11 +666,17 @@ static int posix_cpu_timer_set(struct k_itimer *timer, =
int timer_flags,
 	old_expires =3D cpu_timer_getexpires(ctmr);
=20
 	if (unlikely(timer->it.cpu.firing)) {
-		timer->it.cpu.firing =3D -1;
+		/*
+		 * Prevent signal delivery. The timer cannot be dequeued
+		 * because it is on the firing list which is not protected
+		 * by sighand->lock. The delivery path is waiting for
+		 * the timer lock. So go back, unlock and retry.
+		 */
+		timer->it.cpu.firing =3D false;
 		ret =3D TIMER_RETRY;
 	} else {
 		cpu_timer_dequeue(ctmr);
-		timer->it_active =3D 0;
+		timer->it_status =3D POSIX_TIMER_DISARMED;
 	}
=20
 	/*
@@ -745,7 +750,7 @@ static void __posix_cpu_timer_get(struct k_itimer *timer,=
 struct itimerspec64 *i
 	 *  - Timers which expired, but the signal has not yet been
 	 *    delivered
 	 */
-	if (iv && ((timer->it_requeue_pending & REQUEUE_PENDING) || sigev_none))
+	if (iv && timer->it_status !=3D POSIX_TIMER_ARMED)
 		expires =3D bump_cpu_timer(timer, now);
 	else
 		expires =3D cpu_timer_getexpires(&timer->it.cpu);
@@ -808,7 +813,7 @@ static u64 collect_timerqueue(struct timerqueue_head *hea=
d,
 		if (++i =3D=3D MAX_COLLECTED || now < expires)
 			return expires;
=20
-		ctmr->firing =3D 1;
+		ctmr->firing =3D true;
 		/* See posix_cpu_timer_wait_running() */
 		rcu_assign_pointer(ctmr->handling, current);
 		cpu_timer_dequeue(ctmr);
@@ -1363,7 +1368,7 @@ static void handle_posix_cpu_timers(struct task_struct =
*tsk)
 	 * timer call will interfere.
 	 */
 	list_for_each_entry_safe(timer, next, &firing, it.cpu.elist) {
-		int cpu_firing;
+		bool cpu_firing;
=20
 		/*
 		 * spin_lock() is sufficient here even independent of the
@@ -1375,13 +1380,13 @@ static void handle_posix_cpu_timers(struct task_struc=
t *tsk)
 		spin_lock(&timer->it_lock);
 		list_del_init(&timer->it.cpu.elist);
 		cpu_firing =3D timer->it.cpu.firing;
-		timer->it.cpu.firing =3D 0;
+		timer->it.cpu.firing =3D false;
 		/*
-		 * The firing flag is -1 if we collided with a reset
-		 * of the timer, which already reported this
-		 * almost-firing as an overrun.  So don't generate an event.
+		 * If the firing flag is cleared then this raced with a
+		 * timer rearm/delete operation. So don't generate an
+		 * event.
 		 */
-		if (likely(cpu_firing >=3D 0))
+		if (likely(cpu_firing))
 			cpu_timer_fire(timer);
 		/* See posix_cpu_timer_wait_running() */
 		rcu_assign_pointer(timer->it.cpu.handling, NULL);
@@ -1478,6 +1483,7 @@ static int do_cpu_nanosleep(const clockid_t which_clock=
, int flags,
 	timer.it_overrun =3D -1;
 	error =3D posix_cpu_timer_create(&timer);
 	timer.it_process =3D current;
+	timer.it.cpu.nanosleep =3D true;
=20
 	if (!error) {
 		static struct itimerspec64 zero_it;
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 4576aaed13b2..881a9ce96af7 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -233,11 +233,12 @@ __initcall(init_posix_timers);
  * The siginfo si_overrun field and the return value of timer_getoverrun(2)
  * are of type int. Clamp the overrun value to INT_MAX
  */
-static inline int timer_overrun_to_int(struct k_itimer *timr, int baseval)
+static inline int timer_overrun_to_int(struct k_itimer *timr)
 {
-	s64 sum =3D timr->it_overrun_last + (s64)baseval;
+	if (timr->it_overrun_last > (s64)INT_MAX)
+		return INT_MAX;
=20
-	return sum > (s64)INT_MAX ? INT_MAX : (int)sum;
+	return (int)timr->it_overrun_last;
 }
=20
 static void common_hrtimer_rearm(struct k_itimer *timr)
@@ -249,62 +250,62 @@ static void common_hrtimer_rearm(struct k_itimer *timr)
 	hrtimer_restart(timer);
 }
=20
+static bool __posixtimer_deliver_signal(struct kernel_siginfo *info, struct =
k_itimer *timr)
+{
+	guard(spinlock)(&timr->it_lock);
+
+	/*
+	 * Check if the timer is still alive or whether it got modified
+	 * since the signal was queued. In either case, don't rearm and
+	 * drop the signal.
+	 */
+	if (timr->it_signal_seq !=3D timr->it_sigqueue_seq || WARN_ON_ONCE(!timr->i=
t_signal))
+		return false;
+
+	if (!timr->it_interval || WARN_ON_ONCE(timr->it_status !=3D POSIX_TIMER_REQ=
UEUE_PENDING))
+		return true;
+
+	timr->kclock->timer_rearm(timr);
+	timr->it_status =3D POSIX_TIMER_ARMED;
+	timr->it_overrun_last =3D timr->it_overrun;
+	timr->it_overrun =3D -1LL;
+	++timr->it_signal_seq;
+	info->si_overrun =3D timer_overrun_to_int(timr);
+	return true;
+}
+
 /*
- * This function is called from the signal delivery code if
- * info->si_sys_private is not zero, which indicates that the timer has to
- * be rearmed. Restart the timer and update info::si_overrun.
+ * This function is called from the signal delivery code. It decides
+ * whether the signal should be dropped and rearms interval timers.  The
+ * timer can be unconditionally accessed as there is a reference held on
+ * it.
  */
-void posixtimer_rearm(struct kernel_siginfo *info)
+bool posixtimer_deliver_signal(struct kernel_siginfo *info, struct sigqueue =
*timer_sigq)
 {
-	struct k_itimer *timr;
-	unsigned long flags;
-
-	timr =3D lock_timer(info->si_tid, &flags);
-	if (!timr)
-		return;
+	struct k_itimer *timr =3D container_of(timer_sigq, struct k_itimer, sigq);
+	bool ret;
=20
-	if (timr->it_interval && timr->it_requeue_pending =3D=3D info->si_sys_priva=
te) {
-		timr->kclock->timer_rearm(timr);
+	/*
+	 * Release siglock to ensure proper locking order versus
+	 * timr::it_lock. Keep interrupts disabled.
+	 */
+	spin_unlock(&current->sighand->siglock);
=20
-		timr->it_active =3D 1;
-		timr->it_overrun_last =3D timr->it_overrun;
-		timr->it_overrun =3D -1LL;
-		++timr->it_requeue_pending;
+	ret =3D __posixtimer_deliver_signal(info, timr);
=20
-		info->si_overrun =3D timer_overrun_to_int(timr, info->si_overrun);
-	}
+	/* Drop the reference which was acquired when the signal was queued */
+	posixtimer_putref(timr);
=20
-	unlock_timer(timr, flags);
+	spin_lock(&current->sighand->siglock);
+	return ret;
 }
=20
-int posix_timer_queue_signal(struct k_itimer *timr)
+void posix_timer_queue_signal(struct k_itimer *timr)
 {
-	int ret, si_private =3D 0;
-	enum pid_type type;
-
 	lockdep_assert_held(&timr->it_lock);
=20
-	timr->it_active =3D 0;
-	if (timr->it_interval)
-		si_private =3D ++timr->it_requeue_pending;
-
-	/*
-	 * FIXME: if ->sigq is queued we can race with
-	 * dequeue_signal()->posixtimer_rearm().
-	 *
-	 * If dequeue_signal() sees the "right" value of
-	 * si_sys_private it calls posixtimer_rearm().
-	 * We re-queue ->sigq and drop ->it_lock().
-	 * posixtimer_rearm() locks the timer
-	 * and re-schedules it while ->sigq is pending.
-	 * Not really bad, but not that we want.
-	 */
-	timr->sigq->info.si_sys_private =3D si_private;
-
-	type =3D !(timr->it_sigev_notify & SIGEV_THREAD_ID) ? PIDTYPE_TGID : PIDTYP=
E_PID;
-	ret =3D send_sigqueue(timr->sigq, timr->it_pid, type);
-	/* If we failed to send the signal the timer stops. */
-	return ret > 0;
+	timr->it_status =3D timr->it_interval ? POSIX_TIMER_REQUEUE_PENDING : POSIX=
_TIMER_DISARMED;
+	posixtimer_send_sigqueue(timr);
 }
=20
 /*
@@ -317,62 +318,10 @@ int posix_timer_queue_signal(struct k_itimer *timr)
 static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
 {
 	struct k_itimer *timr =3D container_of(timer, struct k_itimer, it.real.time=
r);
-	enum hrtimer_restart ret =3D HRTIMER_NORESTART;
-	unsigned long flags;
-
-	spin_lock_irqsave(&timr->it_lock, flags);
-
-	if (posix_timer_queue_signal(timr)) {
-		/*
-		 * The signal was not queued due to SIG_IGN. As a
-		 * consequence the timer is not going to be rearmed from
-		 * the signal delivery path. But as a real signal handler
-		 * can be installed later the timer must be rearmed here.
-		 */
-		if (timr->it_interval !=3D 0) {
-			ktime_t now =3D hrtimer_cb_get_time(timer);
-
-			/*
-			 * FIXME: What we really want, is to stop this
-			 * timer completely and restart it in case the
-			 * SIG_IGN is removed. This is a non trivial
-			 * change to the signal handling code.
-			 *
-			 * For now let timers with an interval less than a
-			 * jiffy expire every jiffy and recheck for a
-			 * valid signal handler.
-			 *
-			 * This avoids interrupt starvation in case of a
-			 * very small interval, which would expire the
-			 * timer immediately again.
-			 *
-			 * Moving now ahead of time by one jiffy tricks
-			 * hrtimer_forward() to expire the timer later,
-			 * while it still maintains the overrun accuracy
-			 * for the price of a slight inconsistency in the
-			 * timer_gettime() case. This is at least better
-			 * than a timer storm.
-			 *
-			 * Only required when high resolution timers are
-			 * enabled as the periodic tick based timers are
-			 * automatically aligned to the next tick.
-			 */
-			if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS)) {
-				ktime_t kj =3D TICK_NSEC;
-
-				if (timr->it_interval < kj)
-					now =3D ktime_add(now, kj);
-			}
-
-			timr->it_overrun +=3D hrtimer_forward(timer, now, timr->it_interval);
-			ret =3D HRTIMER_RESTART;
-			++timr->it_requeue_pending;
-			timr->it_active =3D 1;
-		}
-	}
=20
-	unlock_timer(timr, flags);
-	return ret;
+	guard(spinlock_irqsave)(&timr->it_lock);
+	posix_timer_queue_signal(timr);
+	return HRTIMER_NORESTART;
 }
=20
 static struct pid *good_sigevent(sigevent_t * event)
@@ -399,32 +348,27 @@ static struct pid *good_sigevent(sigevent_t * event)
 	}
 }
=20
-static struct k_itimer * alloc_posix_timer(void)
+static struct k_itimer *alloc_posix_timer(void)
 {
 	struct k_itimer *tmr =3D kmem_cache_zalloc(posix_timers_cache, GFP_KERNEL);
=20
 	if (!tmr)
 		return tmr;
-	if (unlikely(!(tmr->sigq =3D sigqueue_alloc()))) {
+
+	if (unlikely(!posixtimer_init_sigqueue(&tmr->sigq))) {
 		kmem_cache_free(posix_timers_cache, tmr);
 		return NULL;
 	}
-	clear_siginfo(&tmr->sigq->info);
+	rcuref_init(&tmr->rcuref, 1);
 	return tmr;
 }
=20
-static void k_itimer_rcu_free(struct rcu_head *head)
-{
-	struct k_itimer *tmr =3D container_of(head, struct k_itimer, rcu);
-
-	kmem_cache_free(posix_timers_cache, tmr);
-}
-
-static void posix_timer_free(struct k_itimer *tmr)
+void posixtimer_free_timer(struct k_itimer *tmr)
 {
 	put_pid(tmr->it_pid);
-	sigqueue_free(tmr->sigq);
-	call_rcu(&tmr->rcu, k_itimer_rcu_free);
+	if (tmr->sigq.ucounts)
+		dec_rlimit_put_ucounts(tmr->sigq.ucounts, UCOUNT_RLIMIT_SIGPENDING);
+	kfree_rcu(tmr, rcu);
 }
=20
 static void posix_timer_unhash_and_free(struct k_itimer *tmr)
@@ -432,7 +376,7 @@ static void posix_timer_unhash_and_free(struct k_itimer *=
tmr)
 	spin_lock(&hash_lock);
 	hlist_del_rcu(&tmr->t_hash);
 	spin_unlock(&hash_lock);
-	posix_timer_free(tmr);
+	posixtimer_putref(tmr);
 }
=20
 static int common_timer_create(struct k_itimer *new_timer)
@@ -467,7 +411,7 @@ static int do_timer_create(clockid_t which_clock, struct =
sigevent *event,
 	 */
 	new_timer_id =3D posix_timer_add(new_timer);
 	if (new_timer_id < 0) {
-		posix_timer_free(new_timer);
+		posixtimer_free_timer(new_timer);
 		return new_timer_id;
 	}
=20
@@ -485,18 +429,23 @@ static int do_timer_create(clockid_t which_clock, struc=
t sigevent *event,
 			goto out;
 		}
 		new_timer->it_sigev_notify     =3D event->sigev_notify;
-		new_timer->sigq->info.si_signo =3D event->sigev_signo;
-		new_timer->sigq->info.si_value =3D event->sigev_value;
+		new_timer->sigq.info.si_signo =3D event->sigev_signo;
+		new_timer->sigq.info.si_value =3D event->sigev_value;
 	} else {
 		new_timer->it_sigev_notify     =3D SIGEV_SIGNAL;
-		new_timer->sigq->info.si_signo =3D SIGALRM;
-		memset(&new_timer->sigq->info.si_value, 0, sizeof(sigval_t));
-		new_timer->sigq->info.si_value.sival_int =3D new_timer->it_id;
+		new_timer->sigq.info.si_signo =3D SIGALRM;
+		memset(&new_timer->sigq.info.si_value, 0, sizeof(sigval_t));
+		new_timer->sigq.info.si_value.sival_int =3D new_timer->it_id;
 		new_timer->it_pid =3D get_pid(task_tgid(current));
 	}
=20
-	new_timer->sigq->info.si_tid   =3D new_timer->it_id;
-	new_timer->sigq->info.si_code  =3D SI_TIMER;
+	if (new_timer->it_sigev_notify & SIGEV_THREAD_ID)
+		new_timer->it_pid_type =3D PIDTYPE_PID;
+	else
+		new_timer->it_pid_type =3D PIDTYPE_TGID;
+
+	new_timer->sigq.info.si_tid =3D new_timer->it_id;
+	new_timer->sigq.info.si_code =3D SI_TIMER;
=20
 	if (copy_to_user(created_timer_id, &new_timer_id, sizeof (new_timer_id))) {
 		error =3D -EFAULT;
@@ -580,7 +529,14 @@ static struct k_itimer *__lock_timer(timer_t timer_id, u=
nsigned long *flags)
 	 *  1) Set timr::it_signal to NULL with timr::it_lock held
 	 *  2) Release timr::it_lock
 	 *  3) Remove from the hash under hash_lock
-	 *  4) Call RCU for removal after the grace period
+	 *  4) Put the reference count.
+	 *
+	 * The reference count might not drop to zero if timr::sigq is
+	 * queued. In that case the signal delivery or flush will put the
+	 * last reference count.
+	 *
+	 * When the reference count reaches zero, the timer is scheduled
+	 * for RCU removal after the grace period.
 	 *
 	 * Holding rcu_read_lock() accross the lookup ensures that
 	 * the timer cannot be freed.
@@ -647,10 +603,10 @@ void common_timer_get(struct k_itimer *timr, struct iti=
merspec64 *cur_setting)
 	/* interval timer ? */
 	if (iv) {
 		cur_setting->it_interval =3D ktime_to_timespec64(iv);
-	} else if (!timr->it_active) {
+	} else if (timr->it_status =3D=3D POSIX_TIMER_DISARMED) {
 		/*
 		 * SIGEV_NONE oneshot timers are never queued and therefore
-		 * timr->it_active is always false. The check below
+		 * timr->it_status is always DISARMED. The check below
 		 * vs. remaining time will handle this case.
 		 *
 		 * For all other timers there is nothing to update here, so
@@ -667,7 +623,7 @@ void common_timer_get(struct k_itimer *timr, struct itime=
rspec64 *cur_setting)
 	 * is a SIGEV_NONE timer move the expiry time forward by intervals,
 	 * so expiry is > now.
 	 */
-	if (iv && (timr->it_requeue_pending & REQUEUE_PENDING || sig_none))
+	if (iv && timr->it_status !=3D POSIX_TIMER_ARMED)
 		timr->it_overrun +=3D kc->timer_forward(timr, now);
=20
 	remaining =3D kc->timer_remaining(timr, now);
@@ -775,7 +731,7 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id)
 	if (!timr)
 		return -EINVAL;
=20
-	overrun =3D timer_overrun_to_int(timr, 0);
+	overrun =3D timer_overrun_to_int(timr);
 	unlock_timer(timr, flags);
=20
 	return overrun;
@@ -867,8 +823,6 @@ void posix_timer_set_common(struct k_itimer *timer, struc=
t itimerspec64 *new_set
 	else
 		timer->it_interval =3D 0;
=20
-	/* Prevent reloading in case there is a signal pending */
-	timer->it_requeue_pending =3D (timer->it_requeue_pending + 2) & ~REQUEUE_PE=
NDING;
 	/* Reset overrun accounting */
 	timer->it_overrun_last =3D 0;
 	timer->it_overrun =3D -1LL;
@@ -886,8 +840,6 @@ int common_timer_set(struct k_itimer *timr, int flags,
 	if (old_setting)
 		common_timer_get(timr, old_setting);
=20
-	/* Prevent rearming by clearing the interval */
-	timr->it_interval =3D 0;
 	/*
 	 * Careful here. On SMP systems the timer expiry function could be
 	 * active and spinning on timr->it_lock.
@@ -895,7 +847,7 @@ int common_timer_set(struct k_itimer *timr, int flags,
 	if (kc->timer_try_to_cancel(timr) < 0)
 		return TIMER_RETRY;
=20
-	timr->it_active =3D 0;
+	timr->it_status =3D POSIX_TIMER_DISARMED;
 	posix_timer_set_common(timr, new_setting);
=20
 	/* Keep timer disarmed when it_value is zero */
@@ -908,7 +860,8 @@ int common_timer_set(struct k_itimer *timr, int flags,
 	sigev_none =3D timr->it_sigev_notify =3D=3D SIGEV_NONE;
=20
 	kc->timer_arm(timr, expires, flags & TIMER_ABSTIME, sigev_none);
-	timr->it_active =3D !sigev_none;
+	if (!sigev_none)
+		timr->it_status =3D POSIX_TIMER_ARMED;
 	return 0;
 }
=20
@@ -936,6 +889,9 @@ static int do_timer_settime(timer_t timer_id, int tmr_fla=
gs,
 	if (old_spec64)
 		old_spec64->it_interval =3D ktime_to_timespec64(timr->it_interval);
=20
+	/* Prevent signal delivery and rearming. */
+	timr->it_signal_seq++;
+
 	kc =3D timr->kclock;
 	if (WARN_ON_ONCE(!kc || !kc->timer_set))
 		error =3D -EINVAL;
@@ -1004,17 +960,31 @@ int common_timer_del(struct k_itimer *timer)
 {
 	const struct k_clock *kc =3D timer->kclock;
=20
-	timer->it_interval =3D 0;
 	if (kc->timer_try_to_cancel(timer) < 0)
 		return TIMER_RETRY;
-	timer->it_active =3D 0;
+	timer->it_status =3D POSIX_TIMER_DISARMED;
 	return 0;
 }
=20
+/*
+ * If the deleted timer is on the ignored list, remove it and
+ * drop the associated reference.
+ */
+static inline void posix_timer_cleanup_ignored(struct k_itimer *tmr)
+{
+	if (!hlist_unhashed(&tmr->ignored_list)) {
+		hlist_del_init(&tmr->ignored_list);
+		posixtimer_putref(tmr);
+	}
+}
+
 static inline int timer_delete_hook(struct k_itimer *timer)
 {
 	const struct k_clock *kc =3D timer->kclock;
=20
+	/* Prevent signal delivery and rearming. */
+	timer->it_signal_seq++;
+
 	if (WARN_ON_ONCE(!kc || !kc->timer_del))
 		return -EINVAL;
 	return kc->timer_del(timer);
@@ -1040,12 +1010,18 @@ SYSCALL_DEFINE1(timer_delete, timer_t, timer_id)
=20
 	spin_lock(&current->sighand->siglock);
 	hlist_del(&timer->list);
-	spin_unlock(&current->sighand->siglock);
+	posix_timer_cleanup_ignored(timer);
 	/*
 	 * A concurrent lookup could check timer::it_signal lockless. It
 	 * will reevaluate with timer::it_lock held and observe the NULL.
+	 *
+	 * It must be written with siglock held so that the signal code
+	 * observes timer->it_signal =3D=3D NULL in do_sigaction(SIG_IGN),
+	 * which prevents it from moving a pending signal of a deleted
+	 * timer to the ignore list.
 	 */
 	WRITE_ONCE(timer->it_signal, NULL);
+	spin_unlock(&current->sighand->siglock);
=20
 	unlock_timer(timer, flags);
 	posix_timer_unhash_and_free(timer);
@@ -1091,6 +1067,8 @@ static void itimer_delete(struct k_itimer *timer)
 	}
 	hlist_del(&timer->list);
=20
+	posix_timer_cleanup_ignored(timer);
+
 	/*
 	 * Setting timer::it_signal to NULL is technically not required
 	 * here as nothing can access the timer anymore legitimately via
@@ -1123,6 +1101,19 @@ void exit_itimers(struct task_struct *tsk)
 	/* The timers are not longer accessible via tsk::signal */
 	while (!hlist_empty(&timers))
 		itimer_delete(hlist_entry(timers.first, struct k_itimer, list));
+
+	/*
+	 * There should be no timers on the ignored list. itimer_delete() has
+	 * mopped them up.
+	 */
+	if (!WARN_ON_ONCE(!hlist_empty(&tsk->signal->ignored_posix_timers)))
+		return;
+
+	hlist_move_list(&tsk->signal->ignored_posix_timers, &timers);
+	while (!hlist_empty(&timers)) {
+		posix_timer_cleanup_ignored(hlist_entry(timers.first, struct k_itimer,
+							ignored_list));
+	}
 }
=20
 SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h
index 4784ea65f685..61906f0688c1 100644
--- a/kernel/time/posix-timers.h
+++ b/kernel/time/posix-timers.h
@@ -1,6 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #define TIMER_RETRY 1
=20
+enum posix_timer_state {
+	POSIX_TIMER_DISARMED,
+	POSIX_TIMER_ARMED,
+	POSIX_TIMER_REQUEUE_PENDING,
+};
+
 struct k_clock {
 	int	(*clock_getres)(const clockid_t which_clock,
 				struct timespec64 *tp);
@@ -36,7 +42,7 @@ extern const struct k_clock clock_process;
 extern const struct k_clock clock_thread;
 extern const struct k_clock alarm_clock;
=20
-int posix_timer_queue_signal(struct k_itimer *timr);
+void posix_timer_queue_signal(struct k_itimer *timr);
=20
 void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_settin=
g);
 int common_timer_set(struct k_itimer *timr, int flags,
diff --git a/kernel/time/sleep_timeout.c b/kernel/time/sleep_timeout.c
new file mode 100644
index 000000000000..dfe939f6e4ec
--- /dev/null
+++ b/kernel/time/sleep_timeout.c
@@ -0,0 +1,377 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ *  Kernel internal schedule timeout and sleeping functions
+ */
+
+#include <linux/delay.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+#include <linux/sched/signal.h>
+#include <linux/sched/debug.h>
+
+#include "tick-internal.h"
+
+/*
+ * Since schedule_timeout()'s timer is defined on the stack, it must store
+ * the target task on the stack as well.
+ */
+struct process_timer {
+	struct timer_list timer;
+	struct task_struct *task;
+};
+
+static void process_timeout(struct timer_list *t)
+{
+	struct process_timer *timeout =3D from_timer(timeout, t, timer);
+
+	wake_up_process(timeout->task);
+}
+
+/**
+ * schedule_timeout - sleep until timeout
+ * @timeout: timeout value in jiffies
+ *
+ * Make the current task sleep until @timeout jiffies have elapsed.
+ * The function behavior depends on the current task state
+ * (see also set_current_state() description):
+ *
+ * %TASK_RUNNING - the scheduler is called, but the task does not sleep
+ * at all. That happens because sched_submit_work() does nothing for
+ * tasks in %TASK_RUNNING state.
+ *
+ * %TASK_UNINTERRUPTIBLE - at least @timeout jiffies are guaranteed to
+ * pass before the routine returns unless the current task is explicitly
+ * woken up, (e.g. by wake_up_process()).
+ *
+ * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
+ * delivered to the current task or the current task is explicitly woken
+ * up.
+ *
+ * The current task state is guaranteed to be %TASK_RUNNING when this
+ * routine returns.
+ *
+ * Specifying a @timeout value of %MAX_SCHEDULE_TIMEOUT will schedule
+ * the CPU away without a bound on the timeout. In this case the return
+ * value will be %MAX_SCHEDULE_TIMEOUT.
+ *
+ * Returns: 0 when the timer has expired otherwise the remaining time in
+ * jiffies will be returned. In all cases the return value is guaranteed
+ * to be non-negative.
+ */
+signed long __sched schedule_timeout(signed long timeout)
+{
+	struct process_timer timer;
+	unsigned long expire;
+
+	switch (timeout) {
+	case MAX_SCHEDULE_TIMEOUT:
+		/*
+		 * These two special cases are useful to be comfortable
+		 * in the caller. Nothing more. We could take
+		 * MAX_SCHEDULE_TIMEOUT from one of the negative value
+		 * but I' d like to return a valid offset (>=3D0) to allow
+		 * the caller to do everything it want with the retval.
+		 */
+		schedule();
+		goto out;
+	default:
+		/*
+		 * Another bit of PARANOID. Note that the retval will be
+		 * 0 since no piece of kernel is supposed to do a check
+		 * for a negative retval of schedule_timeout() (since it
+		 * should never happens anyway). You just have the printk()
+		 * that will tell you if something is gone wrong and where.
+		 */
+		if (timeout < 0) {
+			pr_err("%s: wrong timeout value %lx\n", __func__, timeout);
+			dump_stack();
+			__set_current_state(TASK_RUNNING);
+			goto out;
+		}
+	}
+
+	expire =3D timeout + jiffies;
+
+	timer.task =3D current;
+	timer_setup_on_stack(&timer.timer, process_timeout, 0);
+	timer.timer.expires =3D expire;
+	add_timer(&timer.timer);
+	schedule();
+	del_timer_sync(&timer.timer);
+
+	/* Remove the timer from the object tracker */
+	destroy_timer_on_stack(&timer.timer);
+
+	timeout =3D expire - jiffies;
+
+ out:
+	return timeout < 0 ? 0 : timeout;
+}
+EXPORT_SYMBOL(schedule_timeout);
+
+/*
+ * __set_current_state() can be used in schedule_timeout_*() functions, beca=
use
+ * schedule_timeout() calls schedule() unconditionally.
+ */
+
+/**
+ * schedule_timeout_interruptible - sleep until timeout (interruptible)
+ * @timeout: timeout value in jiffies
+ *
+ * See schedule_timeout() for details.
+ *
+ * Task state is set to TASK_INTERRUPTIBLE before starting the timeout.
+ */
+signed long __sched schedule_timeout_interruptible(signed long timeout)
+{
+	__set_current_state(TASK_INTERRUPTIBLE);
+	return schedule_timeout(timeout);
+}
+EXPORT_SYMBOL(schedule_timeout_interruptible);
+
+/**
+ * schedule_timeout_killable - sleep until timeout (killable)
+ * @timeout: timeout value in jiffies
+ *
+ * See schedule_timeout() for details.
+ *
+ * Task state is set to TASK_KILLABLE before starting the timeout.
+ */
+signed long __sched schedule_timeout_killable(signed long timeout)
+{
+	__set_current_state(TASK_KILLABLE);
+	return schedule_timeout(timeout);
+}
+EXPORT_SYMBOL(schedule_timeout_killable);
+
+/**
+ * schedule_timeout_uninterruptible - sleep until timeout (uninterruptible)
+ * @timeout: timeout value in jiffies
+ *
+ * See schedule_timeout() for details.
+ *
+ * Task state is set to TASK_UNINTERRUPTIBLE before starting the timeout.
+ */
+signed long __sched schedule_timeout_uninterruptible(signed long timeout)
+{
+	__set_current_state(TASK_UNINTERRUPTIBLE);
+	return schedule_timeout(timeout);
+}
+EXPORT_SYMBOL(schedule_timeout_uninterruptible);
+
+/**
+ * schedule_timeout_idle - sleep until timeout (idle)
+ * @timeout: timeout value in jiffies
+ *
+ * See schedule_timeout() for details.
+ *
+ * Task state is set to TASK_IDLE before starting the timeout. It is similar=
 to
+ * schedule_timeout_uninterruptible(), except this task will not contribute =
to
+ * load average.
+ */
+signed long __sched schedule_timeout_idle(signed long timeout)
+{
+	__set_current_state(TASK_IDLE);
+	return schedule_timeout(timeout);
+}
+EXPORT_SYMBOL(schedule_timeout_idle);
+
+/**
+ * schedule_hrtimeout_range_clock - sleep until timeout
+ * @expires:	timeout value (ktime_t)
+ * @delta:	slack in expires timeout (ktime_t)
+ * @mode:	timer mode
+ * @clock_id:	timer clock to be used
+ *
+ * Details are explained in schedule_hrtimeout_range() function description =
as
+ * this function is commonly used.
+ */
+int __sched schedule_hrtimeout_range_clock(ktime_t *expires, u64 delta,
+					   const enum hrtimer_mode mode, clockid_t clock_id)
+{
+	struct hrtimer_sleeper t;
+
+	/*
+	 * Optimize when a zero timeout value is given. It does not
+	 * matter whether this is an absolute or a relative time.
+	 */
+	if (expires && *expires =3D=3D 0) {
+		__set_current_state(TASK_RUNNING);
+		return 0;
+	}
+
+	/*
+	 * A NULL parameter means "infinite"
+	 */
+	if (!expires) {
+		schedule();
+		return -EINTR;
+	}
+
+	hrtimer_setup_sleeper_on_stack(&t, clock_id, mode);
+	hrtimer_set_expires_range_ns(&t.timer, *expires, delta);
+	hrtimer_sleeper_start_expires(&t, mode);
+
+	if (likely(t.task))
+		schedule();
+
+	hrtimer_cancel(&t.timer);
+	destroy_hrtimer_on_stack(&t.timer);
+
+	__set_current_state(TASK_RUNNING);
+
+	return !t.task ? 0 : -EINTR;
+}
+EXPORT_SYMBOL_GPL(schedule_hrtimeout_range_clock);
+
+/**
+ * schedule_hrtimeout_range - sleep until timeout
+ * @expires:	timeout value (ktime_t)
+ * @delta:	slack in expires timeout (ktime_t)
+ * @mode:	timer mode
+ *
+ * Make the current task sleep until the given expiry time has
+ * elapsed. The routine will return immediately unless
+ * the current task state has been set (see set_current_state()).
+ *
+ * The @delta argument gives the kernel the freedom to schedule the
+ * actual wakeup to a time that is both power and performance friendly
+ * for regular (non RT/DL) tasks.
+ * The kernel give the normal best effort behavior for "@expires+@delta",
+ * but may decide to fire the timer earlier, but no earlier than @expires.
+ *
+ * You can set the task state as follows -
+ *
+ * %TASK_UNINTERRUPTIBLE - at least @timeout time is guaranteed to
+ * pass before the routine returns unless the current task is explicitly
+ * woken up, (e.g. by wake_up_process()).
+ *
+ * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
+ * delivered to the current task or the current task is explicitly woken
+ * up.
+ *
+ * The current task state is guaranteed to be TASK_RUNNING when this
+ * routine returns.
+ *
+ * Returns: 0 when the timer has expired. If the task was woken before the
+ * timer expired by a signal (only possible in state TASK_INTERRUPTIBLE) or
+ * by an explicit wakeup, it returns -EINTR.
+ */
+int __sched schedule_hrtimeout_range(ktime_t *expires, u64 delta,
+				     const enum hrtimer_mode mode)
+{
+	return schedule_hrtimeout_range_clock(expires, delta, mode,
+					      CLOCK_MONOTONIC);
+}
+EXPORT_SYMBOL_GPL(schedule_hrtimeout_range);
+
+/**
+ * schedule_hrtimeout - sleep until timeout
+ * @expires:	timeout value (ktime_t)
+ * @mode:	timer mode
+ *
+ * See schedule_hrtimeout_range() for details. @delta argument of
+ * schedule_hrtimeout_range() is set to 0 and has therefore no impact.
+ */
+int __sched schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mod=
e)
+{
+	return schedule_hrtimeout_range(expires, 0, mode);
+}
+EXPORT_SYMBOL_GPL(schedule_hrtimeout);
+
+/**
+ * msleep - sleep safely even with waitqueue interruptions
+ * @msecs:	Requested sleep duration in milliseconds
+ *
+ * msleep() uses jiffy based timeouts for the sleep duration. Because of the
+ * design of the timer wheel, the maximum additional percentage delay (slack=
) is
+ * 12.5%. This is only valid for timers which will end up in level 1 or a hi=
gher
+ * level of the timer wheel. For explanation of those 12.5% please check the
+ * detailed description about the basics of the timer wheel.
+ *
+ * The slack of timers which will end up in level 0 depends on sleep duration
+ * (msecs) and HZ configuration and can be calculated in the following way (=
with
+ * the timer wheel design restriction that the slack is not less than 12.5%):
+ *
+ *   ``slack =3D MSECS_PER_TICK / msecs``
+ *
+ * When the allowed slack of the callsite is known, the calculation could be
+ * turned around to find the minimal allowed sleep duration to meet the
+ * constraints. For example:
+ *
+ * * ``HZ=3D1000`` with ``slack=3D25%``: ``MSECS_PER_TICK / slack =3D 1 / (1=
/4) =3D 4``:
+ *   all sleep durations greater or equal 4ms will meet the constraints.
+ * * ``HZ=3D1000`` with ``slack=3D12.5%``: ``MSECS_PER_TICK / slack =3D 1 / =
(1/8) =3D 8``:
+ *   all sleep durations greater or equal 8ms will meet the constraints.
+ * * ``HZ=3D250`` with ``slack=3D25%``: ``MSECS_PER_TICK / slack =3D 4 / (1/=
4) =3D 16``:
+ *   all sleep durations greater or equal 16ms will meet the constraints.
+ * * ``HZ=3D250`` with ``slack=3D12.5%``: ``MSECS_PER_TICK / slack =3D 4 / (=
1/8) =3D 32``:
+ *   all sleep durations greater or equal 32ms will meet the constraints.
+ *
+ * See also the signal aware variant msleep_interruptible().
+ */
+void msleep(unsigned int msecs)
+{
+	unsigned long timeout =3D msecs_to_jiffies(msecs);
+
+	while (timeout)
+		timeout =3D schedule_timeout_uninterruptible(timeout);
+}
+EXPORT_SYMBOL(msleep);
+
+/**
+ * msleep_interruptible - sleep waiting for signals
+ * @msecs:	Requested sleep duration in milliseconds
+ *
+ * See msleep() for some basic information.
+ *
+ * The difference between msleep() and msleep_interruptible() is that the sl=
eep
+ * could be interrupted by a signal delivery and then returns early.
+ *
+ * Returns: The remaining time of the sleep duration transformed to msecs (s=
ee
+ * schedule_timeout() for details).
+ */
+unsigned long msleep_interruptible(unsigned int msecs)
+{
+	unsigned long timeout =3D msecs_to_jiffies(msecs);
+
+	while (timeout && !signal_pending(current))
+		timeout =3D schedule_timeout_interruptible(timeout);
+	return jiffies_to_msecs(timeout);
+}
+EXPORT_SYMBOL(msleep_interruptible);
+
+/**
+ * usleep_range_state - Sleep for an approximate time in a given state
+ * @min:	Minimum time in usecs to sleep
+ * @max:	Maximum time in usecs to sleep
+ * @state:	State of the current task that will be while sleeping
+ *
+ * usleep_range_state() sleeps at least for the minimum specified time but n=
ot
+ * longer than the maximum specified amount of time. The range might reduce
+ * power usage by allowing hrtimers to coalesce an already scheduled interru=
pt
+ * with this hrtimer. In the worst case, an interrupt is scheduled for the u=
pper
+ * bound.
+ *
+ * The sleeping task is set to the specified state before starting the sleep.
+ *
+ * In non-atomic context where the exact wakeup time is flexible, use
+ * usleep_range() or its variants instead of udelay(). The sleep improves
+ * responsiveness by avoiding the CPU-hogging busy-wait of udelay().
+ */
+void __sched usleep_range_state(unsigned long min, unsigned long max, unsign=
ed int state)
+{
+	ktime_t exp =3D ktime_add_us(ktime_get(), min);
+	u64 delta =3D (u64)(max - min) * NSEC_PER_USEC;
+
+	if (WARN_ON_ONCE(max < min))
+		delta =3D 0;
+
+	for (;;) {
+		__set_current_state(state);
+		/* Do not return before the requested sleep time has elapsed */
+		if (!schedule_hrtimeout_range(&exp, delta, HRTIMER_MODE_ABS))
+			break;
+	}
+}
+EXPORT_SYMBOL(usleep_range_state);
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index 5f2105e637bd..faac36de35b9 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -25,6 +25,7 @@ extern int tick_do_timer_cpu __read_mostly;
 extern void tick_setup_periodic(struct clock_event_device *dev, int broadcas=
t);
 extern void tick_handle_periodic(struct clock_event_device *dev);
 extern void tick_check_new_device(struct clock_event_device *dev);
+extern void tick_offline_cpu(unsigned int cpu);
 extern void tick_shutdown(unsigned int cpu);
 extern void tick_suspend(void);
 extern void tick_resume(void);
@@ -142,10 +143,8 @@ static inline bool tick_broadcast_oneshot_available(void=
) { return tick_oneshot_
 #endif /* !(BROADCAST && ONESHOT) */
=20
 #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_HOTPLUG_=
CPU)
-extern void tick_offline_cpu(unsigned int cpu);
 extern void tick_broadcast_offline(unsigned int cpu);
 #else
-static inline void tick_offline_cpu(unsigned int cpu) { }
 static inline void tick_broadcast_offline(unsigned int cpu) { }
 #endif
=20
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 753a184c7090..9f90c7333b1d 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -311,14 +311,6 @@ static enum hrtimer_restart tick_nohz_handler(struct hrt=
imer *timer)
 	return HRTIMER_RESTART;
 }
=20
-static void tick_sched_timer_cancel(struct tick_sched *ts)
-{
-	if (tick_sched_flag_test(ts, TS_FLAG_HIGHRES))
-		hrtimer_cancel(&ts->sched_timer);
-	else if (tick_sched_flag_test(ts, TS_FLAG_NOHZ))
-		tick_program_event(KTIME_MAX, 1);
-}
-
 #ifdef CONFIG_NO_HZ_FULL
 cpumask_var_t tick_nohz_full_mask;
 EXPORT_SYMBOL_GPL(tick_nohz_full_mask);
@@ -1055,7 +1047,10 @@ static void tick_nohz_stop_tick(struct tick_sched *ts,=
 int cpu)
 	 * the tick timer.
 	 */
 	if (unlikely(expires =3D=3D KTIME_MAX)) {
-		tick_sched_timer_cancel(ts);
+		if (tick_sched_flag_test(ts, TS_FLAG_HIGHRES))
+			hrtimer_cancel(&ts->sched_timer);
+		else
+			tick_program_event(KTIME_MAX, 1);
 		return;
 	}
=20
@@ -1604,21 +1599,13 @@ void tick_setup_sched_timer(bool hrtimer)
  */
 void tick_sched_timer_dying(int cpu)
 {
-	struct tick_device *td =3D &per_cpu(tick_cpu_device, cpu);
 	struct tick_sched *ts =3D &per_cpu(tick_cpu_sched, cpu);
-	struct clock_event_device *dev =3D td->evtdev;
 	ktime_t idle_sleeptime, iowait_sleeptime;
 	unsigned long idle_calls, idle_sleeps;
=20
 	/* This must happen before hrtimers are migrated! */
-	tick_sched_timer_cancel(ts);
-
-	/*
-	 * If the clockevents doesn't support CLOCK_EVT_STATE_ONESHOT_STOPPED,
-	 * make sure not to call low-res tick handler.
-	 */
-	if (tick_sched_flag_test(ts, TS_FLAG_NOHZ))
-		dev->event_handler =3D clockevents_handle_noop;
+	if (tick_sched_flag_test(ts, TS_FLAG_HIGHRES))
+		hrtimer_cancel(&ts->sched_timer);
=20
 	idle_sleeptime =3D ts->idle_sleeptime;
 	iowait_sleeptime =3D ts->iowait_sleeptime;
diff --git a/kernel/time/time.c b/kernel/time/time.c
index 642647f5046b..1b69caa87480 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -556,9 +556,9 @@ EXPORT_SYMBOL(ns_to_timespec64);
  * - all other values are converted to jiffies by either multiplying
  *   the input value by a factor or dividing it with a factor and
  *   handling any 32-bit overflows.
- *   for the details see __msecs_to_jiffies()
+ *   for the details see _msecs_to_jiffies()
  *
- * __msecs_to_jiffies() checks for the passed in value being a constant
+ * msecs_to_jiffies() checks for the passed in value being a constant
  * via __builtin_constant_p() allowing gcc to eliminate most of the
  * code, __msecs_to_jiffies() is called if the value passed does not
  * allow constant folding and the actual conversion must be done at
@@ -866,7 +866,7 @@ struct timespec64 timespec64_add_safe(const struct timesp=
ec64 lhs,
  *
  * Handles compat or 32-bit modes.
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int get_timespec64(struct timespec64 *ts,
 		   const struct __kernel_timespec __user *uts)
@@ -897,7 +897,7 @@ EXPORT_SYMBOL_GPL(get_timespec64);
  * @ts: input &struct timespec64
  * @uts: user's &struct __kernel_timespec
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int put_timespec64(const struct timespec64 *ts,
 		   struct __kernel_timespec __user *uts)
@@ -944,7 +944,7 @@ static int __put_old_timespec32(const struct timespec64 *=
ts64,
  *
  * Handles X86_X32_ABI compatibility conversion.
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int get_old_timespec32(struct timespec64 *ts, const void __user *uts)
 {
@@ -963,7 +963,7 @@ EXPORT_SYMBOL_GPL(get_old_timespec32);
  *
  * Handles X86_X32_ABI compatibility conversion.
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int put_old_timespec32(const struct timespec64 *ts, void __user *uts)
 {
@@ -979,7 +979,7 @@ EXPORT_SYMBOL_GPL(put_old_timespec32);
  * @it: destination &struct itimerspec64
  * @uit: user's &struct __kernel_itimerspec
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int get_itimerspec64(struct itimerspec64 *it,
 			const struct __kernel_itimerspec __user *uit)
@@ -1002,7 +1002,7 @@ EXPORT_SYMBOL_GPL(get_itimerspec64);
  * @it: input &struct itimerspec64
  * @uit: user's &struct __kernel_itimerspec
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int put_itimerspec64(const struct itimerspec64 *it,
 			struct __kernel_itimerspec __user *uit)
@@ -1024,7 +1024,7 @@ EXPORT_SYMBOL_GPL(put_itimerspec64);
  * @its: destination &struct itimerspec64
  * @uits: user's &struct old_itimerspec32
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int get_old_itimerspec32(struct itimerspec64 *its,
 			const struct old_itimerspec32 __user *uits)
@@ -1043,7 +1043,7 @@ EXPORT_SYMBOL_GPL(get_old_itimerspec32);
  * @its: input &struct itimerspec64
  * @uits: user's &struct old_itimerspec32
  *
- * Return: %0 on success or negative errno on error
+ * Return: 0 on success or negative errno on error
  */
 int put_old_itimerspec32(const struct itimerspec64 *its,
 			struct old_itimerspec32 __user *uits)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 7e6f409bf311..d115adebc418 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -30,8 +30,9 @@
 #include "timekeeping_internal.h"
=20
 #define TK_CLEAR_NTP		(1 << 0)
-#define TK_MIRROR		(1 << 1)
-#define TK_CLOCK_WAS_SET	(1 << 2)
+#define TK_CLOCK_WAS_SET	(1 << 1)
+
+#define TK_UPDATE_ALL		(TK_CLEAR_NTP | TK_CLOCK_WAS_SET)
=20
 enum timekeeping_adv_mode {
 	/* Update timekeeper when a tick has passed */
@@ -41,20 +42,18 @@ enum timekeeping_adv_mode {
 	TK_ADV_FREQ
 };
=20
-DEFINE_RAW_SPINLOCK(timekeeper_lock);
-
 /*
  * The most important data for readout fits into a single 64 byte
  * cache line.
  */
-static struct {
+struct tk_data {
 	seqcount_raw_spinlock_t	seq;
 	struct timekeeper	timekeeper;
-} tk_core ____cacheline_aligned =3D {
-	.seq =3D SEQCNT_RAW_SPINLOCK_ZERO(tk_core.seq, &timekeeper_lock),
-};
+	struct timekeeper	shadow_timekeeper;
+	raw_spinlock_t		lock;
+} ____cacheline_aligned;
=20
-static struct timekeeper shadow_timekeeper;
+static struct tk_data tk_core;
=20
 /* flag for if timekeeping is suspended */
 int __read_mostly timekeeping_suspended;
@@ -114,6 +113,36 @@ static struct tk_fast tk_fast_raw  ____cacheline_aligned=
 =3D {
 	.base[1] =3D FAST_TK_INIT,
 };
=20
+unsigned long timekeeper_lock_irqsave(void)
+{
+	unsigned long flags;
+
+	raw_spin_lock_irqsave(&tk_core.lock, flags);
+	return flags;
+}
+
+void timekeeper_unlock_irqrestore(unsigned long flags)
+{
+	raw_spin_unlock_irqrestore(&tk_core.lock, flags);
+}
+
+/*
+ * Multigrain timestamps require tracking the latest fine-grained timestamp
+ * that has been issued, and never returning a coarse-grained timestamp that=
 is
+ * earlier than that value.
+ *
+ * mg_floor represents the latest fine-grained time that has been handed out=
 as
+ * a file timestamp on the system. This is tracked as a monotonic ktime_t, a=
nd
+ * converted to a realtime clock value on an as-needed basis.
+ *
+ * Maintaining mg_floor ensures the multigrain interfaces never issue a
+ * timestamp earlier than one that has been previously issued.
+ *
+ * The exception to this rule is when there is a backward realtime clock jum=
p. If
+ * such an event occurs, a timestamp can appear to be earlier than a previou=
s one.
+ */
+static __cacheline_aligned_in_smp atomic64_t mg_floor;
+
 static inline void tk_normalize_xtime(struct timekeeper *tk)
 {
 	while (tk->tkr_mono.xtime_nsec >=3D ((u64)NSEC_PER_SEC << tk->tkr_mono.shif=
t)) {
@@ -161,13 +190,15 @@ static void tk_set_wall_to_mono(struct timekeeper *tk, =
struct timespec64 wtm)
 	WARN_ON_ONCE(tk->offs_real !=3D timespec64_to_ktime(tmp));
 	tk->wall_to_monotonic =3D wtm;
 	set_normalized_timespec64(&tmp, -wtm.tv_sec, -wtm.tv_nsec);
-	tk->offs_real =3D timespec64_to_ktime(tmp);
-	tk->offs_tai =3D ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0));
+	/* Paired with READ_ONCE() in ktime_mono_to_any() */
+	WRITE_ONCE(tk->offs_real, timespec64_to_ktime(tmp));
+	WRITE_ONCE(tk->offs_tai, ktime_add(tk->offs_real, ktime_set(tk->tai_offset,=
 0)));
 }
=20
 static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta)
 {
-	tk->offs_boot =3D ktime_add(tk->offs_boot, delta);
+	/* Paired with READ_ONCE() in ktime_mono_to_any() */
+	WRITE_ONCE(tk->offs_boot, ktime_add(tk->offs_boot, delta));
 	/*
 	 * Timespec representation for VDSO update to avoid 64bit division
 	 * on every update.
@@ -184,7 +215,7 @@ static inline void tk_update_sleep_time(struct timekeeper=
 *tk, ktime_t delta)
  * the tkr's clocksource may change between the read reference, and the
  * clock reference passed to the read function.  This can cause crashes if
  * the wrong clocksource is passed to the wrong read function.
- * This isn't necessary to use when holding the timekeeper_lock or doing
+ * This isn't necessary to use when holding the tk_core.lock or doing
  * a read of the fast-timekeeper tkrs (which is protected by its own locking
  * and update logic).
  */
@@ -195,97 +226,6 @@ static inline u64 tk_clock_read(const struct tk_read_bas=
e *tkr)
 	return clock->read(clock);
 }
=20
-#ifdef CONFIG_DEBUG_TIMEKEEPING
-#define WARNING_FREQ (HZ*300) /* 5 minute rate-limiting */
-
-static void timekeeping_check_update(struct timekeeper *tk, u64 offset)
-{
-
-	u64 max_cycles =3D tk->tkr_mono.clock->max_cycles;
-	const char *name =3D tk->tkr_mono.clock->name;
-
-	if (offset > max_cycles) {
-		printk_deferred("WARNING: timekeeping: Cycle offset (%lld) is larger than =
allowed by the '%s' clock's max_cycles value (%lld): time overflow danger\n",
-				offset, name, max_cycles);
-		printk_deferred("         timekeeping: Your kernel is sick, but tries to c=
ope by capping time updates\n");
-	} else {
-		if (offset > (max_cycles >> 1)) {
-			printk_deferred("INFO: timekeeping: Cycle offset (%lld) is larger than th=
e '%s' clock's 50%% safety margin (%lld)\n",
-					offset, name, max_cycles >> 1);
-			printk_deferred("      timekeeping: Your kernel is still fine, but is fee=
ling a bit nervous\n");
-		}
-	}
-
-	if (tk->underflow_seen) {
-		if (jiffies - tk->last_warning > WARNING_FREQ) {
-			printk_deferred("WARNING: Underflow in clocksource '%s' observed, time up=
date ignored.\n", name);
-			printk_deferred("         Please report this, consider using a different =
clocksource, if possible.\n");
-			printk_deferred("         Your kernel is probably still fine.\n");
-			tk->last_warning =3D jiffies;
-		}
-		tk->underflow_seen =3D 0;
-	}
-
-	if (tk->overflow_seen) {
-		if (jiffies - tk->last_warning > WARNING_FREQ) {
-			printk_deferred("WARNING: Overflow in clocksource '%s' observed, time upd=
ate capped.\n", name);
-			printk_deferred("         Please report this, consider using a different =
clocksource, if possible.\n");
-			printk_deferred("         Your kernel is probably still fine.\n");
-			tk->last_warning =3D jiffies;
-		}
-		tk->overflow_seen =3D 0;
-	}
-}
-
-static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u=
64 cycles);
-
-static inline u64 timekeeping_debug_get_ns(const struct tk_read_base *tkr)
-{
-	struct timekeeper *tk =3D &tk_core.timekeeper;
-	u64 now, last, mask, max, delta;
-	unsigned int seq;
-
-	/*
-	 * Since we're called holding a seqcount, the data may shift
-	 * under us while we're doing the calculation. This can cause
-	 * false positives, since we'd note a problem but throw the
-	 * results away. So nest another seqcount here to atomically
-	 * grab the points we are checking with.
-	 */
-	do {
-		seq =3D read_seqcount_begin(&tk_core.seq);
-		now =3D tk_clock_read(tkr);
-		last =3D tkr->cycle_last;
-		mask =3D tkr->mask;
-		max =3D tkr->clock->max_cycles;
-	} while (read_seqcount_retry(&tk_core.seq, seq));
-
-	delta =3D clocksource_delta(now, last, mask);
-
-	/*
-	 * Try to catch underflows by checking if we are seeing small
-	 * mask-relative negative values.
-	 */
-	if (unlikely((~delta & mask) < (mask >> 3)))
-		tk->underflow_seen =3D 1;
-
-	/* Check for multiplication overflows */
-	if (unlikely(delta > max))
-		tk->overflow_seen =3D 1;
-
-	/* timekeeping_cycles_to_ns() handles both under and overflow */
-	return timekeeping_cycles_to_ns(tkr, now);
-}
-#else
-static inline void timekeeping_check_update(struct timekeeper *tk, u64 offse=
t)
-{
-}
-static inline u64 timekeeping_debug_get_ns(const struct tk_read_base *tkr)
-{
-	BUG();
-}
-#endif
-
 /**
  * tk_setup_internals - Set up internals to use clocksource clock.
  *
@@ -390,19 +330,11 @@ static inline u64 timekeeping_cycles_to_ns(const struct=
 tk_read_base *tkr, u64 c
 	return ((delta * tkr->mult) + tkr->xtime_nsec) >> tkr->shift;
 }
=20
-static __always_inline u64 __timekeeping_get_ns(const struct tk_read_base *t=
kr)
+static __always_inline u64 timekeeping_get_ns(const struct tk_read_base *tkr)
 {
 	return timekeeping_cycles_to_ns(tkr, tk_clock_read(tkr));
 }
=20
-static inline u64 timekeeping_get_ns(const struct tk_read_base *tkr)
-{
-	if (IS_ENABLED(CONFIG_DEBUG_TIMEKEEPING))
-		return timekeeping_debug_get_ns(tkr);
-
-	return __timekeeping_get_ns(tkr);
-}
-
 /**
  * update_fast_timekeeper - Update the fast and NMI safe monotonic timekeepe=
r.
  * @tkr: Timekeeping readout base from which we take the update
@@ -446,7 +378,7 @@ static __always_inline u64 __ktime_get_fast_ns(struct tk_=
fast *tkf)
 		seq =3D raw_read_seqcount_latch(&tkf->seq);
 		tkr =3D tkf->base + (seq & 0x01);
 		now =3D ktime_to_ns(tkr->base);
-		now +=3D __timekeeping_get_ns(tkr);
+		now +=3D timekeeping_get_ns(tkr);
 	} while (raw_read_seqcount_latch_retry(&tkf->seq, seq));
=20
 	return now;
@@ -517,7 +449,7 @@ EXPORT_SYMBOL_GPL(ktime_get_raw_fast_ns);
  *    timekeeping_inject_sleeptime64()
  *    __timekeeping_inject_sleeptime(tk, delta);
  *                                                 timestamp();
- *    timekeeping_update(tk, TK_CLEAR_NTP...);
+ *    timekeeping_update_staged(tkd, TK_CLEAR_NTP...);
  *
  * (2) On 32-bit systems, the 64-bit boot offset (tk->offs_boot) may be
  * partially updated.  Since the tk->offs_boot update is a rare event, this
@@ -562,7 +494,7 @@ static __always_inline u64 __ktime_get_real_fast(struct t=
k_fast *tkf, u64 *mono)
 		tkr =3D tkf->base + (seq & 0x01);
 		basem =3D ktime_to_ns(tkr->base);
 		baser =3D ktime_to_ns(tkr->base_real);
-		delta =3D __timekeeping_get_ns(tkr);
+		delta =3D timekeeping_get_ns(tkr);
 	} while (raw_read_seqcount_latch_retry(&tkf->seq, seq));
=20
 	if (mono)
@@ -676,13 +608,11 @@ static void update_pvclock_gtod(struct timekeeper *tk, =
bool was_set)
 int pvclock_gtod_register_notifier(struct notifier_block *nb)
 {
 	struct timekeeper *tk =3D &tk_core.timekeeper;
-	unsigned long flags;
 	int ret;
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
+	guard(raw_spinlock_irqsave)(&tk_core.lock);
 	ret =3D raw_notifier_chain_register(&pvclock_gtod_chain, nb);
 	update_pvclock_gtod(tk, true);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
=20
 	return ret;
 }
@@ -695,14 +625,8 @@ EXPORT_SYMBOL_GPL(pvclock_gtod_register_notifier);
  */
 int pvclock_gtod_unregister_notifier(struct notifier_block *nb)
 {
-	unsigned long flags;
-	int ret;
-
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	ret =3D raw_notifier_chain_unregister(&pvclock_gtod_chain, nb);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
-
-	return ret;
+	guard(raw_spinlock_irqsave)(&tk_core.lock);
+	return raw_notifier_chain_unregister(&pvclock_gtod_chain, nb);
 }
 EXPORT_SYMBOL_GPL(pvclock_gtod_unregister_notifier);
=20
@@ -717,6 +641,18 @@ static inline void tk_update_leap_state(struct timekeepe=
r *tk)
 		tk->next_leap_ktime =3D ktime_sub(tk->next_leap_ktime, tk->offs_real);
 }
=20
+/*
+ * Leap state update for both shadow and the real timekeeper
+ * Separate to spare a full memcpy() of the timekeeper.
+ */
+static void tk_update_leap_state_all(struct tk_data *tkd)
+{
+	write_seqcount_begin(&tkd->seq);
+	tk_update_leap_state(&tkd->shadow_timekeeper);
+	tkd->timekeeper.next_leap_ktime =3D tkd->shadow_timekeeper.next_leap_ktime;
+	write_seqcount_end(&tkd->seq);
+}
+
 /*
  * Update the ktime_t based scalar nsec members of the timekeeper
  */
@@ -750,9 +686,30 @@ static inline void tk_update_ktime_data(struct timekeepe=
r *tk)
 	tk->tkr_raw.base =3D ns_to_ktime(tk->raw_sec * NSEC_PER_SEC);
 }
=20
-/* must hold timekeeper_lock */
-static void timekeeping_update(struct timekeeper *tk, unsigned int action)
+/*
+ * Restore the shadow timekeeper from the real timekeeper.
+ */
+static void timekeeping_restore_shadow(struct tk_data *tkd)
+{
+	lockdep_assert_held(&tkd->lock);
+	memcpy(&tkd->shadow_timekeeper, &tkd->timekeeper, sizeof(tkd->timekeeper));
+}
+
+static void timekeeping_update_from_shadow(struct tk_data *tkd, unsigned int=
 action)
 {
+	struct timekeeper *tk =3D &tk_core.shadow_timekeeper;
+
+	lockdep_assert_held(&tkd->lock);
+
+	/*
+	 * Block out readers before running the updates below because that
+	 * updates VDSO and other time related infrastructure. Not blocking
+	 * the readers might let a reader see time going backwards when
+	 * reading from the VDSO after the VDSO update and then reading in
+	 * the kernel from the timekeeper before that got updated.
+	 */
+	write_seqcount_begin(&tkd->seq);
+
 	if (action & TK_CLEAR_NTP) {
 		tk->ntp_error =3D 0;
 		ntp_clear();
@@ -770,14 +727,17 @@ static void timekeeping_update(struct timekeeper *tk, u=
nsigned int action)
=20
 	if (action & TK_CLOCK_WAS_SET)
 		tk->clock_was_set_seq++;
+
 	/*
-	 * The mirroring of the data to the shadow-timekeeper needs
-	 * to happen last here to ensure we don't over-write the
-	 * timekeeper structure on the next update with stale data
+	 * Update the real timekeeper.
+	 *
+	 * We could avoid this memcpy() by switching pointers, but that has
+	 * the downside that the reader side does not longer benefit from
+	 * the cacheline optimized data layout of the timekeeper and requires
+	 * another indirection.
 	 */
-	if (action & TK_MIRROR)
-		memcpy(&shadow_timekeeper, &tk_core.timekeeper,
-		       sizeof(tk_core.timekeeper));
+	memcpy(&tkd->timekeeper, tk, sizeof(*tk));
+	write_seqcount_end(&tkd->seq);
 }
=20
 /**
@@ -930,6 +890,14 @@ ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets=
 offs)
 	unsigned int seq;
 	ktime_t tconv;
=20
+	if (IS_ENABLED(CONFIG_64BIT)) {
+		/*
+		 * Paired with WRITE_ONCE()s in tk_set_wall_to_mono() and
+		 * tk_update_sleep_time().
+		 */
+		return ktime_add(tmono, READ_ONCE(*offset));
+	}
+
 	do {
 		seq =3D read_seqcount_begin(&tk_core.seq);
 		tconv =3D ktime_add(tmono, *offset);
@@ -1060,6 +1028,7 @@ void ktime_get_snapshot(struct system_time_snapshot *sy=
stime_snapshot)
 	unsigned int seq;
 	ktime_t base_raw;
 	ktime_t base_real;
+	ktime_t base_boot;
 	u64 nsec_raw;
 	u64 nsec_real;
 	u64 now;
@@ -1074,6 +1043,8 @@ void ktime_get_snapshot(struct system_time_snapshot *sy=
stime_snapshot)
 		systime_snapshot->clock_was_set_seq =3D tk->clock_was_set_seq;
 		base_real =3D ktime_add(tk->tkr_mono.base,
 				      tk_core.timekeeper.offs_real);
+		base_boot =3D ktime_add(tk->tkr_mono.base,
+				      tk_core.timekeeper.offs_boot);
 		base_raw =3D tk->tkr_raw.base;
 		nsec_real =3D timekeeping_cycles_to_ns(&tk->tkr_mono, now);
 		nsec_raw  =3D timekeeping_cycles_to_ns(&tk->tkr_raw, now);
@@ -1081,6 +1052,7 @@ void ktime_get_snapshot(struct system_time_snapshot *sy=
stime_snapshot)
=20
 	systime_snapshot->cycles =3D now;
 	systime_snapshot->real =3D ktime_add_ns(base_real, nsec_real);
+	systime_snapshot->boot =3D ktime_add_ns(base_boot, nsec_real);
 	systime_snapshot->raw =3D ktime_add_ns(base_raw, nsec_raw);
 }
 EXPORT_SYMBOL_GPL(ktime_get_snapshot);
@@ -1440,45 +1412,35 @@ EXPORT_SYMBOL_GPL(timekeeping_clocksource_has_base);
  */
 int do_settimeofday64(const struct timespec64 *ts)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
 	struct timespec64 ts_delta, xt;
-	unsigned long flags;
-	int ret =3D 0;
=20
 	if (!timespec64_valid_settod(ts))
 		return -EINVAL;
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-
-	timekeeping_forward_now(tk);
+	scoped_guard (raw_spinlock_irqsave, &tk_core.lock) {
+		struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
=20
-	xt =3D tk_xtime(tk);
-	ts_delta =3D timespec64_sub(*ts, xt);
-
-	if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) {
-		ret =3D -EINVAL;
-		goto out;
-	}
+		timekeeping_forward_now(tks);
=20
-	tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts_delta));
+		xt =3D tk_xtime(tks);
+		ts_delta =3D timespec64_sub(*ts, xt);
=20
-	tk_set_xtime(tk, ts);
-out:
-	timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
+		if (timespec64_compare(&tks->wall_to_monotonic, &ts_delta) > 0) {
+			timekeeping_restore_shadow(&tk_core);
+			return -EINVAL;
+		}
=20
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+		tk_set_wall_to_mono(tks, timespec64_sub(tks->wall_to_monotonic, ts_delta));
+		tk_set_xtime(tks, ts);
+		timekeeping_update_from_shadow(&tk_core, TK_UPDATE_ALL);
+	}
=20
 	/* Signal hrtimers about time change */
 	clock_was_set(CLOCK_SET_WALL);
=20
-	if (!ret) {
-		audit_tk_injoffset(ts_delta);
-		add_device_randomness(ts, sizeof(*ts));
-	}
-
-	return ret;
+	audit_tk_injoffset(ts_delta);
+	add_device_randomness(ts, sizeof(*ts));
+	return 0;
 }
 EXPORT_SYMBOL(do_settimeofday64);
=20
@@ -1490,40 +1452,31 @@ EXPORT_SYMBOL(do_settimeofday64);
  */
 static int timekeeping_inject_offset(const struct timespec64 *ts)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
-	unsigned long flags;
-	struct timespec64 tmp;
-	int ret =3D 0;
-
 	if (ts->tv_nsec < 0 || ts->tv_nsec >=3D NSEC_PER_SEC)
 		return -EINVAL;
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-
-	timekeeping_forward_now(tk);
-
-	/* Make sure the proposed value is valid */
-	tmp =3D timespec64_add(tk_xtime(tk), *ts);
-	if (timespec64_compare(&tk->wall_to_monotonic, ts) > 0 ||
-	    !timespec64_valid_settod(&tmp)) {
-		ret =3D -EINVAL;
-		goto error;
-	}
+	scoped_guard (raw_spinlock_irqsave, &tk_core.lock) {
+		struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
+		struct timespec64 tmp;
=20
-	tk_xtime_add(tk, ts);
-	tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *ts));
+		timekeeping_forward_now(tks);
=20
-error: /* even if we error out, we forwarded the time, so call update */
-	timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
+		/* Make sure the proposed value is valid */
+		tmp =3D timespec64_add(tk_xtime(tks), *ts);
+		if (timespec64_compare(&tks->wall_to_monotonic, ts) > 0 ||
+		    !timespec64_valid_settod(&tmp)) {
+			timekeeping_restore_shadow(&tk_core);
+			return -EINVAL;
+		}
=20
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+		tk_xtime_add(tks, ts);
+		tk_set_wall_to_mono(tks, timespec64_sub(tks->wall_to_monotonic, *ts));
+		timekeeping_update_from_shadow(&tk_core, TK_UPDATE_ALL);
+	}
=20
 	/* Signal hrtimers about time change */
 	clock_was_set(CLOCK_SET_WALL);
-
-	return ret;
+	return 0;
 }
=20
 /*
@@ -1576,43 +1529,34 @@ static void __timekeeping_set_tai_offset(struct timek=
eeper *tk, s32 tai_offset)
  */
 static int change_clocksource(void *data)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
-	struct clocksource *new, *old =3D NULL;
-	unsigned long flags;
-	bool change =3D false;
-
-	new =3D (struct clocksource *) data;
+	struct clocksource *new =3D data, *old =3D NULL;
=20
 	/*
-	 * If the cs is in module, get a module reference. Succeeds
-	 * for built-in code (owner =3D=3D NULL) as well.
+	 * If the clocksource is in a module, get a module reference.
+	 * Succeeds for built-in code (owner =3D=3D NULL) as well. Abort if the
+	 * reference can't be acquired.
 	 */
-	if (try_module_get(new->owner)) {
-		if (!new->enable || new->enable(new) =3D=3D 0)
-			change =3D true;
-		else
-			module_put(new->owner);
-	}
-
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-
-	timekeeping_forward_now(tk);
+	if (!try_module_get(new->owner))
+		return 0;
=20
-	if (change) {
-		old =3D tk->tkr_mono.clock;
-		tk_setup_internals(tk, new);
+	/* Abort if the device can't be enabled */
+	if (new->enable && new->enable(new) !=3D 0) {
+		module_put(new->owner);
+		return 0;
 	}
=20
-	timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
+	scoped_guard (raw_spinlock_irqsave, &tk_core.lock) {
+		struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
=20
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+		timekeeping_forward_now(tks);
+		old =3D tks->tkr_mono.clock;
+		tk_setup_internals(tks, new);
+		timekeeping_update_from_shadow(&tk_core, TK_UPDATE_ALL);
+	}
=20
 	if (old) {
 		if (old->disable)
 			old->disable(old);
-
 		module_put(old->owner);
 	}
=20
@@ -1737,6 +1681,12 @@ read_persistent_wall_and_boot_offset(struct timespec64=
 *wall_time,
 	*boot_offset =3D ns_to_timespec64(local_clock());
 }
=20
+static __init void tkd_basic_setup(struct tk_data *tkd)
+{
+	raw_spin_lock_init(&tkd->lock);
+	seqcount_raw_spinlock_init(&tkd->seq, &tkd->lock);
+}
+
 /*
  * Flag reflecting whether timekeeping_resume() has injected sleeptime.
  *
@@ -1761,9 +1711,10 @@ static bool persistent_clock_exists;
 void __init timekeeping_init(void)
 {
 	struct timespec64 wall_time, boot_offset, wall_to_mono;
-	struct timekeeper *tk =3D &tk_core.timekeeper;
+	struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
 	struct clocksource *clock;
-	unsigned long flags;
+
+	tkd_basic_setup(&tk_core);
=20
 	read_persistent_wall_and_boot_offset(&wall_time, &boot_offset);
 	if (timespec64_valid_settod(&wall_time) &&
@@ -1783,24 +1734,21 @@ void __init timekeeping_init(void)
 	 */
 	wall_to_mono =3D timespec64_sub(boot_offset, wall_time);
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
+	guard(raw_spinlock_irqsave)(&tk_core.lock);
+
 	ntp_init();
=20
 	clock =3D clocksource_default_clock();
 	if (clock->enable)
 		clock->enable(clock);
-	tk_setup_internals(tk, clock);
+	tk_setup_internals(tks, clock);
=20
-	tk_set_xtime(tk, &wall_time);
-	tk->raw_sec =3D 0;
+	tk_set_xtime(tks, &wall_time);
+	tks->raw_sec =3D 0;
=20
-	tk_set_wall_to_mono(tk, wall_to_mono);
+	tk_set_wall_to_mono(tks, wall_to_mono);
=20
-	timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
-
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+	timekeeping_update_from_shadow(&tk_core, TK_CLOCK_WAS_SET);
 }
=20
 /* time in seconds when suspend began for persistent clock */
@@ -1878,22 +1826,14 @@ bool timekeeping_rtc_skipsuspend(void)
  */
 void timekeeping_inject_sleeptime64(const struct timespec64 *delta)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-
-	suspend_timing_needed =3D false;
-
-	timekeeping_forward_now(tk);
+	scoped_guard(raw_spinlock_irqsave, &tk_core.lock) {
+		struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
=20
-	__timekeeping_inject_sleeptime(tk, delta);
-
-	timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
-
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+		suspend_timing_needed =3D false;
+		timekeeping_forward_now(tks);
+		__timekeeping_inject_sleeptime(tks, delta);
+		timekeeping_update_from_shadow(&tk_core, TK_UPDATE_ALL);
+	}
=20
 	/* Signal hrtimers about time change */
 	clock_was_set(CLOCK_SET_WALL | CLOCK_SET_BOOT);
@@ -1905,20 +1845,19 @@ void timekeeping_inject_sleeptime64(const struct time=
spec64 *delta)
  */
 void timekeeping_resume(void)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
-	struct clocksource *clock =3D tk->tkr_mono.clock;
-	unsigned long flags;
+	struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
+	struct clocksource *clock =3D tks->tkr_mono.clock;
 	struct timespec64 ts_new, ts_delta;
-	u64 cycle_now, nsec;
 	bool inject_sleeptime =3D false;
+	u64 cycle_now, nsec;
+	unsigned long flags;
=20
 	read_persistent_clock64(&ts_new);
=20
 	clockevents_resume();
 	clocksource_resume();
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
+	raw_spin_lock_irqsave(&tk_core.lock, flags);
=20
 	/*
 	 * After system resumes, we need to calculate the suspended time and
@@ -1932,7 +1871,7 @@ void timekeeping_resume(void)
 	 * The less preferred source will only be tried if there is no better
 	 * usable source. The rtc part is handled separately in rtc core code.
 	 */
-	cycle_now =3D tk_clock_read(&tk->tkr_mono);
+	cycle_now =3D tk_clock_read(&tks->tkr_mono);
 	nsec =3D clocksource_stop_suspend_timing(clock, cycle_now);
 	if (nsec > 0) {
 		ts_delta =3D ns_to_timespec64(nsec);
@@ -1944,18 +1883,17 @@ void timekeeping_resume(void)
=20
 	if (inject_sleeptime) {
 		suspend_timing_needed =3D false;
-		__timekeeping_inject_sleeptime(tk, &ts_delta);
+		__timekeeping_inject_sleeptime(tks, &ts_delta);
 	}
=20
 	/* Re-base the last cycle value */
-	tk->tkr_mono.cycle_last =3D cycle_now;
-	tk->tkr_raw.cycle_last  =3D cycle_now;
+	tks->tkr_mono.cycle_last =3D cycle_now;
+	tks->tkr_raw.cycle_last  =3D cycle_now;
=20
-	tk->ntp_error =3D 0;
+	tks->ntp_error =3D 0;
 	timekeeping_suspended =3D 0;
-	timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+	timekeeping_update_from_shadow(&tk_core, TK_CLOCK_WAS_SET);
+	raw_spin_unlock_irqrestore(&tk_core.lock, flags);
=20
 	touch_softlockup_watchdog();
=20
@@ -1967,11 +1905,11 @@ void timekeeping_resume(void)
=20
 int timekeeping_suspend(void)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
-	unsigned long flags;
-	struct timespec64		delta, delta_delta;
-	static struct timespec64	old_delta;
+	struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
+	struct timespec64 delta, delta_delta;
+	static struct timespec64 old_delta;
 	struct clocksource *curr_clock;
+	unsigned long flags;
 	u64 cycle_now;
=20
 	read_persistent_clock64(&timekeeping_suspend_time);
@@ -1986,9 +1924,8 @@ int timekeeping_suspend(void)
=20
 	suspend_timing_needed =3D true;
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-	timekeeping_forward_now(tk);
+	raw_spin_lock_irqsave(&tk_core.lock, flags);
+	timekeeping_forward_now(tks);
 	timekeeping_suspended =3D 1;
=20
 	/*
@@ -1996,8 +1933,8 @@ int timekeeping_suspend(void)
 	 * just read from the current clocksource. Save this to potentially
 	 * use in suspend timing.
 	 */
-	curr_clock =3D tk->tkr_mono.clock;
-	cycle_now =3D tk->tkr_mono.cycle_last;
+	curr_clock =3D tks->tkr_mono.clock;
+	cycle_now =3D tks->tkr_mono.cycle_last;
 	clocksource_start_suspend_timing(curr_clock, cycle_now);
=20
 	if (persistent_clock_exists) {
@@ -2007,7 +1944,7 @@ int timekeeping_suspend(void)
 		 * try to compensate so the difference in system time
 		 * and persistent_clock time stays close to constant.
 		 */
-		delta =3D timespec64_sub(tk_xtime(tk), timekeeping_suspend_time);
+		delta =3D timespec64_sub(tk_xtime(tks), timekeeping_suspend_time);
 		delta_delta =3D timespec64_sub(delta, old_delta);
 		if (abs(delta_delta.tv_sec) >=3D 2) {
 			/*
@@ -2022,10 +1959,9 @@ int timekeeping_suspend(void)
 		}
 	}
=20
-	timekeeping_update(tk, TK_MIRROR);
-	halt_fast_timekeeper(tk);
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+	timekeeping_update_from_shadow(&tk_core, 0);
+	halt_fast_timekeeper(tks);
+	raw_spin_unlock_irqrestore(&tk_core.lock, flags);
=20
 	tick_suspend();
 	clocksource_suspend();
@@ -2130,16 +2066,17 @@ static __always_inline void timekeeping_apply_adjustm=
ent(struct timekeeper *tk,
  */
 static void timekeeping_adjust(struct timekeeper *tk, s64 offset)
 {
+	u64 ntp_tl =3D ntp_tick_length();
 	u32 mult;
=20
 	/*
 	 * Determine the multiplier from the current NTP tick length.
 	 * Avoid expensive division when the tick length doesn't change.
 	 */
-	if (likely(tk->ntp_tick =3D=3D ntp_tick_length())) {
+	if (likely(tk->ntp_tick =3D=3D ntp_tl)) {
 		mult =3D tk->tkr_mono.mult - tk->ntp_err_mult;
 	} else {
-		tk->ntp_tick =3D ntp_tick_length();
+		tk->ntp_tick =3D ntp_tl;
 		mult =3D div64_u64((tk->ntp_tick >> tk->ntp_error_shift) -
 				 tk->xtime_remainder, tk->cycle_interval);
 	}
@@ -2278,28 +2215,24 @@ static u64 logarithmic_accumulation(struct timekeeper=
 *tk, u64 offset,
  */
 static bool timekeeping_advance(enum timekeeping_adv_mode mode)
 {
+	struct timekeeper *tk =3D &tk_core.shadow_timekeeper;
 	struct timekeeper *real_tk =3D &tk_core.timekeeper;
-	struct timekeeper *tk =3D &shadow_timekeeper;
-	u64 offset;
-	int shift =3D 0, maxshift;
 	unsigned int clock_set =3D 0;
-	unsigned long flags;
+	int shift =3D 0, maxshift;
+	u64 offset;
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
+	guard(raw_spinlock_irqsave)(&tk_core.lock);
=20
 	/* Make sure we're fully resumed: */
 	if (unlikely(timekeeping_suspended))
-		goto out;
+		return false;
=20
 	offset =3D clocksource_delta(tk_clock_read(&tk->tkr_mono),
 				   tk->tkr_mono.cycle_last, tk->tkr_mono.mask);
=20
 	/* Check if there's really nothing to do */
 	if (offset < real_tk->cycle_interval && mode =3D=3D TK_ADV_TICK)
-		goto out;
-
-	/* Do some additional sanity checking */
-	timekeeping_check_update(tk, offset);
+		return false;
=20
 	/*
 	 * With NO_HZ we may have to accumulate many cycle_intervals
@@ -2315,8 +2248,7 @@ static bool timekeeping_advance(enum timekeeping_adv_mo=
de mode)
 	maxshift =3D (64 - (ilog2(ntp_tick_length())+1)) - 1;
 	shift =3D min(shift, maxshift);
 	while (offset >=3D tk->cycle_interval) {
-		offset =3D logarithmic_accumulation(tk, offset, shift,
-							&clock_set);
+		offset =3D logarithmic_accumulation(tk, offset, shift, &clock_set);
 		if (offset < tk->cycle_interval<<shift)
 			shift--;
 	}
@@ -2330,23 +2262,7 @@ static bool timekeeping_advance(enum timekeeping_adv_m=
ode mode)
 	 */
 	clock_set |=3D accumulate_nsecs_to_secs(tk);
=20
-	write_seqcount_begin(&tk_core.seq);
-	/*
-	 * Update the real timekeeper.
-	 *
-	 * We could avoid this memcpy by switching pointers, but that
-	 * requires changes to all other timekeeper usage sites as
-	 * well, i.e. move the timekeeper pointer getter into the
-	 * spinlocked/seqcount protected sections. And we trade this
-	 * memcpy under the tk_core.seq against one before we start
-	 * updating.
-	 */
-	timekeeping_update(tk, clock_set);
-	memcpy(real_tk, tk, sizeof(*tk));
-	/* The memcpy must come last. Do not put anything here! */
-	write_seqcount_end(&tk_core.seq);
-out:
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+	timekeeping_update_from_shadow(&tk_core, clock_set);
=20
 	return !!clock_set;
 }
@@ -2394,6 +2310,94 @@ void ktime_get_coarse_real_ts64(struct timespec64 *ts)
 }
 EXPORT_SYMBOL(ktime_get_coarse_real_ts64);
=20
+/**
+ * ktime_get_coarse_real_ts64_mg - return latter of coarse grained time or f=
loor
+ * @ts:		timespec64 to be filled
+ *
+ * Fetch the global mg_floor value, convert it to realtime and compare it
+ * to the current coarse-grained time. Fill @ts with whichever is
+ * latest. Note that this is a filesystem-specific interface and should be
+ * avoided outside of that context.
+ */
+void ktime_get_coarse_real_ts64_mg(struct timespec64 *ts)
+{
+	struct timekeeper *tk =3D &tk_core.timekeeper;
+	u64 floor =3D atomic64_read(&mg_floor);
+	ktime_t f_real, offset, coarse;
+	unsigned int seq;
+
+	do {
+		seq =3D read_seqcount_begin(&tk_core.seq);
+		*ts =3D tk_xtime(tk);
+		offset =3D tk_core.timekeeper.offs_real;
+	} while (read_seqcount_retry(&tk_core.seq, seq));
+
+	coarse =3D timespec64_to_ktime(*ts);
+	f_real =3D ktime_add(floor, offset);
+	if (ktime_after(f_real, coarse))
+		*ts =3D ktime_to_timespec64(f_real);
+}
+
+/**
+ * ktime_get_real_ts64_mg - attempt to update floor value and return result
+ * @ts:		pointer to the timespec to be set
+ *
+ * Get a monotonic fine-grained time value and attempt to swap it into
+ * mg_floor. If that succeeds then accept the new floor value. If it fails
+ * then another task raced in during the interim time and updated the
+ * floor.  Since any update to the floor must be later than the previous
+ * floor, either outcome is acceptable.
+ *
+ * Typically this will be called after calling ktime_get_coarse_real_ts64_mg=
(),
+ * and determining that the resulting coarse-grained timestamp did not effect
+ * a change in ctime. Any more recent floor value would effect a change to
+ * ctime, so there is no need to retry the atomic64_try_cmpxchg() on failure.
+ *
+ * @ts will be filled with the latest floor value, regardless of the outcome=
 of
+ * the cmpxchg. Note that this is a filesystem specific interface and should=
 be
+ * avoided outside of that context.
+ */
+void ktime_get_real_ts64_mg(struct timespec64 *ts)
+{
+	struct timekeeper *tk =3D &tk_core.timekeeper;
+	ktime_t old =3D atomic64_read(&mg_floor);
+	ktime_t offset, mono;
+	unsigned int seq;
+	u64 nsecs;
+
+	do {
+		seq =3D read_seqcount_begin(&tk_core.seq);
+
+		ts->tv_sec =3D tk->xtime_sec;
+		mono =3D tk->tkr_mono.base;
+		nsecs =3D timekeeping_get_ns(&tk->tkr_mono);
+		offset =3D tk_core.timekeeper.offs_real;
+	} while (read_seqcount_retry(&tk_core.seq, seq));
+
+	mono =3D ktime_add_ns(mono, nsecs);
+
+	/*
+	 * Attempt to update the floor with the new time value. As any
+	 * update must be later then the existing floor, and would effect
+	 * a change to ctime from the perspective of the current task,
+	 * accept the resulting floor value regardless of the outcome of
+	 * the swap.
+	 */
+	if (atomic64_try_cmpxchg(&mg_floor, &old, mono)) {
+		ts->tv_nsec =3D 0;
+		timespec64_add_ns(ts, nsecs);
+		timekeeping_inc_mg_floor_swaps();
+	} else {
+		/*
+		 * Another task changed mg_floor since "old" was fetched.
+		 * "old" has been updated with the latest value of "mg_floor".
+		 * That value is newer than the previous floor value, which
+		 * is enough to effect a change to ctime. Accept it.
+		 */
+		*ts =3D ktime_to_timespec64(ktime_add(old, offset));
+	}
+}
+
 void ktime_get_coarse_ts64(struct timespec64 *ts)
 {
 	struct timekeeper *tk =3D &tk_core.timekeeper;
@@ -2551,13 +2555,10 @@ EXPORT_SYMBOL_GPL(random_get_entropy_fallback);
  */
 int do_adjtimex(struct __kernel_timex *txc)
 {
-	struct timekeeper *tk =3D &tk_core.timekeeper;
 	struct audit_ntp_data ad;
 	bool offset_set =3D false;
 	bool clock_set =3D false;
 	struct timespec64 ts;
-	unsigned long flags;
-	s32 orig_tai, tai;
 	int ret;
=20
 	/* Validate the data before disabling interrupts */
@@ -2568,6 +2569,7 @@ int do_adjtimex(struct __kernel_timex *txc)
=20
 	if (txc->modes & ADJ_SETOFFSET) {
 		struct timespec64 delta;
+
 		delta.tv_sec  =3D txc->time.tv_sec;
 		delta.tv_nsec =3D txc->time.tv_usec;
 		if (!(txc->modes & ADJ_NANO))
@@ -2585,21 +2587,21 @@ int do_adjtimex(struct __kernel_timex *txc)
 	ktime_get_real_ts64(&ts);
 	add_device_randomness(&ts, sizeof(ts));
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
+	scoped_guard (raw_spinlock_irqsave, &tk_core.lock) {
+		struct timekeeper *tks =3D &tk_core.shadow_timekeeper;
+		s32 orig_tai, tai;
=20
-	orig_tai =3D tai =3D tk->tai_offset;
-	ret =3D __do_adjtimex(txc, &ts, &tai, &ad);
+		orig_tai =3D tai =3D tks->tai_offset;
+		ret =3D __do_adjtimex(txc, &ts, &tai, &ad);
=20
-	if (tai !=3D orig_tai) {
-		__timekeeping_set_tai_offset(tk, tai);
-		timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
-		clock_set =3D true;
+		if (tai !=3D orig_tai) {
+			__timekeeping_set_tai_offset(tks, tai);
+			timekeeping_update_from_shadow(&tk_core, TK_CLOCK_WAS_SET);
+			clock_set =3D true;
+		} else {
+			tk_update_leap_state_all(&tk_core);
+		}
 	}
-	tk_update_leap_state(tk);
-
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
=20
 	audit_ntp_log(&ad);
=20
@@ -2623,15 +2625,8 @@ int do_adjtimex(struct __kernel_timex *txc)
  */
 void hardpps(const struct timespec64 *phase_ts, const struct timespec64 *raw=
_ts)
 {
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
-	write_seqcount_begin(&tk_core.seq);
-
+	guard(raw_spinlock_irqsave)(&tk_core.lock);
 	__hardpps(phase_ts, raw_ts);
-
-	write_seqcount_end(&tk_core.seq);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
 }
 EXPORT_SYMBOL(hardpps);
 #endif /* CONFIG_NTP_PPS */
diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c
index b73e8850e58d..badeb222eab9 100644
--- a/kernel/time/timekeeping_debug.c
+++ b/kernel/time/timekeeping_debug.c
@@ -17,6 +17,9 @@
=20
 #define NUM_BINS 32
=20
+/* Incremented every time mg_floor is updated */
+DEFINE_PER_CPU(unsigned long, timekeeping_mg_floor_swaps);
+
 static unsigned int sleep_time_bin[NUM_BINS] =3D {0};
=20
 static int tk_debug_sleep_time_show(struct seq_file *s, void *data)
@@ -53,3 +56,13 @@ void tk_debug_account_sleep_time(const struct timespec64 *=
t)
 			   (s64)t->tv_sec, t->tv_nsec / NSEC_PER_MSEC);
 }
=20
+unsigned long timekeeping_get_mg_floor_swaps(void)
+{
+	unsigned long sum =3D 0;
+	int cpu;
+
+	for_each_possible_cpu(cpu)
+		sum +=3D data_race(per_cpu(timekeeping_mg_floor_swaps, cpu));
+
+	return sum;
+}
diff --git a/kernel/time/timekeeping_internal.h b/kernel/time/timekeeping_int=
ernal.h
index 4ca2787d1642..63e600e943a7 100644
--- a/kernel/time/timekeeping_internal.h
+++ b/kernel/time/timekeeping_internal.h
@@ -10,12 +10,26 @@
  * timekeeping debug functions
  */
 #ifdef CONFIG_DEBUG_FS
+
+DECLARE_PER_CPU(unsigned long, timekeeping_mg_floor_swaps);
+
+static inline void timekeeping_inc_mg_floor_swaps(void)
+{
+	this_cpu_inc(timekeeping_mg_floor_swaps);
+}
+
 extern void tk_debug_account_sleep_time(const struct timespec64 *t);
+
 #else
+
 #define tk_debug_account_sleep_time(x)
+
+static inline void timekeeping_inc_mg_floor_swaps(void)
+{
+}
+
 #endif
=20
-#ifdef CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE
 static inline u64 clocksource_delta(u64 now, u64 last, u64 mask)
 {
 	u64 ret =3D (now - last) & mask;
@@ -26,14 +40,9 @@ static inline u64 clocksource_delta(u64 now, u64 last, u64=
 mask)
 	 */
 	return ret & ~(mask >> 1) ? 0 : ret;
 }
-#else
-static inline u64 clocksource_delta(u64 now, u64 last, u64 mask)
-{
-	return (now - last) & mask;
-}
-#endif
=20
 /* Semi public for serialization of non timekeeper VDSO updates. */
-extern raw_spinlock_t timekeeper_lock;
+unsigned long timekeeper_lock_irqsave(void);
+void timekeeper_unlock_irqrestore(unsigned long flags);
=20
 #endif /* _TIMEKEEPING_INTERNAL_H */
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 0fc9d066a7be..a283e524835d 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -37,7 +37,6 @@
 #include <linux/tick.h>
 #include <linux/kallsyms.h>
 #include <linux/irq_work.h>
-#include <linux/sched/signal.h>
 #include <linux/sched/sysctl.h>
 #include <linux/sched/nohz.h>
 #include <linux/sched/debug.h>
@@ -2422,7 +2421,8 @@ static inline void __run_timers(struct timer_base *base)
=20
 static void __run_timer_base(struct timer_base *base)
 {
-	if (time_before(jiffies, base->next_expiry))
+	/* Can race against a remote CPU updating next_expiry under the lock */
+	if (time_before(jiffies, READ_ONCE(base->next_expiry)))
 		return;
=20
 	timer_base_lock_expiry(base);
@@ -2526,141 +2526,6 @@ void update_process_times(int user_tick)
 		run_posix_cpu_timers();
 }
=20
-/*
- * Since schedule_timeout()'s timer is defined on the stack, it must store
- * the target task on the stack as well.
- */
-struct process_timer {
-	struct timer_list timer;
-	struct task_struct *task;
-};
-
-static void process_timeout(struct timer_list *t)
-{
-	struct process_timer *timeout =3D from_timer(timeout, t, timer);
-
-	wake_up_process(timeout->task);
-}
-
-/**
- * schedule_timeout - sleep until timeout
- * @timeout: timeout value in jiffies
- *
- * Make the current task sleep until @timeout jiffies have elapsed.
- * The function behavior depends on the current task state
- * (see also set_current_state() description):
- *
- * %TASK_RUNNING - the scheduler is called, but the task does not sleep
- * at all. That happens because sched_submit_work() does nothing for
- * tasks in %TASK_RUNNING state.
- *
- * %TASK_UNINTERRUPTIBLE - at least @timeout jiffies are guaranteed to
- * pass before the routine returns unless the current task is explicitly
- * woken up, (e.g. by wake_up_process()).
- *
- * %TASK_INTERRUPTIBLE - the routine may return early if a signal is
- * delivered to the current task or the current task is explicitly woken
- * up.
- *
- * The current task state is guaranteed to be %TASK_RUNNING when this
- * routine returns.
- *
- * Specifying a @timeout value of %MAX_SCHEDULE_TIMEOUT will schedule
- * the CPU away without a bound on the timeout. In this case the return
- * value will be %MAX_SCHEDULE_TIMEOUT.
- *
- * Returns 0 when the timer has expired otherwise the remaining time in
- * jiffies will be returned. In all cases the return value is guaranteed
- * to be non-negative.
- */
-signed long __sched schedule_timeout(signed long timeout)
-{
-	struct process_timer timer;
-	unsigned long expire;
-
-	switch (timeout)
-	{
-	case MAX_SCHEDULE_TIMEOUT:
-		/*
-		 * These two special cases are useful to be comfortable
-		 * in the caller. Nothing more. We could take
-		 * MAX_SCHEDULE_TIMEOUT from one of the negative value
-		 * but I' d like to return a valid offset (>=3D0) to allow
-		 * the caller to do everything it want with the retval.
-		 */
-		schedule();
-		goto out;
-	default:
-		/*
-		 * Another bit of PARANOID. Note that the retval will be
-		 * 0 since no piece of kernel is supposed to do a check
-		 * for a negative retval of schedule_timeout() (since it
-		 * should never happens anyway). You just have the printk()
-		 * that will tell you if something is gone wrong and where.
-		 */
-		if (timeout < 0) {
-			printk(KERN_ERR "schedule_timeout: wrong timeout "
-				"value %lx\n", timeout);
-			dump_stack();
-			__set_current_state(TASK_RUNNING);
-			goto out;
-		}
-	}
-
-	expire =3D timeout + jiffies;
-
-	timer.task =3D current;
-	timer_setup_on_stack(&timer.timer, process_timeout, 0);
-	__mod_timer(&timer.timer, expire, MOD_TIMER_NOTPENDING);
-	schedule();
-	del_timer_sync(&timer.timer);
-
-	/* Remove the timer from the object tracker */
-	destroy_timer_on_stack(&timer.timer);
-
-	timeout =3D expire - jiffies;
-
- out:
-	return timeout < 0 ? 0 : timeout;
-}
-EXPORT_SYMBOL(schedule_timeout);
-
-/*
- * We can use __set_current_state() here because schedule_timeout() calls
- * schedule() unconditionally.
- */
-signed long __sched schedule_timeout_interruptible(signed long timeout)
-{
-	__set_current_state(TASK_INTERRUPTIBLE);
-	return schedule_timeout(timeout);
-}
-EXPORT_SYMBOL(schedule_timeout_interruptible);
-
-signed long __sched schedule_timeout_killable(signed long timeout)
-{
-	__set_current_state(TASK_KILLABLE);
-	return schedule_timeout(timeout);
-}
-EXPORT_SYMBOL(schedule_timeout_killable);
-
-signed long __sched schedule_timeout_uninterruptible(signed long timeout)
-{
-	__set_current_state(TASK_UNINTERRUPTIBLE);
-	return schedule_timeout(timeout);
-}
-EXPORT_SYMBOL(schedule_timeout_uninterruptible);
-
-/*
- * Like schedule_timeout_uninterruptible(), except this task will not contri=
bute
- * to load average.
- */
-signed long __sched schedule_timeout_idle(signed long timeout)
-{
-	__set_current_state(TASK_IDLE);
-	return schedule_timeout(timeout);
-}
-EXPORT_SYMBOL(schedule_timeout_idle);
-
 #ifdef CONFIG_HOTPLUG_CPU
 static void migrate_timer_list(struct timer_base *new_base, struct hlist_hea=
d *head)
 {
@@ -2757,59 +2622,3 @@ void __init init_timers(void)
 	posix_cputimers_init_work();
 	open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
 }
-
-/**
- * msleep - sleep safely even with waitqueue interruptions
- * @msecs: Time in milliseconds to sleep for
- */
-void msleep(unsigned int msecs)
-{
-	unsigned long timeout =3D msecs_to_jiffies(msecs);
-
-	while (timeout)
-		timeout =3D schedule_timeout_uninterruptible(timeout);
-}
-
-EXPORT_SYMBOL(msleep);
-
-/**
- * msleep_interruptible - sleep waiting for signals
- * @msecs: Time in milliseconds to sleep for
- */
-unsigned long msleep_interruptible(unsigned int msecs)
-{
-	unsigned long timeout =3D msecs_to_jiffies(msecs);
-
-	while (timeout && !signal_pending(current))
-		timeout =3D schedule_timeout_interruptible(timeout);
-	return jiffies_to_msecs(timeout);
-}
-
-EXPORT_SYMBOL(msleep_interruptible);
-
-/**
- * usleep_range_state - Sleep for an approximate time in a given state
- * @min:	Minimum time in usecs to sleep
- * @max:	Maximum time in usecs to sleep
- * @state:	State of the current task that will be while sleeping
- *
- * In non-atomic context where the exact wakeup time is flexible, use
- * usleep_range_state() instead of udelay().  The sleep improves responsiven=
ess
- * by avoiding the CPU-hogging busy-wait of udelay(), and the range reduces
- * power usage by allowing hrtimers to take advantage of an already-
- * scheduled interrupt instead of scheduling a new one just for this sleep.
- */
-void __sched usleep_range_state(unsigned long min, unsigned long max,
-				unsigned int state)
-{
-	ktime_t exp =3D ktime_add_us(ktime_get(), min);
-	u64 delta =3D (u64)(max - min) * NSEC_PER_USEC;
-
-	for (;;) {
-		__set_current_state(state);
-		/* Do not return before the requested sleep time has elapsed */
-		if (!schedule_hrtimeout_range(&exp, delta, HRTIMER_MODE_ABS))
-			break;
-	}
-}
-EXPORT_SYMBOL(usleep_range_state);
diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c
index 9193d6133e5d..98488b20b594 100644
--- a/kernel/time/vsyscall.c
+++ b/kernel/time/vsyscall.c
@@ -151,9 +151,8 @@ void update_vsyscall_tz(void)
 unsigned long vdso_update_begin(void)
 {
 	struct vdso_data *vdata =3D __arch_get_k_vdso_data();
-	unsigned long flags;
+	unsigned long flags =3D timekeeper_lock_irqsave();
=20
-	raw_spin_lock_irqsave(&timekeeper_lock, flags);
 	vdso_write_begin(vdata);
 	return flags;
 }
@@ -172,5 +171,5 @@ void vdso_update_end(unsigned long flags)
=20
 	vdso_write_end(vdata);
 	__arch_sync_vdso_data(vdata);
-	raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+	timekeeper_unlock_irqrestore(flags);
 }
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 7315f643817a..14977b9fc254 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1328,19 +1328,6 @@ config SCHEDSTATS
=20
 endmenu
=20
-config DEBUG_TIMEKEEPING
-	bool "Enable extra timekeeping sanity checking"
-	help
-	  This option will enable additional timekeeping sanity checks
-	  which may be helpful when diagnosing issues where timekeeping
-	  problems are suspected.
-
-	  This may include checks in the timekeeping hotpaths, so this
-	  option may have a (very small) performance impact to some
-	  workloads.
-
-	  If unsure, say N.
-
 config DEBUG_PREEMPT
 	bool "Debug preemptible kernel"
 	depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT
diff --git a/mm/damon/core.c b/mm/damon/core.c
index a83f3b736d51..79efd8089d6c 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1892,11 +1892,10 @@ static unsigned long damos_wmark_wait_us(struct damos=
 *scheme)
=20
 static void kdamond_usleep(unsigned long usecs)
 {
-	/* See Documentation/timers/timers-howto.rst for the thresholds */
-	if (usecs > 20 * USEC_PER_MSEC)
+	if (usecs >=3D USLEEP_RANGE_UPPER_BOUND)
 		schedule_timeout_idle(usecs_to_jiffies(usecs));
 	else
-		usleep_idle_range(usecs, usecs + 1);
+		usleep_range_idle(usecs, usecs + 1);
 }
=20
 /* Returns negative error code if it's not activated but should return */
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 1c82dcdf6e8f..4bd94d432bcf 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -42,8 +42,6 @@
 #define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \
 		 "\x00\x00\x00\x00\x00\x00\x00\x00"
=20
-#define secs_to_jiffies(_secs) msecs_to_jiffies((_secs) * 1000)
-
 /* Handle HCI Event packets */
=20
 static void *hci_ev_skb_pull(struct hci_dev *hdev, struct sk_buff *skb,
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 34f68ef74b8f..7e23cacbe66e 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2285,7 +2285,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t sp=
in_until)
 	s64 remaining;
 	struct hrtimer_sleeper t;
=20
-	hrtimer_init_sleeper_on_stack(&t, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
+	hrtimer_setup_sleeper_on_stack(&t, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 	hrtimer_set_expires(&t.timer, spin_until);
=20
 	remaining =3D ktime_to_ns(hrtimer_expires_remaining(&t.timer));
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index db720efa811d..5514600586a9 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -107,14 +107,12 @@ static void idletimer_tg_expired(struct timer_list *t)
 	schedule_work(&timer->work);
 }
=20
-static enum alarmtimer_restart idletimer_tg_alarmproc(struct alarm *alarm,
-							  ktime_t now)
+static void idletimer_tg_alarmproc(struct alarm *alarm, ktime_t now)
 {
 	struct idletimer_tg *timer =3D alarm->data;
=20
 	pr_debug("alarm %s expired\n", timer->attr.attr.name);
 	schedule_work(&timer->work);
-	return ALARMTIMER_NORESTART;
 }
=20
 static int idletimer_check_sysfs_name(const char *name, unsigned int size)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4427572b2477..98790fe5115d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6597,11 +6597,11 @@ sub process {
 			# ignore udelay's < 10, however
 			if (! ($delay < 10) ) {
 				CHK("USLEEP_RANGE",
-				    "usleep_range is preferred over udelay; see Documentation/timers/tim=
ers-howto.rst\n" . $herecurr);
+				    "usleep_range is preferred over udelay; see function description of =
usleep_range() and udelay().\n" . $herecurr);
 			}
 			if ($delay > 2000) {
 				WARN("LONG_UDELAY",
-				     "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" .=
 $herecurr);
+				     "long udelay - prefer mdelay; see function description of mdelay().=
\n" . $herecurr);
 			}
 		}
=20
@@ -6609,7 +6609,7 @@ sub process {
 		if ($line =3D~ /\bmsleep\s*\((\d+)\);/) {
 			if ($1 < 20) {
 				WARN("MSLEEP",
-				     "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/t=
imers-howto.rst\n" . $herecurr);
+				     "msleep < 20ms can sleep for up to 20ms; see function description o=
f msleep().\n" . $herecurr);
 			}
 		}
=20
@@ -7077,11 +7077,11 @@ sub process {
 			my $max =3D $7;
 			if ($min eq $max) {
 				WARN("USLEEP_RANGE",
-				     "usleep_range should not use min =3D=3D max args; see Documentation=
/timers/timers-howto.rst\n" . "$here\n$stat\n");
+				     "usleep_range should not use min =3D=3D max args;  see function des=
cription of usleep_range().\n" . "$here\n$stat\n");
 			} elsif ($min =3D~ /^\d+$/ && $max =3D~ /^\d+$/ &&
 				 $min > $max) {
 				WARN("USLEEP_RANGE",
-				     "usleep_range args reversed, use min then max; see Documentation/ti=
mers/timers-howto.rst\n" . "$here\n$stat\n");
+				     "usleep_range args reversed, use min then max;  see function descri=
ption of usleep_range().\n" . "$here\n$stat\n");
 			}
 		}
=20
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h
index 2584621c3b2d..d73644e85b6e 100644
--- a/sound/soc/sof/ops.h
+++ b/sound/soc/sof/ops.h
@@ -597,12 +597,12 @@ snd_sof_is_chain_dma_supported(struct snd_sof_dev *sdev=
, u32 dai_type)
  * @addr: Address to poll
  * @val: Variable to read the value into
  * @cond: Break condition (usually involving @val)
- * @sleep_us: Maximum time to sleep between reads in us (0
- *            tight-loops).  Should be less than ~20ms since usleep_range
- *            is used (see Documentation/timers/timers-howto.rst).
+ * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Ple=
ase
+ *            read usleep_range() function description for details and
+ *            limitations.
  * @timeout_us: Timeout in us, 0 means never timeout
  *
- * Returns 0 on success and -ETIMEDOUT upon a timeout. In either
+ * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either
  * case, the last read value at @addr is stored in @val. Must not
  * be called from atomic context if sleep_us or timeout_us are used.
  *
diff --git a/tools/testing/selftests/wireguard/qemu/debug.config b/tools/test=
ing/selftests/wireguard/qemu/debug.config
index 9d172210e2c6..139fd9aa8b12 100644
--- a/tools/testing/selftests/wireguard/qemu/debug.config
+++ b/tools/testing/selftests/wireguard/qemu/debug.config
@@ -31,7 +31,6 @@ CONFIG_SCHED_DEBUG=3Dy
 CONFIG_SCHED_INFO=3Dy
 CONFIG_SCHEDSTATS=3Dy
 CONFIG_SCHED_STACK_END_CHECK=3Dy
-CONFIG_DEBUG_TIMEKEEPING=3Dy
 CONFIG_DEBUG_PREEMPT=3Dy
 CONFIG_DEBUG_RT_MUTEXES=3Dy
 CONFIG_DEBUG_SPINLOCK=3Dy


.
Subject: [PATCH 6.12.y] mm/mmap: fix __mmap_region() error handling in rare merge failure case
From: "Liam R. Howlett" <Liam.Howlett@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
        Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
        Jann Horn <jannh@google.com>,
        "Liam R. Howlett" <Liam.Howlett@Oracle.com>,
        syzbot+bc6bfc25a68b7a020ee1@syzkaller.appspotmail.com,
        Vlastimil Babka <vbabka@suse.cz>, stable@vger.kernel.org
Date: Mon, 18 Nov 2024 14:40:48 -0500

.
Subject: [PATCH] drivers/card_reader/rtsx_usb: Restore interrupt based detection
From: Sean Rhodes <sean@starlabs.systems>
To: linux-kernel@vger.kernel.org
Cc: Sean Rhodes <sean@starlabs.systems>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Mon, 18 Nov 2024 19:52:01 +0000

.
Subject: [for-next][PATCH 0/4] tools/tracing: Last minute updates for 6.13
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>
Date: Mon, 18 Nov 2024 15:14:31 -0500

.
Subject: [for-next][PATCH 1/4] rtla/timerlat: Do not set params->user_workload with -U
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>
Date: Mon, 18 Nov 2024 15:14:32 -0500

.
Subject: [for-next][PATCH 2/4] tools/rtla: Improve code readability in timerlat_load.py
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 "lgoncalv@redhat.com" <lgoncalv@redhat.com>,
 Furkan Onder <furkanonder@protonmail.com>
Date: Mon, 18 Nov 2024 15:14:33 -0500

.
Subject: [for-next][PATCH 3/4] tools/rtla: Enhance argument parsing in timerlat_load.py
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 "lgoncalv@redhat.com" <lgoncalv@redhat.com>,
 Furkan Onder <furkanonder@protonmail.com>
Date: Mon, 18 Nov 2024 15:14:34 -0500

.
Subject: [for-next][PATCH 4/4] tools/rtla: Improve exception handling in timerlat_load.py
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 "lgoncalv@redhat.com" <lgoncalv@redhat.com>,
 Furkan Onder <furkanonder@protonmail.com>
Date: Mon, 18 Nov 2024 15:14:35 -0500

.
Subject: [PATCH v6 0/2] PCI: add enabe(disable)_device() hook for bridge
From: Frank Li <Frank.Li@nxp.com>
To: Bjorn Helgaas <bhelgaas@google.com>, Richard Zhu <hongxing.zhu@nxp.com>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Lorenzo Pieralisi <lpieralisi@kernel.org>, 
 =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, 
 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, 
 Rob Herring <robh@kernel.org>, Shawn Guo <shawnguo@kernel.org>, 
 Sascha Hauer <s.hauer@pengutronix.de>, 
 Pengutronix Kernel Team <kernel@pengutronix.de>, 
 Fabio Estevam <festevam@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, 
 linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank.li@nxp.com, 
 alyssa@rosenzweig.io, bpf@vger.kernel.org, broonie@kernel.org, jgg@ziepe.ca, 
 joro@8bytes.org, l.stach@pengutronix.de, lgirdwood@gmail.com, 
 maz@kernel.org, p.zabel@pengutronix.de, robin.murphy@arm.com, 
 will@kernel.org, Robin Murphy <robin.murphy@arm.com>, 
 Marc Zyngier <maz@kernel.org>, Frank Li <Frank.Li@nxp.com>
Date: Mon, 18 Nov 2024 15:24:26 -0500

.
Subject: [GIT PULL] Kselftest update for Linux 6.13-rc1
From: Shuah Khan <skhan@linuxfoundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: shuah <shuah@kernel.org>, Shuah Khan <skhan@linuxfoundation.org>,
 linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 13:40:02 -0700

This is a multi-part message in MIME format.
--------------v8upExji9lbeNmEC9zZ6NCja
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Linus,

Please pull the following kselftest fixes update for Linux 6.13-rc1.

kselftest update for Linux 6.13-rc1

-- timers test - removes duplicates defines
-- timers test - fixes to improve error reporting
-- rtc test - adds check rtc alarm status to alarm test
-- resctrl test - adds array overrun checks during iMC config parsing code
-- resctrl test - adds array overflow checks when reading strings
-- resctrl test - fixes and reorganizing code

Looks like I forgot to mention signal test changes in my tag
message. :(

diff is attached.

Tests passed on my kselftest next branch:

- Individual test runs of signal, timers, rtc, and resctrl

thanks,
-- Shuah

----------------------------------------------------------------
The following changes since commit 8e929cb546ee42c9a61d24fae60605e9e3192354:

   Linux 6.12-rc3 (2024-10-13 14:33:32 -0700)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-next-6.13-rc1

for you to fetch changes up to a44c26d7fa74a5f4d2795a5c55a2d6ec1ebf1e38:

   selftests/resctrl: Replace magic constants used as array size (2024-11-04 17:02:03 -0700)

----------------------------------------------------------------
linux_kselftest-next-6.13-rc1

kselftest update for Linux 6.13-rc1

-- timers test - removes duplicates defines
-- timers test - fixes to improve error reporting
-- rtc test - adds check rtc alarm status to alarm test
-- resctrl test - adds array overrun checks during iMC config parsing code
-- resctrl test - adds array overflow checks when reading strings
-- resctrl test - fixes and reorganizing code

----------------------------------------------------------------
Chen Ni (1):
       selftests: timers: Remove unneeded semicolon

Dev Jain (2):
       selftests: Rename sigaltstack to generic signal
       selftests: Add a test mangling with uc_sigmask

Gianfranco Trad (1):
       selftests: timers: improve timer_create failure message

Joseph Jang (1):
       selftest: rtc: Add to check rtc alarm status for alarm related test

NÃ­colas F. R. A. Prado (1):
       docs: dev-tools: Add documentation for the device focused kselftests

Reinette Chatre (15):
       selftests/resctrl: Make functions only used in same file static
       selftests/resctrl: Print accurate buffer size as part of MBM results
       selftests/resctrl: Fix memory overflow due to unhandled wraparound
       selftests/resctrl: Protect against array overrun during iMC config parsing
       selftests/resctrl: Protect against array overflow when reading strings
       selftests/resctrl: Make wraparound handling obvious
       selftests/resctrl: Remove "once" parameter required to be false
       selftests/resctrl: Only support measured read operation
       selftests/resctrl: Remove unused measurement code
       selftests/resctrl: Make benchmark parameter passing robust
       selftests/resctrl: Ensure measurements skip initialization of default benchmark
       selftests/resctrl: Use cache size to determine "fill_buf" buffer size
       selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth
       selftests/resctrl: Keep results from first test run
       selftests/resctrl: Replace magic constants used as array size

Shuah Khan (2):
       selftests: timers: Remove local NSEC_PER_SEC and USEC_PER_SEC defines
       selftests:timers: remove local CLOCKID defines

  Documentation/dev-tools/kselftest.rst              |   9 +
  Documentation/dev-tools/testing-devices.rst        |  47 +++
  tools/testing/selftests/Makefile                   |   2 +-
  tools/testing/selftests/resctrl/cmt_test.c         |  37 +-
  tools/testing/selftests/resctrl/fill_buf.c         |  45 +--
  tools/testing/selftests/resctrl/mba_test.c         |  54 ++-
  tools/testing/selftests/resctrl/mbm_test.c         |  37 +-
  tools/testing/selftests/resctrl/resctrl.h          |  79 +++-
  tools/testing/selftests/resctrl/resctrl_tests.c    |  95 ++++-
  tools/testing/selftests/resctrl/resctrl_val.c      | 447 ++++++---------------
  tools/testing/selftests/resctrl/resctrlfs.c        |  19 +-
  tools/testing/selftests/rtc/Makefile               |   2 +-
  tools/testing/selftests/rtc/rtctest.c              |  64 +++
  .../selftests/{sigaltstack => signal}/.gitignore   |   1 +
  .../selftests/{sigaltstack => signal}/Makefile     |   3 +-
  .../current_stack_pointer.h                        |   0
  tools/testing/selftests/signal/mangle_uc_sigmask.c | 184 +++++++++
  .../selftests/{sigaltstack => signal}/sas.c        |   0
  tools/testing/selftests/timers/Makefile            |   2 +-
  tools/testing/selftests/timers/adjtick.c           |   6 +-
  .../testing/selftests/timers/alarmtimer-suspend.c  |  22 +-
  .../testing/selftests/timers/inconsistency-check.c |  21 +-
  tools/testing/selftests/timers/leap-a-day.c        |   2 +-
  tools/testing/selftests/timers/mqueue-lat.c        |   2 +-
  tools/testing/selftests/timers/nanosleep.c         |  21 +-
  tools/testing/selftests/timers/nsleep-lat.c        |  22 +-
  tools/testing/selftests/timers/posix_timers.c      |  15 +-
  tools/testing/selftests/timers/raw_skew.c          |   4 +-
  tools/testing/selftests/timers/set-2038.c          |   3 +-
  tools/testing/selftests/timers/set-timer-lat.c     |  21 +-
  tools/testing/selftests/timers/valid-adjtimex.c    |   4 +-
  31 files changed, 701 insertions(+), 569 deletions(-)
  create mode 100644 Documentation/dev-tools/testing-devices.rst
  rename tools/testing/selftests/{sigaltstack => signal}/.gitignore (70%)
  rename tools/testing/selftests/{sigaltstack => signal}/Makefile (56%)
  rename tools/testing/selftests/{sigaltstack => signal}/current_stack_pointer.h (100%)
  create mode 100644 tools/testing/selftests/signal/mangle_uc_sigmask.c
  rename tools/testing/selftests/{sigaltstack => signal}/sas.c (100%)
----------------------------------------------------------------
--------------v8upExji9lbeNmEC9zZ6NCja
Content-Type: text/x-patch; charset=UTF-8;
 name="linux_kselftest-next-6.13-rc1.diff"
Content-Disposition: attachment; filename="linux_kselftest-next-6.13-rc1.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL0RvY3VtZW50YXRpb24vZGV2LXRvb2xzL2tzZWxmdGVzdC5yc3QgYi9E
b2N1bWVudGF0aW9uL2Rldi10b29scy9rc2VsZnRlc3QucnN0CmluZGV4IGYzNzY2ZTMyNmQx
ZS4uZmRiMWRmODY3ODNhIDEwMDY0NAotLS0gYS9Eb2N1bWVudGF0aW9uL2Rldi10b29scy9r
c2VsZnRlc3QucnN0CisrKyBiL0RvY3VtZW50YXRpb24vZGV2LXRvb2xzL2tzZWxmdGVzdC5y
c3QKQEAgLTMxLDYgKzMxLDE1IEBAIGtzZWxmdGVzdCBydW5zIGFzIGEgdXNlcnNwYWNlIHBy
b2Nlc3MuICBUZXN0cyB0aGF0IGNhbiBiZSB3cml0dGVuL3J1biBpbgogdXNlcnNwYWNlIG1h
eSB3aXNoIHRvIHVzZSB0aGUgYFRlc3QgSGFybmVzc2BfLiAgVGVzdHMgdGhhdCBuZWVkIHRv
IGJlCiBydW4gaW4ga2VybmVsIHNwYWNlIG1heSB3aXNoIHRvIHVzZSBhIGBUZXN0IE1vZHVs
ZWBfLgogCitEb2N1bWVudGF0aW9uIG9uIHRoZSB0ZXN0cworPT09PT09PT09PT09PT09PT09
PT09PT09PT0KKworRm9yIGRvY3VtZW50YXRpb24gb24gdGhlIGtzZWxmdGVzdHMgdGhlbXNl
bHZlcywgc2VlOgorCisuLiB0b2N0cmVlOjoKKworICAgdGVzdGluZy1kZXZpY2VzCisKIFJ1
bm5pbmcgdGhlIHNlbGZ0ZXN0cyAoaG90cGx1ZyB0ZXN0cyBhcmUgcnVuIGluIGxpbWl0ZWQg
bW9kZSkKID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09P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pfU0VUT0ZGU0VUIDB4MDEwMAogCiAjaW5jbHVkZSA8c3lzL3N5
c2NhbGwuaD4K

--------------v8upExji9lbeNmEC9zZ6NCja--

.
Subject: linux-next: duplicate patch in the crypto-current tree
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Herbert Xu <herbert@gondor.apana.org.au>, Linux Crypto List
 <linux-crypto@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Next
 Mailing List <linux-next@vger.kernel.org>
Date: Tue, 19 Nov 2024 07:53:39 +1100

.
Subject: linux-next: duplicate patches in the tip tree
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 "H. Peter Anvin" <hpa@zytor.com>, Peter Zijlstra <peterz@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Next
 Mailing List <linux-next@vger.kernel.org>
Date: Tue, 19 Nov 2024 08:02:59 +1100

.
Subject: [GIT PULL] x86/cpu for v6.13
From: Borislav Petkov <bp@alien8.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>
Date: Mon, 18 Nov 2024 22:05:08 +0100

Hi Linus,

please pull the x86/cpu lineup for v6.13.

Thx.

---

The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc:

  Linux 6.12-rc1 (2024-09-29 15:06:19 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip tags/x86_cpu_for_v6.13

for you to fetch changes up to f74642d81c24d9e69745cd0b75e1bddc81827606:

  x86/cpu: Remove redundant CONFIG_NUMA guard around numa_add_cpu() (2024-11-12 11:00:50 +0100)

----------------------------------------------------------------
- Add a feature flag which denotes AMD CPUs supporting workload classification
  with the purpose of using such hints when making scheduling decisions

- Determine the boost enumerator for each AMD core based on its type: efficiency
  or performance, in the cppc driver

- Add the type of a CPU to the topology CPU descriptor with the goal of
  supporting and making decisions based on the type of the respective core

- Add a feature flag to denote AMD cores which have heterogeneous topology and
  enable SD_ASYM_PACKING for those

- Check microcode revisions before disabling PCID on Intel

- Cleanups and fixlets

----------------------------------------------------------------
Borislav Petkov (AMD) (1):
      x86/cpu: Fix formatting of cpuid_bits[] in scattered.c

Mario Limonciello (2):
      x86/cpufeatures: Rename X86_FEATURE_FAST_CPPC to have AMD prefix
      x86/amd: Use heterogeneous core topology for identifying boost numerator

Pawan Gupta (1):
      x86/cpu: Add CPU type to struct cpuinfo_topology

Perry Yuan (3):
      x86/cpufeatures: Add X86_FEATURE_AMD_HETEROGENEOUS_CORES
      x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD
      x86/cpufeatures: Add X86_FEATURE_AMD_WORKLOAD_CLASS feature bit

Shivank Garg (1):
      x86/cpu: Remove redundant CONFIG_NUMA guard around numa_add_cpu()

Tony Luck (1):
      x86/cpu: Fix FAM5_QUARK_X1000 to use X86_MATCH_VFM()

Xi Ruoyao (1):
      x86/mm: Don't disable PCID when INVLPG has been fixed by microcode

 arch/x86/include/asm/cpufeatures.h              |  4 +-
 arch/x86/include/asm/intel-family.h             |  7 +++-
 arch/x86/include/asm/processor.h                | 18 ++++++++
 arch/x86/include/asm/topology.h                 |  9 ++++
 arch/x86/kernel/acpi/cppc.c                     | 23 ++++++++++
 arch/x86/kernel/cpu/common.c                    |  2 -
 arch/x86/kernel/cpu/debugfs.c                   |  1 +
 arch/x86/kernel/cpu/scattered.c                 | 56 +++++++++++++------------
 arch/x86/kernel/cpu/topology_amd.c              |  3 ++
 arch/x86/kernel/cpu/topology_common.c           | 34 +++++++++++++++
 arch/x86/kernel/smpboot.c                       |  5 ++-
 arch/x86/mm/init.c                              | 23 ++++++----
 arch/x86/platform/efi/quirks.c                  |  3 +-
 arch/x86/platform/intel-quark/imr.c             |  2 +-
 arch/x86/platform/intel-quark/imr_selftest.c    |  2 +-
 drivers/cpufreq/amd-pstate.c                    |  2 +-
 drivers/thermal/intel/intel_quark_dts_thermal.c |  2 +-
 tools/arch/x86/include/asm/cpufeatures.h        |  2 +-
 18 files changed, 149 insertions(+), 49 deletions(-)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

.
Subject: linux-next: Fixes tag needs some work in the drivers-x86 tree
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Next
 Mailing List <linux-next@vger.kernel.org>
Date: Tue, 19 Nov 2024 08:06:58 +1100

.
Subject: [GIT PULL] Devicetree updates for v6.13
From: Rob Herring <robh@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Saravana Kannan <saravanak@google.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Date: Mon, 18 Nov 2024 15:07:30 -0600

Linus,

Please pull DT updates for 6.13. There's a few things out of the 
normal spots in arch/ and sound/ which are some updates to callers of DT 
functions.

Rob


The following changes since commit 6e0391e48cf9fb8b1b5e27c0cbbaf2e4639f2c33:

  of: Skip kunit tests when arm64+ACPI doesn't populate root node (2024-10-10 12:43:01 -0500)

are available in the Git repository at:

  ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/robh/linux.git tags/devicetree-for-6.13

for you to fetch changes up to 28b513b5a683cf1e7125ba54ffe7ecb206ef4984:

  Merge branch 'dt/linus' into dt/next (2024-11-15 14:03:59 -0600)

----------------------------------------------------------------
Devicetree updates for v6.13:

Bindings:

- Enable dtc "interrupt_provider" warnings for binding examples.
  Fix the warnings in fsl,mu-msi and ti,sci-inta due to this.

- Convert zii,rave-sp-wdt, zii,rave-sp-pwrbutton,  and
  altr,fpga-passive-serial to DT schema format

- Add some documentation on the different forms of YAML text blocks
  which are a constant source of review comments

- Fix some schema errors in constraints for arrays

- Add compatibles for qcom,sar2130p-pdc and onnn,adt7462

DT core:

- Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n

- Add some warnings on deprecated address handling

- Rework early_init_dt_scan() so the arch can pass in the phys address
  of the DTB as __pa() is not always valid to use. This fixes a warning
  for arm64 with kexec.

- Add and use some new DT graph iterators for iterating over ports and
  endpoints

- Rework reserved-memory handling to be sized dynamically for fixed
  regions

- Optimize of_modalias() to avoid a strlen() call

- Constify struct device_node and property pointers where ever possible

----------------------------------------------------------------
Abel Vesa (1):
      dt-bindings: cache: qcom,llcc: Fix X1E80100 reg entries

Ba Jing (1):
      of:of_numa: remove unused macro

Chanh Nguyen (1):
      dt-bindings: trivial-devices: add onnn,adt7462

Dmitry Baryshkov (1):
      dt-bindings: interrupt-controller: qcom,pdc: Add SAR2130P compatible

Fabio Estevam (1):
      dt-bindings: fpga: altr,fpga-passive-serial: Convert to yaml

Frank Li (2):
      dt-bindings: input: convert zii,rave-sp-pwrbutton.txt to yaml
      dt-bindings: watchdog: convert zii,rave-sp-wdt.txt to yaml format

Kuninori Morimoto (9):
      of: property: add of_graph_get_next_port()
      of: property: add of_graph_get_next_port_endpoint()
      of: property: use new of_graph functions
      ASoC: test-component: use new of_graph functions
      ASoC: audio-graph-card: use new of_graph functions
      ASoC: audio-graph-card2: use new of_graph functions
      gpu: drm: omapdrm: use new of_graph functions
      fbdev: omapfb: use new of_graph functions
      media: xilinx-tpg: use new of_graph functions

Oreoluwa Babatunde (2):
      of: reserved_mem: Restructure how the reserved memory regions are processed
      of: reserved_mem: Add code to dynamically allocate reserved_mem array

Rob Herring (Arm) (16):
      dt-bindings: interrupt-controller: ti,sci-inta: Add missing "#interrupt-cells" to example
      dt-bindings: interrupt-controller: fsl,mu-msi: Drop "interrupt-controller" property
      dt-bindings: Fix array property constraints
      dt-bindings: writing-schema: Add details on YAML text blocks
      logic_pio: Constify fwnode_handle
      PCI: Constify pci_register_io_range() fwnode_handle
      of: Constify struct device_node function arguments
      of: Constify struct property pointers
      of: Constify of_changeset_entry function arguments
      of: Constify safe_name() kobject arg
      of/address: Constify of_busses[] array and pointers
      dt-bindings: Enable dtc "interrupt_provider" warnings
      of/fdt: Don't use default address cell sizes for address translation
      of: WARN on deprecated #address-cells/#size-cells handling
      of/address: Rework bus matching to avoid warnings
      Merge branch 'dt/linus' into dt/next

Sergey Shtylyov (1):
      of: module: remove strlen() call in of_modalias()

Stephen Boyd (1):
      of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n

Usama Arif (1):
      of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify

 Documentation/devicetree/bindings/Makefile         |   1 -
 .../devicetree/bindings/cache/l2c2x0.yaml          |   5 +-
 .../devicetree/bindings/cache/qcom,llcc.yaml       |  36 +++-
 .../devicetree/bindings/dma/dma-common.yaml        |   7 +-
 .../devicetree/bindings/example-schema.yaml        |   1 +
 .../bindings/fpga/altera-passive-serial.txt        |  29 ---
 .../bindings/fpga/altr,fpga-passive-serial.yaml    |  74 +++++++
 .../bindings/input/zii,rave-sp-pwrbutton.txt       |  22 --
 .../bindings/input/zii,rave-sp-pwrbutton.yaml      |  36 ++++
 .../bindings/interrupt-controller/arm,gic-v3.yaml  |  12 +-
 .../bindings/interrupt-controller/fsl,mu-msi.yaml  |   4 -
 .../bindings/interrupt-controller/qcom,pdc.yaml    |   1 +
 .../bindings/interrupt-controller/ti,sci-inta.yaml |   1 +
 .../bindings/media/i2c/thine,thp7312.yaml          |   3 +-
 .../bindings/memory-controllers/exynos-srom.yaml   |   5 +-
 .../devicetree/bindings/pci/brcm,stb-pcie.yaml     |   5 +-
 .../devicetree/bindings/soc/qcom/qcom,smp2p.yaml   |   3 +-
 .../devicetree/bindings/trivial-devices.yaml       |   2 +
 .../bindings/watchdog/zii,rave-sp-wdt.txt          |  39 ----
 .../bindings/watchdog/zii,rave-sp-wdt.yaml         |  47 +++++
 .../devicetree/bindings/writing-schema.rst         |  30 +++
 arch/arc/kernel/devtree.c                          |   2 +-
 arch/arm/kernel/devtree.c                          |   2 +-
 arch/arm64/kernel/setup.c                          |   6 +-
 arch/csky/kernel/setup.c                           |   4 +-
 arch/loongarch/kernel/setup.c                      |   2 +-
 arch/microblaze/kernel/prom.c                      |   2 +-
 arch/mips/kernel/prom.c                            |   2 +-
 arch/mips/kernel/relocate.c                        |   2 +-
 arch/nios2/kernel/prom.c                           |   4 +-
 arch/openrisc/kernel/prom.c                        |   2 +-
 arch/powerpc/kernel/dt_cpu_ftrs.c                  |   2 +-
 arch/powerpc/kernel/prom.c                         |   2 +-
 arch/powerpc/platforms/pseries/plpks.c             |   2 +-
 arch/riscv/kernel/setup.c                          |   2 +-
 arch/sh/kernel/setup.c                             |   2 +-
 arch/um/kernel/dtb.c                               |   2 +-
 arch/x86/kernel/devicetree.c                       |   2 +-
 arch/xtensa/kernel/setup.c                         |   2 +-
 drivers/gpu/drm/omapdrm/dss/dpi.c                  |   3 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c                  |   3 +-
 drivers/media/platform/xilinx/xilinx-tpg.c         |  14 +-
 drivers/of/.kunitconfig                            |   1 +
 drivers/of/Kconfig                                 |   2 +-
 drivers/of/address.c                               |  36 ++--
 drivers/of/base.c                                  |  48 +++--
 drivers/of/cpu.c                                   |   2 +-
 drivers/of/dynamic.c                               |   4 +-
 drivers/of/fdt.c                                   |  23 ++-
 drivers/of/fdt_address.c                           |   4 +-
 drivers/of/irq.c                                   |   4 +-
 drivers/of/kexec.c                                 |   2 +-
 drivers/of/kobj.c                                  |   8 +-
 drivers/of/module.c                                |   4 +-
 drivers/of/of_numa.c                               |   3 -
 drivers/of/of_private.h                            |  15 +-
 drivers/of/of_reserved_mem.c                       | 227 ++++++++++++++++-----
 drivers/of/overlay.c                               |  19 +-
 drivers/of/overlay_test.c                          |   2 +
 drivers/of/property.c                              | 109 ++++++++--
 drivers/of/resolver.c                              |  12 +-
 drivers/pci/pci.c                                  |   2 +-
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c         |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c      |  66 ------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c         |  20 +-
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c         |   3 +-
 include/linux/logic_pio.h                          |   6 +-
 include/linux/of.h                                 |  28 +--
 include/linux/of_address.h                         |   6 +-
 include/linux/of_fdt.h                             |   5 +-
 include/linux/of_graph.h                           |  49 +++++
 include/linux/of_irq.h                             |   4 +-
 include/linux/pci.h                                |   4 +-
 include/video/omapfb_dss.h                         |   8 -
 lib/logic_pio.c                                    |   4 +-
 sound/soc/generic/audio-graph-card.c               |   2 +-
 sound/soc/generic/audio-graph-card2.c              | 104 +++++-----
 sound/soc/generic/test-component.c                 |   3 +-
 78 files changed, 786 insertions(+), 483 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/fpga/altera-passive-serial.txt
 create mode 100644 Documentation/devicetree/bindings/fpga/altr,fpga-passive-serial.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.txt
 create mode 100644 Documentation/devicetree/bindings/input/zii,rave-sp-pwrbutton.yaml
 delete mode 100644 Documentation/devicetree/bindings/watchdog/zii,rave-sp-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/zii,rave-sp-wdt.yaml

.
Subject: [GIT PULL] HID for 6.13
From: Jiri Kosina <jikos@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 18 Nov 2024 22:16:01 +0100 (CET)

Linus,

please pull from

  git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git tags/hid-for-li=
nus-2024111801

to receive HID subsystem queue for 6.13 merge window.

Please note: there is one SHA that you might notice was not present in=20
linux-next, and that's e8a0581914bd ("HID: multitouch: make mt_set_mode()=
=20
less cryptic").

The reason for this is that there was a hiccup when merging this patch=20
originally, and the topic branch was based on some random state of the=20
for-next branch, so it contained a lot of unrelated churn. And I've=20
noticed that only now, when preparing the pull request. The end result is=
=20
identical on a code level, but I didn't want to send you the branch with=20
git merge history that makes no sense [1], so I've created [2] instead,=20
and that's the one present in this pull request.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/log/?h=3Dfo=
r-6.13/multitouch

Highlights:

=3D=3D=3D=3D=3D
- improvement of the way hid-bpf coexists with specific drivers=20
  (others than hid-generic) that are already bound to devices (Benjamin=20
  Tissoires)
- removal of three way-too-aggressive BUG_ON()s from HID drivers (He=20
  Lugang)
- assorted cleanups and small code fixes to HID core (Dmitry Torokhov, Yan=
=20
  Zhen, Nathan Chancellor, Andy Shevchenko)
- support for Corsair Void headset family (Stuart Hayhurst)
- Support for Goodix GT7986U SPI (Charles Wang)
- initial vendor-specific driver for Kysona, currently adding support for
  Kysona M600 (Lode Willems)
- other assorted code cleanups and small bugfixes all over the place
=3D=3D=3D=3D=3D

Thanks!

----------------------------------------------------------------
Andy Shevchenko (1):
      HID: debug: Remove duplicates from 'keys'

Bastien Nocera (3):
      HID: logitech-hidpp: Remove feature_type from hidpp_root_get_feature(=
)
      HID: steelseries: Fix battery requests stopping after some time
      HID: steelseries: Add capacity_level mapping

Benjamin Tissoires (12):
      HID: bpf: move HID-BPF report descriptor fixup earlier
      HID: core: save one kmemdup during .probe()
      HID: core: remove one more kmemdup on .probe()
      HID: bpf: allow write access to quirks field in struct hid_device
      selftests/hid: add dependency on hid_common.h
      selftests/hid: cleanup C tests by adding a common struct uhid_device
      selftests/hid: allow to parametrize bus/vid/pid/rdesc on the test dev=
ice
      HID: add per device quirk to force bind to hid-generic
      selftests/hid: add test for assigning a given device to hid-generic
      HID: bpf: Fix NKRO on Mistel MD770
      HID: bpf: Fix Rapoo M50 Plus Silent side buttons
      HID: bpf: drop use of Logical|Physical|UsageRange

Callahan Kovacs (1):
      HID: magicmouse: Apple Magic Trackpad 2 USB-C driver support

Charles Wang (4):
      HID: hid-goodix: Return 0 when receiving an empty HID feature package
      HID: hid-goodix: Fix HID get/set feature operation overwritten proble=
m
      dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
      HID: hid-goodix-spi: Add OF supports

Dmitry Torokhov (4):
      HID: simplify code in fetch_item()
      HID: simplify snto32()
      HID: stop exporting hid_snto32()
      HID: multitouch: make mt_set_mode() less cryptic

Erick Archer (1):
      HID: ishtp-hid-client: replace fake-flex arrays with flex-array membe=
rs

He Lugang (1):
      HID: replace BUG_ON() with WARN_ON()

Jason Gerecke (2):
      HID: wacom: Set eraser status when either 'Eraser' or 'Invert' usage =
is set
      HID: wacom: Interpret tilt data from Intuos Pro BT as signed values

Lode Willems (4):
      HID: Add IDs for Kysona
      HID: Kysona: Add basic battery reporting for Kysona M600
      HID: Kysona: check battery status every 5s using a workqueue
      HID: Kysona: add basic online status

Nathan Chancellor (1):
      HID: Remove default case statement in fetch_item()

Stuart Hayhurst (1):
      HID: corsair-void: Add Corsair Void headset family driver

Uwe Kleine-K=F6nig (1):
      HID: i2c-hid-of: Drop explicit initialization of struct i2c_device_id=
::driver_data to 0

Vincent Huang (1):
      HID: rmi: Add select RMI4_F3A in Kconfig

Vitaly Kuznetsov (1):
      HID: hyperv: streamline driver probe to avoid devres issues

Yan Zhen (1):
      HID: Fix typo in the comment

Zhang Lixu (1):
      HID: intel-ish-hid: Add firmware version sysfs attributes

 .../ABI/testing/sysfs-driver-hid-corsair-void      |  38 +
 .../bindings/input/goodix,gt7986u-spifw.yaml       |  69 ++
 drivers/hid/Kconfig                                |  13 +
 drivers/hid/Makefile                               |   3 +-
 drivers/hid/bpf/hid_bpf_dispatch.c                 |   9 +-
 drivers/hid/bpf/hid_bpf_struct_ops.c               |   1 +
 drivers/hid/bpf/progs/Huion__Dial-2.bpf.c          |  66 +-
 drivers/hid/bpf/progs/Huion__Inspiroy-2-S.bpf.c    |  60 +-
 drivers/hid/bpf/progs/Mistel__MD770.bpf.c          | 154 ++++
 drivers/hid/bpf/progs/Rapoo__M50-Plus-Silent.bpf.c | 148 ++++
 drivers/hid/bpf/progs/hid_report_helpers.h         |  36 +-
 drivers/hid/hid-asus.c                             |   2 +-
 drivers/hid/hid-core.c                             | 182 +++--
 drivers/hid/hid-corsair-void.c                     | 829 +++++++++++++++++=
++++
 drivers/hid/hid-cp2112.c                           |   3 +-
 drivers/hid/hid-debug.c                            |   9 +-
 drivers/hid/hid-generic.c                          |   3 +
 drivers/hid/hid-goodix-spi.c                       |  35 +-
 drivers/hid/hid-hyperv.c                           |  58 +-
 drivers/hid/hid-ids.h                              |   5 +
 drivers/hid/hid-kysona.c                           | 248 ++++++
 drivers/hid/hid-lg4ff.c                            |   3 +-
 drivers/hid/hid-logitech-hidpp.c                   |  74 +-
 drivers/hid/hid-magicmouse.c                       |  56 +-
 drivers/hid/hid-multitouch.c                       |  30 +-
 drivers/hid/hid-picolcd_fb.c                       |   2 +-
 drivers/hid/hid-sensor-custom.c                    |   2 +-
 drivers/hid/hid-sony.c                             |   3 +-
 drivers/hid/hid-steam.c                            |   2 +-
 drivers/hid/hid-steelseries.c                      |  19 +-
 drivers/hid/i2c-hid/i2c-hid-of.c                   |   6 +-
 drivers/hid/intel-ish-hid/ipc/pci-ish.c            |  45 ++
 drivers/hid/intel-ish-hid/ishtp-fw-loader.c        |   2 +-
 drivers/hid/intel-ish-hid/ishtp-hid-client.c       |  25 +-
 drivers/hid/intel-ish-hid/ishtp-hid.h              |  11 +-
 drivers/hid/intel-ish-hid/ishtp/client.c           |   2 +-
 drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h        |  12 +
 drivers/hid/intel-ish-hid/ishtp/loader.c           |  35 +-
 drivers/hid/intel-ish-hid/ishtp/loader.h           |  34 +
 drivers/hid/usbhid/hid-core.c                      |   2 +-
 drivers/hid/wacom_wac.c                            |  11 +-
 drivers/hid/wacom_wac.h                            |   2 +-
 include/linux/hid.h                                |  21 +-
 include/linux/hid_bpf.h                            |  11 +-
 tools/testing/selftests/hid/Makefile               |   2 +-
 tools/testing/selftests/hid/hid_bpf.c              | 151 ++--
 tools/testing/selftests/hid/hid_common.h           | 112 ++-
 tools/testing/selftests/hid/hidraw.c               |  36 +-
 tools/testing/selftests/hid/progs/hid.c            |  12 +
 .../testing/selftests/hid/progs/hid_bpf_helpers.h  |   6 +-
 50 files changed, 2288 insertions(+), 412 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-hid-corsair-void
 create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-=
spifw.yaml
 create mode 100644 drivers/hid/bpf/progs/Mistel__MD770.bpf.c
 create mode 100644 drivers/hid/bpf/progs/Rapoo__M50-Plus-Silent.bpf.c
 create mode 100644 drivers/hid/hid-corsair-void.c
 create mode 100644 drivers/hid/hid-kysona.c

--=20
Jiri Kosina
SUSE Labs


.
Subject: [for-next][PATCH 0/5] tools/tracing: Last minute updates for 6.13
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>
Date: Mon, 18 Nov 2024 16:41:22 -0500

.
Subject: [for-next][PATCH 1/5] rtla/timerlat: Do not set params->user_workload with -U
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>
Date: Mon, 18 Nov 2024 16:41:23 -0500

.
Subject: [for-next][PATCH 2/5] tools/rtla: Improve code readability in timerlat_load.py
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 "lgoncalv@redhat.com" <lgoncalv@redhat.com>,
 Furkan Onder <furkanonder@protonmail.com>
Date: Mon, 18 Nov 2024 16:41:24 -0500

.
Subject: [for-next][PATCH 3/5] tools/rtla: Enhance argument parsing in timerlat_load.py
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 "lgoncalv@redhat.com" <lgoncalv@redhat.com>,
 Furkan Onder <furkanonder@protonmail.com>
Date: Mon, 18 Nov 2024 16:41:25 -0500

.
Subject: [for-next][PATCH 5/5] verification/dot2: Improve dot parser robustness
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 Gabriele Monaco <gmonaco@redhat.com>
Date: Mon, 18 Nov 2024 16:41:27 -0500

.
Subject: [for-next][PATCH 4/5] tools/rtla: Improve exception handling in timerlat_load.py
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Tomas Glozar <tglozar@redhat.com>,
 John Kacur <jkacur@redhat.com>,
 "lgoncalv@redhat.com" <lgoncalv@redhat.com>,
 Furkan Onder <furkanonder@protonmail.com>
Date: Mon, 18 Nov 2024 16:41:26 -0500

.
Subject: [syzbot] [bcachefs?] kernel BUG in bch2_bucket_alloc_trans (3)
From: syzbot <syzbot+592425844580a6598410@syzkaller.appspotmail.com>
To: kent.overstreet@linux.dev, linux-bcachefs@vger.kernel.org, 
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Date: Mon, 18 Nov 2024 13:41:30 -0800

.
Subject: [PATCH] media: i2c: imx412: Add missing newline to prints
From: Luca Weiss <luca.weiss@fairphone.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, 
 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, 
 linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, 
 Luca Weiss <luca.weiss@fairphone.com>
Date: Mon, 18 Nov 2024 22:45:46 +0100

.
Subject: [PATCH v2] mm: Respect mmap hint address when aligning for THP
From: Kalesh Singh <kaleshsingh@google.com>
Cc: kernel-team@android.com, android-mm@google.com, 
	Kalesh Singh <kaleshsingh@google.com>, Andrew Morton <akpm@linux-foundation.org>, 
	Vlastimil Babka <vbabka@suse.cz>, Yang Shi <yang@os.amperecomputing.com>, 
	Rik van Riel <riel@surriel.com>, Ryan Roberts <ryan.roberts@arm.com>, 
	Suren Baghdasaryan <surenb@google.com>, Minchan Kim <minchan@kernel.org>, Hans Boehm <hboehm@google.com>, 
	Lokesh Gidra <lokeshgidra@google.com>, stable@vger.kernel.org, 
	"Liam R. Howlett" <Liam.Howlett@oracle.com>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com>, 
	Jann Horn <jannh@google.com>, Yang Shi <shy828301@gmail.com>, linux-mm@kvack.org, 
	linux-kernel@vger.kernel.org
Date: Mon, 18 Nov 2024 13:46:48 -0800

.
Subject: [PATCH] drm/amd/pm: prevent invalid fan speed value in smu13 driver
From: Murad Masimov <m.masimov@maxima.ru>
To: Kenneth Feng <kenneth.feng@amd.com>
Date: Mon, 18 Nov 2024 15:42:17 +0300

.
