From patchwork Wed Aug 16 14:52:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Leonard_G=C3=B6hrs?= X-Patchwork-Id: 135866 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp572128vqi; Thu, 17 Aug 2023 02:31:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzTJfoEUNmcq33HTo8n/lmPYjgEunHEFdw9XVAi1YeDnTU6wYTQ9L8A6hTSwmrT7/fD+jB X-Received: by 2002:a19:2d1c:0:b0:4fb:7381:4c69 with SMTP id k28-20020a192d1c000000b004fb73814c69mr3271124lfj.28.1692264695107; Thu, 17 Aug 2023 02:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692264695; cv=none; d=google.com; s=arc-20160816; b=RGA39MymKsA4j8mDNC6W0eMG98hMlgf4ih4CBU6S9Ih4/Cq8Xtpxex4aXr/cxUDxaJ c9Yia2+SdU5j8sA0tqKZE2GObh+hzfQHmKHZ1QJ2o5zxJjUYGqSS+kWbyIscFDUtYg/S MfUPVhJU4hw3gHTgFZfELhd/ZnFBKJPz/O37YNwoB99oKQwAqI4wUAPLD9nzuv1yLtka o1SwFf14o+NimsqCEQxaybej5IFC1IqKxjkM0JarUiBbWcWHAXXj7Gasj4PQUr+EoXoc OFdyCcmFIurHT7djtjLXo8wgcYeG3AB5qwr9dNfYNzrPlh4ETi0kWnOJWhXmuGxdwcVc UgOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=lX3pPkML70Vn8t1w/0RoKm1p10wB/i3oa9OtYLOIR9s=; fh=YmBscbGkS0vKdqruRL7myglA3FHxxayGVvLZx9tIy40=; b=Nk4iN7+8IgH95YnOGBx4JRKuSrlB6bAWxcRig0pbzFRNsPb70eXxMlD6lUJ3qLADlZ TYOzH5IzjKMPQ9n/W2n6E6NSO42sObl6x2CADZO/pOIPxit115BCUtzul00542jmTJXh iJcN1CMIqsiMFmiVokCaNMPSiFIWJWNGgaY2lg5IZosS/1t3YdCyxFYascGMiRFpr2/X kSCcRpzUDWR2zb02XWovchCqjU4HS/DobrDV4KPkaWJ7uLafmrMWRW6KrEefsP6NwfsM BKVdV2frX4cGQQ25BHiqrvS4imjuQ91JR4JOhXM/iH5s1gfsxeCdiCbCcfzUIORAafic IC9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r22-20020aa7da16000000b00525979bd9fcsi2022550eds.305.2023.08.17.02.31.09; Thu, 17 Aug 2023 02:31:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343825AbjHPOxp (ORCPT + 99 others); Wed, 16 Aug 2023 10:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343921AbjHPOxn (ORCPT ); Wed, 16 Aug 2023 10:53:43 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB022715 for ; Wed, 16 Aug 2023 07:53:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qWHtm-0001Ft-4f; Wed, 16 Aug 2023 16:53:26 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qWHtj-00140M-QO; Wed, 16 Aug 2023 16:53:23 +0200 Received: from lgo by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qWHti-00DG1Q-Ph; Wed, 16 Aug 2023 16:53:22 +0200 From: =?utf-8?q?Leonard_G=C3=B6hrs?= To: valentin.caron@foss.st.com, Alain Volmat , Mark Brown , Maxime Coquelin , Alexandre Torgue Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, robh+dt@kernel.org, =?utf-8?q?Leo?= =?utf-8?q?nard_G=C3=B6hrs?= Subject: [PATCH] spi: stm32: fix accidential revert to byte-sized transfer splitting Date: Wed, 16 Aug 2023 16:52:37 +0200 Message-Id: <20230816145237.3159817-1-l.goehrs@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: lgo@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774468144994892559 X-GMAIL-MSGID: 1774468144994892559 Commit 6f486556abe35 ("spi: stm32: renaming of spi_master into spi_controller") included an accidential reverted of a change added in commit 1e4929112507f ("spi: stm32: split large transfers based on word size instead of bytes"). This breaks large SPI transfers with word sizes > 8 bits, which are e.g. common when driving MIPI DBI displays. Fix this by using `spi_split_transfers_maxwords()` instead of `spi_split_transfers_maxsize()`. Fixes: 6f486556abe35 ("spi: stm32: renaming of spi_master into spi_controller") Signed-off-by: Leonard Göhrs --- drivers/spi/spi-stm32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421 diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index 6d10fa4ab7839..7ddf9db776b06 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -1001,9 +1001,9 @@ static int stm32_spi_prepare_msg(struct spi_controller *ctrl, if (spi->cfg->set_number_of_data) { int ret; - ret = spi_split_transfers_maxsize(ctrl, msg, - STM32H7_SPI_TSIZE_MAX, - GFP_KERNEL | GFP_DMA); + ret = spi_split_transfers_maxwords(ctrl, msg, + STM32H7_SPI_TSIZE_MAX, + GFP_KERNEL | GFP_DMA); if (ret) return ret; }