Message ID | 20230522105049.1467313-31-schnelle@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1355447vqo; Mon, 22 May 2023 03:57:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4X1V8nzmQwOnAGGxIUv4JBom8V62G7k4GEgSvZKB666nAztFU8z8gwDWrQmgEUvSXHPkwj X-Received: by 2002:a05:6a20:728c:b0:ff:da37:ae9 with SMTP id o12-20020a056a20728c00b000ffda370ae9mr11660434pzk.53.1684753059855; Mon, 22 May 2023 03:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684753059; cv=none; d=google.com; s=arc-20160816; b=1Dg2tyDqcO1fpfFB9hOADaTT7My4s9+Gs56hn8l8Bf6qXhfGoZczIlT0jjx5NlO9+z ZiycItnt2n19vuOz4nCrSmk1+WT9gmZXsArhLPU4oQ32WSfsVWRbvLlKJff3T2QKivU7 AWCRgn/UxdRAWQOgY+h7r+GqY0UB8XO7FfjYqqrEVQeGU2L36cfMYJo0TbBPj91j4uLl 58k5JzUEmNofesaxnxUv6cMBexYD2d1ESyDT+h+MViHeCr6ema3SndLNL0ggxQzqaiqy n9IF78BdEG+VSxFWNSvNclljgT1H+4hNTctnmFKQEidHEveSc+mvsk2xDdceAfoBVtis pQKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lZBL4kOttDo6OcG66doNlqIQcqB5P0FhRz/+1vMlQuY=; b=z9izuRn2Px+n3j9EG/F0DgKjfNHtt+D4aVLqrxzLI2BYBxwDOBs3bWOAyp8C4ePw6T Xp8yNi52HRWXcFirGIVnJzoxmnThFrgDphzPXc9rUPFzCc5Wj8jBx2fVU36o/zGQin0i vChPlZ7v5ewfWk0jlh+Glnqy/xLa1flxvtGydcGenCXuMM8wXURMtGfrXWfSiSV5qnVt 6ywI/IMvMx0vtCgu4QItz5U8MjtuyMU86ScS7fkbyG9m2jYon4aIOPYifAi6iCqy7axI X7nTOOlEcj7KNeoQsppTBGJjL1rYnr/VNs7aQeVQ9FaE81+HsbxkiowpvlGOCJWE9SyC hzAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gHWyLlkH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u70-20020a638549000000b0053415b1caa8si2681621pgd.157.2023.05.22.03.57.24; Mon, 22 May 2023 03:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=gHWyLlkH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232979AbjEVKzm (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Mon, 22 May 2023 06:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232964AbjEVKxU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 22 May 2023 06:53:20 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F315C6; Mon, 22 May 2023 03:51:48 -0700 (PDT) Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34M9qMHi014961; Mon, 22 May 2023 10:51:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=lZBL4kOttDo6OcG66doNlqIQcqB5P0FhRz/+1vMlQuY=; b=gHWyLlkHtb6/KkcLOk0kiDO3YAiF5owTVVnO4xbgW8rRjAczWz9y0j/jYNIP4E0sVdng 43vYZNsFOMWSisgqiyCBIUiWyAwHoRdt27RAUUH2kbKRb32exfT8JUm59icd5IG4+JMQ 7MlTrQ43639VIuXdUIzejmdYd9UojMe9bQImwx2OVYmkE8mVQrtwF1fyolOzLHfu6zAW iRfJ0Jl1QB50k7eTlHAduOmWsLMqJlioBsS3X+Re1MjAr8sMquDPRv/kgi4Sgv/avG8f QMKtWBtQ5F9MP6MGeqRBy9De1qj6/hNiW9JblElKJAoJz7wO9Mvx+ZNGnOSnjWBtTju9 Qg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqgk8s35k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:23 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34MAbZ1o023711; Mon, 22 May 2023 10:51:22 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qqgk8s34c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:22 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34M4jAdp004151; Mon, 22 May 2023 10:51:19 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3qppc10ru2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 10:51:19 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34MApGc121693072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 May 2023 10:51:16 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 462B12004D; Mon, 22 May 2023 10:51:16 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7C2C20040; Mon, 22 May 2023 10:51:15 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 22 May 2023 10:51:15 +0000 (GMT) From: Niklas Schnelle <schnelle@linux.ibm.com> To: Arnd Bergmann <arnd@arndb.de>, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Bjorn Helgaas <bhelgaas@google.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Alan Stern <stern@rowland.harvard.edu>, "Rafael J. Wysocki" <rafael@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Arnd Bergmann <arnd@kernel.org>, linux-rtc@vger.kernel.org Subject: [PATCH v5 30/44] rtc: add HAS_IOPORT dependencies Date: Mon, 22 May 2023 12:50:35 +0200 Message-Id: <20230522105049.1467313-31-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522105049.1467313-1-schnelle@linux.ibm.com> References: <20230522105049.1467313-1-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: GiA6URbS7rsQKqoZnW--h5JDhkw52A6k X-Proofpoint-ORIG-GUID: 9ylNKlDFRWujZ3NFph7DBqTz0Gp8JCtc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-22_06,2023-05-22_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=843 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1011 priorityscore=1501 adultscore=0 impostorscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220089 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766591624340497149?= X-GMAIL-MSGID: =?utf-8?q?1766591624340497149?= |
Series |
treewide: Remove I/O port accessors for HAS_IOPORT=n
|
|
Commit Message
Niklas Schnelle
May 22, 2023, 10:50 a.m. UTC
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> --- drivers/rtc/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Mon, 22 May 2023, Niklas Schnelle wrote: > diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig > index 753872408615..a38a919b3f15 100644 > --- a/drivers/rtc/Kconfig > +++ b/drivers/rtc/Kconfig > @@ -956,6 +956,7 @@ comment "Platform RTC drivers" > config RTC_DRV_CMOS > tristate "PC-style 'CMOS'" > depends on X86 || ARM || PPC || MIPS || SPARC64 > + depends on HAS_IOPORT || MACH_DECSTATION > default y if X86 > select RTC_MC146818_LIB > help For the DECstation part: Acked-by: Maciej W. Rozycki <macro@orcam.me.uk> Maciej
On Mon, 22 May 2023 12:50:35 +0200, Niklas Schnelle wrote: > In a future patch HAS_IOPORT=n will result in inb()/outb() and friends > not being declared. We thus need to add HAS_IOPORT as dependency for > those drivers using them. > > Applied, thanks! [30/44] rtc: add HAS_IOPORT dependencies commit: 8bb12adb214b2d7cdad84f89db2cbab4b2908b61 Best regards,
Hi Niklas, On Mon, May 22, 2023 at 12:51 PM Niklas Schnelle <schnelle@linux.ibm.com> wrote: > In a future patch HAS_IOPORT=n will result in inb()/outb() and friends > not being declared. We thus need to add HAS_IOPORT as dependency for > those drivers using them. > > Co-developed-by: Arnd Bergmann <arnd@kernel.org> > Signed-off-by: Arnd Bergmann <arnd@kernel.org> > Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Thanks for your patch, which is now commit 8bb12adb214b2d7c ("rtc: add HAS_IOPORT dependencies") upstream. > --- a/drivers/rtc/Kconfig > +++ b/drivers/rtc/Kconfig > @@ -1193,7 +1195,7 @@ config RTC_DRV_MSM6242 > > config RTC_DRV_BQ4802 > tristate "TI BQ4802" > - depends on HAS_IOMEM > + depends on HAS_IOMEM && HAS_IOPORT > help > If you say Y here you will get support for the TI > BQ4802 RTC chip. This driver can use either iomem or ioport. By adding a dependency on HAS_IOPORT, it can no longer be used on platforms that provide HAS_IOMEM only. Probably the driver should be refactored to make it use only the accessors that are available. Gr{oetje,eeting}s, Geert
On Tue, Jul 4, 2023, at 10:06, Geert Uytterhoeven wrote: > Hi Niklas, > > On Mon, May 22, 2023 at 12:51 PM Niklas Schnelle <schnelle@linux.ibm.com> wrote: >> In a future patch HAS_IOPORT=n will result in inb()/outb() and friends >> not being declared. We thus need to add HAS_IOPORT as dependency for >> those drivers using them. >> >> Co-developed-by: Arnd Bergmann <arnd@kernel.org> >> Signed-off-by: Arnd Bergmann <arnd@kernel.org> >> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> > > Thanks for your patch, which is now commit 8bb12adb214b2d7c ("rtc: > add HAS_IOPORT dependencies") upstream. > >> --- a/drivers/rtc/Kconfig >> +++ b/drivers/rtc/Kconfig >> @@ -1193,7 +1195,7 @@ config RTC_DRV_MSM6242 >> >> config RTC_DRV_BQ4802 >> tristate "TI BQ4802" >> - depends on HAS_IOMEM >> + depends on HAS_IOMEM && HAS_IOPORT >> help >> If you say Y here you will get support for the TI >> BQ4802 RTC chip. > > This driver can use either iomem or ioport. > By adding a dependency on HAS_IOPORT, it can no longer be used > on platforms that provide HAS_IOMEM only. You are correct, we could allow building this driver even without IOPORT and make it use ioport_map() or an #ifdef. > Probably the driver should be refactored to make it use only > the accessors that are available. Since the driver itself has no DT support, it looks like the only way it can be used is from the sparc64/ultra45 wrapper, but that architecture always provides CONFIG_IOPORT, so I don't think it makes any difference in the end. We can change this again if another user comes up. It might be good to know whether the machine uses a memory or I/O resource in its device tree. Arnd
Hi Arnd, On Tue, Jul 4, 2023 at 1:25 PM Arnd Bergmann <arnd@arndb.de> wrote: > On Tue, Jul 4, 2023, at 10:06, Geert Uytterhoeven wrote: > > On Mon, May 22, 2023 at 12:51 PM Niklas Schnelle <schnelle@linux.ibm.com> wrote: > >> In a future patch HAS_IOPORT=n will result in inb()/outb() and friends > >> not being declared. We thus need to add HAS_IOPORT as dependency for > >> those drivers using them. > >> > >> Co-developed-by: Arnd Bergmann <arnd@kernel.org> > >> Signed-off-by: Arnd Bergmann <arnd@kernel.org> > >> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> > > > > Thanks for your patch, which is now commit 8bb12adb214b2d7c ("rtc: > > add HAS_IOPORT dependencies") upstream. > > > >> --- a/drivers/rtc/Kconfig > >> +++ b/drivers/rtc/Kconfig > >> @@ -1193,7 +1195,7 @@ config RTC_DRV_MSM6242 > >> > >> config RTC_DRV_BQ4802 > >> tristate "TI BQ4802" > >> - depends on HAS_IOMEM > >> + depends on HAS_IOMEM && HAS_IOPORT > >> help > >> If you say Y here you will get support for the TI > >> BQ4802 RTC chip. > > > > This driver can use either iomem or ioport. > > By adding a dependency on HAS_IOPORT, it can no longer be used > > on platforms that provide HAS_IOMEM only. > > You are correct, we could allow building this driver even > without IOPORT and make it use ioport_map() or an #ifdef. > > > Probably the driver should be refactored to make it use only > > the accessors that are available. > > Since the driver itself has no DT support, it looks like the > only way it can be used is from the sparc64/ultra45 wrapper, > but that architecture always provides CONFIG_IOPORT, so I > don't think it makes any difference in the end. We can change > this again if another user comes up. Correct, I made the same reasoning after sending my previous email... > It might be good to know whether the machine uses a memory or > I/O resource in its device tree. Indeed. Gr{oetje,eeting}s, Geert
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 753872408615..a38a919b3f15 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -956,6 +956,7 @@ comment "Platform RTC drivers" config RTC_DRV_CMOS tristate "PC-style 'CMOS'" depends on X86 || ARM || PPC || MIPS || SPARC64 + depends on HAS_IOPORT || MACH_DECSTATION default y if X86 select RTC_MC146818_LIB help @@ -976,6 +977,7 @@ config RTC_DRV_CMOS config RTC_DRV_ALPHA bool "Alpha PC-style CMOS" depends on ALPHA + depends on HAS_IOPORT select RTC_MC146818_LIB default y help @@ -1193,7 +1195,7 @@ config RTC_DRV_MSM6242 config RTC_DRV_BQ4802 tristate "TI BQ4802" - depends on HAS_IOMEM + depends on HAS_IOMEM && HAS_IOPORT help If you say Y here you will get support for the TI BQ4802 RTC chip.