Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp323185lqj; Wed, 10 Apr 2024 11:25:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCKPOcMryOWSO/bcxmdFsgnmkLRIl1szjSSvUqYkUnFX8G2sZJpWjuYFcQ6vmyxN2GiBo/VBvZ5oslQv1wnIZ+TZeJ/GyM6+mKzqFTkA== X-Google-Smtp-Source: AGHT+IHdGrMPI04ETs0MN6fMpZv0UVeORrqyQA2/VJfT9thkXirSUEwfjxNXGEpnxGOW3jJ5T1Tb X-Received: by 2002:a05:6a21:3d85:b0:1a3:6a19:9f5f with SMTP id bj5-20020a056a213d8500b001a36a199f5fmr4029619pzc.26.1712773523675; Wed, 10 Apr 2024 11:25:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712773523; cv=pass; d=google.com; s=arc-20160816; b=jUYnwl3hJ8EY9tpo0le3tHPJySPZ3KnCQANjtHcTO7DNkjsNfF0MEDFaZmRr74VyZ8 4E0hoY6NeAIgZZ2+1aaWoValmQBNbjHRcK9bsZekVmLSdqyFJ9TmTb4QvquPVe5qyrA0 fKZJz1i6dd2Y+Es95AXJ5yv9tYgDE1rzZIjggetkRHV5+2i9QBm3I+2M9KLp+4zuMiu8 MLpxZAmzpIYacnDquKeCAKf7B08vgyDNd0kTV0f+jC56RNPQOLjTGMNXHZHGmbpskOfA wwxDjzMKjhXVxiAVygFUosuu2GEWC3Q3Q8HmQ+HsjFa8A01EfrzhV/lcG26/6GkGoOPn OL/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=x7cDQX1E7JHBxDHMRv3T+Nrz0RpKwP8cLHQVWQ/O5c8=; fh=qWTlUT0sNgnDd1JjjWNqMPJgnAwv1BmbQunFqiQKABo=; b=XHcvaBvvx9fUNcQ/6Ar7j3x6pceqY9qmGznECxq/NKRJn6/zaF8/LB9ykPZHoihuYZ b6GL4MDSKmTCKf+58UNK7m44m2eeuaU2e1Zp8lb104oGXw5M4wO5zllDqALClyaV8eKD xBQ2rbrssKFqkYNcFszTzE7sPC72b9IC3il2DsnNfxV3WP7tQBMsJjf0q1OgT/KZiSld JX11V5MpVZvff0Wi0+UuYXuGtx01a+lskqghF/Dc6VKXN/S2eLxwZ5365SAMmVpt0wRz Eu8sW9A/4jVaw6EZZaR7qZrVArFGeqRn19AC9F4OT+KKhYZWjy3xCDDJ28MJtpV4m/yB l8PQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DDSA4vJO; 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-139186-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139186-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 20-20020a170902ee5400b001e2a44ff6c5si10779507plo.289.2024.04.10.11.25.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 11:25:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139186-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=DDSA4vJO; 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-139186-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139186-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 69107288256 for ; Wed, 10 Apr 2024 18:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4678E1802B8; Wed, 10 Apr 2024 18:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DDSA4vJO" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 BC3A217F36E for ; Wed, 10 Apr 2024 18:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712773502; cv=none; b=Nl7CWCjs9FYq+FZHgrB4+71eY5HzNQogHlHOsm3DzVO/qlYaMvmIO5WJ4BJeVS36W47wSAc3gldETZN0IKB75KWmm0j4fSNUk3QSneaAb/4iCoV/ay+kwDB6xiqs9Rfp0qBWjxCcf16vfARDft6yQ+edWaXLI69qpB8zdijgDzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712773502; c=relaxed/simple; bh=+Ct4X0tI1ng1fVCdDgz1bpL8NF6sg+gCDiBH35XT1aQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tBwzN2TK6LamVxHtaPK1sjjdIAt0z5N8jR5oNMkVg86a7Nv3tLuiM11a1aBt8hlMfhqXw3vxEkZghkdmB1pHHP/eERAiASnxjy3igxJu8JvFyHrgwtcoyoAbW9FvQ7Fpi/BNIYGfICNyH7KxTpMTGJ/FSRVhtSU9rtn/0T/D01Y= 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=DDSA4vJO; arc=none smtp.client-ip=209.85.167.48 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-f48.google.com with SMTP id 2adb3069b0e04-516c403cc46so13529491e87.3 for ; Wed, 10 Apr 2024 11:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712773499; x=1713378299; 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=x7cDQX1E7JHBxDHMRv3T+Nrz0RpKwP8cLHQVWQ/O5c8=; b=DDSA4vJOCwc9rd9+azVwGTE8xAtbDT6x6lWX+dkj/URSmThMg8nEV3l7ULj/SCxR5S qFyuhiIZwjRxaO02doNWPM7yQcnbJZ0nSZ6kvjSxL1rdGa92lmJMB0dKJ61lhTDbq/1W vjB39DjbPfmotuyMvdn92zxfEXBR14g806Dbw6oQRT1JzsWcaDisAZugAl6ZCulP53ss F48QGd9eM23d5pVRKe+/H20P/O1oFcDSJhD6fcLNuHN9925w6ZXGpIj/EdrkYIpWehXE fCznn/aZoOy9M+X0tzz/Yn6nxMg9FUAzgctDXCMDIM5wXx7pTpVSo6xB7OhRWh+TCktb tsmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712773499; x=1713378299; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=x7cDQX1E7JHBxDHMRv3T+Nrz0RpKwP8cLHQVWQ/O5c8=; b=NdWa0oLNbsTczdlxvmhhYrP35Z9Z7bw8KoPJaosBJvfkNsn0f015utIMwWhYsGHetC HBkG0Hrat9QMdDQPVbSz0M2fSCV3pe25KMb/yQfqK+fv4upN7wDzwMPpRgx6dLQyZOLs fNpmkikxQ/rcX07G5wUt7HF4USVeERqwAsmLjRP4qPhnoycF5FU9welD2vbwhnDnShSz WBzoYR7Upf3O/rlkgUNyElsLmvz77CSYzpzVuWHXu8gdvdfzHvsYb1zNcyV57kg+jp5O O4UZ3q12KfmOOM59ko0wHEcQTonWjYr52DEwPZm3sNPBHabMSFPiNRqZmVQPaD9Jha3L 8trA== X-Forwarded-Encrypted: i=1; AJvYcCVIS7mFlgOywVEgPk9VP9qMK4eg+vhBgKjqqBLyja92u73bvEIvBMwWXwm/85ymtt8dk9yL8Re7eNLJAKNuI5qM1pr3tzQTphIC76u3 X-Gm-Message-State: AOJu0Yyx3x5x69PT5NcXS1lJeyfx0bFLCn+swiThH9AEy9F2I0yyP9Yw o02G/L3wRHdPMXz133OTL41lK4IAUbBIkZQ0enUt69M7Te3phstu+pmaNk1yfqXd17fvWCf5JvZ rLsc= X-Received: by 2002:a05:6512:3c81:b0:515:a9d5:aab6 with SMTP id h1-20020a0565123c8100b00515a9d5aab6mr3666969lfv.18.1712773498951; Wed, 10 Apr 2024 11:24:58 -0700 (PDT) Received: from [172.30.205.26] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id y5-20020ac24465000000b00516d4d27c9bsm1862973lfl.102.2024.04.10.11.24.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Apr 2024 11:24:58 -0700 (PDT) Message-ID: <3365d84a-1b1d-4b1d-8be5-6d8d1039e6b9@linaro.org> Date: Wed, 10 Apr 2024 20:24:55 +0200 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 v4 2/5] soc: qcom: llcc: Add regmap for Broadcast_AND region To: Unnathi Chalicheemala , Krzysztof Kozlowski , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Johan Hovold Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@quicinc.com References: <20240329-llcc-broadcast-and-v4-0-107c76fd8ceb@quicinc.com> <20240329-llcc-broadcast-and-v4-2-107c76fd8ceb@quicinc.com> <13ccc36a-c3cc-469a-ae0b-71fd0d24bf63@quicinc.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <13ccc36a-c3cc-469a-ae0b-71fd0d24bf63@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/2/24 21:34, Unnathi Chalicheemala wrote: > On 3/30/2024 4:46 AM, Krzysztof Kozlowski wrote: >> On 29/03/2024 22:53, Unnathi Chalicheemala wrote: >>> Define new regmap structure for Broadcast_AND region and initialize >>> this regmap when HW block version is greater than 4.1, otherwise >>> initialize as a NULL pointer for backwards compatibility. >>> >> >>> + struct regmap *regmap; >>> u32 act_ctrl_reg; >>> u32 act_clear_reg; >>> u32 status_reg; >>> @@ -849,7 +850,8 @@ static int llcc_update_act_ctrl(u32 sid, >>> return ret; >>> >>> if (drv_data->version >= LLCC_VERSION_4_1_0_0) { >>> - ret = regmap_read_poll_timeout(drv_data->bcast_regmap, status_reg, >>> + regmap = drv_data->bcast_and_regmap ?: drv_data->bcast_regmap; >>> + ret = regmap_read_poll_timeout(regmap, status_reg, >>> slice_status, (slice_status & ACT_COMPLETE), >>> 0, LLCC_STATUS_READ_DELAY); >>> if (ret) >>> @@ -1284,6 +1286,16 @@ static int qcom_llcc_probe(struct platform_device *pdev) >>> >>> drv_data->version = version; >>> >>> + /* Applicable only when drv_data->version >= 4.1 */ >>> + drv_data->bcast_and_regmap = qcom_llcc_init_mmio(pdev, i + 1, "llcc_broadcast_and_base"); >>> + if (IS_ERR(drv_data->bcast_and_regmap)) { >> >> I am pretty sure this breaks all users. Can you please explain how do >> you maintain ABI and that IS_ERR() is applied only for version >= 4.1? >> >> Best regards, >> Krzysztof >> > IS_ERR() check is done for all versions. > If new register isn't defined in DT(for version < 4.1) it simply sets bcast_and_regmap to NULL. > Otherwise, for version >= 4.1, it goes to err(in the case bcast_and_regmap isn't set properly). b4 shazam booting on 8250, I get: [ 2.794850] qcom-llcc 9200000.system-cache-controller: invalid resource (null) which comes from lib/devres.c : __devm_ioremap_resource() Now, this is gonna get you an angry Johan(+CC) response when he sees this land in the next release. Perhaps, this warning could either be removed from libdevres, or some sort of an _optional variant that doesn't print it could be introduced. Konrad