qemu/hw
Corey Minyard 0fa758c3a0 i2c: Fix SMBus read transactions to avoid double events
Change 2293c27fad (i2c: implement broadcast write) added broadcast
capability to the I2C bus, but it broke SMBus read transactions.
An SMBus read transaction does two i2c_start_transaction() calls
without an intervening i2c_end_transfer() call.  This will
result in i2c_start_transfer() adding the same device to the
current_devs list twice, and then the ->event() for the same
device gets called twice in the second call to i2c_start_transfer(),
resulting in the smbus code getting confused.

Note that this happens even with pure I2C devices when simulating
SMBus over I2C.

This fix only scans the bus if the current set of devices is empty.
This means that the current set of devices stays fixed until
i2c_end_transfer() is called, which is really what you want.

This also deletes the empty check from the top of i2c_end_transfer().
It's unnecessary, and it prevents the broadcast variable from being
set to false at the end of the transaction if no devices were on
the bus.

Cc: KONRAD Frederic <fred.konrad@greensocs.com>
Cc: Alistair Francis <alistair.francis@xilinx.com>
Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Cc: Kwon <hyun.kwon@xilinx.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1470153614-6657-1-git-send-email-minyard@acm.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-24 16:26:55 +01:00
..
9pfs 9pfs: fix memory leak in v9fs_write 2016-10-17 14:13:58 +02:00
acpi acpi: provide _PXM method for CPU devices if QEMU is started numa enabled 2016-10-10 01:16:57 +03:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha sun4uv: fix serial initialization regression 2016-10-24 15:27:20 +02:00
arm ARM: Virt: ACPI: Build an IORT table with RC and ITS nodes 2016-10-24 16:26:54 +01:00
audio pcspk: adding vmstate for save/restore 2016-09-15 15:10:06 +02:00
block virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
bt char: replace avail_connections 2016-10-24 15:46:10 +02:00
char char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
core hw/ptimer: Add "no counter round down" policy 2016-10-24 16:26:52 +01:00
cpu
cris
display virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
dma hw/dma/pl080: Fix bad bit mask (PL080_CONF_M1 | PL080_CONF_M1) 2016-10-17 19:22:17 +01:00
gpio
i2c i2c: Fix SMBus read transactions to avoid double events 2016-10-24 16:26:55 +01:00
i386 * KVM run_on_cpu fix (Alex) 2016-10-24 15:03:09 +01:00
ide Block layer patches 2016-10-04 14:25:08 +01:00
input virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
intc x86 queue, 2016-10-17 2016-10-18 09:29:44 +01:00
ipack
ipmi char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
isa char: remove init callback 2016-10-24 15:27:20 +02:00
lm32
m68k m68k: change default system clock for m5208evb 2016-10-08 11:25:29 +03:00
mem trace: move hw/mem/pc-dimm.c trace points into correct file 2016-09-28 19:17:54 +01:00
microblaze
mips char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
misc char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
moxie
net virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
nvram vl: Switch qemu_uuid to QemuUUID 2016-09-23 11:42:52 +08:00
openrisc
pci
pci-bridge
pci-host
pcmcia
ppc spapr: Improved placement of PCI host bridges in guest memory map 2016-10-16 12:04:15 +11:00
s390x s390x/css: {c,h,t,r,x}sch: require enable AND device number valid 2016-09-28 13:24:51 +02:00
scsi virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
sd vmstateify ssi-sd 2016-09-22 18:13:08 +01:00
sh4
smbios smbios: fix uuid copy 2016-09-29 11:43:22 +08:00
sparc intc: make HMP 'info irq' and 'info pic' commands use InterruptStatsProvider interface 2016-10-04 10:00:25 +02:00
sparc64 sun4uv: fix serial initialization regression 2016-10-24 15:27:20 +02:00
ssi xilinx: fix buffer overflow on realize 2016-10-24 15:27:20 +02:00
timer timer: a9gtimer: remove loop to auto-increment comparator 2016-10-24 16:26:54 +01:00
tpm
tricore
unicore32
usb * KVM run_on_cpu fix (Alex) 2016-10-24 15:03:09 +01:00
vfio vfio: fix duplicate function call 2016-10-17 10:58:03 -06:00
virtio char: use qemu_chr_fe* functions with CharBackend argument 2016-10-24 15:27:21 +02:00
watchdog
xen
xenpv xenpv: Fix qemu_uuid compiling error 2016-09-29 11:43:17 +08:00
xtensa char: remove init callback 2016-10-24 15:27:20 +02:00
Makefile.objs STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00