Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp49315lqp; Wed, 20 Mar 2024 13:18:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmhqKxia8vaFuMtFh7mIoW9lvV3XGJjp74wnUVHm/NRpMJrgJkMPzJEkYg0nQGf8hZ43y/zzfwy2y+kbrta8hdYT3/4OzhHVh9V4uoZw== X-Google-Smtp-Source: AGHT+IEcoRshflioM2/OS5TzlGfUpn42ZY7/Hg2QiEjUlZq69feoRqHpd307OHX8nKiwpKhKRgMK X-Received: by 2002:a0c:f5c8:0:b0:690:a576:2a2c with SMTP id q8-20020a0cf5c8000000b00690a5762a2cmr6617140qvm.32.1710965924752; Wed, 20 Mar 2024 13:18:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710965924; cv=pass; d=google.com; s=arc-20160816; b=ECS+WGezYs/rTlgb1nT6wQEKHOxkHLKPf55WKicTVKCNCtC7gTdbhetF3RMrlMI+ds K/P4KJBfPyjchy/d26x0RlITHeu19X0dNf63Ipmc3NTwvDijluLfxXk9zUkPjMGsfaG5 j41kCL+zJFyiX/SaOJsb3zafIrABm2CFTrxRRZjRQCYOou+fcgUj75XTXz0WwuGPS+yt sSKLWLcmmqUFuVoYFFzUru6z2J1RlF61XC+wflM8lDHCZBFQe3p47wAyQasmqo2+lhi7 p9YnCVmSqRbeZwRsA+LaZ9iswMyjeawSiInqYWfLt4AGh0T/ycXUdsLwpcvMNdDHkUdx Clew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=ZcBOsw97Cw3dCwC0IpeN5YUGl16Tlt2YUvn3jG+nAW8=; fh=LU9t59yyDNNQyoYLryD/MeegFy+JN6P+mKZvE5/mvec=; b=kKr/oktnA1lo0tSSmdMI73fVY3Cqp5YqzzR/FHB32C5hXIjJq49ljosFfh5L2g/MPA +4TS078m+6Nk/v9yYQEfIfROn+CPp28vA3yQFyFkNc2aGftf0KuXZpE7g3Uijaw1ZVa+ yKL/G25ewG3bJtnLShRUinhNn/KI58KZmZYIGXfb7ZzKcZPHDAVDRUnAfOHxbW3xe4yy jhFSW2bHw2mVtTA+Pwq1OmMfV7Uw52w75+n6V7LQHBRqYJDq5f+x/u9sbQ56KN9TWoh3 GJTEy1lWwRQSsPgpouUINb8UCT2ij0f2dsHKt9Gq67h3TqwL7GlvCd8HxQN0SkNoS3VG uGuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VNlW0smn; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-109389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jx9-20020a0562142b0900b0069154e17940si13746286qvb.84.2024.03.20.13.18.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 13:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109389-linux.lists.archive=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=@google.com header.s=20230601 header.b=VNlW0smn; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-109389-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 6E0121C235BB for ; Wed, 20 Mar 2024 20:18:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68B9D8593E; Wed, 20 Mar 2024 20:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VNlW0smn" Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 DA80984A43 for ; Wed, 20 Mar 2024 20:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710965917; cv=none; b=apAIBPJ8hysyOhB+uk4gULWHQaiVyEm+GFg7BqKADXUhIMgmWz7wPYbrMQEQcC5T2k4Y3SXm/LBl/NG3EEnHuLdY3yxtyp1HG/ZFXRW2OkOk1tbGL+EVXeoANMT6qxsdUHn75zZqdVN6Ons+qallvcXUaPA6MI728D4xEubb6Ss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710965917; c=relaxed/simple; bh=P8Domv5WqTvgS1GmnEkQPzqgFNJc7dGQVd7liXEnfi8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DnoSJY/01mY7Th1PhDaQYZX1CgP7iTk4ykdJTJlbZrzMYofgFTqrzsWzX9UAJiIzXDgnxJY/nVUQYO451idufCgj2rz2z3qaQJdDpu8C2pmP1O+6Fe7esmcT4koENvVVwGTeW2JR9SbxNpZuatCBvEfkvgRG7uHoYQBDmpDcdEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=VNlW0smn; arc=none smtp.client-ip=209.85.160.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-430d3fcc511so7191cf.1 for ; Wed, 20 Mar 2024 13:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710965915; x=1711570715; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZcBOsw97Cw3dCwC0IpeN5YUGl16Tlt2YUvn3jG+nAW8=; b=VNlW0smnGQK/f2a53vzC5XACTkHZEOXKJepTUC/FSffNflkkX6SA+vjHEFpq/Fm876 AJHGS5fEY/ANEf+r1k+frfta/eXFF7csj1h+pybjNwjrZNZIx+s3Urn545GLblwvDEqu KQxSe9fXq/IaXutmdnaeF2YBL6+0CCDqRp1Nucd7ngPCiieOA7uXEKUXk4gVuB81ha58 dg5+Gct/V6dQqufdUElCi+X76ujfdSrzXEjXBJ/cJwUfEjPo4Mp5mUVTDgrXmtO21p+r qRe1EDEmGIfYKe8McAlaB8vxfnPFAOxblPLEeWpzd3HxZaYls6VVXHciZxbetDJz3R1B 3+iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710965915; x=1711570715; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZcBOsw97Cw3dCwC0IpeN5YUGl16Tlt2YUvn3jG+nAW8=; b=RAbJOim7Y/DCGmxfZny+ul9XKU/Yl9J9rbjLI7+8QgevnT7vfG2gJRHml5BKDwV+CQ Wp/aNJrYyis8I97C1VpImy7ij64jbmYRZrpc7N8Sdo7xqEXFEepf/neoVV6J/Ncy8M/C A4XwpXYSNvgUKP4qsukD7c+QvJ64+hI9f+nKvr2Afb6GCeZ9KzvSLhkNL9cypSbxkYzV TazVn/GSzhTkZsDkU0nKsjYhypCmbQio4V6UYAfk9SFrRzX+mQyqBNm8KNpg3OnnxEMH kVmy86UkbSfsuMg720focIif8WcF5g2nF9h7iyYNif/uOIRjLsusq4l7MuVrd1ZuX49X WrhQ== X-Forwarded-Encrypted: i=1; AJvYcCWRh3wnh+6JbHBMkXAK4Y7p6Q8DCHEbBvGkwse38+HTxPEG+uG76NFjnUEyvYzhoDYgCMwAuYIHnopb5xCFD9cuCrUj3zBznOz5vtJd X-Gm-Message-State: AOJu0YySMIy4MWezTYR+8vMOK8aN7YgrqrY9N8wY6rZFnRFbG+CrPoxw SHKvd3YBSzuzHOPcBVtXo6SnI4TZnxd6z4ly0uHFOaINWiAI0ocylYtfo+p2wtIFxVfiBc/NmM4 pmBDvlk9uAp/tLyeNQQzc3cGd2hPXAf1Itj8N X-Received: by 2002:a05:622a:55:b0:431:608:ef03 with SMTP id y21-20020a05622a005500b004310608ef03mr61735qtw.0.1710965914619; Wed, 20 Mar 2024 13:18:34 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Saravana Kannan Date: Wed, 20 Mar 2024 13:17:58 -0700 Message-ID: Subject: Re: [PATCH] clocksource/drivers/renesas-ostm: Avoid reprobe after successful early probe To: Geert Uytterhoeven Cc: Daniel Lezcano , Thomas Gleixner , Biju Das , Lad Prabhakar , =?UTF-8?B?5ZGo55Cw5p2w?= , Paul Cercueil , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2024 at 3:30=E2=80=AFAM Geert Uytterhoeven wrote: > > The Renesas OS Timer (OSTM) driver contains two probe points, of which > only one should complete: > 1. Early probe, using TIMER_OF_DECLARE(), to provide the sole > clocksource on (arm32) RZ/A1 and RZ/A2 SoCs, > 2. Normal probe, using a platform driver, to provide additional timers > on (arm64 + riscv) RZ/G2L and similar SoCs. > > The latter is needed because using OSTM on RZ/G2L requires manipulation > of its reset signal, which is not yet available at the time of early > probe, causing early probe to fail with -EPROBE_DEFER. It is only > enabled when building a kernel with support for the RZ/G2L family, so it > does not impact RZ/A1 and RZ/A2. Hence only one probe method can > complete on all affected systems. > > As relying on the order of initialization of subsystems inside the > kernel is fragile, set the DT node's OF_POPULATED flag after a succesful > early probe. This makes sure the platform driver's probe is never > called after a successful early probe. > > Signed-off-by: Geert Uytterhoeven > --- > Tested on RZ/A2 (after force-enabling the platform driver probe). > Regression-tested on RZ/Five (member of the RZ/G2L family). > > In between commit 4f41fe386a94639c ("clocksource/drivers/timer-probe: > Avoid creating dead devices") and its revert 4479730e9263befb (both in > v5.7), the clocksource core took care of this. Other subsystems[1] > still handle this, either minimally (by just setting OF_POPULATED), or > fully (by also clearing OF_POPULATED again in case of probe failure). > > Note that despite the revert in the clocksource core, several > clocksource drivers[2] still clear the OF_POPULATED flag manually, to > force probing the same device using both TIMER_OF_DECLARE() and standard > platform device probing (the latter may be done in a different driver). > > [1] See of_clk_init(), of_gpiochip_scan_gpios(), of_irq_init(). > [2] drivers/clocksource/ingenic-sysost.c > drivers/clocksource/ingenic-timer.c > drivers/clocksource/timer-versatile.c > --- > drivers/clocksource/renesas-ostm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/ren= esas-ostm.c > index 8da972dc171365bc..37db7e23a4d29135 100644 > --- a/drivers/clocksource/renesas-ostm.c > +++ b/drivers/clocksource/renesas-ostm.c > @@ -210,6 +210,7 @@ static int __init ostm_init(struct device_node *np) > pr_info("%pOF: used for clock events\n", np); > } > > + of_node_set_flag(np, OF_POPULATED); > return 0; Couldn't you also solve this by using the more specific compatible strings for the driver and TIMER_OF_DECLARE()? -Saravana > > err_cleanup: > -- > 2.34.1 >