From: Guenter Roeck <linux@roeck-us.net>
To: Li Qiang <liqiang01@kylinos.cn>, wim@linux-watchdog.org
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] via_wdt: fix critical boot hang due to unnamed resource allocation
Date: Sun, 28 Sep 2025 07:20:35 -0700 [thread overview]
Message-ID: <08e2bfe4-8cee-4d72-96ed-30d1e04e8f63@roeck-us.net> (raw)
In-Reply-To: <20250928083332.3035370-1-liqiang01@kylinos.cn>
On 9/28/25 01:33, Li Qiang wrote:
> The VIA watchdog driver uses allocate_resource() to reserve a MMIO
> region for the watchdog control register. However, the allocated
> resource was not given a name, which causes the kernel resource tree
> to contain an entry marked as "<BAD>" under /proc/iomem on x86
> platforms.
>
> During boot, this unnamed resource can lead to a critical hang because
> subsequent resource lookups and conflict checks fail to handle the
> invalid entry properly.
FWIW, I only see the name used in print messages, which should show <NULL>
when called with a NULL pointer. Some more details would have been useful,
especially with the idea in mind that a missing resource name should be
reported but not result in a hang and/or crash.
>
> Signed-off-by: Li Qiang <liqiang01@kylinos.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter
> ---
> drivers/watchdog/via_wdt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
> index d647923d68fe..f55576392651 100644
> --- a/drivers/watchdog/via_wdt.c
> +++ b/drivers/watchdog/via_wdt.c
> @@ -165,6 +165,7 @@ static int wdt_probe(struct pci_dev *pdev,
> dev_err(&pdev->dev, "cannot enable PCI device\n");
> return -ENODEV;
> }
> + wdt_res.name = "via_wdt";
>
> /*
> * Allocate a MMIO region which contains watchdog control register
prev parent reply other threads:[~2025-09-28 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-28 8:33 Li Qiang
2025-09-28 14:20 ` 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=08e2bfe4-8cee-4d72-96ed-30d1e04e8f63@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=liqiang01@kylinos.cn \
--cc=wim@linux-watchdog.org \
/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®