All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
@ 2020-08-06 13:03 Philippe Mathieu-Daudé
  2020-08-06 13:03 ` [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event Philippe Mathieu-Daudé
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06 13:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Michael S. Tsirkin,
	Philippe Mathieu-Daudé,
	Marc-André Lureau, Paolo Bonzini

This series improve tracing of multiple UART device in the same
chipset, and allow to use the Clock API to feed each device with
an (updatable) input clock.

Based-on: <20200730165900.7030-1-philmd@redhat.com>
"hw/char: Remove TYPE_SERIAL_IO"

Philippe Mathieu-Daudé (4):
  hw/char/serial: Replace commented DPRINTF() by trace event
  hw/char/serial: Remove old DEBUG_SERIAL commented code
  hw/char/serial: Let SerialState have an 'id' field
  hw/char/serial: Use the Clock API to feed the UART reference clock

 include/hw/char/serial.h |  4 +++
 hw/char/serial.c         | 55 +++++++++++++++++++++++-----------------
 hw/char/trace-events     |  5 ++--
 3 files changed, 39 insertions(+), 25 deletions(-)

-- 
2.21.3



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event
  2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
@ 2020-08-06 13:03 ` Philippe Mathieu-Daudé
  2020-08-12 17:41   ` Richard Henderson
  2020-08-06 13:03 ` [PATCH-for-5.2 2/4] hw/char/serial: Remove old DEBUG_SERIAL commented code Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06 13:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Michael S. Tsirkin,
	Philippe Mathieu-Daudé,
	Marc-André Lureau, Paolo Bonzini

Convert the old debug PRINTF() call to display the UART
baudrate to a trace event.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/char/serial.c     | 4 +---
 hw/char/trace-events | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/char/serial.c b/hw/char/serial.c
index fd80ae5592..3e903d5fad 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -187,9 +187,7 @@ static void serial_update_parameters(SerialState *s)
     ssp.stop_bits = stop_bits;
     s->char_transmit_time =  (NANOSECONDS_PER_SECOND / speed) * frame_size;
     qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
-
-    DPRINTF("speed=%.2f parity=%c data=%d stop=%d\n",
-           speed, parity, data_bits, stop_bits);
+    trace_serial_update_parameters(speed, parity, data_bits, stop_bits);
 }
 
 static void serial_update_msl(SerialState *s)
diff --git a/hw/char/trace-events b/hw/char/trace-events
index d20eafd56f..85e39d9d62 100644
--- a/hw/char/trace-events
+++ b/hw/char/trace-events
@@ -7,6 +7,7 @@ parallel_ioport_write(const char *desc, uint16_t addr, uint8_t value) "write [%s
 # serial.c
 serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%02x"
 serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0x%02x"
+serial_update_parameters(uint64_t baudrate, char parity, int data_bits, int stop_bits) "baudrate=%"PRIu64" parity='%c' data=%d stop=%d"
 
 # virtio-serial-bus.c
 virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u"
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH-for-5.2 2/4] hw/char/serial: Remove old DEBUG_SERIAL commented code
  2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
  2020-08-06 13:03 ` [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event Philippe Mathieu-Daudé
@ 2020-08-06 13:03 ` Philippe Mathieu-Daudé
  2020-08-12 17:42   ` Richard Henderson
  2020-08-06 13:03 ` [PATCH-for-5.2 3/4] hw/char/serial: Let SerialState have an 'id' field Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06 13:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Michael S. Tsirkin,
	Philippe Mathieu-Daudé,
	Marc-André Lureau, Paolo Bonzini

All useful DPRINTF() calls have been converted to trace
events.  Remove a pointless one in the IOEventHandler,
and drop the DEBUG_SERIAL ifdef'ry.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/char/serial.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/hw/char/serial.c b/hw/char/serial.c
index 3e903d5fad..758a3aa49b 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -36,8 +36,6 @@
 #include "trace.h"
 #include "hw/qdev-properties.h"
 
