Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3338186ybd; Tue, 25 Jun 2019 00:31:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqweS/Iy5+u4+iK1OPZFWQLscHrLue5yVp9Vxg7LlCI1XgB+FlXV/RsCzCTF4I2b2WqSohC8 X-Received: by 2002:a63:b90d:: with SMTP id z13mr36748730pge.16.1561447877298; Tue, 25 Jun 2019 00:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561447877; cv=none; d=google.com; s=arc-20160816; b=tlXTcRFJtlBOQ/Kf2DR5PUR5rbSeGSG4Qjyh3TqyIfGF2QLEGOyryPCx0Xdjrdr+VP y5p0QUavo0Z8PlzaBGWb6oWJ4Vu+iSjt5mlHf1poqnQtNMtr3fhHGfcU+0jYQ62/XZ+c 7rgdjAfX1rKNO5E+HpdXJAWIxluuin2n7jS8oZgM5LzfBhEydSK7gTnPKyod+uLrJdom HkBB7l0yRl/Bg8Y/Iku+dTx46CcmUI6z0k/23nK5sHYiXQtvAQTjpV7gIGBP0/atW6Af zDNe5i7sXUy1PUzVdh+Rqzkme9tTpCG+IyIWHBzA12ro+VOV/oqXPktXTENxML9RMeZa VM7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=g1C42EOjBw7hmpu7NNMuxhWHpXipan6nW/gku6GH1bw=; b=R0BcE76DLk/LxOyGp4yHPJW8tmdIB45Hb3vevvPs9MsTRcGT/4arxdxiBsasLWn9zY RYY5AhTcqieO2TphWjDf+QqNdnlaG/ZII5Qg2jJpPWyEgASON5mXWffyzLY1W3DqDkjo 23QCQ750sHWlKibWawE3mmEH5XDD14/n34pVxHPbI7zl8cYW2+VtpfrICEalkksCGG/Q 7weXz3zqxSkaQz8xNrTVlcsvVSJV03HeFp0Vn40Eze5Lu7dr5SWDtA5O46cS7UXwlV/N ArbQVjgzGYFmJTIpd72kFSpZ3Oq2uojv9HoTXEd7F6TJS/9PWfnS93JAd2Xk8+ugGOtx ejmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=MCb1Z2D3; dkim=pass header.i=@codeaurora.org header.s=default header.b=e+h2bnNq; 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 w6si1183177pgf.193.2019.06.25.00.31.01; Tue, 25 Jun 2019 00:31:17 -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=@codeaurora.org header.s=default header.b=MCb1Z2D3; dkim=pass header.i=@codeaurora.org header.s=default header.b=e+h2bnNq; 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 S1728369AbfFYFor (ORCPT + 99 others); Tue, 25 Jun 2019 01:44:47 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50450 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbfFYFor (ORCPT ); Tue, 25 Jun 2019 01:44:47 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1BF25601E7; Tue, 25 Jun 2019 05:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561441486; bh=VoP64LnBzSeu4YlaPxe3/Iim6Cic7+1v38v1apbRuak=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MCb1Z2D3EruYT8t2nRPe3btLfwqWxn+9pHYZ81bQ8T1Bz1HpQQl76TdVE+yZM1SY/ evJ8li6Bc+C4+FgFC5FWIo75ysmuo3puw8fljJKa6uYn0zFhujbq64EvPtPRG4dv0R DoUwyg7DtSN5c4hF8ICg6wxq9dbxHUlnJxVp9JAs= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 52BAF601E7; Tue, 25 Jun 2019 05:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561441485; bh=VoP64LnBzSeu4YlaPxe3/Iim6Cic7+1v38v1apbRuak=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=e+h2bnNqJO4uHAEkcwB1UFdosHbAILF0sslm8yXSoJdwAxpG0yu4ZXtumIN4VwMTt QbxTp+wvqlBrQQhzR4n/CQ6iAqTUO+6PU1BE6OqWORC/CdVbTYJ8rCDZuIgoh3Sqt1 wJmGLediQfgaML9iTnIv2fwJt4ZHHQPEobkS++NA= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 25 Jun 2019 11:14:45 +0530 From: dhar@codeaurora.org To: Jeykumar Sankaran Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robdclark@gmail.com, seanpaul@chromium.org, hoegsberg@chromium.org, abhinavk@codeaurora.org, chandanu@codeaurora.org, nganji@codeaurora.org, jshekhar@codeaurora.org Subject: Re: drm/msm/dpu: Correct dpu encoder spinlock initialization In-Reply-To: References: <1561357632-15361-1-git-send-email-dhar@codeaurora.org> Message-ID: X-Sender: dhar@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-06-25 03:56, Jeykumar Sankaran wrote: > On 2019-06-23 23:27, Shubhashree Dhar wrote: >> dpu encoder spinlock should be initialized during dpu encoder >> init instead of dpu encoder setup which is part of commit. >> There are chances that vblank control uses the uninitialized >> spinlock if not initialized during encoder init. > Not much can be done if someone is performing a vblank operation > before encoder_setup is done. > Can you point to the path where this lock is acquired before > the encoder_setup? > > Thanks > Jeykumar S. >> When running some dp usecase, we are hitting this callstack. Process kworker/u16:8 (pid: 215, stack limit = 0x00000000df9dd930) Call trace: spin_dump+0x84/0x8c spin_dump+0x0/0x8c do_raw_spin_lock+0x80/0xb0 _raw_spin_lock_irqsave+0x34/0x44 dpu_encoder_toggle_vblank_for_crtc+0x8c/0xe8 dpu_crtc_vblank+0x168/0x1a0 dpu_kms_enable_vblank+0[ 11.648998] vblank_ctrl_worker+0x3c/0x60 process_one_work+0x16c/0x2d8 worker_thread+0x1d8/0x2b0 kthread+0x124/0x134 Looks like vblank is getting enabled earlier causing this issue and we are using the spinlock without initializing it. Thanks, Shubhashree >> Change-Id: I5a18b95fa47397c834a266b22abf33a517b03a4e >> Signed-off-by: Shubhashree Dhar >> --- >> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >> index 5f085b5..22938c7 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c >> @@ -2195,8 +2195,6 @@ int dpu_encoder_setup(struct drm_device *dev, >> struct >> drm_encoder *enc, >> if (ret) >> goto fail; >> >> - spin_lock_init(&dpu_enc->enc_spinlock); >> - >> atomic_set(&dpu_enc->frame_done_timeout, 0); >> timer_setup(&dpu_enc->frame_done_timer, >> dpu_encoder_frame_done_timeout, 0); >> @@ -2250,6 +2248,7 @@ struct drm_encoder *dpu_encoder_init(struct >> drm_device *dev, >> >> drm_encoder_helper_add(&dpu_enc->base, &dpu_encoder_helper_funcs); >> >> + spin_lock_init(&dpu_enc->enc_spinlock); >> dpu_enc->enabled = false; >> >> return &dpu_enc->base;