Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp869282lqa; Sun, 28 Apr 2024 07:49:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPQbybY6rkDfQRSVOT3W2H+p6Ku0/Duepn2ob3VInzrpgBhiqwO41/brynUNVt1L/X65IcY+10hJW5f5lrerzatBd13Of7dyhtrLosxQ== X-Google-Smtp-Source: AGHT+IEEO1KgXx/177uz11uc1Jie7amyJ3GGHGfRfjLe/rylR8p5fYppN3Dhilb1qy5GCc4dswZh X-Received: by 2002:a17:906:414:b0:a55:bd8e:b6ef with SMTP id d20-20020a170906041400b00a55bd8eb6efmr5231502eja.37.1714315750967; Sun, 28 Apr 2024 07:49:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714315750; cv=pass; d=google.com; s=arc-20160816; b=NDSmj5bDZr4LWFBCSL78BdkjE9z32H1FFQpB2BzNPRZDNfoOly8mSdK3dCTElw45Mb HzND2lHYjaVNl8Fh6nRk46wTE8Ewc9rc04u4te/BXH7dUHzv+cGuw/7JrL7+ZbWe0KgA 6REv61Dpjx5NnFgQXz1In3PVh5uxhjoSYEBHxHt0uRB7MTQE3h5M7LjyFA9gzXN5IhKU MdC4GE/Gh7VGtYAzJPX4s+9Qrh9xu5I3uDk+YlHH22ic8DlOrPixXtVCVT/6Q5VAEnRA l6zWRAORp+f7/qNOBW+wudEmLV+pv2BtjfJQ9dSEykH86QXp8fP1R4ue4oe3lbp0pdTb 5EdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xqq21paJKP2+riMYLIjLYPLWIPBCPPYAVbbEQpB67Mg=; fh=pfFrlfXiCsgV/idJaOiy83ENDJ3ICedBEA7atztuk+g=; b=ecoTacyKOP5TCATMT6fSkpGpkAumMCBfvA3h8Mja/Mxoh1Nzb206ReClbxNjJHDPj/ W/XIEJ+GhJE2cVNu8ZMhy2oWJnsrYxmqkd28M6f1dUpOz6v9VqSV7SteFcemCjaUcpNK WTDBTAl69b5SpVbRX/zllDD5vnvmTkzou6j/77LkNSLYoWXDSCGTT9BBi684LoBoecwJ j4DrnofivA8DD4kMt17lRL9GSM13yK2pIDQBk436ca2gd/f2zrKzgmMB0wFawk5Y97xC 1Rt0HE6vRGf/h097m/Tw19HxoYy9yHxzVIRJAIHFDG0vV+oucmcAeFuyEbChMcblDzZe d6Fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="GjY/AysB"; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-161461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ce13-20020a170906b24d00b00a588075f57fsi6474467ejb.971.2024.04.28.07.49.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 07:49:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="GjY/AysB"; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-161461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 am.mirrors.kernel.org (Postfix) with ESMTPS id ADCD91F21223 for ; Sun, 28 Apr 2024 14:49:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E93956D1C7; Sun, 28 Apr 2024 14:48:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="GjY/AysB" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80E25AD52; Sun, 28 Apr 2024 14:48:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714315739; cv=none; b=Nse+Z9yGSy4mONuEkHnbzTnGWcCsp1dZB1Pa0FK4JAWwSRMP0nPRE2SWPBk/L85CgThuzUbC/f4cnSh9DHwWdFcwrhbuMcItbFV4tmigY1yS6uBXHUwrCk/Ms1f/677MWqx3DTVlzZd4j6VNDq/72G2oHbQgI+NEAFxdt7Mn25w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714315739; c=relaxed/simple; bh=TwQA7/miNNOphY2D3FI8tBXZwUzrt3mN49X+VNAy1tA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BJereALt65o2jsJNMwf8ggrwNsxaZj9xaVH4Q7ugo6rDAE8E0+KOlXVTIE1sBfpmbqjR/tX634QoohYS9aJP5BkaXIJ2PytjIgSOYyWkpDcc4bI9pn4n/A5EGilGm4OxrrEXJ2jwAO7ELv+xmf0YB9it8EG4gHlJ0RQt6cDL3kc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=GjY/AysB; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=xqq21paJKP2+riMYLIjLYPLWIPBCPPYAVbbEQpB67Mg=; b=Gj Y/AysBpQW6z8Qb8hIUYe9BIu8ptnZKE/aFs2RjpMVx6H+3IW+JA74hS3uJr92JIqa/K8uulLDD9lK 17hzYyijU6s5haNc0DJAJQkHjnUlyCERbSthBROv2NlN8TSYlrqE+twK3ilp/HJKIaF6FKaLKZJEa 3DQvvwpUT2bzOlg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s15pa-00EBzI-9b; Sun, 28 Apr 2024 16:48:42 +0200 Date: Sun, 28 Apr 2024 16:48:42 +0200 From: Andrew Lunn To: =?iso-8859-1?Q?Ram=F3n?= Nordin Rodriguez Cc: Parthiban Veerasooran , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, saeedm@nvidia.com, anthony.l.nguyen@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, horatiu.vultur@microchip.com, ruanjinjie@huawei.com, steen.hegelund@microchip.com, vladimir.oltean@nxp.com, UNGLinuxDriver@microchip.com, Thorsten.Kummermehr@microchip.com, Pier.Beruto@onsemi.com, Selvamani.Rajagopal@onsemi.com, Nicolas.Ferre@microchip.com, benjamin.bigler@bernformulastudent.ch Subject: Re: [PATCH net-next v4 05/12] net: ethernet: oa_tc6: implement error interrupts unmasking Message-ID: <4ea06ce4-d1df-49ea-8667-1f43dac7e747@lunn.ch> References: <20240418125648.372526-1-Parthiban.Veerasooran@microchip.com> <20240418125648.372526-6-Parthiban.Veerasooran@microchip.com> <77d7d190-0847-4dc9-8fc5-4e33308ce7c8@lunn.ch> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Apr 27, 2024 at 11:55:13PM +0200, Ram?n Nordin Rodriguez wrote: > > How fast is your SPI bus? Faster than the link speed? Or slower? > > > > It could be different behaviour is needed depending on the SPI bus > > speed. If the SPI bus is faster than the link speed, by some margin, > > the receiver buffer should not overflow, since the CPU can empty the > > buffer faster than it fills. > > I'm running at 25MHz, I'm guessing that should translate to fast enough > for the 10MBit half duplex link. > But I'm not sure how the spi clock translates to bps here. That seems plenty fast. Maybe you can get a bus pirate or similar sniffing the bus. Maybe there are big gaps between the transfers for some reason? Or the interrupt controller is very slow? > I'm guessing you are right and that the others actually would be > meningful to log. > There is a nested question here as well, and that is wheter to keep or > drop the code that drops the rx buffer on overflow interrupt. > I think not dropping the full buffer could be one of the reasons for the > perf change. You need to look careful at what a buffer overflow means, as written in the standard. Does it mean a chunk has been dropped from the frame currently being transferred over the SPI bus? If so, you need to drop the frame, because it is missing 64 bytes somewhere. That could happen if the device has very minimal buffering and does cut through. So the frame goes straight to the SPI bus while it is still being received from the line. Or the device could have sufficient buffers to hold a few full frames. It has run out of such buffers while receiving, and so dropped the frame. You never see that frame over SPI because it has already been discarded. If so, linux should not be dropping anything, the device already has. Given your 25Mhz bus speed, i think there at least two things wrong here. Dropping frames is too noise, and potentially doing it wrong. I also think there is something not optimal in your SPI master, because 25MHz should not have trouble with 10Mbps line speed. Andrew