From mboxrd@z Thu Jan 1 00:00:00 1970 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 25617341ACA; Fri, 20 Feb 2026 11:14:18 +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=1771586058; cv=none; b=C+jY7N2XxjVXq5LZJFIkouc9jxaGPBILeNM5bATNqN0+9bb/ptTVbHvzrrwW0+gczcOW73iR/xOM0B5srr3UFyqf6VJ/m5zZAwv0lgaSQWUxsiqku08jswh+nxjG4OfocNp3dSuE1ia0hpKoNpMOvQe00tK+HP5S7LjHqLFTdSs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771586058; c=relaxed/simple; bh=OBIwovGiLEgk9sxiCKOM48/c82NKWhf+xBbPy5J21OY=; h=Mime-Version:Content-Type:Date:Message-Id:To:From:Subject:Cc: References:In-Reply-To; b=S+qJiODOy44CeHtLCD+0DkbjbWBFaWQzZb3jYQtT0xapBmSIquY4sRaAO0dfIQyW0WtZMmxK96/wV0sLcFNVv+ySXNzbACG41TRH6Az5sqGsEvGlvmaUXINH6niWKbWSCSbTtQipYCkb/IjisqZ3F72QeO7bGHieiU6LNHpx5Wc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gfPun1Jc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gfPun1Jc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 981C6C116C6; Fri, 20 Feb 2026 11:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771586058; bh=OBIwovGiLEgk9sxiCKOM48/c82NKWhf+xBbPy5J21OY=; h=Date:To:From:Subject:Cc:References:In-Reply-To:From; b=gfPun1JctNvoNIPU18uGCxIMd5aHiT6dlrmj2bsqLAyavEu8synMj7lWsFKeZXRGe 2Ct9Zau5qkp2RGx60hxrlRnWk2pql8eJaaMg7VDRPkmx9vl7oYB9EiQrfHWiWDClNI epLqINoePUTxsjEVMnF3aXbzG0cL+ZDDE21nmHe2GjTf5UuKRo3+afXOpGYryxTUiy 3bnMj7tn0ROxyUkCt5R9Q7+7EUQo2EiZ1p8doDxcASopRTcPqmbosOUSng3pwf9F8r 9it9JfwQvqkFvY1m8DW6yYf9trdQEriJWze7GP1c65mUJhsz2kL5OiLm+faDY8Pect NCXlJg33ToXqw== Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Feb 2026 12:14:12 +0100 Message-Id: To: "Leon Romanovsky" From: "Danilo Krummrich" Subject: Re: [PATCH V2] driver core: auxiliary bus: Fix sysfs creation on bind Cc: "Tariq Toukan" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "Saeed Mahameed" , "Mark Bloch" , "Andrew Lunn" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , , , , , "Gal Pressman" , "Moshe Shemesh" , "Amir Tzin" References: <20260219210435.1769394-1-tariqt@nvidia.com> <20260220080413.GB10607@unreal> In-Reply-To: <20260220080413.GB10607@unreal> On Fri Feb 20, 2026 at 9:04 AM CET, Leon Romanovsky wrote: > This init->add->remove->destroy pattern follows standard Linux kernel pra= ctice. > I expect all current review tools to flag any missing function call > among these three. I'm not saying that the flow is not logical, goes against existing patterns= , etc., I'm saying that it is unnecessary to expose a new API to drivers, sin= ce this is already handled internally. I.e. we can easily fix the bug without increasing the API surface exposing = a new API to drivers. > It is not, atomic is not a replacement for locking and this hunk is > going to be racy as hell: No, of course not, but it is sufficient to ensure that something runs only = once. However, you are still right, since sysfs_create_group() can still fail, we still need the mutex, because we may need to unwind. > In the proposed patch, locking is handled by the driver, which understand= s the > flow far better than the driver core. I don't think so, the driver core (or actually the auxiliary bus code) is perfectly aware of the flow, i.e. create the attribute group once actually needed by auxiliary_device_sysfs_irq_add(), remove it on driver unbind.