Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp151316lqa; Fri, 26 Apr 2024 18:36:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWTsH7fJpx3dRn/EdoJFz5WIEpnbsgxnUtBvj9flUk2PInO+jYoJKoVqc7N92esk2SnZdxpjk1P9SQFbo7MZ2+SLarwgW7i460v5pbXw== X-Google-Smtp-Source: AGHT+IGOSMKQRJh9xk4z21JuTpBDQhwb/aJU3PXbD99NfOgbOCso0avRuSf+I1lCtR2gjL0Etltf X-Received: by 2002:a05:651c:551:b0:2df:7dd6:f8e3 with SMTP id q17-20020a05651c055100b002df7dd6f8e3mr1868497ljp.3.1714181793250; Fri, 26 Apr 2024 18:36:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714181793; cv=pass; d=google.com; s=arc-20160816; b=j89PAMjQIBj9+O78YvjKWqp1i34lDGtmkbma0yb+qu9thVzBi083idH5sCfu7vAHBF fSfRPvvrRDdhbtbMMFf5CCx+nKZSzyMFgdolgRHYcaF+4lovjNbLz9OeNFQ1qxwbPc0y OMBvQrBxpo7YuIMYsSBipDUppKVUshaQ7L16T89Tll7jkJgffJ3oEdLVfFgHfXfRCbuz HY03En5uV0/8QXZWYhhNU9CNLc4nKyJr+CSFJNHJhwfH6RotPPg6lt+ao1kOZEQNReDs G4Gtj4vx6p/6UJunywH8uvkYVNNaLjPX1sW3082QkNpKwNOCzTbXXhevhKWY5nAUvf1O 48ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=DNCnVj1Y2/lmMmkRb2EKBZBX4wqTajwlwp5m2yeDx44=; fh=7EfYO8JNVBVJUQF2qo2dgTKQATNxg7M4RrAbecYiiiU=; b=gKzEVdpgwgxcm9mcN6ox8h9Q2KwA3VTocUQ2XLVJbV3NRegyJe3JK4nOVzWGgya8iB M/ykNxwVaPH8SL8zRC4nUye9Rvw/q4plkPjNvCrg2wqVu3Z32pm8F4RcINrBWHddcwgs fM1kJnt7MKQ+aFzbvW/izaRnt0E11WZu8/8ZWGRMGc//rb7Eii0RvjUhTdA7M2BEpzHn YtcWEQQIbyAvNOGYh7ef0hDX1bKnWToeNHxJTBjBeq+tbG3m6+YX/z+AV7SKi2zkaTtH NlPqhJ/tnDv6mQ3GshEPCUAksTIWfjGwzbdpl6k7zNq27Gttn8A9AuVhwdAHdbgqo5nd 9aWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p94PWi38; 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-160852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u2-20020a509502000000b00572207fd7e2si5346548eda.184.2024.04.26.18.36.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 18:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p94PWi38; 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-160852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160852-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E964A1F22BFF for ; Sat, 27 Apr 2024 01:36:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A5E1383A0; Sat, 27 Apr 2024 01:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p94PWi38" Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (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 378F1381AA for ; Sat, 27 Apr 2024 01:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714181786; cv=none; b=lhSdLyBbpN7Uq/T0Nxco67QKFGT41hOl4KNr14nGp6v1gZ3r1OK5OGSsDu5J/eg0pD03HiDnlx47Kx+i5LAc3VvK8+j+nVaEJ2IIUyZKLJ2MTYLa+V6s7NwwSaDlhwl11VzPHF5tAr0FtcTy4uKixD9mqboDi05OZ9YVd+gf1Kg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714181786; c=relaxed/simple; bh=RdoQEjsfDLaQLxmZJ7q6grWn9U77AJJaiBSCfDtS9V4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YG4x6xFTSpJOejOXMpcsSUoCRGy07Y2F8TM2lNvDnqzgsiX/ThOcUS+vPJau4ceE7WJhaeMSf1qmAb5RZ6hG6AggF1WclRGCU4KQSpeQZSJHvkSGcI8hFVOHqp61XxYetOnwF2tNqECywC5sMU1Ywz354pyxofLrDfb4JCzCzBg= 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=p94PWi38; arc=none smtp.client-ip=209.85.128.175 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-yw1-f175.google.com with SMTP id 00721157ae682-61b6200fcb5so29818907b3.2 for ; Fri, 26 Apr 2024 18:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714181784; x=1714786584; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DNCnVj1Y2/lmMmkRb2EKBZBX4wqTajwlwp5m2yeDx44=; b=p94PWi38iBSTEVWR/dHuUERmQQewEYrXNycrqB5V2bLkpu4tDtJfDHtZQxTQHKrqmc 18Y4oSMelvgYr4obxNFpurT4tmg5aOK5w+5SfM944Md3FbFFGIOgKgahabTtgZN6hU4i Uu53Qc8gXTX9bG9dl/7YPrAzuZYnfik+v7aFKetbXhXbUQ+wDVqf6MpUphQ/Vf3xXzxV zaJ2YDR0xvgY7MWyZVKguI6RR2lTZuXj7vKihi8XsyNBDaUQOZg2pFw8HekV/ZQDU+np yr8q7KL1Evt6CgsHcIESGx4vUXzflilZxR4AOY3HJzIsh9FWIzHVVZzLPiCpAXlIwC3o bUkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714181784; x=1714786584; h=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=DNCnVj1Y2/lmMmkRb2EKBZBX4wqTajwlwp5m2yeDx44=; b=l3vBOuNGItnXDUybHPR2Pao4Lj2OwMm3rLD0TrBOoiuoft+bY7uyFPE1G/214LAdla FbYBD3PHm827mZkvXnC3WpsDyg9b40lrSxxYQZuP/A3IhU0fGV0EdZnvx2gRM+A+b5au JOwSRW2Zm5gNpcVmRYLr4Adu1MYWos6CG5U04QpoA/2/r/4VRUmGme0sVjlOVDPIsqzV DBf+VVRbJi/CmqbHbLlizTGoeXEDZ3/rkKHhLxopbDqiLrMZ/4zfcJJqDDWBMMf7ixMh nr6SO5G/rbFIxeaduVjYkpW9AAZOa/d9RRTt1LAfD3me+TpEKI8HJeNXPEFvis+sGTLE xZnA== X-Forwarded-Encrypted: i=1; AJvYcCUVH0MfLUVqaEq8tgguxybp3bQeLmjJS+1XDY/WD4Vem9iscNxz/t8xofXozB+qmtHk/mWn1Z79aA2ztWgvUUjru0r7s9EB/DasH9oZ X-Gm-Message-State: AOJu0YxKl4oPZiegQQ7+aeVI1SHOg6mgVMXTVo87M6mbyV0IzVGaAFfk jPvA3D4rQTS3HaG2mAjQm6a5qaFwiC4mxCe1Ko+E7wenCWDcRAY+PtF6qRwdNbzvf2bXQN7RkRd UpePxdmDLTlt8cI850pUl2jUhgHYU4xqx7+ABzA== X-Received: by 2002:a05:690c:630d:b0:618:9353:1023 with SMTP id ho13-20020a05690c630d00b0061893531023mr5892671ywb.17.1714181784203; Fri, 26 Apr 2024 18:36:24 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240424-qcom-pd-mapper-v7-0-05f7fc646e0f@linaro.org> <20240424-qcom-pd-mapper-v7-6-05f7fc646e0f@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Sat, 27 Apr 2024 04:36:13 +0300 Message-ID: Subject: Re: [PATCH v7 6/6] remoteproc: qcom: enable in-kernel PD mapper To: Chris Lew 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" Content-Type: text/plain; charset="UTF-8" On Sat, 27 Apr 2024 at 04:03, Chris Lew wrote: > > > > On 4/24/2024 2:28 AM, Dmitry Baryshkov wrote: > > diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c > > index 1d24c9b656a8..02d0c626b03b 100644 > > --- a/drivers/remoteproc/qcom_q6v5_adsp.c > > +++ b/drivers/remoteproc/qcom_q6v5_adsp.c > > @@ -23,6 +23,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > > > @@ -375,10 +376,14 @@ static int adsp_start(struct rproc *rproc) > > int ret; > > unsigned int val; > > > > - ret = qcom_q6v5_prepare(&adsp->q6v5); > > + ret = qcom_pdm_get(); > > if (ret) > > return ret; > > Would it make sense to try and model this as a rproc subdev? This > section of the remoteproc code seems to be focused on making specific > calls to setup and enable hardware resources, where as pd mapper is > software. > > sysmon and ssr are also purely software and they are modeled as subdevs > in qcom_common. I'm not an expert on remoteproc organization but this > was just a thought. Well, the issue is that the pd-mapper is a global, not a per-remoteproc instance > > Thanks! > Chris > > > > > + ret = qcom_q6v5_prepare(&adsp->q6v5); > > + if (ret) > > + goto put_pdm; > > + > > ret = adsp_map_carveout(rproc); > > if (ret) { > > dev_err(adsp->dev, "ADSP smmu mapping failed\n"); > > @@ -446,6 +451,8 @@ static int adsp_start(struct rproc *rproc) > > adsp_unmap_carveout(rproc); > > disable_irqs: > > qcom_q6v5_unprepare(&adsp->q6v5); > > +put_pdm: > > + qcom_pdm_release(); > > > > return ret; > > } > -- With best wishes Dmitry