lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <876f6a08-1850-21cd-83d1-b309e7e1e912@roeck-us.net>
Date:   Thu, 6 Jul 2023 09:03:53 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Henning Schild <henning.schild@...mens.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Cc:     Wim Van Sebroeck <wim@...ux-watchdog.org>,
        Jean Delvare <jdelvare@...e.com>,
        linux-watchdog@...r.kernel.org, linux-hwmon@...r.kernel.org,
        Tobias Schaffner <tobias.schaffner@...mens.com>,
        Gerd Haeussler <gerd.haeussler.ext@...mens.com>
Subject: Re: [PATCH 1/2] watchdog: simatic-ipc-wdt: make IO region access of
 one model muxed

On 7/6/23 08:48, Henning Schild wrote:
> The IO region used for the watchdog also hold CMOS battery monitoring
> information. Make the access muxed so that a hwmon driver can use the
> region as well.
> 
> Signed-off-by: Henning Schild <henning.schild@...mens.com>

Acked-by: Guenter Roeck <linux@...ck-us.net>

> ---
>   drivers/watchdog/simatic-ipc-wdt.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/simatic-ipc-wdt.c b/drivers/watchdog/simatic-ipc-wdt.c
> index 6599695dc672..cdc1a2e15180 100644
> --- a/drivers/watchdog/simatic-ipc-wdt.c
> +++ b/drivers/watchdog/simatic-ipc-wdt.c
> @@ -155,9 +155,8 @@ static int simatic_ipc_wdt_probe(struct platform_device *pdev)
>   
>   	switch (plat->devmode) {
>   	case SIMATIC_IPC_DEVICE_227E:
> -		if (!devm_request_region(dev, gp_status_reg_227e_res.start,
> -					 resource_size(&gp_status_reg_227e_res),
> -					 KBUILD_MODNAME)) {
> +		res = &gp_status_reg_227e_res;
> +		if (!request_muxed_region(res->start, resource_size(res), res->name)) {
>   			dev_err(dev,
>   				"Unable to register IO resource at %pR\n",
>   				&gp_status_reg_227e_res);
> @@ -210,6 +209,10 @@ static int simatic_ipc_wdt_probe(struct platform_device *pdev)
>   	if (wdd_data.bootstatus)
>   		dev_warn(dev, "last reboot caused by watchdog reset\n");
>   
> +	if (plat->devmode == SIMATIC_IPC_DEVICE_227E)
> +		release_region(gp_status_reg_227e_res.start,
> +			       resource_size(&gp_status_reg_227e_res));
> +
>   	watchdog_set_nowayout(&wdd_data, nowayout);
>   	watchdog_stop_on_reboot(&wdd_data);
>   	return devm_watchdog_register_device(dev, &wdd_data);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