Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4035772ybz; Mon, 20 Apr 2020 14:20:22 -0700 (PDT) X-Google-Smtp-Source: APiQypJWN3iP+WP1IDq3Ufny+OC02G1a0f7wDstJS57bf6cR1Iydd2piDTd0q47VpcGyU9855xiF X-Received: by 2002:a17:906:f251:: with SMTP id gy17mr16797746ejb.369.1587417621839; Mon, 20 Apr 2020 14:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587417621; cv=none; d=google.com; s=arc-20160816; b=GCNghYiG++hWDlRIU55JEaqY0UFWGfG5jXaFGU5to7tJsgbiY4d3QNmNovkJ4N3HFq A84F59IlyphpfbI23IaORcwrejXC/nLToHYJna5wbOCyvmTrNH6Y945a+4WuxqlGurtv w5DDkcUmtCd7v8Vb30SM+dmn1C9UedNFq6hjjoogXmh3g+VG9JVbfK6oxIyGjqLW0IG9 rqsJ6WkaylofHOol4qVYXfCizlZ6vSmKBYuu9pbH//XWDFtp/HhUe+g1zdBHAu4SXSk1 jM0uUMlbZ23Fz8IAHPHaU83eoHmGgxzAEc/IqRTS3HU8z2fvfyJRoBLMn+BLhONptG9n pT+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rD4w4N0eJ/tfjt2nOo1kPiXoCAMHsRlgxj04yDslYRs=; b=Ua5eF0qLRWKXuIJ7GlGvR/t2FAA+U2orddWYOYqbjAuCKNNp/HMFl3d4UBZATw7OWQ LczzBU5b1Vtxe1/mI7qRqoHpFAhE2YkxFKFXYvuC29aleb25UX8TkfI/+speKo2KwASV ACjwojmJKiyJBoTJ/TlUG1L1/V7g7zwUOiA2lrYpoX93UwRXaQAJPGS5WF/SccaE8fZu nzt6jJrMib9vrfzCc5rujDEn7Kz9VFQsBxWk77WJJ2FQzC7ndNUNJoIfG40rrWVncuFN 17mUc+LEQOiSxWHl37XwYdWT3eaZPeb0azxsIrS2/PBVrT3B5lq7Y95vGypaUgTZqOzN U/Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kzHaCZzX; 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 q4si393776edh.273.2020.04.20.14.19.59; Mon, 20 Apr 2020 14:20:21 -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=kzHaCZzX; 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 S1726838AbgDTVSY (ORCPT + 99 others); Mon, 20 Apr 2020 17:18:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726021AbgDTVSX (ORCPT ); Mon, 20 Apr 2020 17:18:23 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CAFEC061A0C; Mon, 20 Apr 2020 14:18:22 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id nu11so420550pjb.1; Mon, 20 Apr 2020 14:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rD4w4N0eJ/tfjt2nOo1kPiXoCAMHsRlgxj04yDslYRs=; b=kzHaCZzX8drpVdZSnnPVhfnPKX39XGAMIiA0q15HENDe0cq/Y9D8gXW3yEmog2ubYT KhdaizTMFXTJXEjISbw4CQA45qGFjVcMtHi6FWFBMZTcNxFFWSoIOKaBf6BERFRzYj9R SuJjslTeOC0cQkesuXN5Fj4+KmOKou2DLb3pyd4TmvbD1lm4PiR4lNMovZgmpVTCcFoH 5oTqyXiFK8XO1GiruFDUJuJGjEuhcNIBnSGautxifFMz1n+bHVSrxN0OquXRjP3M1HFe s7z0OST29eNf6RexT+KDuQ9pJYCPafX64EcICpudMBCPQXFN/ybD/NdRXtgy1Yo5etwy 8PRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rD4w4N0eJ/tfjt2nOo1kPiXoCAMHsRlgxj04yDslYRs=; b=dwwg77qO28RKUg4xCRXi99KzjcA/3I1y2DgGfUSL63spM2JwDR8XhpE21ykkmfyzWB QivQYRtzWTbgyhthHDiTel6fWN6yySFMyxiwt8d7adSDfBHdOF+GC+OAc5sr98tDUMJG 6ZlW1StT5cOxKBpb8KE/4nEooqJbFdMx/SQ/lM3vXJsaum/7Qs37hORk90CDVH6HAQn8 U4WympOuNtOix4jB7yNSF7WZ7H585day9Wtvg/K/Rplh1A1shcFiPVBn/HKaJAgp+Hrh z2Edh7a/WDpNnuabBm5byVRdAExk39zOIH2Lcp+DhYkDNlkPX1N6Vn7bGPNOkQHbAzjF 0IUg== X-Gm-Message-State: AGi0Puax5O6e32Lq3vqsfWWvixurOXGnupBHG2SKH1yDrvSxM/tib507 7W8KTEdA6vHuBXxa8ypcS1E= X-Received: by 2002:a17:90a:7349:: with SMTP id j9mr1592194pjs.196.1587417502082; Mon, 20 Apr 2020 14:18:22 -0700 (PDT) Received: from localhost (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id c144sm398337pfb.172.2020.04.20.14.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 14:18:21 -0700 (PDT) Date: Mon, 20 Apr 2020 14:18:19 -0700 From: Richard Cochran To: Arnd Bergmann Cc: Clay McClure , Grygorii Strashko , "David S. Miller" , Sekhar Nori , Networking , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] net: cpts: Condition WARN_ON on PTP_1588_CLOCK Message-ID: <20200420211819.GA16930@localhost> References: <20200416085627.1882-1-clay@daemons.net> <6fef3a00-6c18-b775-d1b4-dfd692261bd3@ti.com> <20200420093610.GA28162@arctic-shiba-lx> <20200420170051.GB11862@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2020 at 08:57:05PM +0200, Arnd Bergmann wrote: > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 172) #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 173) > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 174) /** > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 175) * ptp_clock_register() - register a PTP hardware clock driver > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 176) * > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 177) * @info: Structure describing the new clock. > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 178) * @parent: Pointer to the parent device of the new clock. > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 179) * > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 180) * Returns a valid pointer on success or PTR_ERR on failure. If PHC > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 181) * support is missing at the configuration level, this function > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 182) * returns NULL, and drivers are expected to gracefully handle that > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 183) * case separately. > > d1cbfd771ce82 (Nicolas Pitre 2016-11-11 184) */ > > The key here is "gracefully". The second patch from Clay just turns NULL into > -EOPNOTSUPP and treats the compile-time condition into a runtime error. You are talking about the cpts driver, no? I'm worried about ptp_clock_register(), because it does return NULL if IS_REACHABLE(CONFIG_PTP_1588_CLOCK), and this is the "correct" behavior ever since November 2016. If somebody wants to change that stub to return EOPNOTSUPP, then fine, but please have them audit the callers and submit a patch series. Thanks, Richard