From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 DF46E2C0F8C for ; Tue, 17 Feb 2026 08:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771318242; cv=none; b=Fh814e8JJWWv6a1vr+R3kc7YtMgq6HmwG+Rsf6QA1CKE5Oi6zUU7KWAwBdZySBvmlpK3+J2lXzsVkX2eziIzFw9vKNSG+CSruiKVecEgg+YdHDd2edeW97X+ltSumknPt9/YC2tr/M4xHNP0SczV5pskMHAJtqVx2Wr2bGm2pwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771318242; c=relaxed/simple; bh=MPRho1BXR5I07Gqqkye/DGFZwC7hGpqHjYdeOqW6o3Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fBkC66fy9XpHsDrvcRLarAMwWMAXrBIZfVHqgd8nzZ9VkiG50BmDTydHzRHPPGpOPYqL6f6yvdRfGHNLnD80jvG4P1FFwq6gVUqSc/tuy4/qO9bBjXqKgHzjjqJCsVBgFUqwMw265u8bLYfwQUNQ//678M+B0g7mTj+phTtFyHc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SkqLSJAo; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=GJfFOwDj; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SkqLSJAo"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="GJfFOwDj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771318239; h=from:from:reply-to:subject:subject: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=hhmnk81VjeKfSAS/tzd8Udq5jgElSXLAFbVQDFjFNds=; b=SkqLSJAoJmZ3ST0ZjinBTBvjCw7fnTu0VqNfqWgXbpk1/K2S60Xh7YkpXzskDQTPoKMxkm NHnHm3lXF9cmueQs2bXHxC2YKS5/wAMWi9/Nwpg37CveAZ3Sp/c/2Fgoq2Bsum0ObuU3lb RVanMA3/9+W+Nr0IpPQksklnOxkQVHc= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-689-zUWDIwG8NcuV8fI1FJYpUg-1; Tue, 17 Feb 2026 03:50:38 -0500 X-MC-Unique: zUWDIwG8NcuV8fI1FJYpUg-1 X-Mimecast-MFC-AGG-ID: zUWDIwG8NcuV8fI1FJYpUg_1771318237 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4837c597cd5so14865975e9.3 for ; Tue, 17 Feb 2026 00:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1771318237; x=1771923037; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=hhmnk81VjeKfSAS/tzd8Udq5jgElSXLAFbVQDFjFNds=; b=GJfFOwDjEyev40NrSNamIFggqF+2o8pTVJ+zbA08zBRZxMRRBeesPGb7egxnBWsOhr Nx5F7TxhrN4IFKcOy+Hi6rqIIMYrZJHGWsS4ULjfjK+4P20WkbW5+T/ANPZsAHh6tIAN 8nSYrD+3I+SsN20rqpvndNqvtTUkkVJ+U3vtQGCBiLZ/ysl463+Bwr8/FrckJlIEOboL /Drx/gdqVIMPKaFg7MNXUIDTlHW/LSfyrofUEgcAIBmpb6v4TqysfZKA/GObkx5aebWd EzWEoVr/qhbtgY0XBBmWAyzaeu5EyBAt3G29dugaxJY+uI2S7TieZ/03yr+IwU169RJr ss3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771318237; x=1771923037; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hhmnk81VjeKfSAS/tzd8Udq5jgElSXLAFbVQDFjFNds=; b=bSwXOM3Tqgq1z55AMiGFe3VricYaRthVkebIa4EthC+ZZ/r2JQEMYGzTklAACmcrFi 8Z0UeBmHcF+WKFLjL4zKgdlA9dLdotAV2PmTwXJUhGDeJOQf1o9wkUv2+g/uNfBIrd1Z gBoynoBOuErByjK3DNf83avnvlqUZKTZeWmvGX1kS0Otcg4cjqBAoENQd+Ci5YDlGd4X 7OmwniS7vmSg3CBi7mUuBxAMzAWi9Ezh6gFEBMtGnqJ+h/Pr3QxGXCmzxLXlZ5puTU7K iaWGCOLqXwaMFQy8RomxnW6NnvYBXvRGMwmqI16AKwiomiCciDi/4ocAvaAJyXPD6p9U 8POA== X-Forwarded-Encrypted: i=1; AJvYcCXSL8j1uBCk0lWy1ckqiMBAFRtDnQCnedHTQtv5KdSbqgKy4xEeZtC2m3Cj+oF1fXyR2h3AcBN1ps66078=@vger.kernel.org X-Gm-Message-State: AOJu0YzA9rqPU4ZBcdYDz3PYYVEJzmUSvKxjxwgRhT/ra2U2deWCefjh e+s5pExyq75Udj0J1MXrAEQB5BYMFOOr8VL4EpJ81Ug81oCYVU8ZSJwYACfCW8Mu8hrlmHNXre9 W8E3rHAPMYghd1fMv6tAcGpi9blsKD+aZul36BEkbJEt0+1QB89MvhuKdZLmovGIVlg== X-Gm-Gg: AZuq6aKLYSyQOj1U+2I+mWtB9yaFiLYYnNUq/DK+mpepGAsWTHmSg9qa7Df75f2uIYf f0TUYi+vEtNasRsh2m2ersk5qJ0ameYLvaWJipCm413uqFzbHHmhQL8eEBmnakcVP3Eg9EqVJCT Cezzn5nbktPeYrezQDDaRLIMMNY0meW7lsnYwH6HfL3NFWN7pu/fgzga8g318ZjT6Bw0bfOc8u5 SUT9QpRCnfgZn/XGgqWmXG/efjqXHVWFaQ31WFaHJDCJSsK8VkCHlM871BXkugGZlE0Ce6NLmWE xuqHNcc8ghQQ5kpsDMBn0FsHcZfh7f9COW0gxNWg5+O4O1ots/Fi6sMMstAWum6Sz2Pp6SZE+sR ogH4jExxtuizfAb2prq951DgFdw== X-Received: by 2002:a05:600c:8b61:b0:483:64b4:79da with SMTP id 5b1f17b1804b1-48373a69ed6mr211390185e9.26.1771318237183; Tue, 17 Feb 2026 00:50:37 -0800 (PST) X-Received: by 2002:a05:600c:8b61:b0:483:64b4:79da with SMTP id 5b1f17b1804b1-48373a69ed6mr211389885e9.26.1771318236688; Tue, 17 Feb 2026 00:50:36 -0800 (PST) Received: from [192.168.88.32] ([169.155.232.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796a5ac7csm29315414f8f.7.2026.02.17.00.50.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Feb 2026 00:50:36 -0800 (PST) Message-ID: <119e20b9-4ecd-480d-b629-1c57b2088a41@redhat.com> Date: Tue, 17 Feb 2026 09:50:34 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: usb: kaweth: remove TX queue manipulation in kaweth_set_rx_mode To: Ziyi Guo , Andrew Lunn Cc: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260209053013.1701134-1-n7l8m4@u.northwestern.edu> Content-Language: en-US From: Paolo Abeni In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2/9/26 6:48 PM, Ziyi Guo wrote: > On Mon, Feb 9, 2026 at 7:56 AM Andrew Lunn wrote: >> >> I think there needs to be a better explanation why it is safe to >> remove these stop and wake queue operations. r8152 does the same. Is >> it also broken? Rather than removing these, should we actually be >> waiting for the completion of the urb? >> >> Andrew > > Hi Andrew, > > Thank you for your time and email, here is my understanding (correct > me if I'm wrong). > > I think ndo_set_rx_mode runs in atomic context with a spinlock held, > if we wait for the completion, this would sleep under a spinlock. > > And it seems the architecture of r8152 is different from kaweth and > rtl8150. In r8152, the ndo_set_rx_mode callback (rtl8152_set_rx_mode) > won't directly call netif_stop_queue/netif_wake_queue. It only sets a > flag and schedules delayed work. > The function that does call netif_stop_queue/netif_wake_queue is > _rtl8152_set_rx_mode(), which runs from the work handler > rtl_work_func_t() under tp->control mutex, not from the ndo callback > under netif_addr_lock_bh. > Also, r8152's start_xmit never submits URBs directly. It only queues > SKBs to a software queue. Actual URB submission happens in a separate > tasklet using a pool of 4 independent TX aggregation buffers, each > with its own URB. > > So even if netif_wake_queue() triggers start_xmit, it just adds an SKB > to the software queue, no URB is touched, and no double-submission can > occur. > > In kaweth and rtl8150, start_xmit calls usb_submit_urb() directly on a > single shared tx_urb, so the netif_wake_queue() from the ndo callback > causes the stack to call start_xmit while that URB is still in-flight. It looks like kaweth_set_rx_mode() is already functionally broken: the real set_rx_mode action is performed by kaweth_async_set_rx_mode, which in turn is not a no-op only at ndo_open() time. So this looks safe to me. /P