* [PATCH] pseries pci: removed dt_irq from PCI host bus
@ 2012-06-14 4:36 Alexey Kardashevskiy
2012-06-28 13:02 ` Alexander Graf
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2012-06-14 4:36 UTC (permalink / raw)
To: kvm-ppc, qemu-devel@nongnu.org, Benjamin Herrenschmidt
As it is a very quick operation to resolve qirq from IRQ number,
it makes no sense to cache it anywhere but its original source i.e. XICS.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
hw/spapr_pci.c | 14 +++++---------
hw/spapr_pci.h | 1 -
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index 269dbbf..93017cd 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -162,7 +162,9 @@ static void pci_spapr_set_irq(void *opaque, int irq_num, int level)
*/
sPAPRPHBState *phb = opaque;
- qemu_set_irq(phb->lsi_table[irq_num].qirq, level);
+ qemu_set_irq(xics_assign_irq(spapr->icp,
+ phb->lsi_table[irq_num].dt_irq, XICS_LSI),
+ level);
}
static uint64_t spapr_io_read(void *opaque, target_phys_addr_t addr,
@@ -268,16 +270,10 @@ static int spapr_phb_init(SysBusDevice *s)
/* Initialize the LSI table */
for (i = 0; i < PCI_NUM_PINS; i++) {
- qemu_irq qirq;
- uint32_t num;
-
- qirq = spapr_allocate_lsi(0, &num);
- if (!qirq) {
+ if (!spapr_allocate_lsi(0, &phb->lsi_table[i].dt_irq)) {
+ fprintf(stderr, "Failed to allocate LSI IRQ pin %u\n", i);
return -1;
}
-
- phb->lsi_table[i].dt_irq = num;
- phb->lsi_table[i].qirq = qirq;
}
return 0;
diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h
index dd66f4b..11c3ee1 100644
--- a/hw/spapr_pci.h
+++ b/hw/spapr_pci.h
@@ -41,7 +41,6 @@ typedef struct sPAPRPHBState {
struct {
uint32_t dt_irq;
- qemu_irq qirq;
} lsi_table[PCI_NUM_PINS];
QLIST_ENTRY(sPAPRPHBState) list;
--
1.7.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pseries pci: removed dt_irq from PCI host bus
2012-06-14 4:36 [PATCH] pseries pci: removed dt_irq from PCI host bus Alexey Kardashevskiy
@ 2012-06-28 13:02 ` Alexander Graf
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2012-06-28 13:02 UTC (permalink / raw)
To: kvm-ppc
On 06/14/2012 06:36 AM, Alexey Kardashevskiy wrote:
> As it is a very quick operation to resolve qirq from IRQ number,
> it makes no sense to cache it anywhere but its original source i.e. XICS.
>
> Signed-off-by: Alexey Kardashevskiy<aik@ozlabs.ru>
Ben, please ack/nack.
Alex
> ---
> hw/spapr_pci.c | 14 +++++---------
> hw/spapr_pci.h | 1 -
> 2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
> index 269dbbf..93017cd 100644
> --- a/hw/spapr_pci.c
> +++ b/hw/spapr_pci.c
> @@ -162,7 +162,9 @@ static void pci_spapr_set_irq(void *opaque, int irq_num, int level)
> */
> sPAPRPHBState *phb = opaque;
>
> - qemu_set_irq(phb->lsi_table[irq_num].qirq, level);
> + qemu_set_irq(xics_assign_irq(spapr->icp,
> + phb->lsi_table[irq_num].dt_irq, XICS_LSI),
> + level);
> }
>
> static uint64_t spapr_io_read(void *opaque, target_phys_addr_t addr,
> @@ -268,16 +270,10 @@ static int spapr_phb_init(SysBusDevice *s)
>
> /* Initialize the LSI table */
> for (i = 0; i< PCI_NUM_PINS; i++) {
> - qemu_irq qirq;
> - uint32_t num;
> -
> - qirq = spapr_allocate_lsi(0,&num);
> - if (!qirq) {
> + if (!spapr_allocate_lsi(0,&phb->lsi_table[i].dt_irq)) {
> + fprintf(stderr, "Failed to allocate LSI IRQ pin %u\n", i);
> return -1;
> }
> -
> - phb->lsi_table[i].dt_irq = num;
> - phb->lsi_table[i].qirq = qirq;
> }
>
> return 0;
> diff --git a/hw/spapr_pci.h b/hw/spapr_pci.h
> index dd66f4b..11c3ee1 100644
> --- a/hw/spapr_pci.h
> +++ b/hw/spapr_pci.h
> @@ -41,7 +41,6 @@ typedef struct sPAPRPHBState {
>
> struct {
> uint32_t dt_irq;
> - qemu_irq qirq;
> } lsi_table[PCI_NUM_PINS];
>
> QLIST_ENTRY(sPAPRPHBState) list;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-28 13:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 4:36 [PATCH] pseries pci: removed dt_irq from PCI host bus Alexey Kardashevskiy
2012-06-28 13:02 ` Alexander Graf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox