Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3945759pxu; Wed, 9 Dec 2020 04:49:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJynFhcjUxLGTxx3lx6LzChfXd+eQOk7GyNilxj5cM0JEgvpbKjUl18EwtToUkp9137egkCE X-Received: by 2002:aa7:dac5:: with SMTP id x5mr1886666eds.198.1607518170325; Wed, 09 Dec 2020 04:49:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607518170; cv=none; d=google.com; s=arc-20160816; b=PpGRQZ/lVgi8C52i5pI+Qp1nnAcXskqQXWtHCo9N3ZoO4/c1qHsAI9wfpcgX1WjJ3M K5BeNmrPQrLEDomtJMG4+Zsa8YrzxTwEQEudvLZoQJOBqSPzIj0rZDY4SzhhsZqzLN60 7OJScJL1EqzurWpfr5MsMbslrw97lqRW8srk1B97G8TW/h3KRb+wWlf6qpcFtLyJmffq bgRc9SVAXA8U/+SnkIcyCfWiB0HUnHwM4b7xQ8UeNu+DM5eeF51XJsJho5hJfMSODgWE q64QJK+6bKzR7ZVFmHxt8IsT2XhTQD6iSwVOkIksfh0O73jJtyWbFdWEHRrEw6k2mkmU gyzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=gyuNzlVWY1dc3cNd/oMgNdSwOYnZEilTxwUjO6LvZ0s=; b=wkwcHA7EjX6XWlbnJ6OFeSY/8jwgiqxehmCozR1WjEEnP8vhNSD5WdoPgJ0QZfds5a 7dLm98gGFeeTcEMTjstC8NBeiaFRUfZcTrhOlA65ZjPmHUiaCbUX1zMwvqfLN8cOUN6a JbrxN1qFVwEQdCCYA5GI8XhXWRqpymAGylzlWGQR4owHVdy+LuP3SlMCuT+3EVSxh7FV J2Bbbq8c4tsxghfwz0TgQA3nXd2+rqcAJRdoRiX1PkjJJk8ytuRcae5KJc+SjHKZhZiY SdHim/C+jwpjwV9kdRcp361nLm79NQcQKzn4Mx5ejbMGOfL+29cXf4nzyggdrx5vD6px HgCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hzkE5kiu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si712979ejj.381.2020.12.09.04.49.06; Wed, 09 Dec 2020 04:49:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hzkE5kiu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731801AbgLIMnK (ORCPT + 99 others); Wed, 9 Dec 2020 07:43:10 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:42692 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731645AbgLIMnK (ORCPT ); Wed, 9 Dec 2020 07:43:10 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0B9CfLeo061329; Wed, 9 Dec 2020 06:41:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1607517681; bh=gyuNzlVWY1dc3cNd/oMgNdSwOYnZEilTxwUjO6LvZ0s=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=hzkE5kium29d3zGio3JriNJ2nmTx5+3sUPg2PfgdjX592BK+TYS8iExWXbxTqc7qC GTnmIBZbpnD+bVjrxzeZtlxU3o3YJB6n8YvqjxdTYEfvWPn+cETed5SoBOfhBzar7b +dYOR8cJBqlpqm07Slb50jnwvJBLTUsonTB9NM5o= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0B9CfLPI120948 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Dec 2020 06:41:21 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 9 Dec 2020 06:41:21 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 9 Dec 2020 06:41:21 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0B9CfJ5S067388; Wed, 9 Dec 2020 06:41:19 -0600 Subject: Re: [PATCH] drm/tidss: Use the new api devm_drm_irq_install To: Daniel Vetter CC: Tian Tao , Jyri Sarha , Dave Airlie , dri-devel , Linux Kernel Mailing List References: <1607413859-63365-1-git-send-email-tiantao6@hisilicon.com> <20201209004828.GN401619@phenom.ffwll.local> <06c1dee7-488d-8a74-a55c-74043cb060cd@ti.com> <327508b7-2c63-8f2c-36a7-362c83b4243d@ti.com> From: Tomi Valkeinen Message-ID: <0eb3f134-877e-4518-2185-8e97cddbfb4d@ti.com> Date: Wed, 9 Dec 2020 14:41:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/12/2020 14:08, Daniel Vetter wrote: > On Wed, Dec 9, 2020 at 1:06 PM Tomi Valkeinen wrote: >> >> On 09/12/2020 13:56, Daniel Vetter wrote: >>> On Wed, Dec 9, 2020 at 12:29 PM Tomi Valkeinen wrote: >>>> >>>> On 09/12/2020 02:48, Daniel Vetter wrote: >>>>> On Tue, Dec 08, 2020 at 03:50:59PM +0800, Tian Tao wrote: >>>>>> Use devm_drm_irq_install to register interrupts so that >>>>>> drm_irq_uninstall is not needed to be called. >>>>>> >>>>>> Signed-off-by: Tian Tao >>>>> >>>>> There's another drm_irq_install in the error path. But I'm not sure this >>>>> is safe since you're chaning the order in which things get cleaned up now. >>>>> So leaving this up to Tomi. >>>> >>>> Right, I don't think this works. tidss irq_uninstall uses runtime_get/put, which needs to happen >>>> before pm_runtime_disable. With devm_drm_irq_install that's not the case. >>> >>> Hm I don't spot devm_ versions of these, surely we're not the only >>> ones with this problem? >> >> drm-misc-next has these. hisilicon uses it, but doesn't have an irq_uninstall hook, so possibly late >> uninstall is fine there. > > I meant a devm_ version of pm_runtime_enable. Or some other way to > make this just work. I see. No, I don't think we have. Also, I feel a bit uncomfortable with devm'ified irq request/free. devm is fine for allocs and reserving stuff, but this one affects the HW state, and your irq handler could get called until devm frees the irq at some late point of time. Well, it can be made to work, but just need to be careful. I've had my irq handlers getting called too early or too late so many times that I'm a bit paranoid about it =). Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki