All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, laurent@vivier.eu
Subject: Re: [PATCH v5 18/20] nubus: add support for slot IRQs
Date: Fri, 24 Sep 2021 11:01:27 +0200	[thread overview]
Message-ID: <8e879ded-3a4e-b12f-1479-62401af06927@amsat.org> (raw)
In-Reply-To: <43591fdf-045b-6c33-d54b-a3f18f0c5d58@ilande.co.uk>

On 9/24/21 09:06, Mark Cave-Ayland wrote:
> On 23/09/2021 10:49, Philippe Mathieu-Daudé wrote:
> 
>> On 9/23/21 11:13, Mark Cave-Ayland wrote:
>>> Each Nubus slot has an IRQ line that can be used to request service 
>>> from the
>>> CPU. Connect the IRQs to the Nubus bridge so that they can be wired 
>>> up using qdev
>>> gpios accordingly, and introduce a new nubus_set_irq() function that 
>>> can be used
>>> by Nubus devices to control the slot IRQ.
>>>
>>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
>>> ---
>>>   hw/nubus/nubus-bridge.c  | 2 ++
>>>   hw/nubus/nubus-device.c  | 8 ++++++++
>>>   include/hw/nubus/nubus.h | 6 ++++++
>>>   3 files changed, 16 insertions(+)
>>
>>>   static Property nubus_bridge_properties[] = {
>>> diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c
>>> index 280f40e88a..0f1852f671 100644
>>> --- a/hw/nubus/nubus-device.c
>>> +++ b/hw/nubus/nubus-device.c
>>> @@ -10,12 +10,20 @@
>>>   #include "qemu/osdep.h"
>>>   #include "qemu/datadir.h"
>>> +#include "hw/irq.h"
>>>   #include "hw/loader.h"
>>>   #include "hw/nubus/nubus.h"
>>>   #include "qapi/error.h"
>>>   #include "qemu/error-report.h"
>>> +void nubus_set_irq(NubusDevice *nd, int level)
>>> +{
>>> +    NubusBus *nubus = NUBUS_BUS(qdev_get_parent_bus(DEVICE(nd)));
>>> +
>>
>> A trace-event could be helpful here, otherwise:
>>
>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>>> +    qemu_set_irq(nubus->irqs[nd->slot], level);
>>> +}
> 
> I think adding a trace event here would just be too verbose 
> (particularly if you have more than one nubus device) and not 
> particularly helpful: normally the part you want to debug is the in the 
> device itself looking at which constituent flags combine to raise/lower 
> the interrupt line. And once you've done that then you've already got a 
> suitable trace-event in place...

But devices accessing the bus are not aware of which devices are plugged
onto it. Wait, what is suppose to call nubus_set_irq()? Devices on the
bus, to propagate the interrupt up to the CPU? OK so then the trace
event is irrelevant indeed. I understood this API as any external device
could trigger an IRQ to device on the bus. I wonder if renaming as
nubus_device_set_irq() could make it clearer. Or even simpler, add
a comment in "hw/nubus/nubus.h" explaining what nubus_set_irq() is for
to avoid any confusion, and we are good.


  reply	other threads:[~2021-09-24  9:02 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  9:12 [PATCH v5 00/20] nubus: bus, device, bridge, IRQ and address space improvements Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 01/20] nubus: add comment indicating reference documents Mark Cave-Ayland
2021-09-23  9:35   ` Philippe Mathieu-Daudé
2021-09-23 10:01   ` Laurent Vivier
2021-09-23  9:12 ` [PATCH v5 02/20] nubus-device: rename slot_nb variable to slot Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 03/20] nubus-device: expose separate super slot memory region Mark Cave-Ayland
2021-09-23 10:04   ` Laurent Vivier
2021-09-23  9:12 ` [PATCH v5 04/20] nubus: use bitmap to manage available slots Mark Cave-Ayland
2021-09-23  9:42   ` Philippe Mathieu-Daudé
2021-09-24  7:00     ` Mark Cave-Ayland
2021-09-23 10:28   ` Laurent Vivier
2021-09-23 14:16   ` BALATON Zoltan
2021-09-24  7:16     ` Mark Cave-Ayland
2021-09-24  8:50       ` Philippe Mathieu-Daudé
2021-09-24 10:51         ` BALATON Zoltan
2021-09-23  9:12 ` [PATCH v5 05/20] nubus: move slot bitmap checks from NubusDevice realize() to BusClass check_address() Mark Cave-Ayland
2021-09-23  9:45   ` Philippe Mathieu-Daudé
2021-09-24  7:01     ` Mark Cave-Ayland
2021-09-23 10:30   ` Laurent Vivier
2021-09-23  9:12 ` [PATCH v5 06/20] nubus: implement BusClass get_dev_path() Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 07/20] nubus: add trace-events for empty slot accesses Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 08/20] nubus: generate bus error when attempting to access empty slots Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 09/20] macfb: don't register declaration ROM Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 10/20] nubus-device: remove nubus_register_rom() and nubus_register_format_block() Mark Cave-Ayland
2021-09-23  9:12 ` [PATCH v5 11/20] nubus-device: add romfile property for loading declaration ROMs Mark Cave-Ayland
2021-09-23  9:13 ` [PATCH v5 12/20] nubus: move nubus to its own 32-bit address space Mark Cave-Ayland
2021-09-23 10:33   ` Laurent Vivier
2021-09-23  9:13 ` [PATCH v5 13/20] nubus-bridge: introduce separate NubusBridge structure Mark Cave-Ayland
2021-09-23 10:35   ` Laurent Vivier
2021-09-23  9:13 ` [PATCH v5 14/20] mac-nubus-bridge: rename MacNubusState to MacNubusBridge Mark Cave-Ayland
2021-09-23 10:35   ` Laurent Vivier
2021-09-23 12:50     ` Mark Cave-Ayland
2021-09-23 13:53       ` Laurent Vivier
2021-09-23 16:03         ` Mark Cave-Ayland
2021-09-24  6:37           ` Mark Cave-Ayland
2021-09-23  9:13 ` [PATCH v5 15/20] nubus: move NubusBus from mac-nubus-bridge to nubus-bridge Mark Cave-Ayland
2021-09-23 10:36   ` Laurent Vivier
2021-09-23  9:13 ` [PATCH v5 16/20] nubus-bridge: embed the NubusBus object directly within nubus-bridge Mark Cave-Ayland
2021-09-23 10:37   ` Laurent Vivier
2021-09-23  9:13 ` [PATCH v5 17/20] nubus-bridge: make slot_available_mask a qdev property Mark Cave-Ayland
2021-09-23  9:52   ` Philippe Mathieu-Daudé
2021-09-24  7:09     ` Mark Cave-Ayland
2021-09-23  9:13 ` [PATCH v5 18/20] nubus: add support for slot IRQs Mark Cave-Ayland
2021-09-23  9:49   ` Philippe Mathieu-Daudé
2021-09-24  7:06     ` Mark Cave-Ayland
2021-09-24  9:01       ` Philippe Mathieu-Daudé [this message]
2021-09-24  9:05         ` Philippe Mathieu-Daudé
2021-09-29  6:42           ` Mark Cave-Ayland
2021-09-29  8:38             ` Laurent Vivier
2021-09-24  9:43         ` Mark Cave-Ayland
2021-09-23  9:13 ` [PATCH v5 19/20] q800: wire up nubus IRQs Mark Cave-Ayland
2021-09-23  9:13 ` [PATCH v5 20/20] q800: configure nubus available slots for Quadra 800 Mark Cave-Ayland

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=8e879ded-3a4e-b12f-1479-62401af06927@amsat.org \
    --to=f4bug@amsat.org \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.