From patchwork Thu Jul 27 16:17:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 108841 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2265964qge; Thu, 27 Jul 2017 09:18:11 -0700 (PDT) X-Received: by 10.84.229.5 with SMTP id b5mr5025473plk.216.1501172291339; Thu, 27 Jul 2017 09:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501172291; cv=none; d=google.com; s=arc-20160816; b=h94pBzkQrtzsHMhidj2fgff/eEiIQYD9X6cIrLQBxzEjSxq0BI+GaFvgWYqNa7FjlM Ajukjq1soqaS4bi/UkQNm2HCEmlkPhuQHSgSYADJB7UxI0ljc6KBtsRq/kMZaFrwud/n TqxeV73NBP/2Aa4WAKIGhDjKB8RWPMDnGZt4HKuLzVdCZ+fAnJxv9hjulBp3OS6k/slU QICWv1NG+hYVPHhkHdxs+eUk/+xLokLOpRO/o5XrdomNtEJBM1nRaooZg1J7t43Meap6 hzaiQIX5VxflBWyMgdYjVYnyeuDmd4XHXwnEwG3KsrUsoBzfeoOXFwF7c/cqt0kjXnQL 4/8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=xoQ0LuIVT8ufsUXNqvLYgYjYRwlblVnMOTqqQwh4e7g=; b=x4Cav23qS1/TnES6X8mQC4tw5ah4Ilzp/5/mAZOIpmPP9m0q+eclt8xhn0ecgIQmez 1RgV916u7VkSpgrZUL0w20lC61PTBLZlERliyxEn43J55ERDFHCZpTV1gkPem/glbeob qsWreZMdd/Mg45KaUk2hdA/m5qpNRYqmtq/TSJK9hm9QQybSXGyTYqBlxTa4UJVbzkKY Zz22DtWwO+Pcz/Otyj2LCJP7hbOzBumsnn1DdVS3amKpQ/NQHwRH+pht00tzi8CbUdZ7 IqvGiXV5kVSfvZkvYdck1P9k8sdShUqP8KRXO2+EOiW76F/Ptiwm9pAQj7P96lT799Ue cCyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.b=v5jFqnWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si11044318pfe.209.2017.07.27.09.18.11; Thu, 27 Jul 2017 09:18:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.b=v5jFqnWO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044AbdG0QSI (ORCPT + 26 others); Thu, 27 Jul 2017 12:18:08 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36245 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751867AbdG0QSA (ORCPT ); Thu, 27 Jul 2017 12:18:00 -0400 Received: by mail-wm0-f41.google.com with SMTP id t201so103887630wmt.1 for ; Thu, 27 Jul 2017 09:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xoQ0LuIVT8ufsUXNqvLYgYjYRwlblVnMOTqqQwh4e7g=; b=v5jFqnWOnzf/3+E+kEtuhOJuYes6eRlMrOvb8cqpvpWP7XjR8qZM+Gr/LBfWd7YE1V U2Edx1q7CwbHWoiuXmUoAnpX3iiJNDjfzTLAXD75WIYjfBFiLP13DRwbixjtHsIVpbaZ uwRNmZjElSgbmM0HTWhvINVb3H5Oj+lR8hvRLp5z5RyJuwdA/emsuWNDvwaVcGVpfZKK /sXlik52ZQfmXD+txoyny5dHiDlinM3ZTDi3fznyQGDKdkp25sOuyGYImb9y73wJy24L bGa5U8GE/g8yWzKvJmAetPqX5PbmWV3TDVF9fklerbylx+SkHivEslpkf52uekAehES0 udug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xoQ0LuIVT8ufsUXNqvLYgYjYRwlblVnMOTqqQwh4e7g=; b=MPmxFr2MUzjxnIVvAwb0siAhbxeiBuCWwh20vhekH3aLWspm2ZdRldmkwebF3JhD4F hKdwRQuYUw74Z4NLPrxW4BeMOS652rcFyPw/ZAkpzQfXkedOeLFVe3epS4GeGb0P3Fh0 jpllPMky2AW3gnSIkUwdPBdrW00oQhcczFFl3XnknlUtjj/qIOIOr8gixvBkYasWgunR JPZ25GxeKZxx0Dl5VLOHASApTHgm1jx89/v0JLJCTINQX2Lap5UmEepTlJbqL636fBd4 XDeYvZ933bJuyRTDnKkfENiTjrMK7O4LzVZRnb8/l7pnzWd1zXYOjpuWd+GaPeb1mwJB +9MQ== X-Gm-Message-State: AIVw113jiRcNhfjRGrUfwmZaVD+7E46KISEzMZ4vwU1vUCo9ZIlW+FaY de4V6amClOP7xEe3 X-Received: by 10.28.33.67 with SMTP id h64mr3570810wmh.87.1501172279728; Thu, 27 Jul 2017 09:17:59 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id w19sm16128125wrb.49.2017.07.27.09.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 09:17:59 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman Cc: Jerome Brunet , Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] clk: meson: meson8b: fix protection against undefined clks Date: Thu, 27 Jul 2017 18:17:54 +0200 Message-Id: <20170727161755.10393-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170727161755.10393-1-jbrunet@baylibre.com> References: <20170727161755.10393-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org meson8b clock driver gracefully handles case where the clkid is defined but the clock hw pointer is not provided, as long as it is not at the end of the hw_onecell_data array. This patch ensure that the last entries are defined as well to handle this particular case. Fixes: e92f7cca446e ("clk: meson8b: clean up fixed rate clocks") Signed-off-by: Jerome Brunet --- drivers/clk/meson/meson8b.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.4 diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index bb3f1de876b1..7629aa09472a 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -585,6 +585,7 @@ static struct clk_hw_onecell_data meson8b_hw_onecell_data = { [CLKID_MPLL0] = &meson8b_mpll0.hw, [CLKID_MPLL1] = &meson8b_mpll1.hw, [CLKID_MPLL2] = &meson8b_mpll2.hw, + [CLK_NR_CLKS] = NULL, }, .num = CLK_NR_CLKS, }; From patchwork Thu Jul 27 16:17:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 108843 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp2239488obm; Thu, 27 Jul 2017 09:25:53 -0700 (PDT) X-Received: by 10.84.224.199 with SMTP id k7mr4873689pln.354.1501172753434; Thu, 27 Jul 2017 09:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501172753; cv=none; d=google.com; s=arc-20160816; b=yr2IfA/5wMr5ef5A9mDMPWv+w/bH4EBdNFqZHF9m2oZENfcnh7yZT7T53Z92cARBoa LaErfM9V8ky7uNijcCXT6j31zF/2qkxYg5nU/yfG69ifMZo8GYvbhgELT5JlwSzS0WYx ri9NoQNeqrloxHZ4ft5fsRZ/+xCgwc39989zqODbdnlL1so0GrJu0b7w7qMTh5M1v/Ze lfZqCEpicWBsBVboHkA6+bO/+LXSfRVDYhdu6JFTH70xpFvcRs08hRuuYy3WaiBGH8Yz PmsuHR/qATA8gsn25WeANC4E7Z2Wczu0cXpPTn5wojoQYE/9Pq33F5q9JropkGM8xZ+R 5q3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=EAABz+oYYNhLuBBaae9yyiAWL37RWjdpMLVRC03GgOk=; b=MIvaORE5C1eTra6jEjkJ1Ta48V7QXbFmtSzGFaP7re3WNh6H35cGBYafsRQIJl8nPH z+ZFuhgYTn7qdbA5CdoEUyawX6Vxz2IR92ecO1GTee65PXLjnUSb2Ydyy7jLcaAOPlo4 qE4xYjWZAMiM0dNste/2LZv5VLxpxOhQmlmLtGVRd+XcXmMARtI955L4YzWHdQijPIgk H9zh4xTQT94lcADaC77t+Bc92iqxtaMb4wlY2RlLMf8aAS0kf3m1hSFUmWlZBUKv7kwJ Hs8+vZkAO4HYHN96D3heUw8SeBWGztf1TzyJ1JwvM+ZWuqCRAFIqiAYd4zXdLlZZgwj1 90HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.b=UYDC8YfP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si827001pfd.557.2017.07.27.09.25.53; Thu, 27 Jul 2017 09:25:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.b=UYDC8YfP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751582AbdG0QZu (ORCPT + 26 others); Thu, 27 Jul 2017 12:25:50 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:34733 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbdG0QZt (ORCPT ); Thu, 27 Jul 2017 12:25:49 -0400 Received: by mail-wm0-f48.google.com with SMTP id t138so3999316wmt.1 for ; Thu, 27 Jul 2017 09:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EAABz+oYYNhLuBBaae9yyiAWL37RWjdpMLVRC03GgOk=; b=UYDC8YfPJQZ+iMgsv+Wav+f4qiyy2XHcWP0VmWYHuj6XibsdCXEMznSiHu8y6R2o2o VVI/NxbJv+7xk/Jn2Tyu3zNQ0TSBG6iLP0N7jLsl0Uk1nF43h5pDHYJzKYW7a9azJKFk 4tzaCEKWmAM55NijFb/r8QUuQlLdXkzE+CUY5la6cmS78tw+cIDFb5k3DYPDgj/Jhkh9 osb2c2OhPfZQTY+8Hl0c6j9T54vA755+IF5xWc9sTmoZ1MnIJc08n0C/iubn2m/yZsDj B7XxrvW2wcoUlvysRpUDGGioOx9jUoGfoJPOHwRJ20G/Ga/pAaNpYNHJoc4/v3l4oLWL 28mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EAABz+oYYNhLuBBaae9yyiAWL37RWjdpMLVRC03GgOk=; b=Gz32oxW2MMk1pyzUieNNFQlRPNf0T0hUHQXHURH1IFhvbw4VTp/8XXE9B6zWPNci86 ixXvALkSHW3D+h0bn3WabgLOSoijZyRueDvud/DraFMZhqKDoTKKcO8jOxVjWhYjEX4z WpJAYtAQjpSpiK26urMt8aVucm0QzgkBM1/tkDumfGVoVXwEgQwguSiAxmJkRrG3kjbc Pc8a9IWmxtehz8Txy3z92H9qQ3/KqrNnocybvVmxUj2fyvnHre/46BACPeUe8KEZfQsC PCcFsKgnMSFcqTLZw+RqzPVC/sd/zZfvn3ZymPG7CWBZt3y2bv6G3OUbEGQvYnaniJAG uzCA== X-Gm-Message-State: AIVw113+exbdzpACSIo94isG9It/FjpdokVYafNfWPWMfNjlr7J+XOhg fuUlMxYKsqGrrXLy X-Received: by 10.28.24.210 with SMTP id 201mr3610548wmy.65.1501172280741; Thu, 27 Jul 2017 09:18:00 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id w19sm16128125wrb.49.2017.07.27.09.17.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 09:18:00 -0700 (PDT) From: Jerome Brunet To: Neil Armstrong , Michael Turquette , Stephen Boyd , Kevin Hilman Cc: Jerome Brunet , Carlo Caione , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] clk: meson: gxbb: fix protection against undefined clks Date: Thu, 27 Jul 2017 18:17:55 +0200 Message-Id: <20170727161755.10393-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170727161755.10393-1-jbrunet@baylibre.com> References: <20170727161755.10393-1-jbrunet@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gxbb clock driver gracefully handles case where the clkid is defined but the clock hw pointer is not provided, as long as it is not at the end of the hw_onecell_data array. This patch ensure that the last entries are defined as well to handle this particular case. Fixes: a70c6e06ed7c ("clk: meson: gxbb: protect against holes in the onecell_data array") Signed-off-by: Jerome Brunet --- drivers/clk/meson/gxbb.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.4 diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index a897ea45327c..8409d86cda24 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -1183,6 +1183,7 @@ static struct clk_hw_onecell_data gxbb_hw_onecell_data = { [CLKID_32K_CLK] = &gxbb_32k_clk.hw, [CLKID_32K_CLK_SEL] = &gxbb_32k_clk_sel.hw, [CLKID_32K_CLK_DIV] = &gxbb_32k_clk_div.hw, + [NR_CLKS] = NULL, }, .num = NR_CLKS, }; @@ -1305,6 +1306,7 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = { [CLKID_32K_CLK] = &gxbb_32k_clk.hw, [CLKID_32K_CLK_SEL] = &gxbb_32k_clk_sel.hw, [CLKID_32K_CLK_DIV] = &gxbb_32k_clk_div.hw, + [NR_CLKS] = NULL, }, .num = NR_CLKS, };