Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp347001lqp; Tue, 11 Jun 2024 06:30:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXeftBSP86lh5P58/X90+Yh9nQyTEc31fwh2CT7gWfsF0bbd8Bppy11fHIxaMOFtp7CEszhX62AFWVsEjCsUwG8F9skHecDrIMM/LBOQ== X-Google-Smtp-Source: AGHT+IEXXbcEqAsqOd6vp4nyZIl3DDVl9OCk9YrhaoFNm9Ha0+VDeBOmHKK38thPpzWyp6KdsQqf X-Received: by 2002:a25:8385:0:b0:df7:97d4:b790 with SMTP id 3f1490d57ef6-dfaf663badfmr11783031276.18.1718112622298; Tue, 11 Jun 2024 06:30:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718112622; cv=pass; d=google.com; s=arc-20160816; b=GcCRXhcqwbrNXCQ6nucLE9vXqdAaw8kkvm8b+epEJzhkVqJm5La9LQ1Oe8CghemuG5 Zhb6l5re9OP3FJZ3mKh3xEQesUX0lh1N7wPTqng9lKorfEOEMRi93iBDJy4jVwRBXevw sbP8AVKM5f5/HxNUHStLSFfQeyMDWAOK3w6NrWoozmhQyT/o312Y9pcGPjtfdGua992t VteX7c8aYT+i5epXCJf/xwICuKC0hIsVbJkWRqI+8BNoDZpe93IOfyzIg7Sw6jKRKyxe dtiFL9uGI/gzH8rMBhpY+pqQn+B+mnjSbYdNMBrI4yxZ27iNPZ9lVqjKsqYAFT76E/ww wmfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JRaIU7dr4pDVZEScHwKOupJVWmorPwpLlGwRVLApZOY=; fh=4bInQGLnqQ2JwA4ZIId/tnybN1Ad1gzab4Zt2fOUHNA=; b=xUVdNCGLLXvI1SxktxW2wGHCMXxM7CjsP3ywNIc34LpBxccYj98pi88uT8mrJTaRFZ g4ANfY4rhHjUMO1gUa9kKiQiQeWufK4aiK5bkgBmu8oLkU1TakkM7RCbN6f3aZkT2rBP 3cBkVg0kX9QJkfa7JYo8OSgwknec2B4JUwP+mujIc6InmbAVI9bC/guKclYvJIa/yOiP 4QBDRlFDfByzcAvCOweD3xyrmijZL5qsZkxVowHtr4q0CfXLcdyNEmZG9GJDnPSxeD+O F3voFgsbEmEPD4GmRTuM4tCH+L7CpwMrs2RfnuX8L7uVZWFS7JMRy3WSiPXCLAK0FZ9g gsIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Eshwi2Kz; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-4405da8fbd2si78433631cf.627.2024.06.11.06.30.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:30:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Eshwi2Kz; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209955-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CEC0C1C243AE for ; Tue, 11 Jun 2024 13:30:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23BAA17CA1C; Tue, 11 Jun 2024 13:29:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Eshwi2Kz" 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 44B0217CA06; Tue, 11 Jun 2024 13:29:25 +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=1718112565; cv=none; b=tH3Civ+jD0c3lTxzhbJuCK5B20IFeAzjgGGpo0xT47G74N59pfjMz/nW/h2YEaIiZuajvznqsHDM1rIpTWVeVxnCTBV0wXZUjS0I+pH7lba6cWIqEdWBw9M8oAyMiIQTaF0kah+9fGI4BrOGfAq/om0tM5OO2vx6hHIPi71b8V8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718112565; c=relaxed/simple; bh=InuOlaVNE1oo9SB9Gz9Wqxu487yf8TriEQHN/x2DggE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q21mJ7aUqSiNjApAXLB0YQXv+Qkue/Tpvhq9terGaEW65dewaVU8C3MZs7NGEl8gSPw/n+0ZGV/BYJesNmSEFJixPN0q9qw9zqQRZXi0T0wGD7ZLQl07X+9C+LmS9geRurGE7FE/ihBSjEr9SQcl+GYvnNKW40uQj4hndSlc/C4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Eshwi2Kz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87102C2BD10; Tue, 11 Jun 2024 13:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718112565; bh=InuOlaVNE1oo9SB9Gz9Wqxu487yf8TriEQHN/x2DggE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Eshwi2KzINlHj58yYBOiu64/bM/6BwportMUM+oe9Ft63a3NoJlqO5wvMKaPjkS0s 4tv27t7IhFIdtAwsfzVEE1gkckwnKhlXnsLyzaOqht6TkViomuwUAgDVJp/+E7IR0i 1yGB503D3ITqm290pHeRAB79pcKhkf8Er0FBnzQk= Date: Tue, 11 Jun 2024 15:29:22 +0200 From: Greg KH To: Danilo Krummrich Cc: Boqun Feng , rafael@kernel.org, mcgrof@kernel.org, russell.h.weight@intel.com, ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, a.hindborg@samsung.com, aliceryhl@google.com, airlied@gmail.com, fujita.tomonori@gmail.com, pstanner@redhat.com, ajanulgu@redhat.com, lyude@redhat.com, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] rust: add abstraction for struct device Message-ID: <2024061136-unbridle-confirm-c653@gregkh> References: <20240610180318.72152-1-dakr@redhat.com> <20240610180318.72152-2-dakr@redhat.com> 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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jun 11, 2024 at 03:21:31PM +0200, Danilo Krummrich wrote: > ...hence, I agree we should indeed add to the #Invariants and #Safety section > that `->release` must be callable from any thread. > > However, this is just theory, do we actually have cases where `device::release` > is not allowed to be called from any thread? If so, this would be very confusing > for a reference counted type from a design point of view... What do you mean exactly "by any thread"? Maybe not from interrupt context, but any other normal thread (i.e. that you can sleep in), it should be fine to call release() in. thanks, greg k-h