Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1347494rdb; Fri, 1 Dec 2023 13:50:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/Tg1BPuiw/hT6RJvl3ebSMf8hb5hAO3aRwel/+fMtKCIag6SbW3wFKLTRL46Ptb6499gq X-Received: by 2002:a05:6a21:6818:b0:18f:97c:9787 with SMTP id wr24-20020a056a21681800b0018f097c9787mr258116pzb.111.1701467454897; Fri, 01 Dec 2023 13:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701467454; cv=none; d=google.com; s=arc-20160816; b=KWwXbG/wb4G3VEGFQGmHijoBEn1UYAdGpfOZxouITnV3JVuuXOB7TsY2k1eDgx7Aof BDNA0bNEhTzrwi11ubx/FXVXDC/xIubhASuRHBrXY0IfVQfyiX5FyS7xfIIEXMW0DUgJ +fkrZSABOeAU5eHLiRJGEKCanENdmI47i9ScXXAWIHZojDq5vW9ZChDZkJDccZlUkzTd whiPX1xVb7b8VMYxqBYvTulr4jqsnej60aokmuJu6lw2ILIeo+S+fcNKvV2AELjLl15j sXxs1QyIzVobN+7H/q+8xk15kiz58YgZIWsuYN7rmiXXOtK1HoHIIGOI/hB8+nCApysq o1Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uqzpO8XiBlcA9+2hNN8faN/sYzf5WqZZHOMtigNfssY=; fh=hWAuizEjWJC9GXHDkQrSXtnlUt3s9oYLTb4yqUcvpzI=; b=mseJzS0lxZ0NfP2Z0LMze7ddbXZNMo9Ievz9wR2yDofhJzYZPcubqAO6GslP4/qBLZ S9GIP1l2R3HDedAWKrJV0GhiWT9q7Iewfrn/PEAuv0j0owHh8Ku/g5Ci7J0vU4DPC851 ISfroGsY9NC2h3rkiPbZBrYDJFkPkum0PG23kF2748zzvAWL4Qod8bOiShh02uHW0qOU qa7E2tlhU9bSOBss9NFKPyGWDhBvt6uMudR+WQM7vLlbTOM1Wdld1Ym2Jrw5u0I1UcWD yc7ccNc2vllTlq/wehWJogeKNKm5WnnoNzYCTYklqM9PPo95fCDfagfPzC8xsanTAWdy 3cAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lD7i61Br; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 72-20020a63014b000000b005c21c4a46ddsi3951098pgb.356.2023.12.01.13.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 13:50:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lD7i61Br; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6FD9C837CF00; Fri, 1 Dec 2023 13:50:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441795AbjLAVud (ORCPT + 99 others); Fri, 1 Dec 2023 16:50:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjLAVub (ORCPT ); Fri, 1 Dec 2023 16:50:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901ADFC for ; Fri, 1 Dec 2023 13:50:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DFBCC433C8; Fri, 1 Dec 2023 21:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701467438; bh=+unD+pWX96Y1kdDVAxBZ7bMp1TVUj6jkcNw1BaPS65Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lD7i61BrsR1vum22JMye1cgGgyHzYmTPfQgHiyBM+gWmfRFwW5q4QNEuKih7ppXrp uEZ6w8Sn/aCMbOHCzDjYS61GrI00spwsDarF8QwEtg6ZcNvTOhnQEJ4Am+0VGTm74d OI8i8fRZAhvc0g2o6LowV9lww1QBS9cNuCYrbuJwM+c2un3x5YTnYd7lB6GCFHXNGB 2XyJ61IK/iXVBazsTItz+/BzxQvCh3hKqmJ0NiOI/MXtJLozgAvXE6OwtsDs7VpMYz hfsajJSfby98g4SFgALiefSNMRCjoUSj3/T6XnG/Cmktrixx0Hzbal9bN4/Sc8YAg6 W8wGYYNldYDZQ== Date: Fri, 1 Dec 2023 21:50:33 +0000 From: Mark Brown To: Ben Wolsieffer Cc: linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Maxime Coquelin , Alexandre Torgue , Alain Volmat Subject: Re: [PATCH] spi: stm32: enable controller before asserting CS Message-ID: References: <20231201214014.2539031-1-ben.wolsieffer@hefring.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YmrIJOCZ+Tf3khLq" Content-Disposition: inline In-Reply-To: <20231201214014.2539031-1-ben.wolsieffer@hefring.com> X-Cookie: The early worm gets the late bird. X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 01 Dec 2023 13:50:52 -0800 (PST) --YmrIJOCZ+Tf3khLq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 01, 2023 at 04:40:14PM -0500, Ben Wolsieffer wrote: > This patch fixes the bug by enabling the controller in prepare_message() > and disabling it in unprepare_message(), which are called while CS is > not asserted. This feels like it'd be a good fit for moving to runtime PM - that way we avoid bouncing the controller on and off between messages which is probably better anyway. The driver already does pinctrl management for the device there. > Note that bug is likely not present on the STM32H7, because it supports > the AFCNTR bit (and this driver sets it), which keeps the SPI pins > driven even while the controller is disabled. It also occurs to me that this isn't going to work for devices which chip select inverted - for them we can't stop driving chip select at all since they need it held high when idle. There aren't that many such devices and it'd loose us the PM which is rather awkward... I guess that's an incremental issue with a more invasive fix though. --YmrIJOCZ+Tf3khLq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmVqVSgACgkQJNaLcl1U h9BFLQf/UOjz4Pr4wbrh+8Ck/3QreTFHhHy4MfusQ1TVF32f4jX9Nw4JQA/rFs4S 21ni5xP33d8D9cAiNUWJK+a7rYML9TyFbSsHJXso/CMk2OwuFNoUVIs/5NG/e643 Xv8oxmLSchOs7/Es9eBewWXyoyOx44UJZ6Xkm3nTTDFdLcIWO7JXfeB63cI7+Rpe UrehMBhcaftJmv2P3VCwNCYqz4zkKwJa0f8kBSMN/ypYzA/Q0xCoKEJw5rYQW6CW yE6AU3uob0Hgs9UT7xONC7GQ1KEnEfrPrSAtSs3ZFNSvV5vmaVubMZklllhGU3cZ laUraJqW1OZlhresrLnzhF/z4SCtgA== =1M3S -----END PGP SIGNATURE----- --YmrIJOCZ+Tf3khLq--