Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] Hardware programming and framebuffer clearing occur after the device 
is registered, causing data races with user-space and destroying fbcon console 
output.
--

--- Patch [5]: [PATCH 5/5] fbdev: tdfxfb: Program the initial video mode ---
commit 90ecec6554588f0e84d39be7f57c41d5df7e26d5
Author: Daniel Palmer <[email protected]>

fbdev: tdfxfb: Program the initial video mode

If the card does not get bound to by fbcon, the initial video mode is
not setup and the display detects no signal. This commit programs the
video mode and clears the framebuffer memory so random garbage isn't
displayed.

> 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
> @@ -1692,6 +1692,13 @@ static int tdfxfb_probe(struct pci_dev *pdev, const 
> struct pci_device_id *id)
>        * Our driver data
>        */
>       pci_set_drvdata(pdev, info);
> +
> +     /* Program a video mode so the display detects a signal */
> +     tdfxfb_set_par(info);
> +
> +     /* Don't scare the user with random garbage on their display */
> +     memset_io(info->screen_base, 0, info->fix.smem_len);

[Severity: High]
Does calling tdfxfb_set_par() and memset_io() after register_framebuffer()
cause issues with fbcon initialization?

When register_framebuffer() is called just prior to this, it synchronously
notifies the console subsystem. If fbcon binds to the new framebuffer, it
configures the display and draws the console text and boot logo.

By unconditionally clearing the VRAM and setting the parameters after
register_framebuffer() returns, doesn't this wipe out the console output
that fbcon just initialized?

Additionally, since register_framebuffer() exposes the device to user-space
via /dev/fb0, could this create a data race against concurrent user-space
ioctls accessing hardware registers or VRAM without holding info->lock?

> +
>       return 0;
>  
>  out_err_iobase:

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=5

Reply via email to