From patchwork Mon Sep 7 15:31:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Rebmann X-Patchwork-Id: 365 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 75F361C0CB4 for ; Mon, 7 Sep 2026 17:33:57 +0200 (CEST) Authentication-Results: mxe881; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-25658-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-25658-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 567172FBBA for ; Mon, 7 Sep 2026 15:32:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF6FE509F14; Mon, 7 Sep 2026 15:32:13 +0000 (UTC) X-Original-To: linux-sunxi@lists.linux.dev Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (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 583CE4EA394 for ; Mon, 7 Sep 2026 15:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.200.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788795133; cv=none; b=qCRrV8dGhFX1fvGGNJFcB1n+Hzxur8XJoX70qyvgsKywp//1k2CWqzhhB6QR/5XtzxBVPIMVhYOPgeKRBXd4fmb1+6QT9r87uK6YczwrLGMBl81JNkq/AhuLAuitUifSBIO9aC03JY+szAVmzJvVf0vYmI6qeadPZaOb1vRjES0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788795133; c=relaxed/simple; bh=QoP8/i51F8msseuU7N8yphI/jYG+fFigP1A13afHRU0=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=kuEiIXYlkl8m3r3RLqsfmKpnDB1lHz1v47L/lWjxmiBIhNh5QdrSuxVW+L28vYNyVic6wjoMLoLHawDe1o4QMBN/+M4adNHipb2bzPhAQNC7OjZ6M6mzGgIXa1dXsF1WHTKuXZir34OGYRiHqYWscAWFfAm1dUnW8UFup05oXhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de X-PTX-Original-Recipient: samuel@sholland.org X-PTX-Original-Recipient: linux-sunxi@lists.linux.dev X-PTX-Original-Recipient: o.schinagl@ultimaker.com X-PTX-Original-Recipient: t.schramm@manjaro.org X-PTX-Original-Recipient: broonie@linaro.org X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-PTX-Original-Recipient: linux-spi@vger.kernel.org X-PTX-Original-Recipient: jernej.skrabec@gmail.com X-PTX-Original-Recipient: mr.nuke.me@gmail.com X-PTX-Original-Recipient: mkl@pengutronix.de X-PTX-Original-Recipient: kernel@pengutronix.de X-PTX-Original-Recipient: jre@pengutronix.de X-PTX-Original-Recipient: mripard@kernel.org X-PTX-Original-Recipient: wens@kernel.org X-PTX-Original-Recipient: broonie@kernel.org X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org Received: from drehscheibe.grey.stw.pengutronix.de (drehscheibe.grey.stw.pengutronix.de [IPv6:2a0a:edc0:0:c01:1d::a2]) (Authenticated sender: relay-from-drehscheibe.grey.stw.pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 143E02010BD; Mon, 07 Sep 2026 17:32:04 +0200 (CEST) Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1x3bKF-000Ym1-3C; Mon, 07 Sep 2026 17:32:04 +0200 From: Jonas Rebmann Subject: [PATCH v2 0/6] spi: spi-sun4i: assorted fixes Date: Mon, 07 Sep 2026 17:31:39 +0200 Message-Id: <20260907-spi-sun4i-fixes-v2-0-7e805662b9bd@pengutronix.de> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANvYnmoC/3WNOw6DMBBEr4K2zka2E/NJlXtEFAQvsI1BXrCIk O8ehz7lm9GbOUAoMAk8igMCRRaefQZzKaCfOj8SsssMRplSNcqgLIyy+TvjwDsJ6s4qqmvl+uo N2VoCnUWWXm3miWWdw+c8iPqX/t+KGhXqpqktDZUtq9tzIT9ua5g971dH0KaUvoD2SH+zAAAA X-Change-ID: 20260902-spi-sun4i-fixes-1a50e880dc7b To: Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Alexandru Gagniuc , Olliver Schinagl Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Mark Brown , kernel@pengutronix.de, Marc Kleine-Budde , Jonas Rebmann , Tobias Schramm X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1541; i=jre@pengutronix.de; h=from:subject:message-id; bh=QoP8/i51F8msseuU7N8yphI/jYG+fFigP1A13afHRU0=; b=owGbwMvMwCV2ZcYT3onnbjcwnlZLYsiad+P59J55xkp3oqOzjactazw8VWuGXeoZziOOuQnzP HwiKj4t7ShlYRDjYpAVU2SJVZNTEDL2v25WaRcLM4eVCWQIAxenAEwkJ4nhn7LCK+249LSFr/4l TDlxQnqy2qNOt49r5tRuYTp97jFvijEjw6bzIryf48P2LxBXE/W6fdGr7N63wvum8p1Ll2RPvf/ Znw8A X-Developer-Key: i=jre@pengutronix.de; a=openpgp; fpr=0B7B750D5D3CD21B3B130DE8B61515E135CD49B5 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; PRECEDENCE_BULK(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; DMARC_NA(0.00)[pengutronix.de]; FORGED_SENDER_MAILLIST(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo,msgid.link:url,pengutronix.de:email]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jre@pengutronix.de,linux-sunxi@lists.linux.dev]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; FREEMAIL_TO(0.00)[kernel.org,gmail.com,sholland.org,ultimaker.com]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.90.174.1:received,2a0a:edc0:0:c01:1d::a2:received,185.203.200.13:received]; RCVD_COUNT_FIVE(0.00)[6]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[bounces-25658-noreply=patchwork.local]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from] X-Rspamd-Queue-Id: 75F361C0CB4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= This is a series of patches for the spi-sun4i driver, some of which have been sitting around for a while. 1-4 are fixes and 5 is a small patch that introduces reporting of the effective SPI speed. Signed-off-by: Jonas Rebmann --- Changes in v2: - Add Patch 5/6 to fix division by zero potential in 6/6 - 3/6: Correctly subtract 1 to gain the register value for SUN4I_CLK_CTL_CDR1 - Mitigate race condition potential in 4/6 by disabling and syncing interrupts before sun4i_spi_drain_fifo() in the timeout path - Link to v1: https://patch.msgid.link/20260902-spi-sun4i-fixes-v1-0-19985ef75673@pengutronix.de --- Jonas Rebmann (1): spi: spi-sun4i: sun4i_spi_transfer_one(): add error handling at clock setup Marc Kleine-Budde (5): spi: spi-sun4i: sun4i_spi_transfer_one(): fix transfers for SUN4I_FIFO_DEPTH spi: spi-sun4i: sun4i_spi_fill_fifo(): always apply A10 FIFO fill level workaround spi: spi-sun4i: sun4i_spi_transfer_one(): fix setting of clock rate spi: spi-sun4i: sun4i_spi_handler(): fix race condition between transfer completion and RX FIFO interrupt spi: spi-sun4i: sun4i_spi_transfer_one(): report effectively used speed_hz of transfer drivers/spi/spi-sun4i.c | 68 +++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 28 deletions(-) --- base-commit: 89a312991dc6e638a36adc43ccb91dbc25504c04 change-id: 20260902-spi-sun4i-fixes-1a50e880dc7b Best regards, -- Jonas Rebmann