From patchwork Wed Nov 30 08:12:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 630605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46B7BC433FE for ; Wed, 30 Nov 2022 08:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234413AbiK3IMT (ORCPT ); Wed, 30 Nov 2022 03:12:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234383AbiK3IMR (ORCPT ); Wed, 30 Nov 2022 03:12:17 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10FF27B1B for ; Wed, 30 Nov 2022 00:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E5CykABcE1vABNpQM+d0u2/IWt44Ql2QCMRirnpz7iLI6dhWfe+KVVdWE3MEa+tz7rbYP1RCUPHI3PScJpa2uRxzYTcyfZOCCOPzSdFAgsGq0irRQsJzYLXg8YmhQ4EMGDeTHQ/pdPXoEpRZSIUnBNrokBLZA/5IsyPVLfkwInU6zgtyofHTAo/o9/XMRh1ovtcCqnGoGYHQ57m44/6TsoR7wqwlTcnWs8AiEVq24dFidplHLeAOY4cW6JJAf9IC1jJDKssBdDUFygU6ETcfL3fk0QG58Fhsc+HYL49OnP/XsI7gvrnNTXM8jOI542nzbXs8pGPqlzFle4lSqA1yhg== 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=pVU2GNHqNVB3bqGiwjV2zYo0GiWsKjZhGHt0BQwwQlM=; b=Oe7NGk7WJp5cbY+zxZv2LNpMV8ff0kS3Vk0GvbEHqd4Y5RyJD/ae0odPM7jsSYJ9jytdli6dIZui4vWoI7l7C/Q6EEflCMTB90pFDLWo6UNW6z/xc5IBZDjnYVsKXgEpMj/lAdR8jJrg1BAni0evlLJhrZhW/y5uVbpeE8dggs7vn8or/o8DiydD1T6vTPxaiCsYpT6WOXmb0GMDYSpTP4IdTY1bVOijhXH8g5VMllWMgkPR9+8ecRCaFv3BYk6T3Hx4dZcV+avndNEuMOJhdFTg7/ek50ChrZwvxpkjCjSuF5eHPlxOlwt9i8euf+2nXxlJqHJm/75ZztwL1RKC1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pVU2GNHqNVB3bqGiwjV2zYo0GiWsKjZhGHt0BQwwQlM=; b=FlRZk0X3pB1Q3HQcWmj6MGjbyU/60O3YvBLMyljimMLAMpMiUixyY6k1vrc+PjyLYI7fPzj2gR+mR/oIp0MnuvRAaRke4LGFQ/ojd3M8+QnYgn9zysmsCgEc7UFaab8fgKs7I2bXzVNSdBX6jH4RdIjObK7Q24cXz6PAOv2ZTZk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9591.eurprd04.prod.outlook.com (2603:10a6:102:270::18) by DB8PR04MB6890.eurprd04.prod.outlook.com (2603:10a6:10:117::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Wed, 30 Nov 2022 08:12:11 +0000 Received: from PA4PR04MB9591.eurprd04.prod.outlook.com ([fe80::8184:d5e2:3c61:b493]) by PA4PR04MB9591.eurprd04.prod.outlook.com ([fe80::8184:d5e2:3c61:b493%6]) with mapi id 15.20.5857.023; Wed, 30 Nov 2022 08:12:11 +0000 From: Xu Yang To: peter.chen@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-imx@nxp.com, jun.li@nxp.com, xu.yang_2@nxp.com Subject: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role Date: Wed, 30 Nov 2022 16:12:29 +0800 Message-Id: <20221130081231.3127369-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG3P274CA0007.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::19) To PA4PR04MB9591.eurprd04.prod.outlook.com (2603:10a6:102:270::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9591:EE_|DB8PR04MB6890:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ba3cf4c-4448-477a-df78-08dad2aa94c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UQyu5+tdV1w+LVpnroGU2Eq2BsZmx9IhSrlaYNmmEE7m2xszzYa9yiDk9bRCWRRd2HImwqfZa2PXq6+Hj0WGf1byQWh6WU0hXWZRnmG1Z72KK80QiT5h/UtxK3NgayiXPRvhFeXkUO375e3va4O0JbBMEDBwNqs0rBXkK031zc16u411rs7SaTY1mK9zWkwqsa0OhEMI6yuIf5NoRGFrjPnHE0xhePzrVy0ffGx+x0Qi4mNByuN3U/JIgMdXJWIZYuqy5d6mz3mWOE4DyLXlhBzo109r8zu+qP9mIfVeTWWQDQ2J0CEq2XyGFzGcbCkk2LoQM8A29XYoIx/8diHlM7M+AqWPYK5YuEDpGmPy0TtW+G2lWxGqsfccbwqp2xUb8WIxqMLi3QVe1BzdVIgb+RZGk8NWCbwPgISXK+8ZT1wkTIKXICU3V/yNGgBn1ZdSnsL2BnyAJUNlOhpi5Lkz7PD9Tl6Qpv4PEF+4X4j76efzhCX5ooSCqveVSWQNe6jnqn7zWQyawaY+1k1Z511J6dV/OjpBDDqh+YWfQC+AtjDa6aldd9InyR/xibwsjkYJhDcEC32f6AtIjpoyYrRx5NeAdOWDxIWPrGVDg4Ey2Zow8QHJeP7KYNTxeMVg7CZ/qFzddBT1Rtlz7y9JhnKeH/O3NXmS8CObFK7KddQbVd5JkHcU6jD5F9y0KySMGGfP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9591.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(366004)(346002)(396003)(39860400002)(451199015)(2616005)(186003)(1076003)(6486002)(316002)(6916009)(86362001)(36756003)(38100700002)(83380400001)(6666004)(38350700002)(52116002)(6512007)(26005)(6506007)(478600001)(41300700001)(2906002)(4744005)(8676002)(66556008)(8936002)(5660300002)(66476007)(66946007)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EyNlJZBnH7FDSi/Qsx17+yt2eIxc2GrZhU7//JHiMUSwKjRZ+WZCycY7vGXq/VsI+FLMgtL1/YH1qSnQwEhTHALYk+Cd6NpHcMN1/qkqyPJ+qtGh2kXe6IJxJSNd+95fF+63j5kr3yqfjR2YzsgZ6csCM1o9nQykauCHfi0XxHuMwYs4IDknMycVO+74K7RcK/g6rFcdQ86e/5MzW1CWPh20vPh6tf52s8A+L1/0pzLbzUJpo0oOUJEHCy+W/NaWSqdG1SQTV+uUsMO6JFSF6I19gN5uB8UjRO44e/BYkbGnBmdrWcNyvI2IcWuCf/oARMaadLk98Ed5+9dER1DDs01iKGOQE+x4iS1TIg8cKksJ9axqTv/ugZ4t6psEBAn0mQhVgiuJwpheq/ZE+xB8XaoCc/Rar65FxI+mn3Rt58gjxjXZsmYq2EzO38zTztMSKo35JurDZbhIctEvb5wsn+lrmRtngC8nYLZLj8iCSOGQQ2VagCQPeaPgeyPeADJrSyEIBMjni25NdCNTJLh5a4nrqjBityS+1jb66aYBOnstMbc/9aaAqZzX6n1DKwrbktHvljsotOhiBHEaGJUt8NvFAdYht0PsftgAofCINucZQ4FvEwZZR8wWMYYknNFm6qngfskSs4anILzoU5tKdEl16gONDjvFpedF1KK0KFY6CqLt0CTxXVb2y8cuFOsQNGYC9Q/D71G9fTJoWgojaTJQGhhXORL/i6rApsydyC1gIThM3grpn9NC4coggZwiLDnfYKm8Ysjc6N7PHXhb1/RzI12LaNjj+K4bGyfaJuvacmU82L+17VomlquSVFBgYK3EnfDRqLd4TrnEjs0yPlxJela/uiHpRFuem3ovt628rvMAIziepv5pjKtY8VmfDf3fSA+ryHrzVUUMIOdOuL49pCUXLE79oPrVBxjUrNUkBcqsZpYOU5C7PVyb8J2x7reZcqsugI1N1FBun8wrfoXltUTpkVAk7yO/g8Fyz4IuPTp6i3hjo8r1IZm4+5O3RSO/vbzAU6H6lESVC/XT10Q6ICuGCo/cRuJW1SL+hImxLqcgSL7PpPM2iN6ezox8q0kkHN9muXowyCtTeaz23E6lcG2DGiyg1RqbyZ5ACRupgUVoA48zvI8QvvRbDuFH7BOr5E/fqxPNy7gEXbku7ojd+Dj9h9384bazVzMgCv0eyQPd9IMNCfflHPjz/AqBJo4nNIRef/43q9ubZmWTyYFger9Ea4FQ7zW9Jdd73kiXPjrSJ6w1AaN1c/5y7vbpt6lf1gJhI+AIv0T8ZN7Y5BKCMbzQMKGsnzzktP4LnNXKbaebPeU/3jUhwn+DNid3i4hL38eS1OGdVBLD0d1v70hr1ovmfJIFxgdjNvDsYQ3WZ4hxiwz4KDhTBtxnTCpyDL/CP9A9mAuJ4/3QOuOpBxDAN87sk1LDWRixMlP51UMHuhKhojvJV0PKkfpcelm4nPoY04C/NZ7u039HhVQAlhwZosfgxVKFsvcodcEzsX2+mAq8LWChkuzIC09/if9FeQl3vshZ+ikfspFzCOfuIPNnfucAhheSy9/gPBITzUEcWWTOnatPQk1hez7G46e6 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ba3cf4c-4448-477a-df78-08dad2aa94c1 X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9591.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2022 08:12:11.1165 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eQNubG84jBe/dS76nNo9HBShAWq+CBLpRX5o6nxUYI2cRGKS8CIYXVhTC5OX5WUrALyAx37gMXHDm8nwN1YLSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6890 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org It should not return -EINVAL if the request role is the same with current role, return non-error and without do anything instead. Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group") cc: Signed-off-by: Xu Yang --- changes since v1: - no change --- drivers/usb/chipidea/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 484b1cd23431..fcb175b22188 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -984,9 +984,12 @@ static ssize_t role_store(struct device *dev, strlen(ci->roles[role]->name))) break; - if (role == CI_ROLE_END || role == ci->role) + if (role == CI_ROLE_END) return -EINVAL; + if (role == ci->role) + return n; + pm_runtime_get_sync(dev); disable_irq(ci->irq); ci_role_stop(ci); From patchwork Wed Nov 30 08:12:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 629851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB638C4321E for ; Wed, 30 Nov 2022 08:12:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234416AbiK3IMU (ORCPT ); Wed, 30 Nov 2022 03:12:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234406AbiK3IMS (ORCPT ); Wed, 30 Nov 2022 03:12:18 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2C3E286CB for ; Wed, 30 Nov 2022 00:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9YuiaXChafKxrOISaP6NtEGaTcqgxxKBD18693VCB1BL2cBtIZ6pjio9tawDub3sxGsaGiqHKwvDb3FdN7CMFICcQFIWYcFNus4wFk4PneUA0a+wK85LVkoiZRzI8OEbZ9jewGrO2VvP1LOUhnwefe/IOAhhDKGqR9E88mYY92k7rVCmCF1IbeVXW2gc2tD+mVox2eQdMBSgEk89WecSYBumGpP3JwKBQthDNbV6zzkfj0LzUQEhONhd1d5V6DRbPWgd6GNl0KKhXA94KhpfMYcfPvW30v1PlalmRlYzU+N/nAgOFvYZ9EU5R+Gh+LgluZwV/7fh2ngEvMgsw5wvg== 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=eXBPszWCd9nEPdrCi1uLWZsK0c2BbN5D7tkGFOJG+LQ=; b=NkP7aljBDajuN/Kr3pYanccC3y1wjSFvsmt7fx4122YyqrLv9wEL7ijU5ZE88C2H0+G2/lq5dkeb89dYBu7Cg9hWaGhGnIZRw82bc2OicpDMWezWNxJnS0fFyPNBxwv7UlnAJA9Hr8vJP5ge79CR7xjkDIVKf8KHQAa0Ku4tna4CPZcp6vGUJTfu7fZoDcx1CsoQc44bJRE2h6QapeJvYRB1f3dyRCnDjCl0yazvanlIRcpwCpcn//ICK5ucyvyDqosJTJiVMC2nwwAhRtBZ8B9vh2XARWraMq+s7640DHofD4MK2458gPeo4dJVQ2U8wUHtoD35NN8mLMqXzjpnbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eXBPszWCd9nEPdrCi1uLWZsK0c2BbN5D7tkGFOJG+LQ=; b=PsidLj+UPtLqVo8nFtue/GINVMpg89K+mvptZU7tLlOHs/ALoxScK6Gdcnv7dcwH5nRyABPxcWP9Q5pzjt1vm0NsnQH/jwAC2jl3MrhdPQjN1me4YaEU6iiOwsrSQ8Tm3bYSDKRCMh09iGGnUKl9b6KoFwuAA/lckq5NGwPLcyk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9591.eurprd04.prod.outlook.com (2603:10a6:102:270::18) by DB8PR04MB6890.eurprd04.prod.outlook.com (2603:10a6:10:117::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Wed, 30 Nov 2022 08:12:13 +0000 Received: from PA4PR04MB9591.eurprd04.prod.outlook.com ([fe80::8184:d5e2:3c61:b493]) by PA4PR04MB9591.eurprd04.prod.outlook.com ([fe80::8184:d5e2:3c61:b493%6]) with mapi id 15.20.5857.023; Wed, 30 Nov 2022 08:12:13 +0000 From: Xu Yang To: peter.chen@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-imx@nxp.com, jun.li@nxp.com, xu.yang_2@nxp.com Subject: [PATCH v2 2/3] usb: chipidea: core: fix possible concurrent when switch role Date: Wed, 30 Nov 2022 16:12:30 +0800 Message-Id: <20221130081231.3127369-2-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221130081231.3127369-1-xu.yang_2@nxp.com> References: <20221130081231.3127369-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG3P274CA0007.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::19) To PA4PR04MB9591.eurprd04.prod.outlook.com (2603:10a6:102:270::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9591:EE_|DB8PR04MB6890:EE_ X-MS-Office365-Filtering-Correlation-Id: b73469ed-5a25-47a1-185a-08dad2aa962c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ETgdDkTOtk/R2VNAtG3xKBZ2pNZiUbIvhyzFotEDE1lXxcTaCXnxQdY05v8fN7jSTJKiVwpNcqfVgPs5vChYUCYNaWoBhie52aSEwIS2ZfFK9KOZxSQ0FWWRWlmHJae5sptxbuzVYN9ySlwdZ8dAGtbz+aRNTbQWfhiHJDzoIoIP8pa+RJ2oiBdPuGBZaTJlndPxvMdDXTVe2U+6mFaSApmxTzCHxPYVNJVk/w9hxq8JtceZ+9BJHR4LpGucQGxcAgB6PLekxztalQ64TM/RznLHabJ1l2nJ58gFz5wJkidPbDNegOt78srm27g7n1AhrNQtuj6iwFgdQOZGpwTIEZRcL9EwV6NnY60/oRE43i2bMoXj/6meMTmNpAc0HpO9IbCHy2zqR8dd9FpM/yim2vTzGx5oZfjhPKRWdejwdlWfQob8CeHdXynD1UqY12hTH7KOiqZglp7dqzI58orutna/23NupStMoIzOxEfHdngnQdiiXWoYdoGT1RSND1Mi6UmhPWdRBm2UZOhcVccbdj5S2eCpUFgK2DXpbG3+wEskKgQBH3gpVKSQaIWE0+2Z1HPEQWL+qNEJiU2oSjH6tKvq+DtS12dSFbzo8A9xJmuTqggSlt3LFoVnNCXLrjzx8yKxWEZd9FzWlq8A3+Ke+QddqXr1UOidNovMRiCA4X3LKssD7GVOtzEgjXHmhIXP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9591.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(366004)(346002)(396003)(39860400002)(451199015)(2616005)(186003)(1076003)(6486002)(316002)(6916009)(86362001)(36756003)(38100700002)(83380400001)(6666004)(38350700002)(52116002)(6512007)(26005)(6506007)(478600001)(41300700001)(2906002)(8676002)(66556008)(8936002)(5660300002)(66476007)(66946007)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7ix4Ofo1kUiHe8tJPULpHYyPc/TqaYasecf5TcNq3m10kIRR+KK0/D/ZGIhW0oAWWV38j9KmQBc3dV+7/B/m4gBdMuj/cgE7cpe2tQtgaM2xzpoCEedPGcGpVzMDByr3WNuwfB6voVyoNGu9k58ZZqpju+2gzTW+f/lTHsFR3yEhTQ2DfkxdW4xYBY/MAtF4LEe6XvVFp4XtxPb998dKFYSCnYuaedVA5+ggydnRG6Uu966tqLfDjdVPsrSf3jjEWLoetS9+P7gqdB/Ju8qAN/W6iWpqDsUhkawtf0Q5qEnWon+ACj4xGjGwz5hWTXUVqK5TXKZBtoG4eIUnGPT5BsRohE/ZYNLtruZxAYqOBIXoEj9ipB0pmRUlJfqYOqXxbN68HNwLMpopkCTEyrGFLKrTdc3CtagRvn2X4BaS3Q67xlk9FIBxJed9Y4G06Z/StgFkz4lWSxIxu6mt7xN96D3DoQPg6fgk6Bf8+h+oo2SCLJ84tKVBQTQM9YyprPBsz04RO2gMquegOAmuFAucjuFHBdRg2F8lrBHx6/APIvTeZ638v2WuvI3mli/375N3wSJMTzg1EKiFlIs9VvC3oetVs5ifByNDxNOK+9FtKLIwO1O0bPhGa/zDlX1BxYFafFdZH6abavP56Wp3bWRwcjuv4FD/AEChO+MS6LT+WwXhqnDC2Q7YZIxrxHWpTLgN9zCnwBzvpB0lbUG5Fa1m5XB6pV56xHLsauP84wV0ljiRK1NJZTAzKt3Ph6plEO8lkKNFPWCC4LIOzSXxYvqsAMrc437JDIKb+BlBCY1xo0GuGYgfcbGG1xZPaTZtTuNW/ogyphVcY2yij4/CWG2I7Ife6ZPkR/R8W2ipVcFMhgqP8KnwLYuJr+XD7GFfrF0P9/BSyR5T68u5S1DMcKqv/fGVZOh9jSMVCJkYk+Os/XJ+aB71XYfkhI6y8mqEFmRzpLDsgwnC4vj38A35gGdFIioZccSl9SMUGnXLZMqlrG0RrZgeanZkQviqWnEvItqv3C2umdK67uOj2QAw2o50WFP7uOakdY8Q+EyqAHBn9mrcOP3zHRZse+emNOqKam4ommOA+tVpIttvex+XCd8WT/AUpr9scDWTvS7qKAlTnzmi4vamOTKZ80OPW/HSJGW1m+U6VrlyUyNO+QmF5TXS7oDM9VQrlNdxzC8btYmgg8PaFQEUrkJP9QAiGIfxNzCwoWlFOfXFKkK01lNUHWPLZ8exXxGIaw4uS/AAD6fdhvbPC1g9Hwn4CWQ5UGFlAd5KAFCSJ0VfEddq2Gz0CxXwKYo4tdnP7rA3ZK07J5u4OspxgvezbzH7GhgfDydHoGGS+6XkjMfRls+cWzBFPuW9WfxiE3RfGojfRtJRZlzBZ3GFkw23KIvKlL9qSREUxrqd4jd2jH7ewngGAGLZVghsuUzV0GBK/eNCknn7PfWaBD3Ur/s9218Fz5A/CnuggD+bGgho1X+pODrYDG+9b9UI9ThXGpWiQu5kMwtsdLGCnMiDdgyIcKTlvZHcXHIxo0kOWDpAZcKQnZCQklk96E1tsMeqUSHjjqKroRBnZ1CFcXwRj1waGMIcy+i02sNbnvPE X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b73469ed-5a25-47a1-185a-08dad2aa962c X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9591.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2022 08:12:13.3497 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6MKC595bYVt2lqt2njZjbxZ2k146gHCo7pMH4CwddkyzZVZfupjopMk33YnubYaqXA3X93yV5idYPGbCQ9TlxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6890 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The user may call role_store() when driver is handling ci_handle_id_switch() which is triggerred by otg event or power lost event. Unfortunately, the controller may go into chaos in this case. Fix this by protecting it with mutex lock. Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group") cc: Signed-off-by: Xu Yang --- changes since v1: - modify description for mutex member - wrap role variable in ci_handle_id_switch() too --- drivers/usb/chipidea/ci.h | 2 ++ drivers/usb/chipidea/core.c | 8 +++++++- drivers/usb/chipidea/otg.c | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 005c67cb3afb..f210b7489fd5 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -208,6 +208,7 @@ struct hw_bank { * @in_lpm: if the core in low power mode * @wakeup_int: if wakeup interrupt occur * @rev: The revision number for controller + * @mutex: protect code from concorrent running when doing role switch */ struct ci_hdrc { struct device *dev; @@ -260,6 +261,7 @@ struct ci_hdrc { bool in_lpm; bool wakeup_int; enum ci_revision rev; + struct mutex mutex; }; static inline struct ci_role_driver *ci_role(struct ci_hdrc *ci) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index fcb175b22188..d7efde30d59f 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -987,8 +987,12 @@ static ssize_t role_store(struct device *dev, if (role == CI_ROLE_END) return -EINVAL; - if (role == ci->role) + mutex_lock(&ci->mutex); + + if (role == ci->role) { + mutex_unlock(&ci->mutex); return n; + } pm_runtime_get_sync(dev); disable_irq(ci->irq); @@ -998,6 +1002,7 @@ static ssize_t role_store(struct device *dev, ci_handle_vbus_change(ci); enable_irq(ci->irq); pm_runtime_put_sync(dev); + mutex_unlock(&ci->mutex); return (ret == 0) ? n : ret; } @@ -1033,6 +1038,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) return -ENOMEM; spin_lock_init(&ci->lock); + mutex_init(&ci->mutex); ci->dev = dev; ci->platdata = dev_get_platdata(dev); ci->imx28_write_fix = !!(ci->platdata->flags & diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c index 622c3b68aa1e..f5490f2a5b6b 100644 --- a/drivers/usb/chipidea/otg.c +++ b/drivers/usb/chipidea/otg.c @@ -167,8 +167,10 @@ static int hw_wait_vbus_lower_bsv(struct ci_hdrc *ci) void ci_handle_id_switch(struct ci_hdrc *ci) { - enum ci_role role = ci_otg_role(ci); + enum ci_role role; + mutex_lock(&ci->mutex); + role = ci_otg_role(ci); if (role != ci->role) { dev_dbg(ci->dev, "switching from %s to %s\n", ci_role(ci)->name, ci->roles[role]->name); @@ -198,6 +200,7 @@ void ci_handle_id_switch(struct ci_hdrc *ci) if (role == CI_ROLE_GADGET) ci_handle_vbus_change(ci); } + mutex_unlock(&ci->mutex); } /** * ci_otg_work - perform otg (vbus/id) event handle From patchwork Wed Nov 30 08:12:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 630604 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 043ECC433FE for ; Wed, 30 Nov 2022 08:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234419AbiK3IMV (ORCPT ); Wed, 30 Nov 2022 03:12:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234415AbiK3IMT (ORCPT ); Wed, 30 Nov 2022 03:12:19 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A23929CA3 for ; Wed, 30 Nov 2022 00:12:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IerZKNiROUXAN2WxfmjqAPySsY/qmVPybSt3sZNfvPAHsbMF6sOTEAwDehs4AS/805kBVansn5r+vEV97nAlB1IKkwQQszKTUD0WhYsfK0XCQERFQtu5F4coySlAhJgRJfor3aCSnxCcXer4uh3NOCvmSgifRiYjBsOWDis5CCkeWXrq9CC8SZ2y++VRiG1CjL3cbUOij/iIfZPZNVR4XCsvk/q4YSWUS3fRf2t8qPUmO1uDvQ6h17RVdWYjj4lkenXVpWIeoZ4ZUIVc3liFAAimuW4ktt7I3NUSSdUUFLsyCTpxuXm+FiWPNnp2YI/Y/1P+OBd/HHgiU2eoloGl4Q== 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=XPUoAnGq+H+wjLVrZ9PfD0JoUGh5ZiwNr0OG9FsdIyA=; b=AYF2jYIS9Tk2/yvCppVtdK0Ah8NVREKDj1K+BIknegc1YTsIiSo6ZOMWR/zYNjYt+C6SC7Z4nYYhvc2C/bJxUxEQsyPOeKfjPmufLzB6c0VyYEEcwM4k/YNioROxVVe1OL3qJK0FDBybCRi+r8OfmlF2VmFi5sYzPjkHKvgNUa3QYl0Y0jJDlY5c1YUE5SHow253+/C6vj3O5BFuMd6HUOmTnVua+OKfPnXasbbGpQTUk6/xm/L5gKu4W0vl3Z0ECVCZPX2HXRuv0XUV7kI3wTsgsUD6XzhxrYfaOfaa5elqEiHvvl5i5HXGmIWHd/97UIRJ2FmQeEGiLXjTHpQW4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XPUoAnGq+H+wjLVrZ9PfD0JoUGh5ZiwNr0OG9FsdIyA=; b=h+s0Y+CJ7dVcSr1Jnq7x/N8MURM0egQS4f/SBrNenFUf+srR8c87cqYPoa22WlPsUX3kKLkMzg10I7NxGn1yTES9FdAwUEIY8chj7HxqsuoFq9FqduA5ovBjnsSo8c7T7Bi/O9GPSx4hKtgVFeFV+A7aXy9uY6IH6rWcTsZmXcE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9591.eurprd04.prod.outlook.com (2603:10a6:102:270::18) by DB8PR04MB6890.eurprd04.prod.outlook.com (2603:10a6:10:117::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Wed, 30 Nov 2022 08:12:15 +0000 Received: from PA4PR04MB9591.eurprd04.prod.outlook.com ([fe80::8184:d5e2:3c61:b493]) by PA4PR04MB9591.eurprd04.prod.outlook.com ([fe80::8184:d5e2:3c61:b493%6]) with mapi id 15.20.5857.023; Wed, 30 Nov 2022 08:12:15 +0000 From: Xu Yang To: peter.chen@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-imx@nxp.com, jun.li@nxp.com, xu.yang_2@nxp.com Subject: [PATCH v2 3/3] usb: chipidea: debug: remove redundant 'role' debug file Date: Wed, 30 Nov 2022 16:12:31 +0800 Message-Id: <20221130081231.3127369-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221130081231.3127369-1-xu.yang_2@nxp.com> References: <20221130081231.3127369-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG3P274CA0007.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::19) To PA4PR04MB9591.eurprd04.prod.outlook.com (2603:10a6:102:270::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR04MB9591:EE_|DB8PR04MB6890:EE_ X-MS-Office365-Filtering-Correlation-Id: b8cd1fb1-a493-401e-fca1-08dad2aa977e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jIEX/pRG1K8AnZyNHWVY4gbRHyk075P1cvP0tC2XJo4PMJa91wSKRXOmlCw4kG4akfcoK1JbIp6s9s8sWK9HuVJwMPCSycVb0B6sJ2XVS39GR4xtfucTZdf9nYcExjpIMBA+KNt6zc8UwU+L1np8w7n0rlKFIvcjLa6qmkARg4LChdhS4ikwgkRHKN7qwn+fyy/CMcTa7Px5DSMQxjKfi0cyrW+nkg+KzmQlH58CAjWaZbfMqXkWqLic3v/Px84KjUfyr41B/CU7Ok1MVMmFUpEZV8N/oSgbCkJI79ZZNnZk0qBYOJpayYBYKUSizpFro/I64NSP8fAgMLlJJAYAEe4lzPVFxiqcT9N+nwyJsmo5QZJHXeSNg4YwkRLIshF9w5uTcJ8BMpztUyb10OGbX2FMSL113w+r+htwwvwdbi0bXj3HiJRTxV/IRcmcxzRnBCc0MroSDLGUEuJy3yQxGJlE5QNjRqYx+1ZOp/TCD2I4CC0nPeBsgJmKdU4MxPZkB7/VaJ3Egb5a5atwdqseaI3rO/Bxdj1ICiNtdDQIs63IXASFGZQCmgzW5V5yJ9unCaH0WVIZZLbbVKObrMgQ96iHmwhf+RosFzwvrAML1BTFa5YcSVCRFdhrFsn5MuMTCWPY/Xgr27bjA4vM5euiwr1ZCPk7RetU/Qg7Nu5SDmdCzbmrsTLsc6g16irMtPR+zDHa40sUqT3YJVrriMLKSQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR04MB9591.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(366004)(346002)(396003)(39860400002)(451199015)(2616005)(186003)(1076003)(6486002)(316002)(6916009)(86362001)(36756003)(38100700002)(83380400001)(6666004)(38350700002)(52116002)(6512007)(26005)(6506007)(478600001)(41300700001)(2906002)(8676002)(66556008)(8936002)(5660300002)(66476007)(66946007)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a4Rndfw1m6ro0g0Xy98VCst/dtVmn5Vil7534BSPaFCNigdU6qrutmggfypUvIzBr0AlRFrKqz+UA7deNcFLiG4oC/S23Dzt0TeFHOx5ZiKn1/+0aBwHr0SUctfVKNFYo952bYKhJxNW9EsqIBdktT26W8AcHc+1CTOFaPFxyDo77TQAQv1r/hsmnI5KRk0N+pZAJnzAHWNUT07yBxq4Zc3/Hv8wsobhYfM/jz7vppsjLHigVq46NPd1Rk1EidSkaKzKxiDnQaWx+Xsuf8vC4XF//B1DNT7D0dciDEspHP/jVcT8xujqEYmk2UsBJXgXllB2NRJN8avd3smkb03XeUajFvA7y22EFTrkrXn/DIUYHOFwJSaF0TKzHPKbPdpxVFyH8zQ0ffclsVQy39eKH4n4+0LV9qPLyh/ZsHNUxDDYXfsKKq0RmqMECjXeS0GJjuyRVxLde9ZG0szP280LSgN9JhzBP+xGDLbapN+yXq299vWwNv5ti8Tz4LEjJK47D06Y4SOTmQ8TX5XqQ6foAjHCRaj1pAutuBKCZwVIQ6czvPU6kJmGGkAGQIojDLFPN1J10eKut92I/AS+f6YYFZwZV54C7Hi7onh5KL03bCFXmFzaMc/5ojPJQVuI+A+14jIPTr+nMipWtYnHUmZM6ivzCzE09vRb7MUPp9jmGu1Dm+SrqwM9bPhuQEh/mvIDPZLUa3uDssdPeL1AEi1WFAoeppmknBpevOz7HYI644C0TQMDIbNPMGxE0CZYsBre4w92PsTf4AI2kDNR5lIZCUhCYzuGpXzId9v750h5/Xbeeh1n4J0CenJPqieOjxdAA0lO2wozHlduTFb8YvzvxVDfntZDCy2qdnZFSkNK0hTBr2FUZCvQAKCNl9P5SNx9F6ogV4E3t+7yuTQLaKLcNH/yHGeNnr0cBEUvaJvpRcbtnIPAPYYmmqN32jkn1g3zE10vyRgDIlnpvngfQ995MFLNlZMiP2l+bzJk7my3ArxuO5HaGfeaLPwvsa5J7PtYxPAAuj6S577bIjvqXAvkViZ093Ne6sBXAhJj9fn7NHK7UFEwOxVfcqs6gYNNxCpcfH9iY3JZPMA3ySmlqZSyzwQPu6iapTBS+emBu+Icazd+c76aVDGNRcKkqPubswPCNCMLQ+8DG3SbfN59NDNvUJ1Z4aDW4pYs7i2JXAHfq7uDfXc3DAZILy8cy2RMYr4b3hUPA7sosT164SeFebJPWG/BWRvsN4kJXbnb4zIYeGtffH18ckWuDupd97aRgQpYIRIqi2SzkxZcYL4zH70e1lszso80TkO2BCFY3PPfouCkJb9FVoh2JsqslFx+O2q7v5cpgUDOvbMbyvMnQZJJXsBU8MSL6tIfqBKRd186XUpl/vWZZAnn9POJ/0lnOqBsfleAIbEoy1Nmw4SjjMmT9bPs4PEX9cMGPZ0s2TvYsxCgdEwLaA9N8mNocMlyMqaQPxM/Av+RVq1pcYQdfu5JIEdNBSZU548PePc4pCYfl9IqWw5RK+3qoYQvHzkzMWUulOkVKfwZY/lUE3JSP4VYEj7o0XqojH7/W6lRkuNv/0gq9dB0f1WpVX0T4EA9f9Bd X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8cd1fb1-a493-401e-fca1-08dad2aa977e X-MS-Exchange-CrossTenant-AuthSource: PA4PR04MB9591.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2022 08:12:15.6489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bWRomxYxZtzsE8CTZC6ELRM3PjcaQY+c3Ibyn8mezvAWuieRV8hBGccqATSdvJ2Dy5X1krzKeaQoqswcHjLgQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6890 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Two 'role' file exist in different position but with totally same function. 1. /sys/devices/platform/soc@0/xxxxxxxx.usb/ci_hdrc.0/role 2. /sys/kernel/debug/usb/ci_hdrc.0/role This will remove the 2rd redundant 'role' debug file (under debugfs) and keep the one which is more closer to user. Signed-off-by: Xu Yang Acked-by: Peter Chen --- changes since v1: - no change --- drivers/usb/chipidea/debug.c | 55 ------------------------------------ 1 file changed, 55 deletions(-) diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index faf6b078b6c4..37da83de3cba 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c @@ -247,60 +247,6 @@ static int ci_otg_show(struct seq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(ci_otg); -static int ci_role_show(struct seq_file *s, void *data) -{ - struct ci_hdrc *ci = s->private; - - if (ci->role != CI_ROLE_END) - seq_printf(s, "%s\n", ci_role(ci)->name); - - return 0; -} - -static ssize_t ci_role_write(struct file *file, const char __user *ubuf, - size_t count, loff_t *ppos) -{ - struct seq_file *s = file->private_data; - struct ci_hdrc *ci = s->private; - enum ci_role role; - char buf[8]; - int ret; - - if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) - return -EFAULT; - - for (role = CI_ROLE_HOST; role < CI_ROLE_END; role++) - if (ci->roles[role] && - !strncmp(buf, ci->roles[role]->name, - strlen(ci->roles[role]->name))) - break; - - if (role == CI_ROLE_END || role == ci->role) - return -EINVAL; - - pm_runtime_get_sync(ci->dev); - disable_irq(ci->irq); - ci_role_stop(ci); - ret = ci_role_start(ci, role); - enable_irq(ci->irq); - pm_runtime_put_sync(ci->dev); - - return ret ? ret : count; -} - -static int ci_role_open(struct inode *inode, struct file *file) -{ - return single_open(file, ci_role_show, inode->i_private); -} - -static const struct file_operations ci_role_fops = { - .open = ci_role_open, - .write = ci_role_write, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static int ci_registers_show(struct seq_file *s, void *unused) { struct ci_hdrc *ci = s->private; @@ -354,7 +300,6 @@ void dbg_create_files(struct ci_hdrc *ci) if (ci_otg_is_fsm_mode(ci)) debugfs_create_file("otg", S_IRUGO, dir, ci, &ci_otg_fops); - debugfs_create_file("role", S_IRUGO | S_IWUSR, dir, ci, &ci_role_fops); debugfs_create_file("registers", S_IRUGO, dir, ci, &ci_registers_fops); }