public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jon Smirl <jonsmirl@gmail.com>, Dave Airlie <airlied@linux.ie>,
	dri-devel@lists.sourceforge.net,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	xorg@lists.freedesktop.org
Subject: Re: POSTing of video cards (WAS: Solo Xgl..)
Date: Mon, 21 Feb 2005 23:56:12 -0500	[thread overview]
Message-ID: <a728f9f9050221205634a3acf0@mail.gmail.com> (raw)
In-Reply-To: <1109041968.5412.63.camel@gaston>

On Tue, 22 Feb 2005 14:12:48 +1100, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> 
> > Ben, since I'm not getting any help on LKML maybe you can answer this.
> > Secondary cards needs reset. After looking at a bunch of fbdev drivers
> > their code assumes the card has been reset when their probe() function
> > runs. So this means that we have to run the VBIOS reset before probe
> > is called.
> 
> I'm putting back LKML on CC since I intended to reply to your post there
> once I got a bit of time.
> 
> No, we can't really do that _before_ probe is called. It's the
> responsibility of the driver to do what it needs at probe time or later.
> Some drivers need that reset (and not that many in fact), some don't.
> 
> We may provide a "helper" to use from the probe() for that purpose, to
> make things easier.
> 
> Wether the reset code is kernel based or userland based, I would avoid
> have it run synchronously anyway. If a driver detects that it's card
> hasn't been properly initialized by the firmware (and the driver should
> be able to detect that), I suggest it's probe routine calls the
> appropriate helper, providing it with ways to get to the ROM (in some
> case, the same helper will be needed for resume from sleep, and the ROM
> may not be the PCI BAR one, but the memory shadow, though that will not
> always work afaik).
> 
> Look at the firmware download helper, that's very similar. I want an
> asynchronous interface though (that is you get a callback when the reset
> is complete or timed out) rather than synchronous since it's wrong to
> synchronously rely on userland beeing available (power management,
> pre-root mount, etc...)
> 
> > So where can I hook up the call to run the VBIOS up in the kernel? You
> > can't trigger it on module load since the module may support multiple
> > identical adapters. One adapter may already have the module loaded and
> > then a second shows up via hotplug. In this case the module won't get
> > loaded again and the second card doesn't get reset.
> >
> > If using a user space reset program what do you do if the user space
> > program is missing or does not complete running? Somehow you have to
> > stop the probe function from being called.
> 
> That's ok. We deal with that in the firmware loader code already. Just
> timeout or check for errors from call_usermodehelper. You basically run
> the user program and wait for it to write a "reply" via sysfs. In fact,
> the existing firmware loading facility could be re-used.
> 
> > Another case, you have a card and load the module for it, this causes
> > reset. Now unload the module and load it again. This probably should
> > not reset the card a second time. You also have to make sure you don't
> > reset the primary card.
> 
> It's up to each driver to detect wether it's card need to be POSTed or
> not. Anything else would mean infinite breakage.
> 
> > One solution is to track in pci_dev if the card has been reset. This
> > preserves the state across module load/unload. I'm then tempted to put
> > an in-kernel emu86 (I have a 40K one) into the pci driver. PCI would
> > use this to reset the card before calling probe(). If the VBIOS/emu86
> > has an error it simply wouldn't call the probe function. Doing this
> > in-kernel makes everything synchronous but GregKH would probably have
> > some choice words about the emulator in the PCI driver.
> 
> No, again, it's up to the driver to decide wether it needs to POST or
> not (I prefer that to "reset"). I have no preference for the emulator to
> be in-kernel or userland. I suppose it's easier in userland, just
> re-using the existing infrastructure for firmware loading.
> 

another advantage of the emulator would be that "PC" vga cards could
be used in non-x86 platforms, which I'm sure would be quite popular...

Alex

  parent reply	other threads:[~2005-02-22  4:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.58.0502201049480.18753@skynet>
     [not found] ` <4218BAF0.3010603@tungstengraphics.com>
     [not found]   ` <21d7e997050220150030ea5a68@mail.gmail.com>
     [not found]     ` <9e4733910502201542afb35f7@mail.gmail.com>
     [not found]       ` <1108973275.5326.8.camel@gaston>
     [not found]         ` <9e47339105022111082b2023c2@mail.gmail.com>
     [not found]           ` <1109019855.5327.28.camel@gaston>
     [not found]             ` <9e4733910502211717116a4df3@mail.gmail.com>
2005-02-22  3:12               ` POSTing of video cards (WAS: Solo Xgl..) Benjamin Herrenschmidt
2005-02-22  4:42                 ` Jon Smirl
2005-02-22  5:09                   ` Benjamin Herrenschmidt
2005-02-22 19:19                   ` Linus Torvalds
2005-02-22 19:38                     ` Dmitry Torokhov
2005-02-22 20:46                       ` Linus Torvalds
2005-02-22  4:56                 ` Alex Deucher [this message]
2005-02-22  5:13                   ` Benjamin Herrenschmidt
2005-02-22  6:03                     ` Jon Smirl
2005-02-22  6:32                       ` Benjamin Herrenschmidt
2005-02-22  6:42                         ` Jon Smirl
2005-02-22  6:52                         ` Jon Smirl
2005-02-22  6:57                           ` Benjamin Herrenschmidt
2005-02-28 14:36                       ` Pavel Machek
2005-02-28 16:06                         ` Vladimir Dergachev
2005-02-28 16:47                           ` Keith Packard
2005-02-22  6:05                     ` Jon Smirl
2005-02-22  6:34                       ` Benjamin Herrenschmidt

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=a728f9f9050221205634a3acf0@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@linux.ie \
    --cc=benh@kernel.crashing.org \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jonsmirl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xorg@lists.freedesktop.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