mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: "Andreas Hindborg" <a.hindborg@kernel.org>,
	jaemyung.lee@samsung.com, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	 linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	 linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH RFC] drivers/rufs: add Rust UFS host controller driver
Date: Sun, 13 Sep 2026 14:09:47 +0200	[thread overview]
Message-ID: <01d56517261d397f5e17101f03554f91529e23f0.camel@iokpp.de> (raw)
In-Reply-To: <87jyoqvhpm.fsf@kernel.org>

On Sat, 2026-09-12 at 13:20 +0200, Andreas Hindborg wrote:
> > 
> > You still use scsi everywhere in your implementation protocol/scsi.rs builds
> > READ_10/16, WRITE_10/16, SYNCHRONIZE_CACHE and UNMAP CDB, so "decouple UFS
> > from
> > SCSI" really means "copy a small part of sd and the SCSI error handling into
> > a
> > UFS driver." while JEDEC defines the UFS application layer as SCSI, the SCSI
> > work doesn't go away, you just move somewhere else, and it has to be written
> > again.
> 
> See my response to Greg. The SCSI specific code in this driver is very
> minimal.
> 

Let me reply this in your another email,

> > 
> > The "friction" claim is weak. SCSI has already been changed to fit UFS. Two
> > examples: UFS now uses SCSI simple copy, group number in scsi write command.
> > 
> > I doubt how far this can go. do we really need to pay effort for a new RUST
> > UFS
> > driver, I am not very confident, unless SCSI is removed from the UFS spec
> > and
> > JEDEC defines native UFS commands, or we talk to the device directly with
> > UPIU.
> > please name the JEDEC feature that the SCSI midlayer really blocked, or that
> > was
> > historial issue which has been fixed.
> 
> I am sure the UFS experts will be able to answer this better than me.
> 


this is the main reason in your cover letter for leaving SCSI. I think the
authors should name the feature, because without a real example it is hard to
see why the SCSI work should be done again in a new driver.


> > I would also like to see the heavy and hard parts, because they are the
> > parts
> > that decide if this design worrks:
> > 
> > 1, error handling: abort, LU reset, retries with limits, sense decoding,
> > this is
> > the very hard part of UFS driver.
> 
> I agree. However, we decided to get the discussion going with a smaller
> feature set. We can build an efficient feature complete driver, but we
> would really like to talk to the community about it first.
> 

I understand you want to start small. But error handling is not only a missing
feature. It decides the design. Things like getting a free tag for a device
command while I/O is stuck, abort, LU reset, and what happens when recovery
fails, are the parts the SCSI midlayer gives us today. In this RFC, when
recovery fails the queue stays quiesced and I/O hangs forever. So I would like
to see at least a design for this before we discuss the rest.

> > 2, user-space tools interface: SG_IO and bsg (sg3_utils, ufs-utils, FFU with
> > WRITE BUFFER), and the UFS sysfs tree..
> 
> On the account of this not being a scsi driver, some changes would have
> to be made. But we should be able support
> /sys/bus/platform/drivers/ufshcd/* just fine.
> 

the host attributes in sysfs are only a small part. The per-LU attributes are
documented under /sys/class/scsi_device//device/unit_descriptor/, and ufs-bsg is
named after the SCSI host number. More important, FFU with WRITE BUFFER, RPMB
with SECURITY PROTOCOL, and vendor tools all use SG_IO through  /dev/sg. These
are user-space interfaces people use in products today, so "some changes" here
means breaking them. How do you plan to keep them working? Also, the sysfs path
contains "ufshcd", while RUFS registers as "rufs".


> > Did any AI tool help write this code? If so, please add the Assisted-by:
> > tag.
> 
> We use AI for code review and spell checking, so I guess the tag is warranted.
> 

Thanks for agreeing to add the Assisted-by tag.

Kind regards,
Beamn

  reply	other threads:[~2026-09-13 12:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 15:52 Jaemyung Lee via B4 Relay
2026-09-11 16:18 ` Andreas Hindborg
2026-09-11 19:03 ` Bart Van Assche
2026-09-12 11:33   ` Andreas Hindborg
2026-09-11 20:27 ` Greg KH
2026-09-12 11:00   ` Andreas Hindborg
2026-09-12 12:10     ` James Bottomley
2026-09-12 12:48       ` Andreas Hindborg
2026-09-12 13:37         ` Bart Van Assche
2026-09-12 13:55         ` James Bottomley
2026-09-12 15:45           ` Andreas Hindborg
2026-09-13  0:30             ` Bart Van Assche
2026-09-14 20:27               ` Bart Van Assche
2026-09-16 16:15                 ` Jaemyung Lee
2026-09-14 10:02             ` Johannes Thumshirn
2026-09-13 12:23     ` Bean Huo
2026-09-13 13:44       ` Andreas Hindborg
2026-09-16 16:28   ` Jaemyung Lee
2026-09-11 21:44 ` Bean Huo
2026-09-12 11:20   ` Andreas Hindborg
2026-09-13 12:09     ` Bean Huo [this message]
2026-09-13 13:10       ` Andreas Hindborg
2026-09-16 16:21         ` Bart Van Assche
2026-09-16 17:46           ` Andreas Hindborg
2026-09-16 16:46   ` Jaemyung Lee

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=01d56517261d397f5e17101f03554f91529e23f0.camel@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=jaemyung.lee@samsung.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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®