-//#define DEBUG_SERIAL
-
 #define UART_LCR_DLAB	0x80	/* Divisor latch access bit */
 
 #define UART_IER_MSI	0x08	/* Enable Modem status interrupt */
@@ -102,14 +100,6 @@
 
 #define MAX_XMIT_RETRY      4
 
-#ifdef DEBUG_SERIAL
-#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-do {} while (0)
-#endif
-
 static void serial_receive1(void *opaque, const uint8_t *buf, int size);
 static void serial_xmit(SerialState *s);
 
@@ -636,7 +626,6 @@ static void serial_receive1(void *opaque, const uint8_t *buf, int size)
 static void serial_event(void *opaque, QEMUChrEvent event)
 {
     SerialState *s = opaque;
-    DPRINTF("event %x\n", event);
     if (event == CHR_EVENT_BREAK)
         serial_receive_break(s);
 }
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH-for-5.2 3/4] hw/char/serial: Let SerialState have an 'id' field
  2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
  2020-08-06 13:03 ` [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event Philippe Mathieu-Daudé
  2020-08-06 13:03 ` [PATCH-for-5.2 2/4] hw/char/serial: Remove old DEBUG_SERIAL commented code Philippe Mathieu-Daudé
@ 2020-08-06 13:03 ` Philippe Mathieu-Daudé
  2020-08-12 17:43   ` Richard Henderson
  2020-08-06 13:03 ` [PATCH-for-5.2 4/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06 13:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Michael S. Tsirkin,
	Philippe Mathieu-Daudé,
	Marc-André Lureau, Paolo Bonzini

When a SoC has multiple UARTs (some configured differently),
it is hard to associate events to their UART.

To be able to distinct trace events between various instances,
add an 'id' field. Update the trace format accordingly.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/char/serial.h | 1 +
 hw/char/serial.c         | 7 ++++---
 hw/char/trace-events     | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 81d7ba1917..75c71adfd2 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -75,6 +75,7 @@ typedef struct SerialState {
     uint64_t char_transmit_time;    /* time to transmit a char in ticks */
     int poll_msl;
 
+    uint8_t id;
     QEMUTimer *modem_status_poll;
     MemoryRegion io;
 } SerialState;
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 758a3aa49b..2ddc73f255 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -177,7 +177,7 @@ static void serial_update_parameters(SerialState *s)
     ssp.stop_bits = stop_bits;
     s->char_transmit_time =  (NANOSECONDS_PER_SECOND / speed) * frame_size;
     qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
-    trace_serial_update_parameters(speed, parity, data_bits, stop_bits);
+    trace_serial_update_parameters(s->id, speed, parity, data_bits, stop_bits);
 }
 
 static void serial_update_msl(SerialState *s)
@@ -333,7 +333,7 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val,
     SerialState *s = opaque;
 
     addr &= 7;
-    trace_serial_ioport_write(addr, val);
+    trace_serial_ioport_write(s->id, addr, val);
     switch(addr) {
     default:
     case 0:
@@ -550,7 +550,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)
         ret = s->scr;
         break;
     }
-    trace_serial_ioport_read(addr, ret);
+    trace_serial_ioport_read(s->id, addr, ret);
     return ret;
 }
 
@@ -973,6 +973,7 @@ const MemoryRegionOps serial_io_ops = {
 };
 
 static Property serial_properties[] = {
+    DEFINE_PROP_UINT8("id", SerialState, id, 0),
     DEFINE_PROP_CHR("chardev", SerialState, chr),
     DEFINE_PROP_UINT32("baudbase", SerialState, baudbase, 115200),
     DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/char/trace-events b/hw/char/trace-events
index 85e39d9d62..04a6fb4a15 100644
--- a/hw/char/trace-events
+++ b/hw/char/trace-events
@@ -5,9 +5,9 @@ parallel_ioport_read(const char *desc, uint16_t addr, uint8_t value) "read [%s]
 parallel_ioport_write(const char *desc, uint16_t addr, uint8_t value) "write [%s] addr 0x%02x val 0x%02x"
 
 # serial.c
-serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%02x"
-serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0x%02x"
-serial_update_parameters(uint64_t baudrate, char parity, int data_bits, int stop_bits) "baudrate=%"PRIu64" parity='%c' data=%d stop=%d"
+serial_ioport_read(uint8_t id, uint16_t addr, uint8_t value) "id#%u read addr 0x%02x val 0x%02x"
+serial_ioport_write(uint8_t id, uint16_t addr, uint8_t value) "id#%u write addr 0x%02x val 0x%02x"
+serial_update_parameters(uint8_t id, uint64_t baudrate, char parity, int data_bits, int stop_bits) "id#%u baudrate=%"PRIu64" parity=%c data=%d stop=%d"
 
 # virtio-serial-bus.c
 virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16_t value) "port %u, event %u, value %u"
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH-for-5.2 4/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-08-06 13:03 ` [PATCH-for-5.2 3/4] hw/char/serial: Let SerialState have an 'id' field Philippe Mathieu-Daudé
@ 2020-08-06 13:03 ` Philippe Mathieu-Daudé
  2020-08-12 17:46   ` Richard Henderson
  2020-08-22 20:00 ` [PATCH-for-5.2 0/4] " Philippe Mathieu-Daudé
  2020-09-01 17:02 ` Paolo Bonzini
  5 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06 13:03 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Michael S. Tsirkin,
	Philippe Mathieu-Daudé,
	Marc-André Lureau, Paolo Bonzini

