mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haixu Cui <quic_haixcui@quicinc.com>
To: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>,
	<broonie@kernel.org>, <virtio-dev@lists.oasis-open.org>,
	<viresh.kumar@linaro.org>, <linux-spi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <hdanton@sina.com>,
	<qiang4.zhang@linux.intel.com>, <alex.bennee@linaro.org>
Cc: <quic_ztu@quicinc.com>
Subject: Re: [RFC PATCH v4 3/3] SPI: Add virtio SPI driver
Date: Fri, 25 Apr 2025 11:45:44 +0800	[thread overview]
Message-ID: <b5a6a9d6-50da-4ab9-878d-d4dbad270f22@quicinc.com> (raw)
In-Reply-To: <74698d99-db5b-4ec7-a965-eea2a29e54b1@quicinc.com>

Hi Mukesh,

Thank you for your detailed review and valuable feedback.
I have carefully considered your comments and would like to
address them as follows:


> Could you please help add exact function description which can help 
> understand below details with some background/purpose ?
> 

Different delay parameters impact various phases of SPI transfers,
governing the assertion/deassertion of the CS and the timing intervals
between adjacent words in a single transfer or between consecutive
transfers.

Some delays are inherent device attributes, such as word_delay and
cs_setup in the spi_device structure, while others are specified
per-transfer via fields in the spi_transfer structure, such as
cs_change_delay and delay.

Although virtio SPI cannot directly configure transfer-stage delays by
manipulating hardware registers or precisely control CS signal behavior,
it can indirectly achieve fine-grained transfer control by passing
parameters like cs_delay_hold_ns and cs_setup_ns in the
spi_transfer_head structure to the host.

Function virtio_spi_set_delays is designed to implement this feature,
and will add description like:

/*
  * virtio_spi_set_delays - Set delay parameters for SPI transfer
  *
  * This function sets various delay parameters for SPI transfer,
  * including delay after CS asserted, timing intervals between
  * adjacent words within a transfer, delay before abdafter CS
  * deasserted. It converts these delay parameters to nanoseconds using
  * spi_delay_to_ns and stores the results in spi_transfer_head
  * structure.
  * If the conversion fails, the function logs a warning message and
  * returns an error code.
  */

Could you please review this comment and let me know if it's clear
and easy to understand? Your feedback will be greatly appreciated.



>> + * E => struct spi_device -> cs_inactive
>> + * F => struct spi_transfer -> cs_change_delay

> Alignment of single line arrow  -> .

Alignment is now consistent with "=>", could you please confirm if it 
also needs to be aligned with "->"?



>> + *
>> + * So the corresponding relationship:
>> + * A <===> cs_setup_ns (after CS asserted)
>> + * B <===> word_delay_ns (no matter with CS)
> what does it mean when you say "no matter with CS" ? Any other 
> simplified statement ?
> Delay from sending actual data /Clock generation ?

"no matter with CS" means this delay is not related to CS actually.
B is the timing interval between 2 words, during which the CS remains 
asserted.

I agree this description is unclear, just update as:

B <===> word_delay_ns (delay between adjacent words within a transfer)

>> + * C+D <===> cs_delay_hold_ns (before CS deasserted)
>> + * E+F <===> cs_change_delay_inactive_ns (after CS deasserted, these two
>> + * values are also recommended in the Linux driver to be added up)
> Alignment of all double dashed line arrows <===> to left side symbols .

OK, will update to be aligned with "<===>".


>> +    err = virtio_spi_find_vqs(priv);
>> +    if (err) {
>> +        dev_err(&vdev->dev, "Cannot setup virtqueues\n");
>> +        return err;
> Use dev_err_probe()
>> +    }

Yes, will update as:

dev_err_probe(&vdev->dev, err, "Cannot setup virtqueues\n");


Thanks & BR
Haixu Cui

  parent reply	other threads:[~2025-04-25  3:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  3:36 [RFC PATCH v4 0/3] Virtio SPI Linux driver Haixu Cui
2025-04-01  3:36 ` [RFC PATCH v4 1/3] virtio: Add ID for virtio SPI Haixu Cui
2025-04-01  3:36 ` [RFC PATCH v4 2/3] virtio-spi: Add virtio-spi.h Haixu Cui
2025-04-22  6:03   ` Mukesh Kumar Savaliya
2025-04-25  8:24     ` Haixu Cui
2025-08-11 13:50       ` Andy Shevchenko
2025-08-11 13:49     ` Andy Shevchenko
2025-08-08 13:26   ` Jyothi Kumar Seerapu
2025-08-11 13:25     ` Haixu Cui
2025-08-11 13:52   ` Andy Shevchenko
2025-04-01  3:36 ` [RFC PATCH v4 3/3] SPI: Add virtio SPI driver Haixu Cui
2025-04-22  6:03   ` Mukesh Kumar Savaliya
2025-04-22 14:19     ` Mark Brown
2025-04-22 14:27       ` Mukesh Kumar Savaliya
2025-04-25  3:45     ` Haixu Cui [this message]
2025-08-11 14:12   ` Andy Shevchenko
2025-04-22  3:14 ` [RFC PATCH v4 0/3] Virtio SPI Linux driver Haixu Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5a6a9d6-50da-4ab9-878d-d4dbad270f22@quicinc.com \
    --to=quic_haixcui@quicinc.com \
    --cc=alex.bennee@linaro.org \
    --cc=broonie@kernel.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=qiang4.zhang@linux.intel.com \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_ztu@quicinc.com \
    --cc=viresh.kumar@linaro.org \
    --cc=virtio-dev@lists.oasis-open.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®