From patchwork Fri Dec 18 22:14:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 7888841 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 300019F1AF for ; Fri, 18 Dec 2015 22:15:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A379204FF for ; Fri, 18 Dec 2015 22:15:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3E6912035E for ; Fri, 18 Dec 2015 22:15:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 800F56EB0B; Fri, 18 Dec 2015 14:15:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0071.outbound.protection.outlook.com [157.56.110.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5228D6EB0B for ; Fri, 18 Dec 2015 14:15:05 -0800 (PST) Received: from CY1PR1201CA0002.namprd12.prod.outlook.com (10.169.17.140) by SN1PR12MB0718.namprd12.prod.outlook.com (10.163.209.20) with Microsoft SMTP Server (TLS) id 15.1.355.16; Fri, 18 Dec 2015 22:15:02 +0000 Received: from BY2NAM03FT046.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::201) by CY1PR1201CA0002.outlook.office365.com (2a01:111:e400:5b9a::12) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Fri, 18 Dec 2015 22:15:02 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.221) 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; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp01.amd.com (165.204.84.221) by BY2NAM03FT046.mail.protection.outlook.com (10.152.85.84) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 18 Dec 2015 22:15:01 +0000 X-WSS-ID: 0NZKR51-07-367-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 23F52CAFA98 for ; Fri, 18 Dec 2015 17:15:00 -0500 (EST) Received: from SATLEXDAG05.amd.com (10.181.40.11) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 18 Dec 2015 16:15:30 -0600 Received: from STOREXDAG02.amd.com (10.1.13.11) by satlexdag05.amd.com (10.181.40.11) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 18 Dec 2015 17:15:01 -0500 Received: from cnhwentlanub.amd.com (172.29.225.36) by storexdag02.amd.com (10.1.13.11) with Microsoft SMTP Server id 14.3.266.1; Fri, 18 Dec 2015 17:14:59 -0500 From: Harry Wentland To: Subject: [PATCH 2/2] drm/dp/mst: always send reply for UP request Date: Fri, 18 Dec 2015 17:14:43 -0500 Message-ID: <1450476883-1586-3-git-send-email-harry.wentland@amd.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450476883-1586-1-git-send-email-harry.wentland@amd.com> References: <1450476883-1586-1-git-send-email-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(87936001)(19580405001)(19580395003)(86362001)(5008740100001)(105586002)(101416001)(92566002)(50986999)(106466001)(586003)(2950100001)(50226001)(53416004)(1096002)(1220700001)(76176999)(50466002)(77096005)(48376002)(5003600100002)(47776003)(450100001)(189998001)(110136002)(33646002)(229853001)(97736004)(2351001)(5003940100001)(36756003)(11100500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0718; H:atltwp01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0718; 2:i7Z1Az6EApBXwXgNSgP0G/95eE8SQYjkod36w7L5ARzVeZtpg1lpBHMnAvgK/poC8LU7LksWZL0uExC4WAFPimakR31AO+spghh7h081gOCW7HghSPdj8PUDbuO3YpxOHh/MTeGg57qYWP7YHgD+Dg==; 3:g3Z7n3X/Rmu/W3md1D1SLonFmW2xn0JMymeaZA3COW+EFnHFwhIcwRxdeE3fWQR1abTJAGuR24c+sq5ZCx+lQI+ZV7kgFjuw2qsuN+7ZM980CXyr7sKvoxjwz+1BJMYwrIviqDPm7lDTBd4k+ZKgvtE2VPj9n0eO7ISjFRLknWovCdBruxovqfc4JdCC/N2iewNF4TQ8TL499pJWynRxhOI4ci3TYwWqYKPp2bbfXoM=; 25:Tb8M3NhVwymlkGh9BXrBHcxrJzHjgtgzMLBlnI7LDKj5Jiek8QcAufdgwHBFOdoLDQtMgIJVwgEnQa9lC2+8El9Q2TLt2Pz4hhZsIf4yf1HVy9pmUvEhvfUGB7BptsyWuSBOfYkLQVIucxMavoDB43cNwhsSJco+dnpRaEwhMo3UwGk+IASwEYtt7iVu4r0aKOnyw+nkyK8hWUmJ6YmbxNcqCvQ5+MNbj3Y3j/WVNgcSJ8C+lAlgvDGdvj/IwCRc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0718; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0718; 20:QQy7aWciAMpgLCi5Xsotax7bnZG4sg5p72fN1gtUdmxffs+wCNbgowpuM2Bs2QKPBlzo4YxsVzZbH1T8VjXLXK40Wy+gzQZCruftaEi1ozACMrnPJCZTBJpDDRIuh9RXBKjOXCxwDjeAPltfeBfIgPefxfuBZL8Gy6O/2HnsSOK65xUDDVl/11jDEHJcRR85VDk430CyYb2lhlEWb+ZaX+AoqGWmLL+XKYC5DOvUvUKN8kD6rcgu1vkGpj/oWH41XI0F3CNmpel1vhv4vSLKJjcfkm5Z8bwuu37a84eElt8l8TVQej1F+4nlKOVT1xCPVI9y0inCzvoWr1wIW53ZYFYTG4G9Yq7UbUYxqs8YliOoEexO7xOLe7tngMYyNmpkSwmYzLj0wleY2nWgPTXHogqfdTN8zVs3JTxJ7gBVrm5ZFcmcwKAHl/PcK/SUjUP+RIDAONBMI3ihgr9gDw/e+aOawOwC6SzcbZ1uUfInzdpEsfq2/KWTQuavIsmO549l; 4:1Xf5kOXysy5IN9hnwAyLoNuNprofWiRnIIyFNLeuD4w93BXq6HUQoD3FTMneTsAKuHueZcgFU6ZqyRO5bZ7iYLFKSjWAoCRsVxqKX0K7FmaWv4R4/7RH3101V5fyFUuNCBo+vS4NSl9WitkBISIFcWkSaxt2zcK/IG3HvBp6+CQtOmF3zSF8VhmrfV+lIFc2sVGQ1wKaL2FIhGoiWQSAHmrI3vXn2uBOmawlIQkD9IsK2PrfwHuwUd71JdZmO33ijR+3wG6fYC52OPK9e3iZIOrqZJ8lTnljOJMIB4toErAqAEabV6K/EjRSqwWJALAFJ8ate9NAmMLbXqwUYO4jTWju8Qa06HdsqSu0+xaBMtYzUpTlfewkZkGidF+KCkDM10AVHmu9RWp6TnSHSpqdQ6eBWtyinU+tth36Z195kYM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:SN1PR12MB0718; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0718; X-Forefront-PRVS: 07943272E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0718; 23:+aJ3PhsLfCdBcCvAeIcLnn0wYMppReIPBDyO1TH9m?= =?us-ascii?Q?+jhKknPsil+1fbHTzay5nLxRFZZhyS7sN6GvcmOlmUKzcPLwxgaaFDKWKNWA?= =?us-ascii?Q?d52GX6mL/BxyH3FICo0J63IM8CQYx+9qcRvMsK3fYuZjhm9gQK/xMePGnYm8?= =?us-ascii?Q?ieQicVDobNZ2u316B+VQe6E8bPjGhT2I3DtnCpLUcGqTRrcYFJYAlYeEhKOA?= =?us-ascii?Q?/3pK8q1Ayudl4zu8zj006IuuJAUbqjpl7LXTAfP/84cCQ99yyBFPFFUR52G6?= =?us-ascii?Q?hP7WKQNTR/8v3Lzsth7hwBWIOwrqmx5DYMY8PzejspF4M9GmSopaSS2P8T7w?= =?us-ascii?Q?YtTfSOijeDQ9Q/A2vqLuWD5zHSJH7rTtqPiAjfS7Sb3OZCoREt44v8IyPYHg?= =?us-ascii?Q?4UFdLGjQaeZ+19e9N8u30UycR+giWUgkU2zso0nC2Rzh8fwWvE4e3gfAsHKt?= =?us-ascii?Q?/gZt7OmbaN6TjAyeV/xETN6VV2niWel26h6LXQhu/irxWhL4XwruMwFu74Gh?= =?us-ascii?Q?EBMjZB7tYGXdn+kvIfkLc7lwLuFN3WwXIJ25Etp/ZahZMletz1iKXzcKqYE6?= =?us-ascii?Q?lJ762Xbk8NFrrhFAl5r4x654oWoDWw9vK3xq3weFSMxLVeOXw9whcONCij0u?= =?us-ascii?Q?vPdS4Gt6w7GEBC0wKR/WBXVfR2RYzRPusePqSfw55iN0EitsK//hqOHM2EN7?= =?us-ascii?Q?SoSjASl0fKtymoww3bptkfj7AkAMnkSAl9c5J7crU7+Jb0kbv2BVY+LOd2DH?= =?us-ascii?Q?927jTo6FmQ5AMNdPvXEPeSAzw8qvSTalb8Zq7Xag4EP+FF7mlPjQpITRULtY?= =?us-ascii?Q?p/ws1wIqIPW8h8NAISOmt4u3CWqnZZpORSWnpVDniI+PjGV9oIzlpVCHlI31?= =?us-ascii?Q?yho3D4rOCw61OQOGvTxZzoQt4yagHoV0XZD8dIk4a+UMbKl0Cgj84KDHDpmm?= =?us-ascii?Q?YvzpKr8SPikI7vS5Gku43Gp1cxAfp7PUFn9Q1s6Vpq5om+EGsDEd+B+vVk/6?= =?us-ascii?Q?QM=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0718; 5:MM7n6WXqMao3RORSrlDatwrPDOhh8+CbDO2iALWq7A0VwxQ32NocMfCk3Zbs5td41Ug4g/TPOj3MtwXoAtMSKvkhQFCveMdp5Jz1TI/bIQh0j4zaOcJ8YVd3yJOvraDpOVYu6bYh1OyHMJJfdRHV2w==; 24:dX0WlkX0kTc9RT1+ghTZSqVNQZgEGaPvn7vCcwZOzB2slimBOPA0xShi9aj4ULxb6ztd4oahnPhzUI7iCtxw1qG2ChsAF74YprQWo5/Arlc=; 20:wwQggJ8tFDrCjaywEQtH6Z++LFN+qMsDPfxEVRaudJezhYLl6h7t/+QhFAop5wwi2FsaWbroHjWb7Iblslkn2zKEybUbGEcd/zM5iLVSljUlmzu9Msves7hZ7b7p+wHxX9S5cHxPqt9kqmw46QWlAHDcLutpiPY4Vn6Dqla5hR12eyOJPidLZG7Nzr/nMhmV5EXLcXAKEBvDltqxWS1cM0KLVJ5hZxQrShLXvvmxrCPk2dWjw/ooZ4nhFWuaI0DO SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2015 22:15:01.9665 (UTC) 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.221]; Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0718 Cc: Mykola Lysenko X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mykola Lysenko We should always send reply for UP request in order to make downstream device clean-up resources appropriately. Issue was that reply for UP request was sent only once. Signed-off-by: Mykola Lysenko --- drivers/gpu/drm/drm_dp_mst_topology.c | 30 +++++++++++------------------- include/drm/drm_dp_mst_helper.h | 2 -- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 3baa95c1b14b..bda9be9a3087 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1489,26 +1489,18 @@ static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) } /* called holding qlock */ -static void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) +static void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_sideband_msg_tx *txmsg) { - struct drm_dp_sideband_msg_tx *txmsg; int ret; /* construct a chunk from the first msg in the tx_msg queue */ - if (list_empty(&mgr->tx_msg_upq)) { - mgr->tx_up_in_progress = false; - return; - } - - txmsg = list_first_entry(&mgr->tx_msg_upq, struct drm_dp_sideband_msg_tx, next); ret = process_single_tx_qlock(mgr, txmsg, true); - if (ret == 1) { - /* up txmsgs aren't put in slots - so free after we send it */ - list_del(&txmsg->next); - kfree(txmsg); - } else if (ret) + + if (ret != 1) DRM_DEBUG_KMS("failed to send msg in q %d\n", ret); - mgr->tx_up_in_progress = true; + + txmsg->dst->tx_slots[txmsg->seqno] = NULL; } static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, @@ -1895,11 +1887,12 @@ static int drm_dp_send_up_ack_reply(struct drm_dp_mst_topology_mgr *mgr, drm_dp_encode_up_ack_reply(txmsg, req_type); mutex_lock(&mgr->qlock); - list_add_tail(&txmsg->next, &mgr->tx_msg_upq); - if (!mgr->tx_up_in_progress) { - process_single_up_tx_qlock(mgr); - } + + process_single_up_tx_qlock(mgr, txmsg); + mutex_unlock(&mgr->qlock); + + kfree(txmsg); return 0; } @@ -2809,7 +2802,6 @@ int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, mutex_init(&mgr->qlock); mutex_init(&mgr->payload_lock); mutex_init(&mgr->destroy_connector_lock); - INIT_LIST_HEAD(&mgr->tx_msg_upq); INIT_LIST_HEAD(&mgr->tx_msg_downq); INIT_LIST_HEAD(&mgr->destroy_connector_list); INIT_WORK(&mgr->work, drm_dp_mst_link_probe_work); diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h index 5340099741ae..006062a27639 100644 --- a/include/drm/drm_dp_mst_helper.h +++ b/include/drm/drm_dp_mst_helper.h @@ -450,9 +450,7 @@ struct drm_dp_mst_topology_mgr { the mstb tx_slots and txmsg->state once they are queued */ struct mutex qlock; struct list_head tx_msg_downq; - struct list_head tx_msg_upq; bool tx_down_in_progress; - bool tx_up_in_progress; /* payload info + lock for it */ struct mutex payload_lock;