Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1059pxt; Wed, 4 Aug 2021 04:31:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAra8/QyS1vhC+PxyQDVIlaTpp8scdNRqcD5HE7ogj1PNzI8ev3700JdBNpxkxjg24mskc X-Received: by 2002:a02:394c:: with SMTP id w12mr19681075jae.125.1628076689166; Wed, 04 Aug 2021 04:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628076689; cv=none; d=google.com; s=arc-20160816; b=MUFykJ0jJJH1BtycTa786RAcZLpg2Ems2cqETOHBj5Huq6GP4UFhJnECLemHpo+W+9 yvQLZP0ELGbAaIPLNXDBoMqs4OzWM4OgYMX4RAmwDpF/N2Li1tQkRNzoz1THWDaTtuhf zXiLt8rtENa1N2p+1mh6NpVYAvv3PSbr0qFfjaQVwvM5OqqBW/g3oIuKdJbJqI6NKfOF CprBsfgjPWzXI5pnn5vRInT/oSruK6cWqDzDyQq+REVMzuFn6o32citCLyV6O7xHP20e uA+svRZpgdvfdbISBfYdsUr678rljq9LGwOiIir6Z/Z5oV7Oy3o5IJfSN6MGsqP4oBqP 43UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=CRA5Zy7VJg2lXN2UkC74+GOrXGVDnYrbYQjjbvnqtIM=; b=YFVcd65T8SN1lDipM1T2gMSlxZOiFMu8kQXxe7yAg7U3tIoWNNRdPTkbD/CC5NiZAr CPwjQaWy7SQ/OsMll0eiYa76q9igxHNZrbmdAydwXkIkBIHpAyTffKOZ2UmhiI/LZNhC bYP5ypWGTFyAB0wc3Gv65SxmwtVZERnO2ggVe0JU4LBVM3llj3bxFyfrb+s39IHQi1Hn CiCSLlOS08vZuP+0P67vuR8aVvGmo57QAPsJW4SBAA52WPUx/iGOs87c8OqfeBnhL+3f 6HVD+vHQkjah+z0i03dXJWJQFPM87gpBU7+nPNwEzHaKxq93LosD3b3I94kaR5QmYVRb bJ4w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k18si2142305ilq.156.2021.08.04.04.31.16; Wed, 04 Aug 2021 04:31:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237265AbhHDLTW convert rfc822-to-8bit (ORCPT + 99 others); Wed, 4 Aug 2021 07:19:22 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:55275 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235764AbhHDLTT (ORCPT ); Wed, 4 Aug 2021 07:19:19 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1N8oOk-1nFnPL30fW-015qOp; Wed, 04 Aug 2021 13:19:05 +0200 Received: by mail-wr1-f50.google.com with SMTP id c9so1795803wri.8; Wed, 04 Aug 2021 04:19:05 -0700 (PDT) X-Gm-Message-State: AOAM531nAneJxxHbylRhiXrW36dOBMgJxREtco2XPOb97V5qFkENwKVh TC9EV7SuhN2W6RNnFmRhnNg4JC4Me3ARPnJF6JE= X-Received: by 2002:adf:f7c5:: with SMTP id a5mr28307602wrq.99.1628075945279; Wed, 04 Aug 2021 04:19:05 -0700 (PDT) MIME-Version: 1.0 References: <20210802145937.1155571-1-arnd@kernel.org> <20210802164907.GA9832@hoboy.vegasvil.org> <20210802230921.GA13623@hoboy.vegasvil.org> <20210803155556.GD32663@hoboy.vegasvil.org> <20210803161434.GE32663@hoboy.vegasvil.org> In-Reply-To: From: Arnd Bergmann Date: Wed, 4 Aug 2021 13:18:48 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v2] ethernet/intel: fix PTP_1588_CLOCK dependencies To: "Keller, Jacob E" Cc: Richard Cochran , Nicolas Pitre , "Brandeburg, Jesse" , "Nguyen, Anthony L" , "David S. Miller" , Jakub Kicinski , Arnd Bergmann , Kurt Kanzenbach , "Saleem, Shiraz" , "Ertman, David M" , "intel-wired-lan@lists.osuosl.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Yangbo Lu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:2C0s8y2+wI7zT8RjmWu65pqoSCbqCc0/bMWmECZkUjwh5Xe532W SvHDe0ccf6AkrhGkkIfn7YvBepfyM2zhRnFq6jFlmO6J7T8+FKFaPj6Z3lGOTo8f52Y5l6R +QGbwGO4cBEdHnSLHCSX5IjNDlFGPwPb4gcnpVJ6x1JUWeSpWPSKrDE89ry21tItrT4+XRu ffB+siELLoChDJW7F9IBw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7m5kR69SaVU=:TrXKws7lzG5kLpvkh9jvvs rykZ9ip8uC5TGGIgu3HKvTIl7Kx3phowm/Ap8hSBlvRW5bNSh+YnN9VSjLnUjYAp1gulwkKdW pY2F7W1homDM6l5nMvou+FCj1fDTfkZQtOOxS2v+aHWR62l0jFmu7CjRQj1bOBJTfegUVvR21 jdSJHfp/Gl8N+2UQqaWOYIzbYw7+KmPeYW2l1vUvIhKWqQAHiV8P42qqfttvCIcWzvuJCFJJx nL5/4quc10I5gTEcvA3uprXwi920eJBAx+iqUvfQN7C3RPZ4j+VIZ0CB8KgSBqL9jnQ/Pa55T T/KpTxfjbzsCJbJu/97BFBTU4nT5jFN7MK+JHRFDc/F5DieMN5bpX/ak1Mm1vqRXIcYZEJrne CX7C2+XbBxpxase2hATwSe0bPA35OEg9qdMgkal2toowFCxuEdMjO1VLfXoZQv3tigeP8bSg3 c/4Juc/UY9W+NZKhGtpB490gdpPGYfx8elzcjjLb9Q2/0ilQXNnuakj0dAGg8JHWT8DWhhTER Dh7vzB60mA0DDsmTE7LeORxHBsND8G2u8i7le0hHzC9qE9QMKyPq/RtyC3tb6pV/9WcCnRkRk no8G3VHUsLuARN1pjBaNelBNP0sM0z7rUor74wCEqvMJ/uot/t9zNENSTQKYFqD9ktpv+6GjM EYAo9ZcFPz8TzTzst/EP4d8+oFCJc79l1E4n/vIGZQuzdicN3Rvrlwlb9eugsQNZF7NlTMubA psaJe4F0i4UWQguFuzqnSa9ttYpWL/HUrYTHmowY2UFrFr47T4fDR2MvCItDNa+QSNzy1tecn oX7E02LMbFp1r5IwsXMGb34eA6KaINR8YHKQYCJqwkrWEDNiue5f11EMKfhhOck6GKds1yT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 3, 2021 at 8:27 PM Arnd Bergmann wrote: > > On Tue, Aug 3, 2021 at 7:19 PM Keller, Jacob E wrote: > > > On Tue, Aug 3, 2021 at 6:14 PM Richard Cochran wrote: > > > There is an alternative solution to fixing the imply keyword: > > > > Make the drivers use it properly by *actually* conditionally enabling the feature only when IS_REACHABLE, i.e. fix ice so that it uses IS_REACHABLE instead of IS_ENABLED, and so that its stub implementation in ice_ptp.h actually just silently does nothing but returns 0 to tell the rest of the driver things are fine. > > I would consider IS_REACHABLE() part of the problem, not the solution, it makes > things magically build, but then surprises users at runtime when they do not get > the intended behavior. Case in point: two patches from Yangbo Lu that call into the ptp core from built-in network code look like they could never have worked with CONFIG_PTP_1588_CLOCK, but did not cause a link failure because of the IS_REACHABLE() check, see commit d7c088265588 ("net: socket: support hardware timestamp conversion to PHC bound") and c156174a6707 ("ethtool: add a new command for getting PHC virtual clocks"). I found that by testing my patch that turns the IS_REACHABLE() back into IS_ENABLED() and got aarch64-linux-ld: net/socket.o: in function `__sock_recv_timestamp': socket.c:(.text+0x1f20): undefined reference to `ptp_convert_timestamp' aarch64-linux-ld: net/ethtool/common.o: in function `ethtool_get_phc_vclocks': common.c:(.text+0x35c): undefined reference to `ptp_get_vclocks_index' I added a workaround to my patch now to keep it working as before, but this needs to be fixed properly. The easiest way would be to no longer support modular PTP at all as Richard would like to do anyway, but I have not attempted other fixes. Arnd