From patchwork Wed May 29 10:25:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10966843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E63F112C for ; Wed, 29 May 2019 11:20:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0125F204C4 for ; Wed, 29 May 2019 11:20:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA2042892E; Wed, 29 May 2019 11:20:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2FC1A2839C for ; Wed, 29 May 2019 11:20:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE2FB6E2D8; Wed, 29 May 2019 11:20:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABEC66E0F0 for ; Wed, 29 May 2019 10:26:51 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id c6so1331806pfa.10 for ; Wed, 29 May 2019 03:26:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YcCSMOQNkzGaXhDk0okGAy0XqAbQi4G2u6aLWlPaPBw=; b=OFqVDgsFJeQWznGywuNQLzFKsNpKVSm4zz7WMkMEIH/31jCyexKIJU7GfbZUfkOFzf 76HGBW0WLFGrcLRBj0x+68+wI3lNy5o/h4buRfjHeuYoEGkBAGzpFQAf+iVQGGTh0EqY rBm3+I+Nxy8LezW8c7QqAMNPv6aUS4Y83cG4H7e9KignyvLdUs96rQAp+F7cBFC1aqhn gey7p9HV/RW0PlutdAIhI5m/GWoQZK7f1OCwQ4SWh69V4crFa6yj5aEBxO2e2zBfNP6V 122l/1/wj/Dqq6oz5xMpsbS93U+U8DFB+veCFRooOX73CJPjTPFyYM1vhx+7RPxamzlX uMuw== X-Gm-Message-State: APjAAAWkdI/7+RLevDm6bxEfamTysDLv7BCQ7gZy3v6iXoH1ayMKHH7a pu7DPzrTwKwGCgMOYUZiPqyw2Q== X-Google-Smtp-Source: APXvYqyyaROmC37HXAcccgz51No+HwGj0nRGT99eAspxv1IL1mnTD2gRQ1iaLO7Rvi00xcw+ddOyEQ== X-Received: by 2002:a17:90a:ac0d:: with SMTP id o13mr11037075pjq.139.1559125611164; Wed, 29 May 2019 03:26:51 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id e12sm18992183pfl.122.2019.05.29.03.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 May 2019 03:26:50 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/4] drm: mediatek: clear num_pipes when unbind driver Date: Wed, 29 May 2019 18:25:55 +0800 Message-Id: <20190529102555.251579-5-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529102555.251579-1-hsinyi@chromium.org> References: <20190529102555.251579-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 29 May 2019 11:20:23 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YcCSMOQNkzGaXhDk0okGAy0XqAbQi4G2u6aLWlPaPBw=; b=Cuhppf15fgs+ro5fQzou91thI1XLxU4KioJr8st6A+3rShMcYV8fSqZOp424wsNyS7 Yjt8ZDWKI8t5jY8/w/olvN9NejpmeXI58p0vNnxcpidO9I9OYs9PLq5hcAy2JUfwloW/ 0z63BUjUnVKb52ngcrkoQKYOWPV2zpLSKFZpM= 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 Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Matthias Brugger , linux-mediatek@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: CK Hu --- 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; }