public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Olivier Galibert <galibert@pobox.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>, Chuck Ebbert <cebbert@redhat.com>,
	Len Brown <lenb@kernel.org>
Subject: Re: [RFC PATCH] PCI MMCONFIG: add validation against ACPI motherboard resources
Date: Tue, 22 May 2007 18:31:35 -0600	[thread overview]
Message-ID: <46538B67.3080007@shaw.ca> (raw)
In-Reply-To: <200705211322.18937.jbarnes@virtuousgeek.org>

Jesse Barnes wrote:
> On Monday, May 21, 2007, Jesse Barnes wrote:
>> Yeah, I've got that data... just a sec while I make sure it's
>> reproducable...
>>
>> Aha, I hadn't decoded the devfn before, looks like it's dying on an
>> access to the graphics device (bus 0, slot 2, device 0):
>>
>> ...
>> pci_mmcfg_read: 0, 0, 0x10, 0x18, 4 = 0xc000000c
>> pci_mmcfg_read: 0, 0, 0x10, 0x18, 4 = <hang>
>> ...
>>
>> Offset 0x18 into the graphics config space should be the graphics memory
>> range address, and 0xc000000c is the correct value.  But for some reason
>> it hangs on the second access.
>>
>> It hangs here everytime.
> 
> That register is in the config space BAR region, so it should be ok to 
> write 0xffffffff to it and read it back to size the register.  However, 
> it's after writing the 0xffffffff to it and trying to read it back that 
> the machine hangs.  I didn't see any accesses to the command register to 
> disable decoding (at least not via the mmconfig methods), so maybe that's 
> broken during MCFG based probing?

Eww. I don't see where we disable the decode at all while we probe the 
BARs on the device. That seems like a bad thing, especially with the way 
we probe 64-bit BARs (do the low 32 bits first and then the high 32 
bits). This means the base address effectively gets set to 0xfffffff0 
momentarily, which might cause some issues.

I'd try adding some code inside pci_setup_device (drivers/pci/probe.c) 
to disable PCI_COMMAND_IO and PCI_COMMAND_MEMORY on the device when 
probing devices with the standard header type and then restoring the 
previous command bits afterwards, and see what effect that has. It'll be 
  interesting if it does, since obviously it seems to work as it is with 
non-MMCONFIG access methods. Maybe the base address being set like that 
interferes with MMCONFIG access itself somehow?

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/

  reply	other threads:[~2007-05-23  0:31 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30  2:14 [RFC PATCH] PCI MMCONFIG: add validation against ACPI motherboard resources Robert Hancock
2007-04-30  2:59 ` Randy Dunlap
2007-04-30 22:59 ` Olivier Galibert
2007-04-30 23:26   ` Robert Hancock
2007-05-01 16:48   ` Jesse Barnes
2007-05-02  2:41   ` Jesse Barnes
2007-05-02  2:56     ` Jesse Barnes
2007-05-02  5:27       ` Jesse Barnes
2007-05-02 14:34         ` Robert Hancock
2007-05-02 17:57           ` Jesse Barnes
2007-05-02 23:45             ` Robert Hancock
2007-05-02 23:54               ` Jesse Barnes
2007-05-04 21:06                 ` Jesse Barnes
2007-05-05  0:22                   ` Robert Hancock
2007-05-21 19:10                   ` Jesse Barnes
2007-05-21 19:26                     ` Robert Hancock
2007-05-21 20:07                       ` Jesse Barnes
2007-05-21 20:22                         ` Jesse Barnes
2007-05-23  0:31                           ` Robert Hancock [this message]
2007-05-23  0:38                             ` Jesse Barnes
2007-05-23  0:53                               ` Robert Hancock
2007-05-23  0:56                                 ` Jesse Barnes
2007-05-23  1:06                               ` Robert Hancock
2007-05-23 18:52                                 ` Jesse Barnes
2007-05-23 20:20                                   ` Linus Torvalds
2007-05-23 20:38                                     ` Alan Cox
2007-05-23 20:45                                       ` Linus Torvalds
2007-05-23 20:49                                     ` Jesse Barnes
2007-05-23 20:56                                       ` Linus Torvalds
2007-05-23 21:03                                         ` Jesse Barnes
2007-05-23 21:09                                           ` Jeff Garzik
2007-05-23 21:35                                             ` Alan Cox
2007-05-23 21:35                                               ` Jeff Garzik
2007-05-23 21:37                                               ` Jesse Barnes
2007-05-23 21:42                                                 ` Jeff Garzik
2007-05-23 23:07                                             ` Stephen Hemminger
2007-05-23 21:54                                           ` Linus Torvalds
2007-05-23 22:06                                             ` Jesse Barnes
2007-05-23 22:16                                               ` Linus Torvalds
2007-05-23 22:28                                                 ` Jesse Barnes
2007-05-23 23:04                                                 ` David Miller
2007-05-23 23:11                                                   ` Jesse Barnes
2007-05-23 23:15                                                     ` Robert Hancock
2007-05-23 23:21                                                       ` Jesse Barnes
2007-05-23 21:20                                         ` Jesse Barnes
2007-05-23 22:24                                           ` Olivier Galibert
2007-05-23 22:31                                             ` Jesse Barnes
2007-05-23 22:48                                             ` Linus Torvalds
2007-05-23 22:55                                               ` Jesse Barnes
2007-05-24  0:21                                                 ` Linus Torvalds
2007-05-24  2:59                                                   ` Jesse Barnes
2007-05-24  3:18                                                     ` Linus Torvalds
2007-05-24  3:20                                                       ` Linus Torvalds
2007-05-24  3:40                                                         ` Jesse Barnes
2007-05-24  5:19                                                           ` Robert Hancock
2007-05-24  6:18                                                   ` Jeff Garzik
2007-05-24 15:42                                                     ` Linus Torvalds
2007-05-23 23:04                                     ` Robert Hancock
2007-05-23 23:04                                   ` Robert Hancock
2007-05-23 23:06                                     ` Jesse Barnes
2007-05-24  0:02 ` Jesse Barnes

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=46538B67.3080007@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=ak@suse.de \
    --cc=cebbert@redhat.com \
    --cc=galibert@pobox.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.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