Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp21456lqb; Fri, 15 Mar 2024 13:41:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe8mesVkwkq+LLECftdM78enG0i9tMh5RFS0njb29qV4Iwd0DbLdgcIOYatBu4aW962xi5c6FcHpY5S/7oHIsny8QtBN5x7kLo2DnhqQ== X-Google-Smtp-Source: AGHT+IG8//s6gLh+GZ27ybhTBTjKGFCeq5aj7IBOfehuz7LPWpFExuArvdfYmeYLTRONp7QEFkwL X-Received: by 2002:a05:6a21:170f:b0:1a1:7713:acc with SMTP id nv15-20020a056a21170f00b001a177130accmr5696939pzb.49.1710535292552; Fri, 15 Mar 2024 13:41:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710535292; cv=pass; d=google.com; s=arc-20160816; b=o5Sb8kkbGBttNn2LZHLbPzX2ar5APzBUopFGtiaRbooYv18I6C/9CXg7Rgc1j3oU7o 0XyfSMbCMwYL586ntIDGSTCfkb6Sr4dPvjAaHOvoC1NL7UpbwZIHzaEw12iQEE8GQezD 7Co/N0lxT6LCYgw1MZvZVtYnqrI0zbo5Wpwvr3iPGZl6dtVDr8yNIMC8cH/TyRL3WK0O j2WxJagSgESpUrvYNsHcED4YlDPIuRdMgOPpZHmfqoUvZ/d6ZEaEkMMCfENV1UBattlg HQ/r5EtqUSW/KjwfCWXFj/Z42PF+FroKAxD9iKaB6cl2diEpgOIA7rfTdAaoeoi9uW3D wLfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZHqjsOzcUbVrDSpytoyEaLdHDpP/EhcorlLYt/IVjBY=; fh=j8WEY9m3HXTC2RDSWQnKbrSuGWbYRr6qL+EbH1kqBco=; b=aScDYNgajPNWupCIt1GsW1/8KFjiB+htBlS1PJhCVst5umClsro19LGKHst1bI214z r6G61pg+3xAkP3Xa6nb6kYatuFigi9E6i84EZ2Xef5o+Oik1+RJ/fPpOZHoUCU07LkPu rcSxAkHwCmoAT+l+b8LwEY1ip2ZLbZa9o7Rf+KermpvsIgQt/y+rCPLcqUpzxCClZYh5 nndpJk6llVziOQXEpF9YGhyeGt6h6rdQ6dNGzNbepZI1vGgnnxk9FjJh8Cmdsnhc5rXM tysChKTqG+hTPl/lc9Tr0Ys+WZLzTuPk/DyVeaf3PBACLf15utVKBuoGoc/suggzFE1d YdAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X6KYFR0e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-104897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 202-20020a6300d3000000b005e4a2f03587si3366249pga.557.2024.03.15.13.41.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 13:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X6KYFR0e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-104897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3B14D2887A7 for ; Fri, 15 Mar 2024 20:41:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 341F836B15; Fri, 15 Mar 2024 20:41:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X6KYFR0e" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5C47B1EB48; Fri, 15 Mar 2024 20:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710535286; cv=none; b=qeb8A4vi02+lKizLzyvUsb5K+LD2MzV1gP1Eq31q3ci3LbWW6bYfGZosBd0fQeuFy6QnpyKDP5pbwhuDrMWaq186m/7soIsqVbkmgrQX/pJ5NbKIg6di0ZxPhu/ntoPA3YIksiItIYNRF94dyWKndU3jrNN1V1M1jYNoYuEFhcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710535286; c=relaxed/simple; bh=OCGwnFTrEKMR7c0B6YzT8O9HyaNBGHd+2FsDDY5QnpI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PXFvWXlR62o9AYvKvlZDrTFekztcVqiKb0gqygdx1aI9XN6MSRc9gmtNxKq/O/K0C8qZeNyYL7ebVV+nver2Bs2z7uySu9G5WOSmoUF24LWKgKPbQZSjqDU3X42VcNZKpQjW9RpvjzeVoGgzf4nZaYa1gvX+SuSXsD3cbc6b2uY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X6KYFR0e; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95D09C433C7; Fri, 15 Mar 2024 20:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710535286; bh=OCGwnFTrEKMR7c0B6YzT8O9HyaNBGHd+2FsDDY5QnpI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X6KYFR0eGqSI4WRdnxqRUW0SUG6msu1cMhnmPGxxyVVa5RiisKSr8sviDtWOonI7U hHSyyxdUesc95vAVrkcOKoodbsd4Hqz1B/WzWELSVqPgsjmXVehj9qg14qSUaKzDzL +NcM0ZzGuSMTzLQ03rFQtVh68jeumeRjIZ2qVLypThrf4ExNhreLWXMJ3xOo8mZu1V C33n6H50BJQWErH07JixQ3cd7RF1iJJ3x1yZCLO8lD3uq68I9Z1czYpx5EdXGQXJOO sAPuZH0yZZJDJQvfxJWCoWxG2tEvWtiw+81W5EcjqCjYcfct0bvmwkXfKmRt4CzbsF hj65LPqGR0LfQ== Date: Fri, 15 Mar 2024 20:41:21 +0000 From: Mark Brown To: Justin Swartz Cc: Matthias Brugger , AngeloGioacchino Del Regno , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] spi: mt7621: allow GPIO chip select lines Message-ID: <71533474-eb08-438c-b7ec-5f3277c195fc@sirena.org.uk> References: <20240315015708.13948-1-justin.swartz@risingedge.co.za> <2dbc59c9133542f6f8bc465113d9630b@risingedge.co.za> <6c92fddd-f79b-40b5-bd52-61f43d6a7591@sirena.org.uk> <55c5f2e0723c18384c781e87985f0d22@risingedge.co.za> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="D8fyoBk023SaRwkC" Content-Disposition: inline In-Reply-To: <55c5f2e0723c18384c781e87985f0d22@risingedge.co.za> X-Cookie: A well-known friend is a treasure. --D8fyoBk023SaRwkC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 15, 2024 at 10:21:53PM +0200, Justin Swartz wrote: > On 2024-03-15 19:47, Mark Brown wrote: > > Look at other drivers that support GPIO chip selects? > Of the 43 drivers (of drivers/spi/*.c) that setup the > spi_controller's use_gpio_descriptors as true: > 39 drivers use the transfer_one hook, and > 4 drivers use the transfer_one_message hook. > Drivers that use the transfer_one hook benefit from the core > taking care of chip selection on their behalf. > Drivers that use the transfer_one_message hook handle chip > selection on their own, within the function they've pointed > the hook at. Oh, this is an old school driver. Glancing at the code I can't see any particular reason why it's not using transfer_one(), you should just convert the driver to that which will reduce the open coding and just generally improve functionality. You could add a callback to flush the write FIFO or add that into the write function, I'm not sure if there's a meaningful performance benefit there. > Considering spi-mt7621.c was implemented using the > transfer_one_message() hook, I'd assumed that it made more I think it's just old and based on having gone through staging likely based on even older BSP code. --D8fyoBk023SaRwkC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmX0snEACgkQJNaLcl1U h9AiQwf/UOmHNcZDrwzH7kt6mKHCl+t2aZ6FfT4MQdJ8icSErJVvBcuuQ9oJsVxP xz1vy6RLJhwCbN5LBk2dq55XzuBxiITCjPJhusoxmvZhbYZeZYzWzzWY8aB88aFV fyxs1trGjhla0rRAs1oNr/y5UDZFLYQvD9tBX+BWyGbous6fV7yYBycO7nYdRHd5 rsfasrQicNwMFKe1CJfKPp7GbaHPvC4drNGlDL9EaAFHGlxCp0a5ayWrLV4k1A6W v77j7yGf8gagHBzL7wp3pTbBKfJkYxSJiyEeIvsxXpKg7cjVHMywkzWlvF9RYTvv ZN3l1mazhE3mtXYNfbTEgMCj1iNXKg== =gBAh -----END PGP SIGNATURE----- --D8fyoBk023SaRwkC--