Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2615385ybl; Thu, 29 Aug 2019 10:30:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqznYJKdby6v1/X6kb/gQMORwiHMOAqE238J5dWGKGqq77FKsVMLpnAxKG3ZUxqVVwrVtaNb X-Received: by 2002:aa7:96b3:: with SMTP id g19mr12499486pfk.26.1567099800411; Thu, 29 Aug 2019 10:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567099800; cv=none; d=google.com; s=arc-20160816; b=h6H4JEr79bVxsChrINigWn0PLRuuu2cuMVvXg833ejR3c5wVx42rB8T4rTZgN30tBA XmXXqw5rDKa5UktOusAgbFlao2FzoVY8GSiL0Th2ejs+6F+d/NmQ3pc1/Xd3sejBkR21 FzfdV/75UVqeUwpuYDBHnZ20ta4YIwBNt2ydIxixIUT2szHF9UROGBR0/corSraBTWRH vAA3/Wg22z4s/kByhxM0GC+bG2GIQysKbWaUqPiGTDbDoC/1wySNAhrDQmVutoi+icS/ qtsQYn1EeDI9W6r/cR+mGAgZ84hraokLBNLAQO4aieXtJ406qzoXfAwDrrQ54qbpCTEh hT0w== 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=h3l+cnwgLiAnxdbo1DA0QAVgE8Ahk9WZSlg+KJsywhg=; b=caR+f96heXHCf39wTX3vOlcMTFlz2sPQBpY8oWy3dvzCA1SPIDZwJ1TSw+xmf9L+hK XD3jP8LU+isqawr7tUkbMSqiucj4KV9tthO9ijJ3C1VX1llvzL350Cd0X+iZsLDS9mu1 yq6RTzF/j+92FB8hZ5khEc5z/hwWnFONLR97HZ1uPirnBu8pjEQnfjaj8ltVgblzhK/t ovLVqjFbd5o1dXFPqrUOA5gC2yEI1D+d7zvza+jUJ1zaoY8OCXzekF/pkk5gDycfZu4b Yl9xzU77CZDO/8fKZVhWo69F3D8EnJ/J8InLr2DtZ3BGTrN9ZZmNr06JoH2w8SUhFIeK 25Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LzVRRjQV; 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 m186si3409021pfm.141.2019.08.29.10.29.44; Thu, 29 Aug 2019 10:30:00 -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=LzVRRjQV; 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 S1727978AbfH2R2w (ORCPT + 99 others); Thu, 29 Aug 2019 13:28:52 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41823 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727173AbfH2R2w (ORCPT ); Thu, 29 Aug 2019 13:28:52 -0400 Received: by mail-pf1-f194.google.com with SMTP id 196so2514392pfz.8; Thu, 29 Aug 2019 10:28:51 -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=h3l+cnwgLiAnxdbo1DA0QAVgE8Ahk9WZSlg+KJsywhg=; b=LzVRRjQVaNl26Q1HWhVNlp4y3i6RrjP4ioKujdqMcYLxuWJAyounwHpRRXYbS4a+3I 9MBKvFW5dU6A6f6dfiN0meLYZqHzy09lk0Vrrj8OlQLumZh7QeYy8yDmdRY5gh9Jq6TF a3pmCnZ9idbMg9bvifOaRNB/3X+X+gy2+CJ4KD46cpM/cLYQvs33UQcEAkHqup33yWI5 J8OuzXHGFKDeZmj2H4FvytpzVwGJA5a/BliZf2y/pIhzRU5UpX6NsmPF+saALZ2ThLn7 GqkLp6Wvy8uhJ6zZERLaUGZdasJMqrYHVqYvkrwS/FJAQ30LmXrOYDDN4pAnBxaSnn0W 1kqw== 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=h3l+cnwgLiAnxdbo1DA0QAVgE8Ahk9WZSlg+KJsywhg=; b=q5JzvQyL7W0ZlvKaS3+8FiNq8h4+9i7ZcU6T3ampeFT4NDiJXJZaCqX8PQS/FtjaP8 4BQZFtIGAKrVMul0m6XnU8pLtGdaz0l5amQjIeSFvUdiYHk3yE6CkGgWOc8KB7Eo1flq 9X8uUNxxBWVYv7TjK9r13Pp4zp6xsRVPo74aOpAxZTgQ02U9KdslELpFZjbmTj1Us2M0 kSciIe0YgkZNlXyZ221Es2IknzsOMQIv71G7M9IupbOziNPETGcO290FWmDLmm10WbHc 6IQgvepMuQx0Jn7UVmsbOkLiC1Juf7fej2xEdBfNCfZPHLngo8WHRMZ3GsrlcKfhacMm duOQ== X-Gm-Message-State: APjAAAXNQw+hRWP/yqGIUApOstDzpkAIL89hHJO0y3N+9vs9ULQ0rUAS N82YPSrr1yxh0lmscilMfEk= X-Received: by 2002:a17:90a:c503:: with SMTP id k3mr11205835pjt.134.1567099731651; Thu, 29 Aug 2019 10:28:51 -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 203sm3881871pfz.107.2019.08.29.10.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 10:28:50 -0700 (PDT) Date: Thu, 29 Aug 2019 10:28:48 -0700 From: Richard Cochran To: Felipe Balbi Cc: Christopher S Hall , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net Subject: Re: [PATCH v2 2/2] PTP: add support for one-shot output Message-ID: <20190829172848.GC2166@localhost> References: <20190829095825.2108-1-felipe.balbi@linux.intel.com> <20190829095825.2108-2-felipe.balbi@linux.intel.com> <20190829172509.GB2166@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829172509.GB2166@localhost> 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 Adding davem onto CC... 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