From patchwork Mon Aug 26 14:09:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Francis X-Patchwork-Id: 11114713 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C186E1399 for ; Mon, 26 Aug 2019 14:09:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A92992053B for ; Mon, 26 Aug 2019 14:09:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A92992053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7436C8957B; Mon, 26 Aug 2019 14:09:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780057.outbound.protection.outlook.com [40.107.78.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id D65A889322 for ; Mon, 26 Aug 2019 14:09:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XHG8cVrC8EJWVKDDBpOVQGop0ItK7uEm4+e5bE1svDxNFGeGVF2StGSnICjYkL5X/ppwvHgF29N4r1RWvlnw6pGFUfDd6rdSrUvmcVAsPYhf/HMAUenOXXTU0CYgEc9DjBri75WpNlQki/NMBkWBCJeqCCtuzIseIhkmEJnCWEIcpdVtGGJGJbteP8xzlepGcInoRNK2MJALkPBXHwie8glnFYxeR9961e0g4IJM4QNYyRdwwo2hGXjas32tFyhsSRS5rilsFYTyZhfhVQr/xkVfZor6Pjr5Ogf/ARymc+m9+0XTEO1cQY8cRSL07rOv1YTyKg3z9m5JRCIfrVWnrQ== 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-SenderADCheck; bh=ipZkMogiVTtH6unVUU46wQQJlQTxfLxLr28XtWrgkv4=; b=lThgftws/CsMszTFoi0TyzQuOPwVOBkDtpQ5FdJNdhFeY2Uercim4tDpNHxkL4oEOpz2RsRThLeJGZ5YyihmJb6eZomKmDeSZmxLGTC5vWGeR3YQT7cEDmZvD661+VD8iG8BynAtUgyRZz/cdhpSIyZcQIB3jsz0R4xl2/uDSx4fXnQsGt2DnJxwKG4C576AaubGH+OPQjC1EDDDa+/a0Hm3BZ5APHR6lLiHUBU3jkkSTjBrUb+xUxGVXdeAwHXK4nJuk0wZzPpT+2v7+6mT69SoM2JDRd5q358lOk3LxNejSFpRKGj3nRy0v6mzEkteqSm81P7oqNEPzJbyrb4N+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM5PR12CA0071.namprd12.prod.outlook.com (2603:10b6:3:103::33) by SN6PR12MB2719.namprd12.prod.outlook.com (2603:10b6:805:70::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.19; Mon, 26 Aug 2019 14:09:32 +0000 Received: from BY2NAM03FT058.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::208) by DM5PR12CA0071.outlook.office365.com (2603:10b6:3:103::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.15 via Frontend Transport; Mon, 26 Aug 2019 14:09:32 +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 BY2NAM03FT058.mail.protection.outlook.com (10.152.85.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2178.16 via Frontend Transport; Mon, 26 Aug 2019 14:09:31 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Mon, 26 Aug 2019 09:09:07 -0500 From: David Francis To: Subject: [PATCH v6 4/6] drm/dp_mst: Fill branch->num_ports Date: Mon, 26 Aug 2019 10:09:01 -0400 Message-ID: <20190826140903.12580-5-David.Francis@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190826140903.12580-1-David.Francis@amd.com> References: <20190826140903.12580-1-David.Francis@amd.com> 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)(979002)(4636009)(396003)(346002)(136003)(39860400002)(376002)(2980300002)(428003)(199004)(189003)(76176011)(478600001)(4326008)(1076003)(8936002)(47776003)(14444005)(186003)(446003)(2906002)(476003)(86362001)(426003)(305945005)(53936002)(70586007)(70206006)(8676002)(16586007)(26005)(6666004)(356004)(316002)(48376002)(51416003)(81166006)(36756003)(486006)(50466002)(50226002)(2616005)(11346002)(2351001)(5660300002)(126002)(6916009)(49486002)(81156014)(336012)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR12MB2719; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93a0df9b-ec65-4a34-6f6b-08d72a2f0437 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328); SRVR:SN6PR12MB2719; X-MS-TrafficTypeDiagnostic: SN6PR12MB2719: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-Forefront-PRVS: 01415BB535 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: YECmtEgI0TZJpW+J4g912MZaBa2vnXqq16vmb/yQijEvhxSIWs+1cL5GGa6UOIMm6RjwdECiGMHC+gFKXPtEHG36/EEen+RgUGcnbkG/KwYfSUl2qlrgrdcrO9Mm/TeYuWSZ/bGgwzdKBtReuInEUy1qKEyVDHK09/hcPa3dqrvHdWD5T5OdHs32Z9Bw8N4ko6evfdxPG4LFQlzs+fwQcWr3gO+x9/VZxSxNy2YEGc2//V3ba7cRsJgaVNcayE5RGpHx3MUMqIWaDh5UBZ0hCumiRVvc2UrQNvvn1ZtyEWMBXIluCnyqCm+ruCO+ByJm7+FFQXHwEBj94r2aGBCeCe74DoZpXD8cCE9IPf+SXMo0BiZ8EL6fPGnVzC1wXXsbtF9pDY5J7SM6QKv0SrUOZyy0ESicUdkvfNHPdxhEG5E= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2019 14:09:31.7214 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93a0df9b-ec65-4a34-6f6b-08d72a2f0437 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: SN6PR12MB2719 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ipZkMogiVTtH6unVUU46wQQJlQTxfLxLr28XtWrgkv4=; b=uZEds9Q86PNh6K9te2v0aSQU1WF86jE4R1c/m4loe4TEHdZCLuDPZpTBNS0LqMiOln7w60gqcmnsIlpY3kygNkIeV+xA8PIK1gvLKBCnTBdFUEsO+8Bb3BGvO2E8xNG9dB8MlpUHt89O0iaUS/ri2/5dkgOqujhzcnmFEqqx2hs= 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: David Francis Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This field on drm_dp_mst_branch was never filled It is initialized to zero when the port is kzallocced. When a port is added to the list, increment num_ports, and when a port is removed from the list, decrement num_ports. v2: remember to decrement on port removal v3: don't explicitly init to 0 Signed-off-by: David Francis Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 9f3604355705..502923c24450 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1669,6 +1669,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, mutex_lock(&mstb->mgr->lock); drm_dp_mst_topology_get_port(port); list_add(&port->next, &mstb->ports); + mstb->num_ports++; mutex_unlock(&mstb->mgr->lock); } @@ -1703,6 +1704,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, /* remove it from the port list */ mutex_lock(&mstb->mgr->lock); list_del(&port->next); + mstb->num_ports--; mutex_unlock(&mstb->mgr->lock); /* drop port list reference */ drm_dp_mst_topology_put_port(port);