From patchwork Fri May 26 18:07:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yassine Oudjana X-Patchwork-Id: 9916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp665864vqr; Fri, 26 May 2023 11:12:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66i7y+UiUKAO6nIpI1EW05zbptNsi5sZjXO0zJP89+QxqsZRX+CXZ+G6F4Oy5tajm/7pLM X-Received: by 2002:a17:90a:9cb:b0:253:8abb:b613 with SMTP id 69-20020a17090a09cb00b002538abbb613mr3315829pjo.46.1685124750150; Fri, 26 May 2023 11:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685124750; cv=none; d=google.com; s=arc-20160816; b=uCIg1SAHybhY5WYF2wlHhQiChkROyaLijHsLSVKm3iVHOm6aMS1QK4iB8+vmGEJTMa Y39dWTjk0TpLCkOgfnK2lSLMwwWMjxTxcO83PW8/d15K/gQSGOlWXSWuAhffiB+/8GA0 sntAw2LXuEkzF+kZFdDcu8lPrVYCn+H++RboZCisdn4oz/taY6OIJ7F6eFMlgrETD/hF 2nFeqvR5ff+rkLPhCuy8ue+lh/ZHK1UwAEebY1NAQh/KZtiv77WlR3HInerpN4xqN3hy ikDnw8TqGv5VFDw1JiP4Etf4kHiZ7hdHwRCla7Hua79mRR0cewAVVjPRVGGkjoDkkMDl jAgw== 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=AU/kd7w2jq/58XCHklASS4nJYK7BktctWkyMZw7QDd0=; b=xaumHwMadMJjETp2XCyEMadtHYxwWUyf744IFZhcNwfYNUwSh5qHO52sJUcYmfXxFN CgRS1t9QJc2JGMRlQJqKQfKLIKQgsPM5DqhN43AUC0I2kym6iDWbdwktCqWk1gD9hdwz J9csZLFynZlHkmf9p71Y9/mkmHqrQ8+ErnA0CgRUk0Pu6z9KaQjZ5J29niu2CBVgD882 jMG6MfPw8+clqB4iM2gctV/tYx3wcYZyMUs5PiqMdLzvq9cf/wJStUUQIoFdLt13swzN wQ9BI3eBCKNgbdIhYW/2EAt1KkawSV2XGdFbwK8NTxu7urKLCGr3ZXgVqK3FuSwcsVCo JiDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=miHus96s; 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 13-20020a63050d000000b005346af99305si4127216pgf.526.2023.05.26.11.12.15; Fri, 26 May 2023 11:12:30 -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=miHus96s; 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 S237344AbjEZSHm (ORCPT + 99 others); Fri, 26 May 2023 14:07:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237043AbjEZSHk (ORCPT ); Fri, 26 May 2023 14:07:40 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20DEA125; Fri, 26 May 2023 11:07:39 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-96f6a9131fdso151985366b.1; Fri, 26 May 2023 11:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685124457; x=1687716457; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AU/kd7w2jq/58XCHklASS4nJYK7BktctWkyMZw7QDd0=; b=miHus96sHqsD9vqUR8YA/lXell5dRmtsfCW10qrulYZDfcXOhRuzJkS+bOt0T+UEtZ x2rJg5+7aZcmjWUqT9a6MLUrONBxdQtNfzZE9VI/GoJXxg8RJ8lxGBjGUtM34GKyVNAF LRDDUe0N4gVDAzlZPyeT149M4QJqIryY6XnG0+qYIRHBNmGWu78+k2nZFWbKtLWjLIVL bm23iPAOtf240H4bJvZIHl9k+HlYwig2qGMlg/2CX+9/l+8mw8EOD2OGkpKjAsGCkr0i zd9kR/z9YhTvseuET4HC1arwTp6o8ifETeAWgb7zrOPsDM45j5A9C1iiprNEOyq1vDZL ro7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685124457; x=1687716457; 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=AU/kd7w2jq/58XCHklASS4nJYK7BktctWkyMZw7QDd0=; b=LY/y2kr3TYz6pkdGrHIRXHs2PnUDZWQ6pRSBntcAYzy2jYWFSWMdswXI2Pz7nryzxu 3Un0Ry31h/I8u2JQrjKX/V7ya5L41K1hiaceV3FTvIjY7bcnbn32ENqgyRgA9Sv+kzov z0RFDcec9N4keRnyaaPHZZ3KU9I15eNf0z1fWZfKYJny/LQWNN8Z6ciGyf22rDUnVU0V kgkjSqPE57UFoQ2RlFo/1cxheuIUim+YuCOJAUnmZ/DvKJ73HB9rn8Na0X4yGvg44Qm4 zCsxRKptLtpH6STbhzWVTAZXaWQr06/Fq7lMakGOLb34b2BteRr1CuxKRBwqMJD7BQq5 3oGw== X-Gm-Message-State: AC+VfDwgrOQfRCJKmM36eLChGmFWvWgUWI6arvJVsitZg/EOyqWKZ1EI KmwCr/VZxVdTPKZX0xQvsP8= X-Received: by 2002:a17:907:c09:b0:971:eb29:a086 with SMTP id ga9-20020a1709070c0900b00971eb29a086mr3125022ejc.75.1685124457172; Fri, 26 May 2023 11:07:37 -0700 (PDT) Received: from localhost.localdomain ([95.183.227.33]) by smtp.gmail.com with ESMTPSA id j11-20020a170906410b00b0096f689848desm2410823ejk.195.2023.05.26.11.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 11:07:36 -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 v2 0/3] media: camss: Link CAMSS power domain on MSM8996 Date: Fri, 26 May 2023 21:07:09 +0300 Message-Id: <20230526180712.8481-1-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.40.1 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?1766981370099682024?= X-GMAIL-MSGID: =?utf-8?q?1766981370099682024?= From: Yassine Oudjana CAMSS on MSM8996 has been broken since commit 46cc03175498 ("media: camss: Split power domain management"). 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. Changes since v1: - Wrap commit messages at 75 lines. - Remove duplicate "media" from and shorten the subject of the first patch. - Expand the commit message of the second patch. - Fix "Fixes" tag in the third patch as well as other commit references. Yassine Oudjana (3): dt-bindings: media: camss: qcom,msm8996-camss: Add CAMSS power domain 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(-)