[haiku-commits] haiku: hrev52357 - src/system/kernel/arch/x86

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 22 Sep 2018 16:50:37 -0400 (EDT)

hrev52357 adds 1 changeset to branch 'master'
old head: 2ba2d603518c6d00c8de4ab00b7f39726ba5f02c
new head: 7d8b7501ba0bab073c8e173bf78e79c1bcd0a257
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=7d8b7501ba0b+%5E2ba2d603518c

----------------------------------------------------------------------------

7d8b7501ba0b: kernel: Treat 255 as an invalid interrupt line on x86.
  
  From mmlr's analysis in #13370 comment:22: "We actually do ignore a missing
  routing in case the interrupt line is 0. In this case it isn't 0 but 0xff,
  which is invalid and generally treated the same as 0 in the rest of the code.
  Ignoring the missing routing on 0xff seems like the way to go here."
  
  Indeed, I managed to locate a footnote in the PCI 3.0 specification which
  confirms that this is the case on x86, and a commit in the Linux kernel
  which essentially does the same thing this change does:
  https://github.com/torvalds/linux/commit/e237a5518425155faa508a087f2826
  Interestingly, that commit is only from 2016, while PCI 3.0 is from 2004.
  
  This probably fixes #13370 ("Haiku doesn't MBR boot on Ryzen"), and 
potentially
  other interrupt-routing-related boot failures.
  
  Change-Id: I88129f6507c62d24cb50cf5c78597ca7bd7872d7
  Reviewed-on: https://review.haiku-os.org/590
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52357
Commit:      7d8b7501ba0bab073c8e173bf78e79c1bcd0a257
URL:         https://git.haiku-os.org/haiku/commit/?id=7d8b7501ba0b
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Sat Sep 22 20:42:34 2018 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Sep 22 20:50:34 2018 UTC

Ticket:      https://dev.haiku-os.org/ticket/13370

----------------------------------------------------------------------------

1 file changed, 5 insertions(+), 2 deletions(-)
src/system/kernel/arch/x86/irq_routing_table.cpp | 7 +++++--

----------------------------------------------------------------------------

diff --git a/src/system/kernel/arch/x86/irq_routing_table.cpp 
b/src/system/kernel/arch/x86/irq_routing_table.cpp
index c442fac456..578896baef 100644
--- a/src/system/kernel/arch/x86/irq_routing_table.cpp
+++ b/src/system/kernel/arch/x86/irq_routing_table.cpp
@@ -578,8 +578,11 @@ ensure_all_functions_matched(pci_module_info* pci, uint8 
bus,
                        }
 
                        if (!matched) {
-                               if (pci->read_pci_config(bus, device, function,
-                                               PCI_interrupt_line, 1) == 0) {
+                               uint32 interrupt_line = 
pci->read_pci_config(bus, device,
+                                       function, PCI_interrupt_line, 1);
+                               // On x86, interrupt line 255 means "unknown" 
or "no connection"
+                               // (PCI Local Bus spec 3.0, section 6.2.4 / 
page 223, footnote.)
+                               if (interrupt_line == 0 || interrupt_line == 
255) {
                                        dprintf("assuming no interrupt use on 
PCI device"
                                                " %u:%u:%u (bios irq 0, no 
routing information)\n",
                                                bus, device, function);


Other related posts:

  • » [haiku-commits] haiku: hrev52357 - src/system/kernel/arch/x86 - waddlesplash