Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp881201rdb; Tue, 23 Jan 2024 19:38:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlYyInnBlD4HVg+74hAJ1+143zbNtG/ONiHEChtFC4cscU3c8mP9vLyoCIwL8RUz4Oq8Vp X-Received: by 2002:a2e:8916:0:b0:2cd:1366:4aa9 with SMTP id d22-20020a2e8916000000b002cd13664aa9mr440331lji.25.1706067506478; Tue, 23 Jan 2024 19:38:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706067506; cv=pass; d=google.com; s=arc-20160816; b=b0PX5jcKuk43z3Y4WTDGjSmKN2uVqCqpMvP8uZKTVOE+w8wen9wyDX0lQLlCcdtAYs SQRjTmPWTeGWFxY9YfA1zHRNHKEFxTajftsP252hSS95fdU47Y3Cy5V6ooPXmxGDITQx RhrursVq4pi3vhQHlxNWYUUFWLaHii4cTdN8xrYbuTnP0Up2212X0WbumqJgxO0aZqjT KNnvvh/4AnQONo9JnWqIam+2roBt8fXmHb0mDRpea6A9VTd1X9KRSxffBqeh9/1cZYnG fNhOr7MQJmxdGPRjTBmd/TfrjxN46mDu5t6G7KrSl9NdDX2bihuoO+z+7E4A0Djm5X+K ZkxQ== 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=tdMLjM3xmQX96Y3bdJuN/STfPj4rBI4cOGcM5vMcyR8=; fh=vN14k4+oqNO45Ir6mYPyXDXeEnlO6FnzmFddqICT9UQ=; b=P7yHWWN76jGhJt/DoOnK15+u/CU0ylL8mKspzvTLIKoqbmo2Usg3Nd5rquhicYLWgg cl4XgMV/ko0dd9TVnOwNrkqLLPaHWquvLyCgAD5//PfMsC3l+9nNtkqC6eHICEXOSCzt lDVMS+LU46T7eCoEDV4rvuP+RN0+2chbMD0PtoFY5FTfHcXoP68kGMYJK2SbRE1QC5JJ Ax96NN28n6LIH9TFzMUvBH1f6ZzU4ItMO58cx2r5Y3siKd/6jbW6TmwWwJynG7nLHtKx 7DNBOkLSh7HZx2ujbU3kub1tD9jlIOemUx0DeqH0HyoVuf6q24h8iPuUIHcTvKfZIfSO DwRg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=vAXnxluH; 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-36405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d24-20020a056402401800b0055c374941b1si3105765eda.279.2024.01.23.19.38.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 19:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36405-linux.lists.archive=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=@google.com header.s=20230601 header.b=vAXnxluH; 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-36405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36405-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 160D21F2CA77 for ; Wed, 24 Jan 2024 03:38:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02DA2B643; Wed, 24 Jan 2024 03:38:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vAXnxluH" Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 AF4B7747A for ; Wed, 24 Jan 2024 03:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706067498; cv=none; b=iWlUNpKUJMPQERdmTsx9L/xl7x/k4hh4sKfUScNzufcqWeTqWmtTJudnpud/nxZ5nSBxaPsgd8sujqB0tzIAJt4C0GSk0sECVY1mWfQh3VXVtqlgFJ0YJB/PlCaGJnIqRrDboG8/jfFWfwL5nN41ZKUjb2iAieQLBpYPMVEjzek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706067498; c=relaxed/simple; bh=gHY6Za4YB2YEjW4eFUsAvZWAPhx8MO1yOAHtuYxr1Y0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GFYBOFmAwvIzXQuMg77ZSrX7Kwt9g25+gjjggiorAxHO8BTvsv3oHB7mOa0eWEjiLPd56HaqVVd5Ygt0UlLsJa9G3EmXR15YbQgs79BXq2kVr+GBSIxt5jpkiy8B1U5QysTRq8TDJJ9NA3A38w+NysShFB/xpH2hraiFt16hCqY= 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=vAXnxluH; arc=none smtp.client-ip=209.85.160.170 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-f170.google.com with SMTP id d75a77b69052e-428405a0205so85761cf.1 for ; Tue, 23 Jan 2024 19:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706067493; x=1706672293; 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=tdMLjM3xmQX96Y3bdJuN/STfPj4rBI4cOGcM5vMcyR8=; b=vAXnxluH+jfAw0sZ2evuV3GmDQvMJNJKRDJdorN1jP6pI18KXLY0z2LBRjNzEJ+2Hb 15LAZpsEAHKz+guokMS2/ZN4NDsUpqp7jRF9fVn9oBXcM1MieQ0GC70TYgyNITA3bxSb kJJhdaVzM6pQs+wfcKWbUDuruRxBEbDx3O4E3B9h8x3fkOjG8qIgOZrk5aVUTjyE3M93 n2BKNEHGBWjmBQ2aH3MnrJDd7mdu5c/YjZPKCaSZ7gQfQE7PD0d1eFXuWbYlZxRN4u0I 9Ns13MYE6jduQwdeZBYWkUpW2yln/rJbl5dnGNewAorvxzpgo0fMq4ZVE4Thn5opdgPg 3A6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706067493; x=1706672293; 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=tdMLjM3xmQX96Y3bdJuN/STfPj4rBI4cOGcM5vMcyR8=; b=boF6mzPFk5ioawXoywSKZ68GVN2oltF+TJBrfMIfTkjDIHLQSb+6oYBogCOy5fn0rm BE5EkDdUYplkwxQqMCviYuksQqz9vXLavyoCpAT3Gf7DK2o2KaQPh6jpe2Qt3TzxGFzn XgIyjYf1lWcpinLUIO2U8SqAI3s5bLNJsHJ24WmbJvmnCMNIB1MmZou5PJVKMRdpuPYt rfSQrseHNP+peJxsbLYtsfKhKzzwN/iXAXrteEMBiByz7oqarEERc+WVqCqJfdCd/lVp 6BSc/X7E2UAjRx+weMymKlWhM82zm5ZpoEFFRriSOEsQVuGL67tswa7ORc8v1E+o2Vv0 pJbQ== X-Gm-Message-State: AOJu0YxEB/7SM0D/Dx/XJYtryxsI3dllFLvOdHrU6YJ3c/cvBbb0wQIc 0BU4Tam2ZJiso1L483iLxWN8Cz2o0OuwRrJlMcZ2Cw1XcomupPaqQA4EOtDVMKqxsL2pr9ANwkx kqVH++bzcwRBhIGMXtS3AqPJ5uGZNWmcyN9PW X-Received: by 2002:a05:622a:17cf:b0:429:c9cc:daa5 with SMTP id u15-20020a05622a17cf00b00429c9ccdaa5mr18599qtk.23.1706067493350; Tue, 23 Jan 2024 19:38:13 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122225710.1952066-1-peter.griffin@linaro.org> <20240122225710.1952066-4-peter.griffin@linaro.org> <6c72a521-1048-42eb-ac74-d8f718a90723@linaro.org> In-Reply-To: <6c72a521-1048-42eb-ac74-d8f718a90723@linaro.org> From: Saravana Kannan Date: Tue, 23 Jan 2024 19:37:34 -0800 Message-ID: Subject: Re: [PATCH 3/9] watchdog: s3c2410_wdt: update to use new exynos_pmu_*() apis To: Krzysztof Kozlowski Cc: Peter Griffin , arnd@arndb.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux@roeck-us.net, wim@linux-watchdog.org, conor+dt@kernel.org, alim.akhtar@samsung.com, jaewon02.kim@samsung.com, chanho61.park@samsung.com, semen.protsenko@linaro.org, kernel-team@android.com, tudor.ambarus@linaro.org, andre.draszik@linaro.org, willmcvicker@google.com, linux-fsd@tesla.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2024 at 10:12=E2=80=AFAM Krzysztof Kozlowski wrote: > > On 23/01/2024 18:30, Peter Griffin wrote: > >>> dev_warn(wdt->dev, "Couldn't get RST_STAT register\n"); > >>> else if (rst_stat & BIT(wdt->drv_data->rst_stat_bit)) > >>> @@ -698,14 +699,6 @@ static int s3c2410wdt_probe(struct platform_devi= ce *pdev) > >>> if (ret) > >>> return ret; > >>> > >>> - if (wdt->drv_data->quirks & QUIRKS_HAVE_PMUREG) { > >>> - wdt->pmureg =3D syscon_regmap_lookup_by_phandle(dev->of= _node, > >>> - "samsung,syscon-phandle= "); > >>> - if (IS_ERR(wdt->pmureg)) > >>> - return dev_err_probe(dev, PTR_ERR(wdt->pmureg), > >>> - "syscon regmap lookup fail= ed.\n"); > >> > >> > >> Continuing topic from the binding: I don't see how you handle probe > >> deferral, suspend ordering. > > > > The current implementation is simply relying on exynos-pmu being > > postcore_initcall level. > > > > I was just looking around for any existing Linux APIs that could be a > > more robust solution. It looks like > > > > of_parse_phandle() > > and > > of_find_device_by_node(); > > > > Are often used to solve this type of probe deferral issue between > > devices. Is that what you would recommend using? Or is there something > > even better? > > I think you should keep the phandle and then set device link based on > of_find_device_by_node(). This would actually improve the code, because > syscon_regmap_lookup_by_phandle() does not create device links. I kinda agree with this. Just because we no longer use a syscon API to find the PMU register address doesn't mean the WDT doesn't depend on the PMU. However, I think we should move to a generic "syscon" property. Then I can add support for "syscon" property to fw_devlink and then things will just work in terms of probe ordering, suspend/resume and also showing the dependency in DT even if you don't use the syscon APIs. Side note 1: I think we really should officially document a generic syscon DT property similar to how we have a generic "clocks" or "dmas" property. Then we can have a syscon_get_regmap() that's like so: struct regmap *syscon_get_regmap(struct device *dev) { return syscon_regmap_lookup_by_phandle(dev->of_node, "syscon"); } Instead of every device defining its own bespoke DT property to do the exact same thing. I did a quick "back of the envelope" grep on this and I get about 143 unique properties just to get the syscon regmap. $ git grep -A1 syscon_regmap_lookup_by_phandle | grep '"' | sed -e 's/^[^"]*//' -e 's/"[^"]*$/"/' | sort | uniq | wc -l 143 Side note 2: How are we making sure that it's the exynos-pmu driver that ends up probing the PMU and not the generic syscon driver? Both of these are platform drivers. And the exynos PMU device lists both the exynos compatible string and the syscon property. Is it purely a link order coincidence? -Saravana