@@ -787,11 +787,13 @@ static bool ot_spi_device_is_hw_read_command(const OtSPIDeviceState *s)
787787 }
788788}
789789
790- static void ot_spi_device_release_cs (OtSPIDeviceState * s )
790+ static void ot_spi_device_release (OtSPIDeviceState * s )
791791{
792792 SpiDeviceFlash * f = & s -> flash ;
793793 SpiDeviceBus * bus = & s -> bus ;
794794
795+ trace_ot_spi_device_release ();
796+
795797 BUS_CHANGE_STATE (bus , IDLE );
796798 bus -> byte_count = 0 ;
797799
@@ -1988,7 +1990,7 @@ static void ot_spi_device_chr_receive(void *opaque, const uint8_t *buf,
19881990
19891991 if (!bus -> byte_count ) {
19901992 if (bus -> release ) {
1991- ot_spi_device_release_cs (s );
1993+ ot_spi_device_release (s );
19921994 } else {
19931995 BUS_CHANGE_STATE (bus , IDLE );
19941996 }
@@ -2008,11 +2010,11 @@ static void ot_spi_device_chr_event_hander(void *opaque, QEMUChrEvent event)
20082010 return ;
20092011 }
20102012
2011- ot_spi_device_release_cs (s );
2013+ ot_spi_device_release (s );
20122014 }
20132015
20142016 if (event == CHR_EVENT_CLOSED ) {
2015- ot_spi_device_release_cs (s );
2017+ ot_spi_device_release (s );
20162018 }
20172019}
20182020
@@ -2041,7 +2043,7 @@ static int ot_spi_device_chr_be_change(void *opaque)
20412043
20422044 fifo8_reset (& bus -> chr_fifo );
20432045
2044- ot_spi_device_release_cs (s );
2046+ ot_spi_device_release (s );
20452047
20462048 if (s -> watch_tag > 0 ) {
20472049 g_source_remove (s -> watch_tag );
@@ -2098,7 +2100,7 @@ static void ot_spi_device_reset(DeviceState *dev)
20982100 fifo8_reset (& f -> cmd_fifo );
20992101 ot_fifo32_reset (& f -> address_fifo );
21002102
2101- ot_spi_device_release_cs (s );
2103+ ot_spi_device_release (s );
21022104 f -> watermark = false;
21032105 f -> new_cmd = false;
21042106 s -> spi_regs [R_CONTROL ] = 0x10u ;
0 commit comments