Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb68660943fc0dc2a5fa634243f3c6b7fb715626
Commit:     bb68660943fc0dc2a5fa634243f3c6b7fb715626
Parent:     be521466feb3bb1cd89de82a2b1d080e9ebd3cb6
Author:     Hideo Saito <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 12 14:50:49 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon Mar 12 14:50:49 2007 +0900

    sh: Fix PCI BAR address-space wraparound.
    
    When a SH7751R system includes a card that has wide range space
    like a graphics card, the pci-pci bridge controller can't set the
    correct address range.
    
    For example, when *lower_limit is 0xfd000000 and bar_size is
    0x4000000, in the following code at arch/sh/drivers/pci/pci-auto.c,
    0x0 is set in bar_value.
    
    pciauto_setup_bars()
    {
    ...
                    bar_value = ((*lower_limit - 1) & ~(bar_size - 1)) + 
bar_size;
    ...
                    *lower_limit = bar_value + bar_size;
    }
    
    As a result, 0x4000000 is set in *lower_limit, but this value is wrong.
    
    The following patch avoids this problem by checking the range of the
    value and refusing to update the BAR if the calculated value ends up
    being bogus.
    
    Signed-off-by: Hideo Saito <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/drivers/pci/pci-auto.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c
index ecf1634..224e007 100644
--- a/arch/sh/drivers/pci/pci-auto.c
+++ b/arch/sh/drivers/pci/pci-auto.c
@@ -214,6 +214,12 @@ retry:
                        continue;
                }
 
+               if (bar_value < *lower_limit || (bar_value + bar_size) >= 
*upper_limit) {
+                       DBG(" unavailable -- skipping, value %x size %x\n",
+                                       bar_value, bar_size);
+                       continue;
+               }
+
 #ifdef CONFIG_PCI_AUTO_UPDATE_RESOURCES
                /* Write it out and update our limit */
                early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to