Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1337563lqp; Mon, 15 Apr 2024 03:33:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJFn+yxucXJh8mL8Q1WMNLdflnZOw5dblKvi2AX7fa39QNxIj35GGVQMa2gW+Ol/bTT5TJKPPUeU5czjcGwxM07M4Zbwf9FUO6cJvMzw== X-Google-Smtp-Source: AGHT+IFk4LmYNTx3feQv40v1bcgDtZm1c7FjTXvmYaJVuIyjF1qVE98Ttc/Jp3dFL0yynDZvTgfo X-Received: by 2002:a92:ca06:0:b0:368:a856:aa20 with SMTP id j6-20020a92ca06000000b00368a856aa20mr12045504ils.20.1713177197711; Mon, 15 Apr 2024 03:33:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713177197; cv=pass; d=google.com; s=arc-20160816; b=vX3Mw0p4HbQWoSemsyrryuxpL9DO5kYRDt9QkfdD4WwIyD71MhRjlvDmy2l8Z3q3RD DhBJZH+8I1+2r8eUe8Bh/eB2NsGhW8/8WZ83lQI1jJr3jJ4dOgBuaff3lEh67bj/xtym nh7t6FL5gFU/DSeQRIHDWt9wqi5F0W64oAiNuD7jYdLuDVJxOklqC5nPenCc1En3pFDU ROwLVKtDluwqQahteRu/FtpRMOBtyRq3X/WpiiJ/ARzrXYzychAR40Gws9nRYQW+5Zpa Buo+5HcOltW+TQpodnVdAtb3fxtnzqKa40gdqtStJlUVLNABDn4b+NppDozcWudRyXzi t73Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0F4QB9MOqdLejUtxSiKHfOfYULfcC4HZ4aVidctBqFI=; fh=ikpCI0KwWrDwWF3teFb4pTGHwMEzkJ9At9lpP1qmAg4=; b=f6IeJMqn3INcKMN89eypygcQP9Sgx4Nogj4oRnBqWPc2HnizvMZjgSYx+bcT+9pbbN cRgo1uj9tSgceBasMgQUkZkaCHwp+hMsZvI5HfENTXtVmwbl1zfujHV/bftAei/NYt5P e/vVLtwSU1Te92KxN85LScDHzKNrr5ADlBW/4nyYZu3ZR1mkd9fEYbNBoZ5vjJeFAyFw q2JDU7S/oDGv5Dm59uT+r7dv+6EjgNC41IryIHGV1doS51wJ4cG6b73GCZeYPNoh9mjz +qrA3nFm7LNb0xcuXDG5vz02GuS/ZVRLriT3E3iipK8epURUO3gaoIHBlXdfa6HbTxx/ vAVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NItyMYn4; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-144869-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144869-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e7-20020a631e07000000b005f0a5269689si7730147pge.659.2024.04.15.03.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 03:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144869-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NItyMYn4; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-144869-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144869-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 62D1D288ED8 for ; Mon, 15 Apr 2024 09:53:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F6D547F50; Mon, 15 Apr 2024 09:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NItyMYn4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B6C340875; Mon, 15 Apr 2024 09:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713174778; cv=none; b=b9eZOVwpjq7nASugHpkIg7e8UMY3g2iH6wy63ussQAgTUMHZ7xyQpkIFnq1fVKvWH9AvOxiJjy+LCMimYITUWUVJJy0LVDAJC4Mv9PHRU00fTrpO02nCMGrw/yCMZ0bQvsDFoIxkJiMJCkPnHbWpe4pZmVQEOmaGUjGXtKmqA70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713174778; c=relaxed/simple; bh=V/X3vrE3jxSz3ehSDmcCXV4yyEQ3m8xL6Dlyz364sUU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QU0ceNe0VvnbJQMPeBXunrWHRM+qvTGlGEMjKjxDTtiBWYYYkngJkh9oI4wj7jeMxVH07r1+9z3Vb9Fr0rM17jAcwIIQuduxi8hlgsTtMthOR+jxDIOOXLJdtQVUoyVAX0Q5nqEkrpMU71jFoleQuCz3BbGv/yMHScytp1rIFq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NItyMYn4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF48FC113CC; Mon, 15 Apr 2024 09:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713174778; bh=V/X3vrE3jxSz3ehSDmcCXV4yyEQ3m8xL6Dlyz364sUU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NItyMYn4nODvxzunXF0rBWDX4mjwxMOncgDRtCD0EU+Iy7Mn5U36CFUa2d1rO7fyp crqdmhItd6+IsgsmrkQKjAQhkxf/aGtid5kVvdcLRVnKmPRgqiqiO2okk4u1ekq+Oo 7BYmR5aQNZJ+neZXCvvHc24nJuz89kx4Xks1FeIs= Date: Mon, 15 Apr 2024 11:52:49 +0200 From: Greg KH To: =?iso-8859-1?Q?Bj=F8rn?= Mork Cc: Oliver Neukum , Aleksander Morgado , linux-usb@vger.kernel.org, linux@roeck-us.net, linux-kernel@vger.kernel.org, ejcaruso@chromium.org Subject: Re: [PATCH] usb: cdc-wdm: close race between read and workqueue Message-ID: <2024041536-simile-flatly-824a@gregkh> References: <385a3519-b45d-48c5-a6fd-a3fdb6bec92f@chromium.org> <87mspvi0lk.fsf@miraculix.mork.no> <878r1fht93.fsf@miraculix.mork.no> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <878r1fht93.fsf@miraculix.mork.no> On Mon, Apr 15, 2024 at 11:26:00AM +0200, Bj?rn Mork wrote: > Oliver Neukum writes: > > On 15.04.24 08:47, Bj?rn Mork wrote: > > > >> urb from service_outstanding_interrupt(). That's why it was added. See > >> the explanation Robert wrote when introducing it: > >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/class/cdc-wdm.c?id=c1da59dad0ebd3f9bd238f3fff82b1f7ffda7829 > > > > Well, the explanation is correct in that we must read > > data available. However, if the RESPONDING flag is set > > and the URB submitted, we are already doing so. > > Sounds reasonable. Except that the bug proves we didn't. > > If you are right that service_outstanding_interrupt can race againts > itself (and I don't doubt that), then I guess this could also happen > between failure to submit the URB and clearing the flag? > > >> As for the XMM behaviour: it's been a long time since I tried any of > >> those, but AFAIR one the major differences compared to Qualcomm was the > >> strict queue handling in the firmware. This caused a number of problems > >> where the cdc-wdm driver wanted to skip a message for some reason. So > >> I'm not surprised that a bug like this is triggered by one of those > >> modems. That's probably the only thing they are good for :-) > > > > I am not sure where exactly the issue lies here. Suggestions for > > debugging? > > Nothing more than the obvious; Get one of those modems and do some > usbmon snooping. So for now, should we just revert this problem commit? thanks, greg k-h