From patchwork Fri Aug 16 00:44:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11096649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0776618EC for ; Fri, 16 Aug 2019 00:45:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF0F1289DA for ; Fri, 16 Aug 2019 00:45:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3BE3289DD; Fri, 16 Aug 2019 00:45:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D7B289DA for ; Fri, 16 Aug 2019 00:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726317AbfHPApI (ORCPT ); Thu, 15 Aug 2019 20:45:08 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52138 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725983AbfHPApH (ORCPT ); Thu, 15 Aug 2019 20:45:07 -0400 Received: by mail-wm1-f65.google.com with SMTP id 207so2701264wma.1; Thu, 15 Aug 2019 17:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RiXMeYkIURxOlpteZs7xGB2oEQUNanLqRdsxWuqWYeI=; b=MEDofrhU0mfvUWlwADfaLgabvtFh3xNEKKmycWXLLY01qZ7fn85mEgkzo8URLf5yno J4A++l9qoRHPep/Yw4bG5jylO2zWYyvEd4JDgVTq/7fp+Lc2o1l476UP36hdEQLVpL9S JmEdkokMgH+jYZpsPQtuzJk8x5til8y4tWSz3fCaXUAew53pg+tYAJS+LHZIYHcw2JY9 H4yoFTHG5ayRrofp/Y2Q5sZEY9O4qm+G0/LtIAxXjsnVp96S00ybR4+TDrfPNwpDjzgh w3v2K9SRRsvwSNq63Pjj0Ddrm0uGOJSEYjLDCxqpHKQbNJoXFsJ5jtb/BHrsGfeAxvZS zOyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RiXMeYkIURxOlpteZs7xGB2oEQUNanLqRdsxWuqWYeI=; b=uHZ1rNQJJaQD98Daju01VrrPGDYrkxY8BqMKkU1Zy+yEh/t5pk04r9Jb7IvQXU7wkb pQn02b8omrfJjc+NIrnPVwKXyoqCFebqWpzUUiAUvxNdjNjgnCW+IFYFunxIWkm/fGbW MwzWL1m1ejiIMQ1UZh/Pau6/Nmt1+LvHi8Jv7IdXguZzdrynug96qx75hNYQCK2GNO27 ShhHe0yxeK6ZrIBLcYLJhBvU3JedOEiCmiqpOPXLD/3HaiKKqZ62mUJWe2J4BZslbEqU xSagDA00zgqxDkbHKgv4aKVxIn6mMxCVFiMQXd2yZbKfsXof4hzij7nqHQEj4iQaX8rs yLEA== X-Gm-Message-State: APjAAAXFfwpJa9xBR2PI7/7piOkzZZ29HPHczna/4crCockn5tH59t7E vaCYGqTTSLjWXoN0tIODZ7Q= X-Google-Smtp-Source: APXvYqyne/aFJnQUJBD10JuToneiTd/HGfgoRs6AJbQ/H6XFviRp6AAwB+ZJfrGBvnyZZUgZhYczOQ== X-Received: by 2002:a05:600c:24cf:: with SMTP id 15mr4651382wmu.76.1565916305139; Thu, 15 Aug 2019 17:45:05 -0700 (PDT) Received: from localhost.localdomain ([188.25.91.80]) by smtp.gmail.com with ESMTPSA id k124sm6451204wmk.47.2019.08.15.17.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2019 17:45:04 -0700 (PDT) From: Vladimir Oltean To: h.feurstein@gmail.com, mlichvar@redhat.com, richardcochran@gmail.com, andrew@lunn.ch, f.fainelli@gmail.com, broonie@kernel.org Cc: linux-spi@vger.kernel.org, netdev@vger.kernel.org, Vladimir Oltean Subject: [RFC PATCH net-next 03/11] spi: Add a PTP system timestamp to the transfer structure Date: Fri, 16 Aug 2019 03:44:41 +0300 Message-Id: <20190816004449.10100-4-olteanv@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190816004449.10100-1-olteanv@gmail.com> References: <20190816004449.10100-1-olteanv@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP SPI is one of the interfaces used to access devices which have a POSIX clock driver (real time clocks, 1588 timers etc). Since there are lots of sources of timing jitter when retrieving the time from such a device (controller delays, locking contention etc), introduce a PTP system timestamp structure in struct spi_transfer. This is to be used by SPI device drivers when they need to know the exact time at which the underlying device's time was snapshotted. Because SPI controllers may have jitter even between frames, also introduce a field which specifies to the controller driver specifically which byte needs to be snapshotted. Signed-off-by: Vladimir Oltean --- include/linux/spi/spi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index af4f265d0f67..5a1e4b24c617 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -13,6 +13,7 @@ #include #include #include +#include struct dma_chan; struct property_entry; @@ -842,6 +843,9 @@ struct spi_transfer { u32 effective_speed_hz; + struct ptp_system_timestamp *ptp_sts; + unsigned int ptp_sts_word_offset; + struct list_head transfer_list; };