[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 64/74] i2c: pm_smbus: Make the I2C block read command
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 64/74] i2c: pm_smbus: Make the I2C block read command read-only |
Date: |
Tue, 21 Aug 2018 19:02:36 +0200 |
From: Corey Minyard <address@hidden>
It did have write capability, but the manual says the behavior
with write enabled is undefined. So just set an error in this
case.
Signed-off-by: Corey Minyard <address@hidden>
Cc: Michael S. Tsirkin <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i2c/pm_smbus.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c
index f1fe889..dc61f2c 100644
--- a/hw/i2c/pm_smbus.c
+++ b/hw/i2c/pm_smbus.c
@@ -55,7 +55,7 @@
#define PROT_WORD_DATA 3
#define PROT_PROC_CALL 4
#define PROT_BLOCK_DATA 5
-#define PROT_I2C_BLOCK_DATA 6
+#define PROT_I2C_BLOCK_READ 6
/*#define DEBUG*/
@@ -115,7 +115,7 @@ static void smb_transaction(PMSMBus *s)
goto done;
}
break;
- case PROT_I2C_BLOCK_DATA:
+ case PROT_I2C_BLOCK_READ:
if (read) {
int xfersize = s->smb_data0;
if (xfersize > sizeof(s->smb_data)) {
@@ -125,9 +125,8 @@ static void smb_transaction(PMSMBus *s)
xfersize, false, true);
goto data8;
} else {
- ret = smbus_write_block(bus, addr, cmd, s->smb_data, s->smb_data0,
- false);
- goto done;
+ /* The manual says the behavior is undefined, just set DEV_ERR. */
+ goto error;
}
break;
default:
--
1.8.3.1
- [Qemu-devel] [PULL 73/74] char-socket: update all ioc handlers when changing context, (continued)
- [Qemu-devel] [PULL 73/74] char-socket: update all ioc handlers when changing context, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 60/74] pc: drop memory region alignment check for 0, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 71/74] Revert "chardev: tcp: postpone TLS work until machine done", Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 59/74] util/oslib-win32: indicate alignment for qemu_anon_ram_alloc(), Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 58/74] pc-dimm: assign and verify the "slot" property during pre_plug, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 72/74] Revert "chardev: tcp: postpone async connection setup", Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 74/74] test-char: add socket reconnect test, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 57/74] ipmi: Use proper struct reference for BT vmstate, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 67/74] i2c: pm_smbus: Don't delay host status register busy bit when interrupts are enabled, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 68/74] i2c: pm_smbus: Add the ability to force block transfer enable, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 64/74] i2c: pm_smbus: Make the I2C block read command read-only,
Paolo Bonzini <=
- [Qemu-devel] [PULL 63/74] i2c: pm_smbus: Fix the semantics of block I2C transfers, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 62/74] i2c: pm_smbus: Clean up some style issues, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 66/74] i2c: pm_smbus: Add interrupt handling, Paolo Bonzini, 2018/08/21
- [Qemu-devel] [PULL 65/74] i2c: pm_smbus: Add block transfer capability, Paolo Bonzini, 2018/08/21
- Re: [Qemu-devel] [PULL 00/74] Misc patches for 2018-08-21, Peter Maydell, 2018/08/23