Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp593677pxt; Thu, 5 Aug 2021 07:10:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFIJY/XdFXdZuEU9SFljMWyTNHdYuE+1E45r4w/fvU/d74RuKy5yn1GpRSWf2w0xLkjiDA X-Received: by 2002:a17:906:804b:: with SMTP id x11mr4950204ejw.306.1628172603062; Thu, 05 Aug 2021 07:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628172603; cv=none; d=google.com; s=arc-20160816; b=WlNd7aVXvnWD9q8GermyNDtdRcpxWAS8N0ore1xbWGpI+OFWDPfA8Gv6EMUe6iqe/a T8f9dOL3580MM7cp2ptFudQh1IAKUXIuNsefTCnWrjrPMsdUhg5PWaBshCSUISm63Qs9 YVfdB6zYblmrw8zx7hMRbH/7DEZ8SeOfcoxDntMIzSKCz5c2mkPl3/SPGgww879J2NTx 22RblRhUgRA96wcTVRKriThV5j+jQK7k7MAAlBgcb1hoolC6tF45+xAyOQ+uhwA+UP/v KIM9GSJvqiVSRqj9BKPS9LChRW16qqwRrsykTtqSrdWcRpHEL9MhcL19ltxD/lZfSd36 01TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BMHRHVG7FV528k0alS+dFJLWxY6mPvYTCXb2YBLZf+s=; b=V43xshLJJ3ZH7oZ23Bzo6SCYPjmN03NM0PNp/7iLokGO/sWeF74nIVMxI1wuPCDdjd Za3ZKFb1oysGyyef0K5gPVspMqEDC2yN6QMeMzYIh6nuhHI4e88aGiD70TIcF6b02R7D oc6ow5vzO4aYfImaciV9QKvR0rqqa5XwaVhXm49+w6cKjZVZJ9cvt7MAQpgMVyprKSzi e63CP2BIJmjNhDcFJqrU/0+w5cM9GPnRKv0jjq4S/PWGnAJ3/W/VNM/rB7U7BqlrQBIO U0LAmyd+W6NyVU/05+es4w1oL58y5zSkT/hlL1kHQM2dDiof5qSak2G6TfXbTSLKv1Mj ORhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kEa5CSWK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v23si5388685ejc.215.2021.08.05.07.09.39; Thu, 05 Aug 2021 07:10:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kEa5CSWK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241521AbhHEMxL (ORCPT + 99 others); Thu, 5 Aug 2021 08:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241504AbhHEMxK (ORCPT ); Thu, 5 Aug 2021 08:53:10 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E2CC061765; Thu, 5 Aug 2021 05:52:56 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id z2so10916271lft.1; Thu, 05 Aug 2021 05:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BMHRHVG7FV528k0alS+dFJLWxY6mPvYTCXb2YBLZf+s=; b=kEa5CSWKVFwS77IGuDPqemqQ99clYWFylqTxEnL25Hyq+COpjNrBCXnKqH/Z7sVVlt ZFa4fHBYiVNjylDse/cLP9w9EII8/egPufYcYzDE3AmVWaaoV1yf2oN2R8SfuVhAngbT y4h1Dc3m4Va/nC1f6Isa7D7xz24cyUOrIi0uwge7cgL5EZOe8gV9FT7Yqne1xded4uQ0 A+BJY4ThHNFwHUXZ76qFW04q3TXO+hEPTL+mpkIVRe9qZANnckcQj6ja+L6TxDwKi610 8r3wtm8Ow/eTn0dDNBtiCEgmqKU1AbbnLteA6e4Nh5y8vqXjqyGwJdER/aK+13TrvlZp VDdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BMHRHVG7FV528k0alS+dFJLWxY6mPvYTCXb2YBLZf+s=; b=ibwmpYC0ycykXD4ieACFJjnh5VTME137TweBMaC3osrKH1eUYRjJ5RHb3blwou1bdH 5aP260B9ccQh7tkW7qowQj3/iSoYF5uld8HqiQJzlp+tL65UIOtlbbQ2VcXh+fblC998 iPLSLCpvfUG0k8LJQvtjcp7YU6sdmsGp4bgpRGYapPe+rZOtZPzauL28dzUV/lQpJEKq aHUdsShyFcJ+WeNcXx/0TxPTT0ZmXdLKQNQhq3V+qvYUqrcVnyAuE0SpA4trgoIl/fNC 6DZaZFRNXn8lfI1zJOLqvQ+3Uh7EDBZt2nv1Z/lPiMCs1li/34D/nIi7u3r7TDz11SjN sXuw== X-Gm-Message-State: AOAM530b5EZqusfwEdfhDEZQ2jvQqfef3WbbeQAnNZjq2fzlUTCjpNoY zBEWygbWbZMZ5ysott1wbjuYfwANKdW/eIsYsL0= X-Received: by 2002:a05:6512:3255:: with SMTP id c21mr3633829lfr.179.1628167973678; Thu, 05 Aug 2021 05:52:53 -0700 (PDT) MIME-Version: 1.0 References: <20210805082253.3654591-1-arnd@kernel.org> In-Reply-To: <20210805082253.3654591-1-arnd@kernel.org> From: Julian Calaby Date: Thu, 5 Aug 2021 22:52:41 +1000 Message-ID: Subject: Re: [PATCH net-next v4] ethernet: fix PTP_1588_CLOCK dependencies To: Arnd Bergmann Cc: "David S. Miller" , Jakub Kicinski , Richard Cochran , Arnd Bergmann , Shannon Nelson , Jacob Keller , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Nicolas Ferre , Claudiu Beznea , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Tariq Toukan , Saeed Mahameed , Leon Romanovsky , Jiri Pirko , Ido Schimmel , drivers@pensando.io, Sergei Shtylyov , Edward Cree , Martin Habets , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Heiner Kallweit , Russell King , Yangbo Lu , Karen Xie , netdev@vger.kernel.org, LKML , linux-rdma@vger.kernel.org, Linux SCSI List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Thu, Aug 5, 2021 at 9:49 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > The 'imply' keyword does not do what most people think it does, it only > politely asks Kconfig to turn on another symbol, but does not prevent > it from being disabled manually or built as a loadable module when the > user is built-in. In the ICE driver, the latter now causes a link failure: > > aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_eth_ioctl': > ice_main.c:(.text+0x13b0): undefined reference to `ice_ptp_get_ts_config' > ice_main.c:(.text+0x13b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_get_ts_config' > aarch64-linux-ld: ice_main.c:(.text+0x13bc): undefined reference to `ice_ptp_set_ts_config' > ice_main.c:(.text+0x13bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_set_ts_config' > aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_prepare_for_reset': > ice_main.c:(.text+0x31fc): undefined reference to `ice_ptp_release' > ice_main.c:(.text+0x31fc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_release' > aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_rebuild': > > This is a recurring problem in many drivers, and we have discussed > it several times befores, without reaching a consensus. I'm providing > a link to the previous email thread for reference, which discusses > some related problems. > > To solve the dependency issue better than the 'imply' keyword, introduce a > separate Kconfig symbol "CONFIG_PTP_1588_CLOCK_OPTIONAL" that any driver > can depend on if it is able to use PTP support when available, but works > fine without it. Whenever CONFIG_PTP_1588_CLOCK=m, those drivers are > then prevented from being built-in, the same way as with a 'depends on > PTP_1588_CLOCK || !PTP_1588_CLOCK' dependency that does the same trick, > but that can be rather confusing when you first see it. > > Since this should cover the dependencies correctly, the IS_REACHABLE() > hack in the header is no longer needed now, and can be turned back > into a normal IS_ENABLED() check. Any driver that gets the dependency > wrong will now cause a link time failure rather than being unable to use > PTP support when that is in a loadable module. > > However, the two recently added ptp_get_vclocks_index() and > ptp_convert_timestamp() interfaces are only called from builtin code with > ethtool and socket timestamps, so keep the current behavior by stubbing > those out completely when PTP is in a loadable module. This should be > addressed properly in a follow-up. > > As Richard suggested, we may want to actually turn PTP support into a > 'bool' option later on, preventing it from being a loadable module > altogether, which would be one way to solve the problem with the ethtool > interface. > > Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices") > Link: https://lore.kernel.org/netdev/20210804121318.337276-1-arnd@kernel.org/ > Link: https://lore.kernel.org/netdev/CAK8P3a06enZOf=XyZ+zcAwBczv41UuCTz+=0FMf2gBz1_cOnZQ@mail.gmail.com/ > Link: https://lore.kernel.org/netdev/CAK8P3a3=eOxE-K25754+fB_-i_0BZzf9a9RfPTX3ppSwu9WZXw@mail.gmail.com/ > Link: https://lore.kernel.org/netdev/20210726084540.3282344-1-arnd@kernel.org/ > Acked-by: Shannon Nelson > Acked-by: Jacob Keller > Acked-by: Richard Cochran > Signed-off-by: Arnd Bergmann > diff --git a/drivers/scsi/cxgbi/cxgb4i/Kconfig b/drivers/scsi/cxgbi/cxgb4i/Kconfig > index 8b0deece9758..e78c07f08cdf 100644 > --- a/drivers/scsi/cxgbi/cxgb4i/Kconfig > +++ b/drivers/scsi/cxgbi/cxgb4i/Kconfig > @@ -2,6 +2,7 @@ > config SCSI_CXGB4_ISCSI > tristate "Chelsio T4 iSCSI support" > depends on PCI && INET && (IPV6 || IPV6=n) > ++ depends on PTP_1588_CLOCK_OPTIONAL Extra +? Thanks, -- Julian Calaby Email: julian.calaby@gmail.com Profile: http://www.google.com/profiles/julian.calaby/