From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 93B87379ED7 for ; Wed, 20 May 2026 21:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779310884; cv=none; b=qyZdxy7kRCdzZp8daAj3NLPD/U9SCFh87ARXc+OncvTROwl9BsWVSYAKfjXao2gXZQwOzPaVFascSu6Wd9KKa6V11pbnSYF4l3Q4ASO9l6WBUu2yzHKrLOyThLXhyPcGI1O7EuYraTWlhUjCZ9Tadu6DPSvNvZ+WY2BPRv30tVw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779310884; c=relaxed/simple; bh=9hgVEVQXcU4FuyUUNnkUzIz33hv8SRF0xUI91RTLQ6Y=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=eoWGpbsImOuhdxf/Mz1RZuDauNLxPDv+5XIxF8JSaNXr2A0FxJvzzkrKtqAWsa0ZFkKvfldzYAGZgU2tq+G7Z5v3hbGVvXqSfVj3P777vySoiqkbZv7cIaNX47PgzwMa1NkF4ryYDc6A1CRsHH+vhY3BpA7GpVdxslIl3F7W3mg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aic1Y9RX; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aic1Y9RX" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-48e82c23840so43716155e9.3 for ; Wed, 20 May 2026 14:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779310881; x=1779915681; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uNWw9DWW+f/uHjT/RqJlGuJEj3EDU+LfC71q1l4z5Ng=; b=aic1Y9RXov/dOudrSLpENDu1ghrssIPtz+anGrFNmzr04T5ifA50Cg8Hy7IUTyyWQ1 05LKeJEJNWRgk6RQDjhhHmv10S4w6JMELUvoSkCm1y1eBewT+5QzOzeKu9WGk0aA+9Jp JkHI05sBxGhRMyTQygG0sZzvBjx1HDJamI2ZCHhJAUvcNyHxFBeZ9X509TNQb2T1i7qD Ff4XBojMOaBqn6+3p4WW5rxxb0oh5MXt3P7RPy2zXIY4aYqjBsPvMjVE4Dh8IJNFeWB1 dVaGbk1xU5NJNvxfBWDc9KBmpY/i4mmwWPcWqq3J97/Yw51XWkhFZ+0fN6eaekcoNqDv 6+Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779310881; x=1779915681; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uNWw9DWW+f/uHjT/RqJlGuJEj3EDU+LfC71q1l4z5Ng=; b=VJ7vIqHUf44IB6pT4vDz+DUdhXD2EP3EwvwrtCOjYtI5ShXEKKpdsBQDI65CsF8jc5 MkFr5mjmsvtkZtmP+yioED2/dOq2FXTAomvDscbNFVctPWBXtytAk7nO5C2aLzWdrRpl zl8XvAQ4BWNPgRs28cGnTS9vWQ2/7Amdpat3EK9y90bI19jz3EPzyhxZk1jQI9QFcvYf 6KGHddW2F6SHuTAmNSIZcvEb9our6vsHNZr8bKuJYcr3NPsdyr+qFJdINZooCO32NOKN g/fusg6u1gmXfrOqfUOXp/LvqM65iILZQkfL6zeVfRXkt/mWmBt1ZW051RWyV7lkx47+ m+gQ== X-Forwarded-Encrypted: i=1; AFNElJ+Xj79ThIvX1pA4wUcYcmbdk79Aoe44iQRJsP6XCIm7D3sdKweCLDxS0P/bPttCTVfkz7YOHMCueSnPdes=@vger.kernel.org X-Gm-Message-State: AOJu0YxMibXR16H21gEIV7lPoV+ss1svfpO6RDGFlrJvkkYGdz9tkCFJ jRIPQt0RhW9jTCpQeffxY2De/svJpF/gso6fcOVPZ2bSLHbPJzN2EBmLhLZj6GvDTow= X-Gm-Gg: Acq92OH7l8LTHQFtGY+pR5x3J99YWga4QZFoykBpuFYoA92NfXaKGSzqcTST0IGOfGS AIzLYT1VjxyQWa/N23rsGlF2HFvQPtpapj8funpaEKtn9hmvMPAsVM8FFsTbx+uMnP1819y0G/+ sxPaktGYTcL3d38giGVk1MfhyVTX11AD6ZGKTIj0OJ1J62E3xSL71QT6gEHIIAx9E/mcOLEENjk 6lo7N+PhLl92Rqr+Veq8+NhXa9oPfSDLHIEwRvAhgE4J87np+lqYUfSDWHJUEVMY7/8amjjnOQU ffKhWvfPM0de+xu4s4Uzt72JOSRjTezL7gewl37NV3b8oz5QuEOGU2mvD4j//EIckXMX6Zp9/5A DM3z6EBz5UUhv+10AeWdAVSYjdFMw/lG35hDDydb4GqB4lpgTFGRvbL8a1Vn0HLCQz+DofQkskM GgPVK4fnHswamo3BPH8+ss7w7BLlw5jpULIlAjjoQhGcib8Pjs7M7zsktEEKyKSnLaTSAC2dj+n awyUZb0+ihZxw== X-Received: by 2002:a05:600c:17d1:b0:48a:54a6:b29f with SMTP id 5b1f17b1804b1-48feea9dda7mr217316295e9.17.1779310881027; Wed, 20 May 2026 14:01:21 -0700 (PDT) Received: from localhost ([94.4.195.193]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49035c45734sm849305e9.11.2026.05.20.14.01.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2026 14:01:20 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 20 May 2026 22:01:19 +0100 Message-Id: Cc: "Krzysztof Kozlowski" , "Michael Turquette" , "Stephen Boyd" , "Lee Jones" , "Alim Akhtar" , "Sylwester Nawrocki" , "Chanwoo Choi" , =?utf-8?q?Andr=C3=A9_Draszik?= , , , , , , , , "Krzysztof Kozlowski" Subject: Re: [PATCH 5/6] firmware: samsung: acpm: Add TMU protocol support From: "Alexey Klimov" To: "Tudor Ambarus" X-Mailer: aerc 0.21.0 References: <20260506-acpm-tmu-helpers-v1-0-a9cd5daf8355@linaro.org> <20260506-acpm-tmu-helpers-v1-5-a9cd5daf8355@linaro.org> <806da86b-45b7-43cc-b364-97bade8f4041@linaro.org> <73f18a2c-e729-45d7-9376-7c0e60ed35c7@linaro.org> In-Reply-To: <73f18a2c-e729-45d7-9376-7c0e60ed35c7@linaro.org> Hi Tudor, On Tue May 19, 2026 at 4:46 PM BST, Tudor Ambarus wrote: > Hi, Alexey, > > On 5/18/26 2:24 PM, Alexey Klimov wrote: >> Thinking further about this I'd humbly suggest that even >>=20 >> if (fw_err >=3D 0) >> return 0; >>=20 >> pr_debug_ratelimited("ACPM tmu call returned: %x\n", fw_err); >> or pr_debug(...); >>=20 >> if (fw_err =3D=3D -1) >> return -EACCES; >>=20 >> some debug message would do. >> Perhaps we need some convertation, for instance as it is done in scmi >> code (scmi_to_linux_errno(), scmi_linux_errmap[]). But I don't have any >> data for mapping acpm errors to some human meanings. > > I did that for the pmic helpers. I don't need any debug prints for > gs101 TMU as I have clear instructions from firmware: 0 for success, > -1 for error. This doesn't look like a right approach for upstreaming a ACPM TMU framework. You are trying to submit a gs101-specific implementation masquerading it as a generic ACPM TMU framework, while explicitly pushing the refactoring work onto the next developer to add support for other SoCs in this generic ACPM code. The ACPM TMU protocol implementation on Exynos850 is different: it uses different error codes, and half of the calls in this 'generic' driver are not even implemented in the Exynos850 firmware. Relying on a hardcoded if (fw_err =3D=3D -1) in a driver named generic ACPM is broken by design and may silently swallow critical firmware errors on other SoCs. What about such options below? - rename the driver to reflect reality: rename this specifically to gs101-acpm-tmu-something to reflect that it is tailored for gs101-s; or=20 - abstract the firmware error handling paths through driver_data or a dedicated ops structure now, so that other SoCs can cleanly hook into it without having to rewrite the logic later. Maybe we can utilise build info date from SRAM initdata base to distinguish between different version of ACPM firmware implementations. Sadly I was told that specs doesn't provide any version info. Or probe for implemented calls but that may break ACPM firmware potentially. You also mentioned that there are capabilities returned by TMU init call. Maybe that one can be used somehow. Thanks, Alexey