pciauto_setup_device bars_num fix
PATCH 1/1 pciauto_setup_device bars_num fix
Passing bars_num=0 to pciauto_setup_device should assign no bars.
Signed-off-by Ed Swarthout <[email protected]>
--- drivers/pci_auto.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pci_auto.c +1 -1
@@ -94,7 +94,7 @@ void pciauto_setup_device(struct pci_controller *hose,pci_hose_read_config_dword (hose, dev,PCI_COMMAND , &cmdstat); cmdstat = (cmdstat & ~(PCI_COMMAND_IO |PCI_COMMAND_MEMORY )) |PCI_COMMAND_MASTER ; -for (bar =PCI_BASE_ADDRESS_0 ; bar <=PCI_BASE_ADDRESS_0 + (bars_num*4 ); bar +=4 ) { +for (bar =PCI_BASE_ADDRESS_0 ; bar <PCI_BASE_ADDRESS_0 + (bars_num*4 ); bar +=4 ) {/* Tickle the BAR and get the response */ pci_hose_write_config_dword (hose, dev, bar,0xffffffff );pci_hose_read_config_dword (hose, dev, bar, &bar_response);
Signature · 1 line
1.5.3.rc1.13.g08e38
PATCH 1/1 pciauto_setup_device bars_num fix
Quoted 3 lines · Ed Swarthout
Passing bars_num=0 to
pciauto_setup_deviceshould assign no bars.Signed-off-by Ed Swarthout <[email protected]>
Indeed. This patch works fine on our MIPS target.
Quoted 17 lines
--- drivers/pci_auto.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/pci_auto.c +1
-1@@ -94,7 +94,7 @@ void pciauto_setup_device(struct pci_controller *hose,pci_hose_read_config_dword (hose, dev,PCI_COMMAND , &cmdstat); cmdstat = (cmdstat & ~(PCI_COMMAND_IO |PCI_COMMAND_MEMORY )) |PCI_COMMAND_MASTER ; -for (bar =PCI_BASE_ADDRESS_0 ; bar <=PCI_BASE_ADDRESS_0 + (bars_num*4 ); bar +=4 ) { +for (bar =PCI_BASE_ADDRESS_0 ; bar <PCI_BASE_ADDRESS_0 + (bars_num*4 ); bar +=4 ) {/* Tickle the BAR and get the response */ pci_hose_write_config_dword (hose, dev, bar,0xffffffff );pci_hose_read_config_dword (hose, dev, bar, &bar_response);