From patchwork Thu Jan 12 20:26:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matti_Lehtim=C3=A4ki?= X-Patchwork-Id: 42788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4100272wrt; Thu, 12 Jan 2023 12:55:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXvuYw5pDEpSAY75cVFOxDs+gglWNxCoj2mtrAivaZUs9T7NCP03RxZcgoGCCsVB/Yy30GmN X-Received: by 2002:a17:906:3451:b0:857:b916:94bd with SMTP id d17-20020a170906345100b00857b91694bdmr8443119ejb.60.1673556923759; Thu, 12 Jan 2023 12:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673556923; cv=none; d=google.com; s=arc-20160816; b=rOnjEQV29G4mtIcfujlOs2QRR/23SVObTBA8NvI1eell69tFAM124t09rV3cHVCqBv liOIQRAR0ooahU1j9Xqi3VUP2UGunOZi5PwckHkLT1+CSeBjL/XIZ6dSSNaM7afy+r2K 0at6JsaXrrVc1NpV3QRu42w+fCdL8bB1BKUW7Rmq8Z8yQEeii9DP5gDH3TZa3/tOcT84 snAlYjhwo1wBvVkVp3PkKbCZHzYKj3Tg52ed02QazJpZ8WA+VEo0TvbLsRsD21iSHjji 8JpiiekYiQd+ScONou1SSp2HXxHYkq6Cl+VmMCNnetV24cbNKJPCTeFIt05pF7G1HSMl qQtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZdJ1as/2HorMVf7SThF1+kvjBcYBpePpyfZVaXdM4A0=; b=LicrwSH0utBWv2yVUFFnxgH2sDfUJAu5NjornfVuvD1u4rSNF5PxIctC7Y+G5Cgr2r 9KgUVL6jgpeicdXMftekcT0FCv5XDTIfSh/1I70WqJg1I0P6J+SD+HpT34opB3xGoFhH yKIGyHvuPouGdDJNChCsBtoPeFJ/pokbO/aI83FNaLexYlVV5Ch7aE5OwmoAh0ROTZMv OJWDzLGPi1O7zvlT0Enf2YUE6345EArdw21LZEh8uhoEyq9dWBlfchy0ZJZ4cr2BQqiB C5ZgE8YD1Xbz8a472tiJJSlTMLrc7afsHjWh/Srar37Uqn5zDwxU0qxWNo2Efu2IluqP jLcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XDTIIvu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du1-20020a17090772c100b007c0f5d71c15si18439439ejc.689.2023.01.12.12.54.47; Thu, 12 Jan 2023 12:55:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XDTIIvu2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240416AbjALUx0 (ORCPT + 99 others); Thu, 12 Jan 2023 15:53:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232801AbjALUwz (ORCPT ); Thu, 12 Jan 2023 15:52:55 -0500 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32CB910041; Thu, 12 Jan 2023 12:26:35 -0800 (PST) Received: by mail-lj1-x22c.google.com with SMTP id y18so17022795ljk.11; Thu, 12 Jan 2023 12:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZdJ1as/2HorMVf7SThF1+kvjBcYBpePpyfZVaXdM4A0=; b=XDTIIvu2AnKqlyYZPRSEI2bdQXkR7OBDU6M4TySFVrDa74XXR4jor4RavZgRSHERR9 G/OCJTry/k8Ls46lPcqsH6T+RVXkTWQWbf7tWPwhcwN45A4qzrmX9rtL3ENi3jEJuY7q 1MfM/GPYR0LJm1Ce2mBITwapSXu8j4THFB2q0IDab96U0Y/Tm5Z1TSwvMOrimvesmc9T Kaf8nfUkw1BO7mAXcEu5stvTpzLz0lC2BjjEQAnhenew+uK7aVtwWxU8PnpacsNvl53H hm+H9jrWhvCBqG9E2IrS63tlNDD1sTJ/8RGiUMtqLvX8f4qUGJ5DY3xiOeoPBV8WgLUH AUrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZdJ1as/2HorMVf7SThF1+kvjBcYBpePpyfZVaXdM4A0=; b=3w742yK2fIIkqgG2kU34EGUXiPYBuWvZtWOgXaRX2Za987dGCdaHHvfjniAF/v3ozW zP9zoCa7h8bf8e/0EA91gbb7UPYhNpzjmxDF5Yc2XZF0VaJekYpyMttwWLkW09jUTqwL 3uYSBwSz9GTV3WYpWOd+kaNxowla/OJ/32xSD+ASNMsBhY/vIZB9nXbLPQCpc9LzYohv 02P/sq4VKNBFBHhigAHrNjFtVP16oWR0gyH2irndFiKwxFAXn6gSKliA67WxSBXoA2Bb 4diCgJqpMdLw0r4XSsZJlQwEn5xYmWbCPcr3caqqsobbeF9RpbelVX+hr/1pZ7FpqBtR rTNw== X-Gm-Message-State: AFqh2kq6B/NQH5zjS2DSvqMwv+f9FPe3MVy6+1mtl2rXMS+wDlZhQPd5 oJxXXxNRUTUp04QCq05vmGWHsDD4GxmQMA== X-Received: by 2002:a2e:a221:0:b0:282:3796:60cc with SMTP id i1-20020a2ea221000000b00282379660ccmr6059307ljm.53.1673555194791; Thu, 12 Jan 2023 12:26:34 -0800 (PST) Received: from i-vetokaappi.home.lan (dsl-hkibng42-56733b-36.dhcp.inet.fi. [86.115.59.36]) by smtp.gmail.com with ESMTPSA id k6-20020a2eb746000000b00281350bb5fbsm2346731ljo.2.2023.01.12.12.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 12:26:34 -0800 (PST) From: =?utf-8?q?Matti_Lehtim=C3=A4ki?= To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , =?utf-8?q?Matti_Lehtim=C3=A4ki?= , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mathieu Poirier , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/8] remoteproc: qcom_q6v5_mss: Handle platforms with only single power domain Date: Thu, 12 Jan 2023 22:26:05 +0200 Message-Id: <20230112202612.791455-3-matti.lehtimaki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112202612.791455-1-matti.lehtimaki@gmail.com> References: <20230112202612.791455-1-matti.lehtimaki@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754851624684616474?= X-GMAIL-MSGID: =?utf-8?q?1754851624684616474?= From: Luca Weiss For example MSM8226 has only one power domain (cx) which is attached internally in power domain and cannot be attached in this driver. Signed-off-by: Luca Weiss Signed-off-by: Matti Lehtimäki --- drivers/remoteproc/qcom_q6v5_mss.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 2f4027664a0e..745627a36bcf 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -1820,6 +1820,13 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs, if (!pd_names) return 0; + /* Handle single power domain */ + if (dev->pm_domain) { + devs[0] = dev; + pm_runtime_enable(dev); + return 1; + } + while (pd_names[num_pds]) num_pds++; @@ -1843,8 +1850,15 @@ static int q6v5_pds_attach(struct device *dev, struct device **devs, static void q6v5_pds_detach(struct q6v5 *qproc, struct device **pds, size_t pd_count) { + struct device *dev = qproc->dev; int i; + /* Handle single power domain */ + if (dev->pm_domain && pd_count) { + pm_runtime_disable(dev); + return; + } + for (i = 0; i < pd_count; i++) dev_pm_domain_detach(pds[i], false); }