From patchwork Tue Dec 3 14:35:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lipski, Mikita" X-Patchwork-Id: 11271415 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 5C82614B7 for ; Tue, 3 Dec 2019 14:36:04 +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 44CCB20659 for ; Tue, 3 Dec 2019 14:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44CCB20659 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 F194D6E79B; Tue, 3 Dec 2019 14:35:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720077.outbound.protection.outlook.com [40.107.72.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id B186E6E79A; Tue, 3 Dec 2019 14:35:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lsosUfT2bhT6DCInXPTOL/QOScJiPEBpYorzW8C7/m4OMXzjJjxlEjM/J6sJdxaRJSb2lSXKzCDaNOl6tR7iWCu2aZEv0LduiZ0JmXkjJNJ42LmYK/SwRm0TGwMS23Ktx7oZ0SpO9HoEWIKtLHj2x+YaCyT8RlUmhVpXvYltYYcXGUuPafrPU9QtNy9UF0M/gxba1/xc17MBCGk0FPVYITotlV/B0gpb21j3B2dhVCLiWaBfXNU6PIy7ZGUVjTdDcc8qK1g/J/ec7DfpLXnKyNA6h+FjkYFC2XjycMuQG1CTmDVbFVLmTf2UUx+sLZEx4XPu5J8X7FgEXQnGAYfelQ== 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=3NlOTG3/uWiM+y3cYZNoNSd6OZOdSCN8mOi11eGW+1g=; b=UKAivbtwtwxVi291x++RnbT5dn3g4F1+mImMATRByumuC1wsDAWvQUMUPe2aK+kpLfiuqeMxFYCoDxPv3v5nF8QX9ixfj+xs+awIs14LIMEVM2OBKJpvWOYBNqxzA110s/FOVEA5aP1uyi+w4MWzHcD4CsKSKjQYnSYB0iN32hzi7Wg5X9DzxJpHI8qrzYmQxOBuqkPl7SKr3f9/O6nZLfqL+9k4xo+kppZyxxNW8P4FZ5z+B3GjxUjlmm5LU8iC2UbconSfWbXG8oNWSiJSJqBqYcX0CNy1KzPyT0oNUztgxyvoOgSwDBBA7pSm3OmDMQbXAdRhn8YFjMB+64oZ1A== 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 DM6PR12CA0027.namprd12.prod.outlook.com (2603:10b6:5:1c0::40) by BN7PR12MB2772.namprd12.prod.outlook.com (2603:10b6:408:26::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.12; Tue, 3 Dec 2019 14:35:44 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eaa::202) by DM6PR12CA0027.outlook.office365.com (2603:10b6:5:1c0::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2495.18 via Frontend Transport; Tue, 3 Dec 2019 14:35:43 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2451.23 via Frontend Transport; Tue, 3 Dec 2019 14:35:43 +0000 Received: from SATLEXMB01.amd.com (10.181.40.142) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 3 Dec 2019 08:35:42 -0600 Received: from mlipski-pc.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 3 Dec 2019 08:35:42 -0600 From: To: Subject: [PATCH v8 04/17] drm/dp_mst: Fill branch->num_ports Date: Tue, 3 Dec 2019 09:35:17 -0500 Message-ID: <20191203143530.27262-5-mikita.lipski@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191203143530.27262-1-mikita.lipski@amd.com> References: <20191203143530.27262-1-mikita.lipski@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)(4636009)(346002)(39860400002)(376002)(136003)(396003)(428003)(199004)(189003)(70586007)(5660300002)(70206006)(4326008)(2351001)(81166006)(81156014)(8936002)(450100002)(1076003)(6916009)(8676002)(6666004)(53416004)(50466002)(50226002)(48376002)(356004)(316002)(36756003)(16586007)(54906003)(478600001)(76176011)(336012)(186003)(51416003)(11346002)(446003)(26005)(2906002)(2876002)(305945005)(86362001)(7696005)(14444005)(426003)(2616005)(16060500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR12MB2772; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66741e87-9021-4d20-2e98-08d777fe142d X-MS-TrafficTypeDiagnostic: BN7PR12MB2772: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-Forefront-PRVS: 02408926C4 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +TS7OO9W+vZ4l7JhMqEfdi2lt5J73MoU13swcpGkxARWo/wRH8TOHu7w+GePqBELQPFk5D70gydHpGXzqv8cwg/n+qCJRbFxoTDeUGcWU6ruiKzVkqaRunQ+q0uOA9rQUnzm1NOQWkBiNvriAoYN1aRO1RY5mFx/wB5UcmzeJtaIZTaAxoX/QT2QFRD4VCHzzlk05fzCnuVb840UqdrCXEpXlhP//a7rJ4l1qk1C2DYZiEG0IFP3WOVxWdmSND4LP9/LiphNCm2moqOq0NWsK4GU4JOi7r/eRzFXd71svIzE5RP7hLCR3rOmk/+kRNgE+RELXB4Abe4JvmmFnutO/vlJqL4/AE+NTXc22qtdFWSFrfuNvMKF9LfRvMxyv1XJ5fttN5DVAwf5U1yQUEl3cesaQ0DwTXBduyAs+zjoUfk3H0xB88l5wO5L28MpP1Bf9KtiakcmSXzfWYnwEk7FHcJiq3He2rnv9d5UUnmtEt3PhK6vbeylIle+qBiYHLjQ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2019 14:35:43.9277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66741e87-9021-4d20-2e98-08d777fe142d 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=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2772 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=3NlOTG3/uWiM+y3cYZNoNSd6OZOdSCN8mOi11eGW+1g=; b=U1WfL6fYoqUWV34IK/km+mm6jNmqXz4jcjhVQje6tL2QQHInQBdTRyZ+TGKZ+dpbXeJ2OFeMpeKi2kv7Dua4dswL+8hmhq+qGTRqH1SAxkeOFYwLrmyn6WEsioGlYGTMZh5VG15nnF4EJfZdUJyjTXBearTT0ag1iEIyy5ghJ4w= 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 , Mikita Lipski , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: David Francis 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 Reviewed-by: Lyude Paul Reviewed-by: Harry Wentland Signed-off-by: David Francis Signed-off-by: Mikita Lipski --- 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 06aae9b52e8a..d74b767d0fe1 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2129,6 +2129,7 @@ drm_dp_mst_port_add_connector(struct drm_dp_mst_branch *mstb, build_mst_prop_path(mstb, port->port_num, proppath, sizeof(proppath)); port->connector = mgr->cbs->add_connector(mgr, port, proppath); if (!port->connector) { + mstb->num_ports--; ret = -ENOMEM; goto error; } @@ -2256,6 +2257,7 @@ drm_dp_mst_handle_link_address_port(struct drm_dp_mst_branch *mstb, mutex_lock(&mgr->lock); drm_dp_mst_topology_get_port(port); list_add(&port->next, &mstb->ports); + mstb->num_ports++; mutex_unlock(&mgr->lock); }