Bug 8020 - Sparc SIMBA VGA routing code kills system by disabling IDE controller
Summary: Sparc SIMBA VGA routing code kills system by disabling IDE controller
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: SPARC Linux (All)
: high major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-26 22:21 UTC by David S. Miller
Modified: 2007-05-10 06:26 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to disable Simba PCI bridge routing code (570 bytes, patch)
2006-11-07 23:39 UTC, Jurij Smakov
no flags Details | Splinter Review

Description David S. Miller 2006-08-26 22:21:41 UTC
The code in hw/xfree86/os-support/bus/sparcPci.c:simbaCheckBus()
is trying to mimmick VGA routing by disabling I/O space responses
behind the Simba PCI-PCI controller.

Unfortunately, doing this also happens to disable access to the
IDE controller I/O space registers, thus crashing the system.  The
granularity of the I/O disabling in the Simba controller is not
fine enough to disable VGA without also disabling the IDE controller
registers.

What usually happens is that the SIMBA code disables the I/O range,
and the first module to get loaded afterwards which isn't already in
system ram goes out to disk which hangs.  We get no console
messages because the console has been put into framebuffer mode
by the X server already.

This took a painfully long time to track down and debug.

In my opinion this Simba code should be just removed outright.
It cannot work properly without also disabling access to critical
system devices, such as the IDE controller.

The code tries to disable I/O space by clearing the lowest
bit of the APB_IO_ADDRESS_MAP register.  The effect of this
is to disable the first 2MB of I/O space behind that bridge,
and it's extremely likely that other critical devices will be
sitting in that region, and thus be disabled too.

Bit 0 of this register controls I/O space in the range
0 --> ((1 << 21) - 1), bit 1 controls I/O space in the
range (1 << 21) --> ((2 << 21) - 1), etc.
Comment 1 Frans Pop 2006-10-11 05:07:01 UTC
I can confirm this bug.   
   
I have also experienced severe data loss from this bug as on two separate   
occasions the partition table on a IDE harddisk (first time hda, second time   
hdc) had disappeared!   
   
After the first time I reinstalled the system on hda and the disk showed no   
problems during or after the install. I have yet to resurrect hdc.   
   
It would be great if this issue could be given a bit more attention than it  
seems to have been given so far.  
  
I have checked and my system (a Sparc Ultra 10) does have the SIMBA Advanced  
PCI Bridge. 
Comment 2 Jurij Smakov 2006-11-07 23:38:19 UTC
As David pointed out, the code in question is very problematic with practically
no added benefit, and can occasionally lead to serious data loss. We have
disabled this code in Debian's X.org packages by applying the patch which I will
attach to the report; nobody has complained so far. I'm taking the liberty to
bump the severity of this bug a notch, in the hope that somebody will care
enough to apply it (or propose an alternative solution). 

--
Jurij Smakov
Debian SPARC port maintainer 

Comment 3 Jurij Smakov 2006-11-07 23:39:43 UTC
Created attachment 7701 [details] [review]
Patch to disable Simba PCI bridge routing code
Comment 4 Daniel Stone 2007-02-27 01:33:21 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 5 Matthias Hopf 2007-05-10 06:26:42 UTC
Committed. git ebaa6c920c82401952a0ccc991b94574306449bd


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.