public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	"kbusch@kernel.org" <kbusch@kernel.org>
Subject: Re: [PATCH] nvme: add ctrl state machine pdf creator
Date: Thu, 28 Jul 2022 23:07:43 +0000	[thread overview]
Message-ID: <23d45b37-b02c-66bd-98f7-c8af10a1a458@nvidia.com> (raw)
In-Reply-To: <20220728184022.GB22439@lst.de>

On 7/28/22 11:40, Christoph Hellwig wrote:
> On Wed, Jul 27, 2022 at 02:54:24PM -0700, Chaitanya Kulkarni wrote:
>> It is not always easy to read the NVMe Host controller state machine
>> quickly written in C when debugging the code for various transports.
>>
>> This adds a simple dot based state machine for the host controller that
>> creates pdf. The resulting pdf is easier to understand and process.
> 
> So, the graph looks pretty, but I'm a little worried that having a
> separate copy of the transitions somewhere out in Documentation/
> just means it will become out of date very quickly.  Can we instead
> come up with macros that allow to both generate the code and the
> visualization?
> 

I'll make sure to update the graph when reviewing the new branch.

I did thought of adding the documentation in in the
drivers/nvme/host/ctrl-state-machine, but found it odd to have it in the
nvme/host.

> e.g.
> 
> 	switch (new_state) {
> 	FROM_STATE(NVME_CTRL_LIVE);
> 		TO_STATE(NVME_CTRL_NEW);
> 		TO_STATE(NVME_CTRL_RESETTING);
> 		TO_STATE(NVME_CTRL_CONNECTING);
> 		END_STATE();
> 	..
> 

I fail to understand the part that links the C code from host/core.c to
the pdf in the graph, can you please explain more on this ?

I was trying to avoid new code changes and add more macros for the
documentation purpose, let me see if I can do come up with something
with minimal complexity.

-ck



      reply	other threads:[~2022-07-28 23:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 21:54 [PATCH] nvme: add ctrl state machine pdf creator Chaitanya Kulkarni
2022-07-28 18:40 ` Christoph Hellwig
2022-07-28 23:07   ` Chaitanya Kulkarni [this message]

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=23d45b37-b02c-66bd-98f7-c8af10a1a458@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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