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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 25224C54E71 for ; Fri, 22 Mar 2024 16:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dp21+z+mXEGjRci7IIg23VX3p5GLWDcTBogkBe5PHnQ=; b=AXKO6K5TUPyyP2 hBDBdh8wEkl6li1pnc9raXh2cD6AIkrb6YH9I3Z4ncZQNlIXsEdPKK4rdnFpiRFXR6jDSaEdYxMcI TVh88oRhrB5Ukuo8lzPBazNieGu6+RkT0MOluB3xeNYhi5PPeRZahm0YLTJG2FFXzvvUVkW7dSlku Fslb9yBFI+9Rq7SFx7EmEkdqo97kRcGw7A8GKkC77qwoxGAvWA6PwpT1yr/v+quxVyo4/f+bl5ERM QQqOtkBsL317EdYpM6pc7PoLkHXK79+25VH7RzQMrQ/y7CaQcRsGtKy72nvd75vad6Rvykf5ZvTip 2lCse6HABUqduvn2BE4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnhbr-00000007vtA-0CCD; Fri, 22 Mar 2024 16:19:11 +0000 Received: from out-182.mta0.migadu.com ([91.218.175.182]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnhbn-00000007vsX-0kPk for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 16:19:09 +0000 Message-ID: <2dbf138f-5112-48e1-85a6-9e3ad84ec4a6@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1711124341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KB5GftMYyC75xN2sRG0i/ixBELjpxJvza4IaI6qq1+0=; b=rAcq/Pr6acgADB2ZF7hpy57CL4pr5Hkb9gWfpeXR4lEYG85SU/XKXu/IApF7Y25mcQMjM5 xgZWPtKC95rPVrPXF0K6vyByn2iKWAdzLWgM1zF8R4gtfH7/4ZWB65Ovz7dZjTMhiRCevr ahirJGR9OtB93xVSpOibVK6cMaAV4i4= Date: Fri, 22 Mar 2024 12:18:57 -0400 MIME-Version: 1.0 Subject: Re: [PATCH v2 5/8] drm: zynqmp_dp: Don't retrain the link in our IRQ Content-Language: en-US To: Tomi Valkeinen Cc: Michal Simek , David Airlie , linux-kernel@vger.kernel.org, Daniel Vetter , linux-arm-kernel@lists.infradead.org, Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org References: <20240319225122.3048400-1-sean.anderson@linux.dev> <20240319225122.3048400-6-sean.anderson@linux.dev> <53b2df23-d5ea-498b-a501-b64f753c0074@linux.dev> <0514ef71-5baa-4989-9b7d-8bd9526c4d8d@ideasonboard.com> <16ccf678-270c-4770-8cc9-f676b4fabf09@linux.dev> <1f27ce69-9ea6-4df4-9147-332d74febdf0@ideasonboard.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240322_091907_531415_AB8A5D0C X-CRM114-Status: GOOD ( 14.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/22/24 01:32, Tomi Valkeinen wrote: > On 21/03/2024 21:17, Sean Anderson wrote: >> On 3/21/24 15:08, Tomi Valkeinen wrote: >>> On 21/03/2024 20:01, Sean Anderson wrote: >>>> On 3/21/24 13:25, Tomi Valkeinen wrote: >>>>> On 21/03/2024 17:52, Sean Anderson wrote: >>>>>> On 3/20/24 02:53, Tomi Valkeinen wrote: >>>>>>> On 20/03/2024 00:51, Sean Anderson wrote: >>>>>>> Do we need to handle interrupts while either delayed work is being done? >>>>>> >>>>>> Probably not. >>>>>> >>>>>>> If we do need a delayed work, would just one work be enough which >>>>>>> handles both HPD_EVENT and HPD_IRQ, instead of two? >>>>>> >>>>>> Maybe, but then we need to determine which pending events we need to >>>>>> handle. I think since we have only two events it will be easier to just >>>>>> have separate workqueues. >>>>> >>>>> The less concurrency, the better...Which is why it would be nice to do it all in the threaded irq. >>>> >>>> Yeah, but we can use a mutex for this which means there is not too much >>>> interesting going on. >>> >>> Ok. Yep, if we get (hopefully) a single mutex with clearly defined fields that it protects, I'm ok with workqueues. >>> >>> I'd still prefer just one workqueue, though... >> >> Yeah, but then we need a spinlock or something to tell the workqueue what it should do. > > Yep. We could also always look at the HPD (if we drop the big sleeps) in the wq, and have a flag for the HPD IRQ, which would reduce the state to a single bit. How about something like zynqmp_dp_irq_handler(...) { /* Read status and handle underflow/overflow/vblank */ status &= ZYNQMP_DP_INT_HPD_EVENT | ZYNQMP_DP_INT_HPD_IRQ; if (status) { atomic_or(status, &dp->status); return IRQ_WAKE_THREAD; } return IRQ_HANDLED; } zynqmp_dp_thread_handler(...) { status = atomic_xchg(&dp->status, 0); /* process HPD stuff */ } which gets rid of the workqueue too. --Sean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel