πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3351

Re: [PATCH net v6] usbnet: fix smp_processor_id() use in preemptible context

#3351
From: Sebastian Andrzej Siewior
Date: Wed, 14 Oct 2026 19:11
50 lines
9112 bytes
On 2026-10-12 22:09:25 [-0400], Alan Stern wrote:
> > > Today you fix VHCI, tomorrow some other virtual HCD will cause problems.
> > 
> > We don't have other virtual HCDs, do we?
> 
> Well, we've got dummy-hcd.  And just recently there was an RFC post with 
> a virtio USB HCD implementation.  It wouldn't be surprising to encounter 
> other ones.

dummy-hcd is timer driven (so BH). Without looking at virtio I would
expect it to be interrupt driven.

> Also, don't forget, URBs can complete in several different ways.  
> There's normal completion, explicit unlinking, unlinking because the 
> device was unplugged, unlinking because the device or HC is going into 
> suspend, and so on.  And there's a difference between URBs sent to 
> root hubs as opposed to devices actually on the bus.  Not to mention 
> that in some cases completions may occur synchronously with submission 
> or unlinking, even though they usually are asynchronous.

True.

> > Do you want to document it yourself and have me do the VHCI bits?
> 
> At the moment, the only thing I think we can actually guarantee is that 
> completion handlers will be called with local interrupts disabled.  No 
> commitments about process context vs. interrupt context vs. BH context 
> or anything else.

"local interrupts disabled" as is local_irq_disable()? If so, that is
not the case. If it completes in BH context (due to HCD_BH) then
interrupts remain enabled.

> Of course, in special cases you might know more about how a particular 
> HCD works.  But except for platform-specific settings, it's hard to be 
> certain that your driver will always be used with that one particular 
> HCD.
> 
> If this is okay with you, I can write a documentation patch.

Sure. The kernel doc for usb_hcd_giveback_urb() says BH or caller's
context. I think you need to clarify that part and once we have tha, we
can proceed with the drivers.

Thank you.

> Alan Stern

Sebastian
Technical Details
Message-ID: <20261014191141.GxlJhR1e@linutronix.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346425-linux-kernel-netdev=dewy.ru
References: <20261004215937.302247-1-omermetekaya0@gmail.com> <20261007200049.079aeb75@kernel.org> <7c4a2f1c-f16d-479b-a11f-cef962d5e2c7@rowland.harvard.edu> <20261008094338.301a75fa@kernel.org> <06a81ea1-b17d-40bd-82d9-922de946b86f@rowland.harvard.edu> <2026100910-petition-embattled-94cb@gregkh> <20261012194902.aEq58Q6b@linutronix.de> <8545800a-a37f-482a-9b06-cbdd70312b7a@rowland.harvard.edu> <20261012212527.5sFqlGYu@linutronix.de> <41af30de-4725-4913-9ad8-54d1dea2d4b8@rowland.harvard.edu>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346425-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v6] usbnet: fix smp_processor_id() use in preemptible
 context
