From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 4A2AF3DB645 for ; Mon, 11 May 2026 13:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778505475; cv=none; b=mxY+NngzNpassc++CjThSsCp1h2VWG3lh9YK/FUy33rZddfqat7ml3ksEqBoHd+DnRgOXuk7cYMSnSvC7zvfR7Mpix8XjGtjX6/bdBBnb4cL8vGgPB0tx+7zqO4fwKiIGfOpwOY0EpDXi9Ff8ixP0L30fBD/vYyHWtRhJVn5wQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778505475; c=relaxed/simple; bh=70pRwaawB6fSxyFjY9MWQ2Wj667Hq0JjSk0kpFgv0o0=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=uHjt66xbD5aJFTwHIkPqJD323WD3jsn6ehdjh3B/GfH8A7r5d/QHlmmBTOuDsMKOhA45tyci68yoXRdEfLG5rSHDRwoI0hlYhMN4DcRL4R2u0UPqP8iHlo3NH+qluSJbtCGiu2iv68a3icuu6E5zx6TI39war72mcJNHSSjI8c8= 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=OKiZ5YAY; arc=none smtp.client-ip=209.85.221.53 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="OKiZ5YAY" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-45297094718so3424598f8f.3 for ; Mon, 11 May 2026 06:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778505473; x=1779110273; darn=vger.kernel.org; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VpBr89JbDstdIUMvCB+UAEmSrotPv1wv1lCMdlQElUc=; b=OKiZ5YAYE5GosIW9lKyy4U4IQ6LOmSN909YdrCMzeucPYB/sKJ0yPm3hKVCQ9vW2nT G3lDMvs8v/iwvkUo4xCLNSvxsaP54sJRcysgPeBBl695/hAMiqidXxRNaT/rwRit4Amd RYgCS/ne+0R+xfxke34UlwcRq09huKA6yB2YXd+ftFPx1HBtvSOq/jEzogZTFXd1TWCd lY1SHqHJPv+q2pSEFRpUWePdeSvdBPO5hpLbE9qF4pPjcGae3WGqhW0ypO6JrCxHXcdT kiVNKNppC1oVavuE+0/xoLM1ZPqELlB33VkV+uWicfO6RlbfutFqaTgxJpNdDVO6W6Mf EHYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778505473; x=1779110273; h=in-reply-to:references:from:subject:cc:to: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=VpBr89JbDstdIUMvCB+UAEmSrotPv1wv1lCMdlQElUc=; b=pKD5z89D+YC541rT5+JzKmT8RD59GYy4xFpMOe8jA7QsGMOEIXLUgNUHc5npx47Sh0 gF93ZJ5N5Pz7IfzvuQu7ur7+ET/fO8xuk42Q0lWAzQa8XrOsy+4CuNzW0URfS9i7a6kK bvwYKsetfWHi4jQ7JA8pjtyHAguCHsFFAeipF09RFGWNz88TuZ+ihRqwnBjEAMs18xcx wGEsDmY0L2909tPkhEWNORiO/z8nGnuwS50Fa91SwXExYmzG+pJKD8A8KsE/pZq4ivNu 6MWfFRogM8qxgifD5X/RJGxqP2uqyegwJkDEoKaaf8BHPokcuQLfHXuDGx+s0ijmxUqz j7HA== X-Forwarded-Encrypted: i=1; AFNElJ856+f0ZYaYrvDSk8k7PXs6n9vnojP0jecNPVXp7iQJQLg7FybM4bcYrXPnOrJ0oVe4Wj3dpG2GgOit7E0=@vger.kernel.org X-Gm-Message-State: AOJu0YzFu/7AMPJUdoA/mWDfQ/lFznutEg0Fs+A7XwA8Two08/987E84 gqR0fpCI4MGVNAtAybYDAZuOdU12nNlIR92sZZ3VTTcAS+odqfmE9exw3jdoPbR8yiI= X-Gm-Gg: Acq92OEA76qQ6hnWi8PYAX0ey4FRHbgSYmR4fMTsdoDbo/XEEOghG3iAnTwb5TrIfUD edZbkWMl20ounYE2GG+Tf+su2VofZf3WPOabhxj9avH34NofI9oq1FKlxIDv27fzZX41EajKG3Y meOVwEPi3xh5dObjF1pncyGdCumlsQZ0jlfm6ZX6JVFyIEK9v3PVo2nhAxXSuK+Ph9dvx7nT/T0 0WoTNHeQ9eBfVbC8GffmGldHD4UHUzHxdH+xrvp5BAijEzfKaXdYYTd7E9DmFghxIthUN+XfKoj vchLvfMqcJmJt2L59aKKfXWVH0i2rIFjpvg/4aKExmyArmHNxbvyqfVVM4jTN5wKEiJ6H2HVLbu Rzdf25qB1Js30afRKlkht58Hta4yywqXi06cidHRrbC764R6cHLsS4Il7ipqBZCqSIraJDfiM3y bi58QfwrvEsMGLAImdSZT6Yin3rYifUxOUazjhM6RQPEmZ3WP+o/yMKOE2wp4ejDK0y4xxnQ/8h 17md7jw3YloP8RZtA== X-Received: by 2002:a5d:5d0b:0:b0:43d:c2bc:21b4 with SMTP id ffacd0b85a97d-4515b525d65mr37422228f8f.16.1778505472478; Mon, 11 May 2026 06:17:52 -0700 (PDT) Received: from localhost ([2a00:2381:fd67:101:5acc:6281:995e:547f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120f1f9sm25688565f8f.24.2026.05.11.06.17.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 06:17:52 -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: Mon, 11 May 2026 14:17:51 +0100 Message-Id: To: "Tudor Ambarus" 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" X-Mailer: aerc 0.20.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> In-Reply-To: <806da86b-45b7-43cc-b364-97bade8f4041@linaro.org> 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 >>=20 >> [..] >>=20 >>> +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. >>=20 >> 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 err= or > type, or 0 for success. >>=20 >>> + */ >>> + if (fw_err >=3D 0) >>> + return 0; >>> + >>> + if (fw_err =3D=3D -1) >>> + return -EACCES; >>> + >>> + return -EIO; >>> +} >>=20 >> 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 erro= rs, > zero for success, or BIT(0) and BIT(1) for TMU_INIT to flag some capabili= ties. > 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 t= he > 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 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. Thanks, Alexey