From: sashiko-bot@kernel.org
To: "Daniel Palmer" <daniel@0x0f.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/5] fbdev: tdfxfb: Attempt to detect if the card wasn't booted
Date: Thu, 30 Jul 2026 18:41:16 +0000 [thread overview]
Message-ID: <20260730184116.F0F331F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260730182640.2808572-3-daniel@0x0f.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver unconditionally rejects perfectly working cards if the video BIOS ROM is inaccessible or in an unsupported format.
--
--- Patch [2]: [PATCH 2/5] fbdev: tdfxfb: Attempt to detect if the card wasn't booted ---
commit e450df3d917986ae9c59e1033b55fdddafa9cf19
Author: Daniel Palmer <daniel@0x0f.com>
Subject: fbdev: tdfxfb: Attempt to detect if the card wasn't booted
This commit adds hardware initialization checks to tdfxfb_probe() by
attempting to read the configuration from the video BIOS. If the register
values do not match the BIOS config, it rejects the card to avoid providing
a blank display.
> diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c
> --- a/drivers/video/fbdev/tdfxfb.c
> +++ b/drivers/video/fbdev/tdfxfb.c
[ ... ]
> +/*
> + * Try to work out if the card was booted or not, just checks
> + * if the register reported memory amount matches what the BIOS
> + * reports for now.
> + */
> +static int tdfxfb_hw_init(struct fb_info *info, struct pci_dev *pdev)
> +{
> + struct tdfx_par *par = info->par;
> + struct tdfx_bios_cfg cfg;
> +
> + if (tdfxfb_get_bios_cfg(pdev, &cfg) &&
> + tdfx_inl(par, DRAMINIT0) == le32_to_cpu(cfg.draminit0))
> + return 0;
> +
[Severity: High]
Will this unconditionally reject working cards if the video BIOS ROM is
inaccessible or in an unsupported format?
Looking at tdfxfb_get_bios_cfg(), it can naturally return false if
pci_map_rom() fails. This is common on architectures without PCI ROM
support, or if the ROM BAR is disabled. It will also return false if the
BIOS ROM does not contain the specific 3dfx OEM configuration table.
Because of the logical && short-circuit, if tdfxfb_get_bios_cfg() fails to
read the config, the tdfx_inl() check is skipped and the function falls
through to return -ENODEV.
Could this cause a regression for hardware that was previously supported but
lacks a readable BIOS ROM?
> + dev_err(&pdev->dev,
> + "Card hasn't booted and is unusable\n");
> + return -ENODEV;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260730182640.2808572-1-daniel@0x0f.com?part=2
next prev parent reply other threads:[~2026-07-30 18:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 18:26 [PATCH 0/5] fbdev: tdfxfb: Make "unbooted" cards work Daniel Palmer
2026-07-30 18:26 ` [PATCH 1/5] fbdev: tdfxfb: Add helper to read config table from BIOS Daniel Palmer
2026-07-30 18:34 ` sashiko-bot
2026-07-30 18:26 ` [PATCH 2/5] fbdev: tdfxfb: Attempt to detect if the card wasn't booted Daniel Palmer
2026-07-30 18:41 ` sashiko-bot [this message]
2026-07-30 18:26 ` [PATCH 3/5] fbdev: tdfxfb: Manually boot unbooted cards Daniel Palmer
2026-07-30 18:41 ` sashiko-bot
2026-07-30 18:26 ` [PATCH 4/5] fbdev: tdfxfb: Wake the VGA core before programming the CRTC Daniel Palmer
2026-07-30 18:26 ` [PATCH 5/5] fbdev: tdfxfb: Program the initial video mode Daniel Palmer
2026-07-30 18:33 ` sashiko-bot
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=20260730184116.F0F331F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=daniel@0x0f.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.