Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3105124rdb; Tue, 13 Feb 2024 07:05:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDsPFN2FUN1rj3Oy2Dus89g82mNZSVhvyRKBKF9cqasE3URnH1U5kN34tJ7FFUf5Js2L3G X-Received: by 2002:a05:6512:39c4:b0:511:8b95:1384 with SMTP id k4-20020a05651239c400b005118b951384mr6106451lfu.26.1707836756383; Tue, 13 Feb 2024 07:05:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707836756; cv=pass; d=google.com; s=arc-20160816; b=Do6y/wJxIp/R7H/sUOhCrXxtUOI4riRE9ZFPfgC2A/2T6nFCKGFTv4OXU8GW0Q/BZm l9UEaQBdJ1LzcyFX83n95HUKquRwjoK85RRjO2jMS7XTBxV/nYFh0TFfLxYPpQajyG1i WBjG8EZPNA73gQ3BEjJsrGSaACKrOdoc1mpEpZRoD99jyznvCTevK8Has/CVl4FRK7mL M7Q/VIV5m4jGZZsS2b1krZyNeilKReAO0wAGkzUcbwVKQe3srv0BU2BqrYlfhKAZFhMy +5CXBtZ0cDT14L8de5JhWfQqRcrBL3A6j8AJ8Ko0j9rvOtiCWlXtoV/r8ZWZ/+TYEafM M3Dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:from:to:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=4HDwpyy3tBnXbQ6lIyCh42gt9EtM1qPQ7jmDdySLbRg=; fh=090v8mQsgO/bQ0PFGXNzJUlcF54nLFpzZO8VA/OkWkU=; b=EAD28jNZ+sVW+OJCPk4VcBXPCFvEBIoB4oCLS6MsCNKHziHkP7JTZesDLgnnhs0oi9 lF2RI5/wEeeKGaXAZMQVYXaGaO1yFoeSqSI3CP3slJhPXrchxo21Ixebb1tKcw7vmAcZ d6XkKVeo9c2It0xLTw2YuMc7xc8ep3uI+UAtk0riCouTZ630ibGIZhR1/2dt8Xqx1I3g ExfcupgKNrer8FXb4babQ7Zly8mFVLp6x4sK27AjSDdQdeS28tUaVyb9vQeEavQy//4l KLalCCcQcVJ5oFO2ECIP0hKnG4q2U6fW3qE+PWi1IlnTjs5923VJ0aJtvmEyBOP7t45A yxRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fsoi7BYS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-63754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=2; AJvYcCW0HBj3SO+f+SAMUkQiHa03JoOhiUZJBScSWhAeS4bA8vU8znd3O1mkn7zjeHa4PmUs2IDFdiWNGFLlHyPEkkiwbESUAO/bp6Yph1Y2Tg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m4-20020a50ef04000000b00560dedd6fafsi3740715eds.167.2024.02.13.07.05.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 07:05:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fsoi7BYS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-63754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 am.mirrors.kernel.org (Postfix) with ESMTPS id C47991F2ABF8 for ; Tue, 13 Feb 2024 15:03:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 053125EE69; Tue, 13 Feb 2024 15:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fsoi7BYS" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 D889C58126; Tue, 13 Feb 2024 15:00:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707836425; cv=none; b=Igcg/taK+AC/IbY2w1M7RV/z/UfpwKRsZ+9ayE7L05QJKI9fyKweFltyUHkzPyPsDTR9GpT/NP9paE07BQ+vEuO8GOMkVrBB1uB5n9jYfLUSFWUUBJmBlmn8ycHFvPPMfUOtUHKze3fqVyqWOWsCp3lxSZeWVyImB++yg9y3sTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707836425; c=relaxed/simple; bh=gWsrd0/PgQYOHdRFEK2UvuRn9j/6BP+jXfidNB7p7bk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=UEGRtGXGt7hOC0FzxGogYmo0AqYqPdzEP7AJri7PnEwBERrxB5UdhPhodT7/d2TFttKuk9Y/cA/mb9ytC6G0tyenJqxU27S7xtu1aWRx17YW5r9BiulECkeqA3kLxFuAHa1xiz25BMtCxBICLYvDeHpR/UwE/JzHi4ndRHuXOiQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=fsoi7BYS; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 49CD7FF810; Tue, 13 Feb 2024 15:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707836414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4HDwpyy3tBnXbQ6lIyCh42gt9EtM1qPQ7jmDdySLbRg=; b=fsoi7BYSO+s2oMZcg7kY4xqmglEqIO21JJlQU2VNIOYaIu+58539Hn033rg3ISGS8h/t9k wpyJEIDHqI2M2SdvvG3JRn9pAHaiV8GUpiFLxnNKB4a+0KrhY6eQrgD3U/wPudAgKBWoWW 25P3CrR1LZVCtX4sFF8QtCm2dHJzDEjHdnWptXec3kpByvq1BXW/vjaEaaPEf5Kte1COWg T1VnWHtABd25xQ4N2/rqZKsUyjVFVcbn5TtrIVqmDF67XbH95KxnKAbZLqBIBt+bqGd1/L U74ew7e/TuT9VJPhBU7k3h1HT/lVN3oY9zQcrvlqRww2G8ugjhSELSbtDqLjiw== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 13 Feb 2024 16:00:14 +0100 Message-Id: Cc: , , "Dhruva Gole" , "Gregory CLEMENT" , "Vladimir Kondratiev" , "Thomas Petazzoni" , "Tawfik Bayouk" To: "Tudor Ambarus" , "Mark Brown" From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH] spi: spi-mem: add statistics support to ->exec_op() calls X-Mailer: aerc 0.15.2 References: <20240209-spi-mem-stats-v1-1-dd1a422fc015@bootlin.com> In-Reply-To: X-GND-Sasl: theo.lebrun@bootlin.com Hello Tudor, On Tue Feb 13, 2024 at 1:39 PM CET, Tudor Ambarus wrote: > > /** > > * spi_mem_exec_op() - Execute a memory operation > > * @mem: the SPI memory > > @@ -339,8 +383,12 @@ int spi_mem_exec_op(struct spi_mem *mem, const str= uct spi_mem_op *op) > > * read path) and expect the core to use the regular SPI > > * interface in other cases. > > */ > > - if (!ret || ret !=3D -ENOTSUPP || ret !=3D -EOPNOTSUPP) > > + if (!ret || ret !=3D -ENOTSUPP || ret !=3D -EOPNOTSUPP) { > > + spi_mem_add_op_stats(ctlr->pcpu_statistics, op, ret); > > + spi_mem_add_op_stats(mem->spi->pcpu_statistics, op, ret); > > + > > Would be good to be able to opt out the statistics if one wants it. > > SPI NORs can write with a single write op maximum page_size bytes, which > is typically 256 bytes. And since there are SPI NORs that can run at 400 > MHz, I guess some performance penalty shouldn't be excluded. I did my testing on a 40 MHz octal SPI NOR with most reads being much bigger than 256 bytes, so I probably didn't have the fastest setup indeed. What shape would that take? A spi-mem DT prop? New field in the SPI statistics sysfs directory? Other remarks have been taken into account, thanks! -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com