From patchwork Mon May 18 16:24:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 6430431 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 514239F402 for ; Mon, 18 May 2015 16:25:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEDF8205BE for ; Mon, 18 May 2015 16:25:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9A2CE204C9 for ; Mon, 18 May 2015 16:25:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E6816E52B; Mon, 18 May 2015 09:25:02 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vn0-f51.google.com (mail-vn0-f51.google.com [209.85.216.51]) by gabe.freedesktop.org (Postfix) with ESMTP id CDED06E040 for ; Mon, 18 May 2015 09:25:00 -0700 (PDT) Received: by vnbg129 with SMTP id g129so3410056vnb.9 for ; Mon, 18 May 2015 09:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3FYdzyyeZC6nLCqZKDUd1DXp9oX9qPSmkLh/VAfT8sg=; b=ZxSAGVoxoE+SvC5/ztgY97CcmtL+dRJUPn33tk0Zdb1STTR54dUwa17a1z7XxNqXB6 kZBwE2dLeZNC1Wiq8avPxAJ500AuYXeokgwjeJkNpZ78TVKoiymTUuraPBGKM2mf9g6/ reFz2gz3O0CeU/uwi/f30S0ENzp3v/POA+fZfgNCT/fRq5LG/xCz33P4LRarlLgqAX7D l9QqB3jUZoCIPAk9cKm5EQQFy5Gos98W0Sg9bQKnA6hHox27Py27IWfKDoLheHggmvKz 92k630mOHSE7Cs/8YSROhmF98vjdZztaf+1qfo/lU16AbHyPYTozAouKD76ZNIbIITJm GoEg== X-Received: by 10.52.227.42 with SMTP id rx10mr13159919vdc.14.1431966300290; Mon, 18 May 2015 09:25:00 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPSA id jk10sm2139143vdb.13.2015.05.18.09.24.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2015 09:24:59 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: take the mode_config mutex when dealing with hpds Date: Mon, 18 May 2015 12:24:49 -0400 Message-Id: <1431966291-1449-3-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1431966291-1449-1-git-send-email-alexander.deucher@amd.com> References: <1431966291-1449-1-git-send-email-alexander.deucher@amd.com> Cc: Alex Deucher , stable@vger.kernel.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 Since we are messing with state in the worker. Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/radeon_irq_kms.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 7162c93..5b12c3f 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -79,10 +79,12 @@ static void radeon_hotplug_work_func(struct work_struct *work) struct drm_mode_config *mode_config = &dev->mode_config; struct drm_connector *connector; + mutex_lock(&mode_config->mutex); if (mode_config->num_connector) { list_for_each_entry(connector, &mode_config->connector_list, head) radeon_connector_hotplug(connector); } + mutex_unlock(&mode_config->mutex); /* Just fire off a uevent and let userspace tell us what to do */ drm_helper_hpd_irq_event(dev); } @@ -96,10 +98,12 @@ static void radeon_dp_work_func(struct work_struct *work) struct drm_connector *connector; /* this should take a mutex */ + mutex_lock(&mode_config->mutex); if (mode_config->num_connector) { list_for_each_entry(connector, &mode_config->connector_list, head) radeon_connector_hotplug(connector); } + mutex_unlock(&mode_config->mutex); } /** * radeon_driver_irq_preinstall_kms - drm irq preinstall callback