From patchwork Tue Sep 3 08:39:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979906 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfG15crZz1yZ9 for ; Tue, 3 Sep 2024 18:40:25 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5F-0001KN-Po; Tue, 03 Sep 2024 08:40:17 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5D-0001JP-EW for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:15 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 319C33F215 for ; Tue, 3 Sep 2024 08:40:15 +0000 (UTC) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a870f345c33so414393566b.2 for ; Tue, 03 Sep 2024 01:40:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352815; x=1725957615; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=svHSlBSi7RNp7nGEfHBBzeXk1LtlsPk8nsDYiXsbHuc=; b=DaXeFegzkU4JABLYPeRl+efohqxcIg73RWcsBjZ6y5p4acrra4ITgQAz8pLOvtUPc8 TRc6kfGSswkaOpojCCV8V1vfR7jV0Piybvnr+0xiZqW4KCr8/Rr/mY7EM8OKBmvIofd0 FW1VogFIJfvV90nMH8v7M4BLZXS+FPOkeKT6Stmm45PO3j+K1Kb/0Yu2vqzgkkjqXtAl mhv13wsWqur5gLFNE/WCcq5GFKHdfbW0nz6p0LToST4mNETNU+CEQ3fujKXFbeBnflGk 1DEcn9SeYV4A9K+YXpc3u8HAcsBbstWyn0nQ+TqZUyRwx4X2oufS2QaZ6tuaozc+FKd7 +SDw== X-Gm-Message-State: AOJu0YzgjpYksa7rSwcCcvP8B2sbfRGJyMP4A0rXNUuJPV5Nz1TFLb2w 4XxyaCDtLdls/adIq49lCmxQwFD1/I3OYdpFAvQX+h+UXY707cglnV/N26TKRKdoPppazy326fz oSASWY6Fd419gVdOcqfec0v1zVaSehBdG0FHa0aE3bVhhm7U7n4PdP79D0R4/Q4F1mBoo7gAuwI KXe2zAil3aIg== X-Received: by 2002:a17:907:9495:b0:a86:97e5:8d4e with SMTP id a640c23a62f3a-a8a1d2c8600mr201592066b.23.1725352814672; Tue, 03 Sep 2024 01:40:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELvmRCd/O1kB3Un8sFcngB7FORnNxLB11qklw+JbE38g8QsF1llN9QSRKU61K8sTSGbaXV9w== X-Received: by 2002:a17:907:9495:b0:a86:97e5:8d4e with SMTP id a640c23a62f3a-a8a1d2c8600mr201587866b.23.1725352813620; Tue, 03 Sep 2024 01:40:13 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8989021dedsm653786466b.80.2024.09.03.01.40.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:13 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 01/21] UBUNTU: SAUCE: arm64: dts: qcom: sc8280xp-x13s: disable PCIe perst pull downs Date: Tue, 3 Sep 2024 10:39:50 +0200 Message-ID: <20240903084010.3746280-2-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Johan Hovold Disable the PCIe perst pull-down resistors to save some power. Signed-off-by: Johan Hovold (cherry picked from commit a59e55237c477c7003f06c0297a80510434b3fe6 linux-next) Signed-off-by: Juerg Haefliger --- arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index b27143f81867..a24e64e6eaf4 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -1509,7 +1509,7 @@ perst-n-pins { pins = "gpio143"; function = "gpio"; drive-strength = <2>; - bias-pull-down; + bias-disable; }; wake-n-pins { @@ -1532,7 +1532,7 @@ perst-n-pins { pins = "gpio151"; function = "gpio"; drive-strength = <2>; - bias-pull-down; + bias-disable; }; wake-n-pins { @@ -1555,7 +1555,7 @@ perst-n-pins { pins = "gpio141"; function = "gpio"; drive-strength = <2>; - bias-pull-down; + bias-disable; }; wake-n-pins { From patchwork Tue Sep 3 08:39:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979907 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfG16PCBz1ygj for ; Tue, 3 Sep 2024 18:40:25 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5F-0001KY-VC; Tue, 03 Sep 2024 08:40:17 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5E-0001JW-A2 for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:16 +0000 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 1DE613F215 for ; Tue, 3 Sep 2024 08:40:16 +0000 (UTC) Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a866eb62868so412293766b.3 for ; Tue, 03 Sep 2024 01:40:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352816; x=1725957616; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+zOQw04NzEdGTxOcrUwsndZl+wb8CY2UeXIj9xsBuAo=; b=AMEwWX8cO3gcbqrxBsuQIpvBTRqvcvfWTPKCTIaFxWpJGi6VKzJlR3sOi0gkAtHB7N hkKdVHYbopBbC7Ctgz6bt10rLsVobU30MbhzPngnzefCEDEEJMksomoD+8NGjCGzq/Z/ HcLpTP5V7UsDRqGZo+ifQ1Tz7w9zzBH0YAVxbyQ4uY3OtfHKHi3svMC+JmtwKdv3aA33 g+R9Mv9624UwApZGh/TB0949oKBMNMoR4KNjgJxyf0wI9Egh0OxbUQbFf5/xxYnmTexG G+l4YL7YIB678LiCLQqveH9cQWgwLWNqZk5BWBDZ/el4/uXxg6WnPOFK1HwXEMO+50r0 H1Bg== X-Gm-Message-State: AOJu0YzU1dHqtNFgQsuPGJaSCbff0VlAnMb2d1HjbVpR2PSAszF0DJ7W 0KMdNRD3RZnfgonM+LtM3lDNhgqUh2uCXHgKiOrCSex+jn0KAuI4f+Pwf4lCXVvQ9Gecydwry85 qQQ+8VQYddM0wGoHOnToUn9teWCiPgMXpXuh1pemLNHFaRSQfn8A07jGn44oOZSZprxCfNEJDtg 5WABv2XAsZPQ== X-Received: by 2002:a17:907:320b:b0:a86:79a2:ab12 with SMTP id a640c23a62f3a-a897f930b11mr1406478166b.38.1725352815654; Tue, 03 Sep 2024 01:40:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHk3cqOFV4Y0AsaeF/uwv10QJBpKaxiV8oPldB333V6W6gzoNEgqVnea7Gqq/MUSSDghjSQ1A== X-Received: by 2002:a17:907:320b:b0:a86:79a2:ab12 with SMTP id a640c23a62f3a-a897f930b11mr1406474666b.38.1725352814977; Tue, 03 Sep 2024 01:40:14 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8988feae40sm663973466b.15.2024.09.03.01.40.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:14 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 02/21] UBUNTU: SAUCE: arm64: dts: qcom: sc8280xp-x13s: clean up PCIe2a pinctrl node Date: Tue, 3 Sep 2024 10:39:51 +0200 Message-ID: <20240903084010.3746280-3-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Johan Hovold Clean up the PCIe2a pinctrl node indentation which should use tabs only. Signed-off-by: Johan Hovold (cherry picked from commit dfd06c0e7ff7af10b34fbd6526a08e078a1e876b linux-next) Signed-off-by: Juerg Haefliger --- .../boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index a24e64e6eaf4..a7c5a3f5926c 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -1513,11 +1513,11 @@ perst-n-pins { }; wake-n-pins { - pins = "gpio145"; - function = "gpio"; - drive-strength = <2>; - bias-pull-up; - }; + pins = "gpio145"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; }; pcie3a_default: pcie3a-default-state { From patchwork Tue Sep 3 08:39:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfG44VMdz1yZ9 for ; Tue, 3 Sep 2024 18:40:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5I-0001Ma-6B; Tue, 03 Sep 2024 08:40:20 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5F-0001KT-Ve for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:17 +0000 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id BF0BD3F283 for ; Tue, 3 Sep 2024 08:40:17 +0000 (UTC) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c2483adeeaso3725635a12.1 for ; Tue, 03 Sep 2024 01:40:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352817; x=1725957617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+wyvtS9ckiMlObEE7eXYinloiD1HSZeE5Vxl85YyHi0=; b=fiOzUDaDQECbtjcvNUfbVn/QM+3DJjXun/ed5E6MwiABYJT2X816cvXzl5Krfikj5x I4gI4+eygUd6d/dmBFp0iluWduQ3G04fnFA9OWZejHCX3ZnvWQoOnWJTLycGriJ94o6h lxIvugzkr3ZakU3EyX9tS2LAydKhTJZeF+oJClgDao5coZq/nHT67beOUoBfxCoHBTfx xjBvN2EpX+j3C9Kk34i6haUU6ZquA9TPWBETO0t5P07rPOAwv8d9wIu3vwa6AXGOfpLA ihXRWYdVcnOtpAVviQ1h7bnnEUiyqaenpQwtwIa3Oed9OltodOoupcPiFOQQnNpcmVd2 KZHA== X-Gm-Message-State: AOJu0YymWgWfWG/pXpOZN9csWAMo5/9qM5Xz8IKCnDik8oF4j83JXZyh qDe/a7Uzjkr1m4iI/xp4oKwy1zmNQ2M32aaA1wpGK42pTPH42Wlyy1oj+z5SQlHFX1P0CugS3Uk C7zwU0HHaXGSXzGW6l71gxVsJdIRwJ2oHkZ67eqoFKzeIMomZ7zqvDA2laz3JPbGUC28PGjCKLp oQzn9pFgznyQ== X-Received: by 2002:a05:6402:2114:b0:5be:c2c8:8631 with SMTP id 4fb4d7f45d1cf-5c22f7dff84mr16053232a12.8.1725352817185; Tue, 03 Sep 2024 01:40:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVJL6pPGV89mJOTeVY09ln06tehKc0es6Dm53fLEmF9AKrnV8XvSj9NiFnfPsci53rENKQ0g== X-Received: by 2002:a05:6402:2114:b0:5be:c2c8:8631 with SMTP id 4fb4d7f45d1cf-5c22f7dff84mr16053175a12.8.1725352816285; Tue, 03 Sep 2024 01:40:16 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c7bdb1sm6185350a12.44.2024.09.03.01.40.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:15 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 03/21] UBUNTU: SAUCE: media: qcom: camss: Remove use_count guard in stop_streaming Date: Tue, 3 Sep 2024 10:39:52 +0200 Message-ID: <20240903084010.3746280-4-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bryan O'Donoghue The use_count check was introduced so that multiple concurrent Raw Data Interfaces RDIs could be driven by different virtual channels VCs on the CSIPHY input driving the video pipeline. This is an invalid use of use_count though as use_count pertains to the number of times a video entity has been opened by user-space not the number of active streams. If use_count and stream-on count don't agree then stop_streaming() will break as is currently the case and has become apparent when using CAMSS with libcamera's released softisp 0.3. The use of use_count like this is a bit hacky and right now breaks regular usage of CAMSS for a single stream case. Stopping qcam results in the splat below, and then it cannot be started again and any attempts to do so fails with -EBUSY. [ 1265.509831] WARNING: CPU: 5 PID: 919 at drivers/media/common/videobuf2/videobuf2-core.c:2183 __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common] ... [ 1265.510630] Call trace: [ 1265.510636] __vb2_queue_cancel+0x230/0x2c8 [videobuf2_common] [ 1265.510648] vb2_core_streamoff+0x24/0xcc [videobuf2_common] [ 1265.510660] vb2_ioctl_streamoff+0x5c/0xa8 [videobuf2_v4l2] [ 1265.510673] v4l_streamoff+0x24/0x30 [videodev] [ 1265.510707] __video_do_ioctl+0x190/0x3f4 [videodev] [ 1265.510732] video_usercopy+0x304/0x8c4 [videodev] [ 1265.510757] video_ioctl2+0x18/0x34 [videodev] [ 1265.510782] v4l2_ioctl+0x40/0x60 [videodev] ... [ 1265.510944] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 0 in active state [ 1265.511175] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 1 in active state [ 1265.511398] videobuf2_common: driver bug: stop_streaming operation is leaving buffer 2 in active st One CAMSS specific way to handle multiple VCs on the same RDI might be: - Reference count each pipeline enable for CSIPHY, CSID, VFE and RDIx. - The video buffers are already associated with msm_vfeN_rdiX so release video buffers when told to do so by stop_streaming. - Only release the power-domains for the CSIPHY, CSID and VFE when their internal refcounts drop. Either way refusing to release video buffers based on use_count is erroneous and should be reverted. The silicon enabling code for selecting VCs is perfectly fine. Its a "known missing feature" that concurrent VCs won't work with CAMSS right now. Initial testing with this code didn't show an error but, SoftISP and "real" usage with Google Hangouts breaks the upstream code pretty quickly, we need to do a partial revert and take another pass at VCs. This commit partially reverts commit 89013969e232 ("media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels") Fixes: 89013969e232 ("media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels") Reported-by: Johan Hovold Closes: https://lore.kernel.org/lkml/ZoVNHOTI0PKMNt4_@hovoldconsulting.com/ Tested-by: Johan Hovold Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/lkml/ZoVNHOTI0PKMNt4_@hovoldconsulting.com/ Link: https://lore.kernel.org/r/20240729-linux-next-24-07-13-camss-fixes-v3-1-38235dc782c7@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit 25f18cb1b673220b76a86ebef8e7fb79bd303b27 linux-next) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/camss/camss-video.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index cd72feca618c..3b8fc31d957c 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -297,12 +297,6 @@ static void video_stop_streaming(struct vb2_queue *q) ret = v4l2_subdev_call(subdev, video, s_stream, 0); - if (entity->use_count > 1) { - /* Don't stop if other instances of the pipeline are still running */ - dev_dbg(video->camss->dev, "Video pipeline still used, don't stop streaming.\n"); - return; - } - if (ret) { dev_err(video->camss->dev, "Video pipeline stop failed: %d\n", ret); return; From patchwork Tue Sep 3 08:39:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979911 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfG84Xmsz1ygj for ; Tue, 3 Sep 2024 18:40:32 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5M-0001TK-CA; Tue, 03 Sep 2024 08:40:24 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5H-0001Ls-6J for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:19 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 0E4C93F183 for ; Tue, 3 Sep 2024 08:40:19 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a866eb62868so412296866b.3 for ; Tue, 03 Sep 2024 01:40:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352818; x=1725957618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P8mLhnGwpGoFNK1M4I2qAXwZhoxEEYY9rFzNvATohMU=; b=OVN28IYEBrqUd7BW5FGHWMgsmg0zxQ4w2Iq+vaAcd6LvRTX09pY5GNuCMfi8QkgVDW G39A0U2JYIpWrS3ZoobxXBUcwfuJxMg6uU+EltCYfO+wvHIQNxu+ISfAU+2p7BeiFFNa Yb4RwwSNLf10jIaa68YNPUH5q73pFMWUSx7HZAsrcrl5eeT/IYQQOEdvMmGPn5j5rMN5 RimWxhbykTSOUpr7gr5MiLsx0cHgpAU87A6bayE8NntUOXLORWAAViad5yvdtG56Tpbu QJbnLTr8Ff4Ic1Dq8zEoW+YHoT9MDpAJVwGDBYL/zWnAbANC+tCiraj7M+J2q0wRU/Oh lRgw== X-Gm-Message-State: AOJu0YzJWsk4JTJkoI56C5SFvQwJq5BMj72JZplvkr6x6p4B/rUC0BQR ddKlVEEyu+0EOwdpwSe19weEA3euOi8ZH1yakR2xtuED9vSW3o9m+//SAJ561BNlDr6s6o70KbD zvMmwJCnX5QkpyLXAugP5PueVwjT5GjjIgVHUt3tacNabnq+ywoP8aq7K4x2pRzj07o6C2OmpEh Sgx4jR9mVByQ== X-Received: by 2002:a17:907:2d07:b0:a80:7193:bd93 with SMTP id a640c23a62f3a-a897f84d734mr1248434166b.25.1725352818517; Tue, 03 Sep 2024 01:40:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG40yxjAw1woP9toy6KI0q3rR+4LJ9cNH/XTTR3yKhS/AZMQ9TomhR9X4880ASaCq+5mxw2fQ== X-Received: by 2002:a17:907:2d07:b0:a80:7193:bd93 with SMTP id a640c23a62f3a-a897f84d734mr1248431766b.25.1725352817821; Tue, 03 Sep 2024 01:40:17 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a898900f6absm654564666b.70.2024.09.03.01.40.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:17 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 04/21] UBUNTU: SAUCE: media: qcom: camss: Fix ordering of pm_runtime_enable Date: Tue, 3 Sep 2024 10:39:53 +0200 Message-ID: <20240903084010.3746280-5-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bryan O'Donoghue pm_runtime_enable() should happen prior to vfe_get() since vfe_get() calls pm_runtime_resume_and_get(). This is a basic race condition that doesn't show up for most users so is not widely reported. If you blacklist qcom-camss in modules.d and then subsequently modprobe the module post-boot it is possible to reliably show this error up. The kernel log for this error looks like this: qcom-camss ac5a000.camss: Failed to power up pipeline: -13 Fixes: 02afa816dbbf ("media: camss: Add basic runtime PM support") Reported-by: Johan Hovold Closes: https://lore.kernel.org/lkml/ZoVNHOTI0PKMNt4_@hovoldconsulting.com/ Tested-by: Johan Hovold Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/lkml/ZoVNHOTI0PKMNt4_@hovoldconsulting.com/ Link: https://lore.kernel.org/r/20240729-linux-next-24-07-13-camss-fixes-v3-2-38235dc782c7@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit a151766bd3688f6803e706c6433a7c8d3c6a6a94 linux-next) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/camss/camss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 51b1d3550421..d64985ca6e88 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -2283,6 +2283,8 @@ static int camss_probe(struct platform_device *pdev) v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev); + pm_runtime_enable(dev); + num_subdevs = camss_of_parse_ports(camss); if (num_subdevs < 0) { ret = num_subdevs; @@ -2323,8 +2325,6 @@ static int camss_probe(struct platform_device *pdev) } } - pm_runtime_enable(dev); - return 0; err_register_subdevs: @@ -2332,6 +2332,7 @@ static int camss_probe(struct platform_device *pdev) err_v4l2_device_unregister: v4l2_device_unregister(&camss->v4l2_dev); v4l2_async_nf_cleanup(&camss->notifier); + pm_runtime_disable(dev); err_genpd_cleanup: camss_genpd_cleanup(camss); From patchwork Tue Sep 3 08:39:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfG70YV8z1yZ9 for ; Tue, 3 Sep 2024 18:40:31 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5L-0001S8-HX; Tue, 03 Sep 2024 08:40:23 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5J-0001NW-0d for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:21 +0000 Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id B64493F284 for ; Tue, 3 Sep 2024 08:40:20 +0000 (UTC) Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2f403189d83so948231fa.2 for ; Tue, 03 Sep 2024 01:40:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352820; x=1725957620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UYB9oygodAIeM9MSB4TNWp97IjhFwYpkptgq5KvHTz8=; b=jpae0X8+n1Ug6a9z+I3WORTgBS3aBeQte8HvKDHrxK+cZdBm6e6D+kPN36QX1R/oJs OnrYEXOjxtaxNhqUGPESu6jj4jY4cajrRWfzpnozZjA28EC82gTJ1VFsHbT3kIPiL2fu ulLchyHjX5kk/fo6KP9yJeGHESrOlJ0gmFKlnEvUJCiDCvQ9j6yTgPAxmmDFyQgMlLvM PYvD05kn/99OW/jq4/jRMuP7Nho3ikv2MrAQAneqMHrWETlKGxkTXGGGPtop81jyt3QY SqlIqXBFfEwqeoIozvqkZ2BwUyTFkGW4bFHJtG/IjLto8T4n+Y4U/x1WtRnPzKXXJAq9 vXTA== X-Gm-Message-State: AOJu0YwXzJlqE83Pk2/jmYAEaoOIA7R36pnV7HHdfUYv3h3confgtts8 wxN8lJ/xg+tO9RffIFvjNpdVhKdmGPkxcbPJofLZjzxnYjx8EXkY0at66tiPVZRZKgDaPZ9Fdza 6qh/nS8MFVmzBsNKWqzdT1h/u47SmpmNCGy60Q0YHPNJE+oHnVWbf9ziEPJH061CfRv+vXFySLM OORAqSEDC0Qg== X-Received: by 2002:a2e:be03:0:b0:2ef:2b45:b71d with SMTP id 38308e7fff4ca-2f6103c83ccmr103768321fa.24.1725352819981; Tue, 03 Sep 2024 01:40:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEU7sH93laELSjkE7E8nam3//M7Y/ombHRUSd+jAsC3/sX3kGeiblnX7er7gpwe/x1A4glRCA== X-Received: by 2002:a2e:be03:0:b0:2ef:2b45:b71d with SMTP id 38308e7fff4ca-2f6103c83ccmr103767811fa.24.1725352819109; Tue, 03 Sep 2024 01:40:19 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c7bda6sm6238123a12.41.2024.09.03.01.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:18 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 05/21] UBUNTU: SAUCE: arm64: dts: qcom: sc8280xp-x13s: Enable RGB sensor Date: Tue, 3 Sep 2024 10:39:54 +0200 Message-ID: <20240903084010.3746280-6-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bryan O'Donoghue Enable the main RGB sensor on the Lenovo x13s a five megapixel 2 lane DPHY MIPI sensor connected to cisphy0. With the pm8008 patches recently applied to the x13s dtsi we can now also enable the RGB sensor. Once done we have all upstream support necessary for the RGB sensor on x13s. Reviewed-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20240806-b4-linux-next-24-07-31-camss-sc8280xp-lenovo-rgb-v2-v3-1-199767fb193d@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit 21927e94caa5ae05ab2361a5c6e63d52624e8381 linux-next) Signed-off-by: Juerg Haefliger --- .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index a7c5a3f5926c..6a28cab97189 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -592,6 +592,57 @@ vreg_l10d: ldo10 { }; }; +&camss { + vdda-phy-supply = <&vreg_l6d>; + vdda-pll-supply = <&vreg_l4d>; + + status = "okay"; + + ports { + port@0 { + csiphy0_lanes01_ep: endpoint@0 { + reg = <0>; + clock-lanes = <7>; + data-lanes = <0 1>; + remote-endpoint = <&ov5675_ep>; + }; + }; + }; +}; + +&cci2 { + status = "okay"; +}; + +&cci2_i2c1 { + camera@10 { + compatible = "ovti,ov5675"; + reg = <0x10>; + + reset-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&cam_rgb_default>; + + clocks = <&camcc CAMCC_MCLK3_CLK>; + + orientation = <0>; /* Front facing */ + + avdd-supply = <&vreg_l6q>; + dvdd-supply = <&vreg_l2q>; + dovdd-supply = <&vreg_l7q>; + + port { + ov5675_ep: endpoint { + clock-lanes = <0>; + data-lanes = <1 2>; + link-frequencies = /bits/ 64 <450000000>; + remote-endpoint = <&csiphy0_lanes01_ep>; + }; + }; + + }; +}; + &dispcc0 { status = "okay"; }; @@ -1436,6 +1487,22 @@ cam_indicator_en: cam-indicator-en-state { bias-disable; }; + cam_rgb_default: cam-rgb-default-state { + mclk-pins { + pins = "gpio17"; + function = "cam_mclk"; + drive-strength = <16>; + bias-disable; + }; + + sc-rgb-xshut-n-pins { + pins = "gpio15"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + }; + edp_reg_en: edp-reg-en-state { pins = "gpio25"; function = "gpio"; From patchwork Tue Sep 3 08:39:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979913 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGC0qjWz1yZ9 for ; Tue, 3 Sep 2024 18:40:35 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5P-0001bF-IS; Tue, 03 Sep 2024 08:40:27 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5K-0001P3-8h for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:22 +0000 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 08B563F215 for ; Tue, 3 Sep 2024 08:40:22 +0000 (UTC) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-53440ff1ecfso5328171e87.3 for ; Tue, 03 Sep 2024 01:40:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352821; x=1725957621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b4k770awp0XCHS8xx0wTVz1S3xySu7fmXZ53NRs+mOI=; b=aKaS0W0fCKJG+CrGR3Lcy//FU11y6HQc8Z1AA06fNDLr23fed9A3+cjDiMVxLalQqF KSouT1shXTOiVg1Dv2oaMgtxCwuZuAlG/tuGnePiE8Ju8FkrbHh7aVVkF7r79tlBV82/ CYZ9QeoNz3im/0oIqSNug0ZPExV1fwZGXf/oEf4gFNJ4qow2yF16BF/Ryj9GJEdTOIxQ aG8Q6BBBUI9xZGJFRT7e9zveqJWCiydlmS0wu47g9P+hEzSmZnAacXnYjRMVfSuV6Khi dYiDIRy87Bt5Mrannq4LMUtK+Rv/O7qF6NzEMBpN549Hnyo7V6zJbfyrfeN9iY9ZocUL 1u4A== X-Gm-Message-State: AOJu0YzuX7nDoIjyhDcaTBmbeJh2/GCq/IjXhj0cdd3id8nH/yyXhehJ ZqwysQd13XQEhfQG3r0UgxNbdln2mWsMLipw+K39pZC0mTomeeLFVr9hqx233cwlRZ5QHm0qdmd ATrsbtog3CJiZTnmeGs9QfFIFbhvOzzAFfgRWUoxeSi/vqxK5bRatm9auscSxGYS/WxA7/Ebx7N Kq+0uf0FWbnw== X-Received: by 2002:a05:6512:68c:b0:533:483f:957b with SMTP id 2adb3069b0e04-53546bc2f98mr8166694e87.61.1725352821311; Tue, 03 Sep 2024 01:40:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUXzR3lh7TN4oHwEuAAX/9rniBSubj1t/gjAuBMayoHhG9K4RaGcchvgbMHO5dC7Pd4+Z2sQ== X-Received: by 2002:a05:6512:68c:b0:533:483f:957b with SMTP id 2adb3069b0e04-53546bc2f98mr8166659e87.61.1725352820438; Tue, 03 Sep 2024 01:40:20 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891a3dbdsm653992966b.131.2024.09.03.01.40.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:20 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 06/21] UBUNTU: SAUCE: wifi: ath11k: fix NULL pointer dereference in ath11k_mac_get_eirp_power() Date: Tue, 3 Sep 2024 10:39:55 +0200 Message-ID: <20240903084010.3746280-7-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Baochen Qiang Commit 39dc8b8ea387 ("wifi: mac80211: pass parsed TPE data to drivers") breaks ath11k, leading to kernel crash: BUG: kernel NULL pointer dereference, address: 0000000000000018 RIP: 0010:ath11k_mac_get_eirp_power.isra.0+0x5b/0x80 [ath11k] Call Trace: ath11k_mac_fill_reg_tpc_info+0x3d6/0x800 [ath11k] ath11k_mac_vdev_start_restart+0x412/0x4d0 [ath11k] ath11k_mac_op_sta_state+0x7bc/0xbb0 [ath11k] drv_sta_state+0xf1/0x5f0 [mac80211] sta_info_insert_rcu+0x28d/0x530 [mac80211] sta_info_insert+0xf/0x20 [mac80211] ieee80211_prep_connection+0x3b4/0x4c0 [mac80211] ieee80211_mgd_auth+0x363/0x600 [mac80211] The issue scenario is, AP advertises power spectral density (PSD) values in its transmit power envelope (TPE) IE and supports 160 MHz bandwidth in 6 GHz. When connecting to this AP, in ath11k_mac_parse_tx_pwr_env(), the local variable psd is true and then reg_tpc_info.num_pwr_levels is set to 8 due to 160 MHz bandwidth. Note here ath11k fails to set reg_tpc_info.is_psd_power as TRUE due to above commit. Then in ath11k_mac_fill_reg_tpc_info(), for each of the 8 power levels, for a PSD channel, ath11k_mac_get_psd_channel() is expected to be called to get required information. However due to invalid reg_tpc_info.is_psd_power, it is ath11k_mac_get_eirp_power() that gets called and passed with pwr_lvl_idx as one of the arguments. Note this function implicitly requires pwr_lvl_idx to be no more than 3. So when pwr_lvl_idx is larger than that ath11k_mac_get_seg_freq() returns invalid center frequency, with which as the input ieee80211_get_channel() returns NULL, then kernel crashes due to NULL pointer dereference. Fix it by setting reg_tpc_info.is_psd_power properly. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 Fixes: 39dc8b8ea387 ("wifi: mac80211: pass parsed TPE data to drivers") Reported-by: Mikko Tiihonen Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219131 Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Link: https://lore.kernel.org/r/20240813083808.9224-1-quic_bqiang@quicinc.com Signed-off-by: Johan Hovold (cherry picked from commit 9abf199943a6469a71f6ce5c2266e9364d310f8b linux-next) Signed-off-by: Juerg Haefliger --- drivers/net/wireless/ath/ath11k/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index ba910ae2c676..7c0ef6916dd2 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -7900,6 +7900,7 @@ static void ath11k_mac_parse_tx_pwr_env(struct ath11k *ar, } if (psd) { + arvif->reg_tpc_info.is_psd_power = true; arvif->reg_tpc_info.num_pwr_levels = psd->count; for (i = 0; i < arvif->reg_tpc_info.num_pwr_levels; i++) { From patchwork Tue Sep 3 08:39:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfG91GCbz1yh2 for ; Tue, 3 Sep 2024 18:40:33 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5O-0001XI-6n; Tue, 03 Sep 2024 08:40:26 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5L-0001QZ-1E for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:23 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id CABB13F183 for ; Tue, 3 Sep 2024 08:40:22 +0000 (UTC) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c25680de68so1470837a12.2 for ; Tue, 03 Sep 2024 01:40:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352822; x=1725957622; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OFcuL4/KVt0qwcf8I59tFtXkZDZHKSxo0BXp3sLXQqM=; b=ZwMATHkZSk3bglURLgEN49fA2v04KcAoA4CEkBepOxEYgWjCX2/ctfAT1hxFgo0K9E nVwF3kqA2//DojWAs0dzcAPebTC0sX9X79BeHyVUbMxPv1qIxqi8CKCzb9++vWFwJoCK dXoromVM9FXUy+vPX+9InWByZDrhqMyuNgjB97wFistBjTad1gHnRGG5pZZ7v4gD/Wxz B/fM3qAJnHw7EGpa8dVknO8ImRGVY7c8Tv2rgoAAwUwrmcJV88kodU5m16PgQ04HMiyr QqES79d2hIQcS9SoWjpnVq5TW+4p2ycJQyDyE2zcM1XZbn4RsdS4i03DOd0RiK534XaI SfEw== X-Gm-Message-State: AOJu0YwCZMvaFW+NukIDzp3WpGAPb7DPNYhT/S4NTFb6eeEqRYn5o7zY PlHNw106HHar74qmlUOj3arnGml53i3dSXrQl86DODkEMPowZ8Hr4se5dNkfqHJ/+gT2hyD85+J nSPdisjQrEoYUd23uJnGiPt7haoEhdEDBCJd/MtaA7rRvIbAxe7eGd/4xU+oLoUuh5Mt5dS2nWm WL33a1IoWhUQ== X-Received: by 2002:a05:6402:50ca:b0:5c2:6fd3:4a36 with SMTP id 4fb4d7f45d1cf-5c26fd34afbmr594951a12.16.1725352822367; Tue, 03 Sep 2024 01:40:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEW1FAGVyAA1v3fA9zi+3CCBwBq9uD7+wL0G+DMxXisYzajkWwW5Ppo87MRj5+EM+scgFDJVg== X-Received: by 2002:a05:6402:50ca:b0:5c2:6fd3:4a36 with SMTP id 4fb4d7f45d1cf-5c26fd34afbmr594914a12.16.1725352821716; Tue, 03 Sep 2024 01:40:21 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c251cf4384sm3028456a12.88.2024.09.03.01.40.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:21 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 07/21] UBUNTU: SAUCE: Revert "wifi: ath11k: restore country code during resume" Date: Tue, 3 Sep 2024 10:39:56 +0200 Message-ID: <20240903084010.3746280-8-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Baochen Qiang This reverts commit 7f0343b7b8710436c1e6355c71782d32ada47e0c. We are going to revert commit 166a490f59ac ("wifi: ath11k: support hibernation"), on which this commit depends. With that commit reverted, this one is not needed any more, so revert this commit first. Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Link: https://lore.kernel.org/r/20240830073420.5790-2-quic_bqiang@quicinc.com Signed-off-by: Johan Hovold (cherry picked from commit d3e154d7776ba57ab679fb816fb87b627fba21c9 linux-next) Signed-off-by: Juerg Haefliger --- drivers/net/wireless/ath/ath11k/core.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 03187df26000..325b930aaf06 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -1009,16 +1009,6 @@ int ath11k_core_resume(struct ath11k_base *ab) return -ETIMEDOUT; } - if (ab->hw_params.current_cc_support && - ar->alpha2[0] != 0 && ar->alpha2[1] != 0) { - ret = ath11k_reg_set_cc(ar); - if (ret) { - ath11k_warn(ab, "failed to set country code during resume: %d\n", - ret); - return ret; - } - } - ret = ath11k_dp_rx_pktlog_start(ab); if (ret) ath11k_warn(ab, "failed to start rx pktlog during resume: %d\n", From patchwork Tue Sep 3 08:39:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGF0VjNz1ygj for ; Tue, 3 Sep 2024 18:40:37 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5Q-0001eV-Nq; Tue, 03 Sep 2024 08:40:28 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5N-0001Ve-EO for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:25 +0000 Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 1B9283FA91 for ; Tue, 3 Sep 2024 08:40:25 +0000 (UTC) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2f3f6a6e3e8so57295261fa.2 for ; Tue, 03 Sep 2024 01:40:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352824; x=1725957624; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B9lUWM8NqVwR0Toi2gABwUQzny7fonIjpLzvFclkOjI=; b=rKrW/HXBc2MuQ/xFAjiCSk2tfizGrtqiTn2PFNbVOLP1HWn3oFRhJeafrznAcP4YMi 3YvdprylVujUNY7ZegjwGRt9e1S640vau/cfWpsl3+9ulh2gUVnCDlQc5+u6jHTPjTa+ GWiCtSNxrGoKSeBEHNNcjgWZ792v3VxsYwwU0MNW80K18wAKOTwpDNu78jWZRCiGJtHx yBv/8pMkp+6KU2Q/yvMPK8NyOo0/ukJBTpbNN4em0zvY2/FOwoRcAjQt1gFrJnQjtseE A8r5K+D7AkQrkkJ1hcXKYoCuJF4n5gW3kvml6EtKVSpVAj1xJX953xwPtcywWcDhGzD8 4S7Q== X-Gm-Message-State: AOJu0YyA4Ufn6YXF0CBICjYzCtOLV7t16gxr2/iSPIMQleNI+N3njIsK btNB5GXwzWfdGr48wv7sADDT0qd6o7XKAkK13Umkwk1k97EoYD7X6Ue6CqHNlhjDUVcVLoXt9Xn 0AqPTrb9pMvn19nrhqItlGdDcwWEbgdiwqg8R9M7H5zKuGzBnhtQIZr/baVj3xo1SSOn3cgXqek sbsAlBhDAhkA== X-Received: by 2002:a05:651c:210d:b0:2ef:29cd:3191 with SMTP id 38308e7fff4ca-2f6108934b4mr133048931fa.35.1725352824220; Tue, 03 Sep 2024 01:40:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6X0S7898ktnLVigmlT/dde1W/AHSOkA3N7M8YUzKDYgw0ms/esoskdxwpDkBsV3dKzzKSQg== X-Received: by 2002:a05:651c:210d:b0:2ef:29cd:3191 with SMTP id 38308e7fff4ca-2f6108934b4mr133048601fa.35.1725352823327; Tue, 03 Sep 2024 01:40:23 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8988feb1b8sm657167566b.38.2024.09.03.01.40.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:22 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 08/21] UBUNTU: SAUCE: Revert "wifi: ath11k: support hibernation" Date: Tue, 3 Sep 2024 10:39:57 +0200 Message-ID: <20240903084010.3746280-9-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Baochen Qiang This reverts commit 166a490f59ac10340ee5330e51c15188ce2a7f8f. We get report [1][2] that this commit breaks system suspend on some specific Lenovo platforms. Since there is no fix available, for now revert this commit to make suspend work again on those platforms. [1] https://bugzilla.kernel.org/show_bug.cgi?id=219196 [2] https://bugzilla.redhat.com/show_bug.cgi?id=2301921 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219196 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2301921 Signed-off-by: Baochen Qiang Fixes: 166a490f59ac ("wifi: ath11k: support hibernation") Acked-by: Jeff Johnson Link: https://lore.kernel.org/r/20240830073420.5790-3-quic_bqiang@quicinc.com Signed-off-by: Johan Hovold (cherry picked from commit 2f833e8948d6c88a3a257d4e426c9897b4907d5a linux-next) Signed-off-by: Juerg Haefliger --- drivers/net/wireless/ath/ath11k/ahb.c | 4 +- drivers/net/wireless/ath/ath11k/core.c | 107 ++++++++----------------- drivers/net/wireless/ath/ath11k/core.h | 4 - drivers/net/wireless/ath/ath11k/hif.h | 12 +-- drivers/net/wireless/ath/ath11k/mhi.c | 12 +-- drivers/net/wireless/ath/ath11k/mhi.h | 3 +- drivers/net/wireless/ath/ath11k/pci.c | 44 ++-------- drivers/net/wireless/ath/ath11k/qmi.c | 2 +- 8 files changed, 49 insertions(+), 139 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index 634d385fd9ad..97b12f51ef28 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -413,7 +413,7 @@ static int ath11k_ahb_power_up(struct ath11k_base *ab) return ret; } -static void ath11k_ahb_power_down(struct ath11k_base *ab, bool is_suspend) +static void ath11k_ahb_power_down(struct ath11k_base *ab) { struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab); @@ -1280,7 +1280,7 @@ static void ath11k_ahb_remove(struct platform_device *pdev) struct ath11k_base *ab = platform_get_drvdata(pdev); if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { - ath11k_ahb_power_down(ab, false); + ath11k_ahb_power_down(ab); ath11k_debugfs_soc_destroy(ab); ath11k_qmi_deinit_service(ab); goto qmi_fail; diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 325b930aaf06..ccf4ad35fdc3 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -906,6 +906,12 @@ int ath11k_core_suspend(struct ath11k_base *ab) return ret; } + ret = ath11k_wow_enable(ab); + if (ret) { + ath11k_warn(ab, "failed to enable wow during suspend: %d\n", ret); + return ret; + } + ret = ath11k_dp_rx_pktlog_stop(ab, false); if (ret) { ath11k_warn(ab, "failed to stop dp rx pktlog during suspend: %d\n", @@ -916,85 +922,29 @@ int ath11k_core_suspend(struct ath11k_base *ab) ath11k_ce_stop_shadow_timers(ab); ath11k_dp_stop_shadow_timers(ab); - /* PM framework skips suspend_late/resume_early callbacks - * if other devices report errors in their suspend callbacks. - * However ath11k_core_resume() would still be called because - * here we return success thus kernel put us on dpm_suspended_list. - * Since we won't go through a power down/up cycle, there is - * no chance to call complete(&ab->restart_completed) in - * ath11k_core_restart(), making ath11k_core_resume() timeout. - * So call it here to avoid this issue. This also works in case - * no error happens thus suspend_late/resume_early get called, - * because it will be reinitialized in ath11k_core_resume_early(). - */ - complete(&ab->restart_completed); - - return 0; -} -EXPORT_SYMBOL(ath11k_core_suspend); - -int ath11k_core_suspend_late(struct ath11k_base *ab) -{ - struct ath11k_pdev *pdev; - struct ath11k *ar; - - if (!ab->hw_params.supports_suspend) - return -EOPNOTSUPP; - - /* so far single_pdev_only chips have supports_suspend as true - * and only the first pdev is valid. - */ - pdev = ath11k_core_get_single_pdev(ab); - ar = pdev->ar; - if (!ar || ar->state != ATH11K_STATE_OFF) - return 0; - ath11k_hif_irq_disable(ab); ath11k_hif_ce_irq_disable(ab); - ath11k_hif_power_down(ab, true); + ret = ath11k_hif_suspend(ab); + if (ret) { + ath11k_warn(ab, "failed to suspend hif: %d\n", ret); + return ret; + } return 0; } -EXPORT_SYMBOL(ath11k_core_suspend_late); - -int ath11k_core_resume_early(struct ath11k_base *ab) -{ - int ret; - struct ath11k_pdev *pdev; - struct ath11k *ar; - - if (!ab->hw_params.supports_suspend) - return -EOPNOTSUPP; - - /* so far single_pdev_only chips have supports_suspend as true - * and only the first pdev is valid. - */ - pdev = ath11k_core_get_single_pdev(ab); - ar = pdev->ar; - if (!ar || ar->state != ATH11K_STATE_OFF) - return 0; - - reinit_completion(&ab->restart_completed); - ret = ath11k_hif_power_up(ab); - if (ret) - ath11k_warn(ab, "failed to power up hif during resume: %d\n", ret); - - return ret; -} -EXPORT_SYMBOL(ath11k_core_resume_early); +EXPORT_SYMBOL(ath11k_core_suspend); int ath11k_core_resume(struct ath11k_base *ab) { int ret; struct ath11k_pdev *pdev; struct ath11k *ar; - long time_left; if (!ab->hw_params.supports_suspend) return -EOPNOTSUPP; - /* so far single_pdev_only chips have supports_suspend as true + /* so far signle_pdev_only chips have supports_suspend as true * and only the first pdev is valid. */ pdev = ath11k_core_get_single_pdev(ab); @@ -1002,19 +952,29 @@ int ath11k_core_resume(struct ath11k_base *ab) if (!ar || ar->state != ATH11K_STATE_OFF) return 0; - time_left = wait_for_completion_timeout(&ab->restart_completed, - ATH11K_RESET_TIMEOUT_HZ); - if (time_left == 0) { - ath11k_warn(ab, "timeout while waiting for restart complete"); - return -ETIMEDOUT; + ret = ath11k_hif_resume(ab); + if (ret) { + ath11k_warn(ab, "failed to resume hif during resume: %d\n", ret); + return ret; } + ath11k_hif_ce_irq_enable(ab); + ath11k_hif_irq_enable(ab); + ret = ath11k_dp_rx_pktlog_start(ab); - if (ret) + if (ret) { ath11k_warn(ab, "failed to start rx pktlog during resume: %d\n", ret); + return ret; + } - return ret; + ret = ath11k_wow_wakeup(ab); + if (ret) { + ath11k_warn(ab, "failed to wakeup wow during resume: %d\n", ret); + return ret; + } + + return 0; } EXPORT_SYMBOL(ath11k_core_resume); @@ -2109,8 +2069,6 @@ static void ath11k_core_restart(struct work_struct *work) if (!ab->is_reset) ath11k_core_post_reconfigure_recovery(ab); - - complete(&ab->restart_completed); } static void ath11k_core_reset(struct work_struct *work) @@ -2180,7 +2138,7 @@ static void ath11k_core_reset(struct work_struct *work) ath11k_hif_irq_disable(ab); ath11k_hif_ce_irq_disable(ab); - ath11k_hif_power_down(ab, false); + ath11k_hif_power_down(ab); ath11k_hif_power_up(ab); ath11k_dbg(ab, ATH11K_DBG_BOOT, "reset started\n"); @@ -2253,7 +2211,7 @@ void ath11k_core_deinit(struct ath11k_base *ab) mutex_unlock(&ab->core_lock); - ath11k_hif_power_down(ab, false); + ath11k_hif_power_down(ab); ath11k_mac_destroy(ab); ath11k_core_soc_destroy(ab); ath11k_fw_destroy(ab); @@ -2306,7 +2264,6 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size, timer_setup(&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry, 0); init_completion(&ab->htc_suspend); init_completion(&ab->wow.wakeup_completed); - init_completion(&ab->restart_completed); ab->dev = dev; ab->hif.bus = bus; diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index df24f0e409af..b655967a465b 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -1036,8 +1036,6 @@ struct ath11k_base { DECLARE_BITMAP(fw_features, ATH11K_FW_FEATURE_COUNT); } fw; - struct completion restart_completed; - #ifdef CONFIG_NL80211_TESTMODE struct { u32 data_pos; @@ -1237,10 +1235,8 @@ void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd); int ath11k_core_check_dt(struct ath11k_base *ath11k); int ath11k_core_check_smbios(struct ath11k_base *ab); void ath11k_core_halt(struct ath11k *ar); -int ath11k_core_resume_early(struct ath11k_base *ab); int ath11k_core_resume(struct ath11k_base *ab); int ath11k_core_suspend(struct ath11k_base *ab); -int ath11k_core_suspend_late(struct ath11k_base *ab); void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab); bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab); diff --git a/drivers/net/wireless/ath/ath11k/hif.h b/drivers/net/wireless/ath/ath11k/hif.h index c4c6cc09c7c1..674ff772b181 100644 --- a/drivers/net/wireless/ath/ath11k/hif.h +++ b/drivers/net/wireless/ath/ath11k/hif.h @@ -18,7 +18,7 @@ struct ath11k_hif_ops { int (*start)(struct ath11k_base *ab); void (*stop)(struct ath11k_base *ab); int (*power_up)(struct ath11k_base *ab); - void (*power_down)(struct ath11k_base *ab, bool is_suspend); + void (*power_down)(struct ath11k_base *ab); int (*suspend)(struct ath11k_base *ab); int (*resume)(struct ath11k_base *ab); int (*map_service_to_pipe)(struct ath11k_base *ab, u16 service_id, @@ -67,18 +67,12 @@ static inline void ath11k_hif_irq_disable(struct ath11k_base *ab) static inline int ath11k_hif_power_up(struct ath11k_base *ab) { - if (!ab->hif.ops->power_up) - return -EOPNOTSUPP; - return ab->hif.ops->power_up(ab); } -static inline void ath11k_hif_power_down(struct ath11k_base *ab, bool is_suspend) +static inline void ath11k_hif_power_down(struct ath11k_base *ab) { - if (!ab->hif.ops->power_down) - return; - - ab->hif.ops->power_down(ab, is_suspend); + ab->hif.ops->power_down(ab); } static inline int ath11k_hif_suspend(struct ath11k_base *ab) diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c index ab182690aed3..6974a551883f 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c @@ -453,17 +453,9 @@ int ath11k_mhi_start(struct ath11k_pci *ab_pci) return 0; } -void ath11k_mhi_stop(struct ath11k_pci *ab_pci, bool is_suspend) +void ath11k_mhi_stop(struct ath11k_pci *ab_pci) { - /* During suspend we need to use mhi_power_down_keep_dev() - * workaround, otherwise ath11k_core_resume() will timeout - * during resume. - */ - if (is_suspend) - mhi_power_down_keep_dev(ab_pci->mhi_ctrl, true); - else - mhi_power_down(ab_pci->mhi_ctrl, true); - + mhi_power_down(ab_pci->mhi_ctrl, true); mhi_unprepare_after_power_down(ab_pci->mhi_ctrl); } diff --git a/drivers/net/wireless/ath/ath11k/mhi.h b/drivers/net/wireless/ath/ath11k/mhi.h index 2d567705e732..a682aad52fc5 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.h +++ b/drivers/net/wireless/ath/ath11k/mhi.h @@ -18,7 +18,7 @@ #define MHICTRL_RESET_MASK 0x2 int ath11k_mhi_start(struct ath11k_pci *ar_pci); -void ath11k_mhi_stop(struct ath11k_pci *ar_pci, bool is_suspend); +void ath11k_mhi_stop(struct ath11k_pci *ar_pci); int ath11k_mhi_register(struct ath11k_pci *ar_pci); void ath11k_mhi_unregister(struct ath11k_pci *ar_pci); void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab); @@ -26,4 +26,5 @@ void ath11k_mhi_clear_vector(struct ath11k_base *ab); int ath11k_mhi_suspend(struct ath11k_pci *ar_pci); int ath11k_mhi_resume(struct ath11k_pci *ar_pci); + #endif diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index 8d63b84d1261..be9d2c69cc41 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -638,7 +638,7 @@ static int ath11k_pci_power_up(struct ath11k_base *ab) return 0; } -static void ath11k_pci_power_down(struct ath11k_base *ab, bool is_suspend) +static void ath11k_pci_power_down(struct ath11k_base *ab) { struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); @@ -649,7 +649,7 @@ static void ath11k_pci_power_down(struct ath11k_base *ab, bool is_suspend) ath11k_pci_msi_disable(ab_pci); - ath11k_mhi_stop(ab_pci, is_suspend); + ath11k_mhi_stop(ab_pci); clear_bit(ATH11K_FLAG_DEVICE_INIT_DONE, &ab->dev_flags); ath11k_pci_sw_reset(ab_pci->ab, false); } @@ -970,7 +970,7 @@ static void ath11k_pci_remove(struct pci_dev *pdev) ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) { - ath11k_pci_power_down(ab, false); + ath11k_pci_power_down(ab); ath11k_debugfs_soc_destroy(ab); ath11k_qmi_deinit_service(ab); goto qmi_fail; @@ -998,7 +998,7 @@ static void ath11k_pci_shutdown(struct pci_dev *pdev) struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); - ath11k_pci_power_down(ab, false); + ath11k_pci_power_down(ab); } static __maybe_unused int ath11k_pci_pm_suspend(struct device *dev) @@ -1035,39 +1035,9 @@ static __maybe_unused int ath11k_pci_pm_resume(struct device *dev) return ret; } -static __maybe_unused int ath11k_pci_pm_suspend_late(struct device *dev) -{ - struct ath11k_base *ab = dev_get_drvdata(dev); - int ret; - - ret = ath11k_core_suspend_late(ab); - if (ret) - ath11k_warn(ab, "failed to late suspend core: %d\n", ret); - - /* Similar to ath11k_pci_pm_suspend(), we return success here - * even error happens, to allow system suspend/hibernation survive. - */ - return 0; -} - -static __maybe_unused int ath11k_pci_pm_resume_early(struct device *dev) -{ - struct ath11k_base *ab = dev_get_drvdata(dev); - int ret; - - ret = ath11k_core_resume_early(ab); - if (ret) - ath11k_warn(ab, "failed to early resume core: %d\n", ret); - - return ret; -} - -static const struct dev_pm_ops __maybe_unused ath11k_pci_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(ath11k_pci_pm_suspend, - ath11k_pci_pm_resume) - SET_LATE_SYSTEM_SLEEP_PM_OPS(ath11k_pci_pm_suspend_late, - ath11k_pci_pm_resume_early) -}; +static SIMPLE_DEV_PM_OPS(ath11k_pci_pm_ops, + ath11k_pci_pm_suspend, + ath11k_pci_pm_resume); static struct pci_driver ath11k_pci_driver = { .name = "ath11k_pci", diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index 1bc648920ab6..f477afd325de 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -2877,7 +2877,7 @@ int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab) } /* reset the firmware */ - ath11k_hif_power_down(ab, false); + ath11k_hif_power_down(ab); ath11k_hif_power_up(ab); ath11k_dbg(ab, ATH11K_DBG_QMI, "exit wait for cold boot done\n"); return 0; From patchwork Tue Sep 3 08:39:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGH04GTz1yZ9 for ; Tue, 3 Sep 2024 18:40:39 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5T-0001mp-CQ; Tue, 03 Sep 2024 08:40:31 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5N-0001WQ-QY for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:25 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id B5CC23F183 for ; Tue, 3 Sep 2024 08:40:25 +0000 (UTC) Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a8691010836so374703366b.2 for ; Tue, 03 Sep 2024 01:40:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352825; x=1725957625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uaYQpzwfOXQ011Plhuqhb1pyvRaM4QKyRWrgwSawzDI=; b=n4cPSiwB8aAF02DWH0FQm8X85WbaaUEwkHqVPbZEoEqjcbdJDyTxRTg8F262Og6iuZ AMlYxq67XcGpToeG2QqepY/f1aGTZy1bH2I+A4wVR7QdKkrTQ1/180CiaxRdxASsGS2f hSDU/zp2gkJHJ4qw1D9LY7k5l44gASLrxcGvXupiT3Pc54ZNj5TB/XCtoBnm+wzDQBr8 oyhIUhZ2UC0GACtwT/oAhG80y0tYod7uAjBECaGFsi6hs7JUOfPqdCyzjp5umPGToNIA 94mSUC59M/PEQV+ELIPiz9ugg9G7Bx4xWzDSdJNb11UWWaXKXW//x6az4vAI8DYMvtpt WOIA== X-Gm-Message-State: AOJu0Yxqh/dcGRqSJShxY7exx/3jZjGI4d23pYh9Aoa1Tj174JHpAQVY 8pkg4/mI0iSQXmH0OONWL3YdZO0l1D28XH+qNnycRHTXxf0Eul3Ccj8bImZTLiT8F+211+j+J72 qlYN0wv+f7x7IJdC3A4r0b+kMa2ljx/LI6yOfOjgX3HtRFLbgZ7pfHBp2xP3c2y4ttiMKu8c9DL TmAktqpd5i1g== X-Received: by 2002:a17:906:fd88:b0:a86:b923:4a04 with SMTP id a640c23a62f3a-a89a379cf80mr1168110866b.50.1725352825157; Tue, 03 Sep 2024 01:40:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0gGUj7AaCOtOPPvubEWmy5WA4xSELXep5S7pge8yGdDrxj7GdxLGsD6hqM2TpuWZtXv8QKA== X-Received: by 2002:a17:906:fd88:b0:a86:b923:4a04 with SMTP id a640c23a62f3a-a89a379cf80mr1168107466b.50.1725352824513; Tue, 03 Sep 2024 01:40:24 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891daeb1sm655826266b.169.2024.09.03.01.40.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:24 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 09/21] UBUNTU: SAUCE: media: ov5675: Fix power on/off delay timings Date: Tue, 3 Sep 2024 10:39:58 +0200 Message-ID: <20240903084010.3746280-10-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bryan O'Donoghue The ov5675 specification says that the gap between XSHUTDN deassert and the first I2C transaction should be a minimum of 8192 XVCLK cycles. Right now we use a usleep_rage() that gives a sleep time of between about 430 and 860 microseconds. On the Lenovo X13s we have observed that in about 1/20 cases the current timing is too tight and we start transacting before the ov5675's reset cycle completes, leading to I2C bus transaction failures. The reset racing is sometimes triggered at initial chip probe but, more usually on a subsequent power-off/power-on cycle e.g. [ 71.451662] ov5675 24-0010: failed to write reg 0x0103. error = -5 [ 71.451686] ov5675 24-0010: failed to set plls The current quiescence period we have is too tight. Instead of expressing the post reset delay in terms of the current XVCLK this patch converts the power-on and power-off delays to the maximum theoretical delay @ 6 MHz with an additional buffer. 1.365 milliseconds on the power-on path is 1.5 milliseconds with grace. 85.3 microseconds on the power-off path is 90 microseconds with grace. Fixes: 49d9ad719e89 ("media: ov5675: add device-tree support and support runtime PM") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20240713-linux-next-ov5675-v3-1-527f5b985836@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit 719ec29fceda2f19c833d2784b1574638320400f linuxtv.org/media_stage) Signed-off-by: Juerg Haefliger --- drivers/media/i2c/ov5675.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c index 3641911bc73f..5b5127f8953f 100644 --- a/drivers/media/i2c/ov5675.c +++ b/drivers/media/i2c/ov5675.c @@ -972,12 +972,10 @@ static int ov5675_set_stream(struct v4l2_subdev *sd, int enable) static int ov5675_power_off(struct device *dev) { - /* 512 xvclk cycles after the last SCCB transation or MIPI frame end */ - u32 delay_us = DIV_ROUND_UP(512, OV5675_XVCLK_19_2 / 1000 / 1000); struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov5675 *ov5675 = to_ov5675(sd); - usleep_range(delay_us, delay_us * 2); + usleep_range(90, 100); clk_disable_unprepare(ov5675->xvclk); gpiod_set_value_cansleep(ov5675->reset_gpio, 1); @@ -988,7 +986,6 @@ static int ov5675_power_off(struct device *dev) static int ov5675_power_on(struct device *dev) { - u32 delay_us = DIV_ROUND_UP(8192, OV5675_XVCLK_19_2 / 1000 / 1000); struct v4l2_subdev *sd = dev_get_drvdata(dev); struct ov5675 *ov5675 = to_ov5675(sd); int ret; @@ -1014,8 +1011,11 @@ static int ov5675_power_on(struct device *dev) gpiod_set_value_cansleep(ov5675->reset_gpio, 0); - /* 8192 xvclk cycles prior to the first SCCB transation */ - usleep_range(delay_us, delay_us * 2); + /* Worst case quiesence gap is 1.365 milliseconds @ 6MHz XVCLK + * Add an additional threshold grace period to ensure reset + * completion before initiating our first I2C transaction. + */ + usleep_range(1500, 1600); return 0; } From patchwork Tue Sep 3 08:39:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979914 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGD6nTPz1yZ9 for ; Tue, 3 Sep 2024 18:40:36 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5Q-0001ev-T0; Tue, 03 Sep 2024 08:40:28 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5P-0001bP-Nh for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:27 +0000 Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 7E3343F183 for ; Tue, 3 Sep 2024 08:40:27 +0000 (UTC) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5334573b3e6so5002274e87.2 for ; Tue, 03 Sep 2024 01:40:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352827; x=1725957627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5comwtkAPqdFIVfxpo+lt64MpGO/otvtrSpPwTdM99k=; b=cFPt1JN68ZQMZly3pyTY5HPi0gs/2yf00sLmAeSkO2qkWvIsZkIQ9L+UTB4XhXADCM pGeBIcL2OZy49hTB4TcGoLulylkQbmqYc8+hzwB7Xw+aWiogaDTAgQJJqgNDXjaZQT6f FJIXYa1slgEq1lmNpj18MhKG9KDSm+YB94+2UnjbiwMyxLEbFh179h2WS61eaOSsosj3 oxwoFsXLQU8gpMZ2pJhLzngtY0Yxa8ufldUiTqWpEZ+3MSZ8RF7aNewSBpkgqrK7K/5+ /m49HuP8s6MhoG5gUvtBorkRlsP/vXrkMaNlZSN1iorv+BSEFpj2E4EBxT8eNCqGe1Sp UaCA== X-Gm-Message-State: AOJu0YyPglaa+0xC+bJPe8E5HOSv63ZUJ0HbDb1PKy12YgaVBd1MnbeY 8TOHnCDgnb9cdHUKwAZfsNNawFF9LYSiPbnRHo4Frf1ql1VCbI94toSFL+s4OZHz1SqkumVF0Qm 8Owk/1LMd3JnqebrhOPpIVVz92VQryVScgSTYAJNp5/2WSh1KnsyKiFM8DtjEmxFilnintpoprx hWw6LU1mPFKQ== X-Received: by 2002:a05:6512:1598:b0:52f:cbce:b9b7 with SMTP id 2adb3069b0e04-53546a56c49mr8507202e87.0.1725352826740; Tue, 03 Sep 2024 01:40:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo7FpbIsVxDVWdek6tre62HmkH/vy9g+EOzBuOH/vtNGYABXrBGFLsZMeOkjfqdJ1aOk5pSw== X-Received: by 2002:a05:6512:1598:b0:52f:cbce:b9b7 with SMTP id 2adb3069b0e04-53546a56c49mr8507165e87.0.1725352825887; Tue, 03 Sep 2024 01:40:25 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8988feb453sm654347266b.36.2024.09.03.01.40.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:25 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 10/21] UBUNTU: SAUCE: media: dt-bindings: Document SC8280XP/SM8350 Venus Date: Tue, 3 Sep 2024 10:39:59 +0200 Message-ID: <20240903084010.3746280-11-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Both of these SoCs implement an IRIS2 block, with SC8280XP being able to clock it a bit higher. Document it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230731-topic-8280_venus-v1-1-8c8bbe1983a5@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit cc34bccb12f3d19bbc1878ab6d9194f515cb435f github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- .../bindings/media/qcom,sm8350-venus.yaml | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml b/Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml new file mode 100644 index 000000000000..8a31bce27c18 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml @@ -0,0 +1,149 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,sm8350-venus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SM8350 Venus video encode and decode accelerators + +maintainers: + - Konrad Dybcio + +description: | + The Venus Iris2 IP is a video encode and decode accelerator present + on Qualcomm platforms + +allOf: + - $ref: qcom,venus-common.yaml# + +properties: + compatible: + enum: + - qcom,sc8280xp-venus + - qcom,sm8350-venus + + clocks: + maxItems: 3 + + clock-names: + items: + - const: iface + - const: core + - const: vcodec0_core + + resets: + maxItems: 1 + + reset-names: + items: + - const: core + + power-domains: + maxItems: 3 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mx + + interconnects: + maxItems: 3 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + - const: video-llcc + + operating-points-v2: true + opp-table: + type: object + + iommus: + maxItems: 1 + + video-decoder: + type: object + + properties: + compatible: + const: venus-decoder + + required: + - compatible + + additionalProperties: false + + video-encoder: + type: object + + properties: + compatible: + const: venus-encoder + + required: + - compatible + + additionalProperties: false + +required: + - compatible + - power-domain-names + - iommus + - video-decoder + - video-encoder + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + #include + #include + + venus: video-codec@aa00000 { + compatible = "qcom,sm8350-venus"; + reg = <0x0aa00000 0x100000>; + interrupts = ; + + clocks = <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>; + clock-names = "iface", + "core", + "vcodec0_core"; + + resets = <&gcc GCC_VIDEO_AXI0_CLK_ARES>; + reset-names = "core"; + + power-domains = <&videocc MVS0C_GDSC>, + <&videocc MVS0_GDSC>, + <&rpmhpd SM8350_MX>; + power-domain-names = "venus", + "vcodec0", + "mx"; + + interconnects = <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_VENUS_CFG 0>, + <&mmss_noc MASTER_VIDEO_P0 0 &mc_virt SLAVE_EBI1 0>, + <&mmss_noc MASTER_VIDEO_P0 0 &gem_noc SLAVE_LLCC 0>; + interconnect-names = "cpu-cfg", + "video-mem", + "video-llcc"; + + operating-points-v2 = <&venus_opp_table>; + iommus = <&apps_smmu 0x2100 0x400>; + memory-region = <&pil_video_mem>; + + status = "disabled"; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + }; From patchwork Tue Sep 3 08:40:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979917 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGJ4cZvz1yZ9 for ; Tue, 3 Sep 2024 18:40:40 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5U-0001pu-2m; Tue, 03 Sep 2024 08:40:32 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5Q-0001ew-Vx for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:29 +0000 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id CFE7E3F183 for ; Tue, 3 Sep 2024 08:40:28 +0000 (UTC) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5334824e68dso653672e87.3 for ; Tue, 03 Sep 2024 01:40:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352828; x=1725957628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRO0qomgHJ8wlCltnBYuTX88iSvb9/OrH+vsigDdTPQ=; b=TRzqsI5EVMCQzDPFge0+SMV7HPm+iwqsGpK8xDwQFzlXbwhVOS4wmtiM+Tzn3aogkO WgdQxWSMVkUsGZN5Izx2ZC+4l9y72voIbJIhizCODc4qeJ1ReW068RgTYOcoj8N9RfKB YKppGs2ga6v/fO9plCaLakCJ89umMBqKjyAg0saj3ECBIB7gUNi+Q/HbUqDbeJ6qXEsD euPymvETzOFhDWVXxfCRbOB9SNnMADRrPZE6iK3YfnqF4hHQ/Bj3jojdvKN/jWNHlttd azt4597eC1zqhFyfrKuIasiYlqInKj/0hS8ScTacltIj3jpCOTlwpTQB7r8+Z7TYvbNi C1fQ== X-Gm-Message-State: AOJu0Yx4sLB8leUCAYCxjNwiOi9PDteTFWpqrwh37z0du66IcuxLD03W zJmTWkTtAHacNKw5O1jtU+j4YH/zsEtfXOOP9ewf6z/VubleacfCW4KnkqnNsMk6/wbViuVfx/X FqzihtYnkOClDxkGMcL7L/RxYp8BQikadGDeuIoVxSf3/cVOk31iACMDsxv1P81UseZ+GcUfP4O enUqFtj4k5Gw== X-Received: by 2002:a05:6512:124f:b0:530:e228:779c with SMTP id 2adb3069b0e04-53546b04212mr9834422e87.19.1725352827998; Tue, 03 Sep 2024 01:40:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAEi/9QYG3S7m5IERtPy1cjtx6ynI62PaS+n3jjTVlTnisGy+6OHlqBLUpP+BMyTaZbRmhBg== X-Received: by 2002:a05:6512:124f:b0:530:e228:779c with SMTP id 2adb3069b0e04-53546b04212mr9834389e87.19.1725352827263; Tue, 03 Sep 2024 01:40:27 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891d7368sm655566066b.168.2024.09.03.01.40.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:26 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 11/21] UBUNTU: SAUCE: media: venus: core: Remove trailing commas from of match entries Date: Tue, 3 Sep 2024 10:40:00 +0200 Message-ID: <20240903084010.3746280-12-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Even though it has zero effect on functionality, remove them for coherency with other drivers. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230731-topic-8280_venus-v1-2-8c8bbe1983a5@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit 2537cdf2e14b4b884791e84ea83158641f9ff95f github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/venus/core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 165c947a6703..edd35e652c92 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -933,15 +933,15 @@ static const struct venus_resources sc7280_res = { }; static const struct of_device_id venus_dt_match[] = { - { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, - { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, - { .compatible = "qcom,msm8998-venus", .data = &msm8998_res, }, - { .compatible = "qcom,sdm660-venus", .data = &sdm660_res, }, - { .compatible = "qcom,sdm845-venus", .data = &sdm845_res, }, - { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, }, - { .compatible = "qcom,sc7180-venus", .data = &sc7180_res, }, - { .compatible = "qcom,sc7280-venus", .data = &sc7280_res, }, - { .compatible = "qcom,sm8250-venus", .data = &sm8250_res, }, + { .compatible = "qcom,msm8916-venus", .data = &msm8916_res }, + { .compatible = "qcom,msm8996-venus", .data = &msm8996_res }, + { .compatible = "qcom,msm8998-venus", .data = &msm8998_res }, + { .compatible = "qcom,sdm660-venus", .data = &sdm660_res }, + { .compatible = "qcom,sdm845-venus", .data = &sdm845_res }, + { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2 }, + { .compatible = "qcom,sc7180-venus", .data = &sc7180_res }, + { .compatible = "qcom,sc7280-venus", .data = &sc7280_res }, + { .compatible = "qcom,sm8250-venus", .data = &sm8250_res }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match); From patchwork Tue Sep 3 08:40:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979918 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGK309vz1yZ9 for ; Tue, 3 Sep 2024 18:40:41 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5U-0001s8-OB; Tue, 03 Sep 2024 08:40:32 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5S-0001kU-Au for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:30 +0000 Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 23D9D3F215 for ; Tue, 3 Sep 2024 08:40:30 +0000 (UTC) Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-5344b7df784so5595448e87.1 for ; Tue, 03 Sep 2024 01:40:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352829; x=1725957629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vYkMe2gent94zL4Y7bPSZDFb5VFRbCWn9umlVgfwQc4=; b=lBuLtKEBnDfexZbn3/cJCLCrTnCQrn/IJrBkfVF4gCFJTQvnF3pwnIyKO2Zeg3/dcI NCdOWyQzE/5bgMqNOv03QyVKdBLirTNpghwtv6Px6GFCSV8DGO73wVFC73tYoHCV7Bj/ EZupl0XRsWU6OuF3Raf2j7ODz21j2ydLKK9jZBnRIG4o81sjADF+CdSX8VEXyjuAthlo 95JQ1vZYFU3pc5rYxfebD0mOq8mNVWuixa/nMyKqRgKSrHKsddXk1GbxYWmchSNtBr5u oZEBSOxke6BSZaw3bWUtF+Sn2rNU7QbmYOwdF3ceotZ6ET+cJsuruWisaQL7z7NagX2K Ykfw== X-Gm-Message-State: AOJu0Yy/A+yd0BljfCd3sbm6CtNnGvwyaUzqtSheaQVcncqYPgbnmtcX UEM/HdIIMfH06eM3agDj1U5dYWodSZj74Gv8E4UYbw0vEPgBar8pR55FpA2d1tqcf4BJLd4VElh 8MB0je+sIFyH0gXwzWaszrdV7OdXTS/4ga2UnyoWTh/zX0DrjbrRKG5pDafNiXESskBDscJSAf9 /hkzE3f7CXoQ== X-Received: by 2002:a05:6512:3d24:b0:52e:a68a:6076 with SMTP id 2adb3069b0e04-53546bb4d0fmr9904055e87.49.1725352829394; Tue, 03 Sep 2024 01:40:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGl2EcUpAQTd0si8cFQECnwolcWg/MrbFUpvIC5oRwF798IqSoas3QePlUWkRqD76nEDVuUQ== X-Received: by 2002:a05:6512:3d24:b0:52e:a68a:6076 with SMTP id 2adb3069b0e04-53546bb4d0fmr9904013e87.49.1725352828531; Tue, 03 Sep 2024 01:40:28 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226ce9722sm6494699a12.96.2024.09.03.01.40.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:28 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 12/21] UBUNTU: SAUCE: media: venus: hfi_venus: Support only updating certain bits with presets Date: Tue, 3 Sep 2024 10:40:01 +0200 Message-ID: <20240903084010.3746280-13-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio On some platforms (like SM8350) we're expected to only touch certain bits (such as 0 and 4 corresponding to mask 0x11). Add support for doing so. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230731-topic-8280_venus-v1-3-8c8bbe1983a5@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit 0e1ff5c0f65d549776a4fdb8682a760b250fc42c github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/hfi_venus.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 55202b89e1b9..b4e60243e0ae 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -37,6 +37,7 @@ struct freq_tbl { struct reg_val { u32 reg; u32 value; + u32 mask; }; struct bw_tbl { diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f9437b6412b9..76eeb371263f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -359,10 +359,19 @@ static void venus_set_registers(struct venus_hfi_device *hdev) const struct venus_resources *res = hdev->core->res; const struct reg_val *tbl = res->reg_tbl; unsigned int count = res->reg_tbl_size; - unsigned int i; + unsigned int i, val; + + for (i = 0; i < count; i++) { + val = tbl[i].value; - for (i = 0; i < count; i++) - writel(tbl[i].value, hdev->core->base + tbl[i].reg); + /* In some cases, we only want to update certain bits */ + if (tbl[i].mask) { + val = readl(hdev->core->base + tbl[i].reg); + val = (val & ~tbl[i].mask) | (tbl[i].value & tbl[i].mask); + } + + writel(val, hdev->core->base + tbl[i].reg); + } } static void venus_soft_int(struct venus_hfi_device *hdev) From patchwork Tue Sep 3 08:40:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGK6HY3z1ygj for ; Tue, 3 Sep 2024 18:40:41 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5V-0001uv-JP; Tue, 03 Sep 2024 08:40:33 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5U-0001pa-20 for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:32 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 871313F215 for ; Tue, 3 Sep 2024 08:40:31 +0000 (UTC) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c24b4a57b4so1663988a12.2 for ; Tue, 03 Sep 2024 01:40:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352831; x=1725957631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KI9jBNVK7OxQKg7CCPcfEggj1puTxJltTA2Nx/SDo7k=; b=fgihxFVYSI4E4AvYXpIyYiCzTtH4aRGcT5VjKDg0xfylNhQJntDDvFP1cOD7G+wUk6 8qIXnZxaxDof8lRxzJ8zT+I/rdI/nQ7cE1t7PUl8RXM5wuGhXNUdxgvYL4VNIxX3Yvvb tcrlNfnpWd6W417hGP7KUmkYm7xBVHXOWig5zMdICLRM8t19EvIQfOifV02tmg/lVunw X1Eg9fnmkNQyD/V+z7j95JUSEpUdrb6QRiVjTVjMnhEO2VqvuABsW6Wcw876CD8wc7PA 916hXkwKWwmTHLaEXj0GcSVODdvIn6ktj5OVpqlPUN8lT6xcfrnxsBf13gyRzMkPuiKM LN/A== X-Gm-Message-State: AOJu0YyRGpvKT08foskM1y1HDdopOj0hE+4rHNvkqGa5/UIk98Ekb4i9 eYHk09KobyvG8GDEjiweo7jmjpiSPrCfHRsFLQiLtk//j4AmLNyPHvroydoxVjBN/C5Y3XMnUM9 ncmXrzDLVdRazOY7w91A5hvtEUVZbZTEuG7m4g6Y3K3TZbbkyzixDifFHtFLvAgN8HjB+DP33zF xj+mKfEOanBg== X-Received: by 2002:a05:6402:2695:b0:5bf:257f:9ee5 with SMTP id 4fb4d7f45d1cf-5c21ed9fd2emr11070065a12.34.1725352831060; Tue, 03 Sep 2024 01:40:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrxtRq+CCGHufED677sxpSrdO8nP1f3SkamOJo/7DZtOX5mERN72qGg2rRGXJRhlBrli321Q== X-Received: by 2002:a05:6402:2695:b0:5bf:257f:9ee5 with SMTP id 4fb4d7f45d1cf-5c21ed9fd2emr11070031a12.34.1725352830224; Tue, 03 Sep 2024 01:40:30 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c6a437sm6152200a12.20.2024.09.03.01.40.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:29 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 13/21] UBUNTU: SAUCE: media: platform: venus: Add optional LLCC path Date: Tue, 3 Sep 2024 10:40:02 +0200 Message-ID: <20240903084010.3746280-14-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Some newer SoCs (such as SM8350) have a third interconnect path. Add it and make it optional. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230731-topic-8280_venus-v1-4-8c8bbe1983a5@linaro.org Signed-off-by: Johan Hovold (cherry picked from commit 9d5b86b703b1b8c7ff1d1496fe4be450cc1696b9 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/venus/core.c | 19 +++++++++++++++++++ drivers/media/platform/qcom/venus/core.h | 3 +++ .../media/platform/qcom/venus/pm_helpers.c | 3 +++ 3 files changed, 25 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index edd35e652c92..ff2b5468f85a 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -309,6 +309,15 @@ static int venus_probe(struct platform_device *pdev) if (IS_ERR(core->cpucfg_path)) return PTR_ERR(core->cpucfg_path); + core->llcc_path = devm_of_icc_get(dev, "video-llcc"); + if (IS_ERR(core->llcc_path)) { + /* LLCC path is optional */ + if (PTR_ERR(core->llcc_path) == -ENODATA) + core->llcc_path = NULL; + else + return PTR_ERR(core->llcc_path); + } + core->irq = platform_get_irq(pdev, 0); if (core->irq < 0) return core->irq; @@ -486,12 +495,18 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev) if (ret) goto err_cpucfg_path; + ret = icc_set_bw(core->llcc_path, 0, 0); + if (ret) + goto err_llcc_path; + ret = icc_set_bw(core->video_path, 0, 0); if (ret) goto err_video_path; return ret; +err_llcc_path: + icc_set_bw(core->video_path, kbps_to_icc(20000), 0); err_video_path: icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0); err_cpucfg_path: @@ -511,6 +526,10 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) if (ret) return ret; + ret = icc_set_bw(core->llcc_path, kbps_to_icc(20000), 0); + if (ret) + return ret; + ret = icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0); if (ret) return ret; diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index b4e60243e0ae..90a06c283cc8 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -64,6 +64,7 @@ struct venus_resources { unsigned int bw_tbl_enc_size; const struct bw_tbl *bw_tbl_dec; unsigned int bw_tbl_dec_size; + bool has_llcc_path; const struct reg_val *reg_tbl; unsigned int reg_tbl_size; const struct hfi_ubwc_config *ubwc_conf; @@ -133,6 +134,7 @@ struct venus_format { * @vcodec1_clks: an array of vcodec1 struct clk pointers * @video_path: an interconnect handle to video to/from memory path * @cpucfg_path: an interconnect handle to cpu configuration path + * @llcc_path: an interconnect handle to video to/from llcc path * @has_opp_table: does OPP table exist * @pmdomains: a pointer to a list of pmdomains * @opp_dl_venus: an device-link for device OPP @@ -187,6 +189,7 @@ struct venus_core { struct clk *vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX]; struct icc_path *video_path; struct icc_path *cpucfg_path; + struct icc_path *llcc_path; bool has_opp_table; struct dev_pm_domain_list *pmdomains; struct device_link *opp_dl_venus; diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 4ce76ce6dd4d..9c5852d3fb92 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -237,6 +237,9 @@ static int load_scale_bw(struct venus_core *core) dev_dbg(core->dev, VDBGL "total: avg_bw: %u, peak_bw: %u\n", total_avg, total_peak); + if (core->res->has_llcc_path) + icc_set_bw(core->llcc_path, total_avg, total_peak); + return icc_set_bw(core->video_path, total_avg, total_peak); } From patchwork Tue Sep 3 08:40:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGP2LT6z1yZ9 for ; Tue, 3 Sep 2024 18:40:45 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5Y-00027o-W0; Tue, 03 Sep 2024 08:40:37 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5V-0001tN-4d for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:33 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id AF7573F183 for ; Tue, 3 Sep 2024 08:40:32 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a86915aeb32so397169966b.3 for ; Tue, 03 Sep 2024 01:40:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352832; x=1725957632; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Er7m1djo63W153vd5+KWblLOVuygdWd4JKynELejLkk=; b=iQ7AcGyiyCpDf4hoqtWufgmn0/2x+gUlUZD9ZSbmotRBXlieQyL8TQMC2AdIUFHxAI OLGQRyvAhR1GcYwdcgfldBDoi5+osF4eSdz2d1wW9ho6gZdgWgw//1bofSEwvQ6ykr0c M/dHV1QMJ81U4F28wINvdHdV1npEmsRv9mow3DTxQ7NX8U119gQdyIWP86o7RFAT6LPM d2UVxKDjv+IvqqJobOhQ/5R9ukJ18uoL6c0fIXpmiakFw+zMOTpfvNtzcjK3E9R7uW9d Y7kV5rJSM9ZGlEgOWt+e7jwB51XUHuxjSNEXm4MZbrbchRHZt8FqLcgIzQdL2kINiTLv otBw== X-Gm-Message-State: AOJu0YzBn+mYlTesRxWjsA/uMHw4Xf53qP1k1FdBG3mOq2ih8Qrb04HR 8/0U2PtZiBTxqEU+CIhWdLDqdpC6yLO7bYnICqauQBmMKA36F8Y3s8knmtHEtKOH7GLULm9DqqY KOSj8pAEOR9LMDFZBUPdaRXGYok+hFlEI5Bs96dGdncOZ/TmnsmcgsBjRGlWG7uNE5XpqMrXSaI pKuLN+njOgEQ== X-Received: by 2002:a17:907:a4e:b0:a77:eb34:3b4e with SMTP id a640c23a62f3a-a89fad7b7cemr465645366b.7.1725352832283; Tue, 03 Sep 2024 01:40:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKduSQPhA2bnzaLWNWQhgfF6uKQ75Y2tHUnfhCeiQ6wG+MWr6bSnLHKKewmhqLMaV7SLaJ/Q== X-Received: by 2002:a17:907:a4e:b0:a77:eb34:3b4e with SMTP id a640c23a62f3a-a89fad7b7cemr465642666b.7.1725352831523; Tue, 03 Sep 2024 01:40:31 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a898922295csm652335266b.198.2024.09.03.01.40.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:31 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 14/21] UBUNTU: SAUCE: media: venus: core: Add SM8350 resource struct Date: Tue, 3 Sep 2024 10:40:03 +0200 Message-ID: <20240903084010.3746280-15-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Add SM8350 configuration data and related compatible. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230731-topic-8280_venus-v1-5-8c8bbe1983a5@linaro.org [ johan: rebase on 6.9-rc1; convert vcodec_pmdomains ] Signed-off-by: Johan Hovold (cherry picked from commit 940eaf1bc7e068cd7a9778a211957ce3a1cfc8b7 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/venus/core.c | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index ff2b5468f85a..3d99fa9c1d21 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -889,6 +889,44 @@ static const struct venus_resources sm8250_res = { .fwname = "qcom/vpu-1.0/venus.mbn", }; +static const struct reg_val sm8350_reg_preset[] = { + { 0xb0088, 0, 0x11 }, +}; + +static const struct venus_resources sm8350_res = { + .freq_tbl = sm8250_freq_table, + .freq_tbl_size = ARRAY_SIZE(sm8250_freq_table), + .reg_tbl = sm8350_reg_preset, + .reg_tbl_size = ARRAY_SIZE(sm8350_reg_preset), + .bw_tbl_enc = sm8250_bw_table_enc, + .bw_tbl_enc_size = ARRAY_SIZE(sm8250_bw_table_enc), + .bw_tbl_dec = sm8250_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sm8250_bw_table_dec), + .clks = { "core", "iface" }, + .clks_num = 2, + .resets = { "core" }, + .resets_num = 1, + .vcodec0_clks = { "vcodec0_core" }, + .vcodec_clks_num = 1, + .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, + .vcodec_pmdomains_num = 2, + .opp_pmdomain = (const char *[]) { "mx", NULL }, + .vcodec_num = 1, + .max_load = 7833600, /* 7680x4320@60fps */ + .hfi_version = HFI_VERSION_6XX, + .vpu_version = VPU_VERSION_IRIS2, + .num_vpp_pipes = 4, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = GENMASK(31, 29) - 1, + .cp_start = 0, + .cp_size = 0x25800000, + .cp_nonpixel_start = 0x1000000, + .cp_nonpixel_size = 0x24800000, + .fwname = "qcom/vpu-2.0/venus.mbn", +}; + static const struct freq_tbl sc7280_freq_table[] = { { 0, 460000000 }, { 0, 424000000 }, @@ -961,6 +999,7 @@ static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,sc7180-venus", .data = &sc7180_res }, { .compatible = "qcom,sc7280-venus", .data = &sc7280_res }, { .compatible = "qcom,sm8250-venus", .data = &sm8250_res }, + { .compatible = "qcom,sm8350-venus", .data = &sm8350_res }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match); From patchwork Tue Sep 3 08:40:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979922 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGP60dwz1ygj for ; Tue, 3 Sep 2024 18:40:45 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5Z-00028m-7G; Tue, 03 Sep 2024 08:40:37 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5W-0001zU-Od for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:34 +0000 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 8395E3F183 for ; Tue, 3 Sep 2024 08:40:34 +0000 (UTC) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-53440ff1ecfso5328337e87.3 for ; Tue, 03 Sep 2024 01:40:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352834; x=1725957634; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9bQKU86Hm2BDi5PpHvmdAadCboYXHnySN3xuZzsGPxE=; b=siPJ3/VPybdPf7C6mksxVHIwjXC+k6KmpKmRNhV5TIm93otcj5zWzwK35okIAU45RE C9yab8QeF25p19/+57dUcOv1OkN4d6wm9B66kDTcz7yGxHhXFm/yBujtRpz/9MSiSMGy /aMJHM2Y8YkCF5DcEDu5d+cxMFvGLmOtx+ybAqtThsSmI2lbTTeSWV3Ce65jX9nKT3l5 ukg/Az3fp9VuQiz1U6Xc5pGdpXa7VYOjcKocUTzbjMHzMVbeaYxLbcRz6nmHVp5jNF84 bqXNzxqtLmvZI1Fsedy+zyKuO43TeR/+36bSG8MhdIZGKbZEaRa+QK4YUuTL8Kjv/BC/ 2Hpw== X-Gm-Message-State: AOJu0YwpE19IYxXMqo4iPogaEw/kF2aZaXK1JDLne9A8TBNKZrSFK1xn WNwX/STZ/QcEKYEojyNlaMDMZGv1ODu9GveGscl0GKLn5SI98gc77Yw+0Wx97sBvcFsK1a54DA4 gzsV6J5rIMm8tHS2siSYN7FgjtPKeJKPtYr6Qwv8n86wewQSej6y1sVRm/pUll6ORKtV9IyXP2I Y+XkQGRSQctg== X-Received: by 2002:a05:6512:39d0:b0:533:44e8:5565 with SMTP id 2adb3069b0e04-53546b8d88cmr8810185e87.46.1725352833735; Tue, 03 Sep 2024 01:40:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2Ytphdff0W1IQqao2fQVThMDKooeJRlP/FrFuU1BWBsSBVyD5nMCIEAAfYPl8CebK4l6tDw== X-Received: by 2002:a05:6512:39d0:b0:533:44e8:5565 with SMTP id 2adb3069b0e04-53546b8d88cmr8810145e87.46.1725352832912; Tue, 03 Sep 2024 01:40:32 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a898919fcb4sm655957966b.132.2024.09.03.01.40.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:32 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 15/21] UBUNTU: SAUCE: media: venus: core: Add SC8280XP resource struct Date: Tue, 3 Sep 2024 10:40:04 +0200 Message-ID: <20240903084010.3746280-16-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Add SC8280XP configuration data and related compatible. Signed-off-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230731-topic-8280_venus-v1-6-8c8bbe1983a5@linaro.org [ johan: rebase on 6.9-rc1; convert vcodec_pmdomains ] Signed-off-by: Johan Hovold (cherry picked from commit 6e5c9e63424b63a57df814041709c1bdff1c690e github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/media/platform/qcom/venus/core.c | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 3d99fa9c1d21..75af4aff014c 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -989,6 +989,50 @@ static const struct venus_resources sc7280_res = { .fwname = "qcom/vpu-2.0/venus.mbn", }; +static const struct freq_tbl sc8280xp_freq_table[] = { + { 0, 239999999 }, + { 0, 338000000 }, + { 0, 366000000 }, + { 0, 444000000 }, + { 0, 533000000 }, + { 0, 560000000 }, +}; + +static const struct venus_resources sc8280xp_res = { + .freq_tbl = sc8280xp_freq_table, + .freq_tbl_size = ARRAY_SIZE(sc8280xp_freq_table), + .reg_tbl = sm8350_reg_preset, + .reg_tbl_size = ARRAY_SIZE(sm8350_reg_preset), + .bw_tbl_enc = sm8250_bw_table_enc, + .bw_tbl_enc_size = ARRAY_SIZE(sm8250_bw_table_enc), + .bw_tbl_dec = sm8250_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sm8250_bw_table_dec), + .clks = { "core", "iface" }, + .clks_num = 2, + .resets = { "core" }, + .resets_num = 1, + .vcodec0_clks = { "vcodec0_core" }, + .vcodec_clks_num = 1, + .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, + .vcodec_pmdomains_num = 2, + .opp_pmdomain = (const char *[]) { "mx", NULL }, + .vcodec_num = 1, + .max_load = 7833600, /* 7680x4320@60fps */ + .hfi_version = HFI_VERSION_6XX, + .vpu_version = VPU_VERSION_IRIS2, + .num_vpp_pipes = 4, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = GENMASK(31, 29) - 1, + .cp_start = 0, + .cp_size = 0x25800000, + .cp_nonpixel_start = 0x1000000, + .cp_nonpixel_size = 0x24800000, + .fwname = "qcom/vpu-2.0/venus.mbn", +}; + + static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,msm8916-venus", .data = &msm8916_res }, { .compatible = "qcom,msm8996-venus", .data = &msm8996_res }, @@ -998,6 +1042,7 @@ static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2 }, { .compatible = "qcom,sc7180-venus", .data = &sc7180_res }, { .compatible = "qcom,sc7280-venus", .data = &sc7280_res }, + { .compatible = "qcom,sc8280xp-venus", .data = &sc8280xp_res }, { .compatible = "qcom,sm8250-venus", .data = &sm8250_res }, { .compatible = "qcom,sm8350-venus", .data = &sm8350_res }, { } From patchwork Tue Sep 3 08:40:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGR6Tc8z1yZ9 for ; Tue, 3 Sep 2024 18:40:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5b-0002HL-EE; Tue, 03 Sep 2024 08:40:39 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5X-000242-Qf for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:35 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 9D1AD3F183 for ; Tue, 3 Sep 2024 08:40:35 +0000 (UTC) Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a7d2d414949so425219566b.0 for ; Tue, 03 Sep 2024 01:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352835; x=1725957635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nNUgM2rdCtrz2kvDVakA6YBoUsXQNd2CxjH+Dg7kg0s=; b=PR/hKRS+DpSULi5KQa39B6tXYkdSgeHjSIYBfCcQaj2S+NAraKclNtvbdlrVjCVq1R N9QwPHmAsH7EYmmQNs2sjm16PPWxsFb9txw4+DznPvCpHGrAc3607XPQMThL1qLZNRRO BWCc8C2g7xf9ROa/ph1q5GUJ1X8V9Nzw7FQ/MIfRG/QY+zC3YosmDSW7k4iXIKE5sOvX eiFs9WwfpKADiKoGXhyqtm6S4kvroFoAPtmTMUKLijg5rzK4CW3inXnmgK5KeOikqbBi lFqOlnaYsm62Payjceb733TeTyJE3gtm+FIbQQ/veE52FC02P71k5pPUjy3f2cXrTzU7 z37A== X-Gm-Message-State: AOJu0YyWgPuN40oah16zgQoS+lU5qgP5daENJjG8LRO2k5WuRMn2zgTz yJcSjlxc+iwc3GHatSaL0DUiIX7iXeeaAJTeQvZ73sSpZwL6DICZF3aDxHiPGuCqmE+uZ1/dZe2 Uv0Lcl+3GQ+NvFb6wlFcAgFwxpCl4qyrfhNuYlKsHqsndOjA4Jlkggj3ts8mMJ4a9put4HcZ9jS Z/GtuPDikZLA== X-Received: by 2002:a17:907:2d0a:b0:a86:acdd:8238 with SMTP id a640c23a62f3a-a897fad7de6mr1195293866b.67.1725352835200; Tue, 03 Sep 2024 01:40:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEI+sqeN8ECTSgzKJEXH9S3LeRSK/2VjnVyISoJo9cSlzGpHNIl+m6Dhipn/Ba5p5YMK3kvMA== X-Received: by 2002:a17:907:2d0a:b0:a86:acdd:8238 with SMTP id a640c23a62f3a-a897fad7de6mr1195290066b.67.1725352834271; Tue, 03 Sep 2024 01:40:34 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a898900f6c4sm656610066b.68.2024.09.03.01.40.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:33 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 16/21] UBUNTU: SAUCE: arm64: dts: qcom: sc8280xp: Add Venus Date: Tue, 3 Sep 2024 10:40:05 +0200 Message-ID: <20240903084010.3746280-17-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Add the required nodes to enable Venus on sc8280xp. Signed-off-by: Konrad Dybcio [ johan: use sm8350 videocc defines ] Signed-off-by: Johan Hovold (cherry picked from commit 999ef9bc8caf4487e45f843d6c744deb533bb0a0 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi index 80a57aa22839..14c3b1d6ad47 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -690,6 +691,11 @@ reserved-region@85b00000 { no-map; }; + pil_video_mem: pil_video_region@86700000 { + reg = <0 0x86700000 0 0x500000>; + no-map; + }; + pil_adsp_mem: adsp-region@86c00000 { reg = <0 0x86c00000 0 0x2000000>; no-map; @@ -3675,6 +3681,86 @@ usb_1_dwc3_ss: endpoint { }; }; + venus: video-codec@aa00000 { + compatible = "qcom,sm8350-venus"; + reg = <0 0x0aa00000 0 0x100000>; + interrupts = ; + + clocks = <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>; + clock-names = "iface", + "core", + "vcodec0_core"; + power-domains = <&videocc MVS0C_GDSC>, + <&videocc MVS0_GDSC>, + <&rpmhpd SC8280XP_MX>; + power-domain-names = "venus", + "vcodec0", + "mx"; + + resets = <&gcc GCC_VIDEO_AXI0_CLK_ARES>; + reset-names = "core"; + + interconnects = <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_VENUS_CFG 0>, + <&mmss_noc MASTER_VIDEO_P0 0 &mc_virt SLAVE_EBI1 0>, + <&mmss_noc MASTER_VIDEO_P0 0 &gem_noc SLAVE_LLCC 0>; + interconnect-names = "cpu-cfg", + "video-mem", + "video-llcc"; + + operating-points-v2 = <&venus_opp_table>; + iommus = <&apps_smmu 0x2e00 0x400>; + memory-region = <&pil_video_mem>; + + status = "disabled"; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + + venus_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-720000000 { + opp-hz = /bits/ 64 <720000000>; + required-opps = <&rpmhpd_opp_low_svs>; + }; + + opp-1014000000 { + opp-hz = /bits/ 64 <1014000000>; + required-opps = <&rpmhpd_opp_svs>; + }; + + opp-1098000000 { + opp-hz = /bits/ 64 <1098000000>; + required-opps = <&rpmhpd_opp_svs_l1>; + }; + + opp-1332000000 { + opp-hz = /bits/ 64 <1332000000>; + required-opps = <&rpmhpd_opp_nom>; + }; + }; + }; + + videocc: clock-controller@abf0000 { + compatible = "qcom,sc8280xp-videocc"; + reg = <0 0x0abf0000 0 0x10000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&rpmhcc RPMH_CXO_CLK_A>, + <&sleep_clk>; + power-domains = <&rpmhpd SC8280XP_MMCX>; + required-opps = <&rpmhpd_opp_low_svs>; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; + cci0: cci@ac4a000 { compatible = "qcom,sc8280xp-cci", "qcom,msm8996-cci"; reg = <0 0x0ac4a000 0 0x1000>; From patchwork Tue Sep 3 08:40:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979924 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGS5S2dz1ygj for ; Tue, 3 Sep 2024 18:40:48 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5b-0002Hu-KX; Tue, 03 Sep 2024 08:40:39 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5Z-00028O-5F for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:37 +0000 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id EDC7F3FA91 for ; Tue, 3 Sep 2024 08:40:36 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-374c90d24e3so1793389f8f.0 for ; Tue, 03 Sep 2024 01:40:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352836; x=1725957636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X8/OYNWKpbv2VnnOJu+YzSF5VtH2KWNd1DyQ+hlGXAw=; b=pqd+ZjRU+DFM/IDUsCeiJK1AlshcAX0WEmerZMoN8Nqhp89bc7pmGLxCTZzpN8BRGm dlEg3EcnTP3h1+6ObOPSAoEizI32smLxQ6kCF69sCGpWsrc4zaKOJsE9S3STQ007hEFV s4w6dGr8B0aio1vh9pLh2qwYY1dgrTvC76+wjKeETPyxgN5kQuvIkEIxOAUgyVEaf4o6 xb2ng1sE6yG8c67gzwjlUnmap5GxXkKmRCu+b4/JAH9Z/DjUJ5PpC6efqvhGbep/XLot mQHaM750GHiqJeCT4H9tFuG2LLZG4ZV7+EOdqxgiZ1Uq5e4xAkIemtewTxxkBHg3aELb /9rQ== X-Gm-Message-State: AOJu0Yz9piA4bi6AJphYIx44Aqs/aN2I2c35Wl1GFukHI9Mej34mv+JM PQGkFtfeOwpIMmPen6WT8E1cUwwyqTzTBLcKQneny8+dpcMuSLUQRnGpdsSCOP+N53LV++iLFHm BJdNbegTYO6a/ZmRhPLdnXO6LrtkzZLorzPNZCR/ZtpLv2OqKZrfnSeCg47WNo0T4Y+jaq068Xl pHiscf0Z1xVQ== X-Received: by 2002:a05:6000:c8e:b0:367:9903:a91 with SMTP id ffacd0b85a97d-3749b526808mr13547349f8f.11.1725352836515; Tue, 03 Sep 2024 01:40:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyArgnMXfZ9MGEL+2/0c3ssYOnQblXV5f9rLrKluUenZ/0GmyWDOdbrYbOZBisc12DHoVL4A== X-Received: by 2002:a05:6000:c8e:b0:367:9903:a91 with SMTP id ffacd0b85a97d-3749b526808mr13547324f8f.11.1725352835743; Tue, 03 Sep 2024 01:40:35 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89890090a1sm654828666b.49.2024.09.03.01.40.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:35 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 17/21] UBUNTU: SAUCE: arm64: dts: qcom: sc8280xp-x13s: Enable Venus Date: Tue, 3 Sep 2024 10:40:06 +0200 Message-ID: <20240903084010.3746280-18-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Konrad Dybcio Enable Venus and point the driver to the correct firmware file. Signed-off-by: Konrad Dybcio Signed-off-by: Johan Hovold (cherry picked from commit dba1b20213a99e1fb5c3b50e69207e0245a56321 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index 6a28cab97189..e7a9d41fa9b6 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -1410,6 +1410,11 @@ &vamacro { status = "okay"; }; +&venus { + firmware-name = "qcom/sc8280xp/LENOVO/21BX/qcvss8280.mbn"; + status = "okay"; +}; + &wsamacro { status = "okay"; }; From patchwork Tue Sep 3 08:40:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGV3k0vz1yZ9 for ; Tue, 3 Sep 2024 18:40:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5e-0002Sq-4H; Tue, 03 Sep 2024 08:40:42 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5a-0002ET-IG for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:38 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 63F093F283 for ; Tue, 3 Sep 2024 08:40:38 +0000 (UTC) Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a868403dbdeso375889766b.1 for ; Tue, 03 Sep 2024 01:40:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352838; x=1725957638; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yC0GNRrjeoHfQR5ni1JMUj1hLuN5w54/YBod5tHcOv4=; b=Xofb8B2TdpxQrTWXpUttTtSrezy/gaXICwQHZI7D4hKNaEBhczykZ0LBkBK+d9uiNr eY8aoVT59dTXMiIzS4h89xZ5xteDwXZ8Ed+t7fVLURhS+ZT/4s0ZJY07/6RMPKyXpsDs ueM2WEqRsAOR/U81YIELlBTiuESmf4NgD3vtT7MjVRcNCM+jO55JWDuQsD6uiqwiQIZU M4pdImQS/VIMjqiX0ym+sSyeBXeXjKIeCHynwSMZIAduIvIA/Z/gECFHzw9lg8UvJMSK dCAfchfy2WlTU2c3ozB4rZnHbVt0tOwGsU00nknLqFYXn4Tl5jX3nJ626kR4xIj9UHlk ZVbg== X-Gm-Message-State: AOJu0YyuM5O+PFqS8h+o4wTaNWLVbTcU2tJy5rfNjQboCTH8mEO5OpUq KuhKoPIw2mW/2r/xWPoBX1GxUINR/zExH2dsckllYvQkXpMi/Tmmvr2p0kPihF3qRn8pYKMyIpK K9+o0kWDol/1uYXVC8kSK/P2JIBmjDnrs+rnEXHX+aZPkqL9bKf2s8XgFQWeDvbFXoa1Gojf/Y0 IVa468iPA4oA== X-Received: by 2002:a17:907:7251:b0:a86:7c5d:1856 with SMTP id a640c23a62f3a-a897fa744a8mr1456684566b.46.1725352837832; Tue, 03 Sep 2024 01:40:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3NSfhmbAc0GElp17JIC83lx98W6dyJOYjQsJQX+Un5DRIb9ztrYrg+fzuBNYZZG3ivGN2Bg== X-Received: by 2002:a17:907:7251:b0:a86:7c5d:1856 with SMTP id a640c23a62f3a-a897fa744a8mr1456681066b.46.1725352836999; Tue, 03 Sep 2024 01:40:36 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8988feb112sm660012966b.39.2024.09.03.01.40.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:36 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 18/21] UBUNTU: SAUCE: phy: qcom-qmp-combo: drop regulator loads Date: Tue, 3 Sep 2024 10:40:07 +0200 Message-ID: <20240903084010.3746280-19-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Johan Hovold Drivers should not be specifying active-mode regulator loads unless supporting an idle mode where the load is reduced during runtime. This effectively reverts commit 85936d4f3815 ("phy: qcom-qmp: add regulator_set_load to dp phy"). Link: https://lore.kernel.org/r/YuPps+cvVAMugWmy@sirena.org.uk Signed-off-by: Johan Hovold (cherry picked from commit 85f127f537adb8886e5caeb72a78d4aa15049708 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 40 +++++------------------ 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 7b00945f7191..3d3e68aa0774 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -1425,17 +1425,6 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_usb_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), }; -/* list of regulators */ -struct qmp_regulator_data { - const char *name; - unsigned int enable_load; -}; - -static struct qmp_regulator_data qmp_phy_vreg_l[] = { - { .name = "vdda-phy", .enable_load = 21800 }, - { .name = "vdda-pll", .enable_load = 36000 }, -}; - static const u8 qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = { { 0x00, 0x0c, 0x15, 0x1a }, { 0x02, 0x0e, 0x16, 0xff }, @@ -1591,7 +1580,7 @@ struct qmp_phy_cfg { const char * const *reset_list; int num_resets; /* regulators to be requested */ - const struct qmp_regulator_data *vreg_list; + const char * const *vreg_list; int num_vregs; /* array of registers with different offsets */ @@ -1700,6 +1689,11 @@ static const char * const sc7180_usb3phy_reset_l[] = { "phy", }; +/* list of regulators */ +static const char * const qmp_phy_vreg_l[] = { + "vdda-phy", "vdda-pll", +}; + static const struct qmp_combo_offsets qmp_combo_offsets_v3 = { .com = 0x0000, .txa = 0x1200, @@ -3090,32 +3084,16 @@ static int qmp_combo_vreg_init(struct qmp_combo *qmp) const struct qmp_phy_cfg *cfg = qmp->cfg; struct device *dev = qmp->dev; int num = cfg->num_vregs; - int ret, i; + int i; qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); if (!qmp->vregs) return -ENOMEM; for (i = 0; i < num; i++) - qmp->vregs[i].supply = cfg->vreg_list[i].name; + qmp->vregs[i].supply = cfg->vreg_list[i]; - ret = devm_regulator_bulk_get(dev, num, qmp->vregs); - if (ret) { - dev_err(dev, "failed at devm_regulator_bulk_get\n"); - return ret; - } - - for (i = 0; i < num; i++) { - ret = regulator_set_load(qmp->vregs[i].consumer, - cfg->vreg_list[i].enable_load); - if (ret) { - dev_err(dev, "failed to set load at %s\n", - qmp->vregs[i].supply); - return ret; - } - } - - return 0; + return devm_regulator_bulk_get(dev, num, qmp->vregs); } static int qmp_combo_reset_init(struct qmp_combo *qmp) From patchwork Tue Sep 3 08:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGW4g6Hz1yZ9 for ; Tue, 3 Sep 2024 18:40:51 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5f-0002W2-5q; Tue, 03 Sep 2024 08:40:43 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5c-0002MI-Jb for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:40 +0000 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 41F753F215 for ; Tue, 3 Sep 2024 08:40:40 +0000 (UTC) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5334344ae21so5235698e87.3 for ; Tue, 03 Sep 2024 01:40:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352839; x=1725957639; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ld2SAIgBFM8QszzjcKz85mz//1wPZYumnTgh/FUypSA=; b=EaHlmmUrf3zW+ICtQMHfd2GFoOOW5tNZp2p5KlGJQfP492PVTxB8FCUCeQZFPG0Fzm cldhqE6OvXl3AjvELw7klanjT9UDj/bGj03zh2VX4/IRSLYyyKpKt2Vucvqo8Qo2XdWX mbUdwb87/ZNHwe66xV/eMhDBBR7AHw+0PlgWcSJz7//+qwu1RfisVz1MUAl+BCXp6mM6 4aIc4J2PB6jvm4+1AHSljDxR0UAkXgYPToJa2bG+vn9n/XMXNoUhbwOLc9vLo1mx7kYz 1OoRs4BL1Twc3XdefSAn/DtuJ/3XVVAZIlp8B8H+Vgv537fy6gVtLp6NOtmXBN4ub7fC HwlA== X-Gm-Message-State: AOJu0Yy992EA8YTPOK3C1N8So80S2c8/hctoo91fsppZePZltKhjNi8a W8J0GaoFlL3b9Crh0WO8QWIQTch4i+M4aFoyD6+0wYa+0UVZmaMcyZ1QTVIObDMonmAFixnhCsD sWxU6AHwt4IkOreQ/baBlWYMCq3gGrAqfiHS+8cXD7vM2n/+mRNGIiEhvj6krpLkm/VOmXC+Upo yFXMv5sX2hZA== X-Received: by 2002:a05:6512:1387:b0:533:6f3:9857 with SMTP id 2adb3069b0e04-53546afad8amr8643392e87.5.1725352839463; Tue, 03 Sep 2024 01:40:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH73K8zXAlWO2B5Y88PpJj5oJ1Eu2UkG0ziUzYARvtedB/uKSECklnmFZEwzXVXMIYbvMyrwA== X-Received: by 2002:a05:6512:1387:b0:533:6f3:9857 with SMTP id 2adb3069b0e04-53546afad8amr8643355e87.5.1725352838336; Tue, 03 Sep 2024 01:40:38 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8989092143sm658318666b.96.2024.09.03.01.40.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:37 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 19/21] UBUNTU: SAUCE: phy: qcom-edp: drop regulator loads Date: Tue, 3 Sep 2024 10:40:08 +0200 Message-ID: <20240903084010.3746280-20-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Johan Hovold Drivers should not be specifying active-mode regulator loads unless supporting an idle mode where the load is reduced during runtime. This effectively reverts commit a4888b2005d1 ("phy: qcom-edp: add regulator_set_load to edp phy") Link: https://lore.kernel.org/r/YuPps+cvVAMugWmy@sirena.org.uk Signed-off-by: Johan Hovold (cherry picked from commit 6abcfbac29f86056b5ab8a1989adaae6f4cbbdd3 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/phy/qualcomm/phy-qcom-edp.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c index da2b32fb5b45..a926925c1edd 100644 --- a/drivers/phy/qualcomm/phy-qcom-edp.c +++ b/drivers/phy/qualcomm/phy-qcom-edp.c @@ -1079,18 +1079,6 @@ static int qcom_edp_phy_probe(struct platform_device *pdev) if (ret) return ret; - ret = regulator_set_load(edp->supplies[0].consumer, 21800); /* 1.2 V vdda-phy */ - if (ret) { - dev_err(dev, "failed to set load at %s\n", edp->supplies[0].supply); - return ret; - } - - ret = regulator_set_load(edp->supplies[1].consumer, 36000); /* 0.9 V vdda-pll */ - if (ret) { - dev_err(dev, "failed to set load at %s\n", edp->supplies[1].supply); - return ret; - } - ret = qcom_edp_clks_register(edp, pdev->dev.of_node); if (ret) return ret; From patchwork Tue Sep 3 08:40:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGY2Xvdz1yZ9 for ; Tue, 3 Sep 2024 18:40:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5g-0002aq-4J; Tue, 03 Sep 2024 08:40:44 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5d-0002P0-7F for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:41 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id F2C093F215 for ; Tue, 3 Sep 2024 08:40:40 +0000 (UTC) Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a8683bd9e67so426825566b.1 for ; Tue, 03 Sep 2024 01:40:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352840; x=1725957640; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7HG7aSGDj2tOZicuWjJ8UwSiJsMdviJ5ZLgLBAMTC1g=; b=VZ5MZAZKEkPGmRUE/EA/5U8886Ysk9p+JUJ3FcZiYHR8kZ2qKDRuoptccr2FokUykL dO9lNfb0oKt8TP2Bqx2SdbmpBr1oMoiRsguaEkhFJweDDheVnL+jr5zz0HrZE5IUDgbZ tbbAY7tD+z4O5RcURbqDlZPX0KnvPP0FcnAcE89F2OSMkJCxkyqSu8hQLbXgf23mLRjW /2FcU9VbtfFTIxuAQZM0oZUqBzKMVLRZ/y65jEnVYIuzESyGU4Mj6zzK3h5DK2c31Oy3 2GzZtY3KA32/vxZhv0b13568HNd+dLUJ1Fehe4bUiQPftLoC8O1Yah7qsgtsYLNH5dpK S8/A== X-Gm-Message-State: AOJu0Yy38Krj6j5M4pRxtqqSlfOTME+LZYPosdXH3VaHw/uDyDqn8a6t Yc2L/i/rdengoFtIlNc/+wiwgHxDEVeNXejEFSUICaiImxTBFgqTbLHK8x4KFujodbjV0/UXnv3 w0qPdFPNL4fhLwrOpW4xfa3dssUzuX0XoZv4KFFjBqxCwXn1U8xHgunUigIkSLHL5pssAgnqxMu +qedjk0W98Dw== X-Received: by 2002:a17:907:7206:b0:a86:a5a0:7613 with SMTP id a640c23a62f3a-a8a1d4c2db0mr229790166b.55.1725352840364; Tue, 03 Sep 2024 01:40:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSRKj2gC6depUSlTrVxjofg9Y+LZNPYgb6xRscW+NfKfNQ9a+FBYFL62iU934lD20DzQijrA== X-Received: by 2002:a17:907:7206:b0:a86:a5a0:7613 with SMTP id a640c23a62f3a-a8a1d4c2db0mr229787266b.55.1725352839748; Tue, 03 Sep 2024 01:40:39 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a89891d80fcsm655260366b.181.2024.09.03.01.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:39 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 20/21] UBUNTU: SAUCE: i2c: qcom-cci: Stop complaining about DT set clock rate Date: Tue, 3 Sep 2024 10:40:09 +0200 Message-ID: <20240903084010.3746280-21-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Bryan O'Donoghue It is common practice in the downstream and upstream CCI dt to set CCI clock rates to 19.2 MHz. It appears to be fairly common for initial code to set the CCI clock rate to 37.5 MHz. Applying the widely used CCI clock rates from downstream ought not to cause warning messages in the upstream kernel where our general policy is to usually copy downstream hardware clock rates across the range of Qualcomm drivers. Drop the warning it is pervasive across CAMSS users but doesn't add any information or warrant any changes to the DT to align the DT clock rate to the bootloader clock rate. Signed-off-by: Bryan O'Donoghue Signed-off-by: Johan Hovold (cherry picked from commit f1ef00a7c6c56c97aa567b02f7811d3fdbb860ea github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/i2c/busses/i2c-qcom-cci.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c index 414882c57d7f..99e4305a3373 100644 --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -602,14 +602,6 @@ static int cci_probe(struct platform_device *pdev) } } - if (cci_clk_rate != cci->data->cci_clk_rate) { - /* cci clock set by the bootloader or via assigned clock rate - * in DT. - */ - dev_warn(dev, "Found %lu cci clk rate while %lu was expected\n", - cci_clk_rate, cci->data->cci_clk_rate); - } - ret = cci_enable_clocks(cci); if (ret < 0) return ret; From patchwork Tue Sep 3 08:40:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1979928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WyfGb1MvGz1yZ9 for ; Tue, 3 Sep 2024 18:40:55 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1slP5i-0002lT-H0; Tue, 03 Sep 2024 08:40:46 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1slP5e-0002Un-Ot for kernel-team@lists.ubuntu.com; Tue, 03 Sep 2024 08:40:42 +0000 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 6C0233F284 for ; Tue, 3 Sep 2024 08:40:42 +0000 (UTC) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5c247f815b3so2004037a12.3 for ; Tue, 03 Sep 2024 01:40:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725352842; x=1725957642; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rP/vENljf+PiqJsDENF0DzuxCsM/ZyddF8WP3iSwsYs=; b=nm9nDFJBDGrZsTYSV4gE+OE5amkQgG6jS9PsNqkYLPh/gz+Qvhooxmds92IQhZdCVA lqQlLbVDG2oalSIiZklw2yBHS7Js6qQOMC/S9J8+nP3OPyWbJXSq9bCDKzT4BG9qMnss 5GjUq+zIXwXrQiAo5I4G7lylx8EjupQ6BXqucn++u55nA1xCTLFW1Z8nHW7zk//x13Hs 8xH5SFs01K4sRFnrOguIl0HAxmSsD6XQSiWfZRC5RiY8SLGGezJRxhEYLaagOq5f+6C8 HSNjY+LWeINyb8vbT1dy09GAzA4+owHlm4KEb5auQ4q6v1SZLJE51fkUjchh/BvLwGMT nhQA== X-Gm-Message-State: AOJu0Yx4NrdTpxU2u/ttMaPc0Ic4U9WMbSQagGNDv59qu3TMBOodorQs /DCg9gPag6mc1OuEuSkpzTiXm9r0SNWpER1bqFgi7dSpIbwQRMB1ZWpknTwgP0tTuvp16TTbhKN 3DnZt82S2TxPcjnpqNawfT0JTsLt+CyFxksjbdJyhmDUC4zRal5aMF+UFJR5VWIM3GfIZpPqdJC XMFcz7aM1uoQ== X-Received: by 2002:a05:6402:5208:b0:5c0:8ecb:d852 with SMTP id 4fb4d7f45d1cf-5c25c3a7192mr4500979a12.6.1725352841839; Tue, 03 Sep 2024 01:40:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE43FEvAXsbTPdzKMxr9UU5qEtijKmCVTn9ol80YnvVyPhNyDzZdFRVOx3B2YtbpTb0xNK7lQ== X-Received: by 2002:a05:6402:5208:b0:5c0:8ecb:d852 with SMTP id 4fb4d7f45d1cf-5c25c3a7192mr4500949a12.6.1725352840976; Tue, 03 Sep 2024 01:40:40 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c2502f86ebsm3220137a12.77.2024.09.03.01.40.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 01:40:40 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [O][PATCH 21/21] UBUNTU: SAUCE: clk: qcom: gcc-sc8280xp: don't use parking clk_ops for QUPs Date: Tue, 3 Sep 2024 10:40:10 +0200 Message-ID: <20240903084010.3746280-22-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903084010.3746280-1-juerg.haefliger@canonical.com> References: <20240903084010.3746280-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Johan Hovold A recent change started parking the RCG at an always on parent during registration, something which specifically breaks handover from an early serial console. Quoting Stephen Boyd who fixed this issue for SM8550 [1]: The QUPs aren't shared in a way that requires parking the RCG at an always on parent in case some other entity turns on the clk. The hardware is capable of setting a new frequency itself with the DFS mode, so parking is unnecessary. Furthermore, there aren't any GDSCs for these devices, so there isn't a possibility of the GDSC turning on the clks for housekeeping purposes. This wasn't a problem to mark these clks shared until we started parking shared RCGs at clk registration time in commit 01a0a6cc8cfd ("clk: qcom: Park shared RCGs upon registration"). Parking at init is actually harmful to the UART when earlycon is used. If the device is pumping out data while the frequency changes you'll see garbage on the serial console until the driver can probe and actually set a proper frequency. Fixes: 01a0a6cc8cfd ("clk: qcom: Park shared RCGs upon registration") Fixes: d65d005f9a6c ("clk: qcom: add sc8280xp GCC driver") Link: https://lore.kernel.org/all/20240819233628.2074654-2-swboyd@chromium.org/ [1] Signed-off-by: Johan Hovold (cherry picked from commit 5a27118bddc476dfd7e903aaa1aeae018a80d397 github.com/jhovold/linux) Signed-off-by: Juerg Haefliger --- drivers/clk/qcom/gcc-sc8280xp.c | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c index 5f11760cf73f..f27d0003f427 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c @@ -1500,7 +1500,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = { @@ -1517,7 +1517,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = { @@ -1534,7 +1534,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s2_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = { @@ -1551,7 +1551,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = { @@ -1568,7 +1568,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = { @@ -1585,7 +1585,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = { @@ -1617,7 +1617,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s6_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = { @@ -1634,7 +1634,7 @@ static struct clk_init_data gcc_qupv3_wrap0_s7_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = { @@ -1651,7 +1651,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = { @@ -1668,7 +1668,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = { @@ -1685,7 +1685,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s2_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = { @@ -1702,7 +1702,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = { @@ -1719,7 +1719,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = { @@ -1736,7 +1736,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = { @@ -1753,7 +1753,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = { @@ -1770,7 +1770,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s7_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = { @@ -1787,7 +1787,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s0_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s0_clk_src = { @@ -1804,7 +1804,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s1_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s1_clk_src = { @@ -1821,7 +1821,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s2_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s2_clk_src = { @@ -1838,7 +1838,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s3_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s3_clk_src = { @@ -1855,7 +1855,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s4_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s4_clk_src = { @@ -1872,7 +1872,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s5_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s5_clk_src = { @@ -1889,7 +1889,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s6_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s6_clk_src = { @@ -1906,7 +1906,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s7_clk_src_init = { .parent_data = gcc_parent_data_0, .num_parents = ARRAY_SIZE(gcc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_shared_ops, + .ops = &clk_rcg2_ops, }; static struct clk_rcg2 gcc_qupv3_wrap2_s7_clk_src = {