From nobody Mon Feb 9 17:06:18 2026 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 848032F12A0 for ; Thu, 30 Oct 2025 09:27:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761816426; cv=none; b=hZLQrtYsTA8fogAKM2UcF/vR5/q5Es0COaOnk7thtTRYXKWYi8b9G9Cc5FNl0PS1yBiAPUgz3awPkn3v2HEllLQ1jzPi3i1Iu1EKUE6sRWKScNF7+ODRH+iAIgqnDxB0CyOceWp2BlvdIIjOlwakBAYgfuqgOI48PcPfNrCpgkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761816426; c=relaxed/simple; bh=KhR7mlGuLILLgbABDE8JZr+5vkedHPIY9RgeGmUDVFM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RRKBs9EaQknhKO3WBqcEt1RLwIg9Xrp6SrsWHlddczRfbPdgwz5CqaqhxyYyevykjgzlvk+b5BdCqov9bIOtfUTwF0hltStqhIkWdrnXMYErimYWyCN0m3v7rAbHF3L+FRsBjPtxCPQDy2XGAyzgQKhpx97LTWwQzsBqHvcP8iw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=0G+kAEZ2; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="0G+kAEZ2" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4710022571cso9418795e9.3 for ; Thu, 30 Oct 2025 02:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1761816422; x=1762421222; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=f2nbBjY1ngedAQK32AIlHILlTX4360hWS/5AwjBnjIw=; b=0G+kAEZ2oKx54BGoHAZcI6KA2tn96hxoIM/wZ+uq8Mvohxx9KM2icmhtPQCA1fOM57 MLQDk3b/MSr6PByw7/MHO5bU1TSdN58jAz9pvnzSXRuVqcsyzA+L62Z131QAKnbmUvCZ W7PF1gEPP+OYmDJH3jFdjvgLFu4C2NS/DLE4C/GnMDvntD+A18Cnfoy21wn146JcgApU 3MXM9qETVckhvj1GWdXdIg3p9za7qbfDYmgqS3knAJveTrlIC3hULkpjM41F4EjCwFPA M2U1oH8iTzaDW6NtBO3NE8xI/2E22gx+0LMVI8KMjB3J0ynnaideN1xqY/V2APYoXUX7 ga3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761816422; x=1762421222; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f2nbBjY1ngedAQK32AIlHILlTX4360hWS/5AwjBnjIw=; b=KhFOs6zKtd3zMGne0ARipN2t9NsYFwt3BZQRtOd9Emt2SK9KweVVxc2GavQQn8eZAJ 4yGBJ4jGX1DGuQFBnt1QybDzm/1AL3R3wrM+SFt2w9J+qHljka5OhjwrxN37Vx4xhsJF 3aUh7elH/qzOZclkwIvbbMRYL1cpbiKLEsbfrw6GzI8dd14aKBCHnFlZKV1wv2UlSHW6 NzHudbuoTKHNIijBhb3M2LaPsnYs/D9Viq7azdwSd969mB+21lCRN4JYb2XaoXLRDbvm El2A0JxaHx8PJuSGqt1axCpi6A6XOylfEzcF8wyPdT5TvTofqhNPcOEd8Mq7/B4cNfxg 6UMA== X-Forwarded-Encrypted: i=1; AJvYcCXZCTs2lWNNhEJ/9TDj6LwKIBrUNhc/gtFq50Awarz07KxKM5tDxOH0Vg6Or5hyZI1D2ECDuSKfZ1d7uZ4=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1KDUFW3aAzA/ZSNi60qMTrDyzJBJGwnzxPyFk3Pl4IsHsxLFb PauZsEyISBLk5Yj4hhym99Z+PNP3M0TlR4z2ls/RBHMIwiIM8FivovHNGyTK7DrgoQs= X-Gm-Gg: ASbGncs+8F36Cgjun1HbYP0hbFR9T9kefDuC7e4O4/FhzU2ux6bJ5mkGW7sEqyi6bqD wdZ3yyg3BJztEO8L7V2rUfyGaaOWYyoMEv+MbowM/lQ9VI87gycHvTJmXIZOSCDBcWxykXa5Y+D 5PIYGS5XpkWWc/y/V0ucHwOkxJMkyq3408sEOq8vZgDinHksHDsoc0QYhWFS+rBiDVJ7XjEQ9LR clpbRha6X3PwwAjKf09hTLwmBcDvB6FAmPdJbIxCIslE4sx2Dru+/DlcWWXGnNSPtZknU9rbQYT rDwjflA7IbqcHN3+HgvRtihPn23ETX53y9jlVRX8kGXIKdyznuXYSpEuISELVMXgvszbLApnjf3 aAt93LZ5sOmlxEPAta/tIH/DmK34bxZo/vnUPn/vOMw+d/pfNdYxzMCCgUUPXpnxJGdpJdcPLC/ vdS0wcBu8Q X-Google-Smtp-Source: AGHT+IGXRhetBmDY0UqanhzjhdwbjEaOqJ9qlQPU7v66jN4giQVF3G2msZickY+kz8JV5cPNKrQRJw== X-Received: by 2002:a05:600c:3b85:b0:475:e007:bae0 with SMTP id 5b1f17b1804b1-47726736870mr19689495e9.16.1761816421828; Thu, 30 Oct 2025 02:27:01 -0700 (PDT) Received: from localhost ([2001:4090:a245:8496:49da:2c07:5e9a:7fb9]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-429952cbb20sm30827543f8f.18.2025.10.30.02.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 02:27:01 -0700 (PDT) From: "Markus Schneider-Pargmann (TI.com)" Date: Thu, 30 Oct 2025 10:26:08 +0100 Subject: [PATCH v9 1/3] firmware: ti_sci: Remove constant 0 function arguments Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251030-topic-am62-partialio-v6-12-b4-v9-1-074f55d9c16b@baylibre.com> References: <20251030-topic-am62-partialio-v6-12-b4-v9-0-074f55d9c16b@baylibre.com> In-Reply-To: <20251030-topic-am62-partialio-v6-12-b4-v9-0-074f55d9c16b@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar Cc: Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Sebin Francis , Kendall Willis , Akashdeep Kaur , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Markus Schneider-Pargmann (TI.com)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2209; i=msp@baylibre.com; h=from:subject:message-id; bh=KhR7mlGuLILLgbABDE8JZr+5vkedHPIY9RgeGmUDVFM=; b=owGbwMvMwCXWejAsc4KoVzDjabUkhkxmfdtWEfXP9w89uvlp5cdTLK/Wv7ogG2Pgev4jq9/HL Reb/n3c01HKwiDGxSArpsjSmRia9l9+57HkRcs2w8xhZQIZwsDFKQATme3GyPCNQ1tN82iyZ73v jWNzbKccmanrVxogL9h9eLajouDzvL8M/wtdOpWEmQSvRqQF7PqkEZG3+rp3+Y2Q5d9SCl+Wzmd KYwQA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 ti_sci_cmd_prepare_sleep takes three arguments ctx_lo, ctx_hi and debug_flags which are always 0 for the caller. Remove these arguments as they are basically unused. Signed-off-by: Markus Schneider-Pargmann (TI.com) --- drivers/firmware/ti_sci.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 49fd2ae01055d0f425062147422471f0fd49e4bd..24ab392b4a5d0460153de76fe38= 2371e319d8f2e 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -1661,14 +1661,10 @@ static int ti_sci_cmd_clk_get_freq(const struct ti_= sci_handle *handle, * ti_sci_cmd_prepare_sleep() - Prepare system for system suspend * @handle: pointer to TI SCI handle * @mode: Device identifier - * @ctx_lo: Low part of address for context save - * @ctx_hi: High part of address for context save - * @debug_flags: Debug flags to pass to firmware * * Return: 0 if all went well, else returns appropriate error value. */ -static int ti_sci_cmd_prepare_sleep(const struct ti_sci_handle *handle, u8= mode, - u32 ctx_lo, u32 ctx_hi, u32 debug_flags) +static int ti_sci_cmd_prepare_sleep(const struct ti_sci_handle *handle, u8= mode) { struct ti_sci_info *info; struct ti_sci_msg_req_prepare_sleep *req; @@ -1696,9 +1692,9 @@ static int ti_sci_cmd_prepare_sleep(const struct ti_s= ci_handle *handle, u8 mode, =20 req =3D (struct ti_sci_msg_req_prepare_sleep *)xfer->xfer_buf; req->mode =3D mode; - req->ctx_lo =3D ctx_lo; - req->ctx_hi =3D ctx_hi; - req->debug_flags =3D debug_flags; + req->ctx_lo =3D 0; + req->ctx_hi =3D 0; + req->debug_flags =3D 0; =20 ret =3D ti_sci_do_xfer(info, xfer); if (ret) { @@ -3689,8 +3685,7 @@ static int ti_sci_prepare_system_suspend(struct ti_sc= i_info *info) * internal use and can be 0 */ return ti_sci_cmd_prepare_sleep(&info->handle, - TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED, - 0, 0, 0); + TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED); } else { /* DM Managed is not supported by the firmware. */ dev_err(info->dev, "Suspend to memory is not supported by the firmware\= n"); --=20 2.51.0 From nobody Mon Feb 9 17:06:18 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C34C0314D16 for ; Thu, 30 Oct 2025 09:27:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761816426; cv=none; b=O6wcFJLYp3eacfev85IDZV9pRRTKtqXbuE4ysL9Tusu1sgl0wmqSGKXujaDh+GIQ5a0gGrAqG96Ui/p1YoPamlXbjBBIzYEN1eUiv0copyRMOF22h+sxolHBNjMoiYWA7i9Y7SWXf/F0q8oGfiMtkWLJP3YWi5avDyIstfOK4W4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761816426; c=relaxed/simple; bh=PFszx48unL3OZdOKxZC+O4/dOvgkdgU64h4yg5QoZts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XIPPX99tyQuc9IZZcIEELOh/gXwLpd0yh4gSq6HNn1WqQjgEjlqOCl9XdM6EeiWrtaenx5PhWfgAvcDdavA+5YDXX3E4u2zXEIpQrv3xjWOortxLcay1b5XYHdaWbqPuOEEJSrd7pc1BTQ4T3lphOlKrfXulAfZHGlnqxWHLxIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=H8cEYKS7; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="H8cEYKS7" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-421851bcb25so455345f8f.2 for ; Thu, 30 Oct 2025 02:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1761816423; x=1762421223; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QmA+fxDwXNd4r2km4orWOLxYXAzQdDkMb/ExdCUz6S4=; b=H8cEYKS7gEvV1g3l2fNNGUPyw0Otz5hI/EdGOSAdqygJOkyI03uFiTOpAgPV02i0yA kZWrPTNGmmBEAfzbWpEXtjWSwx1JldcDVBmgGPXZ61Q82+i7Tics/dir9twY+PK0v50u 3jyL3BwEaR8RPkNAgfBKhII36ZSEJhvy58mioYhHX3h3sEhyaX/6oOYtIq3eBP9anrXq eZf10eovKsqcFgmdyiP1htiTW1oA8Cgy5XkKQleMYyepocTAq5ZC7k5Tj/np/AA1mggX lvHEP0gK2BHPpSdGgF5uTdD6CCrTrTx+bXz2/8SwlVaJa5uUrdse4DCjvoBV4ySlZO1x AMBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761816423; x=1762421223; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QmA+fxDwXNd4r2km4orWOLxYXAzQdDkMb/ExdCUz6S4=; b=WQ2dX1ikMFphE4GTko66F/Q1v191pZIPFzVLBGnD9qC3Q5hhFHHDk+qNof0PYXAZ4v xhrw+VxK67bhEA4wBpC7AUklKTe65XtxuQ+2sYGOZHBswXULWv4lzIxHgHOKy/u4BGFS g+INgtjOcZFwWigRQfO32jswrHXEJBfqAgwt6OPWqtzDOFRCrO9A+URPYzU9f+AoChkA 1Av3hHP9qndXQ6VGdUSQ18+mCrB6y6eIi+Zhv2MtrBDkCY7QBRPNXDWplFlR+0BI1aa8 DVqQoRBIzcFhqdoSyI2M20/0FiNdi35xJbyQe+Q/Od7q6uR7P7z87hJo/7C1rMruBU4v tJ+A== X-Forwarded-Encrypted: i=1; AJvYcCXVpy2VO8u6T0lxb7Iz1P8ZyW10NmyTIWN1ZbIECyP91GeZuPDRtlLpP3fGFfWH36WDbVPgr8EeleqKs8g=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3CBK+8gfG1xevPvOm5VOKnpl09TQMh0esYXT3WFrMVbY3Ti4Q wTkYof2Vq76etJBw8cA0odhWIXild7OFIsSBxG56Ls7WgUe+M5XD1x7JNDxcVK/0XEk= X-Gm-Gg: ASbGnctfhKwg9smdysqqHytLu2htK/OGKOkyyKMsvji507OtQq8j1K3ROfJOvda0LRG n+Y53CkhJUI0g48Xm638kcyRH10d9mCngDL50oMorLepmHN6ppf/G4DO9oCGHovf3z9wkYNIppN VmxeCHbB81O72afuaYrdmy5x3neHnUu5xEjxp2p8FZrQP3KB3ZWsgyEI9CtGCGFZPDHGfSsFVyL QvynzgZxjR9B4th924qCgJgobNL6VQNgKbc4/rrGYH+0gimbAE1JGcq5JfmfjSdHFpCtZd+iczW r7+sA9G32qVpKIQD7HNG2+k94ILX63ucqBE02Yfb4GvISJXalrlWtF5EjwwIeMmS8nhzsH1j4kG 02m17X4SGIugJCFAAMVziaD+kOQ3mb7l09Y+hdbZGkCVmAv5CZ5WelVqaHWh2etXDkA5QqcU9xQ == X-Google-Smtp-Source: AGHT+IHQFpBNqStZU2m7ArSoDKfBgtc5gawxk4l8iU8TmUA/zx/GzBMN7nc7bDYsG15F0FLbqaObcg== X-Received: by 2002:a05:6000:430d:b0:3ec:d7c4:25b6 with SMTP id ffacd0b85a97d-429b4c8c17dmr2230439f8f.27.1761816423068; Thu, 30 Oct 2025 02:27:03 -0700 (PDT) Received: from localhost ([2001:4090:a245:8496:49da:2c07:5e9a:7fb9]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-477289e7fd2sm32748615e9.16.2025.10.30.02.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 02:27:02 -0700 (PDT) From: "Markus Schneider-Pargmann (TI.com)" Date: Thu, 30 Oct 2025 10:26:09 +0100 Subject: [PATCH v9 2/3] firmware: ti_sci: Support transfers without response Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251030-topic-am62-partialio-v6-12-b4-v9-2-074f55d9c16b@baylibre.com> References: <20251030-topic-am62-partialio-v6-12-b4-v9-0-074f55d9c16b@baylibre.com> In-Reply-To: <20251030-topic-am62-partialio-v6-12-b4-v9-0-074f55d9c16b@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar Cc: Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Sebin Francis , Kendall Willis , Akashdeep Kaur , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Markus Schneider-Pargmann (TI.com)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1698; i=msp@baylibre.com; h=from:subject:message-id; bh=PFszx48unL3OZdOKxZC+O4/dOvgkdgU64h4yg5QoZts=; b=owGbwMvMwCXWejAsc4KoVzDjabUkhkxmfZdLa79JSd9ZK1y3jeXLxcQcdrbfDgFdDhUfDJ/5f T4Qq3Cio5SFQYyLQVZMkaUzMTTtv/zOY8mLlm2GmcPKBDKEgYtTACYSeofhf4go144rH8qdN4dw 878ReTKj2XCrZ+RBhtCinS3zZ7V8es/w392+60AHs1z9zTQPRef+sNqMzdvlp7UUOp9tL5eILH7 CDAA= X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 Check the header flags if an response is expected or not. If it is not expected skip the receive part of ti_sci_do_xfer(). This prepares the driver for one-way messages as prepare_sleep for Partial-IO. Reviewed-by: Kendall Willis Signed-off-by: Markus Schneider-Pargmann (TI.com) --- drivers/firmware/ti_sci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 24ab392b4a5d0460153de76fe382371e319d8f2e..4db84a92a517b0aa7bb8d47e809= d9848a16e2cc4 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -398,6 +398,9 @@ static void ti_sci_put_one_xfer(struct ti_sci_xfers_inf= o *minfo, static inline int ti_sci_do_xfer(struct ti_sci_info *info, struct ti_sci_xfer *xfer) { + struct ti_sci_msg_hdr *hdr =3D (struct ti_sci_msg_hdr *)xfer->tx_message.= buf; + bool response_expected =3D !!(hdr->flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCES= SED | + TI_SCI_FLAG_REQ_ACK_ON_RECEIVED)); int ret; int timeout; struct device *dev =3D info->dev; @@ -409,12 +412,12 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *= info, =20 ret =3D 0; =20 - if (system_state <=3D SYSTEM_RUNNING) { + if (response_expected && system_state <=3D SYSTEM_RUNNING) { /* And we wait for the response. */ timeout =3D msecs_to_jiffies(info->desc->max_rx_timeout_ms); if (!wait_for_completion_timeout(&xfer->done, timeout)) ret =3D -ETIMEDOUT; - } else { + } else if (response_expected) { /* * If we are !running, we cannot use wait_for_completion_timeout * during noirq phase, so we must manually poll the completion. --=20 2.51.0 From nobody Mon Feb 9 17:06:18 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E21A33EAE3 for ; Thu, 30 Oct 2025 09:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761816428; cv=none; b=uB8bjXZSVDwbDa2kO0r1weONsPRVHMHfMpTRLRMarN8B226W5ThMGlfUPbxIpLi8r2LziOj+jM+9lPTj6saGgSxuoEqRDSOPq4neoRUNe54UfgfxDC04glPXRd61DzqevJlNUiY3LyNXNhhRHk0SKiJK/KyzpWu30iK2HAdgr4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761816428; c=relaxed/simple; bh=26F0Bvu56G754C2jeroEex8fImMoz0+Y7BY0qxomFcU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h3R5TZHmt0na3NPUjlUkuvF93X0/RKVPJDxZxt0NvYdc8bBUonbh99cp/JNX4wTVYdUAyVlf4Q96TtO2E85ixNxMbbT9SLF4cfLI7x1f7mf2smQ6DwEf4u24UrrRPkmeFxHqvLWYVoaIQs61T0otyizD1xVgWCnjKLmm4n6ZTCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=q/XGFwAV; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="q/XGFwAV" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-47710acf715so4144255e9.1 for ; Thu, 30 Oct 2025 02:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1761816424; x=1762421224; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SJU/7pOy6k5Otq6sscIBJ2rwBspnn6iIa72yddH68yU=; b=q/XGFwAVSheVbui53IHDUS4ePMMwFdglHYj/04KlgOjzY2Ga5NEbi7Lh+8MPnQ3AFY jaNLobCYijonQy3UMGensxysdSvp+f6ohL2u+CoPUDQHHPlEhn63reiTa9lGtuF9AOWd rp/+mM15gx8cCm1aS/9Kl79ZLa8BUQ1KRpUWiGhkvk4EXJoqNKpDGTxWwgN3dJxfubBU qHthqgISKqwhRF2Wvy3sjvNEUb92PE8kQOCKCYl3yTqp1NUooxSVT/cEVKnevWXyze3f VNYIV5hNkEVmn3TtqHRCirlNo8ObV9wmSJqkMsNrjmdG5Ic2V0K987KGWy2MBgeT3H1t ykZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761816424; x=1762421224; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SJU/7pOy6k5Otq6sscIBJ2rwBspnn6iIa72yddH68yU=; b=L029NYzPj4nKJkJrlM40P8q0UOLLjj4VJBIhsqlYpArMeHA7WPFjuc0C95ShosKWjm 1gevY4kRJG7qDw+R7mQeEbz4l0xFwUcwxt5Ir900iBGE/ZDVl2xnK7ZBYQEvdNY5lbjr Zi3DYni/D3TOPCyCbECgVErE78djLElMZb5nurmQCDN/f1bYkgyOepIHjfNi/pbaljdW jtdNCRRoq6Up7gRuh9jZ9eEijw2DArO5WRJ8UmxYqXKJAg4EPa/mWkUxrh5QYclp1SvJ 08j6mB2bzd7C91Hel3q8TejzRaSGXsh1Lvo20EqE6/jls3H7+F9tQf7I023py93KoBNs zqDg== X-Forwarded-Encrypted: i=1; AJvYcCWH51XmL05TDRUebOS3KCnkqktAOyJu9mGye91zjeutKNnl3UizZaFT178qsWimHYlDlTUNhOhYBKgQlxI=@vger.kernel.org X-Gm-Message-State: AOJu0YxtRwT6oKV0AxFb0CjOi213CPEtYd2psEXLYalwtMSOqmCSdsut KjAQxAE3T+wkETtIiOOrs//zjqdhRQ+xgw6GGQXkHjTa9FqAsC9cfj8VC3sm0daGDRY= X-Gm-Gg: ASbGncuDoNQnbSBCeXuvbVLxln0KyDKaqAsz41psbOxgHFbOTQ7Mbz/1nr3uWklE9ku AiSSjeNRT7LvRU3PCPWfU7U9pxQZ2RLi+2TfTgdyf6vYNM18WrA+TT9enLJW+QX9EcYAntlJ4Jk iEJEtln3ScaK80NGIdOpowvHy2sc0uKJHbJtAvBxGGrOHUsoKviY/Im9cwdaYXR4kBZ5oWO/qj6 2i8W+3wTij10CFeS9/fM/FOpFjzrCqPF47eC5vU7xgJeqXPc+ew4t6dw6t9onnSeRz31Ft2xidz rGAUYt0LiwAVhco/2/HI4PuN0AxAKAq2nsCbUwNQR52rzv6HYK17W5xGwPNUXEhXz6QqXhKJRtS R61paEMv3fvbWrNVuzMgJxs34X0fsjk+wmIegQdsWGpTBIUaiOBaVb7+cjYSvJPXkLlUHHUEKpA == X-Google-Smtp-Source: AGHT+IGiKMp7FmmJWvCzcPKsR4nFMCkOPRvUXCQdoKXYcyEIZ/3Nl23pSGaG1drR1Wm1x82x0LhDRQ== X-Received: by 2002:a05:600c:6303:b0:46e:4329:a4d1 with SMTP id 5b1f17b1804b1-4772675fffdmr19910835e9.4.1761816424323; Thu, 30 Oct 2025 02:27:04 -0700 (PDT) Received: from localhost ([2001:4090:a245:8496:49da:2c07:5e9a:7fb9]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-429952b79cbsm31002262f8f.4.2025.10.30.02.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 02:27:03 -0700 (PDT) From: "Markus Schneider-Pargmann (TI.com)" Date: Thu, 30 Oct 2025 10:26:10 +0100 Subject: [PATCH v9 3/3] firmware: ti_sci: Partial-IO support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251030-topic-am62-partialio-v6-12-b4-v9-3-074f55d9c16b@baylibre.com> References: <20251030-topic-am62-partialio-v6-12-b4-v9-0-074f55d9c16b@baylibre.com> In-Reply-To: <20251030-topic-am62-partialio-v6-12-b4-v9-0-074f55d9c16b@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar Cc: Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Sebin Francis , Kendall Willis , Akashdeep Kaur , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Markus Schneider-Pargmann (TI.com)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=7001; i=msp@baylibre.com; h=from:subject:message-id; bh=26F0Bvu56G754C2jeroEex8fImMoz0+Y7BY0qxomFcU=; b=owGbwMvMwCXWejAsc4KoVzDjabUkhkxmfR/5LunG1oM/Zvep7WJM4vz1fIqe7/y9kefYt956N FNosdrcjlIWBjEuBlkxRZbOxNC0//I7jyUvWrYZZg4rE8gQBi5OAZjI/m6Gf8Y/D854mCh9wMBS NOW4C+e5u6Km5uEtPfl8L5t7FsQ0BTMydMRfOZx8Pm5NlLbHIk/VQ4L6C8+vzzcOO2P5+oX7h6M r2QA= X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 Add support for Partial-IO poweroff. In Partial-IO pins of a few hardware units can generate system wakeups while DDR memory is not powered resulting in a fresh boot of the system. These hardware units in the SoC are always powered so that some logic can detect pin activity. If the system supports Partial-IO as described in the fw capabilities, a sys_off handler is added. This sys_off handler decides if the poweroff is executed by entering normal poweroff or Partial-IO instead. The decision is made by checking if wakeup is enabled on all devices that may wake up the SoC from Partial-IO. The possible wakeup devices are found by checking which devices reference a "Partial-IO" system state in the list of wakeup-source system states. Only devices that are actually enabled by the user will be considered as an active wakeup source. If none of the wakeup sources is enabled the system will do a normal poweroff. If at least one wakeup source is enabled it will instead send a TI_SCI_MSG_PREPARE_SLEEP message from the sys_off handler. Sending this message will result in an immediate shutdown of the system. No execution is expected after this point. The code will wait for 5s and do an emergency_restart afterwards if Partial-IO wasn't entered at that point. A short documentation about Partial-IO can be found in section 6.2.4.5 of the TRM at https://www.ti.com/lit/pdf/spruiv7 Signed-off-by: Markus Schneider-Pargmann (TI.com) --- drivers/firmware/ti_sci.c | 132 ++++++++++++++++++++++++++++++++++++++++++= +++- drivers/firmware/ti_sci.h | 5 ++ 2 files changed, 136 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 4db84a92a517b0aa7bb8d47e809d9848a16e2cc4..f2922fccfbe748a436cb9aa0a8c= 8e5f48db02ef9 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -6,6 +6,7 @@ * Nishanth Menon */ =20 +#include "linux/dev_printk.h" #define pr_fmt(fmt) "%s: " fmt, __func__ =20 #include @@ -3663,6 +3664,116 @@ devm_ti_sci_get_resource(const struct ti_sci_handle= *handle, struct device *dev, } EXPORT_SYMBOL_GPL(devm_ti_sci_get_resource); =20 +/* + * Enter Partial-IO, which disables everything including DDR with only a s= mall + * logic being active for wakeup. + */ +static int ti_sci_enter_partial_io(struct ti_sci_info *info) +{ + struct ti_sci_msg_req_prepare_sleep *req; + struct ti_sci_xfer *xfer; + struct device *dev =3D info->dev; + int ret =3D 0; + + xfer =3D ti_sci_get_one_xfer(info, TI_SCI_MSG_PREPARE_SLEEP, + TI_SCI_FLAG_REQ_GENERIC_NORESPONSE, + sizeof(*req), sizeof(struct ti_sci_msg_hdr)); + if (IS_ERR(xfer)) { + ret =3D PTR_ERR(xfer); + dev_err(dev, "Message alloc failed(%d)\n", ret); + return ret; + } + + req =3D (struct ti_sci_msg_req_prepare_sleep *)xfer->xfer_buf; + req->mode =3D TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO; + req->ctx_lo =3D 0; + req->ctx_hi =3D 0; + req->debug_flags =3D 0; + + ret =3D ti_sci_do_xfer(info, xfer); + if (ret) { + dev_err(dev, "Mbox send fail %d\n", ret); + goto fail; + } + +fail: + ti_sci_put_one_xfer(&info->minfo, xfer); + + return ret; +} + +/* + * Iterate all device nodes that have a wakeup-source property and check i= f one + * of the possible phandles points to a Partial-IO system state. If it + * does resolve the device node to an actual device and check if wakeup is + * enabled. + */ +static bool ti_sci_partial_io_wakeup_enabled(struct ti_sci_info *info) +{ + struct device_node *wakeup_node =3D NULL; + + for_each_node_with_property(wakeup_node, "wakeup-source") { + struct of_phandle_iterator it; + int err; + + of_for_each_phandle(&it, err, wakeup_node, "wakeup-source", NULL, 0) { + struct platform_device *pdev; + bool may_wakeup; + + /* + * Continue if idle-state-name is not off-wake. Return + * value is the index of the string which should be 0 if + * off-wake is present. + */ + if (of_property_match_string(it.node, "idle-state-name", "off-wake")) + continue; + + pdev =3D of_find_device_by_node(wakeup_node); + if (!pdev) + continue; + + may_wakeup =3D device_may_wakeup(&pdev->dev); + put_device(&pdev->dev); + + if (may_wakeup) { + dev_dbg(info->dev, "%pOF identified as wakeup source for Partial-IO\n", + wakeup_node); + of_node_put(it.node); + of_node_put(wakeup_node); + return true; + } + } + } + + return false; +} + +static int ti_sci_sys_off_handler(struct sys_off_data *data) +{ + struct ti_sci_info *info =3D data->cb_data; + bool enter_partial_io =3D ti_sci_partial_io_wakeup_enabled(info); + int ret; + + if (!enter_partial_io) + return NOTIFY_DONE; + + dev_info(info->dev, "Entering Partial-IO because a powered wakeup-enabled= device was found.\n"); + + ret =3D ti_sci_enter_partial_io(info); + + if (ret) { + dev_err(info->dev, + "Failed to enter Partial-IO %pe, trying to do an emergency restart\n", + ERR_PTR(ret)); + emergency_restart(); + } + + mdelay(5000); + emergency_restart(); + + return NOTIFY_DONE; +} + static int tisci_reboot_handler(struct sys_off_data *data) { struct ti_sci_info *info =3D data->cb_data; @@ -3941,6 +4052,19 @@ static int ti_sci_probe(struct platform_device *pdev) goto out; } =20 + if (info->fw_caps & MSG_FLAG_CAPS_LPM_PARTIAL_IO) { + ret =3D devm_register_sys_off_handler(dev, + SYS_OFF_MODE_POWER_OFF, + SYS_OFF_PRIO_FIRMWARE, + ti_sci_sys_off_handler, + info); + if (ret) { + dev_err(dev, "Failed to register sys_off_handler %pe\n", + ERR_PTR(ret)); + goto out; + } + } + dev_info(dev, "ABI: %d.%d (firmware rev 0x%04x '%s')\n", info->handle.version.abi_major, info->handle.version.abi_minor, info->handle.version.firmware_revision, @@ -3950,7 +4074,13 @@ static int ti_sci_probe(struct platform_device *pdev) list_add_tail(&info->node, &ti_sci_list); mutex_unlock(&ti_sci_list_mutex); =20 - return of_platform_populate(dev->of_node, NULL, NULL, dev); + ret =3D of_platform_populate(dev->of_node, NULL, NULL, dev); + if (ret) { + dev_err(dev, "platform_populate failed %pe\n", ERR_PTR(ret)); + goto out; + } + return 0; + out: if (!IS_ERR(info->chan_tx)) mbox_free_channel(info->chan_tx); diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h index 701c416b2e78f8ef20ce6741a88ffa6fd4853b2d..09eaea54dd5cabce72dd1652c96= 03e3ab446b60c 100644 --- a/drivers/firmware/ti_sci.h +++ b/drivers/firmware/ti_sci.h @@ -595,6 +595,11 @@ struct ti_sci_msg_resp_get_clock_freq { struct ti_sci_msg_req_prepare_sleep { struct ti_sci_msg_hdr hdr; =20 +/* + * When sending prepare_sleep with MODE_PARTIAL_IO no response will be sen= t, + * no further steps are required. + */ +#define TISCI_MSG_VALUE_SLEEP_MODE_PARTIAL_IO 0x03 #define TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED 0xfd u8 mode; u32 ctx_lo; --=20 2.51.0