Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp249975ybd; Tue, 25 Jun 2019 20:44:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYbazvdLX8YnZMAfXwOljaXTE5uLFUmLWAfp9Crx6Lb4C3R5lybyeDmY3upDRKgTlGUCCL X-Received: by 2002:a63:88c7:: with SMTP id l190mr595937pgd.240.1561520655637; Tue, 25 Jun 2019 20:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520655; cv=none; d=google.com; s=arc-20160816; b=fpqtEITL74PfQHsSAKF1WhI77ruTXDhCbq6kjOxjfbhD3vi8H+CWMIO/VVT6uPQz0N Brjl87SBhb0QvC7WD4HHfYt+6MgiYx8PLOqriTGqROzsNSxDO9QZ+wzkRXm9A01ONhyH +7nDe6zhtVXmRfERNWuNaUg5kyAn2NvNsL3hDl/95Yxq+q2kWefx1S9HJ4Qoov0BS16G jzSxFYQ+zfdHCuMyuhVKA3t9d2qAeItMYl+dXjq/x7ZCPf57NAJi94XWFVCqcopQEM/I zNCl9Q58Ir2VOPM1I5X4vg/40JsA3Q1hnAr81x/krP2TvZTMUaszOs81rI+hNDm7fUuz rjyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z2wP/EthqSj5t4NRxRKa31fExaJmGLre9NP+gnVIq7g=; b=k7xUJEe1LH1txGcSo1JIkaAhBQqX7yPLTZwa/quGtlUvDE/XLC35opTk4R1UqcikrM QMfbSILP6+Jmq2paZ6Nts097ij0Wcfp/LkV1r40Zm/nvqelZ4sfTl/iKNDDCT2J0JuvN JMdoj3k3w10dQ/qErsSBsXl8qc283SHli1kjvVuKUpX6JxjemS/Etx8LzolMz5BH4Zg3 9uDR3lQyXIB1A4u8RBuzco6dZooFevLr2hkMhOtBc6aI9v8Gc38Fnw7Q/fbOjjcdfUPK 3HEa00Q6VAwxoxVJffGmxGyzq9NqjLrpASQFAKUzieFvRKwb/O0p5M0VuLbc2FpCMZ+T YhxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qnWAYgcM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si14101979pgs.312.2019.06.25.20.43.59; Tue, 25 Jun 2019 20:44:15 -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; dkim=pass header.i=@kernel.org header.s=default header.b=qnWAYgcM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727009AbfFZDmL (ORCPT + 99 others); Tue, 25 Jun 2019 23:42:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:52676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbfFZDmA (ORCPT ); Tue, 25 Jun 2019 23:42:00 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B29320659; Wed, 26 Jun 2019 03:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520519; bh=HRhRYnyHVM87LoR0ih2Jci+FMYcGNLH438ugNRmuhsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnWAYgcMqqGtymkAV1pm+wwJdalxFv3HdMepvGBqXbB+iCBKJATbbwiBHir2xH+FT UDHAD8MzYcADcMmIYtAW7qz5NMnLP9CLXtHN5kDtR1zo9t7NbJrQrVqL45vOn6QbSB ie87QM2ffLCEyUP3v4ZjZ+esH+D+xh3AkKhQe/MY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hsin-Yi Wang , CK Hu , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.1 18/51] drm/mediatek: clear num_pipes when unbind driver Date: Tue, 25 Jun 2019 23:40:34 -0400 Message-Id: <20190626034117.23247-18-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hsin-Yi Wang [ Upstream commit a4cd1d2b016d5d043ab2c4b9c4ec50a5805f5396 ] num_pipes is used for mutex created in mtk_drm_crtc_create(). If we don't clear num_pipes count, when rebinding driver, the count will be accumulated. From mtk_disp_mutex_get(), there can only be at most 10 mutex id. Clear this number so it starts from 0 in every rebind. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang Signed-off-by: CK Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 8718d123ccaa..bbfe3a464aea 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -400,6 +400,7 @@ static void mtk_drm_unbind(struct device *dev) drm_dev_unregister(private->drm); mtk_drm_kms_deinit(private->drm); drm_dev_put(private->drm); + private->num_pipes = 0; private->drm = NULL; } -- 2.20.1