From: Guenter Roeck <linux@roeck-us.net>
To: "xingtong.wu" <xingtong_wu@163.com>
Cc: linux-watchdog@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, "Wu,
Xing Tong" <XingTong.Wu@siemens.com>,
jan.kiszka@siemens.com, tobias.schaffner@siemens.com,
cedric.hombourger@siemens.com, gerd.haeussler.ext@siemens.com
Subject: Re: wdat_wdt: Problem with WDAT using shared registers
Date: Wed, 11 Oct 2023 08:29:55 -0700 [thread overview]
Message-ID: <df8d53db-0056-434d-953b-991025e6cd34@roeck-us.net> (raw)
In-Reply-To: <bef5a084-9a6c-daaf-dad9-89cb5fc32bf9@163.com>
On Fri, Aug 28, 2043 at 01:17:41AM +0800, xingtong.wu wrote:
> Hi
>
> I want to use the wdat_wdt to support a watchdog of SIONCT (a multi-function device
> (mfd)), and I register instructions for wdat_wdt in BIOS, it need registers 0x2e-0x2f
> to access the watchdog, then register 0x2e-0x2f will be forever occupied by platform
> device wdat_wdt, see the code: https://elixir.bootlin.com/linux/v6.6-rc5/source/drivers/acpi/acpi_watchdog.c#L180
>
> but the 0x2e-0x2f are special, they are used for a multi-function device --SIONCT, the
> device have many pins can not only support features for watchdog, but also other
> features like leds, fans, temperature monitor... there are drivers for these pins, e.g.
> gpio-f7188x, nct6775, w83627hf... these driver use the shared register 0x2e-0x2f.
>
> So the issue happened, the wdat_wdt occupied the shared register 0x2e-0x2f, then
> the other driver can not load.
>
> Here is the msg I collected from my device:
>
> root@ipc-SIMATIC-IPC-BX-21A:/home/ipc# cat /proc/ioports
> 0000-0cf7 : PCI Bus 0000:00
> 0000-001f : dma1
> 0020-0021 : pic1
> 002e-002e : wdat_wdt
> 002f-002f : wdat_wdt
>
> It will cause other SIONCT drivers can not load, e.g.
> root@ipc-SIMATIC-IPC-BX-21A:/home/ipc# modprobe gpio-f7188x
> modprobe: ERROR: could not insert 'gpio_f7188x': No such device
>
> And dmesg info is:
> [ 213.559168] gpio-f7188xI/O address 0x002e already in use
>
> Same reason for other drivers:
> root@ipc-SIMATIC-IPC-BX-21A:/home/ipc# modprobe nct6775
> modprobe: ERROR: could not insert 'nct6775': No such device
>
> Do you have any idea for the wdat_wdt to add support for multi-function device?
>
In general, it would need to request the 0x2e-0x2f space temporarily
and release it when it isn't used. Many other drivers do the same.
Look for request_muxed_region() and release_region() in, for example,
drivers/watchdog/w83627hf_wdt.c.
However, this is more difficult with ACPI. Device access should either
be all through ACPI, or all direct. It doesn't really make much if any
sense to access one of the sub-devices through ACPI and others directly
because there is no automatic synchronization mechanism between ACPI
and the rest of the kernel. If ACPI reserves the 0x2e-0x2f space, it
owns it, period.
Note: There can only be one device at 0x2e/0x2f. I don't really understand
the reference to both nct6775 and f7188 because it is simply not possible
that both reside at that address at the same time. And if there is a nct6775
or f7188 compatible chip in the system, it would make much more sense to
use the chip specific watchdog drivers instead of wdat_wdt - again, ACPI
takes it all, and doesn't like competition.
Guenter
prev parent reply other threads:[~2023-10-11 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2043-08-27 17:17 xingtong.wu
2023-10-11 15:29 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=df8d53db-0056-434d-953b-991025e6cd34@roeck-us.net \
--to=linux@roeck-us.net \
--cc=XingTong.Wu@siemens.com \
--cc=cedric.hombourger@siemens.com \
--cc=gerd.haeussler.ext@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=tobias.schaffner@siemens.com \
--cc=xingtong_wu@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®