All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/2] ACPI: Add ACPI 6.5 fixed clock support
@ 2026-11-30 12:28 Paul Cercueil
  2026-11-30 12:28 ` [PATCH v6 1/2] ACPI: Add basic support for ACPI 6.5 fixed clock resources Paul Cercueil
  2026-11-30 12:28 ` [PATCH v6 2/2] clk: Search clocks of ACPI device with its companion device Paul Cercueil
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Cercueil @ 2026-11-30 12:28 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Russell King,
	Maciej Wieczor-Retman, Pawel Chmielewski
  Cc: linux-acpi, linux-arm-kernel, acpica-devel, linux-kernel,
	Thomas Petazzoni, Paul Cercueil

Hi Rafael, Russell,

Here's the v6 of my patchset that adds partial support for ACPI 6.5
clock resources.

This v6 adds a patch to clkdev, which updates clk_get() to use the ACPI
companion device if available, and fall back to the regular path if the
clock wasn't found there.

It also reworks the main patch, with quite a lot of changes, most
notably the switch from using devm functions which can't be used there.

This patchset was tested both for devices that are probed at boot, and
also through hot-plugging of ACPI tables using configfs. The ACPI
clocks are correctly probed when a new ACPI device is discovered, before
the driver probes, and are correctly unregistered when the hot-plugged
ACPI table is unloaded, after the driver is removed.

Changes in v6:

- [1/2]:
  - Return -EFAULT instead of -EINVAL on bad firmware data
  - Invert condition "res->type != ACPI_RESOURCE_TYPE_CLOCK_INPUT"
  - Rename acpi_platform_init_clocks() to acpi_dev_init_clocks(), and
    move it to drivers/acpi/resource.c
  - Make sure clock index is incremented even for non-fixed clocks
  - Use non-devm variants of the clk/clkdev APIs
  - Keep a list of the acpi_device's clk/clkdev data so that they can be
    unregistered on device removal
  - acpi_dev_init_clocks() is now called from acpi_bus_attach()
  - Add function acpi_dev_remove_clocks() to unregister the ACPI clocks,
    called on ACPI device removal
  - Add documentation for these two functions
  - Use acpi_handle_info() instead of dev_warn()

- [2/2]:
  - New patch

Cheers,
-Paul

Paul Cercueil (2):
  ACPI: Add basic support for ACPI 6.5 fixed clock resources
  clk: Search clocks of ACPI device with its companion device

 drivers/acpi/resource.c | 132 ++++++++++++++++++++++++++++++++++++++++
 drivers/acpi/scan.c     |   6 ++
 drivers/clk/clkdev.c    |  10 +++
 include/acpi/acpi_bus.h |   1 +
 include/linux/acpi.h    |   3 +
 5 files changed, 152 insertions(+)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [PATCH v6 2/2] clk: Search clocks of ACPI device with its companion device
@ 2026-11-30 18:19 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-11-30 18:19 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "too many reports for this commit"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20261130122827.157946-3-paul.cercueil@bootlin.com>
References: <20261130122827.157946-3-paul.cercueil@bootlin.com>
TO: Paul Cercueil <paul.cercueil@bootlin.com>
TO: "Rafael J . Wysocki" <rafael@kernel.org>
TO: Len Brown <lenb@kernel.org>
TO: Russell King <linux@armlinux.org.uk>
TO: "Maciej Wieczor-Retman" <maciej.wieczor-retman@intel.com>
TO: Pawel Chmielewski <pawel.chmielewski@intel.com>
CC: linux-acpi@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: acpica-devel@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
CC: Paul Cercueil <paul.cercueil@bootlin.com>

Hi Paul,

kernel test robot noticed the following build errors:

[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on rafael-pm/bleeding-edge linus/master v7.4-rc5 next-20261127]
[cannot apply to arm/for-next arm/fixes rmk-arm/clkdev]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Paul-Cercueil/ACPI-Add-basic-support-for-ACPI-6-5-fixed-clock-resources/20261130-132826
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20261130122827.157946-3-paul.cercueil%40bootlin.com
patch subject: [PATCH v6 2/2] clk: Search clocks of ACPI device with its companion device
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: xtensa-randconfig-1000-20261130 (https://download.01.org/0day-ci/archive/20261201/20261201021503.NmZo7brJ-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261201/20261201021503.NmZo7brJ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/20261201021503.NmZo7brJ-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/clk/clkdev.c: In function 'clk_get':
>> drivers/clk/clkdev.c:116:22: error: dereferencing pointer to incomplete type 'struct acpi_device'
      clk = clk_get(&adev->dev, con_id);
                         ^~


vim +116 drivers/clk/clkdev.c

05fd8e73e1357f arch/arm/common/clkdev.c Sascha Hauer        2009-03-07  100  
05fd8e73e1357f arch/arm/common/clkdev.c Sascha Hauer        2009-03-07  101  struct clk *clk_get(struct device *dev, const char *con_id)
05fd8e73e1357f arch/arm/common/clkdev.c Sascha Hauer        2009-03-07  102  {
05fd8e73e1357f arch/arm/common/clkdev.c Sascha Hauer        2009-03-07  103  	const char *dev_id = dev ? dev_name(dev) : NULL;
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  104  	struct acpi_device *adev;
4472287a3b2f52 drivers/clk/clkdev.c     Stephen Boyd        2018-12-19  105  	struct clk_hw *hw;
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  106  	struct clk *clk;
766e6a4ec602d0 drivers/clk/clkdev.c     Grant Likely        2012-04-09  107  
53ccb22b8d4a92 drivers/clk/clkdev.c     Bartosz Golaszewski 2018-06-28  108  	if (dev && dev->of_node) {
4472287a3b2f52 drivers/clk/clkdev.c     Stephen Boyd        2018-12-19  109  		hw = of_clk_get_hw(dev->of_node, 0, con_id);
4472287a3b2f52 drivers/clk/clkdev.c     Stephen Boyd        2018-12-19  110  		if (!IS_ERR(hw) || PTR_ERR(hw) == -EPROBE_DEFER)
a1c8d531c694e1 drivers/clk/clkdev.c     Jerome Brunet       2026-07-23  111  			return clk_hw_create_clk(dev, hw, dev_id, con_id, NULL);
766e6a4ec602d0 drivers/clk/clkdev.c     Grant Likely        2012-04-09  112  	}
05fd8e73e1357f arch/arm/common/clkdev.c Sascha Hauer        2009-03-07  113  
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  114  	if (dev && has_acpi_companion(dev)) {
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  115  		adev = ACPI_COMPANION(dev);
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30 @116  		clk = clk_get(&adev->dev, con_id);
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  117  		if (!IS_ERR(clk) || PTR_ERR(clk) != -ENOENT)
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  118  			return clk;
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  119  	}
53ea89e5ed06ee drivers/clk/clkdev.c     Paul Cercueil       2026-11-30  120  
efa850487a6b67 drivers/clk/clkdev.c     Stephen Boyd        2018-12-11  121  	return __clk_get_sys(dev, dev_id, con_id);
05fd8e73e1357f arch/arm/common/clkdev.c Sascha Hauer        2009-03-07  122  }
0318e693d3a568 arch/arm/common/clkdev.c Russell King        2008-11-09  123  EXPORT_SYMBOL(clk_get);
0318e693d3a568 arch/arm/common/clkdev.c Russell King        2008-11-09  124  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-30 18:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 12:28 [PATCH v6 0/2] ACPI: Add ACPI 6.5 fixed clock support Paul Cercueil
2026-11-30 12:28 ` [PATCH v6 1/2] ACPI: Add basic support for ACPI 6.5 fixed clock resources Paul Cercueil
2026-11-30 12:28 ` [PATCH v6 2/2] clk: Search clocks of ACPI device with its companion device Paul Cercueil
2026-11-30 16:44   ` kernel test robot
2026-11-30 17:15   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-11-30 18:19 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.