From patchwork Tue Feb 14 18:07:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 727941 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 3vN9Pz4p9fz9s72 for ; Wed, 15 Feb 2017 05:08:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JxdWxCk8"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755383AbdBNSHx (ORCPT ); Tue, 14 Feb 2017 13:07:53 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35035 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755376AbdBNSHv (ORCPT ); Tue, 14 Feb 2017 13:07:51 -0500 Received: by mail-oi0-f68.google.com with SMTP id x84so3274425oix.2; Tue, 14 Feb 2017 10:07:51 -0800 (PST) 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=JdRHb3eZdr+D3/arC4Qb05Mehl55lc/1BfohGSHwYuw=; b=JxdWxCk8pJUB9DpsAnpCylPkhmNM/caWItUCX2btwcE7rR/XxmDhmU42WawjdUYuYz f5THn2MLZTw1+rP1e6fo6YYRrTT9sfRaS6/Prj30q0Rpot/j6aOA1rQJ88WRAec3TQvY 1JjSvhyGRpIqzxqJ9tJkK60BiPx9jBIflTTtlGEGTi+iReutcDCWvY3E6Bc+VZ7KBCg8 PnkZ8lOeNOr/VsSjwmX80kyjPXtOFzCeDR4NviLo1+oYzp3Lcs/Sv9KFVDA8tPva+apz 00IXxdoWFC1CySnS77Qr/IDKSTXasBx23HusQJck5NZ7ZqhOc+xr441eXtwsHjpJhYgN IDVA== 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=JdRHb3eZdr+D3/arC4Qb05Mehl55lc/1BfohGSHwYuw=; b=N2YE1HIKTCcZcbt5fQIK7NJAP0D+NLMPg+tdxBwKU+Iee0tMK7H2GANQThveYX/ErE +0935fxODxxAWslb2uFrZU1GQ0A3K0fogIM60oyCWkQzPW64G8k/o/bt8aObU6xPwFy3 SmOtLOhDw2uHdytd6gTIxThKCJZUVKKCMNWu2eyzgyvtkwx0Rw8a/s4wVpCeLk8TuoXu os7KazwYpFBDh2TKGu3WwoNU0KglzLsHYVZHMGlzexFzDNPymVoPmToXiBbFqzJxWTkI dF+cLkavDtBxkn+VC1S/8fU4Kv31dA+c7G+Wq/HlsQGZnnpxJJZz9G2hoM8PaBt4YHqI MYbw== X-Gm-Message-State: AMke39mJrShtQ9JXv8m3aFHw6I80Y0KvJlWoc+xYsfWxIf9YgqyF7lvc3HC4ne/q2+TvgA== X-Received: by 10.84.254.66 with SMTP id a2mr31245731pln.57.1487095670223; Tue, 14 Feb 2017 10:07:50 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1311:5595:659:2582:a551]) by smtp.gmail.com with ESMTPSA id j192sm2585663pfc.60.2017.02.14.10.07.49 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 14 Feb 2017 10:07:49 -0800 (PST) Date: Tue, 14 Feb 2017 10:07:47 -0800 From: Dmitry Torokhov To: Richard Cochran Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] ptp: use is_visible method to hide unused attributes Message-ID: <20170214180747.GA4081@dtor-ws> References: <20170214035108.19622-1-dmitry.torokhov@gmail.com> <20170214035108.19622-3-dmitry.torokhov@gmail.com> <20170214084226.GC8048@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170214084226.GC8048@localhost.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Richard, On Tue, Feb 14, 2017 at 09:42:26AM +0100, Richard Cochran wrote: > On Mon, Feb 13, 2017 at 07:51:07PM -0800, Dmitry Torokhov wrote: > > Instead of creating selected attributes after the device is created (and > > after userspace potentially seen uevent), lets use attribute group > > is_visible() method to control which attributes are shown. This will allow > > us to create all attributes (except "pins" group, which will be taken care > > of later) before userspace gets notified about new ptp class device. > > At first glance, this patch and the next look like nice improvements. > I don't futz around with sysfs code very often, and so may I ask how > or whether you tested it? I used the hack below. Thanks. diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c index 34cc3be0df8e..3b4c0d3e4093 100644 --- a/drivers/net/ethernet/intel/e1000e/ptp.c +++ b/drivers/net/ethernet/intel/e1000e/ptp.c @@ -260,18 +260,27 @@ static void e1000e_systim_overflow_work(struct work_struct *work) E1000_SYSTIM_OVERFLOW_PERIOD); } +static struct ptp_pin_desc e1000e_ptp_pin_config[1] = { + { + .name = "TestPin1", + .index = 0, + .func = PTP_PF_NONE, + } +}; + static const struct ptp_clock_info e1000e_ptp_clock_info = { .owner = THIS_MODULE, .n_alarm = 0, .n_ext_ts = 0, - .n_per_out = 0, - .n_pins = 0, + .n_per_out = 1, + .n_pins = 1, .pps = 0, .adjfreq = e1000e_phc_adjfreq, .adjtime = e1000e_phc_adjtime, .gettime64 = e1000e_phc_gettime, .settime64 = e1000e_phc_settime, .enable = e1000e_phc_enable, + .pin_config = e1000e_ptp_pin_config, }; /**