From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH 2/4] staging: imx-hdmi: correct connector detect and hotplug Date: Mon, 14 Apr 2014 21:57:28 +0100 Message-ID: <20140414205728.GM24070@n2100.arm.linux.org.uk> References: <1397225615-17670-1-git-send-email-l.stach@pengutronix.de> <1397225615-17670-2-git-send-email-l.stach@pengutronix.de> <20140413145810.GA24070@n2100.arm.linux.org.uk> <1397464952.4548.4.camel@weser.hi.pengutronix.de> <20140414091033.GF24070@n2100.arm.linux.org.uk> <1397468323.4548.14.camel@weser.hi.pengutronix.de> <20140414100957.GG24070@n2100.arm.linux.org.uk> <1397471085.4548.23.camel@weser.hi.pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from pandora.arm.linux.org.uk (gw-1.arm.linux.org.uk [78.32.30.217]) by gabe.freedesktop.org (Postfix) with ESMTP id 02EC96E827 for ; Mon, 14 Apr 2014 13:58:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1397471085.4548.23.camel@weser.hi.pengutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Lucas Stach Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , kernel@pengutronix.de, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, Apr 14, 2014 at 12:24:45PM +0200, Lucas Stach wrote: > Am Montag, den 14.04.2014, 11:09 +0100 schrieb Russell King - ARM Linux: > > Now *you* please go back and read what you said about kms/userspace being > > able to poll the connector, thereby causing an EDID read attempt while > > HPD may not be active. > > > Yes, userspace may trigger an explicit detect because it might suspect > that a sink is present while it has not received any HP event. What > userspace expects to happen in this situation is an explicit poll of the > connector regardless of the HP status. So, if you issue this poll, and the sink has lowered the HPD signal because it wants to update the EDID EEPROM, and is in the middle of doing so. Meanwhile you start an I2C transaction in the DDC bus. Maybe you win the arbitration, maybe you gain access because you manage to get your transaction in while the sink is between two I2C transactions. The result is you can end up reading inconsistent EDID data from the sink. There is no race free way to do this - HPD is the indication on HDMI that the sink is available, and that the EDID can be read by the source. If HPD is not active, then the EDID should *not* be read. > If you then just report the connector as disconnected because you didn't > receive a HP event before, you break the use-case for which userspace is > calling an explicit detect in the first place. What is wrong is that we store the interrupt-generated cached state, rather than reporting the actual HPD signal state when the "detect" method is used. We need to be reporting the real live state of the HPD signal in that function - or, in the case where HPD has not been correctly wired, your fallback of the RXSENSE bits. HPD *is* the signal which says "the HDMI sink is *properly* connected and the EDID data is available for you to read" when it is asserted. When HPD is not asserted, the HDMI sink is saying that the EDID data is not available. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it.