diff mbox series

[for-3.2,v7,1/6] hw/riscv/virt: Increase the number of interrupts

Message ID a2c70c88a145d2e239f113e28979c7a50d71aedf.1542819633.git.alistair.francis@wdc.com
State New
Headers show
Series Connect a PCIe host and graphics support to RISC-V | expand

Commit Message

Alistair Francis Nov. 21, 2018, 5:02 p.m. UTC
Increase the number of interrupts to match the HiFive Unleashed board.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 include/hw/riscv/virt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Logan Gunthorpe Nov. 21, 2018, 5:58 p.m. UTC | #1
On 2018-11-21 10:02 a.m., Alistair Francis wrote:
> Increase the number of interrupts to match the HiFive Unleashed board.
> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  include/hw/riscv/virt.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
> index 91163d6cbf..7cb2742070 100644
> --- a/include/hw/riscv/virt.h
> +++ b/include/hw/riscv/virt.h
> @@ -45,7 +45,7 @@ enum {
>      UART0_IRQ = 10,
>      VIRTIO_IRQ = 1, /* 1 to 8 */
>      VIRTIO_COUNT = 8,
> -    VIRTIO_NDEV = 10
> +    VIRTIO_NDEV = 0x35

Why 0x35? Based on the PCI patch we are using only 36 interrupts, not 53...

Logan
Alistair Francis Nov. 21, 2018, 6:17 p.m. UTC | #2
On Wed, Nov 21, 2018 at 9:58 AM Logan Gunthorpe <logang@deltatee.com> wrote:
>
>
>
> On 2018-11-21 10:02 a.m., Alistair Francis wrote:
> > Increase the number of interrupts to match the HiFive Unleashed board.
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  include/hw/riscv/virt.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
> > index 91163d6cbf..7cb2742070 100644
> > --- a/include/hw/riscv/virt.h
> > +++ b/include/hw/riscv/virt.h
> > @@ -45,7 +45,7 @@ enum {
> >      UART0_IRQ = 10,
> >      VIRTIO_IRQ = 1, /* 1 to 8 */
> >      VIRTIO_COUNT = 8,
> > -    VIRTIO_NDEV = 10
> > +    VIRTIO_NDEV = 0x35
>
> Why 0x35? Based on the PCI patch we are using only 36 interrupts, not 53...

This is just for future proofing. There is no reason to set the number
lower then the number of interrupts we have, now hopefully this won't
keep churning every time we add a device.

Alistair

>
> Logan
Logan Gunthorpe Nov. 21, 2018, 6:45 p.m. UTC | #3
On 2018-11-21 11:17 a.m., Alistair Francis wrote:
> On Wed, Nov 21, 2018 at 9:58 AM Logan Gunthorpe <logang@deltatee.com> wrote:
>>
>>
>>
>> On 2018-11-21 10:02 a.m., Alistair Francis wrote:
>>> Increase the number of interrupts to match the HiFive Unleashed board.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>>> ---
>>>  include/hw/riscv/virt.h | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
>>> index 91163d6cbf..7cb2742070 100644
>>> --- a/include/hw/riscv/virt.h
>>> +++ b/include/hw/riscv/virt.h
>>> @@ -45,7 +45,7 @@ enum {
>>>      UART0_IRQ = 10,
>>>      VIRTIO_IRQ = 1, /* 1 to 8 */
>>>      VIRTIO_COUNT = 8,
>>> -    VIRTIO_NDEV = 10
>>> +    VIRTIO_NDEV = 0x35
>>
>> Why 0x35? Based on the PCI patch we are using only 36 interrupts, not 53...
> 
> This is just for future proofing. There is no reason to set the number
> lower then the number of interrupts we have, now hopefully this won't
> keep churning every time we add a device.

Makes sense. Still 53 is an odd number.

Logan
Alistair Francis Nov. 21, 2018, 6:49 p.m. UTC | #4
On Wed, Nov 21, 2018 at 10:45 AM Logan Gunthorpe <logang@deltatee.com> wrote:
>
>
>
> On 2018-11-21 11:17 a.m., Alistair Francis wrote:
> > On Wed, Nov 21, 2018 at 9:58 AM Logan Gunthorpe <logang@deltatee.com> wrote:
> >>
> >>
> >>
> >> On 2018-11-21 10:02 a.m., Alistair Francis wrote:
> >>> Increase the number of interrupts to match the HiFive Unleashed board.
> >>>
> >>> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> >>> ---
> >>>  include/hw/riscv/virt.h | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
> >>> index 91163d6cbf..7cb2742070 100644
> >>> --- a/include/hw/riscv/virt.h
> >>> +++ b/include/hw/riscv/virt.h
> >>> @@ -45,7 +45,7 @@ enum {
> >>>      UART0_IRQ = 10,
> >>>      VIRTIO_IRQ = 1, /* 1 to 8 */
> >>>      VIRTIO_COUNT = 8,
> >>> -    VIRTIO_NDEV = 10
> >>> +    VIRTIO_NDEV = 0x35
> >>
> >> Why 0x35? Based on the PCI patch we are using only 36 interrupts, not 53...
> >
> > This is just for future proofing. There is no reason to set the number
> > lower then the number of interrupts we have, now hopefully this won't
> > keep churning every time we add a device.
>
> Makes sense. Still 53 is an odd number.

Agreed. It's the same number as the last interrupt in the QEMU SiFive
U machine. So that is where it came from.

Alistair

>
> Logan
Logan Gunthorpe Nov. 21, 2018, 6:56 p.m. UTC | #5
On 2018-11-21 11:49 a.m., Alistair Francis wrote:
> Agreed. It's the same number as the last interrupt in the QEMU SiFive
> U machine. So that is where it came from.

Ok, can we have a comment for that?

Logan
Alistair Francis Nov. 21, 2018, 6:59 p.m. UTC | #6
On Wed, Nov 21, 2018 at 10:56 AM Logan Gunthorpe <logang@deltatee.com> wrote:
>
>
>
> On 2018-11-21 11:49 a.m., Alistair Francis wrote:
> > Agreed. It's the same number as the last interrupt in the QEMU SiFive
> > U machine. So that is where it came from.
>
> Ok, can we have a comment for that?

I don't think we really need a comment. It's just a made up number. It
just has to be higher then the actual number of used interrupts. It
can be changed in the future if required.

Alistair

>
> Logan
Logan Gunthorpe Nov. 21, 2018, 7:02 p.m. UTC | #7
On 2018-11-21 11:59 a.m., Alistair Francis wrote:
> On Wed, Nov 21, 2018 at 10:56 AM Logan Gunthorpe <logang@deltatee.com> wrote:
>>
>>
>>
>> On 2018-11-21 11:49 a.m., Alistair Francis wrote:
>>> Agreed. It's the same number as the last interrupt in the QEMU SiFive
>>> U machine. So that is where it came from.
>>
>> Ok, can we have a comment for that?
> 
> I don't think we really need a comment. It's just a made up number. It
> just has to be higher then the actual number of used interrupts. It
> can be changed in the future if required.

If it's confusing to me it'll be confusing to others reading it. At
least put something in the commit log describing the choice of number
and why it's not important...

Logan
diff mbox series

Patch

diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
index 91163d6cbf..7cb2742070 100644
--- a/include/hw/riscv/virt.h
+++ b/include/hw/riscv/virt.h
@@ -45,7 +45,7 @@  enum {
     UART0_IRQ = 10,
     VIRTIO_IRQ = 1, /* 1 to 8 */
     VIRTIO_COUNT = 8,
-    VIRTIO_NDEV = 10
+    VIRTIO_NDEV = 0x35
 };
 
 enum {