In the same chipset, UARTs can be clocked at different rate, or the
input clock can be changed at runtime. The Clock API allow us to
propagate such clock rate change to the device.
Let the SerialState have its reference input clock (called 'rclk')
and if not clock is connected to the device, use the currently provided
frequency, to not modify the current code behavior.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/char/serial.h |  3 +++
 hw/char/serial.c         | 35 ++++++++++++++++++++++++++++-------
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 75c71adfd2..1c7a4df2ab 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -31,8 +31,10 @@
 #include "qemu/fifo8.h"
 #include "chardev/char.h"
 #include "hw/sysbus.h"
+#include "hw/clock.h"
 
 #define UART_FIFO_LENGTH    16      /* 16550A Fifo Length */
+#define UART_CLOCK_DIVISOR  16      /* baudrate is input clock / 16 */
 
 typedef struct SerialState {
     DeviceState parent;
@@ -57,6 +59,7 @@ typedef struct SerialState {
     qemu_irq irq;
     CharBackend chr;
     int last_break_enable;
+    Clock *rclk; /* ReceiverClock */
     uint32_t baudbase;
     uint32_t tsr_retry;
     guint watch_tag;
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 2ddc73f255..701c670fd5 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -35,6 +35,7 @@
 #include "qemu/error-report.h"
 #include "trace.h"
 #include "hw/qdev-properties.h"
+#include "hw/qdev-clock.h"
 
 #define UART_LCR_DLAB	0x80	/* Divisor latch access bit */
 
@@ -921,10 +922,36 @@ static int serial_be_change(void *opaque)
     return 0;
 }
 
+/* Change the main reference oscillator frequency. */
+void serial_set_frequency(SerialState *s, uint32_t frequency)
+{
+    s->baudbase = frequency;
+    serial_update_parameters(s);
+}
+
+static void serial_rclk_update(void *opaque)
+{
+    SerialState *s = opaque;
+
+    serial_set_frequency(s, clock_get_hz(s->rclk) / UART_CLOCK_DIVISOR);
+}
+
+static void serial_init(Object *obj)
+{
+    SerialState *s = SERIAL(obj);
+
+    s->rclk = qdev_init_clock_in(DEVICE(obj), "rclk", serial_rclk_update, s);
+}
+
 static void serial_realize(DeviceState *dev, Error **errp)
 {
     SerialState *s = SERIAL(dev);
 
+    /* initialize the frequency in case the clock remains unconnected */
+    if (!clock_get(s->rclk)) {
+        clock_set_hz(s->rclk, s->baudbase);
+    }
+
     s->modem_status_poll = timer_new_ns(QEMU_CLOCK_VIRTUAL, (QEMUTimerCB *) serial_update_msl, s);
 
     s->fifo_timeout_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, (QEMUTimerCB *) fifo_timeout_int, s);
@@ -955,13 +982,6 @@ static void serial_unrealize(DeviceState *dev)
     qemu_unregister_reset(serial_reset, s);
 }
 
