From patchwork Sat Oct 12 14:39:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 13833979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1123CF2566 for ; Sat, 12 Oct 2024 14:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+V4+PzZtNi7MIeIEF0+JVFMXtIpzK+7/ZpBXRsobCbY=; b=oAk5Jkw9qUnHoUURefIngyY2Yo zwxThVdB7UogVioPk9MP5FA5fhV0dlHlyLCyVD4BWLdP8GUIWUpKzc6PYyilnOd+am8+UVS57SiEy 5P6+VxqPZa5dL2wvcYsrVLLMDpu2dwDMilKWhUGIRoAOWMHRXyQzjU5L5K0GecDKuERADFHMdIdjK S41sYVQ8IP/5AppYwV98mKKfcIxII07a6WJ1Iix6Ockrq7GEjKIqHBuWN0Psd4HhD78eAqueXPxG7 KaAREU+qL5GiZeLs9BlwoJHHenopv12XQMrZ0ZViOVvhhuHtBWb1JIg6co5JR7EB/0IX0An6e3KK8 7OcfG9yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szdNG-00000001NTS-2RFJ; Sat, 12 Oct 2024 14:45:42 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szdI4-00000001Lij-3W00 for linux-arm-kernel@lists.infradead.org; Sat, 12 Oct 2024 14:40:23 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a995f56ea2dso465238666b.1 for ; Sat, 12 Oct 2024 07:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728744019; x=1729348819; darn=lists.infradead.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=+V4+PzZtNi7MIeIEF0+JVFMXtIpzK+7/ZpBXRsobCbY=; b=qOxY+jSZTeO2gAkS+ftXMZdy809VzjWPeRg/jE+bldR17vyX8EDgtMS908FHR7L1Lq XSzhZe0iGL9NdbLf4fyPbPhMNpXnhwwxExayJTOhZOpAyR3rOVb0XV+kb/jAgMi9hZiR UkN4dJ+InHCC5vedvVzPFNQsk3Uld1wHTBhLvthAIoh/g3kCQUZAz/BnahGRNT8SHVOf 8wZrEuvl25WaOVMPIZF/iizddMeuaHpURpLlVIZTDeciKhSKmjsdmBH/p5O72YflH+gM 6GLmj0K6s1twYLXlUqN5Rqq7e6CnAMqZHXh0lLm5K8XXAVumbOt8yVAna8sZoq+tK5G2 bpWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728744019; x=1729348819; 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=+V4+PzZtNi7MIeIEF0+JVFMXtIpzK+7/ZpBXRsobCbY=; b=gEHxRqrdhgxpR4vEi3UpISxP02WPQINaQ7Vpqx4Vnch49zZT0p4E5/PnNRj7qZQFDY k/tGT+1pVv8itZH1GuNK19l3MrQc8QKADUT6RFCjmmyCEXdYId1C8rY6LCHI1qr2gbtX Qgfy0LGfVyiZfhAFCKpR+O3dTJCRMYC0dVuuX2/DnkH/pRVjverrh5iXvEeGKK7CuxcO F489N2g+8ec1UkfXCtSjPcYiF1wZPm+yemnzDNPadi+FiQVN4x2srF1+VIM4siF78X6R /5vgjbPVpKKE4rZOIacmGORSARaS+pUFJgtx712gSRSks1AG/kVtzwii7KfApqEVt5UI nE5A== X-Gm-Message-State: AOJu0YzTLxnyMEMufYZGqochx+7m+ZHrFjQAEBl4pud7ltPYSQKTBDJY XyiWimJtqW3RZMfXana48jv7e0ziGzP5hw77b1INxY3yzlhwqJNz+8LB/kVoj9YQDckmiMGAnvk 1 X-Google-Smtp-Source: AGHT+IED80b4AbvloJuTe1bZzV8uPZDsuxDtElUD5sao7Y4gzMTYG2NdJpeqQ+ZAJDYGrLU8wprhgw== X-Received: by 2002:a17:907:e2d0:b0:a7a:aa35:408c with SMTP id a640c23a62f3a-a99e39e4fbbmr281594166b.8.1728744018451; Sat, 12 Oct 2024 07:40:18 -0700 (PDT) Received: from localhost ([2001:4090:a244:83ae:2517:2666:43c9:d0d3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99f752b7d5sm29972766b.217.2024.10.12.07.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 07:40:18 -0700 (PDT) From: Markus Schneider-Pargmann Date: Sat, 12 Oct 2024 16:39:27 +0200 Subject: [PATCH v3 1/6] firmware: ti_sci: Support transfers without response MIME-Version: 1.0 Message-Id: <20241012-topic-am62-partialio-v6-12-b4-v3-1-f7c6c2739681@baylibre.com> References: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> In-Reply-To: <20241012-topic-am62-partialio-v6-12-b4-v3-0-f7c6c2739681@baylibre.com> To: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Anand Gadiyar Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vishal Mahaveer , Kevin Hilman , Dhruva Gole , Markus Schneider-Pargmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=msp@baylibre.com; h=from:subject:message-id; bh=gzvHCEERIFSUE2/l9XVq++gH4WwGcviKuuBBdUnSMcI=; b=owGbwMvMwCGm0rPl0RXRdfaMp9WSGNK5uoxOfru8ZOs2+7jSxF3bFZmrF7YalPlJGrPc/hj3K aruoZdXRykLgxgHg6yYIsvdDwvf1cldXxCx7pEjzBxWJpAhDFycAjCRABeGfwZc5gofIxMDjolP CAkTkF7DXGznu2PHilClUKXtHx5Pes/wz3Bm4WNJbbE4JTuVbxUR5ctXbm0Q/7yAveK55dEnFXf ncgAA X-Developer-Key: i=msp@baylibre.com; a=openpgp; fpr=BADD88DB889FDC3E8A3D5FE612FA6A01E0A45B41 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241012_074020_970263_A353F9CD X-CRM114-Status: GOOD ( 14.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Markus Schneider-Pargmann --- drivers/firmware/ti_sci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 555e41cc08080c78b3991a8d6c06f5030a576d72..9ef86ea27a3c9ac6b9aa4a838a4f5e9fc09a81a9 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -398,10 +398,13 @@ static void ti_sci_put_one_xfer(struct ti_sci_xfers_info *minfo, static inline int ti_sci_do_xfer(struct ti_sci_info *info, struct ti_sci_xfer *xfer) { + struct ti_sci_msg_hdr *hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf; int ret; int timeout; struct device *dev = info->dev; bool done_state = true; + bool response_expected = !!(hdr->flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCESSED | + TI_SCI_FLAG_REQ_ACK_ON_RECEIVED)); ret = mbox_send_message(info->chan_tx, &xfer->tx_message); if (ret < 0) @@ -409,6 +412,9 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info, ret = 0; + if (!response_expected) + goto no_response; + if (system_state <= SYSTEM_RUNNING) { /* And we wait for the response. */ timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); @@ -429,6 +435,7 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info, dev_err(dev, "Mbox timedout in resp(caller: %pS)\n", (void *)_RET_IP_); +no_response: /* * NOTE: we might prefer not to need the mailbox ticker to manage the * transfer queueing since the protocol layer queues things by itself.