From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E74BC47DD9 for ; Wed, 28 Feb 2024 16:22:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1408310E547; Wed, 28 Feb 2024 16:22:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lgbztTkG"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 13F6A10E547 for ; Wed, 28 Feb 2024 16:22:23 +0000 (UTC) Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C86496B3; Wed, 28 Feb 2024 17:22:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1709137330; bh=/3zDOS2PejvTm0xV78aQExrLl1BoCDLR7sm/RYS9aU8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lgbztTkGoUfv9hR8sP0de8pZbHV8zgzqNLgzwcLeXuzKGUCAZtbrDLWDLbDcxItVb e2PtaJwF00ogqLWm9f6jS4V+DBz/Q4hq9Wywj/LHPgN2eIWxAn0+1nf/EzCRz2n6pj 4PUdWySeVm86re+/9+nBTi00iw8P2sWZiD5KQz0A= Date: Wed, 28 Feb 2024 18:22:24 +0200 From: Laurent Pinchart To: Rohit Visavalia Cc: gregkh@linuxfoundation.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, michal.simek@amd.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm: xlnx: dp: Reset DisplayPort IP Message-ID: <20240228162224.GG9863@pendragon.ideasonboard.com> References: <20240216124043.1226713-1-rohit.visavalia@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240216124043.1226713-1-rohit.visavalia@amd.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello Rohit, Thank you for the patch. On Fri, Feb 16, 2024 at 04:40:43AM -0800, Rohit Visavalia wrote: > Assert DisplayPort reset signal before deasserting, > it is to clear out any registers programmed before booting kernel. > > Signed-off-by: Rohit Visavalia > --- > drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c > index 1846c4971fd8..5a40aa1d4283 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c > @@ -1714,6 +1714,10 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) > goto err_free; > } > > + ret = zynqmp_dp_reset(dp, true); > + if (ret < 0) > + return ret; > + This looks fine to me, so Reviewed-by: Laurent Pinchart However, looking at zynqmp_dp_reset(), we have static int zynqmp_dp_reset(struct zynqmp_dp *dp, bool assert) { unsigned long timeout; if (assert) reset_control_assert(dp->reset); else reset_control_deassert(dp->reset); /* Wait for the (de)assert to complete. */ timeout = jiffies + msecs_to_jiffies(RST_TIMEOUT_MS); while (!time_after_eq(jiffies, timeout)) { bool status = !!reset_control_status(dp->reset); if (assert == status) return 0; cpu_relax(); } dev_err(dp->dev, "reset %s timeout\n", assert ? "assert" : "deassert"); return -ETIMEDOUT; } That doesn't seem quite right. Aren't reset_control_assert() and reset_control_deassert() supposed to be synchronous ? If so there should be no need to wait, and if there's a need to wait, it could be a bug in the reset controller driver. This should be fixed, and then the code in probe could be replaced with a call to reset_control_reset(). > ret = zynqmp_dp_reset(dp, false); > if (ret < 0) > goto err_free; -- Regards, Laurent Pinchart