From patchwork Mon May 27 04:50:53 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: 10962797 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 0E34691E for ; Mon, 27 May 2019 12:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2F0B27F88 for ; Mon, 27 May 2019 12:05:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E717228B3B; Mon, 27 May 2019 12:05:04 +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 7EE9827F88 for ; Mon, 27 May 2019 12:05:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BB8E89C54; Mon, 27 May 2019 12:04:46 +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 CDE6B89700 for ; Mon, 27 May 2019 04:51:35 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id n19so8855831pfa.1 for ; Sun, 26 May 2019 21:51:35 -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=nTNnUu5Pg74lFPYV76pxj/avOtvPxN38IgfsN4zW7KQ=; b=gds9nZewTh6BAOg1jzq7w1Wx+BYjz0CpoW8x2keOv3CyIOydRNmdozloMSFg3VfHHb ar+b1IRI4Ocoze+YarMefF8BIzzniQ0DRMwrnIykSdY1vj8c5nV1NTgdrPdHZgwUDSGW c2izGWl2K8mPSq04wOUCPM5Gq4dSKAGLriaK8rweEtF77kim1AWfhrcKRFHo30uQAJAg CV7oUSA5DBP9RGL/QCT73KZzM2Ooml1elUQJqG8rb/sV3w/8ptzlPtmTgt3abqkfqWG4 K7cAZJilGd5u+F/eg/hwHsCe/uzwEDBKL4deAVbvIrOke/qghMIRpoO6Q2WoSMdsGt9f 4iKg== X-Gm-Message-State: APjAAAWKtrAdFvhDV23wSFsTc/0Dfi0/41CRd5WtnSUH6QUf0eobMM0P 6yOjTA+OHsYFoqPLrHNIw4pQmw== X-Google-Smtp-Source: APXvYqx8WppvdjWZOUQtU7qfCXOcLLa/ChE21AsiaFIreNV8ZZUyC8OHhrhAkIaKUz2GmqI9e+qn3Q== X-Received: by 2002:a17:90a:fa09:: with SMTP id cm9mr28441942pjb.137.1558932695346; Sun, 26 May 2019 21:51:35 -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 t18sm8082745pgm.69.2019.05.26.21.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 May 2019 21:51:34 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] drm: mediatek: remove clk_unprepare() in mtk_drm_crtc_destroy() Date: Mon, 27 May 2019 12:50:53 +0800 Message-Id: <20190527045054.113259-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190527045054.113259-1-hsinyi@chromium.org> References: <20190527045054.113259-1-hsinyi@chromium.org> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 27 May 2019 12:03:54 +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=nTNnUu5Pg74lFPYV76pxj/avOtvPxN38IgfsN4zW7KQ=; b=fjbKiekoEYOoJBE0nUV6/Q9YCysuZfEp+pEMPPi41BXxdQCweXz3u6dxC632AR4SmS y2yCfjzWKum60A/UdH1QkxrFpcR111NmZhwY2ZqRwh9ElglQSnMEFWXz4doFbAksG3fj /Q/d3ScgIQ/QIeK6u0PHG4rbgVSsL949aTXQg= 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 There is no clk_prepare() called in mtk_drm_crtc_reset(), when unbinding drm device, mtk_drm_crtc_destroy() will be triggered, and the clocks will be disabled and unprepared in mtk_crtc_ddp_clk_disable. If clk_unprepare() is called here, we'll get warnings[1], so remove clk_unprepare() here. [1] [ 19.416020] mm_disp_ovl0 already unprepared .... [ 19.487536] pstate: 60000005 (nZCv daif -PAN -UAO) [ 19.492325] pc : clk_core_unprepare+0x1d8/0x220 [ 19.496851] lr : clk_core_unprepare+0x1d8/0x220 [ 19.501373] sp : ffffff8017bbba30 [ 19.504681] x29: ffffff8017bbba50 x28: fffffff3f7978000 [ 19.509989] x27: 0000000000000000 x26: 0000000000000000 [ 19.515298] x25: 0000000044000000 x24: fffffff3f7978000 [ 19.520605] x23: 0000000000000060 x22: ffffff9688a89f48 [ 19.525912] x21: fffffff3f8755540 x20: 0000000000000000 [ 19.531219] x19: fffffff3f9d5ca00 x18: 00000000fffebd18 [ 19.536526] x17: 000000000000003c x16: ffffff96881458e4 [ 19.541833] x15: 0000000000000005 x14: 706572706e752079 [ 19.547140] x13: ffffff80085cc950 x12: 0000000000000000 [ 19.552446] x11: 0000000000000000 x10: 0000000000000000 [ 19.557754] x9 : 1b0fa21f0ec0d800 x8 : 1b0fa21f0ec0d800 [ 19.563060] x7 : 0000000000000000 x6 : ffffff9688b5dd07 [ 19.568366] x5 : 0000000000000000 x4 : 0000000000000000 [ 19.573673] x3 : 0000000000000000 x2 : fffffff3fffa0248 [ 19.578979] x1 : fffffff3fff97a00 x0 : 000000000000001f [ 19.584288] Call trace: [ 19.586734] clk_core_unprepare+0x1d8/0x220 [ 19.590914] clk_unprepare+0x30/0x40 [ 19.594491] mtk_drm_crtc_destroy+0x30/0x5c [ 19.598672] drm_mode_config_cleanup+0x124/0x290 [ 19.603286] mtk_drm_unbind+0x44/0x5c [ 19.606946] take_down_master+0x40/0x54 [ 19.610775] component_master_del+0x70/0x94 [ 19.614952] mtk_drm_remove+0x28/0x44 [ 19.618612] platform_drv_remove+0x28/0x50 [ 19.622702] device_release_driver_internal+0x138/0x1ec [ 19.627921] device_release_driver+0x24/0x30 [ 19.632185] unbind_store+0x90/0xdc [ 19.635667] drv_attr_store+0x3c/0x54 [ 19.639327] sysfs_kf_write+0x50/0x68 [ 19.642986] kernfs_fop_write+0x12c/0x1c8 [ 19.646997] __vfs_write+0x54/0x15c [ 19.650482] vfs_write+0xcc/0x188 [ 19.653792] ksys_write+0x78/0xd8 [ 19.657104] __arm64_sys_write+0x20/0x2c [ 19.661027] el0_svc_common+0x9c/0xfc [ 19.664686] el0_svc_compat_handler+0x2c/0x38 [ 19.669039] el0_svc_compat+0x8/0x18 [ 19.672609] ---[ end trace 41ce954855cda6f0 ]--- Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index acad088173da..c2b38997ac8b 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -98,10 +98,6 @@ static void mtk_drm_finish_page_flip(struct mtk_drm_crtc *mtk_crtc) static void mtk_drm_crtc_destroy(struct drm_crtc *crtc) { struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc); - int i; - - for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) - clk_unprepare(mtk_crtc->ddp_comp[i]->clk); mtk_disp_mutex_put(mtk_crtc->mutex);