Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1798720lqo; Sun, 12 May 2024 20:23:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKM1R+uFLPSzwUKkwB9qgURGJX1egEfKUeXRG2/sEI+9Qex/k33GEzNT7UVlPftORl/1Au+Fpacue3efakWlsfhKnw2lGhqwUL9nMMHQ== X-Google-Smtp-Source: AGHT+IElxr5KoKiSbYHHlSDEy+zcOcV4Qylmic3ka7VTY+9uC0WkS6DTQq5Ve81UmeifCQOP3EWh X-Received: by 2002:a17:902:c947:b0:1eb:60ec:30e0 with SMTP id d9443c01a7336-1ef43f4d044mr99074505ad.46.1715570631617; Sun, 12 May 2024 20:23:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715570631; cv=pass; d=google.com; s=arc-20160816; b=UPXqiMaP/P/OK/5PSAUpZT4f+leIEcHPYawzvkdIhJjlVBls3z1lHEh054ywR+5GOe H9TtRYeyQj4xeIuvvsA9WQj4pEW1pEZuOqhgKxJnJ/bA17LoPeSBSBzo5HxaBvlNAtCm IQ9nwu4QceBxB7FqgUVCcmfgRTEC12vPJP0HvVfloDMz61YnWbExraI2r7Aq1CzHSSQD Zp+q5SSgNEKGVYongtAoazA9exqsit60lzRDlZ6xBXyTeU7FGvIo2OGG/E6F6g0RNIWa 21LceqKB9cbln5BaaOCotWV72I4vB+vh5KQa3Y+SKWP2gSysGC29eilH1yGJW4oSBb4T fqOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=e3m7C5s1EzbrOCKMut3xyPmXWEUzIM5EzWY1SS9dSVQ=; fh=U9h867IBHuBYZ+5OmyCQ3hx70hlOIVkDemj+QjkSkRo=; b=xTwOcUsfS8ECxrH8nXvKeqZTKiM3OdGJfYu/Qiu5/Vt4JA1+2oEOz08zT9txHWOElM PynQoXPDisRaN2UrXDqa8k16Cu7/YAhT5HjyByHhEpHtV03txNxZ9G7j/6o4Z9wc8w88 BaNzRiVGBXO/xo8H3j4c+EuWNeyb8Vo0Me5qNF+62Q3GUjG2ApwaAt5BJRtbQior152e Nje6HJ496ngAKQtiyTf0h9oxNrAN1F2KWkzlvcBayB5iTLIRgbRbYHwS3UuhPmbxzD9A X+URh47Ta+ajo+PRehJW3x9Wa/Zy7XgO8mR5e677oPade45QN4HGATsZBoWq2N7a1Nsf 2zVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kali.org header.s=google header.b=P7IiSgus; arc=pass (i=1 spf=pass spfdomain=kali.org dkim=pass dkdomain=kali.org dmarc=pass fromdomain=kali.org); spf=pass (google.com: domain of linux-kernel+bounces-177126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kali.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bf317a6si88628295ad.258.2024.05.12.20.23.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 20:23:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kali.org header.s=google header.b=P7IiSgus; arc=pass (i=1 spf=pass spfdomain=kali.org dkim=pass dkdomain=kali.org dmarc=pass fromdomain=kali.org); spf=pass (google.com: domain of linux-kernel+bounces-177126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kali.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 3A91828135C for ; Mon, 13 May 2024 03:23:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13D98145B2F; Mon, 13 May 2024 03:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kali.org header.i=@kali.org header.b="P7IiSgus" Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.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 0A7191C6AF for ; Mon, 13 May 2024 03:23:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715570625; cv=none; b=kg+7E5kSn7DoJFYWvGyFevLwCqOCpaPLn5t4njpIq6IoOoMkzdybIa1MSY6UqLY5ckOTkfIwKvjFTimM6soUMQogygxj4QI6UxVYPb5UcoFbsVnQKYOJ1umft2DLyNBZUyOL0jQE9fP1ReGHHzHKVeOFOhSD68tL00GXFm5ry3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715570625; c=relaxed/simple; bh=XoegDtlcSO/zIWKuRP063e2zFQ+RAdHrnLhPXIuNUEc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WqLkPMolL+8Y27IbVMFYqUljClOELgXOlSJ7CmMNXKHQuEqVDD3p7FRz8j+/Z5FBZUcX6Pop5n4Xz0k4GjJS8RX/QWVC3UAd1KztSsyE9M36MXLFWVO1tuP2Ue9qvLZ9qRVz9EtQkTwrKva74eAP672LT5V1HddllGtqkXq4oyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kali.org; spf=pass smtp.mailfrom=kali.org; dkim=pass (2048-bit key) header.d=kali.org header.i=@kali.org header.b=P7IiSgus; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kali.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kali.org Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-51f72a29f13so4855208e87.3 for ; Sun, 12 May 2024 20:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kali.org; s=google; t=1715570620; x=1716175420; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=e3m7C5s1EzbrOCKMut3xyPmXWEUzIM5EzWY1SS9dSVQ=; b=P7IiSgusaN8tA/JtV2ZeR7LTt62mSdbHpi7C14dNPD54cI5D1X5HFaYTot85dhoctB /nKJPziKXkJlsDqDp5N8S8c1PVYypEb9IhzhV88+CLOKmP+92UAzTi/hf4jL3H5Ix7fu 7o2cMlD29pERtxRN9L3HPvLSW4D1GBjwWd8PQ3ZaSOrSwUg9mhlNg+dzB/omgv/UmFTw ZcqTsGvCgfx958jHOEWSbBKur7/jWW++jNe3umLoC4rjLAH5yqLesr4Q7kVkcxQ7804a uJmmesqZSsH3GMJ3NnEi+8aTBFpvcTD7578zbhsZTYPqDunFezuCME1zzvZKATDgEreJ vj2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715570620; x=1716175420; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e3m7C5s1EzbrOCKMut3xyPmXWEUzIM5EzWY1SS9dSVQ=; b=H+uLACoIurrY6lo5GUvqgVFyRb23Uy8NPgL09E0jAQTZp+I5PF5mGZqc6QTEiOIM04 3YVwAiZy3SR+LcCDD1i74/ZnH3aRjbLYD5sIqxWAf5XZlFdDfiKOEhi/kWQ3j7g45Mns VHOsw/BBYzTYaQtla6GsiiYMxLiWNabD7fjLEl0HWQg05GYtG34hG7UsiPmzDGHts6rT oSlEHnSmT6scwNvGDUEHyzI8hPM33i3LMkjUKd/v5//OGh9vbr4M+H7A3FkgG+4hnSjs bzAUlBTGzZfqw/pUZtg5+HhVC45VPMlOeF+dn8rUdhD0sinnczkLC8M8U1tQ6NuOmnW3 YEFg== X-Forwarded-Encrypted: i=1; AJvYcCVzub41KEVhbKu+fX+SZY0rXA3JDt2gx97/iqrwyHv/uKw9r/Pjy7lMyyWA8umlTpEi+9u0uK93iQVbwZaoayIdLlBOiERD3V+tzKYT X-Gm-Message-State: AOJu0Yye+oJnVK/aaDtBZcJoN0MTYNT/3/W8isyHsRnYXF77xL1YdAr+ gavv8Pcmgi2Himx3Ynh3iERl/LQzHcwcIZn8wIiYBhhwSbcy+IKHi4rC9K2+RP73EzsRFI5u2F4 a2hMEWPE/Bi+yXDq+QFbunRx7klmZT9xi0kXNmA== X-Received: by 2002:a19:6410:0:b0:51a:d5d3:ee52 with SMTP id 2adb3069b0e04-5221006e6f8mr5380369e87.17.1715570619914; Sun, 12 May 2024 20:23:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240512-qcom-pd-mapper-v8-0-5ecbb276fcc0@linaro.org> In-Reply-To: <20240512-qcom-pd-mapper-v8-0-5ecbb276fcc0@linaro.org> From: Steev Klimaszewski Date: Sun, 12 May 2024 22:23:28 -0500 Message-ID: Subject: Re: [PATCH v8 0/5] soc: qcom: add in-kernel pd-mapper implementation To: Dmitry Baryshkov Cc: Bjorn Andersson , Konrad Dybcio , Sibi Sankar , Mathieu Poirier , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, Johan Hovold , Xilin Wu , "Bryan O'Donoghue" , Alexey Minnekhanov , Neil Armstrong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 11, 2024 at 4:56=E2=80=AFPM Dmitry Baryshkov wrote: > > Protection domain mapper is a QMI service providing mapping between > 'protection domains' and services supported / allowed in these domains. > For example such mapping is required for loading of the WiFi firmware or > for properly starting up the UCSI / altmode / battery manager support. > > The existing userspace implementation has several issue. It doesn't play > well with CONFIG_EXTRA_FIRMWARE, it doesn't reread the JSON files if the > firmware location is changed (or if the firmware was not available at > the time pd-mapper was started but the corresponding directory is > mounted later), etc. > > However this configuration is largely static and common between > different platforms. Provide in-kernel service implementing static > per-platform data. > > To: Bjorn Andersson > To: Konrad Dybcio > To: Sibi Sankar > To: Mathieu Poirier > Cc: linux-arm-msm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-remoteproc@vger.kernel.org > Cc: Johan Hovold > Cc: Xilin Wu > Cc: "Bryan O'Donoghue" > Cc: Steev Klimaszewski > Cc: Alexey Minnekhanov > > -- > > Changes in v8: > - Reworked pd-mapper to register as an rproc_subdev / auxdev > - Dropped Tested-by from Steev and Alexey from the last patch since the > implementation was changed significantly. > - Add sensors, cdsp and mpss_root domains to 660 config (Alexey > Minnekhanov) > - Added platform entry for sm4250 (used for qrb4210 / RB2) > - Added locking to the pdr_get_domain_list() (Chris Lew) > - Remove the call to qmi_del_server() and corresponding API (Chris Lew) > - In qmi_handle_init() changed 1024 to a defined constant (Chris Lew) > - Link to v7: https://lore.kernel.org/r/20240424-qcom-pd-mapper-v7-0-05f7= fc646e0f@linaro.org > > Changes in v7: > - Fixed modular build (Steev) > - Link to v6: https://lore.kernel.org/r/20240422-qcom-pd-mapper-v6-0-f969= 57d01207@linaro.org > > Changes in v6: > - Reworked mutex to fix lockdep issue on deregistration > - Fixed dependencies between PD-mapper and remoteproc to fix modular > builds (Krzysztof) > - Added EXPORT_SYMBOL_GPL to fix modular builds (Krzysztof) > - Fixed kerneldocs (Krzysztof) > - Removed extra pr_debug messages (Krzysztof) > - Fixed wcss build (Krzysztof) > - Added platforms which do not require protection domain mapping to > silence the notice on those platforms > - Link to v5: https://lore.kernel.org/r/20240419-qcom-pd-mapper-v5-0-e35b= 6f847e99@linaro.org > > Changes in v5: > - pdr: drop lock in pdr_register_listener, list_lock is already held (Chr= is Lew) > - pd_mapper: reworked to provide static configuration per platform > (Bjorn) > - Link to v4: https://lore.kernel.org/r/20240311-qcom-pd-mapper-v4-0-2467= 9cca5c24@linaro.org > > Changes in v4: > - Fixed missing chunk, reenabled kfree in qmi_del_server (Konrad) > - Added configuration for sm6350 (Thanks to Luca) > - Removed RFC tag (Konrad) > - Link to v3: https://lore.kernel.org/r/20240304-qcom-pd-mapper-v3-0-6858= fa1ac1c8@linaro.org > > Changes in RFC v3: > - Send start / stop notifications when PD-mapper domain list is changed > - Reworked the way PD-mapper treats protection domains, register all of > them in a single batch > - Added SC7180 domains configuration based on TCL Book 14 GO > - Link to v2: https://lore.kernel.org/r/20240301-qcom-pd-mapper-v2-0-5d12= a081d9d1@linaro.org > > Changes in RFC v2: > - Swapped num_domains / domains (Konrad) > - Fixed an issue with battery not working on sc8280xp > - Added missing configuration for QCS404 > > --- > Dmitry Baryshkov (5): > soc: qcom: pdr: protect locator_addr with the main mutex > soc: qcom: pdr: fix parsing of domains lists > soc: qcom: pdr: extract PDR message marshalling data > soc: qcom: add pd-mapper implementation > remoteproc: qcom: enable in-kernel PD mapper > > drivers/remoteproc/qcom_common.c | 87 +++++ > drivers/remoteproc/qcom_common.h | 10 + > drivers/remoteproc/qcom_q6v5_adsp.c | 3 + > drivers/remoteproc/qcom_q6v5_mss.c | 3 + > drivers/remoteproc/qcom_q6v5_pas.c | 3 + > drivers/remoteproc/qcom_q6v5_wcss.c | 3 + > drivers/soc/qcom/Kconfig | 15 + > drivers/soc/qcom/Makefile | 2 + > drivers/soc/qcom/pdr_interface.c | 17 +- > drivers/soc/qcom/pdr_internal.h | 318 ++--------------- > drivers/soc/qcom/qcom_pd_mapper.c | 676 ++++++++++++++++++++++++++++++= ++++++ > drivers/soc/qcom/qcom_pdr_msg.c | 353 +++++++++++++++++++ > 12 files changed, 1190 insertions(+), 300 deletions(-) > --- > base-commit: e5119bbdaca76cd3c15c3c975d51d840bbfb2488 > change-id: 20240301-qcom-pd-mapper-e12d622d4ad0 > > Best regards, > -- > Dmitry Baryshkov > I've tested this over the weekend on my Thinkpad X13s with a number of reboots and seems to do the correct thing in v8 as well. Tested-by: Steev Klimaszewski