From patchwork Mon Apr 22 23:56:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10911731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FD2214DB for ; Mon, 22 Apr 2019 23:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5215527FA8 for ; Mon, 22 Apr 2019 23:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45F6B287C3; Mon, 22 Apr 2019 23:56:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C0DE827FA8 for ; Mon, 22 Apr 2019 23:56:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 682E4890DB; Mon, 22 Apr 2019 23:56:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0605.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe49::605]) by gabe.freedesktop.org (Postfix) with ESMTPS id 760AE890DB; Mon, 22 Apr 2019 23:56:47 +0000 (UTC) Received: from DM3PR12CA0060.namprd12.prod.outlook.com (2603:10b6:0:56::28) by BN8PR12MB2963.namprd12.prod.outlook.com (2603:10b6:408:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.16; Mon, 22 Apr 2019 23:56:45 +0000 Received: from CO1NAM03FT024.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::203) by DM3PR12CA0060.outlook.office365.com (2603:10b6:0:56::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1813.11 via Frontend Transport; Mon, 22 Apr 2019 23:56:44 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT024.mail.protection.outlook.com (10.152.80.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Mon, 22 Apr 2019 23:56:44 +0000 Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.389.1; Mon, 22 Apr 2019 18:56:43 -0500 Received: from leodev.amd.com (10.180.168.240) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server id 14.3.389.1; Mon, 22 Apr 2019 19:56:42 -0400 From: To: , Subject: [PATCH 1/3] drm/dp: Use non-cyclic idr Date: Mon, 22 Apr 2019 19:56:26 -0400 Message-ID: <1555977388-14203-1-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(376002)(346002)(2980300002)(428003)(189003)(199004)(4744005)(8676002)(70586007)(8936002)(51416003)(50226002)(70206006)(305945005)(47776003)(81166006)(81156014)(2616005)(126002)(336012)(476003)(72206003)(86362001)(486006)(4326008)(7696005)(97736004)(478600001)(426003)(53416004)(53936002)(16586007)(86152003)(5660300002)(14444005)(316002)(36756003)(186003)(54906003)(110136005)(2906002)(2876002)(26005)(356004)(48376002)(50466002)(6666004)(77096007)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR12MB2963; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9202aa8-ee12-47fd-afb1-08d6c77e2c8a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BN8PR12MB2963; X-MS-TrafficTypeDiagnostic: BN8PR12MB2963: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 00159D1518 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: xxr+51UZbQ4Tm4g1D83d0T5nsitkv4tDIDX64nIqjwSDO/txhWdQQAYtWRZP6x6P0gvg58GSV98oPz61GocN8xGaKm4Tf/95g6k6JRTJ8StvTlKn94dn/ECs3bYfIj1SABCEq73vaYKVZEiamrV1O3TyfdNR5M1eINfaO0HZD/eKBBDAqWjc6xBzmwadul7j7O8BK45vCXh/OHlvnsC09d3Z1C/cfGGLzjz3V3qBTwxwxEnxYQO3F8s+qs5oV19k4z5RGjUl4BX9vrvxo4DvoNy/TTkJxlU5nTaNu+GrymTi9TeiT8IU/xHJRGgZTxytY22n+AvhuOS1HlvbvZLTPXCNJW1N9lP4Oz8EzQPTpDJAzKSZlUPuiJKsO3NAILjPpTqORoPxnA1gf8CqbBXqAxCsjWt0KjX32daxqDN0cz4= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2019 23:56:44.4315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9202aa8-ee12-47fd-afb1-08d6c77e2c8a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2963 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1s6pR6oVk7mlw4/kcJswKJQMvwhJfCmajI2Unbg9vb8=; b=OnKVQg1o0BRSDk8zLD4txAfp23wvlBv/7ga4tDb4VdPcCTqgDhMGmMegL5g/MUr3+CMkaldKtUNpMNqS13fTwe9JUWYWi64dyKwgDu2uvE7BDiQtVD7CaCTmWNZg4xUQOJcKk1r01f9Ud+mGncy1gPIXaL40Emj9zvxZ8h2pUq8= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , jerry.zuo@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li Reviewed-by: Ville Syrjälä Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_aux_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c index 0e4f25d..6d84611 100644 --- a/drivers/gpu/drm/drm_dp_aux_dev.c +++ b/drivers/gpu/drm/drm_dp_aux_dev.c @@ -80,8 +80,7 @@ static struct drm_dp_aux_dev *alloc_drm_dp_aux_dev(struct drm_dp_aux *aux) kref_init(&aux_dev->refcount); mutex_lock(&aux_idr_mutex); - index = idr_alloc_cyclic(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, - GFP_KERNEL); + index = idr_alloc(&aux_idr, aux_dev, 0, DRM_AUX_MINORS, GFP_KERNEL); mutex_unlock(&aux_idr_mutex); if (index < 0) { kfree(aux_dev);