From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F23C13B598; Thu, 28 Mar 2024 19:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711655720; cv=none; b=eRgDoysZsOz8pRmsneZvtyKuCECKflDZ4Y9TQ/5gcq/sn8xBMiG0FxjF0oUx65rbIrC+ffsSpHm7iRXwCDFJh7b8EenvakBSmFAgTMZ3WiRAOsiSHdK4BuYn1OpT3J/qDO+oQxg5zZguf2MB6RlGUXkI1TDvhb7/8nV9yVFciGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711655720; c=relaxed/simple; bh=8H5op9oxVlU0msUtq5I4WSqtnbdnJghczRSI2SqtUaM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=I3V5uP+xaYnPL0AfZdeCTFwrCYgZzL3Rc+xqyXZnOHn1Xof8nkSm+spYO/94aWVzrnUzpWL2xtqyYfDU2COVChrS5GEHZguRbOYmly9nfwIOa36Pc11sRKerc3gYJGgogWIl7ry6hTDithUIdvQHugqEuJtJmqGarwDarrTeR8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FUBDeGl9; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FUBDeGl9" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1e0d82c529fso12721145ad.2; Thu, 28 Mar 2024 12:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711655718; x=1712260518; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EzqUPsfXWj4binayeXTWXcfCoPWBBRiht8YRpbXdcMA=; b=FUBDeGl9A7jmubRkBgVcnyIBChMi26PnlOPx/hjHJ/Mwg/tfyOMh7bvFZjFpE0UYCT ZHhzlllWiC43WF87h1e6HXC+FNmq/N+I64RKBVrvGhCzTORfDXdxx5ULDAZ8B6x4NU0O BsCpp7uKTtZjvwe56Ja/5YH/7PFIl2TnruX+SdQDH5Z90cYemOiUMdah3jZhbdqII+Ik U2KJ14rdZTYjMYpuIE8PthCac3sV83w92HqV/yI4GV3pHfp6ooQE3USdRMY37YRyEn0L 1KENrWbJaoD5M7ktUKfderZlbGMyNYCjDAxlyvvKNkHVO94TluyG3Ti2DEKWf45ee3zg tAtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711655718; x=1712260518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EzqUPsfXWj4binayeXTWXcfCoPWBBRiht8YRpbXdcMA=; b=sXRKYaTuteajfrZxL5eW2BceANRBRYHVinBBO0jSAHlx0asCxh35dMWFB/o6qKd8I1 /ga1r1pdcpihQkI7G9XGpmCD1QXxE5NVoQGjXPwdCabyxV/myNTg9WEt5ED1uSmiaTgo wtVYc2blaZClgQWqrkcJStPIuPmBx6QUJQ2IifGsTnPr8nw99JsADSoC6k8mkG7RBHXT eNyyJvWZeJnXux06lI7ngbDaRrtV226uM+MLm4u7vPTEg9V2Jn9Nc8x0xCXOCllOPJpm +OeYIJU5SaR2DkNZBeCLiwl135P9/iNFO542d5+5PIqGuGJNwqdHW0R8KnK09/rCMrJu kiNA== X-Forwarded-Encrypted: i=1; AJvYcCWl82i6PKd0T0L31FhqG7RdyYAuG+OXFMzk6EGfjzx+wEc2Vp5iNh0dPYNU4Zeryo0fgW3TTxlnRGI3DXpKwEz+Dtk/Of++W2IBDZxNc2B8ijoSxLW7O5HUyWS6au2Gtx5cPpqJ X-Gm-Message-State: AOJu0YzpKAA92gEgXa3Bg92LF9u7zWC/DMgxJPY/NgKPlBNkSkcWipey U+AJXnVr9/qBKEzk04bN7t4qEq6GWMUUfYO6CtqgJrG9q7nxR0ZHoBerG+8e X-Google-Smtp-Source: AGHT+IFcH8y9aRYK8WAqYucQcxKLzTdOpTXagA/BsEXoq0kvwRHyM3jJoCzmityUgjvvuOTNcC1qnQ== X-Received: by 2002:a17:902:e888:b0:1e0:b5d4:9fa3 with SMTP id w8-20020a170902e88800b001e0b5d49fa3mr634632plg.2.1711655718390; Thu, 28 Mar 2024 12:55:18 -0700 (PDT) Received: from wedsonaf-dev.home.lan ([189.124.190.154]) by smtp.googlemail.com with ESMTPSA id p16-20020a170902e75000b001dd7a97a266sm2006520plf.282.2024.03.28.12.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 12:55:18 -0700 (PDT) From: Wedson Almeida Filho To: rust-for-linux@vger.kernel.org Cc: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , linux-kernel@vger.kernel.org, Wedson Almeida Filho , FUJITA Tomonori , Trevor Gross , netdev@vger.kernel.org Subject: [PATCH v2 1/5] rust: phy: implement `Send` for `Registration` Date: Thu, 28 Mar 2024 16:54:53 -0300 Message-Id: <20240328195457.225001-2-wedsonaf@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240328195457.225001-1-wedsonaf@gmail.com> References: <20240328195457.225001-1-wedsonaf@gmail.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Wedson Almeida Filho In preparation for requiring `Send` for `Module` implementations in the next patch. Cc: FUJITA Tomonori Cc: Trevor Gross Cc: netdev@vger.kernel.org Signed-off-by: Wedson Almeida Filho --- rust/kernel/net/phy.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs index 96e09c6e8530..265d0e1c1371 100644 --- a/rust/kernel/net/phy.rs +++ b/rust/kernel/net/phy.rs @@ -640,6 +640,10 @@ pub struct Registration { drivers: Pin<&'static mut [DriverVTable]>, } +// SAFETY: The only action allowed in a `Registration` instance is dropping it, which is safe to do +// from any thread because `phy_drivers_unregister` can be called from any thread context. +unsafe impl Send for Registration {} + impl Registration { /// Registers a PHY driver. pub fn register( -- 2.34.1