linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
	pjones@redhat.com, deller@gmx.de, ardb@kernel.org
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 5/8] firmware/sysfb: Create firmware device only for enabled PCI devices
Date: Tue, 30 Jan 2024 13:52:57 +0100	[thread overview]
Message-ID: <95ae7e7a-de13-4702-a0dc-ed1806b96135@suse.de> (raw)
In-Reply-To: <87le88v0bg.fsf@minerva.mail-host-address-is-not-set>


[-- Attachment #1.1: Type: text/plain, Size: 1683 bytes --]

Hi

Am 29.01.24 um 12:36 schrieb Javier Martinez Canillas:
> Thomas Zimmermann <tzimmermann@suse.de> writes:
> 
>> Test if the firmware framebuffer's parent PCI device, if any, has
>> been enabled. If not, the firmware framebuffer is most likely not
>> working. Hence, do not create a device for the firmware framebuffer
>> on disabled PCI devices.
>>
>> So far, efifb tracked the status of the PCI parent device internally
>> and did not bind if it was disabled. This patch implements the
>> functionality for all firmware framebuffers.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
> 
> [...]
> 
>>   
>> +static __init bool sysfb_pci_dev_is_enabled(struct pci_dev *pdev)
>> +{
>> +#if defined(CONFIG_PCI)
>> +	/*
>> +	 * TODO: Try to integrate this code into the PCI subsystem
>> +	 */
>> +	int ret;
>> +	u16 command;
>> +
>> +	ret = pci_read_config_word(pdev, PCI_COMMAND, &command);
>> +	if (ret != PCIBIOS_SUCCESSFUL)
>> +		return false;
>> +	if (!(command & PCI_COMMAND_MEMORY))
>> +		return false;
>> +	return true;
>> +#else
>> +	// Getting here without PCI support is probably a bug.
>> +	return false;
> 
> Should we warn before return in this case ?

I would not do so as the bug is not here, but in screen_info_pci_dev(). 
I'm going to update this chunk such that the non-PCI case is a separate 
function.

> 
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2024-01-30 12:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 12:39 [PATCH 0/8] firmware/sysfb: Track parent device for screen_info Thomas Zimmermann
2024-01-17 12:39 ` [PATCH 1/8] video: Add helpers for decoding screen_info Thomas Zimmermann
2024-01-29 10:41   ` Javier Martinez Canillas
2024-01-30 13:12     ` Thomas Zimmermann
2024-01-17 12:39 ` [PATCH 2/8] video: Provide screen_info_get_pci_dev() to find screen_info's PCI device Thomas Zimmermann
2024-01-29 11:04   ` Javier Martinez Canillas
2024-01-30 10:12     ` Thomas Zimmermann
2024-01-30 10:23       ` Javier Martinez Canillas
2024-01-17 12:39 ` [PATCH 3/8] firmware/sysfb: Set firmware-framebuffer parent device Thomas Zimmermann
2024-01-29 11:28   ` Javier Martinez Canillas
2024-01-17 12:39 ` [PATCH 4/8] fbdev/efifb: Remove PM for " Thomas Zimmermann
2024-01-29 11:30   ` Javier Martinez Canillas
2024-01-17 12:39 ` [PATCH 5/8] firmware/sysfb: Create firmware device only for enabled PCI devices Thomas Zimmermann
2024-01-29 11:36   ` Javier Martinez Canillas
2024-01-30 12:52     ` Thomas Zimmermann [this message]
2024-01-17 12:39 ` [PATCH 6/8] fbdev/efifb: Do not track parent device status Thomas Zimmermann
2024-01-29 11:38   ` Javier Martinez Canillas
2024-01-17 12:39 ` [PATCH 7/8] firmware/sysfb: Update screen_info for relocated EFI framebuffers Thomas Zimmermann
2024-01-29 11:52   ` Javier Martinez Canillas
2024-01-29 12:03     ` Javier Martinez Canillas
2024-01-17 12:39 ` [PATCH 8/8] fbdev/efifb: Remove framebuffer relocation tracking Thomas Zimmermann
2024-01-29 12:03   ` Javier Martinez Canillas

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=95ae7e7a-de13-4702-a0dc-ed1806b96135@suse.de \
    --to=tzimmermann@suse.de \
    --cc=ardb@kernel.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=pjones@redhat.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;
as well as URLs for NNTP newsgroup(s).