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 X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F41EBC4338F for ; Sat, 31 Jul 2021 18:52:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AF74660EB2 for ; Sat, 31 Jul 2021 18:52:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF74660EB2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iMjjpUptlxWvnWLhuMgdoEY+HRidJDZlugQzJRpvZJM=; b=MOpuP1PNXeh/ud 4CqGdkyasArxDc9BMie59AycXzlzoDeokyxoVMHq7l/fvGHAF7psyrGHfeSjAPQD/kQ/l32F0m3Ig YGxdlzFzyFkE/2KF2cWpgv7dltgCHpWHNpSyMZjYLUzA3eR6yjW4+i0hj1+8xLYyh+rX1CQeunDHE CQ2HSXUBiHubE8yjg+VE1DnIZ7kOJ9pLDyqx1SGrXpDH3nMnJXKMjRTjCnxRQ7LcaRgu4kNqm9gBU lncdkgMgeOXjtya+5q5LY9lVe+XQyW/1h5UhBkJ4EZhNwUloWnkTdNPzSCyDUzXK+RxtUsiBgaT7d QhQGzRJjrq/Sbb8XIcSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9u46-00C5SN-3G; Sat, 31 Jul 2021 18:50:30 +0000 Received: from mx2.smtp.larsendata.com ([91.221.196.228]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9u3s-00C5RG-Vx for linux-arm-kernel@lists.infradead.org; Sat, 31 Jul 2021 18:50:18 +0000 Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id 2a153144-f230-11eb-8d1a-0050568cd888; Sat, 31 Jul 2021 18:50:24 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id ED887194B0F; Sat, 31 Jul 2021 20:50:27 +0200 (CEST) Date: Sat, 31 Jul 2021 20:50:02 +0200 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Thomas Zimmermann Subject: Re: [PATCH 00/14] drm: Make DRM's IRQ helpers legacy Message-ID: References: <20210727182721.17981-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210727182721.17981-1-tzimmermann@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210731_115017_340337_F1D0FCBC X-CRM114-Status: GOOD ( 20.55 ) 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: , Cc: airlied@linux.ie, liviu.dudau@arm.com, stefan@agner.ch, amd-gfx@lists.freedesktop.org, anitha.chrisanthus@intel.com, patrik.r.jakobsson@gmail.com, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, daniel@ffwll.ch, edmund.j.dea@intel.com, s.hauer@pengutronix.de, alison.wang@nxp.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, dri-devel@lists.freedesktop.org, sean@poorly.run, linux-arm-kernel@lists.infradead.org, tomba@kernel.org, bbrezillon@kernel.org, jyri.sarha@iki.fi, christian.koenig@amd.com, robdclark@gmail.com, kernel@pengutronix.de, alexander.deucher@amd.com, shawnguo@kernel.org, brian.starkey@arm.com 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 Hi Thomas, On Tue, Jul 27, 2021 at 08:27:07PM +0200, Thomas Zimmermann wrote: > DRM's IRQ helpers are only helpful for old, non-KMS drivers. Move > the code behind CONFIG_DRM_LEGACY. Convert KMS drivers to Linux > IRQ interfaces. > > DRM provides IRQ helpers for setting up, receiving and removing IRQ > handlers. It's an abstraction over plain Linux functions. The code > is mid-layerish with several callbacks to hook into the rsp drivers. > Old UMS driver have their interrupts enabled via ioctl, so these > abstractions makes some sense. Modern KMS manage all their interrupts > internally. Using the DRM helpers adds indirection without benefits. > > Most KMs drivers already use Linux IRQ functions instead of DRM's > abstraction layer. Patches 1 to 12 convert the remaining ones. > The patches also resolve a bug for devices without assigned interrupt > number. DRM helpers don't test for IRQ_NOTCONNECTED, so drivers do > not detect if the device has no interrupt assigned. > > Patch 13 removes an unused function. > > Patch 14 moves the DRM IRQ helpers behind CONFIG_DRM_LEGACY. Only > the old non-KMS drivers still use the functionality. > > Thomas Zimmermann (14): > drm/amdgpu: Convert to Linux IRQ interfaces > drm/arm/hdlcd: Convert to Linux IRQ interfaces > drm/atmel-hlcdc: Convert to Linux IRQ interfaces > drm/fsl-dcu: Convert to Linux IRQ interfaces > drm/gma500: Convert to Linux IRQ interfaces > drm/kmb: Convert to Linux IRQ interfaces > drm/msm: Convert to Linux IRQ interfaces > drm/mxsfb: Convert to Linux IRQ interfaces > drm/radeon: Convert to Linux IRQ interfaces > drm/tidss: Convert to Linux IRQ interfaces > drm/tilcdc: Convert to Linux IRQ interfaces > drm/vc4: Convert to Linux IRQ interfaces > drm: Remove unused devm_drm_irq_install() > drm: IRQ midlayer is now legacy With the irq_enabled confusion out of the way I want to re-address two issues here that I know you have answered but I am just not convinced. 1) IRQ_NOTCONNECTED We do not have this check in drm_irq today and we should avoid spreading it all over. We are either carrying it forever or we wil lsee patches floating in to drop the check again. The current use in the kernel is minimal: https://elixir.bootlin.com/linux/latest/A/ident/IRQ_NOTCONNECTED So as a minimum drop it from atmel_hlcdc and preferably from the rest as it is really not used. (Speaking as atmel_hlcdc maintainer) 2) devm_request_irq() We are moving towards managed allocation so we do not fail to free resources. And an irq has a lifetime equal the device itself - so an obvious cnadidate for devm_request_irq. If we do not introduce it now we will see a revisit of this later. I can be convinced to wait with this as we will have to do much more in each driver, but I cannot see any good arguments to avoid the more modern way to use devm_request_irq. Sam _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel