Message ID | 20230814073924.1066390-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2592564vqi; Mon, 14 Aug 2023 01:11:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVi/vwyBQ8y+sC3Ya/qX+2Y9dvsJ1hn2JL1Gx/5bOyIyN7r3WAYDUlGbG7Yv0slgCSxmWd X-Received: by 2002:a05:6358:430e:b0:129:c50d:6a37 with SMTP id r14-20020a056358430e00b00129c50d6a37mr7194205rwc.16.1692000662577; Mon, 14 Aug 2023 01:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692000662; cv=none; d=google.com; s=arc-20160816; b=PvUnhKwqIlesBjlCrS2CPJxIQ2YJy3qOiOrUsnOVs6utJSzKUot1XLQgrVHS185x28 taF5zUGS75TnFFHq9IBD301+/oit1+1UUF8L6JvUDthbUeWZYssOzCnzmvPYxMey7N9L vVaJXDqZAO2F03zq5gDG/E4MlB1Le4pB0LgNxtypTdLGmCTtnXHSPsCSTpw/tTy49ETI Wvbj1dv5fnEsJgD85hwJJEhd51+tzkTj8405HtYXavkNAmF93mDH3EC1x8/765yiPpjs 5XOvYHYENlYQvcG3JGEGZXlL5BU47thTGtoTiQrWA/1EewiOeOhe4Ey48XJWiSQ4hWA9 iZkA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=N4EWnn28IkPRNoL7Axe9FTyMJv0nAchBkTjn5AGtOYc=; fh=fMnZi4KuePuHxbZev+VeXCBNB9z31b5//W1Y8XgnUVE=; b=xwuc/ylk7/ZbvJ4OdlcCaTkSS9UgnXX+GDCf+23gqzIzv7Sn51HhzV9qlaJUvhegWB xjwYpEmDoc7zcbJkokfLyC/ElhG879lBNeizg4peBS2ukMSJeAXHnX9mmmXLvx4Q9aI0 ko6IcswMnB0Se3OV8+Peo3r0eN+9FQAw5OUOQzUrTgoCVZt/jt7NX4ikANax1ondjeSR E/ka1TqbpSWJsK0uNgAhYMjQfxujwm20pZ+t3w/s46ctqvZVH34W+ixS/BpoRF8Wxv0A Diat5nR685OIxhchBCP7PUoJtu+VEtBY2rb6lbZi0lgWYmSsmDM4rke2ax+53hz8iZrb WYtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q9n6wBSp; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w185-20020a6382c2000000b005653351f94asi7676669pgd.876.2023.08.14.01.10.49; Mon, 14 Aug 2023 01:11:02 -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=@kernel.org header.s=k20201202 header.b=Q9n6wBSp; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233940AbjHNHj7 (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Mon, 14 Aug 2023 03:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233586AbjHNHjf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Aug 2023 03:39:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4546D115; Mon, 14 Aug 2023 00:39:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D6B0A641EA; Mon, 14 Aug 2023 07:39:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68DA5C433C7; Mon, 14 Aug 2023 07:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691998774; bh=kjg4TBwaNAs7v3/kzjzI7ssu51NWiAz4yaBXH6sVnzA=; h=From:To:Cc:Subject:Date:From; b=Q9n6wBSpeCAmsniOpaTf36ptveR2UoXu9MK6Mg9csJErcjWWaZ0gtQktyJK1gNf/h WwY2PMo9Qq4DkFDKsASy57be6NJtijZma9cXeMQspZmRhdy3g5c0qZt25Zu8Q1ztaw 03Gve2RcnhifH0vYp3NucfkqXMk4gkYxqmWEJON5KmHtNjQRFnzpsZCdzwQXbSFPdy ny1PuHu0F+ywtghptl2tMgzy5pXmvjjebtmonM9B5mtdzHCVcC7vB99LDryG0tgq4F 4Hx3r9yZQDscCgcF6QwomrwgO5nB1NMYiuy5uk8l8KBRugKEioKRNeSzknjWE9wB9J xHoKHHTrBc+wA== From: Arnd Bergmann <arnd@kernel.org> To: Wim Van Sebroeck <wim@linux-watchdog.org>, Guenter Roeck <linux@roeck-us.net>, Hans de Goede <hdegoede@redhat.com>, Henning Schild <henning.schild@siemens.com> Cc: "xingtong . wu" <xingtong_wu@163.com>, Arnd Bergmann <arnd@arndb.de>, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] watchdog: simatic: add PCI dependency Date: Mon, 14 Aug 2023 09:38:50 +0200 Message-Id: <20230814073924.1066390-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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: INBOX X-GMAIL-THRID: 1774191287214940245 X-GMAIL-MSGID: 1774191287214940245 |
Series |
watchdog: simatic: add PCI dependency
|
|
Commit Message
Arnd Bergmann
Aug. 14, 2023, 7:38 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The simatic-ipc driver no longer depends on PCI, but its watchdog portion still needs it, otherwise P2SB runs into a build failure: WARNING: unmet direct dependencies detected for P2SB Depends on [n]: PCI [=n] && X86 [=y] Selected by [m]: - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); Add back the minimum dependendency to make it build in random configurations again. Fixes: b72da71ce24b0 ("platform/x86: simatic-ipc: drop PCI runtime depends and header") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi On 2023/8/14 15:38, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The simatic-ipc driver no longer depends on PCI, but its watchdog portion > still needs it, otherwise P2SB runs into a build failure: If the simatic-ipc driver no longer depends on PCI, you can delete the dependency here: https://elixir.bootlin.com/linux/v6.5-rc6/source/drivers/platform/x86/Kconfig#L1079 > > WARNING: unmet direct dependencies detected for P2SB > Depends on [n]: PCI [=n] && X86 [=y] > Selected by [m]: > - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] > > drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); > > Add back the minimum dependendency to make it build in random configurations > again. > > Fixes: b72da71ce24b0 ("platform/x86: simatic-ipc: drop PCI runtime depends and header") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/watchdog/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 04e9b40cf7d53..09452384221a4 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -1680,7 +1680,7 @@ config NIC7018_WDT > > config SIEMENS_SIMATIC_IPC_WDT > tristate "Siemens Simatic IPC Watchdog" > - depends on SIEMENS_SIMATIC_IPC > + depends on SIEMENS_SIMATIC_IPC && PCI The SIEMENS_SIMATIC_IPC_WDT does not depends on PCI directly, it should depends on P2SB, then P2SB depends on PCI > default y > select WATCHDOG_CORE > select P2SB You can replace the "select" to "depends on" instead. Reviewed-by: Xing Tong Wu <xingtong.wu@siemens.com> -- Xing Tong
Hi, On 8/14/23 09:38, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The simatic-ipc driver no longer depends on PCI, but its watchdog portion > still needs it, otherwise P2SB runs into a build failure: > > WARNING: unmet direct dependencies detected for P2SB > Depends on [n]: PCI [=n] && X86 [=y] > Selected by [m]: > - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] > > drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); > > Add back the minimum dependendency to make it build in random configurations > again. > > Fixes: b72da71ce24b0 ("platform/x86: simatic-ipc: drop PCI runtime depends and header") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Thanks, patch looks good to me: Reviewed-by: Hans de Goede <hdegoede@redhat.com> Wachdog maintainers the commit causing the fixed issue is part of my platform-drivers-x86-simatic-ipc branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=platform-drivers-x86-simatic-ipc And more importantly that branch already contains a conflicting commit to the SIEMENS_SIMATIC_IPC_WDT Kconfig entry, which was merged through that branch with Guenter's ack. So I'll also pick up this fix and merge it through that branch to avoid conflicts. Regards, Hans > --- > drivers/watchdog/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 04e9b40cf7d53..09452384221a4 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -1680,7 +1680,7 @@ config NIC7018_WDT > > config SIEMENS_SIMATIC_IPC_WDT > tristate "Siemens Simatic IPC Watchdog" > - depends on SIEMENS_SIMATIC_IPC > + depends on SIEMENS_SIMATIC_IPC && PCI > default y > select WATCHDOG_CORE > select P2SB
Hi, On 8/14/23 09:38, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The simatic-ipc driver no longer depends on PCI, but its watchdog portion > still needs it, otherwise P2SB runs into a build failure: > > WARNING: unmet direct dependencies detected for P2SB > Depends on [n]: PCI [=n] && X86 [=y] > Selected by [m]: > - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] > > drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); > > Add back the minimum dependendency to make it build in random configurations > again. > > Fixes: b72da71ce24b0 ("platform/x86: simatic-ipc: drop PCI runtime depends and header") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Thank you for your patch, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window. Regards, Hans > --- > drivers/watchdog/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 04e9b40cf7d53..09452384221a4 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -1680,7 +1680,7 @@ config NIC7018_WDT > > config SIEMENS_SIMATIC_IPC_WDT > tristate "Siemens Simatic IPC Watchdog" > - depends on SIEMENS_SIMATIC_IPC > + depends on SIEMENS_SIMATIC_IPC && PCI > default y > select WATCHDOG_CORE > select P2SB
Hi Xing Tong, On 8/14/23 10:27, xingtong.wu wrote: > Hi > > On 2023/8/14 15:38, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.de> >> >> The simatic-ipc driver no longer depends on PCI, but its watchdog portion >> still needs it, otherwise P2SB runs into a build failure: > > If the simatic-ipc driver no longer depends on PCI, you can > delete the dependency here: > https://elixir.bootlin.com/linux/v6.5-rc6/source/drivers/platform/x86/Kconfig#L1079 That has already been done, the latest code of the simatic-ipc support lives here: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=platform-drivers-x86-simatic-ipc and there that depends on has been dropped, which is actually what is causing the issue this patch addresses. >> WARNING: unmet direct dependencies detected for P2SB >> Depends on [n]: PCI [=n] && X86 [=y] >> Selected by [m]: >> - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] >> >> drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] >> pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); >> >> Add back the minimum dependendency to make it build in random configurations >> again. >> >> Fixes: b72da71ce24b0 ("platform/x86: simatic-ipc: drop PCI runtime depends and header") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> >> --- >> drivers/watchdog/Kconfig | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig >> index 04e9b40cf7d53..09452384221a4 100644 >> --- a/drivers/watchdog/Kconfig >> +++ b/drivers/watchdog/Kconfig >> @@ -1680,7 +1680,7 @@ config NIC7018_WDT >> >> config SIEMENS_SIMATIC_IPC_WDT >> tristate "Siemens Simatic IPC Watchdog" >> - depends on SIEMENS_SIMATIC_IPC >> + depends on SIEMENS_SIMATIC_IPC && PCI > > The SIEMENS_SIMATIC_IPC_WDT does not depends on PCI directly, > it should depends on P2SB, then P2SB depends on PCI P2SB is a helper library and as such it is selected by all code which needs it and when selecting the Kconfig entry doing the selecting Kconfig must either depend on or select all the Kconfig dependencies of the Kconfig entry it is selecting. > >> default y >> select WATCHDOG_CORE >> select P2SB > > You can replace the "select" to "depends on" instead. No that would mean that we start mixing select and depends on for P2SB, where as currently all users use select. Mixing select and depends on is know to cause dependency cycle issues and thus should be avoided. Arnd's patch is correct as is (and I have merged it this morning). Regards, Hans
On Mon, Aug 14, 2023, at 10:27, xingtong.wu wrote: >> >> config SIEMENS_SIMATIC_IPC_WDT >> tristate "Siemens Simatic IPC Watchdog" >> - depends on SIEMENS_SIMATIC_IPC >> + depends on SIEMENS_SIMATIC_IPC && PCI > > The SIEMENS_SIMATIC_IPC_WDT does not depends on PCI directly, > it should depends on P2SB, then P2SB depends on PCI > >> default y >> select WATCHDOG_CORE >> select P2SB > > You can replace the "select" to "depends on" instead. That would also work, but it's generally best not to mix 'depends on' and 'select' for the same symbol. Changing all three 'select P2SB' to 'depends on P2SB', or removing the prompt to turn P2SB itself into a hidden symbol is probably a good follow-up patch, but I'd keep that separate from the regression fix. Arnd
Hi, On 8/14/23 10:48, Arnd Bergmann wrote: > On Mon, Aug 14, 2023, at 10:27, xingtong.wu wrote: > >>> >>> config SIEMENS_SIMATIC_IPC_WDT >>> tristate "Siemens Simatic IPC Watchdog" >>> - depends on SIEMENS_SIMATIC_IPC >>> + depends on SIEMENS_SIMATIC_IPC && PCI >> >> The SIEMENS_SIMATIC_IPC_WDT does not depends on PCI directly, >> it should depends on P2SB, then P2SB depends on PCI >> >>> default y >>> select WATCHDOG_CORE >>> select P2SB >> >> You can replace the "select" to "depends on" instead. > > That would also work, but it's generally best not to mix > 'depends on' and 'select' for the same symbol. Changing > all three 'select P2SB' to 'depends on P2SB', or removing > the prompt to turn P2SB itself into a hidden symbol is > probably a good follow-up patch, but I'd keep that separate > from the regression fix. Right P2SB would benefit from being changed into a hidden symbol. Andy, any comments on making P2SB a hidden symbol ? Regards, Hans > > Arnd >
On Mon, Aug 14, 2023 at 09:38:50AM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The simatic-ipc driver no longer depends on PCI, but its watchdog portion > still needs it, otherwise P2SB runs into a build failure: > > WARNING: unmet direct dependencies detected for P2SB > Depends on [n]: PCI [=n] && X86 [=y] > Selected by [m]: > - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] > > drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] > pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); > > Add back the minimum dependendency to make it build in random configurations > again. > > Fixes: b72da71ce24b0 ("platform/x86: simatic-ipc: drop PCI runtime depends and header") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> > --- > drivers/watchdog/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 04e9b40cf7d53..09452384221a4 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -1680,7 +1680,7 @@ config NIC7018_WDT > > config SIEMENS_SIMATIC_IPC_WDT > tristate "Siemens Simatic IPC Watchdog" > - depends on SIEMENS_SIMATIC_IPC > + depends on SIEMENS_SIMATIC_IPC && PCI > default y > select WATCHDOG_CORE > select P2SB > -- > 2.39.2 >
On Mon, Aug 14, 2023 at 11:51 AM Hans de Goede <hdegoede@redhat.com> wrote: > On 8/14/23 10:48, Arnd Bergmann wrote: ... > Right P2SB would benefit from being changed into a hidden > symbol. Yes, I dunno why it wasn't that way from day 1. Perhaps due to the original contribution done by somebody else... > Andy, any comments on making P2SB a hidden symbol ? I'm fine with that.
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 04e9b40cf7d53..09452384221a4 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -1680,7 +1680,7 @@ config NIC7018_WDT config SIEMENS_SIMATIC_IPC_WDT tristate "Siemens Simatic IPC Watchdog" - depends on SIEMENS_SIMATIC_IPC + depends on SIEMENS_SIMATIC_IPC && PCI default y select WATCHDOG_CORE select P2SB