Re: [PATCH] ftgmac100: fix dblac write test

2020-06-28 Thread no-reply
Patchew URL: 
https://patchew.org/QEMU/20200628114057.-1-erik.lucas.s...@gmail.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing 
commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  BUILD   pc-bios/optionrom/linuxboot.raw
In file included from /tmp/qemu-test/src/hw/net/ftgmac100.c:19:
/tmp/qemu-test/src/hw/net/ftgmac100.c: In function 'ftgmac100_write':
/tmp/qemu-test/src/hw/net/ftgmac100.c:815:27: error: format '%ld' expects 
argument of type 'long int', but argument 3 has type 'uint64_t' {aka 'long long 
unsigned int'} [-Werror=format=]
  815 |   "%s: transmit descriptor too small : %ld 
bytes\n",
  |   
^
/tmp/qemu-test/src/include/qemu/log.h:120:22: note: in definition of macro 
'qemu_log_mask'
---
  |  long 
int
  |%lld
In file included from /tmp/qemu-test/src/hw/net/ftgmac100.c:19:
/tmp/qemu-test/src/hw/net/ftgmac100.c:821:27: error: format '%ld' expects 
argument of type 'long int', but argument 3 has type 'uint64_t' {aka 'long long 
unsigned int'} [-Werror=format=]
  821 |   "%s: receive descriptor too small : %ld 
bytes\n",
  |   
^~~~
/tmp/qemu-test/src/include/qemu/log.h:120:22: note: in definition of macro 
'qemu_log_mask'
---
  | long int
  |   %lld
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: hw/net/ftgmac100.o] Error 1
make: *** Waiting for unfinished jobs
  BUILD   pc-bios/optionrom/linuxboot_dma.raw
  BUILD   pc-bios/optionrom/kvmvapic.raw
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', 
'--label', 'com.qemu.instance.uuid=2dd03a1068f74da08c7abd42679f0f27', '-u', 
'1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', 
'-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 
'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', 
'/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', 
'/var/tmp/patchew-tester-tmp-jgbwf7wz/src/docker-src.2020-06-28-07.46.16.21026:/var/tmp/qemu:z,ro',
 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit 
status 2.
filter=--filter=label=com.qemu.instance.uuid=2dd03a1068f74da08c7abd42679f0f27
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-jgbwf7wz/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real3m51.351s
user0m8.836s


The full log is available at
http://patchew.org/logs/20200628114057.-1-erik.lucas.s...@gmail.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-de...@redhat.com

[PATCH] ftgmac100: fix dblac write test

2020-06-28 Thread erik-smit
The test of the write of the dblac register was testing the old value
instead of the new value. This would accept the write of an invalid value
but subsequently refuse any following valid writes.

Signed-off-by: erik-smit 
---
 hw/net/ftgmac100.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
index 043ba61b86..9db0d27ea6 100644
--- a/hw/net/ftgmac100.c
+++ b/hw/net/ftgmac100.c
@@ -810,16 +810,16 @@ static void ftgmac100_write(void *opaque, hwaddr addr,
 s->phydata = value & 0x;
 break;
 case FTGMAC100_DBLAC: /* DMA Burst Length and Arbitration Control */
-if (FTGMAC100_DBLAC_TXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) {
+if (FTGMAC100_DBLAC_TXDES_SIZE(value) < sizeof(FTGMAC100Desc)) {
 qemu_log_mask(LOG_GUEST_ERROR,
-  "%s: transmit descriptor too small : %d bytes\n",
-  __func__, FTGMAC100_DBLAC_TXDES_SIZE(s->dblac));
+  "%s: transmit descriptor too small : %ld bytes\n",
+  __func__, FTGMAC100_DBLAC_TXDES_SIZE(value));
 break;
 }
-if (FTGMAC100_DBLAC_RXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) {
+if (FTGMAC100_DBLAC_RXDES_SIZE(value) < sizeof(FTGMAC100Desc)) {
 qemu_log_mask(LOG_GUEST_ERROR,
-  "%s: receive descriptor too small : %d bytes\n",
-  __func__, FTGMAC100_DBLAC_RXDES_SIZE(s->dblac));
+  "%s: receive descriptor too small : %ld bytes\n",
+  __func__, FTGMAC100_DBLAC_RXDES_SIZE(value));
 break;
 }
 s->dblac = value;
-- 
2.25.1