From patchwork Wed Jul 19 11:39:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 9851719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8847602BD for ; Wed, 19 Jul 2017 11:40:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FF1628634 for ; Wed, 19 Jul 2017 11:40:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8432128643; Wed, 19 Jul 2017 11:40:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C8DD28634 for ; Wed, 19 Jul 2017 11:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=RvzOZe+2LP6BygCPbOEsE6S9dR3Yprl7DIErZj+AI2M=; b=WYv Jztgsh2s7Zrg0B3jJE+8YFZEVbyXwEaAXHL+51oyWJf/b0S6ze5vEm6OXr1jsmyFoH+6BvvNBPtBu yRSeog7pjzpCC1CtmoEZprbdMKqoxwwX7Mj8nc0XI2j63RfcOTnE1oEmCvpyKThBJ1Bgc+qis2ZkS tIL4nDfBzBavTX49tTSAQoqsk6CBSUUpoRVjArsdx5H/0OIMsL9KCAhM1lihSc/3k4LcJ5s7Y3Bij EnABXwwIktEt1WENazLtMNfNoz+A0xqcMBHG939GFFkAv5lNYwWSoJVUbAd0JTXIpb6nAgRZhlfGT nLkR1o1TPLFa0T52goGsSHDW+PGZhxw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dXnLF-0000Ju-HF; Wed, 19 Jul 2017 11:40:33 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXnL7-0007OM-Gb for linux-arm-kernel@lists.infradead.org; Wed, 19 Jul 2017 11:40:30 +0000 Received: by mail-wm0-x243.google.com with SMTP id 143so353075wmu.5 for ; Wed, 19 Jul 2017 04:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=rLem+KiQJhwr2QjU//cKj/e3rRNc0bXlRa5qSmgDu0E=; b=qMEE05A+P96afO2x8+ChzxI/925a0YbhZQha4BUQndWH/bpoaq0TWVuP7M6KSQL3W6 ZL6LomW5FUQYios0RoTKzkkyQ8Ny1dAf6kVIrjnRbDqejLPOxrQ0u8PZiP9ga0U2Fm6Q FFdMdg9MGvle6gmmhy9/1AgRR75QPqS0m8WoTJOpFSpeFGINgts1bvkWDmf0MwdWHwvz Fnd4+KKOhDRXGNXvtpJUQEDdKXliSHJkVTEvcqFq3O3hEsc4yWI4aS7m+1ddZrEEjKJt wZBt0UgzVnBi47lavdjcv/If3nlfV0YsKwwyrp6XLuUwJdbkzkY0UgQKa/s7fgDik04w vdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=rLem+KiQJhwr2QjU//cKj/e3rRNc0bXlRa5qSmgDu0E=; b=p3BNjAmsvbOjwOkqaijnR81xFZujIxVz6OAeUM5D1+CKw/OkXbIgH7HnAEjIHa8uj7 IdMT5fBwUJOt+cghShcCyvRiFP71TRmBioHMpPuYjU+2ZVu32tSe+JugJAQTt9DzmC/D AICpVmc5hkA14+/+wNEc3DHI+z3bmWJrPOWG8MfqDIM9A9feLlKIWuKGwdNjk3Szo3tY Iz6kjV08X2vRJMG8E8e2TSKAAQvZW43A8cz1SDxQphJUkvQDsdNp68cO0KkSJj6qeE+8 tzZnG1wS9pxDCkA5n5/n/3Jb1c0p2pmzwSJN+h+epmDP2XmJCUdvUcR7jIc4121u8/gJ yCYQ== X-Gm-Message-State: AIVw110w+BFqqXn+08HWaBc8E4mfApkzk9OXDAFrzV4TRhZDd/WKj9yJ 5FeGFXxQck3SvbUL X-Received: by 10.28.232.29 with SMTP id f29mr5196667wmh.55.1500464402343; Wed, 19 Jul 2017 04:40:02 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id t12sm158098wmd.32.2017.07.19.04.40.01 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 19 Jul 2017 04:40:01 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH] rtc: zynqmp: Disable the build as a module Date: Wed, 19 Jul 2017 13:39:57 +0200 Message-Id: <9881f4ae2afb2cd671715bcd1fcb9035688c40c9.1500464394.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170719_044025_981998_9FF5322B X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , linux-arm-kernel@lists.infradead.org, =?UTF-8?q?S=C3=B6ren=20Brinkmann?= MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);