[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4S6wnM33Vs56vr5@lunn.ch>
Date: Mon, 28 Nov 2022 14:42:26 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Vincent MAILHOL <mailhol.vincent@...adoo.fr>
Cc: Alan Stern <stern@...land.harvard.edu>, linux-can@...r.kernel.org,
Marc Kleine-Budde <mkl@...gutronix.de>,
linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
netdev@...r.kernel.org, linux-usb@...r.kernel.org,
Saeed Mahameed <saeed@...nel.org>,
Jiri Pirko <jiri@...dia.com>,
Lukas Magel <lukas.magel@...teo.net>
Subject: Re: [PATCH v4 2/6] can: etas_es58x: add devlink support
> > But if a driver does make the call, it should be careful to ensure that
> > the call happens _after_ the driver is finished using the interface-data
> > pointer. For example, after all outstanding URBs have completed, if the
> > completion handlers will need to call usb_get_intfdata().
>
> ACK. I understand that it should be called *after* the completion of
> any ongoing task.
What sometimes gets people is /sys, /proc. etc. A process can have
such a file open when the device is unplugged. If the read needs to
make use of your private data structure, you need to guarantee it
still exists. Ideally the core needs to wait and not call the
disconnect until all such files are closed. Probably the USB core
does, it is such an obvious issue, but i have no knowledge of USB.
Andrew
Powered by blists - more mailing lists