[Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups

Mark Cave-Ayland posted 8 patches 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1507583223-14819-1-git-send-email-mark.cave-ayland@ilande.co.uk
Test checkpatch failed
Test docker passed
Test s390x passed
hw/dma/sparc32_dma.c           |  165 ++++++++++++++++++++++++++--------------
hw/dma/sun4m_iommu.c           |   14 ----
hw/sparc/sun4m.c               |   40 +++++-----
include/hw/sparc/sparc32_dma.h |   49 ++++++++++++
include/hw/sparc/sun4m.h       |   16 ++++
5 files changed, 194 insertions(+), 90 deletions(-)
[Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups
Posted by Mark Cave-Ayland 6 years, 6 months ago
This patchset aims to tidy-up the sparc32_dma code by improving the
modelling of the espdma/ledma devices using both QOM and the memory
API which didn't exist when the code was first written.

The result is that it is now possible to remove both the iommu_opaque
and is_ledma workarounds from the code.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Mark Cave-Ayland (8):
  sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE
  sparc32_dma: split esp and le into separate DMA devices
  sparc32_dma: move type declarations from sparc32_dma.c to
    sparc32_dma.h
  sun4m: move DMA device wiring from sparc32_dma_init() to
    sun4m_hw_init()
  sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h
  sparc32_dma: use object link instead of qdev property to pass IOMMU
    reference
  sparc32_dma: introduce new SPARC32_DMA type container object
  sparc32_dma: remove is_ledma hack and replace with memory region
    alias

 hw/dma/sparc32_dma.c           |  165 ++++++++++++++++++++++++++--------------
 hw/dma/sun4m_iommu.c           |   14 ----
 hw/sparc/sun4m.c               |   40 +++++-----
 include/hw/sparc/sparc32_dma.h |   49 ++++++++++++
 include/hw/sparc/sun4m.h       |   16 ++++
 5 files changed, 194 insertions(+), 90 deletions(-)

-- 
1.7.10.4


Re: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups
Posted by no-reply@patchew.org 6 years, 6 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 1507583223-14819-1-git-send-email-mark.cave-ayland@ilande.co.uk
Subject: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
9381599b5f sparc32_dma: remove is_ledma hack and replace with memory region alias
351ac18a76 sparc32_dma: introduce new SPARC32_DMA type container object
2d199e96ee sparc32_dma: use object link instead of qdev property to pass IOMMU reference
3d1e0d1ab6 sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h
6b2427a590 sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()
21c607d831 sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h
76cb2ba4ba sparc32_dma: split esp and le into separate DMA devices
c31bca2fb4 sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE

=== OUTPUT BEGIN ===
Checking PATCH 1/8: sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE...
Checking PATCH 2/8: sparc32_dma: split esp and le into separate DMA devices...
Checking PATCH 3/8: sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h...
Checking PATCH 4/8: sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()...
ERROR: spaces required around that '*' (ctx:WxV)
#47: FILE: hw/sparc/sun4m.c:824:
+    qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS];
              ^

total: 1 errors, 0 warnings, 66 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 5/8: sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h...
Checking PATCH 6/8: sparc32_dma: use object link instead of qdev property to pass IOMMU reference...
Checking PATCH 7/8: sparc32_dma: introduce new SPARC32_DMA type container object...
Checking PATCH 8/8: sparc32_dma: remove is_ledma hack and replace with memory region alias...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
Re: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups
Posted by Mark Cave-Ayland 6 years, 6 months ago
On 09/10/17 23:23, no-reply@patchew.org wrote:

> Hi,
> 
> This series seems to have some coding style problems. See output below for
> more information:
> 
> Type: series
> Message-id: 1507583223-14819-1-git-send-email-mark.cave-ayland@ilande.co.uk
> Subject: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups
> 
> === TEST SCRIPT BEGIN ===
> #!/bin/bash
> 
> BASE=base
> n=1
> total=$(git log --oneline $BASE.. | wc -l)
> failed=0
> 
> git config --local diff.renamelimit 0
> git config --local diff.renames True
> 
> commits="$(git log --format=%H --reverse $BASE..)"
> for c in $commits; do
>     echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
>     if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
>         failed=1
>         echo
>     fi
>     n=$((n+1))
> done
> 
> exit $failed
> === TEST SCRIPT END ===
> 
> Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
> Switched to a new branch 'test'
> 9381599b5f sparc32_dma: remove is_ledma hack and replace with memory region alias
> 351ac18a76 sparc32_dma: introduce new SPARC32_DMA type container object
> 2d199e96ee sparc32_dma: use object link instead of qdev property to pass IOMMU reference
> 3d1e0d1ab6 sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h
> 6b2427a590 sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()
> 21c607d831 sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h
> 76cb2ba4ba sparc32_dma: split esp and le into separate DMA devices
> c31bca2fb4 sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE
> 
> === OUTPUT BEGIN ===
> Checking PATCH 1/8: sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE...
> Checking PATCH 2/8: sparc32_dma: split esp and le into separate DMA devices...
> Checking PATCH 3/8: sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h...
> Checking PATCH 4/8: sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()...
> ERROR: spaces required around that '*' (ctx:WxV)
> #47: FILE: hw/sparc/sun4m.c:824:
> +    qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS];
>               ^
> 
> total: 1 errors, 0 warnings, 66 lines checked
> 
> Your patch has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.
> 
> Checking PATCH 5/8: sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h...
> Checking PATCH 6/8: sparc32_dma: use object link instead of qdev property to pass IOMMU reference...
> Checking PATCH 7/8: sparc32_dma: introduce new SPARC32_DMA type container object...
> Checking PATCH 8/8: sparc32_dma: remove is_ledma hack and replace with memory region alias...
> === OUTPUT END ===
> 
> Test command exited with code: 1

