From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 9A4F43A382F for ; Mon, 22 Jun 2026 09:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782122073; cv=none; b=mmbSibqFGYf72h2zXjnM5yG0fxulz3S1JBWyE4NVLL34AVItPGBpO/Oujxzdhs4td3J4RxtnA77BHGeQQ/nzl6Nv6H4IUUyVhn5z7ESxVijE7JVSJyrcYyJC9BvFgnTZWmlhZy3T7H1zoXBd0denr3OX8HYane9rWvwG6lsC3zc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782122073; c=relaxed/simple; bh=BiQL4Ri6hGHhI7+3UFpEHk++M44Z1saBPvMN7yLGlQE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hm74ggPNprvDhGctZZWTRKH1wEURmYGJkoawhQSdrayHU7ZW+XBnFuLkl8EPiNwKSa2IxmU2pdmi1fBpRDWpZwlH1whSrbOlBT/OrfpvHaoaKggPyk43Ds9VEuG1GGJRfzh5DTs7ETOUEJVa9qtKvm07WqyS1wBWaoOhQdinXOM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=ely6+mvC; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ely6+mvC" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4924593f45dso24606295e9.1 for ; Mon, 22 Jun 2026 02:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1782122069; x=1782726869; 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=SoAl60w2wtS6NmsbuiY2PacmATdoywAl81QEQux4sIM=; b=ely6+mvCnu2HWTPRiIvVNmjpIE3FqrsJofr6ikKparf8zQSQKELtEu6/2L1RgEzX8u f46ERY7EGB6srem+Yzpg6jLmMIvSVCIplf363bZjes14j9xScKNFBRzxM74Jio0kQpwm 9DHZVIlgh9L2tCqJFLr6mDl6P4dWg/rws9tq74455w4XZSt54FGkc5Kpcd9PLUUV7VMy zJHWaZyzOSxCMg09eijB01N79zeMsQ3GJ0CuAxBYnXqKYnSlAWKqORWFTTrmTZ3UG+h+ fTyC8Tyxw5ubQ6EmZgnfg6CWe5AblXurKALBaPs5gbDzodaPeqgrHCVO3p0ZQGZ0uNlF Pg2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782122069; x=1782726869; 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=SoAl60w2wtS6NmsbuiY2PacmATdoywAl81QEQux4sIM=; b=hniEAc9/9tvzDZZKLj3VViU3+b6dTLexp6y4z9f9yjyEqU3a4MH5/Qk68keeN3EPh9 4Gj3CAzTc4zICh5bctPndAkBD4DzpOs9Y23FaybOV1hygn/oyHpKUqMf86YU4VuKXUKX ikrnDjHOlpDCTF5PcT9SxMfLgFJKnCUkSiCo7DOljjO2EtS6mZDl6NPNt3dMs9qJ1C7a A+z0DTEfOsStASqmKEPnVVO4FgXPTwjIF3ELVIsPJX9efRaYimjww5Y1wrXJWl/KYk80 TuIkinCYpGo+tEKPPyR41ze9hcgMpYBgd79qGZ5YpEGUCv7QwXOXpf7toBTS5zOB1Omk 4ZqQ== X-Forwarded-Encrypted: i=1; AFNElJ9+tYhytLA2WMfOiqFh9ffvQaLbB8kme0NjlTVmRLvkTOcEORMjj99N5NcC748sZDxvJOc1d/7rrUUjN6E=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3As4iY594cwSiOjpcsaWkddfCiqJxSHP8beOWzkKW1hXpreOt Z21+Sgju1i4iMmfkl+WLeRQ4yfvndPaoWqlKkM0EOkK/lUroh7RZXYVpkRYl0WPOWG0= X-Gm-Gg: AfdE7ckJ4NA37OXnemssCj3casTTYEItZu93WbkLHysVIQt8VEIG0EJTz3HuVgrdq/X /kpKxXH52SpBIo4LO47LHD4dNVyfqc17kQuOCYtjoQnI9xUyquVPcsYdv8h5mjOARw+h0leV6Ok LVMFnD0zeUfKCA79KLf0FU04i90EpW06571pNUMJ2LNLCjfQoy+LNeKnCERsCbeRuduvgiAamqy daGXFhC5vLXLsZTBLXNQ6uJsCBGr+jw8G7idm80I3cB+azjGno12TpqOzYo5ZEQjLrY1Jq29y02 N7aQCsW9hB11tcYaMiDObc7iWzwq8SbLvBQjLKe8zAnXCLK/+HgIhmTTk6FvD6ma3fQDDbUor+J tcm4S+FIUxJLn2lIsV2hsSSeR6INq1v9IGAghtrH6LQ0wRZgBeyTTzFYbMPr2Q/UY/yqdVNT96u 42+AGOa6uleI8HV4E1Y/j0/Tud3g3W4X92M3DBXMq0hsDJ7X/Lv10Xg2A= X-Received: by 2002:a05:600c:1f92:b0:490:d354:bcf4 with SMTP id 5b1f17b1804b1-4923f593d92mr235161675e9.27.1782122068647; Mon, 22 Jun 2026 02:54:28 -0700 (PDT) Received: from ?IPV6:2001:a61:13d4:6901:78ed:1f08:f691:11a2? ([2001:a61:13d4:6901:78ed:1f08:f691:11a2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49240efc63fsm178656235e9.1.2026.06.22.02.54.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jun 2026 02:54:28 -0700 (PDT) Message-ID: <90bd1abb-1ce8-4936-bedc-59bedb3c8201@suse.com> Date: Mon, 22 Jun 2026 11:54:25 +0200 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: [RFC PATCH 2/9] rust: usb: add synchronous control transfer support To: Mike Lothian , rust-for-linux@vger.kernel.org Cc: linux-usb@vger.kernel.org, Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Greg Kroah-Hartman , Alexandre Courbot , Shankari Anand , linux-kernel@vger.kernel.org References: <20260617145946.1894-1-mike@fireburn.co.uk> <20260617145946.1894-3-mike@fireburn.co.uk> Content-Language: en-US From: Oliver Neukum In-Reply-To: <20260617145946.1894-3-mike@fireburn.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 17.06.26 16:59, Mike Lothian wrote: > + to_result(unsafe { > + bindings::usb_control_msg_send( > + self.as_raw(), > + 0, > + request, > + request_type, > + value, > + index, > + data.as_ptr().cast::(), > + data.len().try_into()?, > + timeout.as_millis().try_into()?, > + bindings::GFP_KERNEL, No, you cannot do this. You cannot just blindly resort to GFP_KERNEL. These parameters exist for a reason. Basically USB devices share error handling among the drivers for all interfaces. That means that all drivers for the purpose of error handling (and power management) are block drivers. As such they are restricted in how they can allocate memory. In particular you cannot do paging. That means that a USB driver must be able to specify whether GFP_KERNEL, GFP_NOIO or GFP_NOFS are to be passed to the USB layer. You must include them in the API exposed to drivers. Regards Oliver