From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3BCEC433FE for ; Mon, 28 Nov 2022 13:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbiK1NnK (ORCPT ); Mon, 28 Nov 2022 08:43:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232013AbiK1Nm6 (ORCPT ); Mon, 28 Nov 2022 08:42:58 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B6B61131; Mon, 28 Nov 2022 05:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=sMuw+r8XztM/y1RLcfVFDrwbd0bUxp2HwDoeUHaaJ4I=; b=lHZ+um/dRDTPKX/QYmMSYhCILO +GZexIJXLRc2Pr3g4cE8ujWFp4NxKn/r9Y7SgCSO83epSVKZ+ZZWHROK+QcolC1ktkUAtH/d/oqOQ SUsNwiP3KhKEUd/4s0YH6i1eA3hYmXW3anOJ6anakRqdk6WhZuIymun513EEeBd30e6g=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ozeOw-003emo-2x; Mon, 28 Nov 2022 14:42:26 +0100 Date: Mon, 28 Nov 2022 14:42:26 +0100 From: Andrew Lunn To: Vincent MAILHOL Cc: Alan Stern , linux-can@vger.kernel.org, Marc Kleine-Budde , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Saeed Mahameed , Jiri Pirko , Lukas Magel Subject: Re: [PATCH v4 2/6] can: etas_es58x: add devlink support Message-ID: References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-1-mailhol.vincent@wanadoo.fr> <20221126162211.93322-3-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-can@vger.kernel.org > > 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