This is strange - I get no errors when I run scripts/checkpatch.pl from
git master locally on the output of git format-patch.

I'm not convinced this is correct either as there are plenty of other
"Type *foo" declarations within the patch itself. Presumably this is
because there are extra rules somewhere for qemu_irq?


ATB,

Mark.

Re: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups
Posted by Artyom Tarasenko 6 years, 6 months ago
On Mon, Oct 9, 2017 at 11:06 PM, Mark Cave-Ayland
<mark.cave-ayland@ilande.co.uk> wrote:
> This patchset aims to tidy-up the sparc32_dma code by improving the
> modelling of the espdma/ledma devices using both QOM and the memory
> API which didn't exist when the code was first written.
>
> The result is that it is now possible to remove both the iommu_opaque
> and is_ledma workarounds from the code.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>

>
> Mark Cave-Ayland (8):
>   sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE
>   sparc32_dma: split esp and le into separate DMA devices
>   sparc32_dma: move type declarations from sparc32_dma.c to
>     sparc32_dma.h
>   sun4m: move DMA device wiring from sparc32_dma_init() to
>     sun4m_hw_init()
>   sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h
>   sparc32_dma: use object link instead of qdev property to pass IOMMU
>     reference
>   sparc32_dma: introduce new SPARC32_DMA type container object
>   sparc32_dma: remove is_ledma hack and replace with memory region
>     alias
>
>  hw/dma/sparc32_dma.c           |  165 ++++++++++++++++++++++++++--------------
>  hw/dma/sun4m_iommu.c           |   14 ----
>  hw/sparc/sun4m.c               |   40 +++++-----
>  include/hw/sparc/sparc32_dma.h |   49 ++++++++++++
>  include/hw/sparc/sun4m.h       |   16 ++++
>  5 files changed, 194 insertions(+), 90 deletions(-)
>
> --
> 1.7.10.4
>



-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu

Re: [Qemu-devel] [PATCH 0/8] sun4m : sparc32_dma tidy-ups
Posted by Mark Cave-Ayland 6 years, 6 months ago
On 10/10/17 09:21, Artyom Tarasenko wrote:

> On Mon, Oct 9, 2017 at 11:06 PM, Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> wrote:
>> This patchset aims to tidy-up the sparc32_dma code by improving the
>> modelling of the espdma/ledma devices using both QOM and the memory
>> API which didn't exist when the code was first written.
>>
>> The result is that it is now possible to remove both the iommu_opaque
>> and is_ledma workarounds from the code.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>

With some further experimentation I've found that making the esp/le
devices children of their respective espdma/ledma devices makes things a
lot cleaner.

I've also got another related patch to update the espdma/ledma
tracepoints to log the DMA transaction length, so I'll submit a v2 of
this with the additional changes shortly.


ATB,

Mark.