Received: by 10.192.165.148 with SMTP id m20csp4145019imm; Mon, 30 Apr 2018 12:36:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqAWcSHpBbVYZQ7ZV+RpsPJajy6smKUw4ozDJVT1QcBpgEf9KMYlynmvbdCALd3Wy3pvK7s X-Received: by 10.98.170.24 with SMTP id e24mr12980536pff.107.1525116964083; Mon, 30 Apr 2018 12:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525116964; cv=none; d=google.com; s=arc-20160816; b=t6a+VQFMd5JCvqeBpjUkmbHCl0C/fDQfDT8IaV9OyDgm3yZnxsqYxGvBGARmvDUIml XGyZsRUV+pwb7BHLdwA5b+ksiaPMM4aIkAK2wbckjkqKkGjUeeb5e/Rqr6zyCePNnEso LXVjh8BJAs22OvuWuKy4U5UCWXvZa79MFXqmJlRq4GuJS4NEMnqdekAdkhFOhE3Ool/K OUk8O/KOL2pDpOTlF+nHraDWJ9E86UxW4qvkxJpthm4eFUHr+jPrr5g4384Psk4m6719 y111jSlMhkem5dbt2S1jY53qTeIXAjeYDOzd+N5OIvjV54RiyQaO7a8pOE8X6WRB8J5g q5OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=awGJggrmdeZ6zI6VDi9uzRx0/NRvjrxA9S2BiPXN9Mw=; b=adR404iVkTFj2lCCGRGsT67CGQknw8a1KPORwWurUle+i55mjaRSpFoQPhulFqgCmy B+JOIJ2C0GuMTtZtiJEpOK1MhK9BiPu3DG2xJQTXfWAjkOFETmDSzBgrj15g4UNg/P/J uGwlh6mFq7MbejphoC9pi5JGQIlt+/SegoUl3CFwCuOnTM2/PRIdRoG7r19CelBLv5xV Mx7WZuUAFErjktvCHshBocFrBtRxXlSSs+su7LiJwNw0TACwSrgLdlLxQmKsxV9LSiPL MUmg0eZoYKOqoikpxIXIFEdcyW9/YyT7nekEc4xpaNXMtiKzKvKFzLHIQNBpoE6+H1sY 83mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j62-v6si4019639pgd.242.2018.04.30.12.35.19; Mon, 30 Apr 2018 12:36:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932380AbeD3Ted (ORCPT + 99 others); Mon, 30 Apr 2018 15:34:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:37068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932378AbeD3T2w (ORCPT ); Mon, 30 Apr 2018 15:28:52 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF3A922DAC; Mon, 30 Apr 2018 19:28:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF3A922DAC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikita Lipski , Harry Wentland , Alex Deucher Subject: [PATCH 4.16 103/113] drm/amd/display: Fix deadlock when flushing irq Date: Mon, 30 Apr 2018 12:25:14 -0700 Message-Id: <20180430184019.560271947@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikita Lipski commit ad64dc0137968f09800e58174bbfd5eac9fe5418 upstream. Lock irq table when reading a work in queue, unlock to flush the work, lock again till all tasks are cleared Signed-off-by: Mikita Lipski Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c @@ -400,14 +400,15 @@ void amdgpu_dm_irq_fini(struct amdgpu_de { int src; struct irq_list_head *lh; + unsigned long irq_table_flags; DRM_DEBUG_KMS("DM_IRQ: releasing resources.\n"); - for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) { - + DM_IRQ_TABLE_LOCK(adev, irq_table_flags); /* The handler was removed from the table, * it means it is safe to flush all the 'work' * (because no code can schedule a new one). */ lh = &adev->dm.irq_handler_list_low_tab[src]; + DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags); flush_work(&lh->work); }