From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 37C44346A02 for ; Wed, 29 Jul 2026 08:37:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785314262; cv=none; b=a7MNBjahi0EnSL/WGybw9GozWjEZH0SaZUuGM8kpmJ8fBxK8HlDwXPj1SBjPSymyd/w5QLwq/fJAcpTYEgeG85yDwPzpADxvpRyfcEu/WPZpBsCtwQPvh3kkj/3m2rOjDPsEOf379YIAatl5ABYzGRF8fwgbRAzNcE3t64+Bo0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785314262; c=relaxed/simple; bh=3IodyGZnKFDzuvbdxVK4kJdIEEZdA2esA+7XyrcqlQc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=GLkRNKG19Dkp/qfNFR0N0Zz65+Mm1Zmrl8SJLVJvXDgjjxanYwxabbXXaZT7C0DJoVOkaTlvZH7vU6PntMIaKRUcmiKhL4T3aMA+cc3OV20fj2AunK0bzuyCx7M3VGqmOVqe3++9ddA6EMMo8ziEVENu9SXfeZySNIcsJnM4f5s= 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=1udvPhs6; arc=none smtp.client-ip=185.246.84.56 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="1udvPhs6" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7533E1A12EF; Wed, 29 Jul 2026 08:37:37 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 32D1D603BD; Wed, 29 Jul 2026 08:37:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5B4A311C14AEC; Wed, 29 Jul 2026 10:37:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1785314256; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=3IodyGZnKFDzuvbdxVK4kJdIEEZdA2esA+7XyrcqlQc=; b=1udvPhs6aNcVxCQqVyU9adFATlbxxyUh3QjebezaE5ZaGB+JI6R4idpk7gkb6SGrOGVJkq 0rHo91gMwyByUgLSGNnTapOMMylQxmuiR8+FfE60mwEm4+d6CzbBqYB7EtLRMbjNwM/TdN guYBfRWWKwrN/BpbLwgqZWDj74J2RPj5j9dmyHkWHTtsOgs6HYlaYScRb9m/o7RvOny9oh bpzq/0+dzEqgxVxaLRRvlJT/msfheh2c4DJq/ByvLVeYRkB0ldtDTpAXWlfKWXmUjwGn1d e59XAO/iBN5zl3pNeY9YeeufrKb7v172iP1AQz+4YBAIUlGXT3bgsAN8Uy/nAQ== From: Miquel Raynal To: Santhosh Kumar K Cc: , , , , , , , , , , , , , , , Subject: Re: [PATCH v6 05/17] spi: spi-mem: add execute_tuning callback and spi_mem_execute_tuning() In-Reply-To: <20260723110219.3180747-6-s-k6@ti.com> (Santhosh Kumar K.'s message of "Thu, 23 Jul 2026 16:32:07 +0530") References: <20260723110219.3180747-1-s-k6@ti.com> <20260723110219.3180747-6-s-k6@ti.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Wed, 29 Jul 2026 10:37:31 +0200 Message-ID: <87qzkmmbsk.fsf@bootlin.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hello Santhosh, On 23/07/2026 at 16:32:07 +0530, Santhosh Kumar K wrote: > Add an execute_tuning callback to struct spi_controller_mem_ops. The > callback receives a mandatory read op template and an optional write op > template. On success the controller sets op->max_freq in each provided > template to the validated clock rate. > > Add the corresponding spi_mem_execute_tuning() wrapper that checks for > callback availability and returns -EOPNOTSUPP when the controller has > not implemented it, allowing callers to handle controllers that do not > support tuning gracefully. > > Reviewed-by: Miquel Raynal > Signed-off-by: Santhosh Kumar K Sashiko found two issues which I think are easy yet worth fixing: - [High] spi_mem_execute_tuning() directly invokes the controller callback = without acquiring the SPI bus locks or ensuring the controller is powered o= n. - [High] spi_mem_execute_tuning() does not check if the SPI device is using= a GPIO chip select before invoking the hardware tuning callback. Can you please have a look? Thanks, Miqu=C3=A8l From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CEB5AC53200 for ; Wed, 29 Jul 2026 08:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wySdx4jCKH5ZkqX5QtbGs6mfIs4fUwwqYy5AUGfuRDQ=; b=LBshjwLB6YTjMc zUeNCOm3bbbrT8xS0ckmw9xMSUo2Y7XJTbmCgD2QMbnzh/2VRheWASc6ZUaNtVl6eupgGFez30U5K CU85MTerz0NT5RtB50X7Tm1zTNszqSewDjNKQ2f0V//kNxZPvb/kykIsQv2MlpoIiNEreyk9fmbwm WzhoBYPecoojqVsE153gJ2rJ6Cq4/G8NlJUyKyabcbuK/8Hokdw7fQyPXR+c7mDqVab/JHSRhrCMC +VZI+utmRDjvl1qUzisxddjPTMcP7qqaPEFBfhmtTEnPPgJgduLW656kWLKdeUGV5uThzHF1TVuRJ HGrU7PDROoyX1a21C6UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1woznL-00000007Fca-18n5; Wed, 29 Jul 2026 08:37:43 +0000 Received: from smtpout-02.galae.net ([185.246.84.56]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1woznI-00000007FbO-0Ccp for linux-mtd@lists.infradead.org; Wed, 29 Jul 2026 08:37:41 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7533E1A12EF; Wed, 29 Jul 2026 08:37:37 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 32D1D603BD; Wed, 29 Jul 2026 08:37:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5B4A311C14AEC; Wed, 29 Jul 2026 10:37:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1785314256; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=3IodyGZnKFDzuvbdxVK4kJdIEEZdA2esA+7XyrcqlQc=; b=1udvPhs6aNcVxCQqVyU9adFATlbxxyUh3QjebezaE5ZaGB+JI6R4idpk7gkb6SGrOGVJkq 0rHo91gMwyByUgLSGNnTapOMMylQxmuiR8+FfE60mwEm4+d6CzbBqYB7EtLRMbjNwM/TdN guYBfRWWKwrN/BpbLwgqZWDj74J2RPj5j9dmyHkWHTtsOgs6HYlaYScRb9m/o7RvOny9oh bpzq/0+dzEqgxVxaLRRvlJT/msfheh2c4DJq/ByvLVeYRkB0ldtDTpAXWlfKWXmUjwGn1d e59XAO/iBN5zl3pNeY9YeeufrKb7v172iP1AQz+4YBAIUlGXT3bgsAN8Uy/nAQ== From: Miquel Raynal To: Santhosh Kumar K Cc: , , , , , , , , , , , , , , , Subject: Re: [PATCH v6 05/17] spi: spi-mem: add execute_tuning callback and spi_mem_execute_tuning() In-Reply-To: <20260723110219.3180747-6-s-k6@ti.com> (Santhosh Kumar K.'s message of "Thu, 23 Jul 2026 16:32:07 +0530") References: <20260723110219.3180747-1-s-k6@ti.com> <20260723110219.3180747-6-s-k6@ti.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Wed, 29 Jul 2026 10:37:31 +0200 Message-ID: <87qzkmmbsk.fsf@bootlin.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260729_013740_227048_7913FC59 X-CRM114-Status: UNSURE ( 8.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd"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