From nobody Tue Dec 23 20:08:59 2025 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.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 A830180635 for ; Fri, 31 May 2024 06:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138672; cv=none; b=mS0yPIV0sgA24Hz7EEQpwjSzrjpcGmbThFul1Nd17VTZGnkfvNRdA5DC3EQWbECQg4vbS7YN1OF4m6myNX9Fey+EQjesvq0+eWuVQR70UQGDFy5ZlEZz4eP/+yRuw2/nBqilmboxMKI+/jRb44CtsQwK/q3T4JKpbrbcwwK3nYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138672; c=relaxed/simple; bh=TJ37oY0V5Jeq9pwzVqB5NXbszEJmtjwoCWFdS6GxE4w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=E8cAN5GA9xXCyN+OTKAQAU1g1pcKNscP6kDGlE+o0JWDzY5sXNFswlCchkQzFYfmvfqHfQgCgqGdqiMYlR1JGBMBKWCV/3DyqJhiFH4nfUauauBOVNaQIeP+4sSS4C33Odl7cNtea4fhWLDG0Fkdu3VSnRvPnjG+jq0OUgD2aow= 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=TaeDAe++; arc=none smtp.client-ip=209.85.218.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="TaeDAe++" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a6341cf2c99so171038266b.0 for ; Thu, 30 May 2024 23:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138669; x=1717743469; 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=y3zKbshCSYA/cMA+U0AV3V6eLZi4juLiiPopO0uScF4=; b=TaeDAe++0m4Ns6B9zifIbUdv+4nb22aFjinH885cmLjGfdVytsdez+mGx4huERlpWE VotWKT7DlrfDsf44L4YmgSqawU7o2MqHv3yLfQXFmFS/l/77Bv35JY7w6bEls4z4FhM6 /Y8HmqSs5I7ZzyIzw2HgDSxvCwqj9BXTHCc3UK+IvlNLGRreiUaC9dua8ZNEfNscsjdD bq30uZ27saV3xD6xF6s6Npsa6eVr7L1cBG3piKAkNPAt/I1uI2vmxEtSZodCQiw4WPH3 eHN4bRX+ZmR4bbWR7woMiQxxqJFhda75ownrRGdhfPDXfCTOnld8jv4tPi2DPxuverv8 5roA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138669; x=1717743469; 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=y3zKbshCSYA/cMA+U0AV3V6eLZi4juLiiPopO0uScF4=; b=fzkw0pzqrPjP6eQ9kwYdkr3cvmwSQ2rFiFcI8SOZhvr9r/poOBrdiDBhestCr0jfmF hqBL+RW6rhcUrE5ytj3mwxBwt3lJcBWCqE0/B2JM2zvPk/wG/bpInhBsHmDUQKok+TGg nSs2jz5MsdBHePJtBe6zNPf+7zPK1hOxVsKMxrHeDq4Wf7HZgh+dRkLsKkF4BIStgPSZ 8xJLay+WXtV/xeyOxKo2QzMgb5wToDnfzbLmaH/ZQMHwgchHE1dhqRekH652S2JuXu45 59Q5KadYfojfeTZYp0TdWr1hmbjByXHv4cQcmzB0c6eNH+P+o/i6L5ps+ZHqIdIDx01E pY4A== X-Forwarded-Encrypted: i=1; AJvYcCUD9SjaYWFGsI+bqwkPGs2eZjawHikdorIKGpw43qT1VScF9+8ObvPQaQkqhIIoUaItm4s59kjLBaNFIiRP6LlVvckpspU8J/pIYfsG X-Gm-Message-State: AOJu0YzKrVhkXFP4DW1k8dDszMSnVd2lakj3f3EJgpRAfDvzZgJXzwB5 HSeWblrXVKF/LGZUqGStu/NV14Qb4zR3MBzHqs+27wiJKb3c7PuLWYCshtdIkQ0= X-Google-Smtp-Source: AGHT+IHKh7xpZYum2rGFe8T9b7OxPvNEJ0hlv1rVuy7vQA537DHUDNfq1OsJivp8xoV77YksfQsONQ== X-Received: by 2002:a17:906:c34d:b0:a59:cdf4:f939 with SMTP id a640c23a62f3a-a681f87e9e5mr60156866b.3.1717138668988; Thu, 30 May 2024 23:57:48 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:48 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 1/9] watchdog: rzg2l_wdt: Restrict the driver to ARCH_RZG2L and ARCH_R9A09G011 Date: Fri, 31 May 2024 09:57:15 +0300 Message-Id: <20240531065723.1085423-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tags Changes in v8: - none 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 85eea38dbdf4..ecd025dd0fef 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -932,7 +932,7 @@ config RENESAS_RZN1WDT =20 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 --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 EFE8680C1D for ; Fri, 31 May 2024 06:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138674; cv=none; b=nCdhRDF+4xG3Lj5df17Mt9dUVG9AN7M3/maOsBLNsDJM+VFBqQ8k6NrkWpBYGjp0FP8jhqR2/f1RJGUrQv/ZwaCvG69cK2duPHoKOjjW2e+2yk69UxYq07N85mzJe8xgpfW1PgkLCz4CmKdqwEjvI2SNEZ348ZUPIDwJgNuy9YY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138674; c=relaxed/simple; bh=GuICZzQNErHvuG2P1OP6ZysijVVwTxA/SYYbpm8UHrQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TjAQUU9gl3nuJxE0sEXucZJR/wllYRvJzaS9OQa34gjsI/uCo9kryssdwoPBGx5L5//7nN//qoN7U0zMYNi4UfW8/2mux5GLsXSMR3RBQclQOS0w43mEuA34STl2LtKPMF/5LdQT+Gjl2JlSU25j3li58C7vsU7ZwrcfIZlFGRI= 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=b3npg3Q5; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="b3npg3Q5" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a6267778b3aso135641866b.3 for ; Thu, 30 May 2024 23:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138671; x=1717743471; 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=+eQAiMDX1+Kg2KUabFIpayCevJwzqOIZx5xL/Lss4a0=; b=b3npg3Q5qIO4eDJ2AchQCsa2o+utMNdr8J/DXWu7jb3/PPRAgTkbtgmnR0X7z0NC5/ WvFa+Tlh/IhS2ZXwvLUwVqmJou6psSAXp4ygW+68l9ejIg/Qr7rS80D0tadbYB8yQQ/7 I3qMD9sR7eReFR69cTJiNZhhpATzHl6pczEDFlVqSYAn36g8PWdl9zmNuTb0yWhhQ3wd QN9Oa0ecuS6k2jiWV+Opsn7tPm9YblPagX1Z48wibY6ICuAD7lF+l0XGuLhWxMtIhMTy 41rcsK5EGJyOHrnGPHVmXMRXkDr8UxF38NTXkEn1IM0wLdXuSCR3iYYw1TiIB5lHYtYG SxXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138671; x=1717743471; 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=+eQAiMDX1+Kg2KUabFIpayCevJwzqOIZx5xL/Lss4a0=; b=crGNtEXqWQ6ooyzhvwKFV7naKZKWA9WN7T3xdvZNhR8rq1g6IsLebQL9a3KhiXO+gP 1lLsubarGg0xPhz/ml1ga/CxVlxpJQVw6T81eXleKYUuiIgT1I6Bbr91ONY2m1iuJKnw wuMxn9v50Vbapweg87KcTXKSr0ks4M3Tw6yDkFe25VWFfAt95vEyW7cLmi/qo7qVdbiT 71dujEc+oFC9X02REPdkmFWzflPxkFiZ2LqK0gObvRKXaJ6GBjZplO47gwN6zNgMiKyU hTu1Lij5jXil0JgoA8tnCF7W0im/MXw7a7qM1e7CjQ8xspRPBLzNlDg8VqVsW0lSTLob 14dQ== X-Forwarded-Encrypted: i=1; AJvYcCX8Lu95ZCIQBtpMQ3XhOVm6kPKRZyMaRvwS5rUt1AAl7fmNpxg/PazYlw2WH+VvtjIEB5G3VLMEOk+wDm5FGlzIn4OWtrv+r9IxP0C9 X-Gm-Message-State: AOJu0YwVUDxejRNKfPC8bzbSVCj0D+0Eh/kJ5BQMdDaDm/kycMSYo/2q 9WztYCXBqp/JA75QdOQMJ0s1HedKDdkReYe7DTeocTsdPM0vV4FlNWpi7kEnFqE= X-Google-Smtp-Source: AGHT+IGSk70NB0y9kgfKXS+hqZbQ9AuxtHO2HT7L4I0+tcaJ+ORAwou2TNvbZ0iFs3nHKTNiXBfskg== X-Received: by 2002:a17:906:3b9b:b0:a66:ebc8:ad2c with SMTP id a640c23a62f3a-a68208f10d4mr65313066b.42.1717138671087; Thu, 30 May 2024 23:57:51 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:50 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com, kernel test robot Subject: [PATCH v9 2/9] watchdog: rzg2l_wdt: Make the driver depend on PM Date: Fri, 31 May 2024 09:57:16 +0300 Message-Id: <20240531065723.1085423-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea The rzg2l_wdt watchdog driver cannot work w/o CONFIG_PM=3Dy (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 Reviewed-by: Guenter Roeck Reported-by: kernel test robot --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - collected tags 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 Closes: https://lore.kernel.org/linux-devicetree/202402020445.TOBlFPcS-lkp@= intel.com 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 ecd025dd0fef..20c5f4a6f30d 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -933,6 +933,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 --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F79C81729 for ; Fri, 31 May 2024 06:57:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138675; cv=none; b=L/inht0jpS04wKbE2TaSZZzwCYOq5CVuNjJETqmXqAE5GtB82PLLd/8ZYGRLWrzGlmLQ46nsAgu7QNuZVEaE8TlypaOXbjI5nFYkq6CG6rEYm+ESYDoLiTiZdDxxw0fmmrzCr4WhKcc25cszgeGSBePLiLEMTlbwbRgxB3HGpTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138675; c=relaxed/simple; bh=QNI4I8AW10XPJRqf4xYm+3JD2Bn1LzmR2dsZ8CEcNFc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=My7N1J+SxgV7k7Hz5WVnFFMEaKo3v5SHXTxqnI5Tfrof5c1GY5sh5oGlHrE1ur3EuUN+uY6afL3AHdKZ1eSb9rKYf/YEIX6GVHtyDLTbnWmZPL1KvwEAWV7qaskpBOWxsMCLheyQea9O2iZyuyVVk0hLo7vT7aF+asxTJWSNszE= 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=ilqyjpTI; arc=none smtp.client-ip=209.85.218.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="ilqyjpTI" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a6269885572so329197966b.1 for ; Thu, 30 May 2024 23:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138673; x=1717743473; 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=DTnNIdPVJtOcfxHWJQRC3fErEAL3V9W1LcejJc1adKQ=; b=ilqyjpTIiEwwwjH36Kay2OzT4TWKMFLZdx34JSntXuNgmms9ErsilfLs8htLHgkL2J 95s9dHwa+Vc9Dpi5NL1FKzta5aDGc52KBVMIajXPlzu+NznWXZ2OQzVhS6CJ283CkWqh LhNLpCvaFSegCALiAiKvF31F41BHucp5D0j2ownVk7fD7B9XJt3GD1or8bgh+G2IAu3c qUx5XL4M018hiMfkq2n6muilX79o4x0FcuH3rgnUlfCg4O1icXgQ4gdZU5KLmqwj8Y+f bSrMq/8MIzuuROJQa4UCR4oVc2vGeQQ1DMBtYnW1+PoNGcWS51EaPNT+z7WZYvUm+GOV RFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138673; x=1717743473; 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=DTnNIdPVJtOcfxHWJQRC3fErEAL3V9W1LcejJc1adKQ=; b=kc2Vnn+gr8ZpHhcTakyDHG7DUNILtrrE5zamsmtovCMbyo2vpLmm1CBN1fUay/dHG2 7p6gKqJjAlwd6kk18Nc0BPvzNZbms+B9wE0PuuUpcW64GjCS5zNV45hm1bSTZPUUCWUA v/XSoXIkfAz8PCJGoDVGhdTtXH/NCxbST15aIJKfVeZt2X31in1JYntfPOpudvG0SsUe 7Sv9bsBCtQpASmZQfNRwXcNm75JfJ0TNlQz6cbpvB/ScLp5A5+q02A+0m8uEfLPmLFxD vl3DeVfWhbbpRIJos/pV+Ynso7x91/M1Pl4td0UfD2l9MkI9DKhEPhbFeCQ2RqQQg+By OmLg== X-Forwarded-Encrypted: i=1; AJvYcCVpV3gc+NAfWaZp+wCB0NXP/ht76MXCRTg14qt4RRuWE/u6JxzOaBrprFfBdFTJqaMQ6OYrYlbNzJ/6KS2zVw+OJlnHGyYfyUwrU/eM X-Gm-Message-State: AOJu0YxnKQIrX7kiYfH56W8tEcJjDtKxcbPDjY+VMA8p4paGX1i9i2OQ 0Zvq0O8UjH6bUhkfezDAtd0nQTB0SntHoMNNN4hEVwwiGKJOIrwAjzOzUr4cst8= X-Google-Smtp-Source: AGHT+IGXqRiZB43214AO4T3c5TzVEbgzTdXXyD3rzilxh2DoJekYOKbhfKEhsusntBESUZqDGdRF1g== X-Received: by 2002:a17:906:4313:b0:a61:7f85:e31c with SMTP id a640c23a62f3a-a6818c46ef7mr85032166b.12.1717138672817; Thu, 30 May 2024 23:57:52 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:52 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 3/9] watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get() Date: Fri, 31 May 2024 09:57:17 +0300 Message-Id: <20240531065723.1085423-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - none 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_dev= ice *wdev) static int rzg2l_wdt_start(struct watchdog_device *wdev) { struct rzg2l_wdt_priv *priv =3D watchdog_get_drvdata(wdev); + int ret; =20 - pm_runtime_get_sync(wdev->parent); + ret =3D pm_runtime_resume_and_get(wdev->parent); + if (ret) + return ret; =20 /* Initialize time out */ rzg2l_wdt_init_timeout(wdev); @@ -150,6 +153,8 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev) =20 static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned in= t timeout) { + int ret =3D 0; + wdev->timeout =3D timeout; =20 /* @@ -159,10 +164,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_devi= ce *wdev, unsigned int time */ if (watchdog_active(wdev)) { rzg2l_wdt_stop(wdev); - rzg2l_wdt_start(wdev); + ret =3D rzg2l_wdt_start(wdev); } =20 - return 0; + return ret; } =20 static int rzg2l_wdt_restart(struct watchdog_device *wdev, --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.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 591BC81ADB for ; Fri, 31 May 2024 06:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138677; cv=none; b=KvtiZbCNoo1W6ukfqJOlNQd/HHtnvmemrero75w09Yb9hJlUDRgwO0vTrhAuKy9TMijTK8Os0+QaLaPmjTDNT5VuGRYgxgQnMSyyHq8NGM/qT9T8jtDRguVW+k4ZZAvqhMCP9QdMohD5xFg2t+AC+mq4cTcT8hR5aCUufo5PaZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138677; c=relaxed/simple; bh=0UGwaZRK6aHwnL5LePxRIXYhV7NVtqBcmBMKQs+sdqw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EyYOg2VfknZ5cK2XemV3p/UkL5YnulLb+nzTrmMMdt4RrcH+FR4v00yJaxABvqvp1gv4xY11EEdruOrCtKHm12qsA8iMEe6Z/nSpmTOL3ue5wB2tziScKGR10fntyQCwNrafiSVrWdF+v+gJpaBl/AwzEhY2b1LOLs/JHoJmxDY= 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=EVTqdvM4; arc=none smtp.client-ip=209.85.167.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="EVTqdvM4" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52b86cfcbcaso974530e87.1 for ; Thu, 30 May 2024 23:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138674; x=1717743474; 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=x0Eevik2IYxzref1KJgFO0IRFSiURPphRwX/prtBFDU=; b=EVTqdvM4tB4S/tCSPct7qRJUmLanwHxlA8sllUaEjhfZjDlOzzIENv432puIi3ykdc xOYuuQKwf5Tz9oiwzzgkjjEh8H1KicyrrclWpG74ECMWncnBC8uII2XVk2O/5lCJRCMf RU4I7FG3f7YKZWo8EJy2N+VraPSA+lfdFm8nKkcxS+2TzYhKq394fK/Km6bgnJ9zQcEY e1o0/7uQmqvmpA3uG0zvsURTgRhZ8rd7fNDckuG9wh+4J3Lls4YGS+rrjoPRe2f27TEq CYUGFqvr2Q4wA5Ycca7+72wZYSX//GBSPwho6Sow6Md8LtWSalrC4VlTP7gLMzPbjzKe mM+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138674; x=1717743474; 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=x0Eevik2IYxzref1KJgFO0IRFSiURPphRwX/prtBFDU=; b=VxadT7Qg1sBdTqVkdv6H7RWRwqlyrSl5zKMdfdvu1Koct/qkcAr/sXowtcbW4aVL/H 7Lt+nHyX5ShPLIMQi18jHE1sGoA8tcopdTiDz/d5EPrxMtE40IWCTYHfh/IHqmKD+lho 1cb0I9mlKQwcyAU3+SDOdAFy6CoylwasOWf4cYYiEPRiPBiG5FF7FBb88/iozCoQP8nw STyQqqqEzlkYU+fll7xnXMoMPgnRgrl77beEtN8Ioat+hOGnwCxDYN4znm4LJONUrVK5 vxQyEFXD8D/o6H9mYH52uyS4BDfAzx02aBWYO3llsW/wtHKI+EgW3/QrdSkyTQgHB9ad IwFA== X-Forwarded-Encrypted: i=1; AJvYcCWi+Da+dejdh1TSZpQmT++iMosS+PgZPrcDWdCmuTa2iq49rLDOuzLrdNhwrtdfos3o1rQoPeh/Sxn/A7sK/q66B+Rf+BuBv0QXD948 X-Gm-Message-State: AOJu0YwXsKcDnlpUOvr+WNvDF7tEAHRO4edvH/UzLDhM3Y7n510WIh57 JvgkoBCEtZueDgTVHVdLeniUiB54n9RQHRvrkBci3jSX6y05Oshidl5fnj2Ftnxptcs09NKYiSn s2tQ= X-Google-Smtp-Source: AGHT+IETnb0Kj+EFXgL7RYZwX/GlYv8v0juRmpEXlA06XJZHXRniKf5+iMbZTU0Be7ft6mXo/Hb6TQ== X-Received: by 2002:a05:6512:485a:b0:52b:86ad:26f0 with SMTP id 2adb3069b0e04-52b896b857fmr582996e87.67.1717138674499; Thu, 30 May 2024 23:57:54 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:54 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 4/9] watchdog: rzg2l_wdt: Check return status of pm_runtime_put() Date: Fri, 31 May 2024 09:57:18 +0300 Message-Id: <20240531065723.1085423-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - none 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 *wde= v) static int rzg2l_wdt_stop(struct watchdog_device *wdev) { struct rzg2l_wdt_priv *priv =3D watchdog_get_drvdata(wdev); + int ret; =20 rzg2l_wdt_reset(priv); - pm_runtime_put(wdev->parent); + + ret =3D pm_runtime_put(wdev->parent); + if (ret < 0) + return ret; =20 return 0; } @@ -163,7 +167,10 @@ static int rzg2l_wdt_set_timeout(struct watchdog_devic= e *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 =3D rzg2l_wdt_stop(wdev); + if (ret) + return ret; + ret =3D rzg2l_wdt_start(wdev); } =20 --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 134398248D for ; Fri, 31 May 2024 06:57:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138679; cv=none; b=rgSyV8m2wKW2Qk+tTayKwYYp2OxjjCowv0NOemVNB/femToKNvjCoPqtoYZOpWJINjU5tDUF0gNQcmGbqVcIHlKk+Yo3v+w6zMp1a5abYec11Ot7EtqxU/lSixFzEAzKxxjYffw89avTTZq9lIk0WmSZ9y4UeMF9yPgBn15UN3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138679; c=relaxed/simple; bh=8fURJAgiFprMwv01jDQF5npiroOs/JA4SgWkAF14e64=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XeDuNK58x01JHuph0a31E1SosB1QRZN8K7uayhSiCLPFn8HExP8liIBFenM3vbjGmQZtyeeRR33PJp6A7hAO0OKsW6Rs0Mf4cIlAAqKa1bbVFgqxj10aqdIccEV6Z3JNR8r2mBjwgM2L45t71j3XRQcmuFES6wImmQKVH3gHnpU= 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=P2EE+tHP; arc=none smtp.client-ip=209.85.218.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="P2EE+tHP" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a673a60f544so86766166b.3 for ; Thu, 30 May 2024 23:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138676; x=1717743476; 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=MeDSR8o5sHBiMB9w8iDNT/c+BZ6oRS2bNAHx1/Apsa4=; b=P2EE+tHPCCByi5ve9s8GN9Fo2UCIALvvM9p0W4HJAvIoY0z/f0MdfnoujMG6cF2arF pUXhxQGjmjCAzYJ0C7m52us5CbyP2X6K8HfATuGxlIZJ9pkKVbEk5nwB7FBYUguONCTn u5AeZEjfG+593Qt0wUHyY3b3FnQrpwL2AaUXlyZvtzq7kLWAXx7J7RFEzGLBRCHGiq2i zvOdoj8HPganNfkRs+TMxHvzsLWr9VRMgFizefWZKZ+NQBqrBsjJBh0Cy2tQIemhadUj gmdoM3P/kG6bo7m+Ar2wOkeDv7gotCtNd0bpgODvaU2hjendVLs+yvxaXC1L5/h7ApCe RZ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138676; x=1717743476; 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=MeDSR8o5sHBiMB9w8iDNT/c+BZ6oRS2bNAHx1/Apsa4=; b=ncbbdQGKBXDgkPiQJ+yAKzi5Fwg2SM/xGWNrpUwzzek3ESoL09/bEAdVf1AkZIHaqr fWWpVqyqJ/igNK4ESjpZbB+8V1TDJ5qhbrhegCurm3Y/et4DS5Ta3M+Ytlh4aOWoCzQw 4WwOUtxIepTIfOvQPuV0hfJx/y59zWZtuNFbLOi8oSQ5Gs1/D+U5sm/H0/Js2lsrtmsN 2FoWGqBSP/x9rUyYe+MFfow6Wg1i1MS/axEPoHSmFfUk5iHNWhUm8vaHfM6vVcxy1H6j oIVyx3VGGiLhQRHknS4Tx8kONJ4Dm4i2PPJ6nw9tvu7JFVzo1RjX4V+Z7uipKPd2KUgs RmeQ== X-Forwarded-Encrypted: i=1; AJvYcCWVVXrpITnodrmRkNsSHpRmrFTdascWiZfOVKzgJ4yhvFvhyYuEskguUkEC3eXSSLU4d00XqrdnELOdR8JiH8kIHIiESJhWfCLIKJFt X-Gm-Message-State: AOJu0Yxwc1JIQQAervLBhvH9BAr97eBOYNN95ZLh47qJJ+OBXPeOclng 2qeTOvM3JbU9GBHN+1IGadT5r5ToImlACZWtzwPETB2lLI6VrLblPzGTvDMQ8jM= X-Google-Smtp-Source: AGHT+IEpvelFNcpLhdN/GNMdGlhBEKvU/gq218tz913pFdtPjNc9x+YA8wu51wxYrvvr9qkW8UCXqw== X-Received: by 2002:a17:906:fd55:b0:a68:5f08:2e2a with SMTP id a640c23a62f3a-a685f082eefmr31291766b.28.1717138676159; Thu, 30 May 2024 23:57:56 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:55 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 5/9] watchdog: rzg2l_wdt: Remove reset de-assert from probe Date: Fri, 31 May 2024 09:57:19 +0300 Message-Id: <20240531065723.1085423-6-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 v9: - call pm_runtime_put() in rzg2l_wdt_start() in case reset_control_deassert() fails; due to this didn't collect the Guenter's Rb tag Changes in v8: - none 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 | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 7bce093316c4..7aad66da138a 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -129,6 +129,12 @@ static int rzg2l_wdt_start(struct watchdog_device *wde= v) if (ret) return ret; =20 + ret =3D reset_control_deassert(priv->rstc); + if (ret) { + pm_runtime_put(wdev->parent); + return ret; + } + /* Initialize time out */ rzg2l_wdt_init_timeout(wdev); =20 @@ -146,7 +152,9 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev) struct rzg2l_wdt_priv *priv =3D watchdog_get_drvdata(wdev); int ret; =20 - rzg2l_wdt_reset(priv); + ret =3D reset_control_assert(priv->rstc); + if (ret) + return ret; =20 ret =3D pm_runtime_put(wdev->parent); if (ret < 0) @@ -186,6 +194,12 @@ static int rzg2l_wdt_restart(struct watchdog_device *w= dev, clk_prepare_enable(priv->osc_clk); =20 if (priv->devtype =3D=3D WDT_RZG2L) { + int ret; + + ret =3D reset_control_deassert(priv->rstc); + if (ret) + return ret; + /* Generate Reset (WDTRSTB) Signal on parity error */ rzg2l_wdt_write(priv, 0, PECR); =20 @@ -236,13 +250,11 @@ static const struct watchdog_ops rzg2l_wdt_ops =3D { .restart =3D rzg2l_wdt_restart, }; =20 -static void rzg2l_wdt_reset_assert_pm_disable(void *data) +static void rzg2l_wdt_pm_disable(void *data) { struct watchdog_device *wdev =3D data; - struct rzg2l_wdt_priv *priv =3D watchdog_get_drvdata(wdev); =20 pm_runtime_disable(wdev->parent); - reset_control_assert(priv->rstc); } =20 static int rzg2l_wdt_probe(struct platform_device *pdev) @@ -285,10 +297,6 @@ static int rzg2l_wdt_probe(struct platform_device *pde= v) return dev_err_probe(&pdev->dev, PTR_ERR(priv->rstc), "failed to get cpg reset"); =20 - ret =3D reset_control_deassert(priv->rstc); - if (ret) - return dev_err_probe(dev, ret, "failed to deassert"); - priv->devtype =3D (uintptr_t)of_device_get_match_data(dev); =20 if (priv->devtype =3D=3D WDT_RZV2M) { @@ -309,9 +317,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) priv->wdev.timeout =3D WDT_DEFAULT_TIMEOUT; =20 watchdog_set_drvdata(&priv->wdev, priv); - ret =3D devm_add_action_or_reset(&pdev->dev, - rzg2l_wdt_reset_assert_pm_disable, - &priv->wdev); + ret =3D devm_add_action_or_reset(&pdev->dev, rzg2l_wdt_pm_disable, &priv-= >wdev); if (ret < 0) return ret; =20 --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 9EB0A82483 for ; Fri, 31 May 2024 06:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138681; cv=none; b=a6/vcNxIFIMXa3pB7N1KT6+KNGrhkbZu4xKHIUHBbooNfppkIbaOsT4SdfqVUVFWS7peTSR+l+NfrlD5Hd8xD/7vlYqLpXRfteOJLZdArMJ1sUo/wo3oCUQFMFYX6NKqjUtAGSRtkDtm+BOnS0idEzBwfIXn+/hpNjLY7OieSdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138681; c=relaxed/simple; bh=C5J7n6mawG/YSKbecNqxc9g3YGlBb0G/F+anEupQ//M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RCFSmwqq+MUhUkFWI2xdgoVHTUoIAJ7CUtrXKeOvhpvigqKYe10MCws28Sx7Hiu1hEJ9tXIHshXSP4B6ZcE5LeCJOAuOI6+CI912GnMbV9ECRntTk917Hb1kP6kiqTPWIxld5yn1I77hHnf+j3HsWYR6UzCwDFFDNANa7eIm/M0= 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=eay1DwKa; arc=none smtp.client-ip=209.85.218.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="eay1DwKa" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a6341cf2c99so171052266b.0 for ; Thu, 30 May 2024 23:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138678; x=1717743478; 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=UnbFNt57mDlPrk/+6HbliL0AWlskuevESgsdP0A0m0w=; b=eay1DwKapbNh9NbYBIMgLZeli+U9sm00ya2Pe3hNq0Xw6vyLmKeW0ShbfbhYhqAKlB FxlYe0+hR6FehzJ4WstDi2g509wq7AzaTQqlt5kzZ5sharat5w3H+S8qYaS+Dm3s9ruN Fv7RxRxBbp08oLrvRCdEk+MeSLsvPU+az/1cHqJINBElenZcHapU+uGoYrWX/JyG/9jv zvhkKARkodOUf1xOCr+fXGIc2hW1nJ4gR1GAehUzuAwEC99YSelvvXZUKDuTQmbZiCZH 0Hy62yfvOcd3KhRR3i5QMfp7ih2ht9Jp3u/oNGzH8exK9FTTDKvOu0bA4GZW0iY91KcF bE6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138678; x=1717743478; 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=UnbFNt57mDlPrk/+6HbliL0AWlskuevESgsdP0A0m0w=; b=aNWBNW5i45VDG3JRw7+se7RxwPtyiBqb1UyKnX246HIxpdfyqI2w9zDvNpQhCua3uo 1DiQ63NKXcR7obdGHu/E2Fm+Fu+1QjABUJkb5RCm6mdYEA81+/pAGXvSJQD2LjdIiQhD rCK7jxio8AMxwyYUOJkTQZqAaembj7qKovjg/BsD/nz6vVIh8kT5U0InAEJxHkt/WNSG 6dRUrH+K1UdVrl1SdBrLgTQW9EABM7KhN7ktJm5bAUobVYpBnB9Z4veMHxDUaIRF00tI 9+ysAOZnkBpMfK2P7OHP/GUDdFuFAhWDOP82LR7qgi/Bk+pCVH4eSlUuIYpEqveqVN8S 2uJg== X-Forwarded-Encrypted: i=1; AJvYcCWVZHKLL+s2rLdZsmzNPX/tZHpsxWAONaz2wE0VcdgHmVYNDaBGla6+vwS50w22jSXo/s8WoR4YuFrdZoDlIkRVgvxbvY23fmftwLjo X-Gm-Message-State: AOJu0Yz9ZxJk+Wi1Tu/Sfn2fIJcT+Nsp/C2rR7BA9wL8WomaZn8crIya G903a6ONnuqZZUxca2oVEh4OlNnruqVA8w9Hyh22x0/9ewuvVjCqJjo7Euui48s= X-Google-Smtp-Source: AGHT+IGgmUEX7HpEA1HJpFVW8dqvobduBoJSFrP3WJDjQ2csTb96wdrhjuykXG+2D+FLIlqu6sP1jw== X-Received: by 2002:a17:906:600a:b0:a66:a24f:13c with SMTP id a640c23a62f3a-a681f87ea17mr57762066b.4.1717138677878; Thu, 30 May 2024 23:57:57 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:57 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 6/9] watchdog: rzg2l_wdt: Remove comparison with zero Date: Fri, 31 May 2024 09:57:20 +0300 Message-Id: <20240531065723.1085423-7-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - none 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 7aad66da138a..1f013dfd3c97 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -318,7 +318,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) =20 watchdog_set_drvdata(&priv->wdev, priv); ret =3D devm_add_action_or_reset(&pdev->dev, rzg2l_wdt_pm_disable, &priv-= >wdev); - if (ret < 0) + if (ret) return ret; =20 watchdog_set_nowayout(&priv->wdev, nowayout); --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.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 3840712E1C1 for ; Fri, 31 May 2024 06:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138684; cv=none; b=ob6OZWac6za9/zwwV1BR9wQtacJxCQGbNG6Az8S8B1HnWDbVfmOTPyzi+TqPj06huRkSIjGeIODQTeV56Omhx2paxrQ8wuLKlsM3eoX4sQgMXMKdwQwsuebIyBi/tk/9uZS5cIT5PZX1S2ykuRtFKPWO0X+k/WMcSp54h8icdyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138684; c=relaxed/simple; bh=P/Nh/oo/uWjDFwH5OIXq+nZf5Rwf9DCbobbRc0hNR4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KAU14p6hEdJFb6RDhYeOvnVW1LEoFHRxNa1Y6SYAFFvW5qgH459Hno2yaLrMRBTyyz4Iv4G9a3X+HpfvPgzdkxF1DNOg/1Bu7itJ/38mV8AL2uuSJ2JVr8QHlPMg8K1YZDmx1jZwaKQa1V/x+i28ke5ZG8nWngVgNvS0Ue7Wk5Y= 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=qLFZL8Oa; arc=none smtp.client-ip=209.85.167.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="qLFZL8Oa" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52b840cfecdso961600e87.3 for ; Thu, 30 May 2024 23:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138680; x=1717743480; 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=Aj2UABYkbAgBpbHbr7DMq3bJIVwbBa4OlR1Ztoek3y0=; b=qLFZL8OaEYfWJzw1hhVFCGTaS9XJnTpP/kfNkcdwke2DzQ/xK6UO+M/drY8v6jTuTs 420ph9xdSSwrM29zMj0+8dmVDkJK476BleKH4ONPQCjqaWrjWFO7jg1GNDZY6epWgp8Y y5nAaIH/3un3zqp92AmuU5PXedM5oUlmUWc63xR3ZT31BwjAWylP6npi8GOX99/MtvRI yD6Td9qFErln7KrcMppYpgX0fqaIAj044pMjbnv20NpSj3lWbHCTtZwvHLERVqPtsRzy rFLjzp9RRUD5elUpyf5Q757/QF/2ciWCku8sKgfAx5HCuqRAIjStxxswRiYF/2G727A3 GALA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138680; x=1717743480; 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=Aj2UABYkbAgBpbHbr7DMq3bJIVwbBa4OlR1Ztoek3y0=; b=bmEnA7F1v3FBTFQfhbSWwMMRkmYmVtljHbWns0jjJZgO6RrSZPnHLrOHjj/Q2FPBP5 6Rn+IwDf9kcmyBhk0iUvsZYKCmy9WWNq09aD6mjR4NLMQ5jb4V0+nkUj8n7gtnVa/ZGJ 03IKpBRlbmNFA3suo2uYbsFtMr22fM/GHEHlslLLe8oJJKJuDTuv71CFGu/+ED4hJgPF ymf8DInlb5DdkzstylxAO4/apXQaPB7VR/WDoPt2D6dpSYvXj6f5Bl0dfI9guLlTwtSX FB+5DVw//nCsrKgUJmVTwY7I3SLJMzYWBRNFazC1vW06eeOUdaohElyGB39eYtr6urIx fdbA== X-Forwarded-Encrypted: i=1; AJvYcCUEfKu9tX9F4QVx5zMHAaMhxX34mZCPosSQ6tDT8HHkv20zu2kCZKPrhGLEzZ8zwFs6z0MSSDVKboG+EyICod5JfJYyTLtrg798TEjL X-Gm-Message-State: AOJu0Yx0RrUnWa3sW7nQON0AZisapgl9YbFRm4n2RVCI5PKejCqpdH63 vwTb6D3AJdF5Q4ysnLFUSIJmd6jUsbaVWU78GQSHsPjlYtrumippLW+ZsjMxnDE= X-Google-Smtp-Source: AGHT+IEqTQ1CoXHVdILVikoDJEE4QrnRUwB4YwEvkNHAV0G0a99ZA1sEqFbBm+11Xk8uIfDtFIyPKg== X-Received: by 2002:ac2:599a:0:b0:52b:6921:4fd9 with SMTP id 2adb3069b0e04-52b896c7ab6mr508765e87.50.1717138680288; Thu, 30 May 2024 23:58:00 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:57:59 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 7/9] watchdog: rzg2l_wdt: Rely on the reset driver for doing proper reset Date: Fri, 31 May 2024 09:57:21 +0300 Message-Id: <20240531065723.1085423-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - none 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 1f013dfd3c97..d77290f7fdea 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; }; =20 -static int rzg2l_wdt_reset(struct rzg2l_wdt_priv *priv) -{ - int err, status; - - if (priv->devtype =3D=3D WDT_RZV2M) { - /* WDT needs TYPE-B reset control */ - err =3D reset_control_assert(priv->rstc); - if (err) - return err; - ndelay(priv->minimum_assertion_period); - err =3D reset_control_deassert(priv->rstc); - if (err) - return err; - err =3D read_poll_timeout(reset_control_status, status, - status !=3D 1, 0, 1000, false, - priv->rstc); - } else { - err =3D 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 */ @@ -189,13 +164,12 @@ static int rzg2l_wdt_restart(struct watchdog_device *= wdev, unsigned long action, void *data) { struct rzg2l_wdt_priv *priv =3D watchdog_get_drvdata(wdev); + int ret; =20 clk_prepare_enable(priv->pclk); clk_prepare_enable(priv->osc_clk); =20 if (priv->devtype =3D=3D WDT_RZG2L) { - int ret; - ret =3D reset_control_deassert(priv->rstc); if (ret) return ret; @@ -207,7 +181,9 @@ static int rzg2l_wdt_restart(struct watchdog_device *wd= ev, rzg2l_wdt_write(priv, PEEN_FORCE, PEEN); } else { /* RZ/V2M doesn't have parity error registers */ - rzg2l_wdt_reset(priv); + ret =3D reset_control_reset(priv->rstc); + if (ret) + return ret; =20 wdev->timeout =3D 0; =20 @@ -299,13 +275,6 @@ static int rzg2l_wdt_probe(struct platform_device *pde= v) =20 priv->devtype =3D (uintptr_t)of_device_get_match_data(dev); =20 - if (priv->devtype =3D=3D WDT_RZV2M) { - priv->minimum_assertion_period =3D 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); =20 priv->wdev.info =3D &rzg2l_wdt_ident; --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 8C23C80C02 for ; Fri, 31 May 2024 06:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138685; cv=none; b=t6+iI2t+nVcPZ56tsGxBfJdHbc8o5cxvn1u4Ew7DZ51X2rZNdAqaxJVg+jqPxxeSnPcgrj8or+KsY/JkR5Sn3G8e8TSht67VNcvxWk4tEEbJT3Hn7xbQe6pEQ5EyK6W5LDJE+m7GGM3AN9tTWZGuPee/ftnHDygl8rjCX6lBaJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138685; c=relaxed/simple; bh=tataYpIwbqjUNC38Cpqdn61J/E/LMYXIwOZFRNJQDg4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hdysFtTsvupqfYfQU1UevZU34YgRtlqzeeLphtGursinA2HPSiFT5/L5nG+PeZALvZ2KqyUtB54v9uXEH8SA+GIurVp34d6qp+TJts+BR3UZ1uGlZVWlyygHefrSzmv7NrYmRmIBMjBNt1fCYaoTXiOK4DgjKkP9mJjjWvZAwpw= 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=ARoHmKXL; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="ARoHmKXL" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a6267778b3aso135654866b.3 for ; Thu, 30 May 2024 23:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138682; x=1717743482; 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=XSggwFbXR3Z6yEAWH/Qxl5wRCutoL0pDxIi0O5Vr5vQ=; b=ARoHmKXLWi+DJoag6NaryfEzF0fAWvYX+XaKdTw2Cr8krH8M7BRYb9cb/0QDiRIIED pF9/b2+igGbOMezoZrdq3lJRglD42KAYOF4CZ5/JEnCShYZkDQbXD5ljr+KWG118mvl5 0pI3KxHYie2abDYrIt/bSQT1oYfdP5hg+KH6wS9acn+NUk5TO5tU9wKLixVi2nfVxEDB rrFdsfdS3FPGhH92MlwwFnnCjBBLVsC/diqnzo6rfCIZRnSpDCfsUTuBTsi1ej+/mYUj lGCCtPQG9ZReOLhRhzIidN4OwwaBhQCoZDZzsBPMCMJSKwZw2nBCltouFRVUPTYVuVnw //gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138682; x=1717743482; 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=XSggwFbXR3Z6yEAWH/Qxl5wRCutoL0pDxIi0O5Vr5vQ=; b=kSrRzUleyojAS3pfjnTOrTfwTxK8fCfkhw4aBdB5nWGwGGAUQnSl3aCJPPZ+e+QuAv 5FY95i3rl5lt17W2OEKYM6dSCoFi/c6tdF8sTkkkaJuK684/Bfz0RH1oEf8cK8gqA0UL /SzqW8g1NCC9iWgRew/nJHZuTsRHHUpJ9O5C/nwPIsYgosJp37vhXPh17AUPP+PggkY5 Q0wynmN4DTfreL3Yy3y3DC17c5J0blxnaF64s6ZBOnL8+i1qNIMLZCuXR3Ws2Jb7rdzI VEx+Mpw2PCcRkYS9XatIiT9Z7GTF3K7Az/QnyuK20/sdH/KNpx97+AV7eq+xRgwTjM98 Gpvw== X-Forwarded-Encrypted: i=1; AJvYcCXXS3THcnNRRkhicc135lAefZ/4QIh3waJ8yViLBryAhxDmT/9roTGEc3SwSpQwuhP1pMdAFj3Pkd59dcCH0tAY7KYU64LWx85nNuPX X-Gm-Message-State: AOJu0YwgKvqFsfz5EuXUNp1JigM+9SKB8RxabW3gfMIT5O3JcZRFZHEp /VX+O1eRWGdS5W/fXHoafS4CUcbTR/zfRB/FJ7OQnDfyWsZ80XiIIpJvJ1dK94M= X-Google-Smtp-Source: AGHT+IGqZzEldpU1/algbNdzWdRvgU8R3XkGrHfgM9jfgkXwYF5W+sjHd4ln26EEr1jRdXi+TqJwiA== X-Received: by 2002:a17:906:df54:b0:a62:2eca:4f15 with SMTP id a640c23a62f3a-a6821b7167bmr57133366b.48.1717138681893; Thu, 30 May 2024 23:58:01 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:58:01 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com Subject: [PATCH v9 8/9] watchdog: rzg2l_wdt: Add suspend/resume support Date: Fri, 31 May 2024 09:57:22 +0300 Message-Id: <20240531065723.1085423-9-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - none 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 d77290f7fdea..2a35f890a288 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -286,6 +286,7 @@ static int rzg2l_wdt_probe(struct platform_device *pdev) priv->wdev.timeout =3D WDT_DEFAULT_TIMEOUT; =20 watchdog_set_drvdata(&priv->wdev, priv); + dev_set_drvdata(dev, priv); ret =3D devm_add_action_or_reset(&pdev->dev, rzg2l_wdt_pm_disable, &priv-= >wdev); if (ret) return ret; @@ -307,10 +308,35 @@ static const struct of_device_id rzg2l_wdt_ids[] =3D { }; MODULE_DEVICE_TABLE(of, rzg2l_wdt_ids); =20 +static int rzg2l_wdt_suspend_late(struct device *dev) +{ + struct rzg2l_wdt_priv *priv =3D 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 =3D 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 =3D { + LATE_SYSTEM_SLEEP_PM_OPS(rzg2l_wdt_suspend_late, rzg2l_wdt_resume_early) +}; + static struct platform_driver rzg2l_wdt_driver =3D { .driver =3D { .name =3D "rzg2l_wdt", .of_match_table =3D rzg2l_wdt_ids, + .pm =3D &rzg2l_wdt_pm_ops, }, .probe =3D rzg2l_wdt_probe, }; --=20 2.39.2 From nobody Tue Dec 23 20:08:59 2025 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.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 8A9A013213A for ; Fri, 31 May 2024 06:58:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138687; cv=none; b=O3IkQ9zCdJyhuKXCM2pyBVXsuu6VGAsJu+GbpmWlKuHygtHIUQdcnii6pjRYWJSfushaSns15STCUlFV+LtZdbldQLzRXc0ClUBOUEmcyUzmCT7Noa9AG5ABVhNZXHeDqyCU7vH1qqUQw9YNddrZfdU9Xl7S7guApotuP4tg/oo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138687; c=relaxed/simple; bh=SgoDvQnygahdoutjIc9prfX+wgUSyYSEJoNImCfQ4pA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m6ThUxE7T7mL49/Iu+AJlY/UOSLU0nFX+JnMhRjxM7EmniLzl6XJaXRtgD6wVnqH+LJlz1uGvHkRShQ9rZ0vO600zaROzo++WpvM1xArvIti2PCD2Bhr/xwhZGB1jpxSpLAst84NQ0YCA3lfl6puFu1h2KdJDOPMuBI/WuH2bxU= 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=UyFKYK5L; arc=none smtp.client-ip=209.85.167.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="UyFKYK5L" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52b8b638437so165950e87.3 for ; Thu, 30 May 2024 23:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1717138684; x=1717743484; 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=tBS+l7TGaeAomOSQfJ8g88idIPgPbvW2eMoPLMjgw2I=; b=UyFKYK5LOmpVMu8JVYeh+pp3z3D+b/RcvYc0MAp+fD5bxFv4iqe/1YZRhW0619FfU2 Ty7QwWyc+rw8siiHmWsW06p8O6PFH7WONwwcaYHKUerndmPiIQqGloNQtqaAFGl0LDBe lSUT2WXCPL/IKQWYdWUF92DJGsJ5w66rifGFPNBgp4HOECmTnmTUWXnv6+X5k8HN/s8L PSnWjR6Tdu980CKl4+ZjP3UkyvUHQvvKL36VcfWELHTkKVOC6p95ME6ADMCARZTsQdp2 41Zx34V1YJ7rs2goT2zkg5uQ47aHMKp7ii0ULmMi83MsTPXPRRXBDO6LStNrMAq/iiGm 3bHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717138684; x=1717743484; 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=tBS+l7TGaeAomOSQfJ8g88idIPgPbvW2eMoPLMjgw2I=; b=l4Kl7dhR+zJTr7ute7GUbYdsI9pz1eQWL6Y27FXAFanpN8j+YlgXrBJWM+jWt8iPRa otYmXIXThzDV8haNBA0kGMWk8N95BuTo66QRJzUPKJFH8S6d7h7g13P+VUpAJl2ApiWx JKrn6ZWIMbU6bkz7v4YyePWPIg86NdAdPLtzGBmB2MrFKjA98COCKMIud/0d1Dgk+q1O 06Uxw18Ox3jdXBtVQoYhKMKNIhoQRc8EaczWg0nTlXAYVvUSNXJ+CX7s/hR0szbwURhE rdHcLHcs+/fJPNdNEHH3UU0yZR5QcTNCiIzkwEIMKTq1yO95xMat+3SOE/jRJlMWCC3Q oHmg== X-Forwarded-Encrypted: i=1; AJvYcCU3G66ZMCXNoXP6wkmveqz1pqv8p1X5fCLleE4mbqKmFAeDoo2Lsxv8QaXsIuFYrZCUgNT3KdiY84l9tOcOFxbJzMWBbHyq8C0YksIB X-Gm-Message-State: AOJu0YyPMAOPipNraaedT8Qm84AZxnppCXy34TyhiBIW20eLiWm0qvNw Nd6I4aDp6BaN7hG+BhDJAJca7T9SCoLhMzf2MTP1RH5hmpDbueVywB+X3AHFsgo= X-Google-Smtp-Source: AGHT+IEcyG1M6riI17p2bccika8+2c8x0/U5C5XU7YCTkfFMFXVNfVGbi2NX2FHHz6cClYrhqai0ag== X-Received: by 2002:ac2:4853:0:b0:52b:8877:30f2 with SMTP id 2adb3069b0e04-52b8980aca3mr441625e87.59.1717138683718; Thu, 30 May 2024 23:58:03 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.157]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1a5sm54205566b.53.2024.05.30.23.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 23:58:03 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: wim@linux-watchdog.org, linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, p.zabel@pengutronix.de, geert+renesas@glider.be, magnus.damm@gmail.com Cc: biju.das.jz@bp.renesas.com, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, claudiu.beznea.uj@bp.renesas.com, Conor Dooley Subject: [PATCH v9 9/9] dt-bindings: watchdog: renesas,wdt: Document RZ/G3S support Date: Fri, 31 May 2024 09:57:23 +0300 Message-Id: <20240531065723.1085423-10-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240531065723.1085423-1-claudiu.beznea.uj@bp.renesas.com> References: <20240531065723.1085423-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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Guenter Roeck --- Changes in v9: - collected Guenter's Rb tag Changes in v8: - none 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 ffb17add491a..eba454d1680f 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 =20 - items: --=20 2.39.2