Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2098606pxb; Sat, 14 Nov 2020 13:20:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyboFBHpIvD2FY5tfFRI6x6+fXetkBv7vIPeoG36YKZYfYDhlU6rNduiWMA63KCEZUwziHu X-Received: by 2002:a17:906:4e41:: with SMTP id g1mr8314923ejw.47.1605388819019; Sat, 14 Nov 2020 13:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605388819; cv=none; d=google.com; s=arc-20160816; b=hSQpGmE0dgzuj7ZnyBGtNM1L3boTGOv2vAdiyAxM4oG3QA24BZXBSDY1Mog7tcuqm5 tleSROWec2PgjMKxqYQ1juPxip5AD42sEIYhYvfcC2cpJ6Z5U6DKXMAMw37qpedp6NdZ A8EEEu4w7+yONIpIsrX2j0GJcXMXNntGCNn4i+RtOqJy3MouYIny3kxfc4k7Md7/uLUw Iwveejfweup/OIHnsAA8NaUrwoWncCxuFpa+Pm0G0tqmagKYvGLDyfUjwXDvKb9CPS8/ KZ/2/5Ei7cGf5lQnGGMQCNisE4ixMbv4zVFxWXkjRWRSgSjwwfBceLfTZYRbn5Jcil4m TA1Q== 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=QHgGkIgN1nqvQ7ikRcFUAcWslsJi/rIH0kRmzqDuymA=; b=vijtbrFEMVNFHrjNK97iue0aMF56LPbElwbyl/GCM/WiEwrfp+CQKfHGgXCntq+xOa Q3+5nLnB8UZWsKC/fPzQIzt2zCGCRQp2/Tuc8f135KS3V2gycbx66RQ0LlrLTIe0Qkxz 4u9jNUrf83TWv+amncnmBj22Razj8HrMpB356OBa194AEb0QbE8vIVHGM6IQ50C83NmH AdhNL4t9pyB4goxD57PkrFo0HAkVcpjDyHJjfDqlvBmdGjSAqPIWiIwQmC3a2hvHNibY cvN2NyzDThyivUsbeWxXA/Nmxj+GkYbr56vHkxq0lAX9C5PsBvb22Kl7eVP2Mshk0Ep9 eAlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c3aPOwd9; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si8719769edo.544.2020.11.14.13.19.56; Sat, 14 Nov 2020 13:20:19 -0800 (PST) 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=@kernel.org header.s=default header.b=c3aPOwd9; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726342AbgKNVRH (ORCPT + 99 others); Sat, 14 Nov 2020 16:17:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:38408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgKNVRG (ORCPT ); Sat, 14 Nov 2020 16:17:06 -0500 Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31A7022450; Sat, 14 Nov 2020 21:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605388626; bh=fLMkFVoa5bkRy30uzWhJQnvABvcL1eCRrjTgBznA7wk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c3aPOwd949G0htINM2Xl/y3kMEAdo0dy6MVlD8C2P4RTndmota9lSUheO25R4D9JP PZepkZ41DJV5UnRpoozbfOFm1z/5kR77lYbnY44RmIvUXe2PceBHh6OcMEEDCFEVEG +REc6FyccNOr/v0GXCjqmBD4ufZ6SzCKUxt4DLlA= Received: by mail-oo1-f52.google.com with SMTP id g4so2992811oom.9; Sat, 14 Nov 2020 13:17:06 -0800 (PST) X-Gm-Message-State: AOAM532ndHcgrkGhTaktG+Xfoz89whQCuFB/yjENi8+aLKjKu1XkyK+p YedFFCaBZmlmFpUcAYfWgrfHweqI3b1LPE8WW04= X-Received: by 2002:a4a:7055:: with SMTP id b21mr5829636oof.66.1605388625527; Sat, 14 Nov 2020 13:17:05 -0800 (PST) MIME-Version: 1.0 References: <20201111080027.7830f756@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201112181954.GD21010@hoboy.vegasvil.org> <20201112232735.GA26605@hoboy.vegasvil.org> <20201114151410.GA24250@hoboy.vegasvil.org> In-Reply-To: <20201114151410.GA24250@hoboy.vegasvil.org> From: Arnd Bergmann Date: Sat, 14 Nov 2020 22:16:49 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Re: [PATCH V4 net-bugfixs] net/ethernet: Update ret when ptp_clock is ERROR To: Richard Cochran Cc: =?UTF-8?B?546L5pOO?= , Jakub Kicinski , Grygorii Strashko , "David S. Miller" , Samuel Zou , Kurt Kanzenbach , Ivan Khoronzhuk , Networking , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 14, 2020 at 4:14 PM Richard Cochran wrote: > > On Fri, Nov 13, 2020 at 05:21:43PM +0100, Arnd Bergmann wrote: > > I've prototyped a patch that I think makes this more sensible > > again: https://pastebin.com/AQ5nWS9e > > I like the behavior described in the text. > > Instead of this ... > > - if a built-in driver calls PTP interface functions but fails > to select HAVE_PTP_1588_CLOCK or depend on PTP_1588_CLOCK, > and PTP support is a loadable module, we get a link error > instead of having an unusable clock. > > how about simply deleting the #else clause of > > --- a/include/linux/ptp_clock_kernel.h > +++ b/include/linux/ptp_clock_kernel.h > @@ -173,7 +173,7 @@ struct ptp_clock_event { > }; > }; > > -#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) > +#if IS_ENABLED(CONFIG_PTP_1588_CLOCK) > > so that invalid configurations throw a compile time error instead? I was trying to still allow PTP clocks to be disabled, either when building a kernel that doesn't need it, or when posix timers are disabled. Leaving out the #else path would break all drivers that have PTP support in the main ethernet driver file rather than conditionally compiling it based on a Kconfig symbol that depends on CONFIG_PTP_1588_CLOCK. Arnd