mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtc: zynqmp: Disable the build as a module
@ 2017-07-19 11:39 Michal Simek
  2017-08-21  8:46 ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2017-07-19 11:39 UTC (permalink / raw)
  To: linux-kernel, monstr
  Cc: Sören Brinkmann, linux-rtc, Alessandro Zummo,
	Alexandre Belloni, linux-arm-kernel

The patch:
"timers: Introduce in-kernel alarm-timer interface"
(sha1: ff3ead96d17f47ee70c294a5cc2cce9b61e82f0f)
introduced new requirement that RTC drivers with alarm functionality
can't be used as a module.
When module is unloaded there is still a reference that's why
rtc_device_release() is not called and ida is not freed.

That's why when module is loaded again it can't use the same RTC number
based on aliases.

Log:
sh-4.3# modprobe rtc-zynqmp
[   42.468565] rtc_zynqmp ffa60000.rtc: rtc core: registered
ffa60000.rtc as rtc5
sh-4.3# rmmod rtc-zynqmp
sh-4.3# modprobe rtc-zynqmp
[   48.648222] rtc_zynqmp ffa60000.rtc: /aliases ID 5 not available
[   48.654280] rtc_zynqmp ffa60000.rtc: rtc core: registered
ffa60000.rtc as rtc0

This patch is removing module support which is just a workaround till
alarm-timer interface is fixed to support device releasing when alarm
timer is not used.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Based on discussion:
https://www.mail-archive.com/rtc-linux@googlegroups.com/msg00908.html

---
 drivers/rtc/Kconfig      |  2 +-
 drivers/rtc/rtc-zynqmp.c | 15 +--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 72419ac2c52a..a2bbe7c2cf92 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1225,7 +1225,7 @@ config RTC_DRV_OPAL
 	  will be called rtc-opal.
 
 config RTC_DRV_ZYNQMP
-	tristate "Xilinx Zynq Ultrascale+ MPSoC RTC"
+	bool "Xilinx Zynq Ultrascale+ MPSoC RTC"
 	depends on OF
 	help
 	  If you say yes here you get support for the RTC controller found on
diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index da18a8ae3c1d..5fc50145dbd2 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -268,14 +268,6 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(xrtcdev->rtc);
 }
 
-static int xlnx_rtc_remove(struct platform_device *pdev)
-{
-	xlnx_rtc_alarm_irq_enable(&pdev->dev, 0);
-	device_init_wakeup(&pdev->dev, 0);
-
-	return 0;
-}
-
 static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -312,7 +304,6 @@ static int __maybe_unused xlnx_rtc_resume(struct device *dev)
 
 static struct platform_driver xlnx_rtc_driver = {
 	.probe		= xlnx_rtc_probe,
-	.remove		= xlnx_rtc_remove,
 	.driver		= {
 		.name	= KBUILD_MODNAME,
 		.pm	= &xlnx_rtc_pm_ops,
@@ -320,8 +311,4 @@ static int __maybe_unused xlnx_rtc_resume(struct device *dev)
 	},
 };
 
-module_platform_driver(xlnx_rtc_driver);
-
-MODULE_DESCRIPTION("Xilinx Zynq MPSoC RTC driver");
-MODULE_AUTHOR("Xilinx Inc.");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xlnx_rtc_driver);
-- 
1.9.1

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

* Re: [PATCH] rtc: zynqmp: Disable the build as a module
  2017-07-19 11:39 [PATCH] rtc: zynqmp: Disable the build as a module Michal Simek