-/* Change the main reference oscillator frequency. */
-void serial_set_frequency(SerialState *s, uint32_t frequency)
-{
-    s->baudbase = frequency;
-    serial_update_parameters(s);
-}
-
 const MemoryRegionOps serial_io_ops = {
     .read = serial_ioport_read,
     .write = serial_ioport_write,
@@ -994,6 +1014,7 @@ static const TypeInfo serial_info = {
     .name = TYPE_SERIAL,
     .parent = TYPE_DEVICE,
     .instance_size = sizeof(SerialState),
+    .instance_init = serial_init,
     .class_init = serial_class_init,
 };
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event
  2020-08-06 13:03 ` [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event Philippe Mathieu-Daudé
@ 2020-08-12 17:41   ` Richard Henderson
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2020-08-12 17:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Damien Hedde, Peter Maydell, Paolo Bonzini,
	Marc-André Lureau, Michael S. Tsirkin

On 8/6/20 6:03 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/char/serial.c     | 4 +---
>  hw/char/trace-events | 1 +
>  2 files changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 2/4] hw/char/serial: Remove old DEBUG_SERIAL commented code
  2020-08-06 13:03 ` [PATCH-for-5.2 2/4] hw/char/serial: Remove old DEBUG_SERIAL commented code Philippe Mathieu-Daudé
@ 2020-08-12 17:42   ` Richard Henderson
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2020-08-12 17:42 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Damien Hedde, Peter Maydell, Paolo Bonzini,
	Marc-André Lureau, Michael S. Tsirkin

On 8/6/20 6:03 AM, Philippe Mathieu-Daudé wrote:
> All useful DPRINTF() calls have been converted to trace
> events.  Remove a pointless one in the IOEventHandler,
> and drop the DEBUG_SERIAL ifdef'ry.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/char/serial.c | 11 -----------
>  1 file changed, 11 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 3/4] hw/char/serial: Let SerialState have an 'id' field
  2020-08-06 13:03 ` [PATCH-for-5.2 3/4] hw/char/serial: Let SerialState have an 'id' field Philippe Mathieu-Daudé
@ 2020-08-12 17:43   ` Richard Henderson
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2020-08-12 17:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Damien Hedde, Peter Maydell, Paolo Bonzini,
	Marc-André Lureau, Michael S. Tsirkin

On 8/6/20 6:03 AM, Philippe Mathieu-Daudé wrote:
> When a SoC has multiple UARTs (some configured differently),
> it is hard to associate events to their UART.
> 
> To be able to distinct trace events between various instances,
> add an 'id' field. Update the trace format accordingly.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/char/serial.h | 1 +
>  hw/char/serial.c         | 7 ++++---
>  hw/char/trace-events     | 6 +++---
>  3 files changed, 8 insertions(+), 6 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 4/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-06 13:03 ` [PATCH-for-5.2 4/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
@ 2020-08-12 17:46   ` Richard Henderson
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2020-08-12 17:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Damien Hedde, Peter Maydell, Paolo Bonzini,
	Marc-André Lureau, Michael S. Tsirkin

On 8/6/20 6:03 AM, Philippe Mathieu-Daudé wrote:
> In the same chipset, UARTs can be clocked at different rate, or the
> input clock can be changed at runtime. The Clock API allow us to
> propagate such clock rate change to the device.
> Let the SerialState have its reference input clock (called 'rclk')
> and if not clock is connected to the device, use the currently provided

s/not/no/

> frequency, to not modify the current code behavior.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/char/serial.h |  3 +++
>  hw/char/serial.c         | 35 ++++++++++++++++++++++++++++-------
>  2 files changed, 31 insertions(+), 7 deletions(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2020-08-06 13:03 ` [PATCH-for-5.2 4/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
@ 2020-08-22 20:00 ` Philippe Mathieu-Daudé
  2020-08-24 15:19   ` Peter Maydell
  2020-09-01 17:02 ` Paolo Bonzini
  5 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-22 20:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Paolo Bonzini,
	Marc-André Lureau, Michael S. Tsirkin

On 8/6/20 3:03 PM, Philippe Mathieu-Daudé wrote:
> This series improve tracing of multiple UART device in the same
> chipset, and allow to use the Clock API to feed each device with
> an (updatable) input clock.
> 
> Based-on: <20200730165900.7030-1-philmd@redhat.com>
> "hw/char: Remove TYPE_SERIAL_IO"
> 
> Philippe Mathieu-Daudé (4):
>   hw/char/serial: Replace commented DPRINTF() by trace event
>   hw/char/serial: Remove old DEBUG_SERIAL commented code
>   hw/char/serial: Let SerialState have an 'id' field
>   hw/char/serial: Use the Clock API to feed the UART reference clock
> 
>  include/hw/char/serial.h |  4 +++
>  hw/char/serial.c         | 55 +++++++++++++++++++++++-----------------
>  hw/char/trace-events     |  5 ++--
>  3 files changed, 39 insertions(+), 25 deletions(-)
> 

ping? Should I resend with the typo from patch 4 fixed?


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-22 20:00 ` [PATCH-for-5.2 0/4] " Philippe Mathieu-Daudé
@ 2020-08-24 15:19   ` Peter Maydell
  2020-08-26  9:52     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2020-08-24 15:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Damien Hedde, Marc-André Lureau, Paolo Bonzini,
	QEMU Developers, Michael S. Tsirkin

On Sat, 22 Aug 2020 at 21:00, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 8/6/20 3:03 PM, Philippe Mathieu-Daudé wrote:
> > This series improve tracing of multiple UART device in the same
> > chipset, and allow to use the Clock API to feed each device with
> > an (updatable) input clock.
> >
> > Based-on: <20200730165900.7030-1-philmd@redhat.com>
> > "hw/char: Remove TYPE_SERIAL_IO"
> >
> > Philippe Mathieu-Daudé (4):
> >   hw/char/serial: Replace commented DPRINTF() by trace event
> >   hw/char/serial: Remove old DEBUG_SERIAL commented code
> >   hw/char/serial: Let SerialState have an 'id' field
> >   hw/char/serial: Use the Clock API to feed the UART reference clock
> >
> >  include/hw/char/serial.h |  4 +++
> >  hw/char/serial.c         | 55 +++++++++++++++++++++++-----------------
> >  hw/char/trace-events     |  5 ++--
> >  3 files changed, 39 insertions(+), 25 deletions(-)
> >
>
> ping? Should I resend with the typo from patch 4 fixed?

Which tree are you expecting the patches to go in via ?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-24 15:19   ` Peter Maydell
@ 2020-08-26  9:52     ` Philippe Mathieu-Daudé
  2020-09-01 16:54       ` Marc-André Lureau
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-26  9:52 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Damien Hedde, Marc-André Lureau, Michael S. Tsirkin,
	QEMU Developers, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]

Hi Peter,

Le lun. 24 août 2020 17:20, Peter Maydell <peter.maydell@linaro.org> a
écrit :

> On Sat, 22 Aug 2020 at 21:00, Philippe Mathieu-Daudé <f4bug@amsat.org>
> wrote:
> >
> > On 8/6/20 3:03 PM, Philippe Mathieu-Daudé wrote:
> > > This series improve tracing of multiple UART device in the same
> > > chipset, and allow to use the Clock API to feed each device with
> > > an (updatable) input clock.
> > >
> > > Based-on: <20200730165900.7030-1-philmd@redhat.com>
> > > "hw/char: Remove TYPE_SERIAL_IO"
> > >
> > > Philippe Mathieu-Daudé (4):
> > >   hw/char/serial: Replace commented DPRINTF() by trace event
> > >   hw/char/serial: Remove old DEBUG_SERIAL commented code
> > >   hw/char/serial: Let SerialState have an 'id' field
> > >   hw/char/serial: Use the Clock API to feed the UART reference clock
> > >
> > >  include/hw/char/serial.h |  4 +++
> > >  hw/char/serial.c         | 55 +++++++++++++++++++++++-----------------
> > >  hw/char/trace-events     |  5 ++--
> > >  3 files changed, 39 insertions(+), 25 deletions(-)
> > >
> >
> > ping? Should I resend with the typo from patch 4 fixed?
>
> Which tree are you expecting the patches to go in via ?
>

I cc'ed you because having reviewed the Clock API series you are familiar
with it.
However I expect this series to be merged by the chardev maintainers.
In particular to verify the default values (when no input clock provided).


> thanks
> -- PMM
>
>

[-- Attachment #2: Type: text/html, Size: 2415 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-26  9:52     ` Philippe Mathieu-Daudé
@ 2020-09-01 16:54       ` Marc-André Lureau
  0 siblings, 0 replies; 15+ messages in thread
From: Marc-André Lureau @ 2020-09-01 16:54 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Damien Hedde, Peter Maydell, Paolo Bonzini, QEMU Developers,
	Michael S. Tsirkin

[-- Attachment #1: Type: text/plain, Size: 1688 bytes --]

Hi

On Wed, Aug 26, 2020 at 1:52 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:

> Hi Peter,
>
> Le lun. 24 août 2020 17:20, Peter Maydell <peter.maydell@linaro.org> a
> écrit :
>
>> On Sat, 22 Aug 2020 at 21:00, Philippe Mathieu-Daudé <f4bug@amsat.org>
>> wrote:
>> >
>> > On 8/6/20 3:03 PM, Philippe Mathieu-Daudé wrote:
>> > > This series improve tracing of multiple UART device in the same
>> > > chipset, and allow to use the Clock API to feed each device with
>> > > an (updatable) input clock.
>> > >
>> > > Based-on: <20200730165900.7030-1-philmd@redhat.com>
>> > > "hw/char: Remove TYPE_SERIAL_IO"
>> > >
>> > > Philippe Mathieu-Daudé (4):
>> > >   hw/char/serial: Replace commented DPRINTF() by trace event
>> > >   hw/char/serial: Remove old DEBUG_SERIAL commented code
>> > >   hw/char/serial: Let SerialState have an 'id' field
>> > >   hw/char/serial: Use the Clock API to feed the UART reference clock
>> > >
>> > >  include/hw/char/serial.h |  4 +++
>> > >  hw/char/serial.c         | 55
>> +++++++++++++++++++++++-----------------
>> > >  hw/char/trace-events     |  5 ++--
>> > >  3 files changed, 39 insertions(+), 25 deletions(-)
>> > >
>> >
>> > ping? Should I resend with the typo from patch 4 fixed?
>>
>> Which tree are you expecting the patches to go in via ?
>>
>
> I cc'ed you because having reviewed the Clock API series you are familiar
> with it.
> However I expect this series to be merged by the chardev maintainers.
> In particular to verify the default values (when no input clock provided).
>

Sorry, I am not of much help here. (other than it looks reasonable to me)


-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 2799 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2020-08-22 20:00 ` [PATCH-for-5.2 0/4] " Philippe Mathieu-Daudé
@ 2020-09-01 17:02 ` Paolo Bonzini
  2020-09-02 10:41   ` Philippe Mathieu-Daudé
  5 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2020-09-01 17:02 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Damien Hedde, Peter Maydell, Marc-André Lureau, Michael S. Tsirkin

On 06/08/20 15:03, Philippe Mathieu-Daudé wrote:
> This series improve tracing of multiple UART device in the same
> chipset, and allow to use the Clock API to feed each device with
> an (updatable) input clock.
> 
> Based-on: <20200730165900.7030-1-philmd@redhat.com>
> "hw/char: Remove TYPE_SERIAL_IO"
> 
> Philippe Mathieu-Daudé (4):
>   hw/char/serial: Replace commented DPRINTF() by trace event
>   hw/char/serial: Remove old DEBUG_SERIAL commented code
>   hw/char/serial: Let SerialState have an 'id' field
>   hw/char/serial: Use the Clock API to feed the UART reference clock
> 
>  include/hw/char/serial.h |  4 +++
>  hw/char/serial.c         | 55 +++++++++++++++++++++++-----------------
>  hw/char/trace-events     |  5 ++--
>  3 files changed, 39 insertions(+), 25 deletions(-)
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Are you planning to deprecate the baudbase property, and instead setting
up the clock already in serial_mm_init?

Thanks,

Paolo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock
  2020-09-01 17:02 ` Paolo Bonzini
@ 2020-09-02 10:41   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-02 10:41 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel
  Cc: Damien Hedde, Peter Maydell, Michael S. Tsirkin, Marc-André Lureau

On 9/1/20 7:02 PM, Paolo Bonzini wrote:
> On 06/08/20 15:03, Philippe Mathieu-Daudé wrote:
>> This series improve tracing of multiple UART device in the same
>> chipset, and allow to use the Clock API to feed each device with
>> an (updatable) input clock.
>>
>> Based-on: <20200730165900.7030-1-philmd@redhat.com>
>> "hw/char: Remove TYPE_SERIAL_IO"
>>
>> Philippe Mathieu-Daudé (4):
>>   hw/char/serial: Replace commented DPRINTF() by trace event
>>   hw/char/serial: Remove old DEBUG_SERIAL commented code
>>   hw/char/serial: Let SerialState have an 'id' field
>>   hw/char/serial: Use the Clock API to feed the UART reference clock
>>
>>  include/hw/char/serial.h |  4 +++
>>  hw/char/serial.c         | 55 +++++++++++++++++++++++-----------------
>>  hw/char/trace-events     |  5 ++--
>>  3 files changed, 39 insertions(+), 25 deletions(-)
>>
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Are you planning to deprecate the baudbase property, and instead setting
> up the clock already in serial_mm_init?

I'd love to get there, but unfortunately most of serial_mm_init() have
the baudrate/frequency argument wrong, because it has never been very
clear it was the uart input clock, so most users sets the default
baudrate expected by their guest.

Maybe a sane way to get this slowly fixed is to add a new
serial_mm_init2() documenting it expects an input clock rate
argument (or even better, a connected clock), use it where possible,
deprecate serial_mm_init(), let the maintainer eventually adapt...

I'm not comfortable adding yet another deprecation that will stay
during years.

> 
> Thanks,
> 
> Paolo
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-09-02 10:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 13:03 [PATCH-for-5.2 0/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
2020-08-06 13:03 ` [PATCH-for-5.2 1/4] hw/char/serial: Replace commented DPRINTF() by trace event Philippe Mathieu-Daudé
2020-08-12 17:41   ` Richard Henderson
2020-08-06 13:03 ` [PATCH-for-5.2 2/4] hw/char/serial: Remove old DEBUG_SERIAL commented code Philippe Mathieu-Daudé
2020-08-12 17:42   ` Richard Henderson
2020-08-06 13:03 ` [PATCH-for-5.2 3/4] hw/char/serial: Let SerialState have an 'id' field Philippe Mathieu-Daudé
2020-08-12 17:43   ` Richard Henderson
2020-08-06 13:03 ` [PATCH-for-5.2 4/4] hw/char/serial: Use the Clock API to feed the UART reference clock Philippe Mathieu-Daudé
2020-08-12 17:46   ` Richard Henderson
2020-08-22 20:00 ` [PATCH-for-5.2 0/4] " Philippe Mathieu-Daudé
2020-08-24 15:19   ` Peter Maydell
2020-08-26  9:52     ` Philippe Mathieu-Daudé
2020-09-01 16:54       ` Marc-André Lureau
2020-09-01 17:02 ` Paolo Bonzini
2020-09-02 10:41   ` Philippe Mathieu-Daudé

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.