From nobody Sat Nov 30 03:44:45 2024 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2120.outbound.protection.outlook.com [40.107.236.120]) (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 E90481AC884; Thu, 12 Sep 2024 16:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726159519; cv=fail; b=MpOXDFYLa6Gyimgvqsn5WxZ3wE3vfvEVcehZ+4BUY8v9rPFhfLZ6Uzpkdj7FV+ePoBXEAckXxZrbqf+rLrptH3dogRlIsKIsB/jSXgTvAEVehLyXVkJ75D/RWLYLrCz8Oh99zkc1h1THgZT3Eqf8vEmx5NML9m8hgLYX2700nOM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726159519; c=relaxed/simple; bh=BHuIJ96Gt4xd5uYMNw+aOkIRAJHxXqco1FOOCCbyFCk=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=AZfgrsFHRlVM09tlWE8rh+poHaxBoCChvnj3jsI4mBUfi89GsC5GCL325aLXgio4pCaTYnpJl74GbeXiLoTRu518foT/ighj17w+rrXHCcKsYoGiwPaBX0Wp9XMNhD3PKRc29OiXoHiLYSxeji6fanLUJm3tMRkbIbGSZ58Y+3o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inmusicbrands.com; spf=pass smtp.mailfrom=inmusicbrands.com; dkim=pass (1024-bit key) header.d=inmusicbrands.com header.i=@inmusicbrands.com header.b=aMN3wGLk; arc=fail smtp.client-ip=40.107.236.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inmusicbrands.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inmusicbrands.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inmusicbrands.com header.i=@inmusicbrands.com header.b="aMN3wGLk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xwL7ZfNcSznYl2KGFbbJFqmc16uYOP4vcHhQAeaUU6Ku5vzm1Lz01ydy++hZM90INpcHQQ0NmHpAGjF5/fWhBeCi5WP5FrUZSA9z/Vy5VaOVw3/z+Chz8EttCQ4hDNy34roBoBrPLBw3cZgavTJeTLZU/ZGIojv82EmihrHZ0fuEvDNK3gK7fdisCb572w6Zxis0LPC5xAc8fAgyjYRvZPcmMSzIoNmzWHRmzpno97ldYUY3xZap8yMCMYwaB1AWaK/VeQAWvmYwZSNzxPwIdSfJ9CnaLzLozintqb7MXIbw4ftNrX07S6+ubIdXoX4lOrVRmdVOm1m+GahDXAUPZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GKyPZwGbw7+gXm8WfcDvpyx1mDAyJq7LqIAzYkT3X1Y=; b=GrLl+UUKblenVWCppWbpMn2f3wixy2AR66sJdMn7YIAvO4xkjkE5skPobmD8LWtbyiJpDQA3mfxKhf6JpP4J+ASiEaSpatCki3lu+Lw8BVqzq+O0D8waC1L89rFNar0hLQPZTc283ABwENldtd9QvpaeqnmWoFDxl3A0MMb2JZELKcumgU3l7qda+a1U343vNxDwQvvx62qvuaxQmfjWxgphLkOksadwvAGf0OMG7k+YWfqF65bSpArs6nyi23szL5s9wOUs3QryXRBRaHjxMySC79ztYjDna0T5JiepLB62w5td7Qs2VWvlE8KN0D9Wk7c08c2J5asDl2K8RWvt9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=inmusicbrands.com; dmarc=pass action=none header.from=inmusicbrands.com; dkim=pass header.d=inmusicbrands.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inmusicbrands.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GKyPZwGbw7+gXm8WfcDvpyx1mDAyJq7LqIAzYkT3X1Y=; b=aMN3wGLk1TP/iCDV5TxW+kVeMwrWLZbTX7gOoMQhZch+yflNWxW5gEDUHReqbJEPAVfioYnlzG43NwE15OE14bVwpAxpBtW02P8cGAa7h40zPAFS9Qhpnb+i0Sff15bT4Aw8R2V6XWVvyuD7Dr9ym2dS34+p9IY4k9tXli2LiKc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=inmusicbrands.com; Received: from MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) by SA1PR08MB7167.namprd08.prod.outlook.com (2603:10b6:806:185::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.25; Thu, 12 Sep 2024 16:45:14 +0000 Received: from MW4PR08MB8282.namprd08.prod.outlook.com ([fe80::55b3:31f1:11c0:4401]) by MW4PR08MB8282.namprd08.prod.outlook.com ([fe80::55b3:31f1:11c0:4401%6]) with mapi id 15.20.7939.017; Thu, 12 Sep 2024 16:45:14 +0000 From: John Keeping To: Greg Kroah-Hartman Cc: John Keeping , Roy Luo , Alan Stern , Chris Wulff , yuan linyu , Paul Cercueil , Krishna Kurapati , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] usb: gadget: core: force synchronous registration Date: Thu, 12 Sep 2024 17:45:00 +0100 Message-ID: <20240912164502.2134084-1-jkeeping@inmusicbrands.com> X-Mailer: git-send-email 2.46.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO4P123CA0203.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::10) To MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR08MB8282:EE_|SA1PR08MB7167:EE_ X-MS-Office365-Filtering-Correlation-Id: fcf82447-d69f-453d-1490-08dcd34a4663 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WL45x97t+121wuEfv1pYFrWmfLNqEEkKkxQcSKvCZoA5SgrJ8K3lIX1+eCgi?= =?us-ascii?Q?Dnes+2CuoFRBpV89KX2EgUgkrwMqq6qY2lXyWcI75R+AF5ie92vvzOx0Xj3a?= =?us-ascii?Q?bzXfzpb4bmm3qEmNVhDrQWdrdkQtXp2G+lTu4c8+oSVmzMaodHQVX1wwhWp4?= =?us-ascii?Q?84wbF5anyo1qGuSC/tIid4iojRG3/vm7yTTHSIqGp364RX5sB25T/QKvj45W?= =?us-ascii?Q?I/rPlRtfSwc4Y6pYvKe9ZqPqt8zsg0/g5xzeNSl3DHR0rWUhslQg3P8e+P1W?= =?us-ascii?Q?20aJloL1c7cWHDB3sP5VF7gPThh/ZGjsSpziHteLUxvQsTrvVWr8zKLxba2f?= =?us-ascii?Q?dWg0bIJhP+t45m8P7JvnGkmc4wqydqN/RwLFqH7+HDQpdwHhjzE7yuWaTe8I?= =?us-ascii?Q?WAV/M74mGdxBJz1F55Wx6l3LR51GsuSzj8B+biRUiBysTsKkF6MZVPmrGVTL?= =?us-ascii?Q?ZicYxPqhpM48N0P6ZoU80tPO5JtAK9Xh9pi+fZcFoz3Cje1JLALkEg3Hi+Nc?= =?us-ascii?Q?1ZuhmhiVo73+gHleVbSwG6lKqj4VRvvTqZG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Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR08MB8282.namprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KxijITHbbnev7CROiqZYa/7B/Ouhen2MTNbmxOCuzvHgKDMydjYx4lTte5Bw?= =?us-ascii?Q?TxHrB7LbV1yyKvGuqSvoRaQV+hj5gHc2JasKDz/v3HpkKTPSYTuBOk3fz8T0?= =?us-ascii?Q?YsSpWXe5zwtDjnOaZ26kymDPy++qD0NBdqi3frIhVbOn5HvVt/kaUB/nLogx?= =?us-ascii?Q?403umYoZEiJqiwoho7BH3lkZbxut6QW8YLZzjqhBxpXKocaiyeH2xDHKYTSy?= =?us-ascii?Q?RJCXVIon2N5kLRuIsf0qK4uRvEub7KcwPdA7hJs4gLoCifcTcmODhW5iXGup?= =?us-ascii?Q?FsStRxXhUSLKcZkD+Tvkx+DDsyYELB6nYm4f9Fam1M7qad4JzGjOYqN+8lgM?= =?us-ascii?Q?XOGx+L3MltuNAcI0lHasznlcu6XBooq4EkT+aBako8j38u3tIfbvRSD3ntSk?= =?us-ascii?Q?69n+aydwMUhRTEJAjxQ/Pb2mZyFHZTdhvCp9EHxU4FwQ0CoOYL7B76VVdv62?= =?us-ascii?Q?jSgnL/6F81mEwaVeRbI3X6Kgh2MJMVcRjn2oZt0ltzP3mPHVvotUTzDhQsP+?= =?us-ascii?Q?aRdequbj/fqKoqiDjA5YHsZLUYfE8EZHD6CX2eL9RxwOwtbloQCZ0HOHy0RY?= =?us-ascii?Q?c2BA1FlowmF+GfKITkT3l4/TUlnFP3BirwU+GPYeLmGwPCP6eXUaUudTlx2x?= =?us-ascii?Q?7mUsyZLWQ/JXD22ViOsPW3Xgm8f9q9bWzJnJsZxQhceL1thsP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zXvlcgAMFa3BjnhXAnFsiMvuiaz4bB3w7B1UJ0ZqAgfyE6cBo?= =?us-ascii?Q?tQ=3D=3D?= X-OriginatorOrg: inmusicbrands.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcf82447-d69f-453d-1490-08dcd34a4663 X-MS-Exchange-CrossTenant-AuthSource: MW4PR08MB8282.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2024 16:45:14.4675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 24507e43-fb7c-4b60-ab03-f78fafaf0a65 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QM/AgBwxhlKyByLDH4aQraLFb8v5/PoN8JhDBMr0yQM7Ii6ToBSZ/fRG5JiqoyFahg6LRNesr73j1JVQoH1veQ1JhIfVJgvb4f/kV96njnM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR08MB7167 Content-Type: text/plain; charset="utf-8" Registering a gadget driver is expected to complete synchronously and immediately after calling driver_register() this function checks that the driver has bound so as to return an error. Set PROBE_FORCE_SYNCHRONOUS to ensure this is the case even when asynchronous probing is set as the default. Fixes: fc274c1e99731 ("USB: gadget: Add a new bus for gadgets") Signed-off-by: John Keeping --- v2: - Add "Fixes" trailer drivers/usb/gadget/udc/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index cf6478f97f4a3..a6f46364be65f 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -1696,6 +1696,7 @@ int usb_gadget_register_driver_owner(struct usb_gadge= t_driver *driver, driver->driver.bus =3D &gadget_bus_type; driver->driver.owner =3D owner; driver->driver.mod_name =3D mod_name; + driver->driver.probe_type =3D PROBE_FORCE_SYNCHRONOUS; ret =3D driver_register(&driver->driver); if (ret) { pr_warn("%s: driver registration failed: %d\n", --=20 2.46.0