lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6d9c043-8627-4e12-b2db-be4eb50f78d8@nvidia.com>
Date: Fri, 24 Oct 2025 11:48:22 +0100
From: Jon Hunter <jonathanh@...dia.com>
To: Kartik Rajput <kkartik@...dia.com>, alexandre.belloni@...tlin.com,
 thierry.reding@...il.com, andriy.shevchenko@...ux.intel.com,
 linux-rtc@...r.kernel.org, linux-tegra@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/3] rtc: tegra: Add ACPI support



On 24/10/2025 07:49, Kartik Rajput wrote:
> Add ACPI support for Tegra RTC, which is available on Tegra241 and
> Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'.
> When ACPI boot is used, the RTC clock is configured by UEFI before
> the kernel boots. On device-tree boot, the probe must fail if clocks are
> not provided in the device-tree.
> 
> Signed-off-by: Kartik Rajput <kkartik@...dia.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> Changes in v3:
> 	* Add patch to use devm_clk_get_enabled().
> 	* Add patch to use pm_sleep_ptr().
> 	* Update commit message to specify clocks are requried for
> 	  device-tree boot.
> Changes in v2:
> 	* Dropped "linux/acpi.h" from includes.
> 	* Dropped redundant ', 0' part from tegra_rtc_acpi_match.
> 	* Replaced "is_of_node(dev_fwnode(&pdev->dev))" with
> 	  "dev_of_node(&pdev->dev)" to check device of node.
> 	* Dropped redundant of_node checks before accessing clock
> 	  related APIs.
> ---
>   drivers/rtc/rtc-tegra.c | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
> index e8c83a6a96b3..9e4e9c88178f 100644
> --- a/drivers/rtc/rtc-tegra.c
> +++ b/drivers/rtc/rtc-tegra.c
> @@ -274,6 +274,12 @@ static const struct of_device_id tegra_rtc_dt_match[] = {
>   };
>   MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match);
>   
> +static const struct acpi_device_id tegra_rtc_acpi_match[] = {
> +	{ "NVDA0280" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(acpi, tegra_rtc_acpi_match);
> +
>   static int tegra_rtc_probe(struct platform_device *pdev)
>   {
>   	struct tegra_rtc_info *info;
> @@ -300,9 +306,11 @@ static int tegra_rtc_probe(struct platform_device *pdev)
>   	info->rtc->ops = &tegra_rtc_ops;
>   	info->rtc->range_max = U32_MAX;
>   
> -	info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
> -	if (IS_ERR(info->clk))
> -		return PTR_ERR(info->clk);
> +	if (dev_of_node(&pdev->dev)) {
> +		info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
> +		if (IS_ERR(info->clk))
> +			return PTR_ERR(info->clk);
> +	}
>   
>   	/* set context info */
>   	info->pdev = pdev;
> @@ -386,6 +394,7 @@ static struct platform_driver tegra_rtc_driver = {
>   	.driver = {
>   		.name = "tegra_rtc",
>   		.of_match_table = tegra_rtc_dt_match,
> +		.acpi_match_table = tegra_rtc_acpi_match,
>   		.pm = &tegra_rtc_pm_ops,
>   	},
>   };


Reviewed-by: Jon Hunter <jonathanh@...dia.com>

Thanks!
Jon

-- 
nvpublic


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