From patchwork Thu Feb 29 18:07:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577488 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 E2C8578261; Thu, 29 Feb 2024 18:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230105; cv=none; b=sUdyLp0x/x8gQ2bGnir5We29xw+YHNKv7F1/AmtF4Othl3f3no5IhDI2/suhkrJGzqdMnz+ZemjZyCMvHBGnNFllAG947nW4RYPelxDrmCEnno8h3D5ASeZQNAAFtGdrwE0INOHHdwuQr3rSmVTvogyMmnA+r9ELR8YEU4skc4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230105; c=relaxed/simple; bh=GaTSHoEdQQZfdVPgGu4OC9tyNlKXbXyeqwoMC3yFiEk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rWir/VVH1Tnqb8ecGzwpouvJnH0gHaV0glrIstMlE/+w1Ol2aple2TJDybBC9Am1h/Ep5+F+ru6I5cbeJGbx3MInw88fV3yS5z//IqWwTMxvRGd4zwuiZcqaCxkD2rLzmQYx72vXyxXEBO1tshidwMsoNRr6Y/EOkAwzB3xbd2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hVBq1Kss; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hVBq1Kss" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-412bb23e5c5so6894015e9.1; Thu, 29 Feb 2024 10:08:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230102; x=1709834902; 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=kH08pUQU08Y2ZLx4/JDTMu/sqhpXrAaQNeadE+HITMA=; b=hVBq1Kss7t8GRpNIqwb7NBnqPiHg4nhnl4dciO7YD5mSiLcLF/Ug3OJuDlvUbP4x2r BsJSwiB4nw9P1s/HR8N8YLgDRwCVImxIVM9qxxJpmiTHnUmPC8vKrnCPUJo+aGGFI/xX IiYnRh9RpbZotbmgRLkYMwNiIiZcxeJVIL1IeoX1XOeQo5VflRiN9oMVywvEGZUtBNsv Lwc0yP2FG/dJuTx5ZJGxclm1gbBo1Yj9xRzqAahq+PoNEPwwv4tPMtDIlB8sqHo91yQB jgAOET/62oIuOPDk65xk6+FOr7V3m68ByunKeckZayfG6JSDhnkhe1tTcS21YPuentBL JM3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230102; x=1709834902; 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=kH08pUQU08Y2ZLx4/JDTMu/sqhpXrAaQNeadE+HITMA=; b=LxEXy8sCpBnZqfBpRQv85L7XT/HnskizFNbM2n9FL+PBK5GQI8fkhiiGVVM/NuSKQ/ XDzXyastoAlgtSXaGy7mO5XWvS82RHV3xZT4+cNPMwJkPKoA0Vw/35AKPtMMJVRQ1Mwy +c/tCsDnsZRNY3A60vvTEXrHq9IQRSsUxHpmIQnSmaLlYYSTa1hKpoxtW3ztDxrANunk WftKPp1vmvJfhb+O+PJ2yZvapXhUs6OeX/6N4YW0sCZGviLd2LG+T5galV8Tarqr80WN w6M3aPKamtCTxNBW0BVQIUwjKr+kMX/WQqMDjq16lyX/IfqwrQsZdP5pgw8bGpxboovd c/1A== X-Forwarded-Encrypted: i=1; AJvYcCXOuQswpqjQcmpPsX0C4sQKB87dM4PdH4hm+mfzDyhMidwfT9oE1BQ4RuYDfX9jQJaq1UiNJsjcsReTliWZkJc4uYAXEclZD85yzQgaXWIjVWcShPMIaic2naMi6XcCuYCXeaXxxQ2C X-Gm-Message-State: AOJu0YzJphcalU4Lmb0vQL2gVnf4ideZ/q9rcIioPnH3URm+4Gly+knf 3wKaZjwIJQ6Nzl00TyFmC/sUpcl8zcZtfYwnmRQ6yyP0GjxkqCxM X-Google-Smtp-Source: AGHT+IH22zo9cFZjUhrRWIvR6gJU6E/1MNLkCACiuLXwjAhwhV4YuRt8iR9nZr+p2bfsIq91eS9xaA== X-Received: by 2002:adf:cb82:0:b0:33d:b312:2130 with SMTP id q2-20020adfcb82000000b0033db3122130mr3449072wrh.11.1709230102255; Thu, 29 Feb 2024 10:08:22 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:21 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:46 +0100 Subject: [PATCH 1/7] clk: qcom: gcc-ipq5018: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-1-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Fixes: e3fdbef1bab8 ("clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/gcc-ipq5018.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c index 4aba47e8700d2..856a2b30e2a8e 100644 --- a/drivers/clk/qcom/gcc-ipq5018.c +++ b/drivers/clk/qcom/gcc-ipq5018.c @@ -857,6 +857,7 @@ static struct clk_rcg2 lpass_sway_clk_src = { static const struct freq_tbl ftbl_pcie0_aux_clk_src[] = { F(2000000, P_XO, 12, 0, 0), + { } }; static struct clk_rcg2 pcie0_aux_clk_src = { @@ -1099,6 +1100,7 @@ static const struct freq_tbl ftbl_qpic_io_macro_clk_src[] = { F(100000000, P_GPLL0, 8, 0, 0), F(200000000, P_GPLL0, 4, 0, 0), F(320000000, P_GPLL0, 2.5, 0, 0), + { } }; static struct clk_rcg2 qpic_io_macro_clk_src = { @@ -1194,6 +1196,7 @@ static struct clk_rcg2 ubi0_axi_clk_src = { static const struct freq_tbl ftbl_ubi0_core_clk_src[] = { F(850000000, P_UBI32_PLL, 1, 0, 0), F(1000000000, P_UBI32_PLL, 1, 0, 0), + { } }; static struct clk_rcg2 ubi0_core_clk_src = { From patchwork Thu Feb 29 18:07:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577489 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 333197827B; Thu, 29 Feb 2024 18:08:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230106; cv=none; b=BLOe0EuX/bFndgHnbLsL7IGdVCXssNegkDlyI6BuAxntuZP3FnrIdXN7BIzUJ+glDgu+d+vJ4/76yq4gXXHWl9uFMJvrVMEiBgRENkrprRV5Nb2R7aUP3dbxVpTvl6dPR7E1+Fy2XenajIbaLxg+cFiyIH+VcrtEPV6VXY4i7N4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230106; c=relaxed/simple; bh=BHpXmfCdFm79sHhjj+p/LhjJdEv9za2/JcqtZAjCXiI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hvl6othtHNF+BOSC+0O22T9tHhxboukMhYsdBVz1NbhhIIW0HcVFBtwhsIAVPxXrEeigZ3o8z/wXDSacJDuui1KtIXx2rH97ZGNYH0pITGek71orXaDit7xH4iVy9TqUExZsmZp64KzCgBpcKiOqJjXEMhSCgnOnxLVHyPoL0iE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=As62mqys; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="As62mqys" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-412c34e8464so2023155e9.2; Thu, 29 Feb 2024 10:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230103; x=1709834903; 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=OYAAhEwR/E+dbtNSsly8JocDfIPA8JdctVrwVBpoHmU=; b=As62mqys29FsIoghvULa8WvplWlStc87rv+dTChhRBeKNST6UZWcMQ1/BxZ0g6NPLs RfVmO+/D8s1y9ke4B2U52Fy24Uek+IYnCWFabHsgFHUq93hS8HiMmtmQ6nvirHSi9oZp GFMnUdH6qPuExTuPHKUivO1cVDGvWFAtDNDXDYSI51OMq0EZE8pVurzTElcl3urtI4A+ 9+vQVbPZ0a7shleWtENBDXCtjEov+OJyWrfljmqXtyVf/3f+/lIUdDLptPvBTKsH9Wrz Z8rnD6YyhjJKsyR4uI72DqsoZ4drmuaZL+ttBRpPpJeJKNdHkkloLrDhK1NPc7iv6Xbz wDuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230103; x=1709834903; 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=OYAAhEwR/E+dbtNSsly8JocDfIPA8JdctVrwVBpoHmU=; b=JwbeIMEfx3BxkoPieO4ZycbbRG/wlxFy4znQEuPxk8wih+HkSe4Juu73Ubar5RP4VQ VeaAwFH1vW0PHnYapesVrLMnaHig7UVTjx+SBRSs85/WEOU0oOCCbRogSrNKag1pQMbV oiixaydU/RdaV4qWoVzmlQ9CLnmFed10apNNQEpVYvU/P7j37HBdhCRHMpDXMcl77VJ1 QV2USNZbUhOUiiWu2/kns0J5FSJGf9ApOpvmSV4mKmomXgQBsiUuLsxVVMgURHayuZPw mq4P5HgGLdnMKIaGChb/skCQn+LLb02F9b08GzrHZ+nsiE1DIxzTPbEeH+3kpyI4pWW6 uq7w== X-Forwarded-Encrypted: i=1; AJvYcCWTsjoq6Eank3PVoj7kvB7A3NqYZKiauwIuJHJExmz+fKDkriuzSMq6eAVWVopAwmSRGuzIFCX1GAW3JESAVdJ/DgGcJmLi9Jrlgo0P0uoOtPubFOSDer2OaeVYv2oFewPxlfjygKJC X-Gm-Message-State: AOJu0Yzkret5+XTSw1Dmco2vxj9bVNSjSN2wOZRxnJh4z8jVVkq0war7 +rOjlM8UB6kousTxNohwWg+Wq9m96YV0Re7Qa84IznKiwzPOqBmVGfzTa/VTNuE= X-Google-Smtp-Source: AGHT+IFbMhZnLqk0ekw5mroQWt83bAhrD2xbKJ27yht2Wk15dYszLSpQEeaaY9h+SMhfmgKOClRF2w== X-Received: by 2002:a05:600c:35d2:b0:412:b42c:8ff1 with SMTP id r18-20020a05600c35d200b00412b42c8ff1mr2389897wmq.21.1709230103496; Thu, 29 Feb 2024 10:08:23 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:23 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:47 +0100 Subject: [PATCH 2/7] clk: qcom: gcc-ipq6018: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-2-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: d9db07f088af ("clk: qcom: Add ipq6018 Global Clock Controller support") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/gcc-ipq6018.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq6018.c b/drivers/clk/qcom/gcc-ipq6018.c index b366912cd6480..ef1e2ce4804d2 100644 --- a/drivers/clk/qcom/gcc-ipq6018.c +++ b/drivers/clk/qcom/gcc-ipq6018.c @@ -1554,6 +1554,7 @@ static struct clk_regmap_div nss_ubi0_div_clk_src = { static const struct freq_tbl ftbl_pcie_aux_clk_src[] = { F(24000000, P_XO, 1, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_core_pi_sleep_clk[] = { @@ -1734,6 +1735,7 @@ static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = { F(160000000, P_GPLL0, 5, 0, 0), F(216000000, P_GPLL6, 5, 0, 0), F(308570000, P_GPLL6, 3.5, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_div2[] = { From patchwork Thu Feb 29 18:07:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577490 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 AFA757A12F; Thu, 29 Feb 2024 18:08:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230108; cv=none; b=D3ogkgx/a8E23eFPMDiLSA+GQ46vjZETHAaPlqHG9ULPfX/Vk5XNsq2q1n97tEiEBNmh40kaNb4jXPFQXltXPz5bb4c4DIH4t5olJB64cPBjHZYl+soCEZdcWX6qWFS0lbABd4uhmfMX0apxcU6nVFfq0v9quos1JRNhJL8FMkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230108; c=relaxed/simple; bh=OPoEGaTaF/oEMgvPl1c1lMp/+Hytcqt2GkXEA6uM3NM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R9xiZNihdyu11eviE2Z4vKPisz5c9e02G2W7VF6H73GHc9+KMiNn7S3HvLGIHW3ojdilWGQgc3698ysRwPUr4htMdI3QlnT4I/HAToTrGnaEKqJEP9cY5mq5+eLkMXYlMJvGVn8ShFe8eIp0vRJk4djWVFqBZeRVRVUwn3Z/jKU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Tp457hfZ; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tp457hfZ" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d180d6bd32so12632041fa.1; Thu, 29 Feb 2024 10:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230105; x=1709834905; 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=0/Xm60hjVFDoBBFKWZ90/O5g1Yww87R9nHLMoER0+64=; b=Tp457hfZeZ562LQzXFLd7dXoDw4VezZCGv7uJXQZhwsfCUzZRwUocrhIaoou/i5208 Nld2EH73VsaLiJEg7FALvYLAVpk6KjQiLv7/WIHvGsilqp+/mV7VarC7LjLIh/ySvSeN 28vXayVigAJqeVHd5UU5s/otKDcNkw/3gV64LQOrgMKElYDtJZ0ZNRZCtdPeNHh1PqbO D2HMTF+A3shHXko9jr76D9xNJdGew7D2dfoQNMT0JtZpjIIyxLLXa752CxFSwghTsi8G KGWXd98GmhBYkwBSOcrSeVyp1/NRw5wp+KyIKr78kOi9PCyGvXJrc8qQFfownL4/aD9H cx8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230105; x=1709834905; 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=0/Xm60hjVFDoBBFKWZ90/O5g1Yww87R9nHLMoER0+64=; b=fKcjczpL3Lhlke0SEVlj6uAGB/w/nLzTIZnL9R8nFAFynZA8Yc5Ys5AhvdmTrU3nu9 sAJE8rlww3pjBiWoY6ssaYel4N0cn5AT+dwZZ/S2rh0uRYfe4ZqLLXzZDMpI9aPquhx2 6UkM4B8A9H6rAWrv8vTMm62RgO/wThMsO5cFl7qv1znMYyQuaCOJfKi7sTunS/YzkBYR J8ZHl2KYH8nGAor5cFdJIKDP53CkfMvaalHSxcuDc9CE3eqdIIfbhQ6phIPni1cBrSKz h8Zlmb4B1x3RJJVTAJIQVZxX5k1ImmIk+j6X9D1muJpk4qzWQDpun+4eS+82hEIomUWn A00g== X-Forwarded-Encrypted: i=1; AJvYcCVOXvp5MQISgPrOM72wa1S2mLefoTPr9txznwz5poWE81AWORmzNiY5cyFxI72pU4+g9FPfddkquSFmfiMyL+7l5hOCakuYFDAbL1m0O3evSM8mLyA1zkFijGtVmLqOgKbzOvocQK40 X-Gm-Message-State: AOJu0Yw4brR4HVqCgge59MxxQlDSlU1etwxLck/tPrnacok64BvDw5ke wRzjYr9HkVTM+G5pAt5BtX9/3p9M3BR/42h3iDniamGzhW1oJMTV X-Google-Smtp-Source: AGHT+IFXOk4FStuddUutRB0VHMsxas5rzJT3Lfn10l9nYhijtAtGE9Hc8v24D3UrCHWBoYx78T+X+Q== X-Received: by 2002:a2e:850e:0:b0:2d3:1be:2565 with SMTP id j14-20020a2e850e000000b002d301be2565mr2075456lji.6.1709230104824; Thu, 29 Feb 2024 10:08:24 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:24 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:48 +0100 Subject: [PATCH 3/7] clk: qcom: gcc-ipq8074: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-3-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: 9607f6224b39 ("clk: qcom: ipq8074: add PCIE, USB and SDCC clocks") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/gcc-ipq8074.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq8074.c b/drivers/clk/qcom/gcc-ipq8074.c index b7faf12a511a1..7bc679871f324 100644 --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c @@ -644,6 +644,7 @@ static struct clk_rcg2 pcie0_axi_clk_src = { static const struct freq_tbl ftbl_pcie_aux_clk_src[] = { F(19200000, P_XO, 1, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_sleep_clk[] = { @@ -795,6 +796,7 @@ static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = { F(19200000, P_XO, 1, 0, 0), F(160000000, P_GPLL0, 5, 0, 0), F(308570000, P_GPLL6, 3.5, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_div2[] = { From patchwork Thu Feb 29 18:07:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577491 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 ABA1C7A153; Thu, 29 Feb 2024 18:08:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230109; cv=none; b=DassgjbWYcTVBfuCmLSN7jGv8dWinait/+LaktW/6UGPObTHgGnwndFEX2NUll74DvKw2GKtHO0JWoCnP/vsgaCJig+vaQZsqBLlYli+cRvg+hZKcrpBYOUQbBdskveCmW3eKQGrH0TutbEAmiJpZWlN+O4r5ihCmPal3pICYnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230109; c=relaxed/simple; bh=cMmRYHD7l7rXiyndG0v1AfcCH8YS9H0IG1JOZeauL8c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SWNUwXKjsF6E25n4v1+a090Xq2fD7SvGiXyF8VAQU/GJbX8LBkAFzZIWeFwdVdat6pFKvlfahEh6Yh7j6QVejR1ZWlyPTPbmmXaH22pE3sFrHxHVkClRV8aW/8qukvbhxIkefukd2iyM9uTAHTp6UOfVVcZPj2yWGl7nKl1Nk+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WB943cBX; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WB943cBX" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-412c24280ffso3930845e9.3; Thu, 29 Feb 2024 10:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230106; x=1709834906; 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=qwB5GZyUp0vVrDZTlAHMqUR9YgdQhpTvdvLOlvDAWYw=; b=WB943cBXAdQW+VUjN0C+XUVQyyUz+Akx3wualWc+jWOROf48YotWnzSLZR+vcc0Okq 8eS56kglkh5rXU009IZxQCCDLlDBgzqT3fMxkD3V/y6/yNwj7mKOIJmiNcGwrkZwk3i0 tu1Y1fQzC/0jvxN+/ySSP9c8BOia+iCeYaUXvvvhLIJS7xbXbEriv+w3bXKPTTPaH+81 JwdE/L2H7rufGiXxFyyJOfaCfdECDV+Stt8v1lfJjNj+CCrsAxvFtqvqHVeoUU/llvEJ NhjM3GXJl/NVoFBznN0X5wdXePtKpA/3dFRl4trc4GRTuGVmM2mpTTb06T9+3rlT1dXd c+Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230106; x=1709834906; 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=qwB5GZyUp0vVrDZTlAHMqUR9YgdQhpTvdvLOlvDAWYw=; b=HjxR17vgkAvQjGGm81TJKgtOvrDdrw/RZT4H1LVy2e/hULxZH1WwRB4TaVYjlttO3w m7i9Mp2fk03C7q7QvoelXPFkrw1dnRk6TkrihgT22MyZ04fqMoJhZK7612FCMYAYM0rw 7tIN64s5qt34YidbBDQ8Oi8BdshSqM3+JrsJpsMDK9lfSvAkWr3pi0K6G3bbReck8koL qIRFGOrjcV/wbwbFWMQdxydMxx5sVPQtKuEA/CyYDZD2FqNHibBXzqdJ0BsAYYH2nsFf wacoYSSCQANj4ru99RGJXq+gcnXuLCroq77LS/KmSGXlDhfLEuPmc03K6PDky0zYzBd1 1xPg== X-Forwarded-Encrypted: i=1; AJvYcCUHMlHYVhNzSbx0MwY6ph1gtWGhFViOwow5+mMATAafAXh0RNHXIyhTz5hRzzavzZYuhA5tPJCrf9NINJnqwXsyB2WGklvlP33lYeWlsXCAFbyPBKffFhy69Opw1pfuoSJei6AGXb1O X-Gm-Message-State: AOJu0YxMJlZt56CiJvKrEYT3Ii+fo6n01XmmZrYwc/phLBYEbL9wQop2 q7tx3UNtmTzhUVbJG5Du+UdcxJn16iMctH/6aLpMp4gzdh2afI+k X-Google-Smtp-Source: AGHT+IEZKYVd5CNS62ZOeTW1t45K/wAl7v40CTb7k0y84DSHsDz8uEosVxEP4VjuXQYZ2hM2eto35A== X-Received: by 2002:a05:600c:444e:b0:412:bef2:5a5 with SMTP id v14-20020a05600c444e00b00412bef205a5mr1746599wmn.16.1709230106109; Thu, 29 Feb 2024 10:08:26 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:25 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:49 +0100 Subject: [PATCH 4/7] clk: qcom: gcc-ipq9574: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-4-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: d75b82cff488 ("clk: qcom: Add Global Clock Controller driver for IPQ9574") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/gcc-ipq9574.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c index e8190108e1aef..0a3f846695b80 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c @@ -2082,6 +2082,7 @@ static struct clk_branch gcc_sdcc1_apps_clk = { static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = { F(150000000, P_GPLL4, 8, 0, 0), F(300000000, P_GPLL4, 4, 0, 0), + { } }; static struct clk_rcg2 sdcc1_ice_core_clk_src = { From patchwork Thu Feb 29 18:07:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577492 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 ED0917D3F2; Thu, 29 Feb 2024 18:08:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230110; cv=none; b=lTvPwdoR3RbD2F9Pz/R2mhi0R0WbIymugm8YVe0gFfxdEXsqdvP1mfByELdaXYZZsVqBOWvaI7oSc0lur9jmpCxDUSB3cwqhrv8T8yWFH4NUTgMJUcBNH6ZbUl2+d8dTxGeSP/m4IVvZ9Ti9c+0bbqSU0ohqtclgbtVcWbTv6bs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230110; c=relaxed/simple; bh=4qATgv2NIkBbPJ4MXwBLLL2AM9zlNCrH2AkubYOzo2Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yh9dy62Ly4vfIhzOJ9cUfFP7nexMPsvMav7NMagjQQTCQldWI/eX1vbBZo5yTZnEXxnfZCpPIIyb1G3Wn+/pMlk24QQrUme3S0e0lLAUCW3HpP6m1T/liH/3tM/fllvff3c5JlH5V/xpVQcfF1nCbfnVACGQC7uK9PsR3DevWc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kO/Ks9Xc; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kO/Ks9Xc" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-412bcb76703so7088605e9.2; Thu, 29 Feb 2024 10:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230107; x=1709834907; 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=lJ1CttY3QePOBroynm6EQeC99boR7JdlBwjlYres+fA=; b=kO/Ks9XcBNsUGoJv51QX4IFV59AeoFSAb2VtsmFvW0JwjphBJl+Ux0r6YVOw3OVqlG uj6DePXtj09clEU7jlYWY51fKUIFjVKWWxhmMX7UzSiyGevtq2lKY6ueJVVsQhMkEg7u ohSAqaPuPrSTadS++Qlx9RhyH44vE7XHFkptB8Bcf6rUtqsOQ5GewoxqyJHFm/vxNj62 NLNA0iqEcnM2Si2c+lbcgQBrwcHt0LAW4Mke/oGRkwgA6+jnPBIOmqCc3Zp9RoZGDakq Nr3f548aovElkfWbNoxCRYAuHW/MVN23fELISau43v7zKg6GGzHGm3swYd9UaVa1ldk+ PxMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230107; x=1709834907; 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=lJ1CttY3QePOBroynm6EQeC99boR7JdlBwjlYres+fA=; b=hG95hUoXi2wSre810hbkRjtMQIpsfRy7lcn/5Cd72CRelT6G91eXsxJuYzaS4ZDQ1D Oj9VoruCBZuEaiKVntMJ0odyiQYoEFjNQPavvlTRGyrUm6GkWcFh/fjg+vQuBI3shWTU VrG5KfTAQwworQ6GJAYaxCGNbt+KxNRqtTi1IFskArJU0sAR0rFapx6wx38/Z/ydP3Mi tX1q205OzbFrIfotYVbBZ/nhxeT09d5THZz5Rl4Jewg5w45MehpYA0sMzYreG+YcJUbL UN97ca3+SaSgYaw5pSCPbQYPGaPPlVQ19HvajDy/fIRG8TtNxq7ABf9/iF4cejLGY1C5 uh4A== X-Forwarded-Encrypted: i=1; AJvYcCW+X8Hp90tpp/euHxaWrhIwBROdEvGthVubI7W6tKil/NgykvYBMIkmHzJd77ldJC/OJ8e1ZXSH3W5qrThv5vJiwyig7muKC52qsUOfV4m68hkm7aOn2/884H5cC2kldPLH5atYb+DQ X-Gm-Message-State: AOJu0YwbT9oUk5joRRh9k0zuBqk/dfWccQsj9AWhiapLeQdBxGSh+NJU yZlJ0GaEfb36J0b36Kh5lax2y7OFzKenRsRRO+9tSbBJInNKKyGy X-Google-Smtp-Source: AGHT+IFx8WHJYEtjEx85k/mCC4sEK18kSet4ygICvSqzOaSFu6VLczg+zdsVwoiA/Df4hawc6NCUFQ== X-Received: by 2002:a05:600c:4f86:b0:412:bafe:613f with SMTP id n6-20020a05600c4f8600b00412bafe613fmr2586709wmq.22.1709230107391; Thu, 29 Feb 2024 10:08:27 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:27 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:50 +0100 Subject: [PATCH 5/7] clk: qcom: camcc-sc8280xp: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-5-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: ff93872a9c61 ("clk: qcom: camcc-sc8280xp: Add sc8280xp CAMCC") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/camcc-sc8280xp.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/clk/qcom/camcc-sc8280xp.c b/drivers/clk/qcom/camcc-sc8280xp.c index 3dcd79b015151..7f0ae9a5f28b2 100644 --- a/drivers/clk/qcom/camcc-sc8280xp.c +++ b/drivers/clk/qcom/camcc-sc8280xp.c @@ -630,6 +630,7 @@ static const struct freq_tbl ftbl_camcc_bps_clk_src[] = { F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), F(760000000, P_CAMCC_PLL3_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_bps_clk_src = { @@ -654,6 +655,7 @@ static const struct freq_tbl ftbl_camcc_camnoc_axi_clk_src[] = { F(320000000, P_CAMCC_PLL7_OUT_ODD, 1, 0, 0), F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_camnoc_axi_clk_src = { @@ -673,6 +675,7 @@ static struct clk_rcg2 camcc_camnoc_axi_clk_src = { static const struct freq_tbl ftbl_camcc_cci_0_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), F(37500000, P_CAMCC_PLL0_OUT_EVEN, 16, 0, 0), + { } }; static struct clk_rcg2 camcc_cci_0_clk_src = { @@ -735,6 +738,7 @@ static const struct freq_tbl ftbl_camcc_cphy_rx_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), F(240000000, P_CAMCC_PLL0_OUT_EVEN, 2.5, 0, 0), F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_cphy_rx_clk_src = { @@ -754,6 +758,7 @@ static struct clk_rcg2 camcc_cphy_rx_clk_src = { static const struct freq_tbl ftbl_camcc_csi0phytimer_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), F(300000000, P_CAMCC_PLL0_OUT_EVEN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_csi0phytimer_clk_src = { @@ -818,6 +823,7 @@ static const struct freq_tbl ftbl_camcc_fast_ahb_clk_src[] = { F(200000000, P_CAMCC_PLL0_OUT_EVEN, 3, 0, 0), F(300000000, P_CAMCC_PLL0_OUT_MAIN, 4, 0, 0), F(400000000, P_CAMCC_PLL0_OUT_MAIN, 3, 0, 0), + { } }; static struct clk_rcg2 camcc_fast_ahb_clk_src = { @@ -838,6 +844,7 @@ static const struct freq_tbl ftbl_camcc_icp_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_icp_clk_src = { @@ -860,6 +867,7 @@ static const struct freq_tbl ftbl_camcc_ife_0_clk_src[] = { F(558000000, P_CAMCC_PLL3_OUT_EVEN, 1, 0, 0), F(637000000, P_CAMCC_PLL3_OUT_EVEN, 1, 0, 0), F(760000000, P_CAMCC_PLL3_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_0_clk_src = { @@ -883,6 +891,7 @@ static const struct freq_tbl ftbl_camcc_ife_0_csid_clk_src[] = { F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_0_csid_clk_src = { @@ -905,6 +914,7 @@ static const struct freq_tbl ftbl_camcc_ife_1_clk_src[] = { F(558000000, P_CAMCC_PLL4_OUT_EVEN, 1, 0, 0), F(637000000, P_CAMCC_PLL4_OUT_EVEN, 1, 0, 0), F(760000000, P_CAMCC_PLL4_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_1_clk_src = { @@ -941,6 +951,7 @@ static const struct freq_tbl ftbl_camcc_ife_2_clk_src[] = { F(558000000, P_CAMCC_PLL5_OUT_EVEN, 1, 0, 0), F(637000000, P_CAMCC_PLL5_OUT_EVEN, 1, 0, 0), F(760000000, P_CAMCC_PLL5_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_2_clk_src = { @@ -962,6 +973,7 @@ static const struct freq_tbl ftbl_camcc_ife_2_csid_clk_src[] = { F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_2_csid_clk_src = { @@ -984,6 +996,7 @@ static const struct freq_tbl ftbl_camcc_ife_3_clk_src[] = { F(558000000, P_CAMCC_PLL6_OUT_EVEN, 1, 0, 0), F(637000000, P_CAMCC_PLL6_OUT_EVEN, 1, 0, 0), F(760000000, P_CAMCC_PLL6_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_3_clk_src = { @@ -1020,6 +1033,7 @@ static const struct freq_tbl ftbl_camcc_ife_lite_0_clk_src[] = { F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_lite_0_clk_src = { @@ -1140,6 +1154,7 @@ static const struct freq_tbl ftbl_camcc_ipe_0_clk_src[] = { F(475000000, P_CAMCC_PLL1_OUT_EVEN, 1, 0, 0), F(520000000, P_CAMCC_PLL1_OUT_EVEN, 1, 0, 0), F(600000000, P_CAMCC_PLL1_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ipe_0_clk_src = { @@ -1163,6 +1178,7 @@ static const struct freq_tbl ftbl_camcc_jpeg_clk_src[] = { F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_jpeg_clk_src = { @@ -1184,6 +1200,7 @@ static const struct freq_tbl ftbl_camcc_lrme_clk_src[] = { F(300000000, P_CAMCC_PLL0_OUT_EVEN, 2, 0, 0), F(320000000, P_CAMCC_PLL7_OUT_ODD, 1, 0, 0), F(400000000, P_CAMCC_PLL0_OUT_MAIN, 3, 0, 0), + { } }; static struct clk_rcg2 camcc_lrme_clk_src = { @@ -1204,6 +1221,7 @@ static const struct freq_tbl ftbl_camcc_mclk0_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), F(24000000, P_CAMCC_PLL2_OUT_EARLY, 10, 1, 4), F(64000000, P_CAMCC_PLL2_OUT_EARLY, 15, 0, 0), + { } }; static struct clk_rcg2 camcc_mclk0_clk_src = { @@ -1320,6 +1338,7 @@ static struct clk_rcg2 camcc_mclk7_clk_src = { static const struct freq_tbl ftbl_camcc_sleep_clk_src[] = { F(32000, P_SLEEP_CLK, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_sleep_clk_src = { @@ -1339,6 +1358,7 @@ static struct clk_rcg2 camcc_sleep_clk_src = { static const struct freq_tbl ftbl_camcc_slow_ahb_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), F(80000000, P_CAMCC_PLL7_OUT_EVEN, 6, 0, 0), + { } }; static struct clk_rcg2 camcc_slow_ahb_clk_src = { @@ -1357,6 +1377,7 @@ static struct clk_rcg2 camcc_slow_ahb_clk_src = { static const struct freq_tbl ftbl_camcc_xo_clk_src[] = { F(19200000, P_BI_TCXO, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_xo_clk_src = { From patchwork Thu Feb 29 18:07:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577493 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 48ED37827B; Thu, 29 Feb 2024 18:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230111; cv=none; b=rrGJ2rot1hDdAIfWn2NIwUttVk0fYlZT/z4ai1uMTpTF3LmSBYaahAJYQPkldmb7QhhI5GrBw5KSgBvw2IOF0kPOTOT/uXibjjOBPaDHzit93AFspRwd5g0z8JRSEuicgM6jNssLmEhAz7qUwKetpNt16F6HLLgRcnWxCnzavBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230111; c=relaxed/simple; bh=n9HZ8WlG3tVYyfs4qDWScus2Mw1QcHzAyJ6G8lMbDUI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SK2OlgKQEtqxz/BUCpXif0oHX84U4uMfRwEfeBeiBKto6eByKfo2VMROOMXBC0u/Qk7yAStEfa0atmor34l8q/eBCWoQ6AaMA4S7ElTka9xaB9lSyjONfZqzfo/A3yk+1zWGxY7XsvLCsMWSfvHkeHe5B8r5avuWEcySOhz1Jac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bZK4+MAd; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bZK4+MAd" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-412b83cfb44so8094225e9.3; Thu, 29 Feb 2024 10:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230109; x=1709834909; 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=NHEkZ7LkAYiQY4fORY2GQCirviKcqtGOy+eYZIPtn30=; b=bZK4+MAd80pbQLPvrSbWzaixZiFbocFIRuvSUVeIwUpo5pWEGFpyHEnw/YzhNEie3f DWbxoQX7Sq6Gcrynyv/q6KH5YMaSERYglgu2abcmNEPoN5RZlkKkoaooLikPvijG0nkY HLrWRR8F8gKXbIl5rOe7+yV3Pl+0z9l4NIPXzkeXslvO8BvWwMqSOOzIOXQcQGETwbjy 221xCM/YubmvUSydW/u3BHVOyShrueQS1eEXeTgQIJN3c8q95lmsvrNaHjpVd535isZv AwUxyMfF8T2vsbeDdo6puoDAphjuPZnMbI2DceEouA5OYix2rlKAhvdGkRwucDF3X9ye a7FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230109; x=1709834909; 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=NHEkZ7LkAYiQY4fORY2GQCirviKcqtGOy+eYZIPtn30=; b=YGQz7zHti5xjlQaaMgCmmz7uzm9lSfucP63T4W12zqdQ9gHH6NTsxVIwVo8IVXS9Hm 6ezUDZDlSk9w0gw3fY4VM4cLwoxbHM8te3NCduPDkpqIqFtkN2F3R4j3gKMKe+gYjQv6 V31zbuVHKKY4Os/sLkjREycA8/QxCkkU0jT/QVkCHbcV0n50yO+MTRxUzP75ogNZiwMz fbQfc6b2YCUrQVzM5tboPMTOe/Nh9w1EfAd5UxxlwMkixlZs4CwTNSevEAbXGvCDdsZY 2g6H6ki9nCJOU0eUU35slUMPTiI9vVySEuDlXIkHF90VUvJawv060DIKUAu47aurLc76 0CpA== X-Forwarded-Encrypted: i=1; AJvYcCVlw5hpgBtejzqXr9W1gqprNc5AzpuijPWVxBIRR4VAzcUpHKxrXK4qB9xnf9krf6lU93Sd/M7ZYrYsqCktpKfcV4gLwMu0FsTNXzBXUqGoSyreSVyrzsocKQMhZrCUFnlOxvwjNj6h X-Gm-Message-State: AOJu0Yyt4wRQxo06U2YyaoX/LSMZ44DUbFCkAP529ByVfduwNAqfGRxG 3rMw40e9Lp1dqV2QbBgf18Q1ydCXSCNDp46GMLQ7vNfsK536u0rS X-Google-Smtp-Source: AGHT+IGfIk70CGd9jgpNki5T5kP9imwifMA1iTr+PJNC4QqaZd9DdaXiXHXzkUKKvajEwDWD1pzChA== X-Received: by 2002:a05:600c:4d26:b0:412:b6b8:b5f1 with SMTP id u38-20020a05600c4d2600b00412b6b8b5f1mr2464527wmp.18.1709230108724; Thu, 29 Feb 2024 10:08:28 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:28 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:51 +0100 Subject: [PATCH 6/7] clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-6-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: 2b46cd23a5a2 ("clk: qcom: Add APQ8084 Multimedia Clock Controller (MMCC) support") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/mmcc-apq8084.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/mmcc-apq8084.c b/drivers/clk/qcom/mmcc-apq8084.c index 02fc21208dd14..c89700ab93f9c 100644 --- a/drivers/clk/qcom/mmcc-apq8084.c +++ b/drivers/clk/qcom/mmcc-apq8084.c @@ -348,6 +348,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = { F(333430000, P_MMPLL1, 3.5, 0, 0), F(400000000, P_MMPLL0, 2, 0, 0), F(466800000, P_MMPLL1, 2.5, 0, 0), + { } }; static struct clk_rcg2 mmss_axi_clk_src = { @@ -372,6 +373,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = { F(150000000, P_GPLL0, 4, 0, 0), F(228570000, P_MMPLL0, 3.5, 0, 0), F(320000000, P_MMPLL0, 2.5, 0, 0), + { } }; static struct clk_rcg2 ocmemnoc_clk_src = { From patchwork Thu Feb 29 18:07:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabor Juhos X-Patchwork-Id: 13577494 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 A2A6F134430; Thu, 29 Feb 2024 18:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230113; cv=none; b=B8wZxz2tsApCutqoRMejM56iytH3I+7+DmB34S5Cl3NOXSbobBsYJbfaDG24RHdlNPJtq5Ms0CK5XQhgnDAD2LWm/KF+JCChadLBRO1uTNfNL/TNr/JZebDJ7ZclrxE6Jd17QLNcchYJ2sgkxJMn1HIykN3SmbSvNvwLfAYTOcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709230113; c=relaxed/simple; bh=RzhBA7EI+AvZLHUDZAghc882r6aBdz/AAQ9BqIdQzMY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OTQ0iPH7G5RQfoyBipQpZY8u7sPNu/krjQdGAblL63ska+yFcWA/LPTANkJvmCJkHjurfWjTH3s9abkSh7a4zLDB6pyoy2zSubPnS6sQUxLk4v+EwhbnnFjeWyyjxLnXSANyL69/kD6d2s4q9quINg9Cs/lrr57wunkNLKqseTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eVm7/hCX; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eVm7/hCX" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33d90dfe73cso719926f8f.0; Thu, 29 Feb 2024 10:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709230110; x=1709834910; 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=AKW+JTh7ZVcxWjWl6fkeHkCopDJAnEXK1oMhXl+IbeY=; b=eVm7/hCXCSB2xqYU24KKJEQOssd694VA3X72iGEIXMHM3BafPCTfEzt53CyfA0XwW5 0lW/uq0Z7XmNGfGTuzIfiCpA9ERkAruWQD++g2+Ku2CDVM8yHECWzOoM6I1hgEUfSUMf MZ+yDuIT54ZynxlbYO/CZPUjm1q/9LCFeJiM8E2jrB5n6zBzXCtqxMgPuJs1qgXsqdcZ +csNQc6DZI7dlNNroKpM2cJ3ApQO3d93ujie6ucDGOXkBb2VsgfIdJ+C8291Ov5B5uIW frr+zZJD7Z0qi0e0ZhS6WMO05igQWaEBwv/S3fDiN9flWAePW59DO9timTStS+r8zPpm aTnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709230110; x=1709834910; 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=AKW+JTh7ZVcxWjWl6fkeHkCopDJAnEXK1oMhXl+IbeY=; b=D7lQYu5XXruEyiW8Kdx3qIroeJvOYJEJlpb2MMPu7JwsMlqDySU8TA2jHVaUIAnWnb 7aXcuBl4i23iS91tU5aHATUAvc1nvDObbulXTS4FHgtRs22s9lh0uy5y6TfzdInhYlsC eqhTBbAK9O0eizQ2ivv+cIz+UtIwMDGQJk+cZmIH6p+lFG3FTBngbUk5G7lrye1C4CeQ VXZl2K0RRzPdivbGww1VkkiUThm/HR4ungkQOufMD6hywq9FlF87uA7wcgZaq19xax9z x+/Rf8CWuqhX5MsvsU+IbREOA92rk4L0G8gSiGzdm2hXG7vmL7MImrTsncBSStKqJCcP 8gmQ== X-Forwarded-Encrypted: i=1; AJvYcCWxgNgivSHTzykLHOIwgCsr2kxjL+flqUC/g9oERp8a0IAjGX+T8i7LPhDvZLxvjB3sMXEXuojoE6lmXGlW72BuqybN48pny/JavZex0YjYjgYQ3n6w6p6CLTuKalhuOkNb1+rLl2lN X-Gm-Message-State: AOJu0Yy6kzwRXmkKA7QYcqgbJy3diYOwJmhXd66EHu/wBRbOsylmoWu2 RRUROuvKF3BjNQT5eRhZoapzQ2yRG6JIBP/J1R2Hzyaaa8odaX9q X-Google-Smtp-Source: AGHT+IFUxNMPTM1Ga7zfS168Xb0IV1PNWM/z8HXaluNXepo4buu4oO06cDiHid6vaB41t9A7fb6YVQ== X-Received: by 2002:adf:c5c3:0:b0:33e:12a4:8619 with SMTP id v3-20020adfc5c3000000b0033e12a48619mr2547610wrg.24.1709230110057; Thu, 29 Feb 2024 10:08:30 -0800 (PST) Received: from [192.168.20.102] (57657817.catv.pool.telekom.hu. [87.101.120.23]) by smtp.googlemail.com with ESMTPSA id z11-20020a1c4c0b000000b00412ba5cda16sm3100620wmf.33.2024.02.29.10.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:08:29 -0800 (PST) From: Gabor Juhos Date: Thu, 29 Feb 2024 19:07:52 +0100 Subject: [PATCH 7/7] clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240229-freq-table-terminator-v1-7-074334f0905c@gmail.com> References: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> In-Reply-To: <20240229-freq-table-terminator-v1-0-074334f0905c@gmail.com> To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Sricharan Ramabadhran , Varadarajan Narayanan , Gokul Sriram Palanisamy , Devi Priya , Anusha Rao , Bryan O'Donoghue , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Gabor Juhos X-Mailer: b4 0.12.3 The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor(). Only compile tested. Fixes: d8b212014e69 ("clk: qcom: Add support for MSM8974's multimedia clock controller (MMCC)") Signed-off-by: Gabor Juhos Reviewed-by: Stephen Boyd --- drivers/clk/qcom/mmcc-msm8974.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/mmcc-msm8974.c b/drivers/clk/qcom/mmcc-msm8974.c index a31f6cf0c4e0c..36f460b78be2c 100644 --- a/drivers/clk/qcom/mmcc-msm8974.c +++ b/drivers/clk/qcom/mmcc-msm8974.c @@ -290,6 +290,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = { F(291750000, P_MMPLL1, 4, 0, 0), F(400000000, P_MMPLL0, 2, 0, 0), F(466800000, P_MMPLL1, 2.5, 0, 0), + { } }; static struct clk_rcg2 mmss_axi_clk_src = { @@ -314,6 +315,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = { F(150000000, P_GPLL0, 4, 0, 0), F(291750000, P_MMPLL1, 4, 0, 0), F(400000000, P_MMPLL0, 2, 0, 0), + { } }; static struct clk_rcg2 ocmemnoc_clk_src = {