[PATCH 0/2] sparc/leon3: Make grlib-irqmp handle its own inbound IRQ lines

Peter Maydell posted 2 patches 3 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201212144134.29594-1-peter.maydell@linaro.org
Maintainers: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, KONRAD Frederic <frederic.konrad@adacore.com>, Fabien Chouteau <chouteau@adacore.com>, Artyom Tarasenko <atar4qemu@gmail.com>
include/hw/sparc/grlib.h |  4 ----
hw/intc/grlib_irqmp.c    |  5 ++++-
hw/sparc/leon3.c         | 21 +++++++++------------
3 files changed, 13 insertions(+), 17 deletions(-)
[PATCH 0/2] sparc/leon3: Make grlib-irqmp handle its own inbound IRQ lines
Posted by Peter Maydell 3 years, 4 months ago
Currently the GRLIB_IRQMP device is used in one place (the leon3
board), but instead of the device providing inbound gpio lines for
the board to wire up, the board code itself calls
qemu_allocate_irqs() with the handler function being a set_irq
function defined in the code for the device.

Patch one in this series refactors this into the standard setup of a
device having input gpio lines.  The main motivation here is that it
squashes a trivial Coverity memory leak warning.  Patch two just
removes a stray unused typedef that I noticed in passing.

Incidentally I suspect the irqmp_ack logic could also be done more
neatly, but I didn't feel like getting into that at this point.

Tested by booting the 'buildroot' image downloadable from
https://www.gaisler.com/anonftp/linux/linux-2.6/images/leon-linux-4.9/leon-linux-4.9-1.0/up/
and runnable with
 ./build/sparc-all/qemu-system-sparc -M leon3_generic -display none -serial stdio -kernel image.ram


thanks
-- PMM

Peter Maydell (2):
  hw/sparc: Make grlib-irqmp device handle its own inbound IRQ lines
  include/hw/sparc/grlib.h: Remove unused set_pil_in_fn typedef

 include/hw/sparc/grlib.h |  4 ----
 hw/intc/grlib_irqmp.c    |  5 ++++-
 hw/sparc/leon3.c         | 21 +++++++++------------
 3 files changed, 13 insertions(+), 17 deletions(-)

-- 
2.20.1


Re: [PATCH 0/2] sparc/leon3: Make grlib-irqmp handle its own inbound IRQ lines
Posted by Mark Cave-Ayland 3 years, 3 months ago
On 12/12/2020 14:41, Peter Maydell wrote:

> Currently the GRLIB_IRQMP device is used in one place (the leon3
> board), but instead of the device providing inbound gpio lines for
> the board to wire up, the board code itself calls
> qemu_allocate_irqs() with the handler function being a set_irq
> function defined in the code for the device.
> 
> Patch one in this series refactors this into the standard setup of a
> device having input gpio lines.  The main motivation here is that it
> squashes a trivial Coverity memory leak warning.  Patch two just
> removes a stray unused typedef that I noticed in passing.
> 
> Incidentally I suspect the irqmp_ack logic could also be done more
> neatly, but I didn't feel like getting into that at this point.
> 
> Tested by booting the 'buildroot' image downloadable from
> https://www.gaisler.com/anonftp/linux/linux-2.6/images/leon-linux-4.9/leon-linux-4.9-1.0/up/
> and runnable with
>   ./build/sparc-all/qemu-system-sparc -M leon3_generic -display none -serial stdio -kernel image.ram
> 
> 
> thanks
> -- PMM
> 
> Peter Maydell (2):
>    hw/sparc: Make grlib-irqmp device handle its own inbound IRQ lines
>    include/hw/sparc/grlib.h: Remove unused set_pil_in_fn typedef
> 
>   include/hw/sparc/grlib.h |  4 ----
>   hw/intc/grlib_irqmp.c    |  5 ++++-
>   hw/sparc/leon3.c         | 21 +++++++++------------
>   3 files changed, 13 insertions(+), 17 deletions(-)

Frederic/Fabien - any chance of a Reviewed-by or Acked-by tag from one of you? If so, 
I can send this as part of an upcoming SPARC PR.


ATB,

Mark.

Re: [PATCH 0/2] sparc/leon3: Make grlib-irqmp handle its own inbound IRQ lines
Posted by Fred Konrad 3 years, 3 months ago

Le 12/12/20 à 3:41 PM, Peter Maydell a écrit :
> Currently the GRLIB_IRQMP device is used in one place (the leon3
> board), but instead of the device providing inbound gpio lines for
> the board to wire up, the board code itself calls
> qemu_allocate_irqs() with the handler function being a set_irq
> function defined in the code for the device.
> 
> Patch one in this series refactors this into the standard setup of a
> device having input gpio lines.  The main motivation here is that it
> squashes a trivial Coverity memory leak warning.  Patch two just
> removes a stray unused typedef that I noticed in passing.
> 
> Incidentally I suspect the irqmp_ack logic could also be done more
> neatly, but I didn't feel like getting into that at this point.

Indeed, and I've some cleanup patches for that, but never had time to submit
them.  Hopefully sometime in 2021 :).

Cheers,
Fred

> 
> Tested by booting the 'buildroot' image downloadable from
> https://www.gaisler.com/anonftp/linux/linux-2.6/images/leon-linux-4.9/leon-linux-4.9-1.0/up/
> and runnable with
>   ./build/sparc-all/qemu-system-sparc -M leon3_generic -display none -serial stdio -kernel image.ram
> 
> 
> thanks
> -- PMM
> 
> Peter Maydell (2):
>    hw/sparc: Make grlib-irqmp device handle its own inbound IRQ lines
>    include/hw/sparc/grlib.h: Remove unused set_pil_in_fn typedef
> 
>   include/hw/sparc/grlib.h |  4 ----
>   hw/intc/grlib_irqmp.c    |  5 ++++-
>   hw/sparc/leon3.c         | 21 +++++++++------------
>   3 files changed, 13 insertions(+), 17 deletions(-)
>