Re: [PATCH] USB: legousbtower: use stream_open for stream semantics
From: mdshahid03
Date: Wed Nov 11 2026 - 08:20:55 EST
Hi Greg,
I did basic sanity ,I build driver and ran smatch after changes.
I don't have Lego USB HW to test it ,but there is similar changes
in Xyllibus ,that was sent by me and Eli(maintainer)has tested in HW.
According to Eli ,There is no regressions with stream_open().
Here is discussion:
https://lore.kernel.org/all/24af6daf-dbf3-5c47-beb7-077c4473ea7e@xxxxxxxxxxxxxxxxxx/
Thanks
Shahid.
On 2026-11-10 13:21 -0500, Greg KH wrote:
> On Tue, Nov 10, 2026 at 11:01:36PM +0530, mdshahid03@xxxxxxxxx wrote:
> > Hi,
> >
> > Could you please review patch and give your feedback,when time permits.
> >
> > Thanks
> > Shahid.
> >
> > On 2026-10-28 23:58 +0530, mdshahid03@xxxxxxxxx wrote:
> > > From: Mohammad Shahid <mdshahid03@xxxxxxxxx>
> > >
> > > The LEGO USB Tower driver uses nonseekable_open() in tower_open()
> > > However, its read and write have stream semantics.
> > >
> > > Use stream_open instead to mark the file as a stream and disable
> > > unnecessary file position handling.
> > >
> > > The issue is reported by stream_open.cocci script as potential
> > > deadlock between read and write operation.
> > >
> > > Signed-off-by: Mohammad Shahid <mdshahid03@xxxxxxxxx>
> > > ---
> > > drivers/usb/misc/legousbtower.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> How was this tested?
>
>