@ 2017-08-21  8:46 ` Alexandre Belloni
  2017-08-21 10:49   ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2017-08-21  8:46 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, Sören Brinkmann, linux-rtc,
	Alessandro Zummo, linux-arm-kernel

Hi,

As discussed, I will not apply that patch and instead will push for:
https://patchwork.kernel.org/patch/9911471/

On 19/07/2017 at 13:39:57 +0200, Michal Simek wrote:
> The patch:
> "timers: Introduce in-kernel alarm-timer interface"
> (sha1: ff3ead96d17f47ee70c294a5cc2cce9b61e82f0f)
> introduced new requirement that RTC drivers with alarm functionality
> can't be used as a module.
> When module is unloaded there is still a reference that's why
> rtc_device_release() is not called and ida is not freed.
> 
> That's why when module is loaded again it can't use the same RTC number
> based on aliases.
> 
> Log:
> sh-4.3# modprobe rtc-zynqmp
> [   42.468565] rtc_zynqmp ffa60000.rtc: rtc core: registered
> ffa60000.rtc as rtc5
> sh-4.3# rmmod rtc-zynqmp
> sh-4.3# modprobe rtc-zynqmp
> [   48.648222] rtc_zynqmp ffa60000.rtc: /aliases ID 5 not available
> [   48.654280] rtc_zynqmp ffa60000.rtc: rtc core: registered
> ffa60000.rtc as rtc0
> 
> This patch is removing module support which is just a workaround till
> alarm-timer interface is fixed to support device releasing when alarm
> timer is not used.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Based on discussion:
> https://www.mail-archive.com/rtc-linux@googlegroups.com/msg00908.html
> 
> ---
>  drivers/rtc/Kconfig      |  2 +-
>  drivers/rtc/rtc-zynqmp.c | 15 +--------------
>  2 files changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 72419ac2c52a..a2bbe7c2cf92 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1225,7 +1225,7 @@ config RTC_DRV_OPAL
>  	  will be called rtc-opal.
>  
>  config RTC_DRV_ZYNQMP
> -	tristate "Xilinx Zynq Ultrascale+ MPSoC RTC"
> +	bool "Xilinx Zynq Ultrascale+ MPSoC RTC"
>  	depends on OF
>  	help
>  	  If you say yes here you get support for the RTC controller found on
> diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
> index da18a8ae3c1d..5fc50145dbd2 100644
> --- a/drivers/rtc/rtc-zynqmp.c
> +++ b/drivers/rtc/rtc-zynqmp.c
> @@ -268,14 +268,6 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
>  	return PTR_ERR_OR_ZERO(xrtcdev->rtc);
>  }
>  
> -static int xlnx_rtc_remove(struct platform_device *pdev)
> -{
> -	xlnx_rtc_alarm_irq_enable(&pdev->dev, 0);
> -	device_init_wakeup(&pdev->dev, 0);
> -
> -	return 0;
> -}
> -
>  static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
> @@ -312,7 +304,6 @@ static int __maybe_unused xlnx_rtc_resume(struct device *dev)
>  
>  static struct platform_driver xlnx_rtc_driver = {
>  	.probe		= xlnx_rtc_probe,
> -	.remove		= xlnx_rtc_remove,
>  	.driver		= {
>  		.name	= KBUILD_MODNAME,
>  		.pm	= &xlnx_rtc_pm_ops,
> @@ -320,8 +311,4 @@ static int __maybe_unused xlnx_rtc_resume(struct device *dev)
>  	},
>  };
>  
> -module_platform_driver(xlnx_rtc_driver);
> -
> -MODULE_DESCRIPTION("Xilinx Zynq MPSoC RTC driver");
> -MODULE_AUTHOR("Xilinx Inc.");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(xlnx_rtc_driver);
> -- 
> 1.9.1
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* Re: [PATCH] rtc: zynqmp: Disable the build as a module
  2017-08-21  8:46 ` Alexandre Belloni
@ 2017-08-21 10:49   ` Michal Simek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2017-08-21 10:49 UTC (permalink / raw)
  To: Alexandre Belloni, Michal Simek
  Cc: linux-kernel, Sören Brinkmann, linux-rtc, Alessandro Zummo,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 208 bytes --]

On 21.8.2017 10:46, Alexandre Belloni wrote:
> Hi,
> 
> As discussed, I will not apply that patch and instead will push for:
> https://patchwork.kernel.org/patch/9911471/

no problem with this.

M


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2017-08-21 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 11:39 [PATCH] rtc: zynqmp: Disable the build as a module Michal Simek
2017-08-21  8:46 ` Alexandre Belloni
2017-08-21 10:49   ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®