Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1225904lqb; Thu, 18 Apr 2024 04:06:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVq1mPL7URMr5Ct33TnA9xFLiUSGOVZh1R6bqYEXQShBdHd8eFP8YXGMd0zEEuLbc9o9BUYhBe+l77Aio3KZNo6oHaifeOnmBVUXu8nrw== X-Google-Smtp-Source: AGHT+IFwjn/brKvih6rh5YQjroDMtj8McZhK0OO8nJJi+Qfcwlca9iqlyFLk3MIxrGZU15UJstc/ X-Received: by 2002:a05:6a20:2449:b0:1a7:359d:964c with SMTP id t9-20020a056a20244900b001a7359d964cmr3158914pzc.32.1713438383879; Thu, 18 Apr 2024 04:06:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713438383; cv=pass; d=google.com; s=arc-20160816; b=F7zb9GzreOOC2k7lo5qMdFBH8mfTc+VmHgx3H/7BBBjfMJb6XvL5c2xLL/vTxHeHFF ft3v0jeX9GfE9yf0HYrmwMRtm2PRtGVMKt82PLEg0jIlD6ftl6dLrUHEVDyH1pU+qo40 xiuN3juKeDlpsf0CKhcdgC5Yu9FV6NGn9XYUTqxm7y64GQba39LTgNSnTLGlDRaAbLLh TG3gTM1ZDwtyb+G156zaud8z9CKBfSIVoecz5pQ93eBkNtYB5rc0GhlzuDW3J9EIxwzN DSd8mEMsXa7vvW0qmj6OmvwIF0N1oIA9t6vxTnEB56ElXo60hnSrOtRKVZ54XjaR/iSn 0CyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QoJVv2RWvbhhnx6gOF70bQ+Hht7rDXtw9zkh1pmPgSE=; fh=uw9M4lErCNOVxoZUF/iekIyO6oe9NW6Qlz7WzpFThrA=; b=iqtl5ouiWhDxLdKSzmVgVRPHhnBBMXQzLDSiT1wB6agfo/7Pfmj4/SJfd45GJI+4OX HPetWnMuUMMJAEV0fYnpZwr7gpTp7c/ZPdzh+IXV4S8HROLWNqmWD6CjtC2GlpGWIDud 8JZe4kknEnZeec1zXChrz33epR8k/S6abNAr0ymaM7BdtVSSMTIFSPqobr7yCN5weZQ1 /N6VjUl0U3myX/rKuJXXY3NITmBUctxaRvELOJnInEvPggmvsb4z05xiO+isAggoAYEJ ZEZ+qHnTpCubhmXJ/fdKwRztteOVMboYRmpRk9oZunbCf4AVVmoxEdtF84WJeV5HPwQz +6IA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N7TBnTVq; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-149948-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m6-20020a056a00080600b006e69b4cc485si1281869pfk.80.2024.04.18.04.06.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149948-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N7TBnTVq; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-149948-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6D5392842C3 for ; Thu, 18 Apr 2024 11:06:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CC0A15B558; Thu, 18 Apr 2024 11:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="N7TBnTVq" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 C0BD715D5A8 for ; Thu, 18 Apr 2024 11:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713438377; cv=none; b=HZU2+1mKcZTkNRGk5RxB7mfH5JCd4LY/cIe5xCxG4mLr+7ALx7ghKbKcbU6xjPc2YV44OzALgxUd720zEyRdyQmDVtDg/+0WX2vCpKtrJvtH0EK4HvuKg9ZSZT/Q+nllitIcbNJPtfUI4TepcffPuxzsn+djuO0A01tcTjL6+Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713438377; c=relaxed/simple; bh=CiYAK71r1dKd1XBeQXn4trgSBWiLXMXsFU4bIEyKT/g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sLa3KAnENrp7TthaLn5tUar16kUpZmoSlpg3JYhPYaoc5Ppl6+T9UL/MwuUC4DfPPSoW/Dpfq/njn8xbbftWWr68O5xC34MIWhDkeYcn/O6Ev1ZH0hUi2c7xinZHVzX+abXPlYod8LTvPHAOcV3WYBWWGMbzxALqTWI0xUurTIg= 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=N7TBnTVq; arc=none smtp.client-ip=209.85.167.45 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 Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-5171a529224so840433e87.0 for ; Thu, 18 Apr 2024 04:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713438374; x=1714043174; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=QoJVv2RWvbhhnx6gOF70bQ+Hht7rDXtw9zkh1pmPgSE=; b=N7TBnTVqOH3rQKnDlU9M7pV4dp00hfDdKBAN1Yr8WFw1bTf8Iw+HOSC6vR0X5FtmSa 2G4N7RLk/64iOi8qp3aoIOizphLAJOiTY+66zsmmR0V3UxhRetdoXHcWFpm/EyIxxloA yrDc55OijeCgRtcNL6HiP6XysviRRZQdDwjbdjGnAop8FOSp/uGKltFGtVLRSWe+k0Bp Sg9FhGlpm9O3V+etVMIWhgxF3fr++JuxTUJOHxGMcvytxIhalI7O+yksC1jXXTNekM6z luJxCtDQp26sLlv+c+pJ4xwisCOobNwia9O2Zl2uYDFIiqC5wu1gSJilcf0nEEmSXXbH spdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713438374; x=1714043174; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QoJVv2RWvbhhnx6gOF70bQ+Hht7rDXtw9zkh1pmPgSE=; b=jFidrCYCi+uhheBbR7Xqdz9hQIPxeEZcxYmMQnW5FBGIbLs6lZN3r2E0Ng7VS63UUW 2E3JVpbf1zHNxz9a4L1UvbJMwMfEeom/kKx8jXknaLTOHKfg6nBxOvHLmPWVFUT64pzb C54/i0b4ytizHjahFTcKoSBGMC7SqOOok3sJj9RAh2vt6W6RJP+n/mjf6onrKpxTQRCF r/qDk01I6vYEINTY9S8FcrGq9z72S2F43w5QJFtWWfcO7E9yDmM9LsXHk5mZ7JNgRCFw UGPGLICuXyP6BH0+2nl/eIHBpSo/jl5j6ThJQFoRHudL8n6C25Qso0uM9Z6zvzgDwehE hVSA== X-Forwarded-Encrypted: i=1; AJvYcCWLFJ1B11IOp1arm/SHQ8N5pkNpvJz8yPMQ/TAh7cFaniIED8VKb33sVHVVZAO4rsT7oJ9i/R7uj6+lrfPFKc/Kl2YezgmjQRT2zjwm X-Gm-Message-State: AOJu0YyOiF0JAKnH50TzZoeVyUCjVeqPoTIlIbZlxbFfudcOOCuR1MzE b+T10UkhU1iqRfrPbFC1Y3ThLyI2V7wJDM0TNWSlryPNZoaF5A/jbZ9b1cjqxyU= X-Received: by 2002:ac2:4e44:0:b0:519:591d:45da with SMTP id f4-20020ac24e44000000b00519591d45damr1140132lfr.18.1713438373824; Thu, 18 Apr 2024 04:06:13 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id r1-20020ac25a41000000b00516c1fa74e3sm194631lfn.207.2024.04.18.04.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:06:13 -0700 (PDT) Date: Thu, 18 Apr 2024 14:06:11 +0300 From: Dmitry Baryshkov To: Konrad Dybcio Cc: Bjorn Andersson , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong Subject: Re: [PATCH v2 2/7] soc: qcom: smem: Add a feature code getter Message-ID: References: <20240404-topic-smem_speedbin-v2-0-c84f820b7e5b@linaro.org> <20240404-topic-smem_speedbin-v2-2-c84f820b7e5b@linaro.org> <89eccb1f-c527-4820-a084-7fc4ad3f0ab4@linaro.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <89eccb1f-c527-4820-a084-7fc4ad3f0ab4@linaro.org> On Thu, Apr 18, 2024 at 11:53:31AM +0200, Konrad Dybcio wrote: > On 18.04.2024 1:39 AM, Dmitry Baryshkov wrote: > > On Wed, Apr 17, 2024 at 10:02:54PM +0200, Konrad Dybcio wrote: > >> Recent (SM8550+ ish) Qualcomm SoCs have a new mechanism for precisely > >> identifying the specific SKU and the precise speed bin (in the general > >> meaning of this word, anyway): a pair of values called Product Code > >> and Feature Code. > >> > >> Based on this information, we can deduce the available frequencies for > >> things such as Adreno. In the case of Adreno specifically, Pcode is > >> useless for non-prototype SoCs. > >> > >> Introduce a getter for the feature code and export it. > >> > >> Signed-off-by: Konrad Dybcio > >> --- > > [...] > > >> +/* Internal feature codes */ > >> +/* Valid values: 0 <= n <= 0xf */ > >> +#define SOCINFO_FC_Yn(n) (0xf1 + n) > >> +#define SOCINFO_FC_INT_MAX SOCINFO_FC_Yn(0x10) > > > > This is 0x101 rather than 0x100 or 0xff. Is that expected? > > Yes, this is "the first invalid one", similar to ENUMNAME_NUM > > > > >> + > >> +/* Product codes */ > >> +#define SOCINFO_PC_UNKNOWN 0 > >> +#define SOCINFO_PCn(n) (n + 1) > >> +#define SOCINFO_PC_RESERVE (BIT(31) - 1) > > > > This patch works on fcodes, why do we have PCode defines here? > > I decided they're useful to keep.. Didn't want to split them to a separate > patch for no reason. Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry