On Wed, Sep 01, 2021 at 11:52:31AM +0530, Viresh Kumar wrote:
On 31-08-21, 20:03, Michael S. Tsirkin wrote:
But if you are doing it like this, then I think we should have conformance clauses that require that the flag is consistent with the buffer.
Something like this will work ?
diff --git a/virtio-i2c.tex b/virtio-i2c.tex index ae344b2bc822..c7335372a8bb 100644 --- a/virtio-i2c.tex +++ b/virtio-i2c.tex @@ -145,6 +145,12 @@ \subsubsection{Device Operation: Operation Status}\label{sec:Device Types / I2C A driver MUST NOT use \field{buf}, for a read request, if the final \field{status} returned from the device is VIRTIO_I2C_MSG_ERR.
+A driver MUST set the \field{VIRTIO_I2C_FLAGS_M_RD} flag for a read operation, +where the buffer is write-only for the device.
+A driver MUST NOT set the \field{VIRTIO_I2C_FLAGS_M_RD} flag for a write +operation, where the buffer is read-only for the device.
A driver MUST queue the requests in order if multiple requests are going to be sent at a time.
-- viresh
Something like this, yes.