Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp592204iog; Mon, 13 Jun 2022 08:45:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXrVx0XXqiPDTAoHkRYNnLVXiQ8YIYSQ8J/knJRiFJjfWNpqdK1W8Ykwgk+xVrBEDLTePZ X-Received: by 2002:a05:6402:f17:b0:42d:d3f3:244c with SMTP id i23-20020a0564020f1700b0042dd3f3244cmr423202eda.52.1655135143351; Mon, 13 Jun 2022 08:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655135143; cv=none; d=google.com; s=arc-20160816; b=rFs9l2VwFZNHk1k/g2jZYwYuDN4VSMeiJOY1WX3Q3fH7ECDEuOeFFgmctLVti6MNNi Fq+mWASdbx4xB9TCcAgd47MUeevxnEwaN8nmleGc5Bm9ITqwzxn7ro4R4b/F570rjZhA HuicklLCvj+IFWoFXltFykbltzwmRnjyPxaTmqbvVdO1JOkHl9RMrWOmq8DTho2dDsOH TzuoSXRnpsTdEAgoD5pG+ERf6qVpKvwKSxWIFm7aYph6fgODycVxHWFAPW6QDIvjBKsX s3IPWx6GPHSa9EKvirDg66rTuSHawfUz3DwmKAXpQlGGL1JIA7zsqX3gWc2znjvpUx3b 6WxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BblCRHqMvy/hekoU+/UnKEN3r7SGox31OQTdKRHap+A=; b=Q2AcCCgJ77fYiPgvdntqrcd2G/PILppnBcMcv/7IFP+mY9z/qk5ASclvhba2VfAGo5 dR03Bkt4Hhd9QCSxzUvVun3/iuPOpv+Fs95DXZLSndU6oZfSB1eaffvkr0T5nNZfMIjr Xtf5k5m7lInPqAkSdMni6+P/OdK3c0VtU/o8TVeZzQlT3CHVYYM8Kzrfz8b3WeWoj4SL WVHTVDi1SmCfU4CePcgLU9bR9+WlWjor7Us2X1hO85KpwZg8PHOXwNh9+q6P55VPwLH8 zpMt/T0z0GVqkvRgF9Sk63AK67oWvn2kkjomkfWFBMA4aBP5ZSZKWPe5OrxcuAvB+AIo 1wGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lW7uNYlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd23-20020a170907629700b00711f646bb89si7822101ejc.739.2022.06.13.08.45.17; Mon, 13 Jun 2022 08:45:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lW7uNYlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359810AbiFMNSC (ORCPT + 99 others); Mon, 13 Jun 2022 09:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359409AbiFMNJv (ORCPT ); Mon, 13 Jun 2022 09:09:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02E9A393F3; Mon, 13 Jun 2022 04:20:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9C02FB80EB2; Mon, 13 Jun 2022 11:20:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 044BCC3411C; Mon, 13 Jun 2022 11:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655119231; bh=wH7/90BcNZzwB2bJOgzMEcaResWqJwE5uqhLmPT9ENA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lW7uNYlKySbElYrCFsRat3mZsZZT+RQlLuZdm7cn2LecTxdis8Rk37BHWRduJlM7w GFLDoVHUC9QMk86JuPzhycfnSD/LLigfKy5z+CJNDfttrO2F8wT6k7aCFkLPsv3/rp O3LByZWCD6s4rF73kbOYaXBafu7Xm/b+C8hPz+5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andre Przywara , Robin Murphy , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.15 187/247] clocksource/drivers/sp804: Avoid error on multiple instances Date: Mon, 13 Jun 2022 12:11:29 +0200 Message-Id: <20220613094928.624784138@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094922.843438024@linuxfoundation.org> References: <20220613094922.843438024@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andre Przywara [ Upstream commit a98399cbc1e05f7b977419f03905501d566cf54e ] When a machine sports more than one SP804 timer instance, we only bring up the first one, since multiple timers of the same kind are not useful to Linux. As this is intentional behaviour, we should not return an error message, as we do today: =============== [ 0.000800] Failed to initialize '/bus@8000000/motherboard-bus@8000000/iofpga-bus@300000000/timer@120000': -22 =============== Replace the -EINVAL return with a debug message and return 0 instead. Also we do not reach the init function anymore if the DT node is disabled (as this is now handled by OF_DECLARE), so remove the explicit check for that case. This fixes a long standing bogus error when booting ARM's fastmodels. Signed-off-by: Andre Przywara Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220506162522.3675399-1-andre.przywara@arm.com Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/clocksource/timer-sp804.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c index 401d592e85f5..e6a87f4af2b5 100644 --- a/drivers/clocksource/timer-sp804.c +++ b/drivers/clocksource/timer-sp804.c @@ -259,6 +259,11 @@ static int __init sp804_of_init(struct device_node *np, struct sp804_timer *time struct clk *clk1, *clk2; const char *name = of_get_property(np, "compatible", NULL); + if (initialized) { + pr_debug("%pOF: skipping further SP804 timer device\n", np); + return 0; + } + base = of_iomap(np, 0); if (!base) return -ENXIO; @@ -270,11 +275,6 @@ static int __init sp804_of_init(struct device_node *np, struct sp804_timer *time writel(0, timer1_base + timer->ctrl); writel(0, timer2_base + timer->ctrl); - if (initialized || !of_device_is_available(np)) { - ret = -EINVAL; - goto err; - } - clk1 = of_clk_get(np, 0); if (IS_ERR(clk1)) clk1 = NULL; -- 2.35.1