From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: Egbert Eich <eich@suse.de>,
Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
Xserver development <xorg@freedesktop.org>,
Egbert Eich <eich@pdx.freedesktop.org>
Subject: Re: [Linux-fbdev-devel] Re: Who is stomping PCI config space?
Date: Sat, 05 Mar 2005 09:42:36 +1100 [thread overview]
Message-ID: <1109976157.5680.309.camel@gaston> (raw)
In-Reply-To: <9e47339105030409352803c7e1@mail.gmail.com>
> Ok, now I see what X is doing. It is making sure there is only one
> active VGA device in the system. However, my framebuffer driver is
> not using VGA mode.
>
> I have similar code in my VGA support patch but I only shut down the
> card mem/io long enough to turn off VGA support. I don't leave the
> whole card turned off. I also see now that I should shut interrupts
> off while doing this.
Shut interrupts off never works. It only affects one CPU, you can still
take the interrupt on the other CPU. Unless you switch interrupt
emission on the card itself, or use some kind of spinlock to put IRQs
"on hold" while you are doing the shutdown...
> pci_read_config_word(pdev, PCI_COMMAND, &command);
> pci_write_config_word(pdev, PCI_COMMAND, command | PCI_COMMAND_IO |
> PCI_COMMAND_MEMORY);
>
> vga_io_w(0x3C3, ~0x01 & vga_io_r(0x3C3));
> vga_io_w(0x46e8, ~0x08 & vga_io_r(0x46e8));
> vga_io_w(0x102, ~0x01 & vga_io_r(0x102));
>
> pci_write_config_word(pdev, PCI_COMMAND, command);
>
> If we leave the whole card turned off I can't access the interrupt
> status registers to acknowledge the interrupt and shut it off.
Also, some cards won't let you switch VGA access decoding off.
> Does this approach work for X? Where is the code that does this at VT
> switch time?
>
> On VT enter X would need to:
> 1) shut off interrupts
Not possible (system interrupts). Unless it does it on the card itself,
which is a per-driver thing.
> 2) disable IO/MEM on all VGA cards - remember IO/mem state
> 3) turn the cards on one at a time and disable VGA - remember VGA enable state
> 4) restore IO/MEM state to all cards
> 5) turn interrupts back on
>
> On VT exit:
> 1) shut off interrupts
> 2) disable IO/MEM on all VGA cards - remember IO/mem state
> 3) restore VGA enable state
> 4) restore IO/MEM state to all cards
> 5) turn interrupts back on
Ben.
next prev parent reply other threads:[~2005-03-04 22:42 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-03 19:03 Who is stomping PCI config space? Jon Smirl
2005-03-03 23:07 ` Benjamin Herrenschmidt
2005-03-04 0:15 ` Jon Smirl
2005-03-04 3:03 ` Jon Smirl
2005-03-04 6:40 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2005-03-04 12:07 ` Egbert Eich
2005-03-04 17:35 ` Jon Smirl
2005-03-04 22:42 ` Benjamin Herrenschmidt [this message]
2005-03-05 19:06 ` [Linux-fbdev-devel] " Egbert Eich
2005-03-05 22:42 ` Benjamin Herrenschmidt
2005-03-07 11:19 ` Egbert Eich
2005-03-08 3:21 ` Benjamin Herrenschmidt
2005-03-05 17:33 ` Egbert Eich
2005-03-04 17:58 ` Jon Smirl
2005-03-04 22:45 ` Benjamin Herrenschmidt
2005-03-05 19:07 ` Egbert Eich
2005-03-05 22:43 ` Benjamin Herrenschmidt
2005-03-04 22:27 ` Benjamin Herrenschmidt
2005-03-05 18:26 ` Egbert Eich
2005-03-05 22:39 ` Benjamin Herrenschmidt
2005-03-07 11:05 ` Egbert Eich
2005-03-04 12:02 ` Egbert Eich
2005-03-04 11:25 ` Egbert Eich
2005-03-04 22:16 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
2005-03-05 17:36 ` Egbert Eich
2005-03-04 11:12 ` Egbert Eich
2005-03-04 22:51 ` Benjamin Herrenschmidt
[not found] ` <42278AEC.4080706@dunaweb.hu>
2005-03-04 11:21 ` Egbert Eich
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=1109976157.5680.309.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=eich@pdx.freedesktop.org \
--cc=eich@suse.de \
--cc=jonsmirl@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=xorg@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;
as well as URLs for NNTP newsgroup(s).