From patchwork Sun Jan 25 18:46:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 54 Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (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 71BE6217F27 for ; Sun, 25 Jan 2026 18:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769367121; cv=none; b=ufNsj3e5O4yhAlVcRWeC5n6i2/le1OeGw991tkiSbaZxjwJBWM3osLEu3lH6zDf245LaFdND4+Rd6NF5A5ZkNGEDaTrqdACzcaS/tzLmyI4Sub9gmLwZCRCe+oMvTL6h4LhniEGWhAA3av+j/jExQ1WO72ghtw2CynPzIAfxhGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769367121; c=relaxed/simple; bh=zMaEvU68BWlhZpxDtfLltxRySkbC44HvvmZ1IlohbuE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HuTurj0sP21aeCJZM/FZzVgQfLPjtKnffeBNpjSk+5Zz+mXbfDOpmBhcoB8OCaVayieIsJSd+GADK4h7BVdPYpuEpA3uVg9xeeXkEpXpM9NBVjfKDphb+AxZoqr5vgFnUilvBX5UZM7JR7J4OF2sYNo6F8H5wppJuP8doHvdyZc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=GUb3b+DY; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="GUb3b+DY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=k1; bh=1cYkOR6p+28OeK pILTeDYy1YUmgndRIsJrSEImzjWWs=; b=GUb3b+DY+9mJpJ7B3Rk9AyWsPIlsID gYiUHWLfH4MhylfpJpW6wK1EEp4qmRvMXufRAsUMyjw3n6a7jZTjlMDlAiAJeytr PDYusfLDkbrdpScgSILsNpYpTv9wxWk3n8sIRRm98T1X5yszKvRP0oq5bX6qilP5 LjHLu7d1lAZJzkgT7s2l3Qa9JZdRes785y0OH4j4PHwtTrndA/aCfpLOjcH1lb4z BtZ0JoJOhdKJB5uQXdN4teK3yDzq+Q8ww2MIjkXg7v93zhNt8uES1joQCXP5zbLl u9kPE+ySeVYAst58JG+Fjj7CLKQTVDUGyLh4C9GbhtN1nhxaNB2QPgsw== Received: (qmail 2369426 invoked from network); 25 Jan 2026 19:51:47 +0100 Received: by mail.zeus03.de with UTF8SMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 25 Jan 2026 19:51:47 +0100 X-UD-Smtp-Session: l3s3148p1@Xefl4TpJKhBtKXAW From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Alexandre Torgue , Andy Shevchenko , Antonio Borneo , Arnd Bergmann , Baolin Wang , Bjorn Andersson , Boqun Feng , Chen-Yu Tsai , Chunyan Zhang , Danilo Krummrich , David Lechner , Greg Kroah-Hartman , Ingo Molnar , Jernej Skrabec , Jonathan Cameron , Jonathan Corbet , Konrad Dybcio , Lee Jones , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-doc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-iio@vger.kernel.org, linux-omap@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, Mark Brown , Maxime Coquelin , =?utf-8?q?Nuno_S=C3=A1?= , Orson Zhai , Peter Zijlstra , "Rafael J. Wysocki" , Samuel Holland , Shuah Khan , Srinivas Kandagatla , Thomas Gleixner , Waiman Long , Wilken Gottwalt , Will Deacon Subject: [RFC PATCH 0/4] hwspinlock: refactor headers into public provider/consumer pair Date: Sun, 25 Jan 2026 19:46:51 +0100 Message-ID: <20260125184654.17843-6-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Status: O TLDR: I want to create a hwspinlock provider outside of the hwspinlock directory. So, I refactored the headers into a provider/consumer pair. Which seems to me like a reasonable seperation anyhow. No functional changes. My build tests went fine and buildbots are happy, too. Longer explanation: There is a device (MFIS) in newer Renesas SoCs which combines various things like hwspinlocks, mailboxes and other stuff. Sadly, these are not strictly separated. Registers are kind of mixed and its register unprotection scheme will need one of its own locks. I tried various paths to handle this device (MFD, auxiliary bus) but I concluded that the sub-device dependencies give enough reasons for a single driver in drivers/soc/. So, this series will allow me to instantiate a hwspinlock provider from the other directory. Patches 1+2 do the actual refactoring with a fallback being in place. I used '-B' with git-format-patch in this RFC, so the actual changes are more visible when the headers are moved. Patch 3 converts all the users. There are not many. We could try to get all the acks for this single patch. Or I can break it into single patches and send them to subsystems. I don't mind. Patch 4 simply removes the fallback. Looking forward to comments on this approach. If the hwspinlock maintainers like it as is, I would kindly propose to apply patches 1+2 after 7.0-rc1 comes out. This might sound a bit hasty, but a) I want to avoid chasing a moving target and b) this would remove one dependency of the hwspinlock driver I originally intend to upstream, of course. I would take care of patches 3+4 as needed. A branch can be found here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/hwspinlock/refactor-includes Patches are based on linux-next as of 2026-01-21. Opinions? Thanks and happy hacking, Wolfram Wolfram Sang (4): hwspinlock: refactor existing headers into provider.h hwspinlock: refactor existing headers into consumer.h treewide: convert hwspinlock users to the new consumer header file hwspinlock: remove old header file Documentation/locking/hwspinlock.rst | 2 +- MAINTAINERS | 2 +- drivers/base/regmap/regmap.c | 2 +- drivers/hwspinlock/hwspinlock_core.c | 5 +-- drivers/hwspinlock/omap_hwspinlock.c | 4 +- drivers/hwspinlock/qcom_hwspinlock.c | 4 +- drivers/hwspinlock/sprd_hwspinlock.c | 4 +- drivers/hwspinlock/stm32_hwspinlock.c | 4 +- drivers/hwspinlock/sun6i_hwspinlock.c | 4 +- drivers/hwspinlock/u8500_hsem.c | 5 +-- drivers/iio/adc/sc27xx_adc.c | 2 +- drivers/irqchip/irq-stm32mp-exti.c | 2 +- drivers/mfd/syscon.c | 2 +- drivers/nvmem/sc27xx-efuse.c | 2 +- drivers/nvmem/sprd-efuse.c | 2 +- drivers/pinctrl/stm32/pinctrl-stm32.c | 2 +- drivers/soc/qcom/smem.c | 2 +- drivers/spi/spi-sprd-adi.c | 2 +- .../{hwspinlock.h => hwspinlock/consumer.h} | 22 ++-------- .../linux/hwspinlock/provider.h | 40 ++++++++++++------- 20 files changed, 49 insertions(+), 65 deletions(-) rename include/linux/{hwspinlock.h => hwspinlock/consumer.h} (94%) rename drivers/hwspinlock/hwspinlock_internal.h => include/linux/hwspinlock/provider.h (78%)