Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp323352pxf; Wed, 31 Mar 2021 04:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6RFSPI7EDYE1uK4loMttoE1/nKy7U95ZkAAt7tBdE6rT1BxCtG7BwwOH5uyy+/mNDrcAi X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr3133912edd.212.1617189840414; Wed, 31 Mar 2021 04:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617189840; cv=none; d=google.com; s=arc-20160816; b=LeVmqIUVIHbGzchaqa/IiyDSI25BPe5ASppEv9FObQNqu5lVcHorMk1kMKKN9XX2rG Rn0ut9r7M1cBr24+hu8igdXCBR+/2CKZp+JXozDAifpjimeSauD9yh5yEV/Fd2nkyvVo Zrk0VrY4AhIE9g8agtS9woyIHQQ14wYVJulgll3ACk3hOpVRLcz1fydx0eXQe1sCplnP rMwFCmxYT9bBDQ2rlS6gVwvH+74EbryXthreQx0x3bLPy8Z0uv83Niy2YUDxi697BAHj JS9ZVcgsHbWkC56taegiLdwXY+yKBv2wUUuWP8spDsFbaJbfI3MJuEv9rFgExizA3CAU cJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=39XoeDEplwa/5PkTULUglEu1oSuZT22FUmjlzm+45WU=; b=KAv1alOD0qCPYa+K288Q4hQKiWwZReWfvJsAuY9htWPe4eUpX55zUkqIrPwk5YVikf /qW7s73zS/12VInCclgH4Qhom63/rK7mps33iKKLuZ2nr/vHBO50AGVmZK00cvWJyfea F/l0ABBI0eCB+5hCeWobF3Am5mYacMIeTYX3qsKdB0xQIX8sSbZJA2Zm9AQ8WQZyr5XC 9OKBPm9RR8UXt4KJsp5Xcfsecuf+JtoJ4gFOoE0Fie1NXDmSNfwIRg3mCvZTqfdB/qCm eIpo/E/qa80twg3FMMAnUW4Zdfn9PbBWKBlh/IjMwH+1LmjK/lSLq93FBSNsdhBrV1B+ hs6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="M6/UORqX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s6si1381695ejq.79.2021.03.31.04.23.36; Wed, 31 Mar 2021 04:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="M6/UORqX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235142AbhCaLVm (ORCPT + 99 others); Wed, 31 Mar 2021 07:21:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:58142 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235119AbhCaLVS (ORCPT ); Wed, 31 Mar 2021 07:21:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1617189676; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=39XoeDEplwa/5PkTULUglEu1oSuZT22FUmjlzm+45WU=; b=M6/UORqXeOXOVirLPHlg+BBgq0NG/TVrfYCtoYjPAFwblXKbMtP8Agy8Zwn2SJPM12ZkqO lKoSuOrsrV3/rHdH6C4GL5JhdI3Lpmop+UnI2FrDUSnk2+qLTMXMSjn+JJIC6UjEYApej+ 91QsfE7gzmNKcNbaKtKuhocO5lbyyfU= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B3F73B1D1; Wed, 31 Mar 2021 11:21:16 +0000 (UTC) Message-ID: <3ae68552f3c689c23cbf2573772239c00e2c94be.camel@suse.com> Subject: Re: [PATCH 3/4] USB: serial: add support for multi-interface functions From: Oliver Neukum To: Johan Hovold Cc: Mauro Carvalho Chehab , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 31 Mar 2021 13:21:15 +0200 In-Reply-To: References: <20210330143820.9103-1-johan@kernel.org> <20210330143820.9103-4-johan@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 31.03.2021, 09:08 +0200 schrieb Oliver Neukum: > Am Dienstag, den 30.03.2021, 17:22 +0200 schrieb Johan Hovold: > > On Tue, Mar 30, 2021 at 04:44:32PM +0200, Oliver Neukum wrote: > > > Am Dienstag, den 30.03.2021, 16:38 +0200 schrieb Johan Hovold: > > > > @@ -1115,6 +1161,8 @@ static void usb_serial_disconnect(struct usb_interface *interface) > > > > if (serial->type->disconnect) > > > > serial->type->disconnect(serial); > > > > > > > > + release_sibling(serial, interface); > > > > + > > > > /* let the last holder of this object cause it to be cleaned up */ > > > > usb_serial_put(serial); > > > > dev_info(dev, "device disconnected\n"); > > > > > > Hi, > > > > > > does this assume you are called for the original interface first? > > > > No, I handle either interface being unbound first (e.g. see > > release_sibling()). > > > > > I am afraid that is an assumption you cannot make. In fact, if somebody > > > is doing odd things with sysfs you cannot even assume both will see a > > > disconnect() > > > > Right, but disconnect() will still be called also for the sibling > > interface as part of release_sibling() above. > > OK, sorry I overlooked that. Hi, on the third hand, the more I look at this, would you mind putting sibling_release() with a modified name into usbcore? This functionality is not limited to serial drivers. btusb needs it; cdc-acm needs it; usbaudio neds it. We have code duplication. Regards Oliver