mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: akpm@osdl.org, torvalds@osdl.org
Cc: anton@samba.org, linux-kernel@vger.kernel.org,
	John Rose <johnrose@austin.ibm.com>
Subject: [PATCH] PPC64 set pci_io_base dynamically if necessary
Date: Mon, 7 Mar 2005 21:11:34 +1100	[thread overview]
Message-ID: <16940.10454.188673.504263@cargo.ozlabs.ibm.com> (raw)

This patch is from John Rose <johnrose@austin.ibm.com>.

Upon DLPAR addition of a PCI Host Brige to a system with purely virtual
I/O, set pci_io_base as necessary.

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

diff -urN linux-2.5/arch/ppc64/kernel/pSeries_pci.c test/arch/ppc64/kernel/pSeries_pci.c
--- linux-2.5/arch/ppc64/kernel/pSeries_pci.c	2005-01-12 18:20:48.000000000 +1100
+++ test/arch/ppc64/kernel/pSeries_pci.c	2005-03-07 21:04:02.000000000 +1100
@@ -424,16 +424,18 @@
 	unsigned int root_size_cells = 0;
 	struct pci_controller *phb;
 	struct pci_bus *bus;
+	int primary;
 
 	root_size_cells = prom_n_size_cells(root);
 
+	primary = list_empty(&hose_list);
 	phb = alloc_phb_dynamic(dn, root_size_cells);
 	if (!phb)
 		return NULL;
 
 	pci_process_bridge_OF_ranges(phb, dn);
 
-	pci_setup_phb_io_dynamic(phb);
+	pci_setup_phb_io_dynamic(phb, primary);
 	of_node_put(root);
 
 	pci_devs_phb_init_dynamic(phb);
diff -urN linux-2.5/arch/ppc64/kernel/pci.c test/arch/ppc64/kernel/pci.c
--- linux-2.5/arch/ppc64/kernel/pci.c	2005-03-07 08:21:53.000000000 +1100
+++ test/arch/ppc64/kernel/pci.c	2005-03-07 21:04:02.000000000 +1100
@@ -619,7 +619,8 @@
 	res->end += io_virt_offset;
 }
 
-void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose)
+void __devinit pci_setup_phb_io_dynamic(struct pci_controller *hose,
+					int primary)
 {
 	unsigned long size = hose->pci_io_size;
 	unsigned long io_virt_offset;
@@ -631,6 +632,9 @@
 		hose->global_number, hose->io_base_phys,
 		(unsigned long) hose->io_base_virt);
 
+	if (primary)
+		pci_io_base = (unsigned long)hose->io_base_virt;
+
 	io_virt_offset = (unsigned long)hose->io_base_virt - pci_io_base;
 	res = &hose->io_resource;
 	res->start += io_virt_offset;
diff -urN linux-2.5/arch/ppc64/kernel/pci.h test/arch/ppc64/kernel/pci.h
--- linux-2.5/arch/ppc64/kernel/pci.h	2005-01-12 18:20:48.000000000 +1100
+++ test/arch/ppc64/kernel/pci.h	2005-03-07 21:06:52.000000000 +1100
@@ -16,8 +16,7 @@
 
 extern void pci_setup_pci_controller(struct pci_controller *hose);
 extern void pci_setup_phb_io(struct pci_controller *hose, int primary);
-
-extern void pci_setup_phb_io_dynamic(struct pci_controller *hose);
+extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary);
 
 
 extern struct list_head hose_list;

                 reply	other threads:[~2005-03-07 10:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=16940.10454.188673.504263@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=johnrose@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®