Re: [PATCH RFC] drivers/rufs: add Rust UFS host controller driver
From: Andreas Hindborg
Date: Sat Sep 12 2026 - 07:01:07 EST
"Greg KH" <gregkh@xxxxxxxxxxxxxxxxxxx> writes:
> On Sat, Sep 12, 2026 at 12:52:55AM +0900, Jaemyung Lee via B4 Relay wrote:
>> Comments on the decision to bypass the SCSI midlayer, the blk-mq model used
>> in its place, and the proposed prerequisite API boundaries would be
>> especially welcome.
>
> Many many years ago, the USB subsystem tried to bypass the SCSI midlayer
> for its storage driver, and while it was a "quick solution" at the time,
> in the end, it didn't work out and we dropped the driver as it just made
> no sense to keep duplicating all of the logic all the time.
>
> So I wouldn't recommend it, as long as UFS builds on top of the SCSI
> commands and the like, you should not attempt to duplicate it in a
> separate driver, no matter how much "simpler" it initially seems to be.
The scsi related code in this driver is less than 300 lines and is
mostly struct packing/unpacking. I guess we could lift the struct
definitions from the scsi layer via bindgen. But at 280 lines I am not
sure it is worth it, and it hardly counts as duplication.
The ufshci driver is duplicated by this driver. Our suggestion is
replacing it.
> But really:
>
>> 30 files changed, 10005 insertions(+)
>
> 30 files and 10000 lines doesn't seem that simple :)
You can take a look and decide for yourself :) To each his own I guess.
To me, reading this ufshci driver is much easier than reading the C
ufshci driver along with the scsi subsystem.
Best regards,
Andreas Hindborg