From nobody Mon Feb 9 02:57:06 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD4F71A83FB for ; Fri, 20 Dec 2024 09:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734685429; cv=none; b=aIRm8WjdaMEcUBiDgLU/bN3Ql5SIjwb2T3SiKr/qdP5cn77bzFDUy9a1P8SfOXWbyetMLOXs+98iKvzMBzXROWNaT96WuY7Hk2QzHVRp3ImOVyiNkM7Z2myXS+DKH8kCsXlDm8fDlybkNx5XKRef0YlAJY2yK7RJAlbKei0I+Yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734685429; c=relaxed/simple; bh=rUGZF8yKmy+p1+ThFeCkZ6lSsu656MxTdFk1QCg9Tts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fS/me3VxLbVCxqYYm2mXwmdMutecekjTfPYdHNIP+sCZPa6AwM4nddtntEZBcUmALRD4trO6CiqXSPbPypON1TCafTq9exdq7XCyhHXfA+XCuwPWEn4znhqqmr6/IZWc1sJFJXFsecy9khNsE+swRe8mRgjBaJ+tkd7OwOMsEi4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=Gi6PNfsb; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="Gi6PNfsb" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4361f796586so17456775e9.3 for ; Fri, 20 Dec 2024 01:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1734685426; x=1735290226; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pq1bmVOour8kC/0ODYFkalnMVivKoV+qKdeFNxm3Yvc=; b=Gi6PNfsbXt7l5F8zvhLxhSTEC633XvQzbCbOogMNRT5Ny3VsT+DkfjWo3mS9fB5KV4 mTsQJtYpqizT+mJQUDFucLHFuIY7zonLfwY/2488VezyMzMbXpcIIQ89eroDhRmvPHpg O+IzqpYEhFjz3laTe6OyWrBYzIlR8e5NoYwCvQhNdJacHt7JJvfhls1hCTfBj5nPVFsG uxFeNrClGYMGrEygfEgExALVwtmKTm6yClH/j6+Ro+f9Xmwj6VpT0U6kcme3b5hslHPC ohiFJfP0fgojMWNd8ISvKPQq+u5sS7AaePBrhTN5kXFBVhKReMeEb93Uus8z08dfsElG yFmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734685426; x=1735290226; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pq1bmVOour8kC/0ODYFkalnMVivKoV+qKdeFNxm3Yvc=; b=K7zm4+utW1XlPgHD+iGj6O72P1/f3e8yGewu+8pHH8rLOySgWRrk0SzQh7PBdvEIfn x8XTbEMYDXidxAxTVRlPM3r+2Fru9+N/mg/FOJ6SYA8lUIvtFoa2TUodDYq17mGS++ry 0NWCpyjMdHvkPRq9Iw9q2YpkcmCROWmeSvY2plnGLXG2aiY+FLVu+Ccfxu59HahMDORB 39lJhWTRfGXd+6tafIJqGo18EDi4C8SLrTZTOGB5EirpnYNMDID2r8QqVU4K2ATZ22Es bB5cfDOndFa66hetc7FUQurcHtcgsGO3WSLhsZqR9J3sE0t3jXeOImUFR35GiRU18/Q9 tH5g== X-Forwarded-Encrypted: i=1; AJvYcCXDE/d2VpUUQ3f8Uor8pn9TiQ64KO6iimpmVfcj1OSsQOX73xoeWscSoB6Lpu0CoOLcNkl250V8tZohd9M=@vger.kernel.org X-Gm-Message-State: AOJu0YyXBDK1opBfZTxOJKeVM29X87vPHX8MqBE8OdG4KzMqIbdmmREw J/ip6L5ZHYD4Hh+ZWhR3lrMAKIAPev0q7ob3F3PqpefE7oNkwwhQcaCWD9PkBaM= X-Gm-Gg: ASbGnctyb/BojAGZGg4UqWDIJUNX/KfMxGf5bD11/CDSM7LZmOmKhB3TFqWo1/dB4eu GXi/dG1h2vZaNYraaWGbEVtOE51Nh0BraodRbm9Nd72osqwUlj1ZKD2V4yCuyf7FvXS+EB/Dfbh Q+h7z+2UgW5MbJU8XaHCgapkWboF2eIGcR16p9qDxhTV3ebJChlW2FRwQrVdWVVi70jwd1PA74l ojrxp7CrRiy/MJoE0XmABS6mYMikBm+fYSMbvRKW+12HJ48zueSNlnF8uojU3qh7j06CfOT0OXE 4xUEAHmMHcLLiQjbWvrtnByCCHjqkA== X-Google-Smtp-Source: AGHT+IHgsh5xJuAMq4qoVNA6TBwXpF2ZHhv/viApIXc0e7PnnUdfQR1REEbtj0sPbgIGdKOKXJ+NIQ== X-Received: by 2002:a05:600c:154b:b0:434:a734:d279 with SMTP id 5b1f17b1804b1-43668644104mr17730505e9.16.1734685425998; Fri, 20 Dec 2024 01:03:45 -0800 (PST) Received: from [100.64.0.4] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea3e0sm40610375e9.7.2024.12.20.01.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 01:03:45 -0800 (PST) From: Luca Weiss Date: Fri, 20 Dec 2024 10:03:30 +0100 Subject: [PATCH 1/2] clk: qcom: gcc-sm6350: Add missing parent_map for two clocks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241220-sm6350-parent_map-v1-1-64f3d04cb2eb@fairphone.com> References: <20241220-sm6350-parent_map-v1-0-64f3d04cb2eb@fairphone.com> In-Reply-To: <20241220-sm6350-parent_map-v1-0-64f3d04cb2eb@fairphone.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , AngeloGioacchino Del Regno , Konrad Dybcio Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss , stable@vger.kernel.org X-Mailer: b4 0.14.2 If a clk_rcg2 has a parent, it should also have parent_map defined, otherwise we'll get a NULL pointer dereference when calling clk_set_rate like the following: [ 3.388105] Call trace: [ 3.390664] qcom_find_src_index+0x3c/0x70 (P) [ 3.395301] qcom_find_src_index+0x1c/0x70 (L) [ 3.399934] _freq_tbl_determine_rate+0x48/0x100 [ 3.404753] clk_rcg2_determine_rate+0x1c/0x28 [ 3.409387] clk_core_determine_round_nolock+0x58/0xe4 [ 3.421414] clk_core_round_rate_nolock+0x48/0xfc [ 3.432974] clk_core_round_rate_nolock+0xd0/0xfc [ 3.444483] clk_core_set_rate_nolock+0x8c/0x300 [ 3.455886] clk_set_rate+0x38/0x14c Add the parent_map property for two clocks where it's missing and also un-inline the parent_data as well to keep the matching parent_map and parent_data together. Fixes: 131abae905df ("clk: qcom: Add SM6350 GCC driver") Cc: Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sm6350.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6350.c b/drivers/clk/qcom/gcc-sm6350.c index a811fad2aa2785fffbdee0d4bd3cd1133e4d0906..74346dc026068a224e173fdc047= 2fbaf878052c4 100644 --- a/drivers/clk/qcom/gcc-sm6350.c +++ b/drivers/clk/qcom/gcc-sm6350.c @@ -182,6 +182,14 @@ static const struct clk_parent_data gcc_parent_data_2_= ao[] =3D { { .hw =3D &gpll0_out_odd.clkr.hw }, }; =20 +static const struct parent_map gcc_parent_map_3[] =3D { + { P_BI_TCXO, 0 }, +}; + +static const struct clk_parent_data gcc_parent_data_3[] =3D { + { .fw_name =3D "bi_tcxo" }, +}; + static const struct parent_map gcc_parent_map_4[] =3D { { P_BI_TCXO, 0 }, { P_GPLL0_OUT_MAIN, 1 }, @@ -701,13 +709,12 @@ static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = =3D { .cmd_rcgr =3D 0x3a0b0, .mnd_width =3D 0, .hid_width =3D 5, + .parent_map =3D gcc_parent_map_3, .freq_tbl =3D ftbl_gcc_ufs_phy_phy_aux_clk_src, .clkr.hw.init =3D &(struct clk_init_data){ .name =3D "gcc_ufs_phy_phy_aux_clk_src", - .parent_data =3D &(const struct clk_parent_data){ - .fw_name =3D "bi_tcxo", - }, - .num_parents =3D 1, + .parent_data =3D gcc_parent_data_3, + .num_parents =3D ARRAY_SIZE(gcc_parent_data_3), .ops =3D &clk_rcg2_ops, }, }; @@ -764,13 +771,12 @@ static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_s= rc =3D { .cmd_rcgr =3D 0x1a034, .mnd_width =3D 0, .hid_width =3D 5, + .parent_map =3D gcc_parent_map_3, .freq_tbl =3D ftbl_gcc_usb30_prim_mock_utmi_clk_src, .clkr.hw.init =3D &(struct clk_init_data){ .name =3D "gcc_usb30_prim_mock_utmi_clk_src", - .parent_data =3D &(const struct clk_parent_data){ - .fw_name =3D "bi_tcxo", - }, - .num_parents =3D 1, + .parent_data =3D gcc_parent_data_3, + .num_parents =3D ARRAY_SIZE(gcc_parent_data_3), .ops =3D &clk_rcg2_ops, }, }; --=20 2.47.1 From nobody Mon Feb 9 02:57:06 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86F2D1A83FC for ; Fri, 20 Dec 2024 09:03:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734685430; cv=none; b=Zng6gPcIT6za9ctnDgyebRZsMag81RNMR1kb/x57c4dO5LzGppuJshBOVdWaXhKKY9KMKNIWycxZ5q60bqLACys7GPdeZsXZ+wp9jRCPHwANkyHsHmukV3xhTUys0hJfJF+QS+o3l0v8cxgrwrcL8WxNZsniT3paDPEU/x6EeXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734685430; c=relaxed/simple; bh=sYfJ8wnk7ijxOCPLQlV1R18oROlrwY0cZtyJnzBm9UA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TvSHU3OTyZMWdy9I+gKiHY/vV5vOqtbZcKp5fG3bxAW0395Y13M6QIlZz4SqbgDsXItTBgMaYfxZ0Lf4EUIlnhNz9hSxLubCduQbEvxvBvYX//EFhiZJXlz9iRDzHYVWVZSR/kkBtjrZrpADVZ/Z33ZwACQiGU6hEfu1wds9h8A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=46Dm2X6z; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="46Dm2X6z" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso16112225e9.0 for ; Fri, 20 Dec 2024 01:03:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1734685427; x=1735290227; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qTCVs5hxfcVP47+ZWc/YNDn2g1Drj1Yq7gW/RQstCeY=; b=46Dm2X6zMEwBR1jAcACns7FPs83thyYHMYhfvg9jmPQ7R4FYcAaAhMYHdo7TMUmAZ8 oDHiGQ+fUJlo2lodqLX8sgv+1jP0xof2QhzVTAI0ReguUACnPoUJOEnzFAmPlxakkXGK K1o+fx9xFQBWBTzcTqfTccatBYc2gvakRTeIRguVHkQpz76sIlPlS5jPZmbCjfVGTjoO wkw3mDSjV5JKKDDeeTg37wzkzbSwTd6I4a6vDiDgC0iaxrp41H2doGWtA2jWPNuqhEUQ JMePRl7hhX1Appl3PKDTU2pvP9hFQBqX+zX7zhaod/HGNp6q2BHTAsZB6l75Pk073eUb ztHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734685427; x=1735290227; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qTCVs5hxfcVP47+ZWc/YNDn2g1Drj1Yq7gW/RQstCeY=; b=vh15H3/wW0k16XSYCVFx2bFvA620ea7himA8ju0SRN8b2MdTOoMrA0y8hT/SsSvdfT tD3mD0LloVdHXFGHgwEY0MZoSLQzYgnbSlLEnwtJRAUma1aGXDsIfw1qDJY+MvbT/Mx4 vtWhn39gQm48h4PxtBcfy0ViAV/GqYqorX/tsWwJ7Jg2rVT+cwaJ5o9LN5mnfjVZRPot a4dQhdeHRWms5ICj9KhSgsIy3qTmUhyC9RZ2GZy5xTNg3dqlXMBD4VgVSpkM4W7tuWhO 55QKoyzq2BYHzjf44z3I3a9kNGxG0YzODwRSmYpUdBemAXrbC6Km8sBfu3dTW6rLmqWt /Tag== X-Forwarded-Encrypted: i=1; AJvYcCWSYiRJqBIryh1ebkIsgOgbie0J7rvuyXrcR16jrXJPoDJctJEQ1QbQlEDRzn/1NAPn79O4N6cdcuFgcRg=@vger.kernel.org X-Gm-Message-State: AOJu0YylK9Rnu2yakTCYSyPjdGjdL9YWEUiO86xhhA1rlIw/1AIq/Qm9 BCmAHioMp81ByniWpS5s4XeZEHPXMyfZM7MiIlc3/5gENapa+kV279QKCPRGdaI= X-Gm-Gg: ASbGncs23KrHDgzSotEcjeCl2fz2q+Xire2CsBjJuWgZ1sBThisLniuY/7jwAG2a7ik Was6diyp3bixSlFnxcEkXxQjoIHkmFRqDiDzf5v9lkCdNIOx++qCzMeJUTsh7qRDMc5FOmWgic0 YMvA/HPKOVzTOIyCoTha+0IAj6q+3Du0+VpBfC12CO1NXUjd66qk1wwHmrzuwHMg315J6I8nFQz 0B3EvsbJZpueVdFbvfZXBwfmRl3K0G5N//Gxr/VMi5unRR73efKHOvm6ZCu1hDwXdlLwb9Fml7Q J7hdECE9d1rvqaw74z2qGo+1SNZM8w== X-Google-Smtp-Source: AGHT+IGHpITziEb0AqGEPqXQ3d/Kd1ljvCdDAf6rDGr2ZBgcyCuqixvJ/Icbd0mED7HVr/rTukylng== X-Received: by 2002:a7b:c3c7:0:b0:434:a90b:94fe with SMTP id 5b1f17b1804b1-4366fb89a04mr358955e9.10.1734685426814; Fri, 20 Dec 2024 01:03:46 -0800 (PST) Received: from [100.64.0.4] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea3e0sm40610375e9.7.2024.12.20.01.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 01:03:46 -0800 (PST) From: Luca Weiss Date: Fri, 20 Dec 2024 10:03:31 +0100 Subject: [PATCH 2/2] clk: qcom: dispcc-sm6350: Add missing parent_map for a clock Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241220-sm6350-parent_map-v1-2-64f3d04cb2eb@fairphone.com> References: <20241220-sm6350-parent_map-v1-0-64f3d04cb2eb@fairphone.com> In-Reply-To: <20241220-sm6350-parent_map-v1-0-64f3d04cb2eb@fairphone.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , AngeloGioacchino Del Regno , Konrad Dybcio Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss , stable@vger.kernel.org X-Mailer: b4 0.14.2 If a clk_rcg2 has a parent, it should also have parent_map defined, otherwise we'll get a NULL pointer dereference when calling clk_set_rate like the following: [ 3.388105] Call trace: [ 3.390664] qcom_find_src_index+0x3c/0x70 (P) [ 3.395301] qcom_find_src_index+0x1c/0x70 (L) [ 3.399934] _freq_tbl_determine_rate+0x48/0x100 [ 3.404753] clk_rcg2_determine_rate+0x1c/0x28 [ 3.409387] clk_core_determine_round_nolock+0x58/0xe4 [ 3.421414] clk_core_round_rate_nolock+0x48/0xfc [ 3.432974] clk_core_round_rate_nolock+0xd0/0xfc [ 3.444483] clk_core_set_rate_nolock+0x8c/0x300 [ 3.455886] clk_set_rate+0x38/0x14c Add the parent_map property for the clock where it's missing and also un-inline the parent_data as well to keep the matching parent_map and parent_data together. Fixes: 837519775f1d ("clk: qcom: Add display clock controller driver for SM= 6350") Cc: Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio --- drivers/clk/qcom/dispcc-sm6350.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/dispcc-sm6350.c b/drivers/clk/qcom/dispcc-sm6= 350.c index 50facb36701af99923584f1ca1549df6a70f06d9..2bc6b5f99f5725bf56c63623c3d= 5c16c25879d9e 100644 --- a/drivers/clk/qcom/dispcc-sm6350.c +++ b/drivers/clk/qcom/dispcc-sm6350.c @@ -187,13 +187,12 @@ static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src = =3D { .cmd_rcgr =3D 0x1144, .mnd_width =3D 0, .hid_width =3D 5, + .parent_map =3D disp_cc_parent_map_6, .freq_tbl =3D ftbl_disp_cc_mdss_dp_aux_clk_src, .clkr.hw.init =3D &(struct clk_init_data){ .name =3D "disp_cc_mdss_dp_aux_clk_src", - .parent_data =3D &(const struct clk_parent_data){ - .fw_name =3D "bi_tcxo", - }, - .num_parents =3D 1, + .parent_data =3D disp_cc_parent_data_6, + .num_parents =3D ARRAY_SIZE(disp_cc_parent_data_6), .ops =3D &clk_rcg2_ops, }, }; --=20 2.47.1