From mboxrd@z Thu Jan 1 00:00:00 1970 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 BEF473F788A for ; Fri, 15 May 2026 07:56:26 +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=1778831788; cv=none; b=L7lvLjyZ0IohQvWVjrfoheExB92FXcTTNZ05lg/jc8gudPRy8W+DdygndIhLkOXCr42bn8KbWcFH2uy+Aa4kmOMmUxIuv8HXVVofmTwvW/m3UQpQA46re7moNO2yw0Xv6wKvCXQt/mscfGncPSCz/P2uaCrqUV3N4ub1qXMD1lo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778831788; c=relaxed/simple; bh=Jqx/gqWShhJ+18Tlq/ec/Xd+/qJ5jHenCuDTIMvA44s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KGzZk7DB0XN3XB9XH+43zeL3qe2CulImaFgOsspP2bsYlqR4PhB/1OSG7us70dlLqNknk0IqG14zR5r5gOqJszABnl/9Yym12HMyAYyyssqOLh/Dp6S3AlwgQNUbJmI+vUq1Gf9gRvd90q+jcwElv7LOTlAw/beg9VLgHLGWNXM= 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=UdM2fl5t; arc=none smtp.client-ip=209.85.128.41 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="UdM2fl5t" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so146149495e9.2 for ; Fri, 15 May 2026 00:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778831785; x=1779436585; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=nE9mrH0UhzecibkTC58SxCDMEGe2+PqMAu5GxokQyLA=; b=UdM2fl5tMOQO5s8H+YEBNJ6CaY15odFcoiWqlbbE1QJI3gIfRVt9NZ9T7H2YCuiuNE bWFV9tC8lGTNhw2N4LZ41GY4dvvy8K0+KDq/wQVb6yWdvLpvjPvx4AenUwRxRKXnLanQ kYi+jiV9g2R+LxXZWv77QLeNc9tze8esjwdbMwvz8SrvgN89X8jxZX4TzFzviSPLOror Pr6LFfSWUeagmN67NbwTnNpbi2GPORZh7W2rb2nhgwBAtW8ppDOHlJ7Cvd5ZLWDAERI8 sFbg2nkEb1eR8PuKd27RYjMf7pbhVcguMYPQKSo0bCzR+rdRqW7gDIUYfMe9I4qzXemz LBcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778831785; x=1779436585; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nE9mrH0UhzecibkTC58SxCDMEGe2+PqMAu5GxokQyLA=; b=gJwnPfA2nc9C90MzGpdUPfTC+eD4lbTW0XPg9TXDbcsx85Gm7JNl5Tqd3BvN3A2OFg canCWYCeh4M8LvsFcyQIKVJ/nXZGDb36RIgeXQnxlZzwH7lyMheoQ0U2ecENcETzSQA2 5Uep3nZw5XBXRuEENBnFx2ih+zy398w//d5sEgFfX0OuXVFxgX6ix002Inj9poKTIX/8 Y7l+Uo+Fl2+Y3bd4x9gaKG0W4Ta8RZzdv/1WMt6BGeMfxMBCgSjSBvJkcz/mQbyjpywg gWlZB36lTP6Xjmerp7BMNpxyB6z5inUKZXBRjPSnNQfizqu8k9UTbzYZmW1BRccgiZrK 6BhA== X-Forwarded-Encrypted: i=1; AFNElJ+8+yoaxChM/IltXDXr6OSGb5ADja8QefoMFAgvVoJWeupzuKmMNhmtnEQcxh/QBvqVTJN27tiERjARFMA=@vger.kernel.org X-Gm-Message-State: AOJu0YzRG0CzYY1JfDgQRf6mZJVgazOnvAvkyC7lJEFmjhnDSUjuj42q UEsu/HWFr6lPhIIg5KIbAroSvrCwtl4KawPQ5T2CkZnK75uF5BbnnQVKMgwUN4GsVYA= X-Gm-Gg: Acq92OHzXpyi/agDQlc5tFocg3NBOWDjwGVA09nwtDfBWGGzYzK6o6RtN6ZAWTIwzzl BLjG9Fz9BW50FQ/W7XQgVkqyipn181nwQMceVSfQs6W/QRspYUaNFqccYJY3jH39ce8fU4Nk9i1 zTBvLDiBoOfswKe6RCg5W3oBPQNpXTr17EfzFKuQyachJj5devkSZ8pwSQ6y3KKAAAWqnfY1D2P lMAJNXM50awlWhudBmCgzINoIQHR5+cATvDbcpKfrKVE24x0BBOm5itihf5sqvXW6kPgo1s/8yG ndlBk22bWJSsF9BqTelcbUaLZhnjF4nfjiiuibwJfzTkO0Z43rg5Lt+51DMFsmTmd4TDTyx3PEF WipoHJjO6wp3Ixx+sWah/3IVdxe1e/Fw/hVMJc01gpzxnL3yapE1dxDVj0mdlF4XioEc60xZpsz Sh9lFputWkTZ4ZNAXxjm9zEdjmZOTo02Xy X-Received: by 2002:a05:600c:6992:b0:48f:e230:2a20 with SMTP id 5b1f17b1804b1-48fe662a1b2mr36300395e9.31.1778831785070; Fri, 15 May 2026 00:56:25 -0700 (PDT) Received: from [10.11.12.109] ([79.115.63.228]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe4c88e5asm43645835e9.6.2026.05.15.00.56.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2026 00:56:24 -0700 (PDT) Message-ID: Date: Fri, 15 May 2026 10:56:20 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/6] firmware: samsung: acpm: Add TMU protocol support To: Alexey Klimov Cc: Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Lee Jones , Alim Akhtar , Sylwester Nawrocki , Chanwoo Choi , =?UTF-8?Q?Andr=C3=A9_Draszik?= , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, peter.griffin@linaro.org, jyescas@google.com, kernel-team@android.com, Krzysztof Kozlowski 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> Content-Language: en-US From: Tudor Ambarus In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/11/26 4:17 PM, Alexey Klimov wrote: > On Thu May 7, 2026 at 9:31 AM BST, Tudor Ambarus wrote: >> On 5/6/26 6:13 PM, Alexey Klimov wrote: >>> On Wed May 6, 2026 at 12:39 PM BST, Tudor Ambarus wrote: > > [..] > >>>> new file mode 100644 >>>> index 000000000000..c68d60b4c0b3 >>>> --- /dev/null >>>> +++ b/drivers/firmware/samsung/exynos-acpm-tmu.c >>> >>> [..] >>> >>>> +static int acpm_tmu_to_linux_err(s8 fw_err) >>>> +{ >>>> + /* >>>> + * ACPM_TMU_INIT uses BIT(0) and BIT(1) of msg.rx.ret to flag APM >>>> + * capabilities. Treat zero and all positive values as success. >>> >>> ACPM_TMU_INIT returns capabilities inside designated error field? >> >> yes > > Heh. Okay. > >>> What about other messages/commands? They just return error code there? >> >> all the other commands either return -1 for errors, regardless of the error >> type, or 0 for success. >>> >>>> + */ >>>> + if (fw_err >= 0) >>>> + return 0; >>>> + >>>> + if (fw_err == -1) >>>> + return -EACCES; >>>> + >>>> + return -EIO; >>>> +} >>> >>> Could we map these return values with better granularity instead of >>> returning -EIO for everything else that is not minus one? >> >> I think we're good as we are now. The firmware returns either -1 for errors, >> zero for success, or BIT(0) and BIT(1) for TMU_INIT to flag some capabilities. >> I can't tell if there are other commands that return capabilities as well, >> or if there are other capabilities for TMU_INIT, I don't have access to the >> firmware code. > > On Exynos850 I see more than just one returned error codes. I definitely > see 0xfe and 0xfd at least. I don't have any data to confirm that ff > maps to -1 and fd-s, fe-s to -2,-3 though and what they mean. From my for these error codes we will return -EIO which is alright. We can have a more granular approach depending on the SoC if you want. For GS101 above is alright, it matches the info I got from the firmware guys. > experiments I suspect that 0xfe means that call/msg type is not > implemented or not accessible and 0xfd means that passed parameter is > wrong or incorrect or not found. > > I am also not sure that I saw 0xff-s but, well, maybe that needs more > experimenting. > fe and ff will be covered as well by -EIO. Let's keep this as it is for now, and if you need a more granular approach we can differentiate that for e850. Thanks, ta