Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4163917ybl; Mon, 26 Aug 2019 06:29:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGlDmejwOhqB/ib+3BOsIAZsd8VgP1sy4VxQHxUQDONB82hite76TV0+D00DQzEFae1yfH X-Received: by 2002:a17:90a:1d0:: with SMTP id 16mr19453277pjd.98.1566826197782; Mon, 26 Aug 2019 06:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566826197; cv=none; d=google.com; s=arc-20160816; b=fpMOzqVvEliV9c0/AFAwrMqKt//OD9wGUR9RgcOhn3W/nQqJnoREdu5Bctj6AklKnR 2KXcTeVFBCUQvKMu2muP8qXmgd3MnhMU222DHJ2GPfNUmMPGuH2/D2/vxfB3nWYshgJC HtCOzU7EBZUSdE8MNNJN/IzM/6ab6PGXtyLJFx8EFeA09lYE2iVBZgeDhEF4ZQsJzlMJ rpMwB78TuIyYGNxyPO+AceyeoldwPI/eEAsRgY/aqYHHNAm3RhnXbBDgj+PLF68iGTAR E2sn//259Xbc+ddAjkJ1B01hnzGa6c0okzJYw2+FEwLbAuPdqfqtrA+ZrIEvhGGo8tgP o56A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eOkLkN7smSq0ns/S0LMZmqF1Dy+3J7PTJleOy2NTrNQ=; b=TyWAn5lP5M61PN+fk4jcw++mdycMZDfXOBDMZ5NaVSgEkWROp9ShrE+lQbKtaXA8po WhaymZDAguoVeqoGaZjOjWKuqR3SzWgcyPx8mGRgeeMhHfUoOw7R//mIHumh7OZoEp7e LJRk++jV4Xf/tlx+qmWzOKw3ST27igB+SSJ5T5ctDoDBvXXBtRtRIQIa9e3gBNUj+2IU 7Vy945Lc/+oSHGJlaWYOhhPpYjrJXIchstJhryiQfUkOwS4Pn3NWzzF3YMSSRLcHMoWv x7eO89IJGt2U6VFd1i3mDB3YMumqH4AFn+s78riHuaEDBTuOchQGzMKWcMzrj1BrDjFm AjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rchSLhS3; 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 u190si10536267pfb.189.2019.08.26.06.29.42; Mon, 26 Aug 2019 06:29:57 -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=rchSLhS3; 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 S1732092AbfHZNLE (ORCPT + 99 others); Mon, 26 Aug 2019 09:11:04 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:38242 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731526AbfHZNLE (ORCPT ); Mon, 26 Aug 2019 09:11:04 -0400 Received: by mail-ed1-f67.google.com with SMTP id r12so26445933edo.5; Mon, 26 Aug 2019 06:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eOkLkN7smSq0ns/S0LMZmqF1Dy+3J7PTJleOy2NTrNQ=; b=rchSLhS3jEcWGALrvZS9lg42bPsK+L4jmE1ofythOxOBFt7Knwin/H0gKk5aRQuMqV sMjx6Gng5zvInucUI+Os13OMlYXLtmWfaUPakz6Z2BMP8OrRt+P+mnqKucmGjCumX1WV f2H6RxTohS0XkJThfe5T3FSYC9FmzWltRieYOjQSQ7nvVWcqkx9nmBLJ+srikJlGrdct DHLoaF6wbuuCOrjORLwQG56Z+SU2Ua6Xynon+2CfT1CioS14peeajnB0XJVrr66r/EmL 1k2QS54FRjqtfCg1SpgSnVOmxY0OZsVNi2e9+Ow+gOZFCJLTy1AF1X2ESTkxR/L3meL/ /BnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eOkLkN7smSq0ns/S0LMZmqF1Dy+3J7PTJleOy2NTrNQ=; b=qJHagZL9F7QZWfvGEDvPp7RcChorCfl/B/KPC8HYizyaRvnFf1vUElFlibCiHte7lW ZiJh4R+m9aT6NAAzjAP7ojYiS6OqtdN4asWe2b4Oks7cdO1sil8g1Kellz92QCZA66M6 uUaGs8DkV0T9QnUhQElR/X3xymao38drSHMrKlMI3c5pylTqq/Vutt6u1dJpQJGNFOYk 2YahMT8st+gGF8iXp8c5saPcYECd6msUDm24wfLRppLEXcX5lsrRqWhwONHXYEwAYlFx qO7yC3Aoc9iTsgS1QPbUoNETYpjAv+rjDtKAbhvGg8GhJto+MsVVEk9u6oCDvtzssxuY xUSA== X-Gm-Message-State: APjAAAVbon+AtouMLqItjUTG0Ia92+geTxjFygT910OwiR2peL6KPcXK S3xL1MfapVMC2qB4fp3DbsjKzdShNxy9BcB6aw0= X-Received: by 2002:a17:907:2069:: with SMTP id qp9mr16385256ejb.90.1566825062311; Mon, 26 Aug 2019 06:11:02 -0700 (PDT) MIME-Version: 1.0 References: <20190822211514.19288-1-olteanv@gmail.com> <20190822211514.19288-6-olteanv@gmail.com> In-Reply-To: <20190822211514.19288-6-olteanv@gmail.com> From: Vladimir Oltean Date: Mon, 26 Aug 2019 16:10:51 +0300 Message-ID: Subject: Re: [PATCH v2 5/5] ARM: dts: ls1021a-tsn: Use the DSPI controller in poll mode To: Mark Brown Cc: linux-spi@vger.kernel.org, lkml , devicetree@vger.kernel.org, netdev , Rob Herring , Shawn Guo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, On Fri, 23 Aug 2019 at 00:15, Vladimir Oltean wrote: > > Connected to the LS1021A DSPI is the SJA1105 DSA switch. This > constitutes 4 of the 6 Ethernet ports on this board. > > As the SJA1105 is a PTP switch, constant disciplining of its PTP clock > is necessary, and that translates into a lot of SPI I/O even when > otherwise idle. > > Switching to using the DSPI in poll mode has several distinct > benefits: > > - With interrupts, the DSPI driver in TCFQ mode raises an IRQ after each > transmitted byte. There is more time wasted for the "waitq" event than > for actual I/O. And the DSPI IRQ count is by far the largest in > /proc/interrupts on this board (larger than Ethernet). I should > mention that due to various LS1021A errata, other operating modes than > TCFQ are not available. > > - The SPI I/O time is both lower, and more consistently so. For a TSN > switch it is important that all SPI transfers take a deterministic > time to complete. > Reading the PTP clock is an important example. > Egressing through the switch requires some setup in advance (an SPI > write command). Without this patch, that operation required a > --tx_timestamp_timeout 50 (ms), now it can be done with > --tx_timestamp_timeout 10. > Yet another example is reconstructing timestamps, which has a hard > deadline because the PTP timestamping counter wraps around in 0.135 > seconds. Combined with other I/O needed for that to happen, there is > a real risk that the deadline is not always met. > > See drivers/net/dsa/sja1105/ for more info about the above. > > Cc: Rob Herring > Cc: Shawn Guo > Signed-off-by: Vladimir Oltean > --- > arch/arm/boot/dts/ls1021a-tsn.dts | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/boot/dts/ls1021a-tsn.dts b/arch/arm/boot/dts/ls1021a-tsn.dts > index 5b7689094b70..1c09cfc766af 100644 > --- a/arch/arm/boot/dts/ls1021a-tsn.dts > +++ b/arch/arm/boot/dts/ls1021a-tsn.dts > @@ -33,6 +33,7 @@ > }; > > &dspi0 { > + /delete-property/ interrupts; > bus-num = <0>; > status = "okay"; > > -- > 2.17.1 > I noticed you skipped applying this patch, and I'm not sure that Shawn will review it/take it. Do you have a better suggestion how I can achieve putting the DSPI driver in poll mode for this board? A Kconfig option maybe? Regards, -Vladimir