From patchwork Fri Aug 18 10:13:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 9908229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EB19B6038C for ; Fri, 18 Aug 2017 10:14:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3ED228BA7 for ; Fri, 18 Aug 2017 10:14:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D29F628C4F; Fri, 18 Aug 2017 10:14:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 50D0C28C85 for ; Fri, 18 Aug 2017 10:14:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09E326E034; Fri, 18 Aug 2017 10:14:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud9.xs4all.net (lb1-smtp-cloud9.xs4all.net [194.109.24.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 62B006E034 for ; Fri, 18 Aug 2017 10:14:02 +0000 (UTC) Received: from [IPv6:2001:420:44c1:2579:107d:8238:b0e5:2d23] ([IPv6:2001:420:44c1:2579:107d:8238:b0e5:2d23]) by smtp-cloud9.xs4all.net with ESMTPA id ieHrd0YkNdRLjieHvdcB8D; Fri, 18 Aug 2017 12:14:00 +0200 Subject: Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support To: Tomi Valkeinen , linux-media@vger.kernel.org References: <20170802085408.16204-1-hverkuil@xs4all.nl> From: Hans Verkuil Message-ID: <9f921701-910c-d749-378c-038e8405f656@xs4all.nl> Date: Fri, 18 Aug 2017 12:13:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CMAE-Envelope: MS4wfAx6P3zAji57ze8So2MgbCTnwCoeCgwux1lmDhSi+ruoJ+fs9nwrHOClFS6MtfOi0U2JtbxXkoZXh9uHHJvFd1s8UMFkWo3YzusmVArngZVkTWGvlOrY c/S7zpf9rYMQKWBx4fZRxae1L8xW1A+xHMYqc3QQ/SU/UzOp94VPppjYlYrEHl7eiT+XS91qgx7Mn5GtmD+4h0Dlh3GH9oNe47zpUjFUT2/Ykl42sHCkuDki u9BUm8Lf+MQNBVz+E0Gb0uL+XctBDfSkHtLjVPiS4xSQP9htZgeBH69yoczhI6dmpv2PkT8d1qtNxUadegoOnqCJ/NNOVMsoY10cN69xs5KBgUbNi5sbrciA wdU89kSSStT78mGTglOW24qDOGSklg== Cc: Laurent Pinchart , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP On 08/18/17 11:02, Tomi Valkeinen wrote: > Hi Hans, > > > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki > > On 11/08/17 13:57, Tomi Valkeinen wrote: > >> I'm doing some testing with this series on my panda. One issue I see is >> that when I unload the display modules, I get: >> >> [ 75.180206] platform 58006000.encoder: enabled after unload, idling >> [ 75.187896] platform 58001000.dispc: enabled after unload, idling >> [ 75.198242] platform 58000000.dss: enabled after unload, idling > > This one is caused by hdmi_cec_adap_enable() never getting called with > enable=false when unloading the modules. Should that be called > explicitly in hdmi4_cec_uninit, or is the CEC framework supposed to call it? Nicely found! The cec_delete_adapter() function calls __cec_s_phys_addr(CEC_PHYS_ADDR_INVALID) which would normally call adap_enable(false), except when the device node was already unregistered, in which case it just returns immediately. The patch below should fix this. Let me know if it works, and I'll post a proper patch and get that in for 4.14 (and possible backported as well, I'll have to look at that). Regards, Hans Signed-off-by: Hans Verkuil diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c index bf45977b2823..61dffe165565 100644 --- a/drivers/media/cec/cec-adap.c +++ b/drivers/media/cec/cec-adap.c @@ -1390,7 +1390,9 @@ static void cec_claim_log_addrs(struct cec_adapter *adap, bool block) */ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) { - if (phys_addr == adap->phys_addr || adap->devnode.unregistered) + if (phys_addr == adap->phys_addr) + return; + if (phys_addr != CEC_PHYS_ADDR_INVALID && adap->devnode.unregistered) return; dprintk(1, "new physical address %x.%x.%x.%x\n",