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: 208457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp584152dyb; Thu, 29 Feb 2024 10:09:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXUDzYTzpnMJrNg6Na0SS85Nq3Y7GJuanfD9VD7ywubShylrcofS/bPg4lB3czN8P4i7iOybWTxgAQM5AEZ51fh0Vvl9w== X-Google-Smtp-Source: AGHT+IEjrWSzLd+hygKBizJh6uAh9/39acJ2tH3h/9oSSocXER59mBq4CI/RQhZnn2kLbC2KSOT7 X-Received: by 2002:a17:903:228e:b0:1dc:7923:aa17 with SMTP id b14-20020a170903228e00b001dc7923aa17mr3549679plh.64.1709230142542; Thu, 29 Feb 2024 10:09:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230142; cv=pass; d=google.com; s=arc-20160816; b=ULV+6jVs2oCRijFV56hqDHnWy6bt18OLfBqLHm/Z45y2TByDOi6TqdupcdyzShGTqF gbZeG2KBSDnqh9f1WuH9/Q5Lnhy2nCeKDr9OMfx0IktbQtr/RuobtKgmJQDmXx/Mk+Ca /Xm7kXyd2NR5d0FYh4UvCTjk+i1+MkzgwSoDXcsJsBS6Q6B1FSC4LhG7/G2m55sq0ghE S8ciohCVboaEPC8WuM8h1wPNToHx4XGh5S+N2mSTK7pnnftXtVLl1ukPg7SiNEH+lkTS Zkn00UqyyigXq6oQhHABZxNy6BV4LmSSak+74jvtzt6gQPiB1/JYFxklgsoZZ0dWmj4v x42Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=kH08pUQU08Y2ZLx4/JDTMu/sqhpXrAaQNeadE+HITMA=; fh=3yOoSrJH449bR203AMQnC11yMKcwWH27BOwFmUAq6wM=; b=Smb/uMSyGVhRuPCcq1ti2yxe7SOJN7pMbtHku8hnxh4R5kJZ2ciUYVwLgyBrXN3Ssq /Lu6w462WGlCDtAF/xgGBMzxHyoPddECrdPapDXJWG5fi0p1BFVF0UYOF5Lx8amVWza5 5OdKXAioLQYa/Yy3nftOC1kITPSriMQo9Kp4sR0IGsN3c1b4Y3cG5FvXn5kwE2GCNgAb Xb878jFWlA2qLo/kIaVmaVu+abCxA3vknaNIupHnZn/Dp689Nm+YDij2h1cU69uLOa/7 i2SiwwHm/Y+9XJt7mv+/RTZFYuAApi5J+7Q5w9iS6Up6Y55uwRvTsY8Gym+j1NpGxuKO /GVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hVBq1Kss; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87233-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87233-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id iw4-20020a170903044400b001d917fa8be8si1704747plb.257.2024.02.29.10.09.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:09:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87233-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hVBq1Kss; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87233-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87233-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5BE4F285BD9 for ; Thu, 29 Feb 2024 18:09:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 469DC7A15E; Thu, 29 Feb 2024 18:08:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hVBq1Kss" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257706208658829 X-GMAIL-MSGID: 1792257706208658829 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: 208458 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp584340dyb; Thu, 29 Feb 2024 10:09:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWJxZdIOvszlH//RUOxP0zYV6281qhA7Zn3dZHFvUzlgTegFiK6qO6uWysxPnXKDohgLjiMfQGlwfK/OeGdWgsz9da9Q== X-Google-Smtp-Source: AGHT+IGKV4KToNs8YtXvG6Gh5mk0jSi48StwCmWOUoXf0a/ac7cxTMrAGmoM+mPLmFlel4J+uSHN X-Received: by 2002:a0c:f94f:0:b0:690:4de5:848a with SMTP id i15-20020a0cf94f000000b006904de5848amr1483142qvo.24.1709230158862; Thu, 29 Feb 2024 10:09:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230158; cv=pass; d=google.com; s=arc-20160816; b=h/G7XIA9zEAaATjJQ9XY7uFxdMyriSVfw08rPVQUOA5YiMQPW0tFPU4Picb1KW8ZAe k1UiM8NDbxjw5/9TnxTtTrTC3PX5oNCNjHPaqf3pnN6y6TDqCbEGt0NeVigC0PqDqo8A +cuYsRCjGx05H0CTgBnLF0YUvz2bDHI90dk0PCaaRRARFZdwXvfwv7b/m3kM0FI30Ljp dR+AfnZrf/FjUjfQg6jBTwvoloessQWotafrLR5nsF6Ooeu9F3/AZ1618EkvFkA1lrXA O3othnJ2w0NwhnlGPYk212EKs/hp72VDJ8XosFGCgNOH/DL8vk65UO55GQdOeeqHfbeC PzQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=OYAAhEwR/E+dbtNSsly8JocDfIPA8JdctVrwVBpoHmU=; fh=HJy+LqPkp96+TDN1xq4EQtnq8sxBBOvlT3H8+pk1e+U=; b=wK1mjJsbBcwIIv6+wpCYFtQNUwp/gNroc5cmPdcY+WbU3DW7WmTeow0x6RgceWV7uB BdowimVfLEhsv0PGJ2l4Zlz+PB6lN2Jqa2nVlktVr0JWyW/5QZvcrdu5ZRZM0Ko3qioS S3BiO8U8+dBobmmEsPhhxVZORXkye88WazYaJMzm+4+LWwnDHwLg9U8Ka9S+sCGpAjz0 FuYXkcxPnxQHCawT5MeP+iOz5hAQYX3BOwY4dhH5zypYKcmV6YImPoh8bL50JSqfph8k iWrSaoZQfvO7S6E9A46LSlhNoBSHuBkZNjpMTj7p/MZDKPGonXtcYV8N4gfRF9tlrBL8 usLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=As62mqys; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u2-20020ad45aa2000000b0068fa92d429csi1848997qvg.204.2024.02.29.10.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:09:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=As62mqys; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87234-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A541C1C2282D for ; Thu, 29 Feb 2024 18:09:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90684130AC1; Thu, 29 Feb 2024 18:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="As62mqys" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257723561386759 X-GMAIL-MSGID: 1792257723561386759 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: 208459 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp584528dyb; Thu, 29 Feb 2024 10:09:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1KTJZnC/Cv3+iuaCzvfJxI740/CngG2Aw6y2cUbKU3bNB5YPs/5LmvD9dRp1vcyt1nWoqlCzvgfw1NATcEw3KiAZUoQ== X-Google-Smtp-Source: AGHT+IGrl43l9Ba9Pvr71Gg48cCbtIaU8o2A+M+VgpoksWOrQC+UkJdOsgFzTlABQuY8xtyL5X4i X-Received: by 2002:a0c:ea87:0:b0:68f:6dc5:149c with SMTP id d7-20020a0cea87000000b0068f6dc5149cmr3068923qvp.61.1709230176644; Thu, 29 Feb 2024 10:09:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230176; cv=pass; d=google.com; s=arc-20160816; b=S53GQGPQioqqdSsosXpXMmr24XCnMk/pFMb2442ecV3SGAJC7UHv6wz0tx0ValnS4A NSZpAT9TVYjqWG1eX4d4BEL+5i/6+tt0vZ+4B8W3pKVwKkkx+7dh5xqzWYtNE6wYLV2E llXMCqbzI3SJZqHD9ReB8+ApdGmX3ti2nDF1YgfG8GQmQXf4NXVKLDgXZqabt1F1n7Cx mTcFClIJOLKLAq3GbJK1RbRydZQp/zXCntgq45ojv4B+ZySiW8/2+FQfbV+fO0PeSnOv xMonbvy8s3hksJCn8DoQZZbfXt1dhvKZno735qajVj3yVGJGXdyiBqmI2K6CeEQI9bUg vneA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=0/Xm60hjVFDoBBFKWZ90/O5g1Yww87R9nHLMoER0+64=; fh=7u1sPTjnVHka3qo5wplP2YqlRO9XJfGLOWc/gkFAMT8=; b=yW0xwNRF2w8x7RzVl6vCT97ruZVSsVzkW2xo1l65kxydBngAXlCr7CPFjZCE3xAG5N m6dW9oi4/OeL4UI3NEqLb7dOVzr6usbm/+RRoGCkzVLtErkXs9WbZ264C/U+aMYC0GYT yfV0cx45PbIGCZLIUGN5y+RnG2h1kUaV+PLgT3gLevuo/i+0gT765nsCjOOt+AJO6IQu Yo1FJV0NF3WhQCMZyb33mIUqpukJT3IwMksb6TSv5oL6cWlVItn15K5rTz+N4apLKhIq PPRO8W0SiDvgHHEdABMbd2sC727+PsUIRvqchOtvBT60RKKZa7zqELP1phkglbaudtFw fWuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Tp457hfZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87235-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87235-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j9-20020a05621419c900b0068f13165047si1945950qvc.0.2024.02.29.10.09.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:09:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87235-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Tp457hfZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87235-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87235-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 715211C22952 for ; Thu, 29 Feb 2024 18:09:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 347B2134425; Thu, 29 Feb 2024 18:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tp457hfZ" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257741512318831 X-GMAIL-MSGID: 1792257741512318831 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: 208480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp590847dyb; Thu, 29 Feb 2024 10:19:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUsKLAoixwQ/IT7wDMtm8618RaJOU5woDPeI8IxAYB+a90SIA02IIG+/pIk9EG/OTJOJ41xcnwR9d8FKVuCBbUYFgygaw== X-Google-Smtp-Source: AGHT+IEAzvJ2VEkVfiUnQ8C3Z65DzxRQ4/dR+4NFk/tTcogEdTb6xqpltzsGCfqCP3F3e5v3uZ/9 X-Received: by 2002:aa7:860e:0:b0:6e3:d201:3f87 with SMTP id p14-20020aa7860e000000b006e3d2013f87mr3101102pfn.28.1709230743647; Thu, 29 Feb 2024 10:19:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230743; cv=pass; d=google.com; s=arc-20160816; b=RVFnKCQgWS5+4Q/Hdmk5WAjoi6JjYD2mt8Ywg7zOsXaP53ycecselCuFMUanagg/ZC 7mg6ZrctHww8X4DjOM2GcwO57ZhzGok3M5ojU3TxjaaaEKEc6NssqvgaH2BylbAHy6SD X+iCkV1zhINfq4EhWh/PZd9x84KAYF0Wbx3lt4p1RVng3HfP2wTribQ53tKa6MBLr8hF L5HS1nbqrCgtYrdRBA5DJm7rw5j+/Vp/PIAy/zk3b6ao67SgXtK4fvverrOeP+0v1arG EtRbBgu+uN8wTpyzNyN7AQMVgakqHyrnvdsDuLLaYxvfBsVJa8i23aZMKDQcR5vwfr4I B/oQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=qwB5GZyUp0vVrDZTlAHMqUR9YgdQhpTvdvLOlvDAWYw=; fh=2whzRfwJZz8qFt1TLoI5QBim9wGW3GagWVSbYiIFJYY=; b=wuRFvDyd7JOgYAMPKCDysC/pBD1IDZZm+zZ9IvokVo9611NxlV+TruC+W4dtemvCd9 fTBFncVcFe0WL57+BmvwNaAW2e0iEkbzbqXxUSu55zRb29C3vKeaROVDonwV2FkS7TZV G2MPLXUsZ4rh3TPtYEsvaRzXXLzVGvl80hyMlqHQh1vE3Geq1/1/k/L2ukYam5aOwUzX 2V7MoV8eTe4zAoD5nqHKwKAzu3C3b1yfGTodAAfnCzyEdEDqWZ+UJMpCJ/c8r8YV0Lh5 hfK0ZbusFGczd47N+OtHnqWuso5CH0dNZ5xOrYtQOhWk60wumPmuLocXvuR4dQOAYvsT FEPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WB943cBX; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87236-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87236-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bz41-20020a056a02062900b005dca1e01c0asi2031520pgb.880.2024.02.29.10.19.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:19:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87236-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WB943cBX; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87236-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87236-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 83861B2454C for ; Thu, 29 Feb 2024 18:09:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D3E213443E; Thu, 29 Feb 2024 18:08:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WB943cBX" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792258336393001001 X-GMAIL-MSGID: 1792258336393001001 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: 208460 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp585033dyb; Thu, 29 Feb 2024 10:10:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUdkZ/8Xn1PtcZ9Fmg38y7TFIi7oabkZx8PsF07Tsj3VAnsOcpUoZP5GFtKZfp9A8ZTcoANQYGXTp+f0lQlilGQrrLDFA== X-Google-Smtp-Source: AGHT+IFJe6pG+D0XVEg8CAZrgCe0bN5x4cEDJ2f+vMGSCBBjWf3BNi6nd20yu/2a1+SzqA7fS1O+ X-Received: by 2002:a50:cc08:0:b0:565:ddc7:6dcd with SMTP id m8-20020a50cc08000000b00565ddc76dcdmr1969370edi.8.1709230216091; Thu, 29 Feb 2024 10:10:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230216; cv=pass; d=google.com; s=arc-20160816; b=yeeAZtz+eaQrPdHbI3ilG5IUuL5BHiwtMCGFx50tqQFj9Ey/IMi26GrZD114r4eEId Ixusa/RUoq9k+4HMRPzFab6/bhCf/P18q+ml5l+MOYRzo7j79uefDxCVAddYOHgRoh1J ku3AFJLMjLFEP9AbhVihK8h81mdlz5Gb0AcXeAycHMU01wE/gqZizdDk2Demuveijy1l DGI0o9mWuL3wDB5QA0oE6MCzKGY+nim0gq7hMSFpAUraOHDcn6BYdvey+U7FUDr2Qf1l UuypAmCRkvh9K3+hO7t+aUSA72j+y5+vd9Fn1CyqgzSzCDtoTHKXA1NnVrkUSxaH/6eU DTUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=lJ1CttY3QePOBroynm6EQeC99boR7JdlBwjlYres+fA=; fh=fGkl903PtjXsZ0Xyx+eNv2U6asvlT8UTyA6ZwAVEt3w=; b=pVq7S0Qy8/SPe7wRqM9J0TD6hwQxtZoISqMhUFR9NcTb2RBKKxAr/Y7PuiTh8OhL3j C4gyDi/2Bo/fiFOLJxlIBowA/9gCNN7j8EtTlU6DnSS9vahaaLHGlqCyIxjYbEbcN4/K T0J3iRR8GBs7Q560BJ5mQSonCJuiF7os7pDb1cjRGqToulsE+lpcd64hPgUHC2NxyyTq mPTuqnACZYlLPrkz6t7Ym/54XaRU/4cNLnzkVJlqxleAW/t3Xkbnh5NCzvacek31KWgV Glf3vjgM+r0NG5Yw03Mxy37Nr5Xlg2aKNag13rQueDFf/qTUvnKFmNHmv3fzPUBPZYj2 dWkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="kO/Ks9Xc"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87237-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87237-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b11-20020a056402084b00b005665c07b967si770156edz.57.2024.02.29.10.10.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:10:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87237-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="kO/Ks9Xc"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87237-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87237-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7EEC71F261E1 for ; Thu, 29 Feb 2024 18:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4FB713C9DF; Thu, 29 Feb 2024 18:08:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kO/Ks9Xc" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257782815796766 X-GMAIL-MSGID: 1792257782815796766 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: 208461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp585518dyb; Thu, 29 Feb 2024 10:10:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1hbIs11eXDDu8FpyQlrJLNG0/SQwjvmTBLml5PvJuTZv6OgZpIAdC1UwUpjwPABZ28nBi1eWc2G09hFEAnX36+qOUrw== X-Google-Smtp-Source: AGHT+IF87JT9OfUOg8YioOUqOS3DBc4b2yXONAseOBrvUNPgFqhJqxjKDi1RpFRXLWL3Agi4qNIO X-Received: by 2002:a05:6214:1083:b0:690:45ce:8e52 with SMTP id o3-20020a056214108300b0069045ce8e52mr2685219qvr.60.1709230249676; Thu, 29 Feb 2024 10:10:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230249; cv=pass; d=google.com; s=arc-20160816; b=IVr62C1riN83D1vUFZhjYU4d6xHkoVJtDUk04qP770mOx9Z4CKmEZrLFqC4ahj78jp Ot/NykF6QiaCEL7z+hYcGJvBcHZElAGKEbbyhOCwXQmdoJzWnxTmSJPXl8XWfKE2zqlR Z6htAc62iUc6mIwkmKyaFgmdpPOce0iWG3bNoLYbk7ugOxm6BIV0UTTNrP4LO/HgMrOF ysBIH5TzGWxj81tIu2yotDglykxPsmHX3OJSz06Up4oJtzG14RG65uk9ogw9qEKA6t41 r18Mv43uYJLkrmVeUCW2NUoAVORitPXBfFJUAbyWxRK9tqWdH4F8uTw0sH/OM40XSyIv +jFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=NHEkZ7LkAYiQY4fORY2GQCirviKcqtGOy+eYZIPtn30=; fh=flCLIWUQA0TZVOFuQ0yehphjLnptWnKUcH7wDGZaHFE=; b=WxtrubC7HPFJVfqU6ajmzU98cc/3yxa2DkmrygGCKwRdP3cSNN6qdStMZLH8FEMhOA E9Bawrv4zBJek9DOA/rRSEHfBkIpQday6D9yqoO10bUWeJ54XKZ6OJWL5ZCKcjK0d45N sCTO39Yv6MayT6f5YN4I11+dRc84dTynDHFz3mvFrYkWNFA1E0A0IEY5629jl27AYE29 jy26vvkUuf6FPV1f+9O2Fu++J5+SWgIjcMrO2jPKFqDXDHO8dj2xbztxndsFerI8EFRG RzCgOtsZde0VezzSgBmGEdX4dEjxzN6zMRbTRs3SOpZkFdC1F8KGOiconyhP16apVfKw oF6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bZK4+MAd; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87238-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87238-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iw11-20020a0562140f2b00b006903929aaeasi1807573qvb.36.2024.02.29.10.10.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:10:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87238-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bZK4+MAd; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87238-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87238-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9D0771C221EB for ; Thu, 29 Feb 2024 18:10:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2204C13C9E3; Thu, 29 Feb 2024 18:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bZK4+MAd" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257818581121053 X-GMAIL-MSGID: 1792257818581121053 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: 208462 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp585575dyb; Thu, 29 Feb 2024 10:10:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUxmGfrcZ3RvAIdCz++1Q3iJ+Znuwye+kjNmsLrfXOuYAijDFxlMe6qiT5wYYV8w8gFzalO/1W9lIor06hnj4Z6hNLnTA== X-Google-Smtp-Source: AGHT+IHAv+GXtQ/hEfr2X//I9VSXx2N2wmEjtO+qgzfk16oIBHtmu1T9WlXAbsTyCoLP+7G82+PV X-Received: by 2002:a05:6871:3423:b0:21f:236:a316 with SMTP id nh35-20020a056871342300b0021f0236a316mr3174931oac.50.1709230254279; Thu, 29 Feb 2024 10:10:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709230254; cv=pass; d=google.com; s=arc-20160816; b=CUmIqcP4xx8LxjbNhpItmWVU+kZqWrJtqzo1hqcDQucf1/WfGUqv/nmupagb6uJRIQ 8UmY96aVELHLYxCWWwmkAbLJasIAGSsONT/v0AfGGSyap7gZybJJStJkXljjvJkgAVNg P0x8x+jw7+DqY2eMVzc7QX5kyAUYfG78vsQjvm+m+digbPIpWtrL5dMNfZOKP9fLXRvO r01PYFn4BQqcrrk5gW6WTu5bv1Q3DQooos26ZnB9dNxJDod/Xh/5tQz9GjI8NPVPMMz0 uWDPt4L9yx13HYVVNBw5KQ3jS7vkITbieMOLQ+gTPQdJDcKKHJqNmeR8jJ2xMDZytG1i kH2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=AKW+JTh7ZVcxWjWl6fkeHkCopDJAnEXK1oMhXl+IbeY=; fh=wYhbkPVVx2bGop22m+ldPQRMbonaCpMSt315D7ont1c=; b=U9kbWLxOwlpsCXKzCRfm6yizoYI2p27eI537bsStMOji1tU7WQx1I0NNaxU7yiRFQS 5M4r+h3xfE+wuijDMeMJkPI/oPuiHN+NZmwVSt3xuLmeSTY9rhCCi0DWq4IYb+WZJU3g vzf/pVm0A9yyoMb0/7rnQvRjh5dLRt9UwOs749W+xhfQJQA5ZTqk6mVBrHm8hJFFYGY9 HwzLjgWUlzVtZo1M3FJDO5ll9pjYwtyMr+EMVpNJ9Jcm2sTtimHJ/YMwswfeyvdn5Y65 zlgP53BcjXfMn28BwFXvq+EVF6etUByt5VDfjpbIGOwzBrWUQLVpIC/ZZYap1cT9IZN1 /e9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="eVm7/hCX"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87239-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87239-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k24-20020ac86058000000b0042e8b8b3051si1782536qtm.46.2024.02.29.10.10.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 10:10:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87239-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="eVm7/hCX"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87239-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87239-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 698C91C22D09 for ; Thu, 29 Feb 2024 18:10:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2318613C9F0; Thu, 29 Feb 2024 18:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eVm7/hCX" 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 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-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-kernel@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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792257822987826440 X-GMAIL-MSGID: 1792257822987826440 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 = {