From patchwork Wed May 3 07:25:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 8862 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1142228vqo; Wed, 3 May 2023 00:39:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5a+dp8CfKTvTUvbmmAQXGvr6DL2zmPHccpJ+6MenfBLMzIF2IB3/nqnLi3ByMGQZvUwKgN X-Received: by 2002:a05:6a20:e48b:b0:fa:7ca5:23e3 with SMTP id ni11-20020a056a20e48b00b000fa7ca523e3mr10650284pzb.2.1683099566714; Wed, 03 May 2023 00:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099566; cv=none; d=google.com; s=arc-20160816; b=e53JFryn1b4FoPudPReTInI1+LJBo9OMSPy4g/1UPy8bSbPv8oN1uh64OpK2ZyYGGK mmm2gEkoJFYycmt51krNfanS0FGx43Pukh5Owju5HBo+GjYLiBBRFAIJCJSIlUjgOxIR hhLc3JZCFCZT3PAeXKaoKxZmi2S9jikp8uLVPjVzduQVT+UKmHMGmKZ+HHpZPhbrcBhu ZxboDoKEt4deqlGRysDr9/C2i0bromTmlQI448BN4X/gWwyVPLu5RbvjbpodU6r77eY9 ExeXEzsKHVWeNyzr1veKvL8O8ZwxIB79Q1nojbT0wPyo7yoNYK09RpMavSahtdqDyIqu U/WQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=kwi9ORlZc7hKI5IKGQjv7FwDWDdxvIkp9fio8PSzkaI=; b=Ri1OamaPeNyd0Zs7pq3lmz+nt8ofMHfiK8/Bk+hNB0mOFSc3SH0uKOcru1Jg0VLCNp YKLSFKeBe5bez32OnZfr66PQpdc68ivUx4nL6guLtFBX+GFFeKtUJjf9OlpVzCgCxXPT bjBf0GpK91Nv27AVjpAXMH/+y1DYrfc01xQzhfC7v4yj1WjcJuysxLKaIcm/XJZLYz4n cKRdgALO7E8VzW8iYg+nJHoTArLSVbM6M0hTXPL6khFcBeGRObISYCOn/KA9tdTAk44V p+KgWTGQztqYoXF0BdrX1itTy6/juh3fcWiwchT/8gc8jdglYFoVvNn8Thw8IxTT7nhY uKYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MDztZQnl; 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 23-20020a631957000000b005031abe8d8bsi31456032pgz.745.2023.05.03.00.39.12; Wed, 03 May 2023 00:39:26 -0700 (PDT) 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=20221208 header.b=MDztZQnl; 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 S229774AbjECH2Y (ORCPT + 99 others); Wed, 3 May 2023 03:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbjECH1r (ORCPT ); Wed, 3 May 2023 03:27:47 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 024D249F9; Wed, 3 May 2023 00:27:18 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-959a3e2dd27so926788066b.3; Wed, 03 May 2023 00:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683098836; x=1685690836; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kwi9ORlZc7hKI5IKGQjv7FwDWDdxvIkp9fio8PSzkaI=; b=MDztZQnlaHhSODJX4osvghLx5ApZw4yayLTFza8uZUYiRFNvX7qw9timaQ3BH+OsAf 330kd2SVJZscnXbTTKX8hsZh6bO1rVSifGDFSsoaa64G4m7TxDYJiSrppODqTlcmYZGT 14mjI3uB9d787JBSLcOHsf8YiI7G2FpRWky+BU+DYO+MrfpgSstcRpHAcV5MixIrkK6Y 3CttbqMBotM6oN7KBtR+bhC67JruKko7FDxXHmteLP+pANOvP8S/cuiRH7Qb1GfgvHS/ JqhUCG8hfGQGAIOyBD8cTFU/ElEyf04XPhGEC2PXA9Tj2k5YK1QjY/kYkavfAQy3Stbl Mh9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683098836; x=1685690836; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kwi9ORlZc7hKI5IKGQjv7FwDWDdxvIkp9fio8PSzkaI=; b=MbPDzxu0XWLO9B0MqFRQZ4AxmhB8yPUbJzD0zZ8/caRsKKx8c66T9MF7WowBTkcUjZ 66wpEnFtDC6frEyuHhQUVfpopeT1DxxU9gMdxKsP/lDHDs0l0havJ2SUgE/cFerru5n5 bbMCMgX+lRxgHt/lFEapM9meO6ATRPqcWBQSoD06IuTWrzHcoETIkcxu0UH5dMgMyKh7 2OUhRGecHuEDR43w+w0tHVTiyfI9065sJrRgb2r4/rHap8FfszFEAd67slQMMvcLGq3L UdQjH/cMmRWToCz1GbMahS/eOba0wFx+1JbzPBtGilInOE2pUQCQPP/FI5Idq9e6Bo9s j+EQ== X-Gm-Message-State: AC+VfDxnEfxREddpiB67tM4wLQXvEb1AlYbjJvSTnQg4eyFzHhAxOcoD Q8w+WRbi3/uJRQaQzM4aBxY= X-Received: by 2002:a17:907:a088:b0:957:758e:df57 with SMTP id hu8-20020a170907a08800b00957758edf57mr2595941ejc.65.1683098836130; Wed, 03 May 2023 00:27:16 -0700 (PDT) Received: from localhost.localdomain ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id t26-20020a1709064f1a00b0094f34fe27c6sm17072009eju.170.2023.05.03.00.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:27:15 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Robert Foss , Todor Tomov , "Bryan O'Donoghue" , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Hans Verkuil Cc: Yassine Oudjana , Yassine Oudjana , Vladimir Zapolskiy , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] media: camss: Link CAMSS power domain on MSM8996 Date: Wed, 3 May 2023 10:25:40 +0300 Message-Id: <20230503072543.4837-1-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.40.0 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,T_SCC_BODY_TEXT_LINE 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?1764857811267171877?= X-GMAIL-MSGID: =?utf-8?q?1764857811267171877?= From: Yassine Oudjana CAMSS on MSM8996 has been broken since commit 46cc03175498 (media: camss: Split power domain management, 2022-07-04). This would happen when trying to start streaming: [ 199.097810] ------------[ cut here ]------------ [ 199.097893] camss_top_ahb_clk status stuck at 'off' [ 199.097913] WARNING: CPU: 3 PID: 728 at drivers/clk/qcom/clk-branch.c:91 clk_branch_wait+0x140/0x160 ... [ 199.100064] clk_branch_wait+0x140/0x160 [ 199.100112] clk_branch2_enable+0x30/0x40 [ 199.100159] clk_core_enable+0x6c/0xb0 [ 199.100211] clk_enable+0x2c/0x50 [ 199.100257] camss_enable_clocks+0x94/0xe0 [qcom_camss] [ 199.100342] csiphy_set_power+0x154/0x2a0 [qcom_camss] ... [ 199.101594] ---[ end trace 0000000000000000 ]--- [ 199.101736] qcom-camss a34000.camss: clock enable failed: -16 [ 199.101813] qcom-camss a34000.camss: Failed to power up pipeline: -16 Turns out camss_top_ahb_clk needs the CAMSS power domain to be on. Before the change, VFE power domains were enabled before CSIPHY enabled clocks, and since the CAMSS power domain was their parent, it got enabled as well. With the VFE power domains now enabled after CSIPHY is powered on, the CAMSS power domain remains off and things go south when CSIPHY tries to enable camss_top_ahb_clk. Link the CAMSS power domain in camss_configure_pd to make sure it gets enabled before CSIPHY tries to enable clocks. Yassine Oudjana (3): media: dt-bindings: media: camss: qcom,msm8996-camss: Add CAMSS power domain and power-domain-names arm64: dts: qcom: msm8996: Add CAMSS power domain and power-domain-names to CAMSS media: camss: Link CAMSS power domain .../bindings/media/qcom,msm8996-camss.yaml | 13 ++++++++++++- arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 +++- drivers/media/platform/qcom/camss/camss.c | 9 ++++++++- 3 files changed, 23 insertions(+), 3 deletions(-)