From patchwork Sat Jul 6 12:03:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 13725831 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2044.outbound.protection.outlook.com [40.92.103.44]) (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 8645550246; Sat, 6 Jul 2024 12:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.103.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720267410; cv=fail; b=tGe9yplNaZey69t5Xm2b9wGb3vcxtACW8K1omAhSN+WYhSaQs533yaqujPBokvyO9t8lpxKwM3Q3fVZAzEIqOe4M+ZVb1FSG5QITkxHZcwePCZzQgrBIbhcjRLH7gTUZCVWEWTlj64t/PwyWUkQNQlLP2EGGkgulVtIVpQX9/go= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720267410; c=relaxed/simple; bh=OFkKgxXvXQfLZf6Ayy/9sggFpDnWcjmfVYgIhHtU4ak=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=eq6NzWqIt0I1nD6R+rVUsLXXjMT6SpWVM+NRmHGLtwrl+zRetQTNMM9XmRhw5RqGv9uVFY/KFbGsiMGogs5PFD/oWitmKvb28dSP3Jz4pEdfH5T3eb0ARelrVIvcoqgtld2Y3SGm3LVDBk9PqeyOWah/iePlUe1i0Nw17yzy6MM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com; spf=pass smtp.mailfrom=live.com; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b=fwDHqypy; arc=fail smtp.client-ip=40.92.103.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=live.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b="fwDHqypy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MUcq6yBcdXvafI7m3dkUPYgnFQtibjsDWF4z1I2rXq/KWDOhWclgwR1gfYFW+b55+32AL4YSoj9SmqhorXLeokQW2/o4ZpR/X49oo606o1o/zA3B0Dk35jkPGCFc45a1eYViQhnTyJTe2qsf66ufGhkEivWVbu5l5jMecS/eydeLKDJ7s3jSuL428SI10gClc1gsipQdPKCKR+2cZHjD7VqnvZhjofCjolwP/7swc2v1HNSdPkUoW1eGE3vaetWsRk9e3iWwu4Kavb/KguESRl7KcskVHCnAP0/0MfrygXSgqCK/zCHodwTuVBR04zMxIs5cDn8rvbua+ark8I5PRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=kwcLnKkbwNtSh+Fo870t0RFr7qhod0dYfmejPREligA=; b=BM2ea+VbJt/3x57rzWp/B03Z8MZ/QewYCgX43PahAIl9t2sYhp4Sj0vLcOs1w9DBMzWa5E2tbbWEcSflf7UWV+fIfuz+0dmM4XN+hZhau28ItdAR1XV4z55s15A7ReK6sduJesZwswolFU0+vwHE1HbgADztcUizwlcpj3VVu0ZBn0+kDrvqLwCj/M5xLeuUZFM3/MCryBAQ4wUfRX/Y4w6t6QkwAXMRXbEfUDjCYez3T1+l6qOcX7q+BkqQcbSzrid+ubdLgmNYaFDykLPU6DzalHkzYftdRHDDT+vU+zivB4TEzA2zfzW2p//uxD7XxvMbJVoOX+nBrpAoWBSMvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwcLnKkbwNtSh+Fo870t0RFr7qhod0dYfmejPREligA=; b=fwDHqypykkSOgVb4QVwmJhORFiSkuaoyLh/Bx3+zn3gvjyb7t/6UQRwKZ8dsY5BBQUeKSDHysW3G22MzruLgNwX1wn1qM/Z8eAhYKuSIAU3Cm9VJ5FwywUOjq48fjCN1MK1FnJJSgZ+ZcE149OUYgGzYa8Ljtxa2TCg+iJLtU9w+Xrv+c7QSeTZBe8pYtYCEhfPkHowZyIht4d/xHnDPZKtQt+yK8avJDF84//BQ3Syn0tiz+H5llx1znlx/M1pcYyvi6p1SWMWPCtuV8vpLN2prYnyEH2FxNxWm5ElUEdTxRbuVZO+L5TMHa6Xg3y5i8Kyk8gCQC20zM/Uv50NTbA== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by PN0P287MB1624.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:17d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.29; Sat, 6 Jul 2024 12:03:23 +0000 Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a]) by MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a%4]) with mapi id 15.20.7741.031; Sat, 6 Jul 2024 12:03:23 +0000 From: Aditya Garg To: "gregkh@linuxfoundation.org" , "oneukum@suse.com" , "stern@rowland.harvard.edu" CC: Kerem Karabay , Orlando Chamberlain , Linux Kernel Mailing List , "linux-usb@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "usb-storage@lists.one-eyed-alien.net" Subject: [PATCH v3 1/2] USB: core: add 'shutdown' callback to usb_driver Thread-Topic: [PATCH v3 1/2] USB: core: add 'shutdown' callback to usb_driver Thread-Index: AQHaz5yATQSWsAoR5EajX9/4d1hpBw== Date: Sat, 6 Jul 2024 12:03:23 +0000 Message-ID: <7AAC1BF4-8B60-448D-A3C1-B7E80330BE42@live.com> References: <58227E2C-1886-40AD-8F80-7C618EF2D8F2@live.com> In-Reply-To: <58227E2C-1886-40AD-8F80-7C618EF2D8F2@live.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [U4rtLmwegwRIHk+0PwiZxhf/nvZs8+RJq4PD412TrtedcSJXzEzQPGwLXhHna4urC/YGCPi0ktw=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|PN0P287MB1624:EE_ x-ms-office365-filtering-correlation-id: a11fb56b-9440-4ec7-74c7-08dc9db3a297 x-microsoft-antispam: BCL:0;ARA:14566002|8060799006|19110799003|461199028|440099028|3412199025|102099032; x-microsoft-antispam-message-info: AUQCQOOfy/usDIygSCWcZEFJkbh3cl9fyAPghxReHdVgkuWQGwKpRe+jwolSE+9BhhnytmK2tomuNN6aQKQVnd8LTlq4uRfJjEVIGf3VWpkWtrUEfS44grNrrdC1bqEKAfQsG4xztnfmDsmcs95wzQ03522qS2XEJdsM/qCM6YQiMHo5wjTGsrByyXwWGLkthsnjs47LsC0zpt2zUDM+2f1LoobVbI98jUzHt8eBTN4K3OBTQO5ibQmzHNbA/RuGZPX1yqKPiKoVQVsEqKN7CJvU/m4VEwZUAaL/6qGcWQ6wq0/hj7p+jlpm50bhkK99hilYpltKVP2AzDfD7t8IO8EVwVkqwTwwwnX1aem0khNO2dJiEl6P8ZUiZhkpBH0MO8BgmbiuRC5v8bzcp1XSxuMNmr8RKqaO7sIu1tDI3REqKwDmHRDGgggO/tp49PmFKjUymQWFiRyNC3SZWKw3Cq0yFeJbu7Tf14+v7xkba2vV6naUs0Ff5mIPDhKejzNHDhern4c1A1gfQhQy0oUFkheyoeg/UiyHYMbOmU5Pb6Oau2TEeOQrTmE+XFEf5IWflirt0QoqhvAmwdlEjKTYIh0/msIFl4EmWEmF9IZEFCnsjaYmmfBPpbH/yqGEyIbOpm3KH3uX/hiC5vxzJFHOXA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: C7zhr7j4Qy45FJSVAKp+ukFF/pGhMglvqaCwsaXme2Z7+zKYytjauOfT60OJqX992QlcTmJFdNFsh5Stkbo2K6dvazukGLZ8usH9SwoA9bPa5vv5RlLhqpyf6iVzLMF8Sy1wvsmU+JuxgAIANSzRqKr+NOr1YBjBOhEi1XPNX0R1EK5sHl2OOHOXvdgP4buRqRVZgUlatSN4L2fFSSBzY28pXfLxUyq+ZY0XrfFgk5Eq0WL5Ivyw4X14zI2xBoBaBn0VWuQoI5LYl99QoS5Pjco7sA171hH9C9aR7SJbktTEvfwigocv9WsZvGapG0wqx2vhOmMVyY58cgBcabwinR1B0D5EecrP20wim/2qrHkazNixos/A/vZyh09GJxAyz6vjAeiDLtVUFNr1/jXLE+RUfI/muGoqNrg3ofKLEFEUkJ4YQ2CDXHfrhe70b+LXTH21XP7h6n8/KWvYOIhqYsT8x5BeIHcNod+sVHGqIeukVTz9X9vhYdDuUPf7AsmLKZWUoLGkfxE2iIuOfOO+ADQNp/nqOSQMNyMVHYuvH0rL1NvrSZdobjtGu1wSqZdwHoSTguY3LX+LSCLqVu9cMsiD79BNR2NYbGyHfpHxCNWTFRC0yBxgGJwiVENK5vClueB+IAJVOxEOyLGjwjrjkZ9xTl1iJqjj8tX59qbjy3QGgFgINHzFb2oaubpBwV3JV5KMk5w71NgUVwjFLo4Enw+3Pu6JMl2NCiy01osd0WKxftSBKxjG6tQoyCOjhg2nZPv3PDhdNTmwWhgGEP2V5xWtazHhUvebXsYL3/xwFfiGN43wA9afODR8qULf26ebBiumq5VVbdF2gYZ8C2KZCbVwzXZDDkqhuwvi9nz1RYq2nR317HjToA86apT6suLzP+l5OYuez15dfPAJsNZ9s097yI19vWyw3bURToGPxUd1p+BunmpZStsE3XNod7vuJFKv5Zmejp8d9/p9+cDJJu+dkz+/Neqg+RxBtsIHXIVe6PHGbwT8vjKGNorjUFC55rXWDBjbu88DPrbwLS0WsEEs6Qbkv/gPGlmjmCPvdbYRpxWKP5HqHEhA4zPYHyahX3N8UZ90W5Xx44fyT3TEdJUVP6iMLuf6LPZJ/LqBRPdl+9tXeRBsXZ14ySD9VcWSak6yq/lWuaWTx3jhJeq51ytkuTPHBzhLKMnRVqfBdU41sFzCXruqVpbQhgyG2NbVxepQdgMZCqqB9U5UNC8I7r57mRZ7jHOJownW3x86Ox2w1wsfzA7S4LkDTjHGW7ehsz/GSZMsg0/4uRmALVM8NCmLifSE+lp0IpohcT0P6JWEATExR7CqsEB+TN58SVXa Content-ID: <0E6B6729E4CC4C48B8BE0511A9813B06@INDP287.PROD.OUTLOOK.COM> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-24072.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MA0P287MB0217.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a11fb56b-9440-4ec7-74c7-08dc9db3a297 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2024 12:03:23.1677 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN0P287MB1624 From: Kerem Karabay Currently there is no standardized method for USB drivers to handle shutdown events. This patch simplifies running code on shutdown for USB devices by adding a shutdown callback to usb_driver. Signed-off-by: Kerem Karabay Signed-off-by: Aditya Garg --- drivers/usb/core/driver.c | 14 ++++++++++++++ include/linux/usb.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index e02ba15f6..b35734d03 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -517,6 +517,19 @@ static int usb_unbind_interface(struct device *dev) return 0; } +static void usb_shutdown_interface(struct device *dev) +{ + struct usb_interface *intf = to_usb_interface(dev); + struct usb_driver *driver; + + if (!dev->driver) + return; + + driver = to_usb_driver(dev->driver); + if (driver->shutdown) + driver->shutdown(intf); +} + /** * usb_driver_claim_interface - bind a driver to an interface * @driver: the driver to be bound @@ -1059,6 +1072,7 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner, new_driver->driver.bus = &usb_bus_type; new_driver->driver.probe = usb_probe_interface; new_driver->driver.remove = usb_unbind_interface; + new_driver->driver.shutdown = usb_shutdown_interface; new_driver->driver.owner = owner; new_driver->driver.mod_name = mod_name; new_driver->driver.dev_groups = new_driver->dev_groups; diff --git a/include/linux/usb.h b/include/linux/usb.h index 1913a1383..832997a9d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1171,6 +1171,7 @@ extern ssize_t usb_show_dynids(struct usb_dynids *dynids, char *buf); * post_reset method is called. * @post_reset: Called by usb_reset_device() after the device * has been reset + * @shutdown: Called at shut-down time to quiesce the device. * @id_table: USB drivers use ID table to support hotplugging. * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set * or your driver's probe function will never get called. @@ -1222,6 +1223,8 @@ struct usb_driver { int (*pre_reset)(struct usb_interface *intf); int (*post_reset)(struct usb_interface *intf); + void (*shutdown)(struct usb_interface *intf); + const struct usb_device_id *id_table; const struct attribute_group **dev_groups; From patchwork Sat Jul 6 12:04:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 13725832 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2053.outbound.protection.outlook.com [40.92.103.53]) (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 C389D4D8BD; Sat, 6 Jul 2024 12:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.103.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720267497; cv=fail; b=I2uZjpx6imIug4R3g5oT3PHjTgiQHRSWtmwfte32Scd5EYvLd62joSmO3KYiJKwUl5kYS/p1nrMPNbLt1bwcXfGJJc6BgneadWuvw2yRt1vP77gS+pdTuhZQGePQBhSlf2HqdB0TNJT8qNV7roo37Prt2q7b3lh2XSWXB7wvdrI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720267497; c=relaxed/simple; bh=4GVtqrG6YOOrKej8NeCw9MfDv4Lqn6Q4011D2PQlaS4=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=fV4dPIY8fiE397W63YQxZGwLU1O3ZcsXumjCuap7Z9wP6wba65VTGZ9v+7TigeokPNVDJcMB81hcGN7pbfmum/aMnPH5ZVK2j1w/ffluCX1MOVL+IuPOvOnxrCqCrxuWodsSVeEULMTzZFFgSY0FgrXzlHbkygKQnqecxKrHnUg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com; spf=pass smtp.mailfrom=live.com; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b=jbjQ5m+L; arc=fail smtp.client-ip=40.92.103.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=live.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=live.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=live.com header.i=@live.com header.b="jbjQ5m+L" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WWao5yovabtbV7ht9rg4q/GcryseKSljCvD1bb/tdxqgcFdm1XInSb2u+Uw7yZYWDoZsJvYagdIP/wWol1UQPBabpyxHGxjzzqiO37JhM+Ocr05mBweKSgl9stKL3Tw3zH5DLZA1r7d6a2aDL3b0yAXhIvf4Z/efjNtFJBWW3ZVWuBCixO48WluuYB2BLj7fh/dobSIbYkOMr3y9hthl1kofwHAYkH1Qk1glh1DaVd8+5F8GprcLCDJVEGO7EGKvyBichFOfKq8ikFGvZLxHa3hm0vrQJnbu5MfgbHD1RORNe29Q4pU1hFgqj2wm12rATLBPX5eZ0nfzveBPWRMdHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=s0+HzOAKgOSOLCTPB+HgtrTZfYPWy1f2kawCiB4UfQI=; b=X8ax/Ee3uJz/4HDRjbgXudiN416UDi6/QzUNVuEA0DfqZkM64Fe2LSB9E6nIzzi9+F6A9N3RypQzIq+HYy+3TLK9SJKEpJPI7PGK8c6rrpcarBlon5jUrQNvIJpmDh0hO+e55Z9l9TI9tthGAfWEvIFEwl/7jNuvJth42XXXWpwr4a1tflM4brnr5uKyLdxA4HrEzoo/M1ZRYHXqpO3jdVfro6j+Q0MFLWqN/2hNJm9LbMc8BzCHBOObhRMHAE8dlS4BejLb/fHWzajwCglWIuiDposloLnzYRQrSTv67V1JjL1NJzTCWyl7L+YgwnYcTXwmuDwDBNzq8IyA3Yf3Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s0+HzOAKgOSOLCTPB+HgtrTZfYPWy1f2kawCiB4UfQI=; b=jbjQ5m+LSWVZnAp30sKl2v6sjn6itbBxPX2HCbHCESwAlbZZRT5A+w5RzuN1IqCC9UXzVIXa4WUGHMvylsEpRYxTfXQOG7RkYIxOLONuJT0NQcp8fee6rZSWyoLCEj1X5zXj0K1BXq6CksJSFr2OKZ5UVqVzAW2efzH69yVbA7AUAWEZk1T6qCmtDJzDJkU5oYKj8orInv2gIwPACNfg/pdpC4WvyoNNfbLUkuK7/hda+h+Fglh7oalz1UQZDicp6TNRDdiWtQ2jc5JFkVWqZyKYC088w1xfVo6f12xRKI9GHgfgyztKc/8Z3g99QArU456zza7TlQaQ7hz5Gw6bzw== Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:b3::9) by MAZP287MB0611.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:10b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.31; Sat, 6 Jul 2024 12:04:50 +0000 Received: from MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a]) by MA0P287MB0217.INDP287.PROD.OUTLOOK.COM ([fe80::98d2:3610:b33c:435a%4]) with mapi id 15.20.7741.031; Sat, 6 Jul 2024 12:04:49 +0000 From: Aditya Garg To: "gregkh@linuxfoundation.org" , "oneukum@suse.com" , "stern@rowland.harvard.edu" CC: Kerem Karabay , Orlando Chamberlain , Linux Kernel Mailing List , "linux-usb@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "usb-storage@lists.one-eyed-alien.net" Subject: [PATCH v3 2/2] USB: uas: Implement the new shutdown callback Thread-Topic: [PATCH v3 2/2] USB: uas: Implement the new shutdown callback Thread-Index: AQHaz5yzQFDokFeVvUid6lhswzVMIA== Date: Sat, 6 Jul 2024 12:04:49 +0000 Message-ID: References: <58227E2C-1886-40AD-8F80-7C618EF2D8F2@live.com> <7AAC1BF4-8B60-448D-A3C1-B7E80330BE42@live.com> In-Reply-To: <7AAC1BF4-8B60-448D-A3C1-B7E80330BE42@live.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [ddM8LUVMufN/Fhdntw8EyoUfkzl7a8mxYB1LVr4WCWg95ai8GIKjYnFTeZZdWt3a2myn3CqqQps=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MA0P287MB0217:EE_|MAZP287MB0611:EE_ x-ms-office365-filtering-correlation-id: 8811a9fb-7eaf-4b37-af9a-08dc9db3d64c x-microsoft-antispam: BCL:0;ARA:14566002|461199028|8060799006|19110799003|102099032|3412199025|440099028; x-microsoft-antispam-message-info: OagswoGEC3Nztk1EowYWjQLRpG++/2m9tac8Z8woiQWhpbhJOcW/hfsamM1EZFkxLrXa6WW7UxInrsZJOviKfVsHRXXUvI0/Lpe+Y8gu8kVQKtHxaBua86wn99ilUA3WvAJkMlfm491FAW8Kr0RpmZNSXorZwSfZ0+TZUmv8OCfSoXklfYiqquPCliQGyPb3B1re/hdtfyW0z2JmiOaAxXC/jSAdj3qjjFtljBj79ZYUkGn479wLNpvl8eIDFw1mtTfPqYXrht7LOUtSseTj8XVf1Fg00Ydbo6igiG9o3u8YMEMRUWb3I6+yUNn8Z+7Jqjgia5HLrtxROFhrBl5GYm6Q2xj7MLclPl222iQmJ179xynUJ6Pzefz3xuZyTa/peFxFr34LT7eSB99VRK7/ll6q3Ymtb1zdhnN0kZzscA8o+NsiPmxPIlPvKkVRbfe9D+XdCVK/7DMEwQA9pilwk3QJTjj0JRgYGiHgrwC40KtypOw3LXUZzGxpdwMM4WwtdW9J+4afnTokhThugTH3XCnUNZqISUHElsjIroU+1VMsKh5s7BTbn4s3dgjGjA5f2RnNL3xNuDEHNoCBleTdYkD1RnUAgSE2kEhAoI3ZbGhEGKnsVrUkDJE3DV5pHZwbohutk7rXWMxv0dxFEaZ5sg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: KVXD6XgDduyrxcbCiNlfx/5BYR8i/H1z1msb7uS76UUEJWThkN3lEWnrtWC1/fVrjtQCRdgnE7mOShOIkujxPo+ubEWbVqzcAzWWdpaTTgRDNiET5xPzrR+03Mh4p+7H5JLko79tCW9x2ZhSyH+6tB/YkDshLd4Jbhc6n44b5hPIff+Qxo1+6cGPlq6XkFcRrrD2tvXHMoSu3UNre38MW/r0OSwzJDB1f/dUV+obvLUHEGKH8VPmnogy3ta5bGrX0QC/c7OUYzQOY5blrOzOCWY3dxAneaYCFtrO1+IQL6Y88EGOC+nNyjivGU/GlaUmg3lgC5XcawTCfxwJVsdIScIqBUh0O7my5Ywxho4UHp3ID3YrsJokH/cCGou/YtQd4CmrLtZwgWFnvGMF3x8NqOzCqkURofXWH/J6jZdBaYFIZBQfks+rswBpnxX7cq89eVVdmDcQT2JsLO0T8Q1UGMfO0WudABVD8r3BJOOM3inchfwqrf6n0uPxYn0fte0EWdiamDAz4Lw84eF1m07YOXt9ij/zU1MyKGl6pSRiK4CNR6G3fDrhRf4nYc8djMg2UziWySyQtVbABrdfnkOdxBMgtXHYIvzigXBQk3s3AgXzBc6KBJt/AJS+FNVH5baDqxfOIgeFp4GGogIb0bvuUkVbM9rD5getb79KMwrgvSTKOP3jKROWHWXEa1LQmLZNSOG/0RPn0exL5xKOXhkQmbK7t6h1ZnpkHecgIkQNnjFnpgrT5RfCI09EdPFohXTeuur5EMShgPA3aTI2smsNLXdp8J4jTD3I66xub3EXeTqqcihjnQzkiF2FIiVFLAm0N+tZUH2kUy28UqHL1AU9Kp76St0iw3VuciHQupw2yX1X4vsekmvdoPicb3OlgAmuaiLiK4huCZlCwOBwrucNdNxOZb9bGK6wTxZLTLcnaQqGd2NHgcVGUiQ8zUKYIPDdbz9wWF4JkuxLHuNNGaLADMuKCWOXyDZ1az3kO+eCMRyhRTCU9outmysn7PzuxlGBnbJy+Roykj+9PxcUynvr2e0Xz6JNnvX8bzTJuDIUOSDqfBmdsbcqHasZjJ4rwtbgb7DDVB4Yo1Uflr1aEbOJGMsDCS/EhBkYAtZvBX+y4/O6Qvr8u++y53Gl9REOR/IBDgwEzC2F8vIAnRMKNk1279R326TgjFIj7g57ohX53Fd1aVIH1U9E/mLUFb3M1w6E0+dXhhXiNLu/T372wrPOfYB57xnZTLaqS/s4U7atQF9qi0ZHs1y7Wg2XhcIN1mkTCEZui3kdSm3jWeiVBAmkT91OmeMeaUk/lqA05vfDfkT+DVBPjBqLKVWQoyuaMPsG Content-ID: <4066DB1C1A0D2B4993C86A646AAB16B7@INDP287.PROD.OUTLOOK.COM> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-24072.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MA0P287MB0217.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 8811a9fb-7eaf-4b37-af9a-08dc9db3d64c X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2024 12:04:49.9232 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: MAZP287MB0611 From: Kerem Karabay A standard implementation of shutdown callback has been implemented for USB drivers. Since the UAS driver implements a shutdown callback this patch enables it to use the new standard implementation. Signed-off-by: Kerem Karabay Signed-off-by: Aditya Garg --- drivers/usb/storage/uas.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index b610a2de4..0cdbcf825 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -1232,9 +1232,8 @@ static void uas_disconnect(struct usb_interface *intf) * hang on reboot when the device is still in uas mode. Note the reset is * necessary as some devices won't revert to usb-storage mode without it. */ -static void uas_shutdown(struct device *dev) +static void uas_shutdown(struct usb_interface *intf) { - struct usb_interface *intf = to_usb_interface(dev); struct usb_device *udev = interface_to_usbdev(intf); struct Scsi_Host *shost = usb_get_intfdata(intf); struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata; @@ -1257,7 +1256,7 @@ static struct usb_driver uas_driver = { .suspend = uas_suspend, .resume = uas_resume, .reset_resume = uas_reset_resume, - .driver.shutdown = uas_shutdown, + .shutdown = uas_shutdown, .id_table = uas_usb_ids, };