Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp932722rdb; Tue, 23 Jan 2024 22:27:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCwglwmR6NnPvvGz52GJGn9ZvhDhRrduwMJqpFG38XFdSVRa4CdPmJrO1gy3EQb7lVj1xq X-Received: by 2002:a9d:5e8b:0:b0:6db:ffa5:5f37 with SMTP id f11-20020a9d5e8b000000b006dbffa55f37mr1012408otl.57.1706077674209; Tue, 23 Jan 2024 22:27:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706077674; cv=pass; d=google.com; s=arc-20160816; b=Ky8YCKjyovdopLhFJc9ZY83/pNhtMp1RPuwTIECC+U6cFuY7H2dZQ2LCrPGVzjTjjr eAWj6tR/rXuS/OWttDyxnIifO6v18iOI6bMM3GLnppEC9+XmkN5DXfKMOM98BKoAK3FK hKhNfv+9RVHt/wZw2XTreVAAB53laxpYbTLNXPo28lJILfEKIPayDaqd6T4rH3XbwxFm kQVqObkuARYfEal9Mrig9WWvjkLWTCvy+b9o9cQOyn08vyAbAbQgNdRY/Fypmbq1Oqjj 4WrtnQGFarq0ytkdsRhHsjfXtm6HvlZ9c2uy2nUDKvjIkXp+FCbgOjw60hzIW4Z3dAVt e+Ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=VTxQrIiVON0OTYTwxrRPdR/y84eGyMz+CtHOGKK0BqE=; fh=KPKhVf73w3JKpqjq3CEIy/K5UNqlUjVpgSQSC4euanw=; b=k1bdE1JCxPCIOIIXJnsSew1od1YukBJeTXhE5sIcmX2aX4g5J3vFSXKuijx1vxw3Yj VGc1Yk1kXTaJ360zEJXw3H3Qsgp4iGH2mmx+QZgzyTUEjBOApm3RDH6ge6b1+crHzI1A DMet28E5UHcKNE0QoshdDqUZwc/EPRAN/uNKu5smtntRJ3DF1wNwEGMaUF1WPjRBcQpF PynccH3bT1uMOsoirJWFp2kIzmECv8mwoMxYkkGMUcTff4H7mx7Qx7LUxOeASaZ42t+t I+bBeRMI4YmFoQTyjyLu8BaL/JYynTdcBngEwCF52CmQimGPbTJh367KSC7dT9ZuzAAu msJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=irFcn6Ro; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-36507-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36507-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k127-20020a632485000000b005cecafd3c43si11058163pgk.218.2024.01.23.22.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 22:27:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36507-linux.lists.archive=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=@linaro.org header.s=google header.b=irFcn6Ro; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-36507-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36507-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 CC802288DBA for ; Wed, 24 Jan 2024 06:27:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8ED4FF9FF; Wed, 24 Jan 2024 06:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="irFcn6Ro" 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 9C928F51C for ; Wed, 24 Jan 2024 06:27:07 +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=1706077629; cv=none; b=Ni12FSxQdF5UNdaGu58I59oI5QzwEmkHvpxwGsZ00RCc/FGTZ4Ro9tAQ5Yi4aZMErlyjnMP65RzC73VtydA67Y8XtSA3q/oJ+ByjmqbvY4SsahOS0ZOT2XLXyJY1aS1ahVN/WwJZIGY36N6bzAz+4TDQQNcftiIYsJxtxIAilCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706077629; c=relaxed/simple; bh=aTdwflVIGHG/EjuMpAo+S4yUcbjsj6s3/ZB5a45BtD4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=XEIJp+9i6H6o31o9EoUeEv89MeYnkGkkXJEBrBL0fe4EGMU+Txzbgb6A9t8YrrvC0EtrkgVQtj5u0WCr8GBZscG62RxIg52mbeZFupr8Z0F1UJRs3V4f54v8tJ5W2UBErNpc8H3Wc/TWMzAeiTZAvWZAg0V5yW+VF+ObrASxfZo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=irFcn6Ro; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40eb0836f8dso24690175e9.2 for ; Tue, 23 Jan 2024 22:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706077626; x=1706682426; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=VTxQrIiVON0OTYTwxrRPdR/y84eGyMz+CtHOGKK0BqE=; b=irFcn6RoHgfO2PbMLcVsA2xU0mgrDngyCH05tkRjX7u1k+SYx32Zv7qaw+Ut0RDHhK nyyQfUpMmGrn1HrjRcuXaAkehxWdlN0/YKiRVny2Z2QkPdbN1Xn//EDuQJt2Dqq0YaZg JhmlIqig6dQbk+fUxkZM+KVUUh7l1+hf2P44QYVXWYAsJGdhvgXmDYOZ0ZXmDGMd6g/E 9xzD3sDc/ad/Ovx0e9ZDEiAyfxJCRHQNt7BzVpgTEGRwR+MRR1eCpWa2VLT3ggPnTrYI FBufWpfbNTCnRa0LVHvfWSlmpQjHT+clNfcfL+qQuNFHvp0Cty5nlLsSApTQit6soUuG InTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706077626; x=1706682426; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VTxQrIiVON0OTYTwxrRPdR/y84eGyMz+CtHOGKK0BqE=; b=w3KrUmWMF9qcrGJ/qEgiCXokmjPd3QNjMD5hEsOJmzT4/RVRy3gKJnl7+c6n2bwOYe xLVrcGCisb3/zM+Z3cUhrp6x0p90ROchY0UMfqMGJ0ynQQ2ktiqgh/hL2r3LfZTCbBTc LK3tXo7TZWbmJwoo2JEI79dE6t3Xzv+hWlHlGn5rckGQCdTP7e5JaJ2K7Bupv8ENCCYm GUJrCG0pr325OkHjKHCuH9FhFxbjtTvGVIAaoDs5TpWOnS6hX5BHi5LnjMF0UwJBM5s4 cORpEwZTxpFqiBFSRvEPNCGpe1a1qsR8my+X/aTDcsX2o5M3O68TEPv7Fv4TPmEGe4JW XXzw== X-Gm-Message-State: AOJu0YxM4QewJ9u5nuxM3USotjCZiVgom/PVwUEd83APOW3tcmaLBqmK L/4vRekRIRcC3BKcjeu6FZ8IsAUN908awyL9+EAdgPz4gGQo7y1tPW+fGni6Sws= X-Received: by 2002:a05:600c:32af:b0:40e:45aa:30d7 with SMTP id t47-20020a05600c32af00b0040e45aa30d7mr810269wmp.171.1706077625756; Tue, 23 Jan 2024 22:27:05 -0800 (PST) Received: from [192.168.1.20] ([178.197.215.66]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c138600b0040d5a9d6b68sm48883055wmf.6.2024.01.23.22.27.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jan 2024 22:27:05 -0800 (PST) Message-ID: Date: Wed, 24 Jan 2024 07:27:02 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/9] watchdog: s3c2410_wdt: update to use new exynos_pmu_*() apis To: Saravana Kannan 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 References: <20240122225710.1952066-1-peter.griffin@linaro.org> <20240122225710.1952066-4-peter.griffin@linaro.org> <6c72a521-1048-42eb-ac74-d8f718a90723@linaro.org> Content-Language: en-US From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex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GXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 24/01/2024 04:37, Saravana Kannan wrote: > On Tue, Jan 23, 2024 at 10:12 AM 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_device *pdev) >>>>> if (ret) >>>>> return ret; >>>>> >>>>> - if (wdt->drv_data->quirks & QUIRKS_HAVE_PMUREG) { >>>>> - wdt->pmureg = 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 failed.\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 Sorry, generic "syscon" property won't fly with DT maintainers, because there is no such thing as syscon in any of hardware. > > 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? initcall ordering Best regards, Krzysztof