From patchwork Fri May 31 06:57:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 800884 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.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 9910C80631 for ; Fri, 31 May 2024 06:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138673; cv=none; b=WAlfTFW/iKTqpTVKBgQxeKKEnHCr3RBXfT/QXFXUAqikyuPdgLMqOPskNEpsaG1IdhP67dRsst4VFfnhY3ROk62jgOulUC1+JbQVnmEduautgQmJE+Vn3DTOMGdaStbjS3CxgUL35BDf8IVuIU5l+NEngENiElrYbUu6K03QoEU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138673; c=relaxed/simple; bh=TJ37oY0V5Jeq9pwzVqB5NXbszEJmtjwoCWFdS6GxE4w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IISaE3Ex06/2C0NhRwdxkAY+shjDFnEzrpvQohGuUrI9xUJeX+Onhl83UFpnBwBqrhIGUwet1yXjmOYr8Y7k5mAMs2LIpOfWAPLiQsbxePmKxtPNILzBgMPP8EHyDE8gvwDcgUI3wgXwik9f+8IzExkMIT6oit4SZrwwt4PV5z0= 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.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 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-f53.google.com with SMTP id a640c23a62f3a-a6303e13ffeso179214666b.3 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=kpYTVOPIVhbzWRtErxnX8LYvk+QppHyVfL6PxMoQc3sbosJO+NG8XIzz1YbaSa5Adw NmUstyI6H2D+ue1Bmf29Us8JYwyfkiEuIiWiy4D/jG60buHbDWBaESgPOadtIPHj0aOj Yb45ICW7T2vNtQJ9KrkmcjCg2nyvwrNa+LB22bMTA72qkrBukN61nYdNx4AHtChcR1fh lr+WUlrBvFbpYvzbyO50q3UO1JR4zHpOcwaOfMhLXkRaTwufJtKZr5StbkyFG/jMOlMN w6LOs8D8xEmHhwq+vNnTelBWusycAB5d0G0QZ8+FsM765VGo7UKdZH79tULryybetnrh YjiA== X-Forwarded-Encrypted: i=1; AJvYcCUUDfAavKf7b6mYNuQ4L8KsCKEuuw46Q7L1AZgoEFWNrsdoJP8MRhV0ixpXbofXdWzSYkY+0XPA6VCYVU8QiYUn4drXzJ/2mrdB/r/JMj0= X-Gm-Message-State: AOJu0Yx/yuX40QrrTrRBDs6j4mxTO4QDvkjTzZxPqMnmHCfoPPMlhqir SGjXjL5/keww5aMZ4KbHfBnwqpG/lBdQkRgiQNH24Dp2NFMft6xg1vaUBq5RGuY= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 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 Fri May 31 06:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 801585 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.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 0294F811E2 for ; Fri, 31 May 2024 06:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138675; cv=none; b=mv3lIpfO6lvfh2NsvE29TelZ2Skxo6SxBQ927yQOfLdIUOGdOYUZDlAYyx4KM8bfcm2qgWeaPDOg3Ta855tMNWkT45mBb12PrknuxaaDjsKNCqvYFb1cmC5S5uRfqptOytHKdO/1A3Sc/lin8JM5gF37OqjPu4J3yO0FKniqlhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138675; c=relaxed/simple; bh=GuICZzQNErHvuG2P1OP6ZysijVVwTxA/SYYbpm8UHrQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nNhacZGZfzgj9HvtHQ17iPmD9U8bKqulgBb1zWy0u0rqtCIVjnFW/JiY5CQLJoJ6WEpI4fI0bcCicJigq9rICWMnq6xDWNOTf8hnqaQa/VQrJpSTHLDCUiFl7zxOtoctY3PwApbjXQaCgHqalslfDlXhc4wqIRE0tDfwBa9+pts= 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.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 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-f52.google.com with SMTP id a640c23a62f3a-a6267778b3aso135641966b.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=qIOIC1Y0Fl3h3o95dnIkKjsH5+AW791ahpL/hGBYjX3JqPn61iTnCswzWaCpeuiekl KpPB+7Gah128RFA6mobbVL8hu++a+u5042EP7Xp5AjOXoiQMLWSmK2XDZGFnbWffXdti W6VXnZXkHFxM1AptYQlXRgUoG7A0vvyXpSntBhLahr52CMzS3t/VX0Rcp4db8SMSYszc MpiwtCcF7mH8XHxEIeSG/fBEv2aDY93xaCAXRg+cZLIomU8pphD/VT6siAZ0dgwZ+gT5 xf6lf8Ry6UbzxDEwJ4VBiXCFafl0v080NCe7QbQjHeqOevSMvzC1+yDONiuioCjaqOdS Yreg== X-Forwarded-Encrypted: i=1; AJvYcCXpcKrstAunsdXwY7DSr0ZW73obb+AysJwEo7xplWG9xGltJbT1dFtcAMGke99kojAI5h1WdGdLrHPnS9JMyoxwGFlv3eIrqxBTNm8PqgY= X-Gm-Message-State: AOJu0YwVHLphGKggeuIdcsqz1GHBlltLhRqVpgR49XOt3U4VjX1+05hV w0cDpoDcx5jf6YeNOvG38Ylx/2DFMlWXGQ0KPg53QYemaWEYoMCSRUmOnCkdViI= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Guenter Roeck --- 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 From patchwork Fri May 31 06:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 800883 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 64DB08172D for ; Fri, 31 May 2024 06:57:54 +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=1717138676; cv=none; b=TRH3T/giVjdyP84gbQ6fIqLMPs8vyWsqzelB3hXtQzmLSspuopPet/4PFSlr25filXvW07k6Q3srcTpAD5sXtVgfN1avMcaC1Y8VzB2vUQWUrz1mW0ia/ft092ObDNJapdvcxuBxD5iohv2uvCZH/inurODr0ne9zehqIUQw+e4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138676; c=relaxed/simple; bh=QNI4I8AW10XPJRqf4xYm+3JD2Bn1LzmR2dsZ8CEcNFc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sLnAxAY9gjc7t5HIAaakkF/P9m4flMUPKozmankirCzyyNpcr7HDaIQfpkqWMVWq2FDLkL5s98T/7Cg10NW2ktTMbwRAeZgoXNAiOq0A6HMcUEwjKLP7YLS2IJ7F5PC5Xme9JbZ1b9nNp9vyIQkx8p/G+6dHt4J2MZ04DsAXrTA= 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.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="ilqyjpTI" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a59a352bbd9so266993666b.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=LJXtNh6U6t97jasSNEtcfK/qPLhh3jQVymuwdHh4PMUIzB/WmUc4yS8zSMXhPQtHjH WzXpl+4oMvp0eCUqYu7RPLUT4wK4GkfpuSQH2I5md4LxFo+PQhYcpfIiC6NnbIzM6JVv cY97Z6zqBfynScFLHJMpyGFxSy739ynEg4muMSYeRMTjo3+NIat/XSWLsm/3QXVRE5g3 V+dyCKqV5hE6TJRw9A8soDG6ZJA1PcfYWoC8UVjSAhBbFamUTnudzKqHpQFQpWr06HYy UHt4FuWothLBN5H2TzEH+EBKLiHB+0CW9RwsG8b+T2eiWB1T3kmEwt+KRyfY9t5LlC67 d01w== X-Forwarded-Encrypted: i=1; AJvYcCUrG0fsB68JUSngKuHVvJfuEYIRkA0tMGX95D7m6XSdSOzqpOczWQIqX730Npirj1acsAQua04NJMKYysN2xCXRfjy0Ieo9iUdBrUDU/TY= X-Gm-Message-State: AOJu0YzoHLb/lX7cmwvMNrXy3ZLvdJ2lOHLN3rE8OxM9oC3PcL4TH9I/ 3qijJTbYBwPGBdenRwLi+/e7rVKMuES7UqAICkDrgomzy84sYTOlLoB5rD2ahI4= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_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 Fri May 31 06:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 801584 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 45A5D81ACB for ; Fri, 31 May 2024 06:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138677; cv=none; b=hpTZ16485Lb6SgVCf4VpQB6T5EqiEdLFfu4qAkTxsOMs0ZuEb1D3jRmBC8J5eF/viGZY+Mzx/K/P4pv8OprTHDQpkjswaLoqFxVMdwluarSBhjjOzunXV8CyFbv2xFraI8PkTboM7GC6Srfp8nCO/iYsjgvDQE53NNLb4YH37xg= 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.54 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-f54.google.com with SMTP id 2adb3069b0e04-52b80e5688aso1888263e87.0 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=koT408Sih5PNNQpRI+H8PUr4oB4z4a6PQ6N/ZgIUicsqZebMpiB0G6nYNYNr5+olro BNYFvu+76TDe2iLH7QBOQHdXTeegdn6+ZdSekHBRIlJfbrwIxew6c+Y0GENFStNShgiJ ZhOMvxDHCQY8tAVjROH3v1uRbanhpd30+k+hZdYFHYhpJZFqfs+PIXlwet/SdTMydbAo XG/Ktz2uAX3PKa5zGCE+vnee/4k9wm11idvrUbKBefW5uojU48kHoKN3CgcUtWpzc9Dy FoKe8ifJe9vPa+WMPldtPVN9FwhpT4xoyIpg3OE8nGC6X1fM7fFp1XB6i0eV7OXfWgGw mp2g== X-Forwarded-Encrypted: i=1; AJvYcCWenac03sPaO5LY/4UiUDTiA6Qhr4hfnSyCBGnfqo7vZgQYR/iNGmayQ/G/X9MJIXK32P8Qsdbqq8ZCENzBHYAJyzI5BgFLK64C/fsZmSQ= X-Gm-Message-State: AOJu0YwXKdutHNsBjvRmpCByNHXAc+SmPxE+K30jORkH9pIiFcHZ1so+ A2fDyCl5NdYd3zqzm7/2LnoA81s1jXE61hB/6zWCDwINIXMmgGGXH3WFRnVTBoI= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 *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 Fri May 31 06:57:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 800882 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.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 E3A1F82483 for ; Fri, 31 May 2024 06:57:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138679; cv=none; b=bytcAQQ865hJHu6GrJRIhbwshf7US6zM+SHZlWeWPMjgFyDO4e4pyHtCCe/k4hcNADDLlerfrhv5vzPpBsLpc2p3UOD75vAfpPMpJtxkf7LdZymTTDRxSqEbCsZYTpN5qg85vGsM4uCuZ9jtVHm3juvEXwu49fVwG2LR2okE1Xs= 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.208.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 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-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-578517c7ae9so1736452a12.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=ou1ZKH9fxu2uylye3WmpYucuUV4qOio+bvTu4wWG1chdfWE5zI4a/Rk0JmkGjRO7Fj 1Zc8tfUKnX8H6Tj50qvMyPwI/c7XYeAW2lq/vSUlRcnJ1JPPrJmh46IoiMonRsaaJhrr gM2oxt8/TVyHH4AmqfarWUamrhi+msLlhrCVtKw0eGkeGw3rgywGEt+aADR/webWwbGa OQHAuR0Fw48LD3QItGfi7ZblwDjg8SPfIn9Xdqk59DbuDLtb4uEx6LaNw45VLhmSGz63 HOZfQjbbmbWvsYB4Bbr/liXW7c8OsE3cCH/xN731c5PYn1keSWDXU6AWimWi0/+ZUXW4 eLGQ== X-Forwarded-Encrypted: i=1; AJvYcCVmCu0Aimpctu+TJPWkMar88MT/UkD4iKAFofxnKP7dumWXx1sKLSmZjB4CKZ0KEGFInPHthtD/hOtdNH4qnSBW+hmSlhuvNqDOgKDodSA= X-Gm-Message-State: AOJu0YwXsNc9h1ZgsmBeVbp+uAe4CSaOexaJiLwKQeE/iy1QfujYl3NN 0wa1q4ykMbQhbuO8o9xMoVkD7ll/SeOmWiihteDamcuC4pduchQwyQG8DTlvRIw= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 *wdev) if (ret) return ret; + ret = reset_control_deassert(priv->rstc); + if (ret) { + pm_runtime_put(wdev->parent); + return ret; + } + /* Initialize time out */ rzg2l_wdt_init_timeout(wdev); @@ -146,7 +152,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 +194,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 +250,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 +297,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 +317,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 Fri May 31 06:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 801583 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 954C6824B5 for ; Fri, 31 May 2024 06:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138681; cv=none; b=nustGdlz0MN4pOQOtE5hD/Str38a73PiqPxHGmQAB/Fz3NK+Ig193myv5ElJ/4SfiWB7uTQcg7KprEvope+o0JbKPv6kdi/hqnrtXl5F+yOUqfDGGJIsyEvh5v+rzSF117+WhQCvuxm4KyBx4SZYrUBUkthQBWyL4tlzI01sbzQ= 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.49 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-f49.google.com with SMTP id a640c23a62f3a-a6341cf2c99so171052166b.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=sF5O1+JGbluSXHb1SvK7kCbnrggJxLFrRRI06RBRYJP4IrBUYUB/UqUAFxJty/rtVf 5DpUj6q7tJoIGLbbr1/H2Se9zZb5xkWfiay7Ssh+MWpY1gkVxZOXY2diJZmJIk4uxN2r xJIA1TP/7qV0xnrzKxOk/NQfi1JxgoZV6dyZmYZa7crkt1vHkA4aOwuwAJ5LIFOV4B8X Uy39HXVNT9gP8ZGjoSpvCSPxlRJeJcKBjpzN9ezTh1Ui4sw2n1iaSOPNfre7Fdw0WGpc ue06Js5UjFHv08ihPJld+Lg6Z5i+EagLnNyxKJsBWMOSqteFU7tdnWCx6hgYF8DS9iTK pbkg== X-Forwarded-Encrypted: i=1; AJvYcCXT2tYgl0P9kLMLfhieQH2wQFOqlmYf6NuVuM58Pk5m7URXuE2rCfTfyfati9uHVqpTbKQLi9FmvPaggJZquCRl5RODq6uRooGb2TEyURw= X-Gm-Message-State: AOJu0YxzBOovSH9q7lePTr74j8ZAwSs4Ocyr9erx2/qMMoYc2h5Oy0Yl 7zFXLUjXrSMV3i1oZL4GD1EZyGhKYExV9SHqk/u2NTI4CizJKMQxsACFGcculgE= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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) 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 Fri May 31 06:57:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 800881 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.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 36DA512DDBF for ; Fri, 31 May 2024 06:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138683; cv=none; b=mxx8dvoXJ3u0XLAGZi5erT1qlkHkOG0tiXHFS7+6yysMVJVkiF3KUjF4VoXZOMpIBRRIHi5DY59ia+T2jSvOUuWk9TVBJISHQxFxd9wAaC+WjK1X7N83zwFpIg1L6Vc+b1cl1oGzfItmOw+9MIsyOe49WltPUfqaNQBq5coDSxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138683; c=relaxed/simple; bh=P/Nh/oo/uWjDFwH5OIXq+nZf5Rwf9DCbobbRc0hNR4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p8PKgscFHeUEZrAsw9h5vYjvkIHCyBfQPK8KtNKzcqDCdJU/QZ1aaqL5ic66/OcYFXi55Xe/mTi+kRaLpkxgIep2QNE74bMjj25BrlOPFGqeLbPcc5ZUex6esYMRAAOyOvfMtj0wzyAPduVRAaMnrmhYEO3RGx3928CNIy1Z64w= 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.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 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-f53.google.com with SMTP id 2adb3069b0e04-52962423ed8so2008139e87.2 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=OerzHfuGF18dPDCADKeFmYBJSboS6o3WG+5u3zpUMQ7jegXZctNHl+LPYn8Vkx/Lw+ sRA+R0Nuvo9ZXPkTIWi1MrMsKBXeQPuJv57tEUajqqt58zj6uMORAe8YilWECFoRE5/m jBJlJznmTzY3r+HucIKou+Y7mhRyhDXXE2kVJdrYBPvWchEeI/ywRM59Z8Mzf4YWkWdU AnffMfpAg9lMFlnhUqs9urxEt1JCmD+3Eool2mllxP4pTYblCTGg6h0MAp7ETcDIVTRb uCuAKIB/FB4WIVnwkxLiwyoOqHlghB7u78TfdEUiFGnryp3dSWQlPsIKxIEalbFSGPUt gA/w== X-Forwarded-Encrypted: i=1; AJvYcCUmB3SN9lJ+MFzEeSHYhShmNwqvCsWeW6xFSXqDbrBHF0UJa+w0WFqvGyoUP/FgrLRG/Xhy+D87kRMnXjmsoXcTyB8exLH9GjImpdfy6fI= X-Gm-Message-State: AOJu0YyzSE40PDa2txWC4JqC8GD2ua8thecWzKDkx2A6m6UoUG/JO1VN Iag4mKUuur2oJI7GlP6R7PAo0MjGm6FsBTXPqwiiX4d0I+6cikA2vhV6h4MfdiI= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; }; -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 */ @@ -189,13 +164,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; @@ -207,7 +181,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; @@ -299,13 +275,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 Fri May 31 06:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 801582 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.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 70E9E132116 for ; Fri, 31 May 2024 06:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138684; cv=none; b=O/C9PXxi+RW5i/gmDuNxHdeCV1VKM6ww2T8Y0T0XE0Teei6T/hjgZYLqlJ/FlypZKPH+sGouMupFQYrrB/Ujp84fb+yqISdjVPAihfKR6k20lLqFh805njBarL/F33Ckn+6Xw9bSPQvn0fU+IxqKcQ6aEsbfmEywAAuLiyAja0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138684; c=relaxed/simple; bh=tataYpIwbqjUNC38Cpqdn61J/E/LMYXIwOZFRNJQDg4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GSKoGtMWw6UiYNG2dLZcTflgCEwi2Ro+PgNA8Otgu5ly3dWEmplBoEy35dPSF8v7gUVvMYfiZ+3dzrcA0whBqat3TP3YFxoNaJU+KQ5Dq4906v7kB6JiswBzPGFtOUwudrS9JFKgZxZYqQ5a7n9hoyq3/Z+XNwQ1CeDBQnqN20s= 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.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="ARoHmKXL" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a653972487fso129907766b.1 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=noTFTGvWms6apNzFLi+ezQAqhxVvJ+g2/VYms6SJJ2eUtJik+SCZIfYzxYLdKUSb7Q gLFHlS7QbGSVde1oP417oYCEk3nYcGOkjSb3h4H3Xzn7LNIBzDTsDim8fCUB0/i04NAe 87BxjYBkJfwirAhvA/7DbLCnVzUv42uoJg1iMBZT6Ba4CXdWxaq5rbS7HQNhc9iICt3R jI/mutdhCSxWxB0vbd+QrtA+h48ges1DzBhWlPxUEwXQ9vly5ga7j0mw7RGHcAg4zaKz rbZWZKI8ulrfgg2SoL+3Z5ikZ7iTxWjg5ZFWE+QDwV6zKItcw34bZImUkrj2m5RveQr5 w5Cg== X-Forwarded-Encrypted: i=1; AJvYcCW9UquRunpE33mw/YgkQv4qdYeocH4WYgevOv2U0zo7LclppJFbJd/56CjjY4rBosNps9NiYRzAjzuUz9YkUY77Et7gFY0Y4uVNQ1Rxw58= X-Gm-Message-State: AOJu0Yw/15DITQHU0OkbuSAGBx6MQWurCEAvNdye30ZwByKJr7KApfuc /z3G90PYy+reDKCoFdH/cC9Dgu3dzi5Z/tuFTUq+H2ZHSZFZaDWsVCyMD/kCzjw= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 = 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; @@ -307,10 +308,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 Fri May 31 06:57:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 800880 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 82695132132 for ; Fri, 31 May 2024 06:58:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717138687; cv=none; b=tIDZGFf6K9SBEtNxeGFB/g/vBPu6dlSQSLuDvx/hQXyj9pcaQr8/MJ4BKgpbS1uko62F1b+ZUl64kDZxgYkRSRbJOwq5pRHKBS1bWkrj2SnMTxWpOWaHLSX8krtzKBsrpP847yiZ6Wm9MBqWpNbCmr917Ekpa3lwcx8wLVR0TnY= 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.44 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-f44.google.com with SMTP id 2adb3069b0e04-52b03d66861so1793989e87.1 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=rSu253GeP00YNxzSyHu4uduyQpFBNP7NZCz5nSYbHUzzXTu7TiTK4Laa7lBM5f2EV7 wXICxaPzcwBd+y9d/7q7V18dAhzW8k4A8O1kkSXu8pzSKuiz5RE+h7CNnbX6Dx+IiTZM H5jkbOqlH2JIi5IQdM7itUsDCAj65S2IKj3ZAgYmed5c6YvjHhXpl+NHw1dB2d8qD9jP DBWBlD/08qSW+d8n6vXjy64TgDoRKkNEPkd+KeEF6/d8Q+n6qeoQrGjXGgXAO7Sp0r/g YlCLnRh44QwreIlER7sNlgBr6IDLGI7LP8EopUa6+kys+El8xAbBDEudmTAaJ0ZabUqP eM5A== X-Forwarded-Encrypted: i=1; AJvYcCWxlhKwTyhHh7bT5KVeACxRW4IbhcdkDuFZAmd9/B8HmtJaLjp29TcKsFdDsWi8HeE2XkiwEwzyVWYbaZQh1dxF5KLMx+TwMqUDyYGZ0qA= X-Gm-Message-State: AOJu0YzkfqUm9WAUzMp2UzldEpLHFK6NILu0kznH4tM1JeWUqq1Vqwfz 6AQ1bPtKRhcD9vr0l9JAK7roBRyxcTtIvdmOadXvrvHKesz4BqxKotRuRbSPUOA= 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-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 - items: