[Qemu-devel] [PATCHv3 00/13] sun4m: sparc32_dma tidy-ups

Mark Cave-Ayland posted 13 patches 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1508006342-5304-1-git-send-email-mark.cave-ayland@ilande.co.uk
Test checkpatch failed
Test docker passed
Test s390x passed
hw/dma/sparc32_dma.c           |  236 +++++++++++++++++++++++++++++-----------
hw/dma/sun4m_iommu.c           |   14 ---
hw/dma/trace-events            |    8 +-
hw/net/lance.c                 |    9 --
hw/scsi/esp.c                  |   13 ---
hw/sparc/sun4m.c               |   82 ++++++--------
include/hw/scsi/esp.h          |   14 +++
include/hw/sparc/sparc32_dma.h |   55 ++++++++++
include/hw/sparc/sun4m.h       |   29 +++++
9 files changed, 307 insertions(+), 153 deletions(-)
[Qemu-devel] [PATCHv3 00/13] 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, and the code for wiring up
the espdma/ledma and respective devices is also a lot more readable.

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

v3:
- Add missing sysbus.h include to esp.h in patch 7

v2:
- Make esp/lance devices children of espdma/ledma devices respectively
- Add len parameter to ledma/espdma tracepoints

Mark Cave-Ayland (13):
  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
  esp: move TYPE_ESP and SysBusESPState from esp.c to esp.h
  sparc32_dma: make esp device child of espdma device
  lance: move TYPE_LANCE and SysBusPCNetState from lance.c to sun4m.h
  sparc32_dma: make lance device child of ledma device
  sparc32_dma: introduce new SPARC32_DMA type container object
  sparc32_dma: remove is_ledma hack and replace with memory region
    alias
  sparc32_dma: add len to esp/le DMA memory tracing

 hw/dma/sparc32_dma.c           |  236 +++++++++++++++++++++++++++++-----------
 hw/dma/sun4m_iommu.c           |   14 ---
 hw/dma/trace-events            |    8 +-
 hw/net/lance.c                 |    9 --
 hw/scsi/esp.c                  |   13 ---
 hw/sparc/sun4m.c               |   82 ++++++--------
 include/hw/scsi/esp.h          |   14 +++
 include/hw/sparc/sparc32_dma.h |   55 ++++++++++
 include/hw/sparc/sun4m.h       |   29 +++++
 9 files changed, 307 insertions(+), 153 deletions(-)

-- 
1.7.10.4


Re: [Qemu-devel] [PATCHv3 00/13] 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: 1508006342-5304-1-git-send-email-mark.cave-ayland@ilande.co.uk
Subject: [Qemu-devel] [PATCHv3 00/13] 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'
49376f2097 sparc32_dma: add len to esp/le DMA memory tracing
d1747b9946 sparc32_dma: remove is_ledma hack and replace with memory region alias
aff708b794 sparc32_dma: introduce new SPARC32_DMA type container object
c1d8e324e2 sparc32_dma: make lance device child of ledma device
89f91116dd lance: move TYPE_LANCE and SysBusPCNetState from lance.c to sun4m.h
dead665d1d sparc32_dma: make esp device child of espdma device
1afaa63bbd esp: move TYPE_ESP and SysBusESPState from esp.c to esp.h
9e05523632 sparc32_dma: use object link instead of qdev property to pass IOMMU reference
80b9835896 sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h
66a36aaa11 sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()
d2fd9ca3eb sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h
74c5135edf sparc32_dma: split esp and le into separate DMA devices
cc07b7035d sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE

=== OUTPUT BEGIN ===
Checking PATCH 1/13: sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE...
Checking PATCH 2/13: sparc32_dma: split esp and le into separate DMA devices...
Checking PATCH 3/13: sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h...
Checking PATCH 4/13: sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()...
ERROR: spaces required around that '*' (ctx:WxV)
#51: 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/13: sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h...
Checking PATCH 6/13: sparc32_dma: use object link instead of qdev property to pass IOMMU reference...
Checking PATCH 7/13: esp: move TYPE_ESP and SysBusESPState from esp.c to esp.h...
Checking PATCH 8/13: sparc32_dma: make esp device child of espdma device...
Checking PATCH 9/13: lance: move TYPE_LANCE and SysBusPCNetState from lance.c to sun4m.h...
Checking PATCH 10/13: sparc32_dma: make lance device child of ledma device...
Checking PATCH 11/13: sparc32_dma: introduce new SPARC32_DMA type container object...
Checking PATCH 12/13: sparc32_dma: remove is_ledma hack and replace with memory region alias...
Checking PATCH 13/13: sparc32_dma: add len to esp/le DMA memory tracing...
=== 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] [PATCHv3 00/13] sun4m: sparc32_dma tidy-ups
Posted by Mark Cave-Ayland 6 years, 6 months ago
On 14/10/17 20: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: 1508006342-5304-1-git-send-email-mark.cave-ayland@ilande.co.uk
> Subject: [Qemu-devel] [PATCHv3 00/13] 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'
> 49376f2097 sparc32_dma: add len to esp/le DMA memory tracing
> d1747b9946 sparc32_dma: remove is_ledma hack and replace with memory region alias
> aff708b794 sparc32_dma: introduce new SPARC32_DMA type container object
> c1d8e324e2 sparc32_dma: make lance device child of ledma device
> 89f91116dd lance: move TYPE_LANCE and SysBusPCNetState from lance.c to sun4m.h
> dead665d1d sparc32_dma: make esp device child of espdma device
> 1afaa63bbd esp: move TYPE_ESP and SysBusESPState from esp.c to esp.h
> 9e05523632 sparc32_dma: use object link instead of qdev property to pass IOMMU reference
> 80b9835896 sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h
> 66a36aaa11 sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()
> d2fd9ca3eb sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h
> 74c5135edf sparc32_dma: split esp and le into separate DMA devices
> cc07b7035d sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE
> 
> === OUTPUT BEGIN ===
> Checking PATCH 1/13: sparc32_dma: rename SPARC32_DMA type to SPARC32_DMA_DEVICE...
> Checking PATCH 2/13: sparc32_dma: split esp and le into separate DMA devices...
> Checking PATCH 3/13: sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h...
> Checking PATCH 4/13: sun4m: move DMA device wiring from sparc32_dma_init() to sun4m_hw_init()...
> ERROR: spaces required around that '*' (ctx:WxV)
> #51: 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/13: sun4m_iommu: move TYPE_SUN4M_IOMMU declaration to sun4m.h...
> Checking PATCH 6/13: sparc32_dma: use object link instead of qdev property to pass IOMMU reference...
> Checking PATCH 7/13: esp: move TYPE_ESP and SysBusESPState from esp.c to esp.h...
> Checking PATCH 8/13: sparc32_dma: make esp device child of espdma device...
> Checking PATCH 9/13: lance: move TYPE_LANCE and SysBusPCNetState from lance.c to sun4m.h...
> Checking PATCH 10/13: sparc32_dma: make lance device child of ledma device...
> Checking PATCH 11/13: sparc32_dma: introduce new SPARC32_DMA type container object...
> Checking PATCH 12/13: sparc32_dma: remove is_ledma hack and replace with memory region alias...
> Checking PATCH 13/13: sparc32_dma: add len to esp/le DMA memory tracing...
> === 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

I had a brief chat with Fam about this on IRC and he agreed it was a
false positive - however I am still confused as to why I don't see this
locally?

From my github repository at https://github.com/mcayland/qemu.git:

$ git checkout for-fam
Previous HEAD position was f90ea7b... Merge remote-tracking branch
'remotes/pmaydell/tags/pull-target-arm-20171012' into staging
Branch for-fam set up to track remote branch for-fam from mcayland-github.
Switched to a new branch 'for-fam'

$ git format-patch -o /tmp/qemu f90ea7b
/tmp/qemu/0001-sparc32_dma-rename-SPARC32_DMA-type-to-SPARC32_DMA_D.patch
/tmp/qemu/0002-sparc32_dma-split-esp-and-le-into-separate-DMA-devic.patch
/tmp/qemu/0003-sparc32_dma-move-type-declarations-from-sparc32_dma..patch
/tmp/qemu/0004-sun4m-move-DMA-device-wiring-from-sparc32_dma_init-t.patch
/tmp/qemu/0005-sun4m_iommu-move-TYPE_SUN4M_IOMMU-declaration-to-sun.patch
/tmp/qemu/0006-sparc32_dma-use-object-link-instead-of-qdev-property.patch
/tmp/qemu/0007-esp-move-TYPE_ESP-and-SysBusESPState-from-esp.c-to-e.patch
/tmp/qemu/0008-sparc32_dma-make-esp-device-child-of-espdma-device.patch
/tmp/qemu/0009-lance-move-TYPE_LANCE-and-SysBusPCNetState-from-lanc.patch
/tmp/qemu/0010-sparc32_dma-make-lance-device-child-of-ledma-device.patch
/tmp/qemu/0011-sparc32_dma-introduce-new-SPARC32_DMA-type-container.patch
/tmp/qemu/0012-sparc32_dma-remove-is_ledma-hack-and-replace-with-me.patch
/tmp/qemu/0013-sparc32_dma-add-len-to-esp-le-DMA-memory-tracing.patch

$ ./scripts/checkpatch.pl /tmp/qemu/*
total: 0 errors, 0 warnings, 175 lines checked

/tmp/qemu/0001-sparc32_dma-rename-SPARC32_DMA-type-to-SPARC32_DMA_D.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 107 lines checked

/tmp/qemu/0002-sparc32_dma-split-esp-and-le-into-separate-DMA-devic.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 89 lines checked

/tmp/qemu/0003-sparc32_dma-move-type-declarations-from-sparc32_dma..patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 66 lines checked

/tmp/qemu/0004-sun4m-move-DMA-device-wiring-from-sparc32_dma_init-t.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 52 lines checked

/tmp/qemu/0005-sun4m_iommu-move-TYPE_SUN4M_IOMMU-declaration-to-sun.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 45 lines checked

/tmp/qemu/0006-sparc32_dma-use-object-link-instead-of-qdev-property.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 45 lines checked

/tmp/qemu/0007-esp-move-TYPE_ESP-and-SysBusESPState-from-esp.c-to-e.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 91 lines checked

/tmp/qemu/0008-sparc32_dma-make-esp-device-child-of-espdma-device.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 40 lines checked

/tmp/qemu/0009-lance-move-TYPE_LANCE-and-SysBusPCNetState-from-lanc.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 110 lines checked

/tmp/qemu/0010-sparc32_dma-make-lance-device-child-of-ledma-device.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 198 lines checked

/tmp/qemu/0011-sparc32_dma-introduce-new-SPARC32_DMA-type-container.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 64 lines checked

/tmp/qemu/0012-sparc32_dma-remove-is_ledma-hack-and-replace-with-me.patch
has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 48 lines checked

/tmp/qemu/0013-sparc32_dma-add-len-to-esp-le-DMA-memory-tracing.patch
has no obvious style problems and is ready for submission.

So I don't see the warning here at all?

$ md5sum scripts/checkpatch.pl
6c5d64bb35ab9fbe2a2da67d8c151d86  scripts/checkpatch.pl


ATB,

Mark.

Re: [Qemu-devel] [PATCHv3 00/13] sun4m: sparc32_dma tidy-ups
Posted by Artyom Tarasenko 6 years, 6 months ago
On Sat, Oct 14, 2017 at 8:38 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, and the code for wiring up
> the espdma/ledma and respective devices is also a lot more readable.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

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

>
> v3:
> - Add missing sysbus.h include to esp.h in patch 7
>
> v2:
> - Make esp/lance devices children of espdma/ledma devices respectively
> - Add len parameter to ledma/espdma tracepoints
>
> Mark Cave-Ayland (13):
>   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
>   esp: move TYPE_ESP and SysBusESPState from esp.c to esp.h
>   sparc32_dma: make esp device child of espdma device
>   lance: move TYPE_LANCE and SysBusPCNetState from lance.c to sun4m.h
>   sparc32_dma: make lance device child of ledma device
>   sparc32_dma: introduce new SPARC32_DMA type container object
>   sparc32_dma: remove is_ledma hack and replace with memory region
>     alias
>   sparc32_dma: add len to esp/le DMA memory tracing
>
>  hw/dma/sparc32_dma.c           |  236 +++++++++++++++++++++++++++++-----------
>  hw/dma/sun4m_iommu.c           |   14 ---
>  hw/dma/trace-events            |    8 +-
>  hw/net/lance.c                 |    9 --
>  hw/scsi/esp.c                  |   13 ---
>  hw/sparc/sun4m.c               |   82 ++++++--------
>  include/hw/scsi/esp.h          |   14 +++
>  include/hw/sparc/sparc32_dma.h |   55 ++++++++++
>  include/hw/sparc/sun4m.h       |   29 +++++
>  9 files changed, 307 insertions(+), 153 deletions(-)
>
> --
> 1.7.10.4
>



-- 
Regards,
Artyom Tarasenko

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