Date: Wed, 14 Oct 2026 21:11:41 +0200
Organization: Usenet Network
Message-ID: <20261014191141.GxlJhR1e@linutronix.de>
References: <20261004215937.302247-1-omermetekaya0@gmail.com>
 <20261007200049.079aeb75@kernel.org>
 <7c4a2f1c-f16d-479b-a11f-cef962d5e2c7@rowland.harvard.edu>
 <20261008094338.301a75fa@kernel.org>
 <06a81ea1-b17d-40bd-82d9-922de946b86f@rowland.harvard.edu>
 <2026100910-petition-embattled-94cb@gregkh>
 <20261012194902.aEq58Q6b@linutronix.de>
 <8545800a-a37f-482a-9b06-cbdd70312b7a@rowland.harvard.edu>
 <20261012212527.5sFqlGYu@linutronix.de>
 <41af30de-4725-4913-9ad8-54d1dea2d4b8@rowland.harvard.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="2369228"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:uzSZ3dFuhKbyLNfyTDcrcm+WHCs= sha256:EfS3HqULWrraCSz4x77NuAutiJOyIQ/xFDwiNJ7bu3I=
	sha1:GGr002vgZUNjwMwDJQDw/BneqSk= sha256:8CBZ7+p2NpreTbfGBrHD04s2EvI0rU6R3Pp0QYjGYMk=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 77C801101BB; Wed, 14 Oct 2026 22:14:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=linutronix.de header.b=Iq07hdar; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=PYnggFmR
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id D3Xoaypp253i;
	Wed, 14 Oct 2026 22:14:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-346425-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linutronix.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6A5881101B2; Wed, 14 Oct 2026 22:14:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8A02C2F212; Wed, 14 Oct 2026 19:11:47 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 498CC4457BA;
	Wed, 14 Oct 2026 19:11:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Iq07hdar";
	dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PYnggFmR"
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(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 B2E8443F4BB;
	Wed, 14 Oct 2026 19:11:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792005107; cv=none; b=tv7xHmEvcJjA/mlAhi7xsgbmM5AjV9q4R8RodvhUr9UFDPU5a/py830YRvkNElNIguH0wKoAyMNKeO5JZOBfgEitBcfYGMpdv+SC44Nsv4tw9MzPZxIqSKUB/InGY6+FOeHYIngt9vSsh70yYEbWVVaqMv7VfrSOaSahFlEKDrQ=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792005107; c=relaxed/simple;
	bh=Oe/sbg8uwHAjPb4YLfnECfFwUY87hHT1lXsjkgwXos4=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=UlEcWLKYMTA5f9IOp04Wx3x/kdw4HOvvbSJkeLJ8SFUVoRghP+hcZ+/PATbIsw1YoSuFj4C1e9lv4C2dQxaB/zoVdGMBfqCEeTcAa/TJhgJRFJktSoUNjfvWjDTQYb/zR4gtguv94wDRmIcXtzAyiOKzrYmryrmwX+NPmgTZ/9o=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Iq07hdar; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PYnggFmR; arc=none smtp.client-ip=193.142.43.55
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1792005103;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=Lgvme0OT2A0ZVkdd7ArF0xH/WUsFMUOgkkS6/tlJyDg=;
	b=Iq07hdaru+qQRF94+1hMxme4fw6RUyDl7SKiXRGibz+3HjWqgEBov68EiEtuqTR0JPGsnz
	ZlUKOvJLEKO4CClPSym4UmBdqE6GP4rOojjoQU0yDzNM4o9yD9QBSR3IqGr1NXehU0OztT
	NqAxhnEs9cUG6DnYhscEjV1+mQKR+E2GTfeJ5DrWcVHvB8sorIFJJ8WSXtsPDyJQaSq9rq
	1tdWP/gIBknyF97sx/ZN6o0ZVz+yQujZZOCFCtdhupKN4g6xyTDNFjoiwEXoHmbBqphJhP
	gTCAZu4jwjQSRh5eNwWOl+GwuZQCo7eoIXJJVZz0+Lv8p6mVb2R2I3f1q7Gotw==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1792005103;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=Lgvme0OT2A0ZVkdd7ArF0xH/WUsFMUOgkkS6/tlJyDg=;
	b=PYnggFmRS+DRLzr0OF5oguLZ/kxGOBQuPFBKZ9FiiDkDstT9zVkBSnT1d7ijf2VfQYVG39
	JWGKkdk4yJ5/zFCw==
X-Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Γ–mer Mete Kaya <omermetekaya0@gmail.com>,
	oneukum@suse.com, netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	david.laight.linux@gmail.com,
	syzbot+04cd90bb99c6ef81a65d@syzkaller.appspotmail.com
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <41af30de-4725-4913-9ad8-54d1dea2d4b8@rowland.harvard.edu>