From patchwork Mon Sep 19 14:10:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 671762 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sd78H3l3fz9s2G for ; Tue, 20 Sep 2016 00:10:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=Qon0/Q8F; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938797AbcISOK1 (ORCPT ); Mon, 19 Sep 2016 10:10:27 -0400 Received: from mail-qt0-f170.google.com ([209.85.216.170]:35220 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758464AbcISOKZ (ORCPT ); Mon, 19 Sep 2016 10:10:25 -0400 Received: by mail-qt0-f170.google.com with SMTP id 93so72020845qtg.2 for ; Mon, 19 Sep 2016 07:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Nbs9PbsZKVLlsTVO2ObkeGd0qESABQ4e28oULy91B/M=; b=Qon0/Q8Funf2DnYQQXe+5phbudR6eA8gDn5Jx40CiWG1ntquOnQXaXeu40pta9IH6V e2i3g+mAYNcgrGYQYDmP7gtejWHwi5t31ZXZ5rvsnpSt3L8GNwZkGZpbkevhMZY13AAL vGEiaTd1MM5BAkK2rorucF/3iLZCia2yJwyOo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Nbs9PbsZKVLlsTVO2ObkeGd0qESABQ4e28oULy91B/M=; b=eKjlEE06a2NRwiEB2etq/4aRkBNUYFNaHgFbE+SUB/aF7/2Im6fAxcmEaFRosPhcr+ 0LUpeOrkEmibxADcoCPkxwyFSlK08F36D5yON9btk2EWsvWCuyCM7CkZ6qAaL0aLEJL4 Ry3O2SvjfpWfBHwfRR7LA+23FXZOoG9+oy4jJRNO3UEhT/KsU3MYoh+EXvA5kScnwGxt /TTS192G/EpTtgYAr+nHis760q3AQccSR/3a9RkP53Rcb4GRGDONhGEsgKkuSlfMICEq cxG08wzdoq6V1OAVIBNEJ9MN0jL5Jb//+X5kQ++O9fvz4nQN+s1el0OSjYGqYetE9CME uAYQ== X-Gm-Message-State: AE9vXwPi+HeDLsoYCYyzfuOoqyqNnqFCTu086qnsGCl9WrPx19+6Cq+e+NirppchzBx/YhZS X-Received: by 10.237.43.163 with SMTP id e32mr30425788qtd.124.1474294223857; Mon, 19 Sep 2016 07:10:23 -0700 (PDT) Received: from xanadu.home ([2607:fa48:6e39:d410:feaa:14ff:fea7:ed77]) by smtp.gmail.com with ESMTPSA id 14sm13107435qtp.6.2016.09.19.07.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Sep 2016 07:10:23 -0700 (PDT) Date: Mon, 19 Sep 2016 10:10:21 -0400 (EDT) From: Nicolas Pitre To: Jiri Benc cc: John Stultz , Thomas Gleixner , Richard Cochran , Josh Triplett , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] ptp_clock: allow for it to be optional In-Reply-To: <20160919142553.3fb682ba@griffin> Message-ID: References: <1474257070-4255-1-git-send-email-nicolas.pitre@linaro.org> <1474257070-4255-2-git-send-email-nicolas.pitre@linaro.org> <20160919142553.3fb682ba@griffin> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 19 Sep 2016, Jiri Benc wrote: > On Sun, 18 Sep 2016 23:51:09 -0400, Nicolas Pitre wrote: > > And to make it possible for PTP to be configured out, the select statement > > in the Kconfig entry for those ethernet drivers is changed from selecting > > PTP_1588_CLOCK to PTP_1588_CLOCK_SELECTED whose purpose is to indicate the > > default Kconfig value for the PTP subsystem. > > With this patch applied, the user is free to set a NIC driver as built > in and PTP_1588_CLOCK as a module, right? If so, that would lead to > non-functional PTP without any warning due to the use of IS_REACHABLE. > That doesn't sound right. Could easily cause hours of headache to > someone. > > Or is this handled somehow? I don't see how to remove the ability to select m for PTP_1588_CLOCK based on (PTP_1588_CLOCK_SELECTED = y). What about this on top then: diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h index 4c29eb8e53..74079b2fcf 100644 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h @@ -207,7 +207,16 @@ int ptp_find_pin(struct ptp_clock *ptp, #else static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, struct device *parent) -{ return NULL; } +{ + if (IS_MODULE(CONFIG_PTP_1588_CLOCK)) { + pr_warn("%s is built-in while PTP clock subsystem is modular, " + "PTP clock ignored\n", KBUILD_MODNAME); + } else { + pr_warn("ignoring PTP clock from %s as PTP clock subsystem " + "is configured out\n", KBUILD_MODNAME); + } + return NULL; +} static inline int ptp_clock_unregister(struct ptp_clock *ptp) { return 0; } static inline void ptp_clock_event(struct ptp_clock *ptp,