Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6721624rdb; Fri, 15 Dec 2023 06:46:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHh8H2Z4pDBJ3bSiYp1hg2+VPsEqsE7cGaWSjgmI7k9/6sdb6sy/TdFq5lN4mbD+f4YiPbh X-Received: by 2002:a1f:f4c9:0:b0:4b2:884d:60ef with SMTP id s192-20020a1ff4c9000000b004b2884d60efmr8444821vkh.9.1702651601140; Fri, 15 Dec 2023 06:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702651601; cv=none; d=google.com; s=arc-20160816; b=pqN+yS+MA1x5ees2W1lLCLE8zJYhm5Qa0NeBnM3GLLp9E6ahXh7AEm46BKOPz74OQw MXHmr7RYD8vXf/RHPrkbwyI62hrxRvb7H5MK6/8oXbQRJBb1Hs8yoNw1j3SiLFk/Th5A JCGCTc7U8CwwXp+Gif5akDjvxe5ecyUD/yovd8TfSeKq7jJSo1x/qN5aQpPNfiXyrOTg jcJqi2CIBsgukEL3J/uhLgiIo5UcLqZrcX7jUsZb2lEwf+DEHUrh9yKqZHhzmbqQDrNu q5mz55oJnsBybw6T5i7yKEOYQVcJvsXOVa1aPvv23VxCHmknGVMVXFdP1ndjOf1jm+ug Upag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wJpx8lDh+zgSZj5Gc1ilBxsX86teXNLADKg4dm6Oaq8=; fh=7efVuUOhpnhc6x/4jCJakao7HjL6VEJyLpXwEIP1ZUg=; b=rA5rsC/dW4eJicD0IrVMNKtNqnabDa2b/xMcx5jbgiNVSQrF9JN75cmscvcD9PQtp+ yOHuyQnX+nhAtmVkyqTQIDK/p2m3V/9qG3S+k9OU6F+vJPYO7cWA/QshqP4nWTktHoBM oBWz5grLZjkz1EDmqrgXjqenGFsOYWjVJoOL9efAMecVIy8D9ZkeQ7rkHYuX3abdM1vS t5TCqGHQSTLkOpDWNoKW9eJS7Ipoia+Tl1D51U+7Wz9Ez9GCeYnZh3hgaSHuB1rN0Aa1 UXzEGf2nQaCxTKs9RayTUmrqYDPyzGgJd7QruaWuSy6Fa4dbp7DaOBVh4hiRpSu3NfV+ 6Rdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d8pdryL7; spf=pass (google.com: domain of linux-kernel+bounces-1130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k7-20020a1fd307000000b004b2db35024dsi3639411vkg.117.2023.12.15.06.46.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:46:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=d8pdryL7; spf=pass (google.com: domain of linux-kernel+bounces-1130-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1130-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DC8541C23871 for ; Fri, 15 Dec 2023 14:46:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E96F5358AE; Fri, 15 Dec 2023 14:46:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d8pdryL7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BBC435882; Fri, 15 Dec 2023 14:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d346f4a043so1501645ad.0; Fri, 15 Dec 2023 06:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702651587; x=1703256387; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wJpx8lDh+zgSZj5Gc1ilBxsX86teXNLADKg4dm6Oaq8=; b=d8pdryL7UmwSQcJdyTKKF0h4h0DfK9utT1MoC17bv1vuJE8i5wn9AHmEeQwzlLxf7m mcWUo8vKhtQfSkA4+XR9Kd5VsnNcRD78ZVhRi9Dq8bdGx+6jfiHXlx1KSnrHQE8d1fEv RZ+0ReGpHhK/fjUCIJvx/RUCg3zbBWKcEdMWwmW+qW8/7FMvCFGQ3Ngz2gBvsSOmd+Yu YOt+HZRV2qH8NtByl9Af89ys7XJqgN/5dNAPJ2ikN972B6YP+22GNDHdeQAYa84uIm09 cM+ppIbbG2cKqzuAqUltfTkEA31Z9xwl0lpG8fE8mtkxOjV0H4NsI1UF8ECrKEUAM5Kq k3mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702651587; x=1703256387; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wJpx8lDh+zgSZj5Gc1ilBxsX86teXNLADKg4dm6Oaq8=; b=AjsNPbUYssgldJ57ZvjneO8ij8OMI3CGjyM0R4rasLhdxPCogKkA6q+ACsPGfqd2oy aw+80NCUjl0Slp85xOjMnLhZhGI9OJfWLfZ93lfI/F3TCduyH9WD2/qELPXWJya5qOtG SJTYH0V7ERp3TuQ22CJ0SAqOqAT+5re9SOUUsugDLlaNs9Fls0YrqU/6VuCHqsz2pKZl ws3ypeT2fhyt6cUhmtd2cdmw/ixowZeAVPCalFQzLkSgb6IZCHMSl6xsRF/GVqNdhl+h PbHWJvrXZ9nWGfI/a0y+4+8SpKOIoctRi5Gd2Cyu4FBDiqt89Go8U0FwCW8Wk6w1P+16 nHXg== X-Gm-Message-State: AOJu0YwIImfvXpNZOSnsoPS2Lqe34A8FpuuLAjLb15/spDos73jiO2Rq uoAzu/aJrsVVFW1jGYrmUcA= X-Received: by 2002:a17:903:18e:b0:1d0:a146:f85f with SMTP id z14-20020a170903018e00b001d0a146f85fmr23491918plg.2.1702651586354; Fri, 15 Dec 2023 06:46:26 -0800 (PST) Received: from hoboy.vegasvil.org ([2601:640:8000:54:e2d5:5eff:fea5:802f]) by smtp.gmail.com with ESMTPSA id n6-20020a170902e54600b001d1cd7e4ad2sm14248945plf.125.2023.12.15.06.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:46:25 -0800 (PST) Date: Fri, 15 Dec 2023 06:46:22 -0800 From: Richard Cochran To: Min Li Cc: Min Li , "lee@kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: Re: [PATCH net-next v3 1/2] ptp: introduce PTP_CLOCK_EXTOFF event for the measured external offset Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 14, 2023 at 09:59:32PM +0000, Min Li wrote: > Would it be Ok if I use the flags to differentiate extts events from extoff? That makes sense to me. We can return the relevant ptp_extts_request.flags. Something like: #define PTP_EXTTS_FLAGS_VALID PTP_ENABLE_FEATURE Then you can return ptp_extts_event.flags = PTP_EXTTS_FLAGS_VALID | PTP_EXT_OFFSET; Later on, other drivers can indicate PTP_[RISING|FALLING]_EDGE, if they can tell which one happened. > struct ptp_extts_event { > - struct ptp_clock_time t; /* Time event occured. */ > + union { > + struct ptp_clock_time t; /* Time event occurred. */ > + __s64 offset_ns; /* Offset event occurred. */ BTW, please don't make a union here. Instead just add text to the comment of `struct ptp_clock_time t`. The `struct ptp_clock_time t` can be a postive or a negative value (see comment at the top of the file), and so you can put an offset in there as well. Thanks, Richard