[virtio-dev] Re: [virtio-comment] [PATCH] [PATCH v5] virtio-spi: add the device specification

Haixu Cui <[email protected]>
Newsgroups dev.linux.lists.virtio-dev,dev.linux.lists.virtio-comment
Message-ID <[email protected]>
Hi Huck,

On 11/29/2023 8:42 PM, Cornelia Huck wrote:
> On Wed, Nov 29 2023, Viresh Kumar <[email protected]> wrote:
> 
>> On 29-11-23, 18:31, Haixu Cui wrote:
>>> Hi Viresh,
>>>
>>>      Thank you for your helpful comments. In next patch, I will clearly point
>>> this out:
>>
>> Great, finally we are on the same page. Thanks Haixu.
>>
>>>      "For full-duplex read and write transfer, both \field{tx_buf} and
>>> \field{rx_buf} are used and the buffer size of \field{tx_buf} must be same
>>> as \field{rx_buf}."
>>
>> Suggest rewriting as:
>>
>> In full-duplex transfer mode, both \field{tx_buf} and \field{rx_buf} are sent by
>> the driver, \field{tx_buf} followed by \field{rx_buf}. The length of both the
>> buffers MUST be same.
> 
> Is that in a non-normative section? (Sorry, I've lost track here...) If
> so, I would say:
> 
> "The length of both buffers has to be the same."

This is non-normative section.
> 
>>
>>>      And in drivernormative section, I will add a requirement:
>>>      "For full-duplex transfer, Virtio SPI driver MUST guarantee the write
>>> transfer size is equal to the read transfer size"
>>
>> Maybe:
>>
>> drivernormative:
>>
>> In full-duplex transfer mode, the Virtio SPI driver MUST guarantee that the
>> length of both \field{tx_buf} and \field{rx_buf} are same.
> 
> s/are same/is the same/
> 
>>
>> devicenormative:
>>
>> In full-duplex transfer mode, the Virtio SPI device MUST verify that the length
>> of both \field{tx_buf} and \field{rx_buf} are same. In case of any mismatch, the
> 
> s/are same/is the same/
> 
>> device MUST fail the transfer and notify the driver.
> 
> "notify the driver" == "set an appropriate error value"?
> 
> Can this be covered by one of the existing error values?

I'd like to use VIRTIO_SPI_PARAM_ERR to indicates the buffer size 
inequality issue here because this is in the scope of parameter checking.

Thanks & BR

Haixu Cui

> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.