From patchwork Mon Jul 4 10:57:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 12905075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D5C4C43334 for ; Mon, 4 Jul 2022 10:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232842AbiGDK5T (ORCPT ); Mon, 4 Jul 2022 06:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231544AbiGDK5S (ORCPT ); Mon, 4 Jul 2022 06:57:18 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C103ADA1 for ; Mon, 4 Jul 2022 03:57:17 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id b19so10596092ljf.6 for ; Mon, 04 Jul 2022 03:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=24EtemxVLj76p6FHt7x5hSsqqbPeIvgrJ85Gzsoq1fA=; b=uVie8MqTNIkbJQCyaY0q57zRzXqdSBAYsd1YZuZbPUnK61WJqRFCK1DDPTtRwuSiWB 5SNh7jlE7prHaqVVUjVktQcAWL6/z4i+k49hoxJ4xKa2kVvptEz1AZqeDEHZx4Wkh66s RdlPVOfaca8C83kbYFKxv6+XXx3rNDsuPgkYJRKdAM2B92/ucyNvLmXBVYi9fLh1Bidr xfQXD7NaE5V1p9pg5W5K5K8QUaAI2HrcKfBLwN2cb8JkdnPQookX+ONDY+ltjwX4bh3Y VwzWsm48232UkyUR44i1p4xG1xWoGFA1AphtqXVpuEo7Z0xfEBB+2/sx6xcbTnVisYsT MXrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=24EtemxVLj76p6FHt7x5hSsqqbPeIvgrJ85Gzsoq1fA=; b=yqQnE29Ln23fwFi2qLBMmyC1jQQrwWqAgzGlNU8MoNimMqWACnjgh+q9yKKQwov4eS nZUI05IsDV0ldo1pg2+IisMV9WhBObLGYwK65b3/n08n+OQn3O3hkXPuTkqoaCt/qxO/ VXcnQbGXcqiXoOA1+noYEiTc0hAxF9LQ6dY1u4SRVE8Hh1RsN/VWWPc92byV9gGtHsZA v1U7sGd6E334ma4IsvL8lRnbZPuRiAgZojF4Q7XZgyBxYHRIwZDrzoooomRRnSw4oGeJ JQAvnffQ0Twh8QtfBAASHJdr9hDLxOHpBndzggFpS9LWL1oKJUxASmXuAnzvLbyrJsOW 0hCg== X-Gm-Message-State: AJIora98wQEw/2AF0xVtBqI5TmWsKl9QWNsrOjS3YQpp2Ch0hB4iY7+V vVWbg8rX8pbCgrWeVaqErVklsA== X-Google-Smtp-Source: AGRyM1t1Rau0tktu2rQDrthibdA4uIfJne0lVH/uqnef5bVNfZJ/ZBKamcSOMGwBXRAf1LeSMnHxig== X-Received: by 2002:a05:651c:4d1:b0:25b:b6ab:5b56 with SMTP id e17-20020a05651c04d100b0025bb6ab5b56mr17068928lji.84.1656932236019; Mon, 04 Jul 2022 03:57:16 -0700 (PDT) Received: from localhost.localdomain (88-112-131-206.elisa-laajakaista.fi. [88.112.131.206]) by smtp.gmail.com with ESMTPSA id o4-20020a2e9444000000b0025a6d6c269esm4948741ljh.41.2022.07.04.03.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 03:57:15 -0700 (PDT) From: Vladimir Zapolskiy To: Robert Foss , Todor Tomov Cc: Bjorn Andersson , Andy Gross , Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] media: camss: Do not attach an already attached power domain on MSM8916 platform Date: Mon, 4 Jul 2022 13:57:12 +0300 Message-Id: <20220704105712.469657-1-vladimir.zapolskiy@linaro.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The change to dynamically allocated power domains neglected a case of CAMSS on MSM8916 platform, where a single VFE power domain is neither attached, linked or managed in runtime in any way explicitly. This is a special case and it shall be kept as is, because the power domain management is done outside of the driver, and it's very different in comparison to all other platforms supported by CAMSS. Fixes: 929684b7ef4d ("media: camss: Allocate power domain resources dynamically") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index bf716b171c02..9e2899a0cdf4 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -1684,6 +1684,14 @@ static int camss_configure_pd(struct camss *camss) return camss->genpd_num; } + /* + * If a platform device has just one power domain, then it is attached + * at platform_probe() level, thus there shall be no need and even no + * option to attach it again, this is the case for CAMSS on MSM8916. + */ + if (camss->genpd_num == 1) + return 0; + camss->genpd = devm_kmalloc_array(dev, camss->genpd_num, sizeof(*camss->genpd), GFP_KERNEL); if (!camss->genpd) @@ -1923,6 +1931,9 @@ void camss_delete(struct camss *camss) pm_runtime_disable(camss->dev); + if (camss->genpd_num == 1) + return; + for (i = 0; i < camss->genpd_num; i++) { device_link_del(camss->genpd_link[i]); dev_pm_domain_detach(camss->genpd[i], true);