Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1309906lqp; Mon, 15 Apr 2024 02:27:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULLP7sB5NNZt6asL6kK52Qv8lHdhlzFEh6fggGOw83R8cS0JPJwPXLkyltvVKFlIeq5SruyJCd0H5aKJac+8SvhEEBx80S11/MRdVxww== X-Google-Smtp-Source: AGHT+IFGzryiWQMxgf8+SideF2PpFcOwImvBtRVp0eG7GYsn+YzsIOjYDUJpf3W/OZP3VYTemYxL X-Received: by 2002:a05:620a:439d:b0:78e:deaf:669a with SMTP id a29-20020a05620a439d00b0078edeaf669amr5174234qkp.23.1713173251341; Mon, 15 Apr 2024 02:27:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713173251; cv=pass; d=google.com; s=arc-20160816; b=ZeOsnltIy1lw+d/z2vTKA0XIzC779P/WPaEsne1KMxNLVrQLNEb0cjMDTvm4uf+/fJ cklQ/yqWDsCse1QI+3PW63pdIEE9MIANvHpvW4bbpnaK5tXNfBHHRCiuso3JJpBfQ/F5 94wCMuoqgfonNTJjAryXUdL5HWT7OCMmXrGjT4SXCJuphZwvwmuAC8gcZyPTFhyRBoS7 iKYwYPKR1MFo0wQoQ6/nOKz8cy2B1AHbCIbp9/fVONbP3Xp3kJncp8l1g72SHZPiQbri KLh2NdSClb8GYcJMAi0wnzgJ/ekHAJDb1dSMco4Gg/miXOnO8j7LpjNckY8CObEf2SeT aa9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from:dkim-signature; bh=KhON5lChtzng6LnzOvsC9a6xUGsfOfDLK851N17ueKo=; fh=01CzTptWgqb/JKGn3ZDcu6tX1fCWK9suXc5PVRAapAI=; b=TRnHWm8S0wsF//0+D6useRFyw2ujD0vz3HnD8h0kXUJ/T/Ng7R5bKZF6UUF+uKrthA rFzXZYJzDqOaNnu58as2Qb5AcJFD33RLw3TLghcEDB6QWZyW/IZoc2A0K8nt3+rW/ObX xs3zJIlMPkP+ljDhSnZYPAOoJn+WiWaZzp7cQnUzQV80U/Hwg3gkfMjRpSzhXtRLPTYJ d2t9CDhQB/+7shBRmvJWFDq7kdcxzstjKYSbcgEbiomSiqyfM0Tr2dbRihMrjf3xyRH7 xWwXsmB++XhqsG2T2sasubFlkdWmzidorftA0PB7Mrldm14ZfMTQVh1dCqAY+KZLQq8l ALpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b="gBT/iVry"; arc=pass (i=1 spf=pass spfdomain=miraculix.mork.no dkim=pass dkdomain=mork.no dmarc=pass fromdomain=mork.no); spf=pass (google.com: domain of linux-kernel+bounces-144832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mork.no Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c42-20020a05620a26aa00b0078ec3c14aacsi10702575qkp.741.2024.04.15.02.27.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 02:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mork.no header.s=b header.b="gBT/iVry"; arc=pass (i=1 spf=pass spfdomain=miraculix.mork.no dkim=pass dkdomain=mork.no dmarc=pass fromdomain=mork.no); spf=pass (google.com: domain of linux-kernel+bounces-144832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mork.no 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C21261C20F29 for ; Mon, 15 Apr 2024 09:26:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 186853FB1C; Mon, 15 Apr 2024 09:26:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mork.no header.i=@mork.no header.b="gBT/iVry" Received: from dilbert.mork.no (dilbert.mork.no [65.108.154.246]) (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 88FE0383B0; Mon, 15 Apr 2024 09:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.108.154.246 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713173189; cv=none; b=BjXLxLnc7E9c72rYSWS53s8VD8M3ZbollZ82b30WZdbewvty3isI6920CPBdmYWaPg3wbmB6gW6HrPI9uWJjGAjSj4jOu8SYuyjguYHOQ1WH1dL0zlcNlu96EBqIIwsw4QbfGRXM/jusKITMWgvYz/sbhZitBeMI+SYrM+LM8VQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713173189; c=relaxed/simple; bh=KA0+CPGFHfmJHhAA2WmrZiTNFjssWuFlhgCioLGnjA8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=ggM3/p3wn5MD/mNoKT7ym0e4mMU7xo6ZkgsaEsqEsf1pJT9Hp/dcQ+fAWMKG2a7vsuPj6oQhtEIRvYzF7ol6kYsz2rqk5YoOz+1FsIPvlyiimA9p4MMOiMtEgRQEHeXXrb4UmowJAreGIsTKH3qNb8+Qaw7PfZttlCHLtm2wUTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mork.no; spf=pass smtp.mailfrom=miraculix.mork.no; dkim=pass (1024-bit key) header.d=mork.no header.i=@mork.no header.b=gBT/iVry; arc=none smtp.client-ip=65.108.154.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mork.no Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=miraculix.mork.no Received: from canardo.dyn.mork.no ([IPv6:2a01:799:10da:6900:0:0:0:1]) (authenticated bits=0) by dilbert.mork.no (8.17.1.9/8.17.1.9) with ESMTPSA id 43F9Q1wd282006 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 15 Apr 2024 10:26:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1713173161; bh=KhON5lChtzng6LnzOvsC9a6xUGsfOfDLK851N17ueKo=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=gBT/iVryaQKnEpshAetRo1gqYfeWE5fMOr0JcXNrQms4RNkb23VQPMQQToJoeafCC OyWV7Cx2ehV8y2ZunWa5dicINVXP4WJ9q8XMJ/L3NuMI3lx0dVlV/qEGqhfgoRZhCt OU9wop3EdhfbNyI001tmgVZBaGfbCM+ggzGcr8I0= Received: from miraculix.mork.no ([IPv6:2a01:799:10da:690a:d43d:737:5289:b66f]) (authenticated bits=0) by canardo.dyn.mork.no (8.17.1.9/8.17.1.9) with ESMTPSA id 43F9Q0dW399022 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Mon, 15 Apr 2024 11:26:00 +0200 Received: (nullmailer pid 21640 invoked by uid 1000); Mon, 15 Apr 2024 09:26:00 -0000 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Oliver Neukum Cc: Aleksander Morgado , linux-usb@vger.kernel.org, gregkh@linuxfoundation.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 Organization: m References: <385a3519-b45d-48c5-a6fd-a3fdb6bec92f@chromium.org> <87mspvi0lk.fsf@miraculix.mork.no> Date: Mon, 15 Apr 2024 11:26:00 +0200 In-Reply-To: (Oliver Neukum's message of "Mon, 15 Apr 2024 11:06:33 +0200") Message-ID: <878r1fht93.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 1.0.3 at canardo X-Virus-Status: Clean Oliver Neukum writes: > On 15.04.24 08:47, Bj=C3=B8rn 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/commi= t/drivers/usb/class/cdc-wdm.c?id=3Dc1da59dad0ebd3f9bd238f3fff82b1f7ffda7829 > > 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. Bj=C3=B8rn