From patchwork Thu Feb 15 14:08:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201500 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp445620dyb; Thu, 15 Feb 2024 06:42:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWLDahNBGbgkp4ax47CSWMXc/wlIT6dv6FnlOANJl5Xz0u39dlwlE0jb+a+TRhWCF1b91tvirCumsGYs/PvcYLj99eong== X-Google-Smtp-Source: AGHT+IGeQimizM67ejYY4+oavs0qHFvlIr0+vrL9Wl26DO4eGTMR6PDbgpttrn8ZVjEcojnBbxgA X-Received: by 2002:a05:6830:1304:b0:6e4:31fd:bfb with SMTP id p4-20020a056830130400b006e431fd0bfbmr467627otq.27.1708008170195; Thu, 15 Feb 2024 06:42:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708008170; cv=pass; d=google.com; s=arc-20160816; b=J+wvXU2P8i8Ig+ybw9ZZPIke+dciGy0ukwuk9L5yxdFvNRXSuCL61sH6Sxg66OrVKJ GdToZ41xd+2lFV2ir6uyW+6L9z3p78BmCyZn2M3xHPKdFugPGjPd2qdLrYWcwAguX1cQ K0iiAXlibWDwv8VggQbTQPv6h/51gGLBGHCJ8o8o8X+BaHzotcFFbRRdCOrYzK64Yj9B 4pCtB9TkXmcm6yoVKTalWq8MZKRiZ9TNGq0pmKIN12yczusrFNBukVFsSlThAFa4mpYj 16a/pG7642XyjCcQyzJ8H++GEf8kKyd2NJC5D7uQvAEy1Hy1jJl/bKgWx2mJEVhW3Occ GvhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RbA8yw86zJThN045X0EtpFQpuxqOp8ZxTfaBxRUnlZA=; fh=hhXi+hSBEbWLRC9S7PM+rTQxb/DKiivB20pOMOJWYVA=; b=VEkmleJxwb/YkRm9fTBHkdrjYDM4q7s4AudkpFOSkujK/l/p8eJ9QJEDoBrS3qazGN HUchMVBjuKyr5n5PZpNaLF9aAZvJuwNspyw6Rgqdvs0+YifjfToCta27TVsvhnnUmFd7 Dii5PDD/SJ3vW+3QmgXYSrGJK76jkVmro4iP2fscm8V6fHB0H0UtsEX840PPtl9szuMz 7UPaGDQfQdAdt+wj3iQel+MVc2TWH2am5b6GaI0h71Ms1pph2mOmi6JJvG3akkd7U5zT ZU7HkRF+MecY9RXirCyY5ZP+baNWCC1ouSRpRPifLBZ74V7XHLIEaCFfUm3XWQnRBx88 bUkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=liuXrxrZ; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67050-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67050-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 13-20020a056a00072d00b006e100469067si1235331pfm.292.2024.02.15.06.42.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67050-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=liuXrxrZ; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67050-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67050-ouuuleilei=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 32421B2AFA2 for ; Thu, 15 Feb 2024 14:09:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E532132476; Thu, 15 Feb 2024 14:08:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="liuXrxrZ" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 2861B131E24 for ; Thu, 15 Feb 2024 14:08:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006134; cv=none; b=Sit+acLUQqIbvsenruLIlSvdL9yUnLxetrN7WPF42SnxJeXoBdbWDQV51pJ9ufvzREMt2TxWWnX8K+3dXcGkr7VuHH+JlMRb/GQjFkfO+ue2LrNGN0Ft1FaN7UNXQs0arOtX3Ro/ZRmpUZ3kYrC4ttTCQrOadVz7Vkn0kR7PJxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006134; c=relaxed/simple; bh=Fchmw8nbRjmpEgAKFhZiNFS9q3+KuEr6rfwjI5iiBZU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=n0L8qbhUmctChx+My6AIQt9UR9BYn/j0nbWaOoLk7jYHsold3/BdpmLgthxMdZEItUqF6rXJmCaoAraZDRLSlfSzE/e+6K1niNeO8qfTL3OvbXhEAjNXpSOt4FFLWOnm42cuaJXjp/gXziKQubACvlmPJpWWDhSBHu7BKvZl1nU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=liuXrxrZ; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-411f895c8b6so7822185e9.1 for ; Thu, 15 Feb 2024 06:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006131; x=1708610931; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RbA8yw86zJThN045X0EtpFQpuxqOp8ZxTfaBxRUnlZA=; b=liuXrxrZbGTmFmdmO8OCtao8eGk7LPGk4SvNvIU+FaBDtT9LxhieVnL+kCalPxban1 s1WIbgYoppQ6te8iRs/Z5WbtGskXiAbFlwZcB7eLYC8Sri/ax9l4yxOdlFi54S9d3D0k cR8xf0H8g6f0/KQTDYoWg+q0Jol5KZdFZWj2XoT2rr4oAPykgEI05NzM1tRLGEbDl3Kg LtOKuXAksdSAAFTKnLq3/9J/mGw7fbIWRxYalMXiqXUsiu03NZIQlryJJG1EbQzWblWn sqo99ljpoyAhNdk9b+BiQ34xwbMcRWd+WDnrU559pt0vxzyNZlPQ3UKBn82TMKG6Qwxf FWEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006131; x=1708610931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RbA8yw86zJThN045X0EtpFQpuxqOp8ZxTfaBxRUnlZA=; b=MtNZWVSsnouzgMEf+GE7bXyLZro4vA5Qv6N5ItYTBzRJgYYs2lcxadEkfw9gId8fJA fR5A2JPVVisJ8hSaMH9pK49I4Sza1r2Mfqi7TKPru363IP/vsfm5h3NBEXL+Rps1uMlN uGge0dB4/lnQNoXK8l0inlk4qYYfiAe0Qxt1NTml9vrH0dHnEbL/HQezh2bin5fhLS6p 7AeeNVBjv8Dp1cx+T2dRyC7eXREA6v6ub2nE17TtRos0US9GfCIkpBNyI/cl+FcirOD/ o2wPCDL8tcKjs2UuVGYSaVQncROdKUgXJGPeq9opsTNDZ4UMpdV7QF3UMrw6ji9I1TfM KrAw== X-Forwarded-Encrypted: i=1; AJvYcCVGvUo5xv4XcZiyjFelBMS6qtGS6eUqUna6iylw7jyNtTVfbf7NhuLK/rnq67fFRB7Bhs2DLoCb3EOluk4wnYlgmw1z2YlhnVw2pQAW X-Gm-Message-State: AOJu0Yzmc/XbLGRLdqrEN5xa8lcUnicqtHuOHxx0LUFBTGLjpGsyFxVy a7OKk9lko1BYWulT7aU8MriEJthKwXPbVQ5LQgm4U0uhVF9WwOB/gsBD1uru3qY= X-Received: by 2002:a05:600c:3b9a:b0:411:50aa:1106 with SMTP id n26-20020a05600c3b9a00b0041150aa1106mr1598084wms.24.1708006131495; Thu, 15 Feb 2024 06:08:51 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:08:50 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 1/9] watchdog: rzg2l_wdt: Restrict the driver to ARCH_RZG2L and ARCH_R9A09G011 Date: Thu, 15 Feb 2024 16:08:33 +0200 Message-Id: <20240215140841.2278657-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790976375308227644 X-GMAIL-MSGID: 1790976375308227644 From: Claudiu Beznea The rzg2l_wdt driver is used only by ARCH_RZG2L and ARCH_R9A09G011 micro-architectures of Renesas. Thus, limit it's usage only to these. Suggested-by: Biju Das Signed-off-by: Claudiu Beznea --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - none; this patch is introduced in v4 drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 4700b218340f..bdd1527bb916 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -921,7 +921,7 @@ config RENESAS_RZN1WDT config RENESAS_RZG2LWDT tristate "Renesas RZ/G2L WDT Watchdog" - depends on ARCH_RENESAS || COMPILE_TEST + depends on ARCH_RZG2L || ARCH_R9A09G011 || COMPILE_TEST select WATCHDOG_CORE help This driver adds watchdog support for the integrated watchdogs in the From patchwork Thu Feb 15 14:08:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp423677dyb; Thu, 15 Feb 2024 06:09:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUeM2/O4ALt/EVQbudrAp0eVw4mFpNfx6W/0X6ZOHMAAyJrILPaOTlpU3iVVSmJlmOE2Wkf6HMUGyKVj57tiNNY0wRbuQ== X-Google-Smtp-Source: AGHT+IE7fr5WaGDbn0wA3mxTanINEnMvSZdqBdAxNAuEN7dIM7K3L5TD8NHtcCAls40A2Gc58CNU X-Received: by 2002:a05:620a:4096:b0:787:351d:9f0e with SMTP id f22-20020a05620a409600b00787351d9f0emr1719916qko.55.1708006183296; Thu, 15 Feb 2024 06:09:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006183; cv=pass; d=google.com; s=arc-20160816; b=d6iHg4bvdFanWIadYvJHED7FS9swdMtmUN/r4ommQBh2J1T7GsoWpkArYf7br7E+uy xFvT0NyrGT18wWtzTnylx7n6frMiBCsAJhhjE/vArulrz85FUlYBLC+fuKRsUn7FQgxZ z+IMYKmhBKVPXkcyWDBmHf8Fe3/LmvBF4G7A5QJPJzen+PH+YnCShOulqKQ+4DORgq5b 4ZQs1tWEvp2oLy/42Csv++lC9qMcqYPac9GPPRi1TJc7P1Fl2EBxtcMyQJ6jfKHr5hgt 2xGJa9xLXP/mA+hwYFyNjFRD8NKpi7ih3ttbX8v/3yS6O3WV4vvnT1mgSBbiCQUqfMHP l74g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HdEY1bJU0PCtz4SwLFjp8WXUERePjgyQ1aqI/SAhvgU=; fh=3t+p/tpqvKuRgxEJWpUkcYVei5vOee5pb6OI2eTpcKo=; b=drHiNbv8+q5ulBnK7P9G+eTkVwfZDFkp2wakBF0X1xG7+hUhc96+E9UeTwX3VzJ80Y zfn3PLFcejk7gp8Wk2i0FkH94UmDvBuN1+PYf7HhNPNYqaRGt97MvmzQVCAj+n8zlHeh AIJ50vbtFfiMyPpv96loZty+ZfrqQthojF4eqfrtnv47/3sM/5Ic4cKCxB1+x1Oj0y2r +Hd02+hxrBoLZQQ8upyC6jKp5YjkRE2OcKKeJErGPaxp0KL5A8iYn5pOg7jG8wMYqLXD 6PbFlZRACZzUmwjWFVrHiYZSi7rrF3yGNi+/Zhi0QAw4SfQB54LPHsK/1uLMmu8lG0uR ACeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=NeAhvv37; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67051-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67051-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g13-20020a05620a108d00b007859976fd61si1520799qkk.576.2024.02.15.06.09.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:09:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67051-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=NeAhvv37; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67051-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67051-ouuuleilei=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 19B4D1C2345F for ; Thu, 15 Feb 2024 14:09:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0719132498; Thu, 15 Feb 2024 14:08:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="NeAhvv37" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 5E943131E4A for ; Thu, 15 Feb 2024 14:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006137; cv=none; b=B2/YgdGBe4qlrsU9SfawMo7JDObJWcWO+o7wwEvC9fwM9XMxunCqVIG3h+rQMi8ZufE4Tkxt+0YidD0jugmUNgCvVHB2j322xIN8kvGtYR5nTGvTs8inuAoAmwx/4Gjslt2zK6jY8ko2VFAf1KPLTCFGCbVwCO768my+RPV9MPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006137; c=relaxed/simple; bh=PiBNBbw25q+v4bUnUd4r2iTh5pT2QFis1M2ZPr8jCPo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PX6gcH+Td0AYtuYxdOMvlP/dkmMaDrhjUXIxf/ms/D08cFxvavjPX/Bax88B3locFiZdGEHQSwry4gmn9H5M1F3R7ZzQBkVVWQ5QN7e1Ql9QfSw5Kyb83xfOvDrmKIJJQa08+flbep2PVIF3hsnoI17+fzrY7EB2P3D+TFun0Pg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=NeAhvv37; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4122acb7e56so2154705e9.2 for ; Thu, 15 Feb 2024 06:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006133; x=1708610933; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HdEY1bJU0PCtz4SwLFjp8WXUERePjgyQ1aqI/SAhvgU=; b=NeAhvv37VL+vkvn/JD+XqXXDTviR71ZQYllvY3uCAZphd/vn9zK4+R9IO4QbZxkWQ/ k6EKXzeGTRAarL+LISLSr8EmEgBFj9vtGQFvP03Z/0NpJ9usU+SsaeggqyzA9ql/OCci DKkixL5GxMaGRPBM+HK5onrBDFxaNnDSHCYaublH3LS8dq+DntnJI14MgIC3NKnqHO1a q8vFji0S9Dai4Ln6s6XXCFelJnRUs330tbOQPeybV/KFLNZLaa+Hi9/8ckRidN18WLTh D1m9fUPE19cfX1q7kYvED0kTu66HVwoXsUf6DjJz22gZe7ukb/fA6JyJTW45TZ97s52X sh/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006133; x=1708610933; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HdEY1bJU0PCtz4SwLFjp8WXUERePjgyQ1aqI/SAhvgU=; b=QL6uQw6fG8PcNPvUrAqVYDr1GrEa7CVx7tKR6kE9ZwdWLP/RZMKeX64f10yQF94nBV 5h1UQwmMojeUaICIwCrifat88UqyBUpCIK6qc+xCySNYm+5CEJWQHEyMXVE/xaEbhp2F JK2O5WJhMq8H/x1JAxinC44NRrijArSTJMKRDIXogpmWzvvtU/2HmuAervb5Iz6c9pBj EsvK888w24teDiaFcAIw2/lGrNUZbcII57Ec7Zrbi8xG+gsAxiTKJ/1rGzCxXwBfhQRt xWADpnf/JHE68Bkyb8Yuf0e93+W5VqrdXoYYvwLo147pzdmuFgGr0/P5JeAJeth+oqpR W34A== X-Forwarded-Encrypted: i=1; AJvYcCXGknoUZ4Vor28YV0S4PIe6liBr61BA7MwFIDX6SS6QLPxHNNV5YntmAvtImLZzZoCRg9AdrnqhPXcOp9PvgNRM+UaOBF4cH7broQTZ X-Gm-Message-State: AOJu0YwGal2LbVMYJDf3ixNyBNUncZ9YwAXeOGPtddWD25dbqj7uSpxm bEO5IyjKmeYD8wETOt9g6T7UbVppEzetRATFuNaNy2dsZEQ35k3R6U2FDtp1jEA= X-Received: by 2002:a05:600c:4f42:b0:412:6b9:2763 with SMTP id m2-20020a05600c4f4200b0041206b92763mr1459721wmq.21.1708006133489; Thu, 15 Feb 2024 06:08:53 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:08:52 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 2/9] watchdog: rzg2l_wdt: Make the driver depend on PM Date: Thu, 15 Feb 2024 16:08:34 +0200 Message-Id: <20240215140841.2278657-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974291396148293 X-GMAIL-MSGID: 1790974291396148293 From: Claudiu Beznea The rzg2l_wdt watchdog driver cannot work w/o CONFIG_PM=y (e.g. the clocks are enabled though pm_runtime_* specific APIs). To avoid building a driver that doesn't work make explicit the dependency on CONFIG_PM. Suggested-by: Guenter Roeck Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven --- Changes in v7: - updated the dependency to PM || COMPILE_TEST to be able to compile-test the driver when compiling for a !(ARCH_RZG2L || ARCH_R9A09G011) platform and CONFIG_PM is disabled Changes in v6: - update patch description - fixed the dependency on COMPILE_TEST previously introduced Changes in v5: - updated patch description - added on a new line the dependency on PM and COMPILE_TEST Changes in v4: - s/ARCH_RENESAS/ARCH_RZG2L || ARCH_R9A09G011 due to patch 1/9 Changes in v3: - make driver depend on PM; with that the "unmet direct dependency" Reported-by: kernel test robot was also fixed - adapt commit message Changes in v2: - this patch is new drivers/watchdog/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index bdd1527bb916..cd2e29da7a54 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -922,6 +922,7 @@ config RENESAS_RZN1WDT config RENESAS_RZG2LWDT tristate "Renesas RZ/G2L WDT Watchdog" depends on ARCH_RZG2L || ARCH_R9A09G011 || COMPILE_TEST + depends on PM || COMPILE_TEST select WATCHDOG_CORE help This driver adds watchdog support for the integrated watchdogs in the From patchwork Thu Feb 15 14:08:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201489 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp426314dyb; Thu, 15 Feb 2024 06:13:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7NbA9WHOKX6zrz8xs5nKMJVNL2H8oD5SC+V1RJtufNIu0F9tRzKQ2RfGO/Z3rcGWNht2gh0GlerFttBEF/yt/hyZdjQ== X-Google-Smtp-Source: AGHT+IGb5sbWPhco5qEfJDxTlmRqvHjQI+8L9uLyLxTUE9uX5zJv4CzQBsC2I8ThELP9tqz+kfmM X-Received: by 2002:a17:902:988d:b0:1d8:b6c8:d9e0 with SMTP id s13-20020a170902988d00b001d8b6c8d9e0mr1647796plp.68.1708006397602; Thu, 15 Feb 2024 06:13:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006397; cv=pass; d=google.com; s=arc-20160816; b=T/Q+Sh7eavKYPFxAUBehWMQAYJ0G1ZtriSLzgkI76RsMVVC3h2si/qcjtt1EeDV7/q TeFwEOtARSkdDJr/1QguJaigZX4IcGCJEa7IosDiencfnfX5XV4DocsnXy6yVPrzd9xZ q8GgiJp8hJBDyxNZAKCBEVrUbj5hP+R7WgNsDYFs4rXMTqTrPX9KF1oP1J/Pqdirfa1N rumPEATR8jFuKMNR6R67va5S1ST0z+bMZ0fxoY33lg0Rv4YCLsrZsC5OKpQUYi0iZMSM FO2sNlmHd6/8Jw8raj3Mbj9wHq2pStJPLjw4ru0PVhrqeoJnurkWKk8he6GoQaTkM3J2 Zi0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=y0o0NMGUN/UniJ6MuCNhr85tN7d6iE/+DXKd4kchRTE=; fh=Hwy975nvAey9FQLGfYaIvPpZj4rB2RW99fKYRnVdTAA=; b=r7YkpeYdenFP2pCMmJrviG9rgd0Qfy2CjnLoXRPc2m3hO/qeGdjvEo8bI6L3wvs5wX WydpmfTC+r8yIXAQE9FzgVo9H1aHbucqmc36RkVbvrJI9oc5Og93ks1imMq7IH+n5pOw k8uoixvl5ly4v00tIeYL7bI4VcQRXbjHWIUx3o+ZHxnptT5+WkGYF2MOLnY7RWAYl6Gw ZzIdOzWXrWh2BqQwQVqLx7797DUD/xZUE9fZ28wfqyVbo5/2MKLt2ZS2wtklx3vymGCn 3ayZamOM79N0uxZMJ1bx2F9pLDaqQ77iswArRaC/m0G8HOsGVvzGPeXBPI9+awUKQGOi tuBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=QTx1k99F; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67052-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67052-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k12-20020a170902c40c00b001d9d44403bbsi1182601plk.583.2024.02.15.06.13.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:13:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67052-ouuuleilei=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=@tuxon.dev header.s=google header.b=QTx1k99F; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67052-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67052-ouuuleilei=gmail.com@vger.kernel.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 13A6D2873E7 for ; Thu, 15 Feb 2024 14:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 655A2132C13; Thu, 15 Feb 2024 14:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="QTx1k99F" Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 2246D132483 for ; Thu, 15 Feb 2024 14:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006139; cv=none; b=dxFcewu2YLj4CQQmR/YoTAbhDnyvCAo5J/RRdoeYtoP/UAWbvpyecl+GUdEMMxQQJ/WNVU+LccfHIFPlmmnkgsCaQSF9qVrzJWpKaANMvOkEX94uKnG4ZbeCT0QiFcCebLpqxqzX+F8q0xQpb4xeGcV0T3HRW73NEsbrVlqyVDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006139; c=relaxed/simple; bh=9Jwy7vJI5ODOPksp05cnDniLiewbXp5lAtvWL9ntsAk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H7GZ2pEgWsbpV0mPYs/1TBSL5wvNKvEEthfGaDHtb+8u13LYGefjTy78fAm/naaD6fF8NzRl66QJ+APNG+kiC8d4YRr2K5UFhCaU0tY45se9HsAeQBJL+dqcxGb6fX3I/k/L9hcNykN+l/JP1eZn3tQN9eyAt7n6FGhPn5q+i84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=QTx1k99F; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-411d3c75026so7255865e9.0 for ; Thu, 15 Feb 2024 06:08:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006136; x=1708610936; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y0o0NMGUN/UniJ6MuCNhr85tN7d6iE/+DXKd4kchRTE=; b=QTx1k99FmbEXpqnR/CeCy8I8WaOr/MYbrTHfPSV8i6PX6eI083IleARiyPVOVqSDsZ 2keUACrwvRzAE71arv5idak5aLVWhAdACQd+a1vWNB7sfO1W1oy5XVgYQplQ/ZcgVM0R XjgKTmPZibPNV8Ua9VFIlMAuvsX/B39ZZtWsl7G8u6b4cDWUYZ/taRrwH1sk9GuENF2O R9s9PETYcW5AP8yDlj++79/6m/WqGdXwcxb6tDxaNqLoKYvbHE0Rw1Rw54AM/84t0wlO bQzQFFT/wJxZRdcqR7KYPKQF0Ns4uOJDV7RPC7dag+a17tBS6vNb9WxjZWfat8Fx6kkd t18A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006136; x=1708610936; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y0o0NMGUN/UniJ6MuCNhr85tN7d6iE/+DXKd4kchRTE=; b=usA5n8HdrwKQARdCFtQT8uHcWmtVWva4xxe4EKlGSWuZLxHoEokSk2K+6gK3KxUgkE /sNl04gVM+oXyI6Q1VJ2K1lVMhdMY5E8HN7KrV0bBpBsJdqjxhJ5rNrf+YJoZWlXTMkv RBYHjAanmoJVAHRsx2kIT/ZqNPaDSlFtyvmK2VLgm+/DdnIS6tlrS2CNqquhAeJ7sW/6 Zg270gZbevdrW3hZNEmMobQ1/QDOqD+URvsCzQ7gjTspcHF01zf8hj+jtJ8NKuNSZrJG 4d2sMrkWCEJES8J/QW5M5ECiMf8xpeZ3mV18LB5lGhHUolx0EapHyNtEEgqJyJtuZ8ev DM0w== X-Forwarded-Encrypted: i=1; AJvYcCVPqUJ1iebxJ85+G/45W1pkITKWm5G5klKwdEhGY92t7hatYRrJWSdtvBVh16O2jRKP5+J3Lr3L+hSlSuihBvZMQcA2P0PArMxN/u2m X-Gm-Message-State: AOJu0YxQlh7gZ1NQQp+Vgily5VpBBsTgAywtiO3+j6foW3BWxZDYzC7N 5UEXuCm0f3jf/6DljsEA/4dkEP0XcBCq1DMiH4OJXFNfzGMDMjtg5kdJbrcTOIs= X-Received: by 2002:a05:600c:310f:b0:412:bf0:b1bb with SMTP id g15-20020a05600c310f00b004120bf0b1bbmr1541822wmo.18.1708006136563; Thu, 15 Feb 2024 06:08:56 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:08:55 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 3/9] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get() Date: Thu, 15 Feb 2024 16:08:35 +0200 Message-Id: <20240215140841.2278657-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974516570629261 X-GMAIL-MSGID: 1790974516570629261 From: Claudiu Beznea pm_runtime_get_sync() may return with error. In case it returns with error dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get() takes care of this. Thus use it. Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of rzg2l_wdt_start() to its caller. Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Claudiu Beznea --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - none Changes in v3: - none Changes in v2: - propagate the return code of rzg2l_wdt_start() to it's callers drivers/watchdog/rzg2l_wdt.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 1741f98ca67c..d87d4f50180c 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -123,8 +123,11 @@ static void rzg2l_wdt_init_timeout(struct watchdog_device *wdev) static int rzg2l_wdt_start(struct watchdog_device *wdev) { struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); + int ret; - pm_runtime_get_sync(wdev->parent); + ret = pm_runtime_resume_and_get(wdev->parent); + if (ret) + return ret; /* Initialize time out */ rzg2l_wdt_init_timeout(wdev); @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev) static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout) { + int ret = 0; + wdev->timeout = timeout; /* @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int time */ if (watchdog_active(wdev)) { rzg2l_wdt_stop(wdev); - rzg2l_wdt_start(wdev); + ret = rzg2l_wdt_start(wdev); } - return 0; + return ret; } static int rzg2l_wdt_restart(struct watchdog_device *wdev, From patchwork Thu Feb 15 14:08:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp424084dyb; Thu, 15 Feb 2024 06:10:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVc9Yi22y6LzfVFeC27e+y7poHZ+DKNpINdnNY2D65poTm4lFyCGuTZlu4bFqLQsqdhvycO/lWgg5kIxTF8uwVS00Gqyw== X-Google-Smtp-Source: AGHT+IHBwHDXTqRnzROERqikSP2kGkNCUeyC4inuPsGQWN/ZWGueTvpWYmwoW89w3UZZNKEyguNI X-Received: by 2002:a05:6512:158f:b0:512:87e8:397c with SMTP id bp15-20020a056512158f00b0051287e8397cmr1823790lfb.16.1708006216257; Thu, 15 Feb 2024 06:10:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006216; cv=pass; d=google.com; s=arc-20160816; b=bp7g8rJMOmgz7nmGqfYSUwDg/rxHoTgyi82KoBXs6gcQRP5L4sqGaLFB4FG2At58ph ywMr7KnL2JhaOpRlaIo/rifAX/XH4E3RoZ3lt/QcJHUdYSeQwishrJOQqU/nyf8pdEiM HURYcznEAiBnO579nQq6+tHW2sLvBCbyphibP9Cd/+VTs7tsPLy0aO/lE9bfR7QUbqb8 wBX637IfL0dqUgLrgGAwaTRS/Ddyo/Wain4IwgWpfPAbDGXrqCp127rBZsoVgVunv4Sn fneykh0wALR39HRES7bYgbMKexb0BedkgUdnhcl/yn7UmKlds7/S/WBSiurItlhH/o4H ODJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qPUYiNHqZhUoHd+sZ4RJHnQ1CmF+Xdz4uH6uUdJNI+c=; fh=C3l78nU3xnKPCC+7hRbq4eS0ucHWc8oyKpRFOBMMz9o=; b=mMXQ41YYJgUUaVOJVQQmNmUgh7n1Uw/qk0H3AR2rq2YUYQAZg7OY0Pw/TwAQs4+Ife R4cFT4XC9Iq8kzl8fZCisSTym3+9HYA+pB5H3ihZAcn3KQqwwUWM22nbuhM8R3fWToKU UsBqxeVf4rEmq3tHDjux80VgKX7Wkd4ubxdjRqgDhKBOreS/pTnLqYP9L1MeiIneBXoY RtBvkidignvBcaRevjrPhlT39JWi/eUpnnlGYWv6FGx4yyhiH2qPU891JJbh3Pd+KUiW sFnyIdoMMKsp22BlSoguWGJEIPGykpzfj9FyDSwVaDR7j0hv5ZZJm1biFtEhNpd3/qJX /TQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=fLtDfOR7; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67053-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t28-20020a508d5c000000b0055ec32431efsi681737edt.13.2024.02.15.06.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:10:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=fLtDfOR7; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67053-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67053-ouuuleilei=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D55821F24E34 for ; Thu, 15 Feb 2024 14:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08D58132C35; Thu, 15 Feb 2024 14:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="fLtDfOR7" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 9AF5C132C0C for ; Thu, 15 Feb 2024 14:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006143; cv=none; b=oTxP4AOID/doaplu/92VTwx0mBTto4w1Ann091pb7knqCGA+2m/d9IFLgKjnRe9gs77GjBfN42NqGa2XxIqqDb9Vr8Go1s61LYnPwRr1BSHPOj80hEr2vKTYMmebDkxGYAp6QgqqR7Kqilv+Lb/g/B7xBPC4xikgzyx9dP4kp5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006143; c=relaxed/simple; bh=8AsK5mIJBGZIHLJAmDvX4jfuEJ1mMOpuX9MBHmSxx/g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OW/0PrOcnVPEhQwYqS2s2ehTrztawGm1GRtuZ+pGa14UVQE5E1bX6/eKo62IjO0tqTr/jjCZZurYV/gEIoqHq2u1T05T+LQzIsQ49irXpq8Q1ZK8cvFW02gN5wuznGN86QMf41h1YgbKl8j6ZjIrm9JsumcxO7KJJ3NTdfJP3dE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=fLtDfOR7; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4122acb7e56so2155755e9.2 for ; Thu, 15 Feb 2024 06:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006140; x=1708610940; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qPUYiNHqZhUoHd+sZ4RJHnQ1CmF+Xdz4uH6uUdJNI+c=; b=fLtDfOR7zzKxOgfJBJUe7kJsm9PU7bmips5thzkXG0R3kUrM9GA4PodvdQTHaMbP6t +JScrNIJWDgVoXG921m8D8X/6Pbn5qILVqyxrN9Dhc8lJHeWCntABDxzzFdjbA3nppNh FE6LH/+ZLFn/lNTz/o0QHSx+hp1x3S/OmWqLJC7GChodNsb8TdE/G3IjAeQepsoMYj8d H/t16yL/nP9+EqL7Hapm3nTi7ApvbJm/6dYqX4mQ2s1hpU0YpSzEPtusVdRDTIIXjSnC Z9jMCxKsrhMW+zQ4HiKkE4a35vcIPG2CAZQcK8weZI3X7AxKZkndvzzO3hbOJo0o0yv7 xNMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006140; x=1708610940; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qPUYiNHqZhUoHd+sZ4RJHnQ1CmF+Xdz4uH6uUdJNI+c=; b=j/BSRbONUgW5KnyVJxvrxurYI1zlUIaGa8WrJaLuCVFf/lgmHlURXlWmL3lR76k9Ip 7nYhh9ZGI1paScbOY4F+xjjrJSTReVc0PfbfIAUJsXCnZCbjNU112sctz/Mp19rzHe/B nowIEiNgSSk9DsKiHA/V1wOTLmx5N1bpP0wOQ148pZ0PLS4iPew+40LVO0nEulzdPy+S d3SEWRNNDDsZVb9Djv0L0oomKt+z9DpJVYrZm8FFzwq9AxPZKsy2M9XXwQ4RDIaGuPGO jFdzRk4khlymY/LVtB2V/yTleAibx4vAdTVLWekfj0Vdc1QHImuuzeSD10CPDLxvd/5m D2wA== X-Forwarded-Encrypted: i=1; AJvYcCVPxGhIiaKbSMVuYluEHRwhl5ygdzAyK3A0uPEUvemEE0A5UYkjXJox/d6bLcBUORzRE4SdRymCJjCEAr3m+O1vfl2QCp68CJ7DDOfX X-Gm-Message-State: AOJu0YzltMpP/vqzRPHta91Bmbf7nvt91m0386eEMsxtCgeHbdB13lu7 uCTSjsP40JiPjjUYovuFxLbRoAFnZlg7C6GpeMDe1JpjSwgGmvgKLlv8HUU/cqM= X-Received: by 2002:a05:600c:1d26:b0:411:da90:89c0 with SMTP id l38-20020a05600c1d2600b00411da9089c0mr1565047wms.10.1708006140040; Thu, 15 Feb 2024 06:09:00 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:08:58 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 4/9] watchdog: rzg2l_wdt: Check return status of pm_runtime_put() Date: Thu, 15 Feb 2024 16:08:36 +0200 Message-Id: <20240215140841.2278657-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974326617676592 X-GMAIL-MSGID: 1790974326617676592 From: Claudiu Beznea pm_runtime_put() may return an error code. Check its return status. Along with it the rzg2l_wdt_set_timeout() function was updated to propagate the result of rzg2l_wdt_stop() to its caller. Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Claudiu Beznea --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - none Changes in v3: - none Changes in v2: - propagate the return code of rzg2l_wdt_stop() to it's callers drivers/watchdog/rzg2l_wdt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index d87d4f50180c..7bce093316c4 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -144,9 +144,13 @@ static int rzg2l_wdt_start(struct watchdog_device *wdev) static int rzg2l_wdt_stop(struct watchdog_device *wdev) { struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); + int ret; rzg2l_wdt_reset(priv); - pm_runtime_put(wdev->parent); + + ret = pm_runtime_put(wdev->parent); + if (ret < 0) + return ret; return 0; } @@ -163,7 +167,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int time * to reset the module) so that it is updated with new timeout values. */ if (watchdog_active(wdev)) { - rzg2l_wdt_stop(wdev); + ret = rzg2l_wdt_stop(wdev); + if (ret) + return ret; + ret = rzg2l_wdt_start(wdev); } From patchwork Thu Feb 15 14:08:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201485 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp424387dyb; Thu, 15 Feb 2024 06:10:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVECvrx1ywDufbDx4V+TLbdMfXzvRLZJFF0+UPil/1mXjyYDwrYaPyE+AgkQRzp1vu/Zh1Gh+uoq/N7Lyx6+gSKNsDTAw== X-Google-Smtp-Source: AGHT+IFXalqD3ViYExV+mlRw0Jbx1Ht6jDX/hIW2KD/5XWhS5CVL2PVAugp5o+GtNF0g9TBTiX7e X-Received: by 2002:a17:906:1d53:b0:a3c:8299:9c5f with SMTP id o19-20020a1709061d5300b00a3c82999c5fmr1231420ejh.75.1708006239396; Thu, 15 Feb 2024 06:10:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006239; cv=pass; d=google.com; s=arc-20160816; b=PklbYUgMD4bd07gd4/276AXJ2M77xFz4feTCWgz1vNmm894Xg35GojR9pHqXMSLJdH r4pXDIVYHX20hArmff/Uwx7WALu8fUmeZJa1aMWUFu74PlVTh2OqVDJMqSJTFkQgAsnc 5aLrwWbJlp1P6WByu2SclX4cQmcmK5rO6/PuEcSvkMvKiTnSpApIu7GHGYl7k+GxRvRk +GAf/JZIDErjRR8zBUaorRKHtYdRf/EeLKo73qdjLDC0sI9Xz36S4u5kLLOl9OJMTp0Q Vt88X/LEaTwUpH9FHkSLFkE5DjDsqa+aJaunOQ72KdAL3ZyknYq1jKt1riXz6uKiSNWS 8BbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=R+ZRYWMcZ6j5I/z8CW0C9Vfz1n7CKxPl7rUaYwU8m/8=; fh=YDrfMP1yjBu2N/3F0CFtO1fUoZ7ji7GTFYcIvGyz42c=; b=ognNBbgSNHu2TbZOQK2q2nXYNMYKC6irRCwrCD/JNmuGLkS44H/OyUcdqndcBO3YfN XlY+U1Q7bfgYPNfArR4IcZlg8kbeCqxgSemUjVK2EZmIzhFMAKbnoX6dCayaYRZP9ajE c7ZXBOBKe+MBdzq3BYULWpbF4rmhNTbmbJqZYrxD2jwOnGAllIv6j5uElLhr/R3WzmXX Yc2StyD+UM3Ag9OatouIMwHHOuB/DG+MgbFhTj0DbaL24eedBZJpcx0A3E7VQsHqYMl1 EGJl1ZnrH7XUqn22uLyKae0WdgT6/HNYO6/FzLBQwr98F45dKPsBTzr6VqqpGuiodckZ unaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=TvrTflDf; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67054-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67054-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p23-20020a1709060dd700b00a3cfa3fa6bcsi691385eji.1001.2024.02.15.06.10.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:10:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67054-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=TvrTflDf; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67054-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67054-ouuuleilei=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D02621F264F0 for ; Thu, 15 Feb 2024 14:10:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38881131E48; Thu, 15 Feb 2024 14:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="TvrTflDf" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 5AECE132C1A for ; Thu, 15 Feb 2024 14:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006146; cv=none; b=aSmYpPdS6vKMeDewG2d/YdfMeift6DLPFyeGcwOntc3w1E+TPg0DuqstSxBOgaVzmWrLr1e0i7/ehLjrJ0J0AvsQC0fSfwuakz6d1TcymyVMU2iAPgxwxO0bEwBo9PFeSXdU+Wde/iW+qat7Nzz9ZvYZr+Mi7GW61V4hxlVz5Bo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006146; c=relaxed/simple; bh=hyVKl2QSRvDHAZPIbt4AQChYhnYDda13VJKQ99ZaAlg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aTvjjM9dP7Adzyx5aop6pXN4LSLi5DyM5LQf6DWskzTp00b7p+IqkxJJPfHj0s9A2RxE3wDzPSzgGxB/QzpQhZ+HIYHxNUUk4LPgj1al3OQTW6wR1tv3yEpxNCdTENYrjv5nyP/WxG7mj9z12Ho+Q+8FlzngIy5Kbz/ZWlxjIbc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=TvrTflDf; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-411f17700ffso7785715e9.0 for ; Thu, 15 Feb 2024 06:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006143; x=1708610943; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R+ZRYWMcZ6j5I/z8CW0C9Vfz1n7CKxPl7rUaYwU8m/8=; b=TvrTflDfih+lQFqvfH5rN87MSKJDw9yBqyYrf8K2xKixX9aep6P1MuqOzPM2OmSmA4 mektWovrJJsbu1FeS3i0hzjtMXHrkswP1p0rFVuohtutXUS47lJ9lSbtwZ0d4eBhFNqk VCOu6c8mOrjCxPYbwzpFHL1IynPJh7mPXBIbcegmMzE5Ba2sHOmV2PARBygBt7prm6KF N8z3bxu5zRWwfkf8suSFjdMX2vQp7PIjR4KpA2gXFJabimswa1+3ssxFT0rY1jZi4ee5 SMHvwMDl58VVVt+cQI3+vAfi7Tirb0ca2Jlbik/J2H97paO/Lvs8hgzXUdKOMHMk8UEI 78IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006143; x=1708610943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R+ZRYWMcZ6j5I/z8CW0C9Vfz1n7CKxPl7rUaYwU8m/8=; b=FO4twC+LJa1osJeN7YptklK/y6KQqOwpDrJ7QUxUegeXe0WZLZerhiLVEkNwWru/dd eFqxc6iUBppMoiKK31K1XjT/LGGihLfBFh/+O8jpX5RR587KeEok9aYYQqlTyWmDNqVX umxFAbUhXxVC4ylHCyr4mUWg6IUkMmBeSCvr1+fYEChUhRvitXXMKQMbJSvv1x2vfXSK coSe7D9SrsQQNjciPCtk+ZeEWOWQLcZHQzasbyGUqpwqW/rUHzGvXNFq+InHWLCzoHeX BOGPjbqcHDxVZl4ZQzzF/cI14f9oPqiI0safCiMVAcibKr/Ohzu2BOJzFqEzH8qFLFj/ YDWA== X-Forwarded-Encrypted: i=1; AJvYcCXCpaVUbvz1ZrySZFBD7j0+0LhSoA3QXVLGLZY1QWzjvN2jm4GT3lbtLJ9lAZep6KWfWtOzLIAHeZtR7wILvlXVzZ5XLroKZWveLMjD X-Gm-Message-State: AOJu0Yw7Ti93pd82ZxDd+zb6cn+n3n3QGA3SRsvDOq+LKkJOGN6YDIS/ N+KGxKf8DfUvPDp17p9nh/Ph7Xh/o5urWkredW2GOEr3lf/z43s6QdEJPcPb7eo= X-Received: by 2002:a05:600c:4fd5:b0:411:b834:9c79 with SMTP id o21-20020a05600c4fd500b00411b8349c79mr1481811wmq.13.1708006142845; Thu, 15 Feb 2024 06:09:02 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:09:02 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 5/9] watchdog: rzg2l_wdt: Remove reset de-assert from probe Date: Thu, 15 Feb 2024 16:08:37 +0200 Message-Id: <20240215140841.2278657-6-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974350766303588 X-GMAIL-MSGID: 1790974350766303588 From: Claudiu Beznea There is no need to de-assert the reset signal on probe as the watchdog is not used prior executing start. Also, the clocks are not enabled in probe (pm_runtime_enable() doesn't do that), thus this is another indicator that the watchdog wasn't used previously like this. Instead, keep the watchdog hardware in its previous state at probe (by default it is in reset state), enable it when it is started and move it to reset state when it is stopped. This saves some extra power when the watchdog is unused. Signed-off-by: Claudiu Beznea --- Changes in v7: - none Changes in v6: - none Changes in v5: - update patch title Changes in v4: - none Changes in v3: - none Changes in v2: - none drivers/watchdog/rzg2l_wdt.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 7bce093316c4..93a49fd0c7aa 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -129,6 +129,10 @@ static int rzg2l_wdt_start(struct watchdog_device *wdev) if (ret) return ret; + ret = reset_control_deassert(priv->rstc); + if (ret) + return ret; + /* Initialize time out */ rzg2l_wdt_init_timeout(wdev); @@ -146,7 +150,9 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev) struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); int ret; - rzg2l_wdt_reset(priv); + ret = reset_control_assert(priv->rstc); + if (ret) + return ret; ret = pm_runtime_put(wdev->parent); if (ret < 0) @@ -186,6 +192,12 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, clk_prepare_enable(priv->osc_clk); if (priv->devtype == WDT_RZG2L) { + int ret; + + ret = reset_control_deassert(priv->rstc); + if (ret) + return ret; + /* Generate Reset (WDTRSTB) Signal on parity error */ rzg2l_wdt_write(priv, 0, PECR); @@ -236,13 +248,11 @@ static const struct watchdog_ops rzg2l_wdt_ops = { .restart = rzg2l_wdt_restart, }; -static void rzg2l_wdt_reset_assert_pm_disable(void *data) +static void rzg2l_wdt_pm_disable(void *data) { struct watchdog_device *wdev = data; - struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); pm_runtime_disable(wdev->parent); - reset_control_assert(priv->rstc); } static int rzg2l_wdt_probe(struct platform_device *pdev) @@ -285,10 +295,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(priv->rstc), "failed to get cpg reset"); - ret = reset_control_deassert(priv->rstc); - if (ret) - return dev_err_probe(dev, ret, "failed to deassert"); - priv->devtype = (uintptr_t)of_device_get_match_data(dev); if (priv->devtype == WDT_RZV2M) { @@ -309,9 +315,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) priv->wdev.timeout = WDT_DEFAULT_TIMEOUT; watchdog_set_drvdata(&priv->wdev, priv); - ret = devm_add_action_or_reset(&pdev->dev, - rzg2l_wdt_reset_assert_pm_disable, - &priv->wdev); + ret = devm_add_action_or_reset(&pdev->dev, rzg2l_wdt_pm_disable, &priv->wdev); if (ret < 0) return ret; From patchwork Thu Feb 15 14:08:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp424540dyb; Thu, 15 Feb 2024 06:10:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUauKsWMJHAMO3l9RgN4siZOuZGTzn3kL67cchGLlJeVnEVuqT2E7j9Jwu3shJzzV2aEsfDUdn9ijj7mCAtO+269wBi6Q== X-Google-Smtp-Source: AGHT+IGO8AYkeRNZKiAZ1nCP7jz6pqRH7yWP79dBC6XhXanXMASNvDpOffhB415DVAnlLcney3Mo X-Received: by 2002:a19:5205:0:b0:511:47f7:62e0 with SMTP id m5-20020a195205000000b0051147f762e0mr1437780lfb.21.1708006250120; Thu, 15 Feb 2024 06:10:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006250; cv=pass; d=google.com; s=arc-20160816; b=qsx/6mbZMdw6sIjW6Pt8ddoMkwhXon76VpGLdoEb7yuB6Cuyl2RHFFqF3Cjpn0oYjB xat8JoW8qbBE27JvbX3HyuFOYDECXPTF4o69S1iKa/n8+We0CN4GYFOhvLqo7kA4ilw1 irhsmskhm7NxZGrOTaMrjHewj38CN61TqMJ+3AujJ1ofQ9qJybmtD7FZYD1t5fKRcvND Bd7rcJdRwhKU1qObZnqNVuE3RSV936OgDzIV3IoLYtbS1Rqyb/6V6iuuzJ4uEDzHO67Q KdKIKN0VBsIKQf9gwOoMMeoLkQ5p8++wQgChCSAupcxWdYj2PWoRAumR9p65/Y2GirBn bXWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=J9hLCgOgDWO+oXa7HyITa5NYPaX6P8CRXV5rOrD/zA4=; fh=D3z4s3mkXP7g3d6b9obS3Y3R0RdiswnCRt0MMi3sDWI=; b=pnWUCcqu+H4HmaP2v7rNkmehuuyj5CZ0XE7y9tha69rLRRvUjWX1UllSml6Cijl/Lg 1bQQV1HYht4hMG7XNY5oFHCs4w+psh5CADSU7xGlL/mb4g5r7HLfUZhDgTZD5MKrMQXd jzazgP/85Dh7GlKcDcyYJzNZlkRqgVGqryvfv4XHNgqz/mwXyzkAd3f9BpkdcdK+CcJl IIOR1imGSIMBs6Ni5gT6FdxQ+9aZXLkiQ3RKq7nVrd2pM+yAEnQ/HwVoJHNIgEBqyJ0P SIgsfHdhfbZ6uHASc5Czq17cyT3GToFkSGcpiXAA5jPDBpqw61hfD2BpIHkzQgXJzF9E c8gg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=mvDkUFmC; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67055-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67055-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t28-20020a508d5c000000b0055ec32431efsi681737edt.13.2024.02.15.06.10.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67055-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=mvDkUFmC; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67055-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67055-ouuuleilei=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6994B1F25EAB for ; Thu, 15 Feb 2024 14:10:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D39951332AF; Thu, 15 Feb 2024 14:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="mvDkUFmC" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 B07E6133281 for ; Thu, 15 Feb 2024 14:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006148; cv=none; b=uWbXaLFaTua04yjF9AeZdNjY9ytGo3DRa/K9ofkNKGdBCh0Cqw1vvAcPIQySSDEPLeDlQDhqoVYwRSGzeBfnIpFQL80LEMO224UaZtzVTWvPu7XKbYY+pKUaiG5Jw1pOrVPMiroazhWnqr+6aLD3FSWrGh+N5tdMR0w/hglpc6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006148; c=relaxed/simple; bh=4Xx+Y6oRenFZ8m0ziN8T9+sztwNA2LuxcGKFoIzVWlI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M4rpM/kLZ92c55B1Uh6nxdtEtQ1xxQgbp6Z9Gj3JzDgeonNKgGvTJCDmKPNNLd+nK6xo5wfiwkC6kENCf6qyfZ/4eGayij/g4KuhqtgPYn3bVVwYS8RKZHDywXGv7rmDvMEsn6VmCQ/ObEZB0nAq5uEtONhfl518zbESUXe0hos= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=mvDkUFmC; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-410c804e933so6613335e9.0 for ; Thu, 15 Feb 2024 06:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006145; x=1708610945; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J9hLCgOgDWO+oXa7HyITa5NYPaX6P8CRXV5rOrD/zA4=; b=mvDkUFmCROgG8QlXHh7hJxbEZbza6PjqQLM3ONvOTDbBafy9P2U3a7h5B48xmvOhcx hubC8FIchViXedk0hAGn/gM1xoUyfPeBsXSu6+jQiRStXzmjS7dR0Ei4rG/N2u3rgJIs T/82VRQgt/uX2C7Fi08V3pKUD3lJ+1qjy2ZjHBEAq0sfQrV1q6OlgCS+MBixduL9oK7D 9Vw4DQcBtrJNKQs2bnIZTfKI3iU/5Ce/pzZ1O/uMXsKArnt22RQzNq1apRMhZlaKpDXA spfOlXvkAt2AM+nOpJKgmepWyNc0Lk60Op0cFhWYRZp9AHIgby7g0HBRF+w7iJ736CNf Uurg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006145; x=1708610945; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J9hLCgOgDWO+oXa7HyITa5NYPaX6P8CRXV5rOrD/zA4=; b=QopeS8w7enqlhP3DuTlw6b5CI+lqasaOpxLcQo7RUDoZJCIUOCZubN1d5rxeTkZzzY 2cHeE6imORvBS3ND1LGhlM1ggjV8j3FE+jV8TwkTEDvIN3xQixNuo34h58oH2Y5ruB8O wtObZ82D8sCqL6I+UrUxmTt2i/I3qGSLHhkuolSuhUpbqpuR8vZbHW8euwARUF1wUrqe e/cUFeSUZGF9mpBZyYdmcHcyLeP936HqP4aQMpait1i+FmErJ0arRS10i11xmGjEIMJe QlofYW7fa1AQKunhzEuc91UTox/CKIwMeap+wT0fNiXPfvpy5Gr6VSvY5Y0YUus2l2I7 slZQ== X-Forwarded-Encrypted: i=1; AJvYcCXCCQCk/cfchTdxM6bDT5eVEXvt53XYlv4ncDwe6BMwJvdRcCYUmzGcYTE2MQLmZ/Gngfd2xbYbr6yWEHohTFXMuTYhKNghWwIA2UBU X-Gm-Message-State: AOJu0Ywg53ToAGXFGlUiAyV0Yt+QM33ybJsRWTMMQz9vGatPK7fMfdJz IeLyeP9qUhzfzvNyTZ22OWnRlUE6xNk5AXBfYFWtTKWAu9HWzEffmi4uxSw13fo= X-Received: by 2002:a05:600c:1c18:b0:411:f49f:b274 with SMTP id j24-20020a05600c1c1800b00411f49fb274mr1578583wms.0.1708006145169; Thu, 15 Feb 2024 06:09:05 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:09:04 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 6/9] watchdog: rzg2l_wdt: Remove comparison with zero Date: Thu, 15 Feb 2024 16:08:38 +0200 Message-Id: <20240215140841.2278657-7-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974361881188125 X-GMAIL-MSGID: 1790974361881188125 From: Claudiu Beznea devm_add_action_or_reset() could return -ENOMEM or zero. Thus, remove comparison with zero of the returning value to make code simpler. Signed-off-by: Claudiu Beznea --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - none Changes in v3: - none Changes in v2: - none drivers/watchdog/rzg2l_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 93a49fd0c7aa..29eb47bcf984 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -316,7 +316,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) watchdog_set_drvdata(&priv->wdev, priv); ret = devm_add_action_or_reset(&pdev->dev, rzg2l_wdt_pm_disable, &priv->wdev); - if (ret < 0) + if (ret) return ret; watchdog_set_nowayout(&priv->wdev, nowayout); From patchwork Thu Feb 15 14:08:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp425337dyb; Thu, 15 Feb 2024 06:11:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWGljqcFBuVcQu2q8HNsFypLlq5c0FfcXnA1nSOGjARCiZ8GnpZw3RUI3a0Ci8xGLo82tPRnrE7HvKzUL4To9zTheCI9Q== X-Google-Smtp-Source: AGHT+IEnRhZ7BGe23ei0z6o1hwGqwez/clHYMCcdGJ6LfOBzxg8hHD/SSdDZQj/GtMXHoLImxBV+ X-Received: by 2002:a05:6808:ece:b0:3c0:3767:b323 with SMTP id q14-20020a0568080ece00b003c03767b323mr2227144oiv.54.1708006315511; Thu, 15 Feb 2024 06:11:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006315; cv=pass; d=google.com; s=arc-20160816; b=StorpGGOsNuB4Ia3KJ9DgYTE8ee5QPw/2d/zbjMxNSXyp6afN1N4GrhYmafbiNlT3F J5I+3fxf5QtJ1URUJQJxHmZtAxyDbNozXS+TdYI7F/8fkUFEsy/ECo6bdlcn66CGniYv ZJvmU8V02y5GzbKVB5BveOEwZDtzLmrvNYCPdQvvoXHw/S4kZ0RgvmdxVu/1SvMje9Ae bUgu7HlBWbzOIot10r9KdPIyHN+/DsirQ1ErVTknYw6xFjnGQyL5/FA+Xw+mccwBQF8n HH3eFtrFlqmFKY52nUolvbdT1SF5drfBaP3O66//aEkIk3ZDT3nukCktCz6zGsVlrJJ2 IpFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=OQB0tXSAMq9qhOZv6U9//5OYMEGwVG4X8UpJn23TuJw=; fh=kQHaG9/lBITiTNA7JSnXlSnD1vaO/LhtQGsHhje3k9A=; b=lcaX6dlVl0+8252PWyhX8FdipTFG7fq3zyR93xlEDcCT0BhW90XyZMiLMYmjAbmbmG peRxdnuRTYRJelu/1Re4suD5o3QRIasyzpoA2mVOuOJ+OizSyuCk0x4Ib03CJnxtaatQ YpV+HR9ug7JJAP1BsrJ+WqMGSl+O4JwFYwn/XXH30r3iedxAhvuFzLt22RDb/MQI/XUU qKNwg4c6/uGKtMIbgZxQa7tPk5XTb0JtCIO9csQIe15MpAvZSWEHdm0Vr6Y38fM8c9nW 4tjapmirnRDtKsfx1yfnsZFp/2b19X4clvdlb/Ux30xG2g5Bfu/7os/pUz7JkPOfgU/e C3yA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b="a/a/Aimq"; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67056-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iw9-20020a0562140f2900b0068efa58259bsi1524650qvb.157.2024.02.15.06.11.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:11:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67056-ouuuleilei=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=@tuxon.dev header.s=google header.b="a/a/Aimq"; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67056-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67056-ouuuleilei=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4B4A01C245D9 for ; Thu, 15 Feb 2024 14:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5567B133423; Thu, 15 Feb 2024 14:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="a/a/Aimq" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 851821332A4 for ; Thu, 15 Feb 2024 14:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006152; cv=none; b=L6618z0fptphX7elQyiWS048SXvoaoyXfk2O4e6wlPgWrXPUvI4Mg3TG06PkylXTuciI4z3d/5PdOxrubsgSoemZCtD/NTavH8QqjsNYwMwYzOAPBlRuJIQXeTW1ipqRlkPlwG1bIV/dX4DFcuU/s76YTn7tvh9iM5HdOighPUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006152; c=relaxed/simple; bh=CtaxfqFvOxEXaO7d0s21hxfy20LkQ7KUXiXAGRzmMlo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J9xNeupOKjk26H3T4WAAewlAaQJjx0vjdQaX4zL+FJmsM+ogJu+Vjh5kfiaZv2xTG8E2VoVXClw02t9HZAzp6FUWZSJYdZKy45WEXGHlMrsfihullCGG4cOq+mKAs05ZQ+GKrV5u861rqqqGaX7KaArf06WCL2f42G8UgyB/pLk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=a/a/Aimq; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-41232741dc4so184805e9.3 for ; Thu, 15 Feb 2024 06:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006148; x=1708610948; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OQB0tXSAMq9qhOZv6U9//5OYMEGwVG4X8UpJn23TuJw=; b=a/a/AimqQQNl4mXu2OSqqEzWKjIp7NScqQk2VJ1DLGj4msBKLfw+OV1bjvceSfNWhg y4Hr1kKpeHoKUFxiCsdE42/uUipSSsFa6Kc6Q0Z+F0affDNIBswqGawc6jqCigpwOhYE bgr79RfxWJUqTwnB+/9MoL5Qp64lMXmBzdPDJ0JWbULqqZtoWvuF+GxwH5Yhce0a9wQ+ OI7U0sC/74eaPbSNEdJUQIEVQham1yUjqsLe8aEWN8NWRRgiS3tHNXlGHDSu0ENNZBU4 VbuFNSFPlmfQZjHosqXLvTE4RM03W3DlCPOqKC55Mj/NQvsGADupMPZZqFgY98DxKCWQ 7IeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006148; x=1708610948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OQB0tXSAMq9qhOZv6U9//5OYMEGwVG4X8UpJn23TuJw=; b=MQjh85phrZcUuN5n8i+0MRckw5Y+XPNcjI9joGfKLc4YSJwEuFxFFf+sUFe7VwvHSp ZQTRutdXdzEpp3nKU/j16qzXYqZkG6oTx3gh4YXs8ee2csvGhYbWsiMfjQspHWjwtf1n 5a9KUli+Sq1VKX5mbu89nr0nbMRZUZoR8eZaXPAqWkufP694BkIp/m9eKYCY4ykphr9B vKUp2Xhr+my2tTvotv3FHNvgMBrtwQdrcIoxVoTwawkR0jiXXP4QG3rMO8FBl5TySK4q 92tEhtzSEMuhOC6o/AwEYuMrTZllDrRReU+E/H9J0Y1oJoXgOudrk9UVjrSjAsEMA8g5 8JSg== X-Forwarded-Encrypted: i=1; AJvYcCWHLlC9+9sm8hmzGFSeCcau3GguEmyudMRA9zhryGePzi0YIhVeOqJK2TLoOhYbN7RKL3saSlJOmlHXRN8omW+XnsFioWoHrFgs4GAd X-Gm-Message-State: AOJu0Yz67iASOUadnKMzfb1G0CpRNEnRtXYjtFge9Mzb9OfCmr06+/uE NOfSjdhjotjLJL+kfwwpP7SBdvX4eiuRd2HlJVShxBRN3E8ZcM+OLwPIQPhHXZ8= X-Received: by 2002:a05:600c:4448:b0:411:fceb:f61 with SMTP id v8-20020a05600c444800b00411fceb0f61mr1551163wmn.24.1708006147836; Thu, 15 Feb 2024 06:09:07 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:09:06 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 7/9] watchdog: rzg2l_wdt: Rely on the reset driver for doing proper reset Date: Thu, 15 Feb 2024 16:08:39 +0200 Message-Id: <20240215140841.2278657-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974429979817608 X-GMAIL-MSGID: 1790974429979817608 From: Claudiu Beznea The reset driver has been adapted in commit da235d2fac21 ("clk: renesas: rzg2l: Check reset monitor registers") to check the reset monitor bits before declaring reset asserts/de-asserts as successful/failure operations. With that, there is no need to keep the reset workaround for RZ/V2M in place in the watchdog driver. Signed-off-by: Claudiu Beznea Reviewed-by: Philipp Zabel --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - collected tag Changes in v3: - none Changes in v2: - none drivers/watchdog/rzg2l_wdt.c | 39 ++++-------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 29eb47bcf984..42f1d5d6f07e 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -54,35 +53,11 @@ struct rzg2l_wdt_priv { struct reset_control *rstc; unsigned long osc_clk_rate; unsigned long delay; - unsigned long minimum_assertion_period; struct clk *pclk; struct clk *osc_clk; enum rz_wdt_type devtype; }; -static int rzg2l_wdt_reset(struct rzg2l_wdt_priv *priv) -{ - int err, status; - - if (priv->devtype == WDT_RZV2M) { - /* WDT needs TYPE-B reset control */ - err = reset_control_assert(priv->rstc); - if (err) - return err; - ndelay(priv->minimum_assertion_period); - err = reset_control_deassert(priv->rstc); - if (err) - return err; - err = read_poll_timeout(reset_control_status, status, - status != 1, 0, 1000, false, - priv->rstc); - } else { - err = reset_control_reset(priv->rstc); - } - - return err; -} - static void rzg2l_wdt_wait_delay(struct rzg2l_wdt_priv *priv) { /* delay timer when change the setting register */ @@ -187,13 +162,12 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, unsigned long action, void *data) { struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); + int ret; clk_prepare_enable(priv->pclk); clk_prepare_enable(priv->osc_clk); if (priv->devtype == WDT_RZG2L) { - int ret; - ret = reset_control_deassert(priv->rstc); if (ret) return ret; @@ -205,7 +179,9 @@ static int rzg2l_wdt_restart(struct watchdog_device *wdev, rzg2l_wdt_write(priv, PEEN_FORCE, PEEN); } else { /* RZ/V2M doesn't have parity error registers */ - rzg2l_wdt_reset(priv); + ret = reset_control_reset(priv->rstc); + if (ret) + return ret; wdev->timeout = 0; @@ -297,13 +273,6 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) priv->devtype = (uintptr_t)of_device_get_match_data(dev); - if (priv->devtype == WDT_RZV2M) { - priv->minimum_assertion_period = RZV2M_A_NSEC + - 3 * F2CYCLE_NSEC(pclk_rate) + 5 * - max(F2CYCLE_NSEC(priv->osc_clk_rate), - F2CYCLE_NSEC(pclk_rate)); - } - pm_runtime_enable(&pdev->dev); priv->wdev.info = &rzg2l_wdt_ident; From patchwork Thu Feb 15 14:08:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp426947dyb; Thu, 15 Feb 2024 06:14:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXEAO91jUN5WglYnYfz63SfbIY0r85mRRWzq5ZI+tgOEbjsITzFb1+GjZ9n8m1X0fp/TjM6nZelr3CVnKG14wu5WccJ2g== X-Google-Smtp-Source: AGHT+IF12uEloWTkojXDHrYO4ZQ5GIwbRaTBg+KFnEehsx2/G1hvE4iX3O47XxJocv8LtNdx7bo3 X-Received: by 2002:a17:902:b20d:b0:1db:596e:8b93 with SMTP id t13-20020a170902b20d00b001db596e8b93mr1600279plr.62.1708006459009; Thu, 15 Feb 2024 06:14:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708006458; cv=pass; d=google.com; s=arc-20160816; b=yjP7ByanaNLGAWeNy5z6ZhHxn7cFKbBi615GT/Eu4xMKDJS1aguPo9JgLRVFgaRzP8 Ma699oT/wyhmIf8CwVxkLC8BiVx0DgpiCMtUo20tI5dkbNFAcE0oa6EER9YHfP2oJI+E wF2FL8XXsidvj4BbZnVML6dKXCs1UFVyAKkS+SIM34olLqVgTU2hXbtpKpou1JmiqRbI p8uEtBPVXuIv+aoHosYJMMztQOuek522PyQMss0Kuq8EjtkS1xmEp8tBj41Xhc6FNXZo loNoegmiR+LgioBnXni8KtsM3c4RYzJinZrpYE4CyCYDyivr7qVoBKmHldOUhs4B27nn xWMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7GMx3oEvdufHoBvmFi6dbwMx9fUDNCWnepPcsld4qxw=; fh=PM0uR07VynnhNRwr2fbIkX22vrP6ZsmIkqSLCrnDPdA=; b=UYKx5zMkE7DkWtJVV+b+zm6SoFecknWd1myJPadWVV390NtRXQYBcYWrz/ZPHx28Ki xM1FqW96+AQqLFYTpot4cCATOsQ7cx4owyw/83R4oSJKhAAnNH88xjzJYgKOByZ6F751 59pExqicy+jQ6m8xYL1LASVK/ea9l+qv3yuX7MGMyXl4AEzAVpTWt88xlZy0X3sNbqCD y+2Q7sOqgtU+ZNRdU59e6eQ/TvIQiuaQ6QvLyj8Ar3SE7vyQENTHZNplCJqOrI4EJq96 ZixG7ANXl/AYMrdfJH0+ySUKclxZr4/G/ung1qYdgTw3Kice8yM/h8yvlrT1AWiMD05J W96g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=DjiT0rk+; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67057-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67057-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n3-20020a170902e54300b001d7852b689csi1187787plf.461.2024.02.15.06.14.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:14:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67057-ouuuleilei=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=@tuxon.dev header.s=google header.b=DjiT0rk+; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67057-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67057-ouuuleilei=gmail.com@vger.kernel.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 EF3072944E6 for ; Thu, 15 Feb 2024 14:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FE4113398A; Thu, 15 Feb 2024 14:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="DjiT0rk+" Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 6613F133400 for ; Thu, 15 Feb 2024 14:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006153; cv=none; b=GVZgpCicxRdG4vc3xi3j443i4m7PxHm/Vc6RRwUwg6pWPy26uNL4gTDXHLfgxk4VWWX5MRdaXwqTxfj1VeIsmu7s7uxftH5WFeaxaMB9g2I5GAULDStCAR8vfy6s4s+qRVkFRCPTd4Ysw74Gf5QOckYYy8ttnIXhVc+/lzOlNXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006153; c=relaxed/simple; bh=b/dlKiES8flQO1V7kDRxQagNiDwOIUuMR02By8uyldM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fJZtbmxlYVXkeS0mqrArje2IeCE87nr/k8aCWZ1FaNX6aBvhHr1kKZ8IU1yk3NWYTlffbkCUU+xjSbutoUa7LTLzKBL4vMtd6Q/CAymWuc3c+4/N66owg2he6mZX2ofLpy5Wqzd+aI4rUg5j/jomdvhnMbNEX+gURi73CxRhWug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=DjiT0rk+; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-411e71d8a2bso6524415e9.1 for ; Thu, 15 Feb 2024 06:09:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006150; x=1708610950; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7GMx3oEvdufHoBvmFi6dbwMx9fUDNCWnepPcsld4qxw=; b=DjiT0rk+zQmfaS142q7BKYsfwol45IPjbXcAwO/9/h5ASkZThSojCLTBTCFbV7QJcF 572uMJo2HqGShQwoEmllDH15qnwjTt7ODxReJaQK5D1g5p5yebo4wtEVnBEqRuvE0cyi OTqXlgg8lG0Ym0f883AsTBpfHMBq2pamVV941eD2kRc+rnt25BKRoJb9y9SDmgRHFedc 8VyLZUcZyELJbufeI5V3obUDdKZVTWg9pXmxJ78b1wcr/NaZ/UjUwlKBVRSk+rmcmvcM ty20vMKA2F6xQQzlJigW2Lly+mqdHWvthkBNDQEiS6MTD7ES3sXzICRLZbmYc8wSGzHP Rlow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006150; x=1708610950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7GMx3oEvdufHoBvmFi6dbwMx9fUDNCWnepPcsld4qxw=; b=Qu3dqisk8TUkplq6rY14kbzrPfpcys8F4FSpuZH8SCkhKOOIo1uVi6BDRxdgcj/qzw absCxUDMw0QuaxweZ8NDggAbfqd+x0apVhYOgluGfmrhdVSkIXnUpBlFT3Ilh61rJ+ER CxoGpC9/6/ICJ3hqYLHS30+Ofp6gK79Ka16TqQdUQIpM7uW6BrlqRKFlTbc0tT0HhCHK qrYXGOxHQTKe0pbzJ1CYVN5BuzliU8TbVsPsUsAxBQWmThEfYcj7AU2+P9ULual0mxG3 JtzgV3VKUuyG74scmJeRq43ouAGDy+yDduyFWgNSbVOsTFCWh62TjoKc+j88vq2nL8CU Id+w== X-Forwarded-Encrypted: i=1; AJvYcCUiDErndvDw5JST4QoSPgrztPPIo5rOeEZ/OPfOW9johlrsNrVLxoGBLkt7rjBmF4EmFSe0r2jvAwgD375pOzCghPDv5sKPNuJgZJn6 X-Gm-Message-State: AOJu0YziXEA4bluJl7Rz0TmkVZccJa0b8fntWIu4K4KsuT3rXv0bf4bI ubXdXOtsOLBwU1/aXLS5abz8o15yVem2+vmMKWYAfZvdAdhNmq2H7xrADyrrM8s= X-Received: by 2002:a05:600c:5342:b0:410:8db2:d5ec with SMTP id hi2-20020a05600c534200b004108db2d5ecmr1478045wmb.38.1708006149702; Thu, 15 Feb 2024 06:09:09 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:09:09 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v7 8/9] watchdog: rzg2l_wdt: Add suspend/resume support Date: Thu, 15 Feb 2024 16:08:40 +0200 Message-Id: <20240215140841.2278657-9-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790974580864598370 X-GMAIL-MSGID: 1790974580864598370 From: Claudiu Beznea The RZ/G3S supports deep sleep states where power to most of the IP blocks is cut off. To ensure proper working of the watchdog when resuming from such states, the suspend function is stopping the watchdog and the resume function is starting it. There is no need to configure the watchdog in case the watchdog was stopped prior to starting suspend. Signed-off-by: Claudiu Beznea --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - none Changes in v3: - none Changes in v2: - remove the usage of pm_ptr() drivers/watchdog/rzg2l_wdt.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 42f1d5d6f07e..c8c20cfb97a3 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -284,6 +284,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) priv->wdev.timeout = WDT_DEFAULT_TIMEOUT; watchdog_set_drvdata(&priv->wdev, priv); + dev_set_drvdata(dev, priv); ret = devm_add_action_or_reset(&pdev->dev, rzg2l_wdt_pm_disable, &priv->wdev); if (ret) return ret; @@ -305,10 +306,35 @@ static const struct of_device_id rzg2l_wdt_ids[] = { }; MODULE_DEVICE_TABLE(of, rzg2l_wdt_ids); +static int rzg2l_wdt_suspend_late(struct device *dev) +{ + struct rzg2l_wdt_priv *priv = dev_get_drvdata(dev); + + if (!watchdog_active(&priv->wdev)) + return 0; + + return rzg2l_wdt_stop(&priv->wdev); +} + +static int rzg2l_wdt_resume_early(struct device *dev) +{ + struct rzg2l_wdt_priv *priv = dev_get_drvdata(dev); + + if (!watchdog_active(&priv->wdev)) + return 0; + + return rzg2l_wdt_start(&priv->wdev); +} + +static const struct dev_pm_ops rzg2l_wdt_pm_ops = { + LATE_SYSTEM_SLEEP_PM_OPS(rzg2l_wdt_suspend_late, rzg2l_wdt_resume_early) +}; + static struct platform_driver rzg2l_wdt_driver = { .driver = { .name = "rzg2l_wdt", .of_match_table = rzg2l_wdt_ids, + .pm = &rzg2l_wdt_pm_ops, }, .probe = rzg2l_wdt_probe, }; From patchwork Thu Feb 15 14:08:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: claudiu beznea X-Patchwork-Id: 201502 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp447305dyb; Thu, 15 Feb 2024 06:45:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVlqVyJG0Qs2oOiJ5y9dGhi7+/rUb9eTFtSNQAf27FjvbW2nUQ1WCAqNvMpMwcNCrcUaFG7gTVPYLFtRjrsZRhR7zzqhw== X-Google-Smtp-Source: AGHT+IFlpmxR+f1bvyCJmlNyLs2DFtKP4/v0ohfXE12mecVmSmyD/BfDDY7ajBGQw48aJrIH2L+N X-Received: by 2002:a05:6a20:d04e:b0:19c:a3de:647d with SMTP id hv14-20020a056a20d04e00b0019ca3de647dmr3065576pzb.19.1708008345663; Thu, 15 Feb 2024 06:45:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708008345; cv=pass; d=google.com; s=arc-20160816; b=ZbZnPUEOL7DWhhkn6jNOvQKUSDJJzJ7pq8G+E3TkV7yp25pBmPsxOrAGXBlRDzRGbX jo2uAjew2mTOMSIxYCqhVB2LS+yMRWjR0cU0J5WKKvyN4WCBdgKkrS5xOgFZaYvNXN5s Ncgzab1W0TWdIwrNTX7qR/0EA2/TaJNv9WRpdCQwrYQAR1wszgPueCCuPUD6bb6UKq1w rrCK7iPzqShyxavdURefaJF+QeuUG7Hcx/vcok2+5SkhRFh6g63WdFFZmOeq4oY8GE+3 M/dMLVYAZYrjcb+l4dd9w236j+0s9bhs6Jik83O0+8Qvp1CBidWlFjKK9aulk74ALW7u Zx7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rijbwvHcSAy25b/Tneh/0DG0Xorpu1pIj5rjNv2eY/w=; fh=1DXE4a63ulsH0VxvXn2UF98HDlZQE457z6S0kUlF45I=; b=b7n4LUVqe0zQcVqABWfmiFFBPhbmkbyFaknH8wyWVDNf+sWR6SYzc80YRgZBZBXYQ+ 6wWPre+ZPRKwjXCS3aYkq/br622diylackWEal8efx+jOV6IdhnkC+vJXPeiDlm305Sf EwfWDB9661qQw2zWRzJcN/JoaekIf4qjr9uf5pfMv1LcbwiAgRmrpcBhDZiGhWx8z1WH EBEvsqDyWhQR7bHr8EjN5e031EMBKKeT2KusIEvV+AR93+aerRGUusKPhhM7jOhUn1jx Jxuujuw234/rW421wDZDa6BN0krIPvNBKsej2w0hA6FMIFb405nhYUS6jqGBi4Gckona tFqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=b7BmtPHD; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67058-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67058-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n23-20020a638f17000000b005dc82a6711fsi1223845pgd.102.2024.02.15.06.45.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:45:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67058-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=b7BmtPHD; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-67058-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67058-ouuuleilei=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 746C3B2B339 for ; Thu, 15 Feb 2024 14:11:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E94C1339AA; Thu, 15 Feb 2024 14:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="b7BmtPHD" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 F317D13340E for ; Thu, 15 Feb 2024 14:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006155; cv=none; b=dZ3jccUUquVnl3rS2i6HfrrrUvqZLUqPa4RrXfjCDwO1gX73tKEkMydewltVRpB/juppUOz7Gb3SRLYwfxw90juiIxCFsEU8lMvseeBd4Av1dtvw5N4Gy0x6Rv6QjjoFf04mV61K7MVJs1QkHNv24jJiIvimHWRRklVcmwQjtD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708006155; c=relaxed/simple; bh=2C2IVa4viiNlUGmLOxJLTFOjDptgPpUuxtWwnvfEGIU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iNuPUbtwwmVxHBXhyxM7XJHgRTDbvtB9u4c4lrmmbfwqKiNL0ktmaKvthI9n6GIZdZwT7lucioXe07fcCwA3EY0hwDGO+hdbnnRWCp4n24cG43ql7eZuGsq1PQmsTSNTHjWoo1NGY/s0d+EemRogjp20gkyLBOsJT4Lr9ByGejU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=b7BmtPHD; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4122acb7e69so1979255e9.3 for ; Thu, 15 Feb 2024 06:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1708006152; x=1708610952; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rijbwvHcSAy25b/Tneh/0DG0Xorpu1pIj5rjNv2eY/w=; b=b7BmtPHDrwRBmIFvsaHyY67L3XK7LLc2QkaSykgvNG1mrH/KxPwMA3Lg50yx3F54KB F4YLr2QT1F36G3PQ78FdZiT9+xfoA7M/UENCf77pxcQBso3CgFKOoNr4Hud3uhjK+FGU /lgggoT5X5V9x0GI9dU1+tWip45QkhZYpAsKUm8awe6RjQGNVcFDh0kZEAux4cJXdsQQ PzourC3eMqQTJ7z1ia+yMA72XCqrJCPQawPH1msEpvThc0885D4zEDkikky2mRo5GDyE zDqSDMlK4V9+ApDP6WtiTKMOkqx1n25bGB/bHmUZUzc/n/zk5vdZ8jFHAUuTVT2a5iFd MDkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708006152; x=1708610952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rijbwvHcSAy25b/Tneh/0DG0Xorpu1pIj5rjNv2eY/w=; b=AYGZCsizmfmL8A2br21OVECkttmRRXeLnhwoCC5c7E3X6Nn+sGpkTWYpggy5Ly8si4 6ZLgMg2SQzMJ6+GQOy7L+RxZRoFNaQQqDHGTCzQSm64l1aIbaZ80PH/8BSBVbGaMYKqh JwOZfAvoRzvh5j2hueBUsYgUWAEK6oVUFrNZFWAo14KNIudCAjw+iJa1hNYGhnpdTb78 Bg4L7gDNFU6lSSoYoGSP+qUNu7/2fdmXXYZkYeLL7McUSmJQdVB+lwUXkPn36/BFEoXL 4nc7C/qIRhUs3EtDLJQJzUkXDb7UbYEaP8Fjp21TN51zRAVK/zUje/cNebgakmkKhC9w XlDA== X-Forwarded-Encrypted: i=1; AJvYcCUS3rGpCi+hSF+o8q2f9sobuyfhlUfaDG9an14g8vncP+hCgvvIimAvUT2X37Ccs9ssvWdwg5JphbTpB/aZrohFscLp4B6G2rKKuKO7 X-Gm-Message-State: AOJu0Yz1NrzWmcmiV/MfF/SHdDucAse1bjEcRSu82qxgmb/9rJLF+L3W QsXqI+QxuFpIAJ2SqItl3HQa+uImIa3RhXhHRfqAhDA4eopvfKniUwqt6+hFjiY= X-Received: by 2002:a05:600c:4507:b0:410:71e8:4921 with SMTP id t7-20020a05600c450700b0041071e84921mr1683519wmo.24.1708006152465; Thu, 15 Feb 2024 06:09:12 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.20]) by smtp.gmail.com with ESMTPSA id h17-20020a05600c261100b0040fe4b733f4sm5120950wma.26.2024.02.15.06.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:09:11 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com, biju.das.jz@bp.renesas.com Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea , Conor Dooley Subject: [PATCH v7 9/9] dt-bindings: watchdog: renesas,wdt: Document RZ/G3S support Date: Thu, 15 Feb 2024 16:08:41 +0200 Message-Id: <20240215140841.2278657-10-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> References: <20240215140841.2278657-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790976559321425816 X-GMAIL-MSGID: 1790976559321425816 From: Claudiu Beznea Document the support for the watchdog IP available on RZ/G3S SoC. The watchdog IP available on RZ/G3S SoC is identical to the one found on RZ/G2L SoC. Signed-off-by: Claudiu Beznea Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven --- Changes in v7: - none Changes in v6: - none Changes in v5: - none Changes in v4: - none Changes in v3: - re-arranged the tags as my b4 am/shazam placed previously the Ab, Rb tags before the author's Sob Changes in v2: - collected tags - s/G2UL/G2L in patch description Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml index 951a7d54135a..220763838df0 100644 --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml @@ -29,6 +29,7 @@ properties: - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five - renesas,r9a07g044-wdt # RZ/G2{L,LC} - renesas,r9a07g054-wdt # RZ/V2L + - renesas,r9a08g045-wdt # RZ/G3S - const: renesas,rzg2l-wdt - items: