Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp562921rdb; Tue, 23 Jan 2024 07:54:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPo8OBzCgtW67yUUx9FjTaZH1RtpaOp4HMcpQib182q5RcnSTlqruQQciEWqlzhL2EMew5 X-Received: by 2002:a05:6a00:2355:b0:6d2:74fc:1f1e with SMTP id j21-20020a056a00235500b006d274fc1f1emr8253691pfj.14.1706025253129; Tue, 23 Jan 2024 07:54:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706025253; cv=pass; d=google.com; s=arc-20160816; b=gluYyBcdsNJ+Jz2LYUFFesokeeRG+wpdoPA9LVEpm9oZs87wl6PCqg8WxVeL+RbyZ3 vfz7n2JWQnSYdKorPOYEJ71nI3yqH9lZW37NNCwGISMmh9vvYq+kHFHLUgXywH1s0dgh L8HEHw3KH6KW5gE3hERqIW2fFug0A5TwMsjw5/VtlthXHoDr9AW7VsovDcRWPBHvUEg1 5iZ69PfUeDifsDuLY7GLIXVdKSAJqD2Spfq5tPGkubU1Jmr4gjdlzkIGf6pv6CeuydMk QhNax8dCcXX5xtZuRm0aSkln0Ydgw2yAFhhFNO5W7w3asK31Gzi5GANN0SMCQi1VSHw2 i4xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=q9Vvev13XdoubG1E45m0UtEzpNjkizsjSeJg3BeobWo=; fh=x6bxIjlTZFIqgu+4UEelLSnZ83btXcWLi5LRVf15wfk=; b=AggR4Z4pqbKFmfOlAnlnRJbRVEdvt3tX1AVLwDs56UkKU6DE1yGiQ1Sj4OSuwPRswP 2KIHKylpzACh2Gs+nnJD1Rxl6ovEHne/IqY0LrL6/GQK5rAmCZdPUG191n/KDlTajKzC dVHIYI+Mu3CqSSoVnKoYx0O/CNBQNXmfcs579hnPmCYjZ4Xx/XkcSAV3jqHzXVaEgISg nrzN/dcrs9RcGS9zts+5kR74BXlQWakiP9agjq7OEq5tGBhHgJpRZrMMWLmKuoSNvP51 n9wHKOwLQZnnxFL4DL0cHGo7VHdcU3P9nwpOBR0xJ8e2OY8PYDH8/GJ05vLQ1Ma5Y+2k c/8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VpcD42TT; 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-35566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35566-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 le13-20020a056a004fcd00b006dd7b95a14fsi1072078pfb.305.2024.01.23.07.54.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35566-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=VpcD42TT; 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-35566-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35566-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 299B3289D16 for ; Tue, 23 Jan 2024 15:43:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 639F5605A4; Tue, 23 Jan 2024 15:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VpcD42TT" Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 16990664B2 for ; Tue, 23 Jan 2024 15:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706024125; cv=none; b=o4ggVhN2f1EIlraEXNNjfN9lJLplAnDJd3tkQgZ7Dpv+cxhrOk7oHRGXSvXQDY2YYEPgOllcvawb1heScG4MrxXQseLiUglNQ/cMk92Yvpqq/4VsxAYz8+8cpIbL23ADDpK4hcZHKIeWJ10kwmce7lJ9DAS14CQ2ZG/RD//t350= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706024125; c=relaxed/simple; bh=OLw2uBmZ0gulJTla/5FtAZVpNcu9rLq53nHgy/OtrjU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NHobqYtQ5ezL47vMJ0vw/Or0CwSjnnSoR0vSv3EuSQ26RL9ygvZHEn1/Ya955WDdA3pHnin8uB4NS+BL6e2wdQXyJYrYRARcwQ8I+M8xZ18Y1ikrk5JGMh/t2F4VLtKk02SR6yMOEmUihOuXV+SSbW+53sHdqdmXfNaySnYeeZs= 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=VpcD42TT; arc=none smtp.client-ip=209.85.222.177 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-qk1-f177.google.com with SMTP id af79cd13be357-783b0813e48so13890685a.1 for ; Tue, 23 Jan 2024 07:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024123; x=1706628923; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=q9Vvev13XdoubG1E45m0UtEzpNjkizsjSeJg3BeobWo=; b=VpcD42TTqRPcHv63lUV+714mQ52nWOtFzy3rt392lRrMy6br+QEqi8FFKM083TLOPy 8ZRV3nJp22WO28XLsf7YKqNUjJBz780Q/he3fQzFY77/VJE15726fWlSZbp2FUYd5kj5 hyAK2J4e825avt8dovRrPw/yI9CLTr+Gvpekb9zB0I6p3kRZhlMhvqxQ6xcFCOKzaOfQ W7Qk1R9UyGczIiwKjPQuQktGEYlBDpCW7TnfiRJ5s1pmdx4b3RLEEY77nKrsY27ZqIJ6 +EDdqV9JtwUpqkOggSeDipDC7Oh5ZaWkdw8jL71lWOaHq7SlrXQdRS30Yt4ULGlTtMXO f+8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024123; x=1706628923; h=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=q9Vvev13XdoubG1E45m0UtEzpNjkizsjSeJg3BeobWo=; b=mx7sRvgg6H6lr4SL+sfoBylkPfnKHOtb3g0lppiGY/dUFuaqJWiWUYOJFs7+zybhBG p4NnT91hTaye2roBUdS90ryzSjvZNGhDlOcqDVCVup4/M5HiHFrhLFoCKE1KWl2GvVaH bYm7pjvy113SH99MADhMLsKpWyrcKDTO978f3mKJNc5ag61hCUk8Ci9KmJ1KmKNOyme3 wsO884hiVOaEfBh4aw1GXaAJFlXmVYhu8i3TTVDIg0wWFynv7a51iL/H6CzyB9dAsYan sIXtpxKoLwbdd28m2wMVm4EaIH6rHh3c8t16dW/Eupdnc5/9Ky/bRsIsR1jnxu0ojsgy V5Uw== X-Gm-Message-State: AOJu0Yz13CpqH1zMPfOdP6NXFTxjHKs33kxrWmXynpN+q78TWlNSij3l PUrSw2llmLxKeiTTkIz4p7ftAjFhwNgyOcP8BLr3DxwYPh0Ta4VHInAGCux5mGOlz3fGBzzX4aI mIGC7VF+iKe7Ue5S3lj1Z2TCDjZQR7f4dyLuoWg== X-Received: by 2002:a05:6214:2484:b0:686:9e8a:a695 with SMTP id gi4-20020a056214248400b006869e8aa695mr1523692qvb.17.1706024122981; Tue, 23 Jan 2024 07:35:22 -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> <726bd8ef-2074-4ae7-89fe-36e2bc70d02e@roeck-us.net> In-Reply-To: <726bd8ef-2074-4ae7-89fe-36e2bc70d02e@roeck-us.net> From: Peter Griffin Date: Tue, 23 Jan 2024 15:35:11 +0000 Message-ID: Subject: Re: [PATCH 3/9] watchdog: s3c2410_wdt: update to use new exynos_pmu_*() apis To: Guenter Roeck Cc: arnd@arndb.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, 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, saravanak@google.com, 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" Hi Guenter, Thanks for the review feedback. On Tue, 23 Jan 2024 at 10:33, Guenter Roeck wrote: > > On 1/22/24 14:57, Peter Griffin wrote: > > Instead of obtaining the PMU regmap directly use the new exynos_pmu_*() > > APIs. The exynos_pmu_ APIs allow support of newer Exynos SoCs that have > > atomic set/clear bit hardware and platforms where the PMU registers can > > only be accessed via SMC call. > > > > Not really sure about using a direect API instead of regmap. I personally > think that regmap is more generic and like the idea of abstracting hardware > accesses this way. Since that is POV, I won't argue about it. However, I did also look into the possibility of a SMC backend to regmap but that was already tried and nacked upstream previously. > > > As all platforms that have PMU registers use these new APIs, remove the > > syscon regmap lookup code, as it is now redundant. > > > > if syscon is now no longer needed, why keep selecting MFD_SYSCON below, > and why are linux/mfd/syscon.h and linux/regmap.h still included ? Good point, those headers and the select of MFD_SYSCON are now superfluous. Will fix it in v2. > Also, the driver did not previously only support ARCH_EXYNOS but also > ARCH_S3C64XX and ARCH_S5PV210. It is not entirely (actually, not at all) > clear to me if and how those platforms are now supported. EXYNOS_PMU > still seems to depend on ARCH_EXYNOS. How can the driver select > EXYNOS_PMU if ARCH_EXYNOS=n ? > > Also, ARCH_EXYNOS already selects EXYNOS_PMU, so a conditional > "select EXYNOS_PMU if ARCH_EXYNOS" would not make sense (or be required) > either. > > Please explain all the above. Fixing this for ARCH_S3C64XX and ARCH_S5PV210 looks to be a case of +++ b/drivers/watchdog/Kconfig @@ -512,8 +512,6 @@ config S3C2410_WATCHDOG tristate "S3C6410/S5Pv210/Exynos Watchdog" depends on ARCH_S3C64XX || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST select WATCHDOG_CORE - select MFD_SYSCON if ARCH_EXYNOS - select EXYNOS_PMU and fixing the return type in the stubs that Arnd pointed out. static inline int exynos_pmu_write(unsigned int offset, unsigned int val) { - return ERR_PTR(-ENODEV); + return -ENODEV; } That then compiles OK with s5pv210_defconfig and s3c6400_defconfig. Neither ARCH_S3C64XX or ARCH_S5PV210 have PMU registers or set the PMU register quirk flags so none of the code for setting PMU registers would get called at runtime on those platforms. I can make the changes described above in v2 which should fix the ARCH_S3C64XX and ARCH_S5PV210 compatibility. Thanks, Peter