Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2611326ybl; Thu, 29 Aug 2019 10:26:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAqH2oEyGvAcEAsfpm20tNtfhg2k7Gu46A7wrPydmxqSp5beQwTtxlaGlsuw20jo46Id8O X-Received: by 2002:a63:9d43:: with SMTP id i64mr9399874pgd.306.1567099599098; Thu, 29 Aug 2019 10:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567099599; cv=none; d=google.com; s=arc-20160816; b=O4h9QpC8yGzBj70t7dYG6PTf8odTwxhB+IxvdaoQ7wQpYhaDmwToJSO92FGB1B9Cuh pH+YLZp3cwUMLEpbMpaDyBLO1pYAb0x3QFX60/Ek4hAY2ZOIwRdfjeABFj9xEKQwgXj6 hwR2heX7T3XCD2Yz60zySCA1CwoTbJAbXHZQtLlEffxSL/VPSnqCzPsFjIUxXcm23ptC flSwG+Z0h97vB3ZVsk9fsfmxgyE1mG1lyqgJZ4l/hkAlgU6zs07zBm2zOvbH2htEdewQ DX624GfJOsgCNAlfycZDUxm/4dS0noZ4jxfaPPZZ+1I70KibeUOxPGTyYzIQ3FBVeMwe ZR5Q== 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=9GuN3MgFC46kDB7x4VlkI6LkxeFzQtYyvkTJ6qGJU5s=; b=KCzwbbCKdD1CtDtz0n1Mkgnk/fvo654rxPX1+8a30BYY32dD1NWMTGi3VzbdwnQNfG +fyPBNEWd9VDeW6NsH5ONXGu+EUniY1FcD7+NbTzThljhfRcdSQ3v0mzWwI0eP5biA0F N+/g6RLPYILJnIA/rodiSjLAhXYGFN0bTSv5MJaD0xvqif5+VCSyYHOzeiTYPv9/cxMS O8BD3YFx9U49wYpPJK+FnkU7vTr1Pdj48do0701gGDVzSTLgMeyAXrCOalNFnNeKZt5G HvsKVgxYbWbVXFt8DiGETaZiNy2BcGgWfdP2+0Ayxvn/upSlMvWdr1y0kB6yyWagYoLJ li6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bR8rtfcJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a37si2380709pla.294.2019.08.29.10.26.23; Thu, 29 Aug 2019 10:26:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bR8rtfcJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728042AbfH2RZN (ORCPT + 99 others); Thu, 29 Aug 2019 13:25:13 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33954 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbfH2RZM (ORCPT ); Thu, 29 Aug 2019 13:25:12 -0400 Received: by mail-pf1-f195.google.com with SMTP id b24so2540125pfp.1; Thu, 29 Aug 2019 10:25:12 -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=9GuN3MgFC46kDB7x4VlkI6LkxeFzQtYyvkTJ6qGJU5s=; b=bR8rtfcJAzcs66myVxnXNqz5PvXLdznyccocG6kepCtUDV74pdYC/KC1XA96ZKMuvo pImi2IyTf3vMfXLmCqPgZb0L1foivbxkXTaMyIL9E76A3imZx/D8Oo2ckxbEGv/fHamd g4zobDzE37wiB0poiMCRV+fe4pcfYCRIBBL7Li0i/Ix9P1aYVCMMcEm1cTMwNipEDDE7 qPLs8NgSL09es5LFR7gq+fRL2MFf9+eYlSsf++E8b+tlW3gajV5kfvS14Swbns6K4WAX 9FWwq1RlAfnycYdHMPyrbfm+SyISkjVN1btdrKXy41eT++l18pasheoZ3sXhT0Dg+alT Rf9g== 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=9GuN3MgFC46kDB7x4VlkI6LkxeFzQtYyvkTJ6qGJU5s=; b=M4zbykPCjnyAflFj70LpHCyIUZh+4LtADXQfxMiudz8EAOLqidfdxtex/cQPGVyQmP 01AfaEcOWP685bo46tFfo1/Zb8iqC2kRk93xiiiTLEKcQzMCp26yt8kyjdjMg4KiQpxq YaQ73G02ni2D/ytOYWhB0xkymNiGdxWyUX/Kj0rbdv3X668iroNWXsuJ2TpMbhUpKLX/ fUm2K8Z1Y9Bbtbce7G5fSBNuUkL7J5vhFfdnGMyrYROwCX09l04lPPLe+r22ZCYkdTM6 wAIbujUcB9B8/GAv8rijQpyjnPSvkKJGzGo49nSFfWUbpETPVFwtijiIrG4VXwQqiljV 8wNA== X-Gm-Message-State: APjAAAWvcmQWow1tb34MbiM4eqZ5VK28za6t2Db0SfLz9tmmKxVSYUfY AQHbdjLYwWBLhCwpFCmEG7I/eyeL X-Received: by 2002:a62:764f:: with SMTP id r76mr12610577pfc.149.1567099511944; Thu, 29 Aug 2019 10:25:11 -0700 (PDT) Received: from localhost (c-73-222-71-142.hsd1.ca.comcast.net. [73.222.71.142]) by smtp.gmail.com with ESMTPSA id a17sm3770384pfc.26.2019.08.29.10.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 10:25:11 -0700 (PDT) Date: Thu, 29 Aug 2019 10:25:09 -0700 From: Richard Cochran To: Felipe Balbi Cc: Christopher S Hall , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] PTP: add support for one-shot output Message-ID: <20190829172509.GB2166@localhost> References: <20190829095825.2108-1-felipe.balbi@linux.intel.com> <20190829095825.2108-2-felipe.balbi@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829095825.2108-2-felipe.balbi@linux.intel.com> 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 Thu, Aug 29, 2019 at 12:58:25PM +0300, Felipe Balbi wrote: > diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c > index 98ec1395544e..a407e5f76e2d 100644 > --- a/drivers/ptp/ptp_chardev.c > +++ b/drivers/ptp/ptp_chardev.c > @@ -177,9 +177,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) > err = -EFAULT; > break; > } > - if ((req.perout.flags || req.perout.rsv[0] || req.perout.rsv[1] > - || req.perout.rsv[2] || req.perout.rsv[3]) > - && cmd == PTP_PEROUT_REQUEST2) { > + if ((req.perout.rsv[0] || req.perout.rsv[1] || req.perout.rsv[2] > + || req.perout.rsv[3]) && cmd == PTP_PEROUT_REQUEST2) { Please check that the reserved bits of req.perout.flags, namely ~PTP_PEROUT_ONE_SHOT, are clear. > err = -EINVAL; > break; > } else if (cmd == PTP_PEROUT_REQUEST) { > diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h > index 039cd62ec706..95840e5f5c53 100644 > --- a/include/uapi/linux/ptp_clock.h > +++ b/include/uapi/linux/ptp_clock.h > @@ -67,7 +67,9 @@ struct ptp_perout_request { > struct ptp_clock_time start; /* Absolute start time. */ > struct ptp_clock_time period; /* Desired period, zero means disable. */ > unsigned int index; /* Which channel to configure. */ > - unsigned int flags; /* Reserved for future use. */ > + > +#define PTP_PEROUT_ONE_SHOT BIT(0) > + unsigned int flags; @davem Any CodingStyle policy on #define within a struct? (Some maintainers won't allow it.) > unsigned int rsv[4]; /* Reserved for future use. */ > }; > > -- > 2.23.0 > Thanks, Richard