From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DB7D13CA81 for ; Fri, 17 Jan 2025 16:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737129949; cv=none; b=CRvlO5peGUe55Xv6IjS+goQDQDPiD9+/HqdtI2twh4ytHtV5/+5qr/C0r3xhJhDToMgdG9weA58ctdYeE1XfBeG53BBIPrTzI2Czs1W27jaFKuRKYApzLICVTdrzFQnquXa9ANJbG5/UP3CCmJvX/aYCISkaQ4hy84HA/tffhdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737129949; c=relaxed/simple; bh=PjnGiMyLxCnHq+h7yQjUe7VzAHCsHX8cmYkBMNAah6Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=umAx1QTh0q0hQLgeohRtHvI4x62Fjiic4yGIrFd1ch+sJFc6/gCqYQBuI7vmUdLCBJI2WReNBnhsynP5Jlyt/zz375ZoDLt5GheNXESR3JAIFiEP3dJbE81a3j3N7mbabVhpvl6EqFbQNTYkROvDwbcnQQjRdHh+34IlUQQBFTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=XlvF2Bf7; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XlvF2Bf7" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20250117160544euoutp01490f9054003c3fa1a0615e867f6a6a94~bhnsmsuR82425024250euoutp01I for ; Fri, 17 Jan 2025 16:05:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20250117160544euoutp01490f9054003c3fa1a0615e867f6a6a94~bhnsmsuR82425024250euoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1737129944; bh=a6tOqrnrINZNt1HeWOxCpX+rnRHQcGPQqaCPkjFcLhY=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=XlvF2Bf7Xl4wJ/6zY53SS+ocamC+NcRqFl+TggXA3W3rUr2LZ8fc85B7q3rQfvDRu GtPJ6mOlXK1NrckCma89c7QQPdgypVAEECq56dY056qgwQu+IHwSnhRUNWFwlTkaHF DeJXPQYcytinFcNIsspvUV8EvJ1TQE+lMZTt24d0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20250117160544eucas1p2320342f0aea349a27352d6ac3edae71c~bhnsXvexG2157321573eucas1p23; Fri, 17 Jan 2025 16:05:44 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 7E.8C.20409.8DF7A876; Fri, 17 Jan 2025 16:05:44 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20250117160544eucas1p121973640d5f6d8845b1c30bd692c3b15~bhnsAwLaZ0745607456eucas1p1l; Fri, 17 Jan 2025 16:05:44 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20250117160544eusmtrp292e22fc965da2d2e93d08a7f57272459~bhnr99jpR1671216712eusmtrp2J; Fri, 17 Jan 2025 16:05:44 +0000 (GMT) X-AuditID: cbfec7f4-c0df970000004fb9-a7-678a7fd8558d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5A.15.19654.7DF7A876; Fri, 17 Jan 2025 16:05:43 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250117160543eusmtip24de2560432668e730613392f07ea07d7~bhnrRiRQR1732817328eusmtip2v; Fri, 17 Jan 2025 16:05:43 +0000 (GMT) Message-ID: <8a7581e4-6422-4d77-8027-02df0d7da489@samsung.com> Date: Fri, 17 Jan 2025 17:05:42 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/1] regmap: Synchronize cache for the page selector To: Andy Shevchenko Cc: Mark Brown , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Dmitry Baryshkov , DRI mailing list Content-Language: en-US From: Marek Szyprowski In-Reply-To: Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGKsWRmVeSWpSXmKPExsWy7djP87o36rvSDY69krHobZrOZDH14RM2 i9fTPrBZTDz/k83iytf3bBbNi9ezWVzeNYfNYu6XqcwOHB6bVnWyedy5tofNY97JQI/9c9ew e9zvPs7k8XmTXABbFJdNSmpOZllqkb5dAlfG3DdrWQvOq1WsXhbfwPhbtouRk0NCwERi496r bF2MXBxCAisYJa78n8IM4XxhlNh7dRE7hPOZUeLD6QMsMC03Wj+wQiSWM0p0tuxjgnA+MkpM n/UcKMPBwStgJzHnZiVIA4uAqsTO6VfAmnkFBCVOznwCZosKyEvcvzWDHcQWFv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UkaJaec2skEkZCRO TmtghbCFJf5c62KDKHrPKHHpfxNQgoODV8BOYs7NSpAaFgFViZ3Tr7CA2LwCghInZz4Bs0UF 5CXu35rBDmILC3hLrGidzwhiiwiYS6ybtAhsJrPAaiaJH70b2CEWzGeSOLfnONgVzALiEree zGcCsdkEDCW63naBxTkFjCS6vz1mhqgxk+ja2sUIYctLNG+dzTyBUWgWkkNmIRk1C0nLLCQt CxhZVjGKpJYW56bnFhvpFSfmFpfmpesl5+duYgRG4bZjP7fsYFz56qPeIUYmDsZDjBIczEoi vGm/O9KFeFMSK6tSi/Lji0pzUosPMZoCQ2Mis5Rocj4wDeSVxBuaGZgamphZGphamhkrifOy XTmfJiSQnliSmp2aWpBaBNPHxMEp1cDk7LjAegP3jUKFj71/dJplt993U3/YydZQY60wef/O X80LFku2feE9sLHj9srPc8/N5Tc9sitK+tHqyWFcpkf5zhVNKou/usnf/fja6T89v8ikejsv Sby/MP6KjZDdEqWXzVsYv9/dOuffuqPzUsyXvSsLZtu1PytrUYqFy87qE1k5np9Fe/4aBUeW CAXc235vgav+k+lPphQ/fflEdDXXhsk7s+9OKkvbEn+4yGXK/ooTbyOis7Qlq2/ObbS2vnvx 9/8J5952VXuKtrVsS59bwhv1/P2KuEy1OblTX5w4fa1wqxFzSPaUoLioZW5/v1+qVF6X78zv FnjlmrJbi3B0wGORN89kRW8sZE+v3XZlrRJLcUaioRZzUXEiANPcemRLAwAA X-CMS-MailID: 20250117160544eucas1p121973640d5f6d8845b1c30bd692c3b15 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20250117135754eucas1p1a8558792f9475c2acc009e1ba20c7109 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20250117135754eucas1p1a8558792f9475c2acc009e1ba20c7109 References: <20250116124303.3941583-1-andriy.shevchenko@linux.intel.com> On 17.01.2025 15:30, Andy Shevchenko wrote: > On Fri, Jan 17, 2025 at 04:09:58PM +0200, Andy Shevchenko wrote: >> On Fri, Jan 17, 2025 at 02:57:52PM +0100, Marek Szyprowski wrote: >>> On 16.01.2025 13:42, Andy Shevchenko wrote: >>>> If the selector register is represented in each page, its value >>>> in accordance to the debugfs is stale because it gets synchronized >>>> only after the real page switch happens. Synchronize cache for >>>> the page selector. >>>> >>>> Before (offset followed by hexdump, the first byte is selector): >>>> >>>> // Real registers >>>> 18: 05 ff 00 00 ff 0f 00 00 f0 00 00 00 >>>> ... >>>> // Virtual (per port) >>>> 40: 05 ff 00 00 e0 e0 00 00 00 00 00 1f >>>> 50: 00 ff 00 00 e0 e0 00 00 00 00 00 1f >>>> 60: 01 ff 00 00 ff ff 00 00 00 00 00 00 >>>> 70: 02 ff 00 00 cf f3 00 00 00 00 00 0c >>>> 80: 03 ff 00 00 00 00 00 00 00 00 00 ff >>>> 90: 04 ff 00 00 ff 0f 00 00 f0 00 00 00 >>>> >>>> After: >>>> >>>> // Real registers >>>> 18: 05 ff 00 00 ff 0f 00 00 f0 00 00 00 >>>> ... >>>> // Virtual (per port) >>>> 40: 00 ff 00 00 e0 e0 00 00 00 00 00 1f >>>> 50: 01 ff 00 00 e0 e0 00 00 00 00 00 1f >>>> 60: 02 ff 00 00 ff ff 00 00 00 00 00 00 >>>> 70: 03 ff 00 00 cf f3 00 00 00 00 00 0c >>>> 80: 04 ff 00 00 00 00 00 00 00 00 00 ff >>>> 90: 05 ff 00 00 ff 0f 00 00 f0 00 00 00 >>>> >>>> Fixes: 6863ca622759 ("regmap: Add support for register indirect addressing.") >>>> Signed-off-by: Andy Shevchenko >>> This patch landed in linux-next some time ago as commit 1fd60ed1700c >>> ("regmap: Synchronize cache for the page selector"). Today I've noticed >>> that it causes a regression for Lontium LT9611UXC HDMI bridge driver. >> Is there any datasheet link to the HW in question? >> >> (FWIW, I have tested this with the CY8C9540 GPIO I²C expander on Intel Galileo >> Gen 1 board.) >> >>> With today's linux-next I got the following messages on QCom RB5 board: >>> >>> # dmesg | grep  lt9611uxc >>> [   13.737346] lt9611uxc 5-002b: LT9611 revision: 0x00.00.00 >>> [   13.804190] lt9611uxc 5-002b: LT9611 version: 0x00 >>> [   13.870564] lt9611uxc 5-002b: FW version 0, enforcing firmware update >>> [   13.877437] lt9611uxc 5-002b: Direct firmware load for >>> lt9611uxc_fw.bin failed with error -2 >>> [   13.887517] lt9611uxc 5-002b: probe with driver lt9611uxc failed with >>> error -2 >>> >>> after reverting the $subject patch, the driver probes fine on that board. >>> >>> I'm not sure if this is really a bug caused by this change or simply the >>> driver already was aligned to old regmap behavior. Dmitry, could you >>> check the regamp usage and review the changes introduced by this patch? >>> Let me know if there is anything to check on the real hardware to help >>> resolving this issue. >> Yes, see below. And thank you for your report! >> >> ... >> >>>> + /* >>>> + * If selector register has been just updated, update the respective >>>> + * virtual copy as well. >>>> + */ >>>> + if (page_chg && >>>> + in_range(range->selector_reg, range->window_start, range->window_len)) >>>> + _regmap_update_bits(map, sel_register, mask, val, NULL, false); >> Can you add a test printk() here to show >> >> page_chg >> range->selector_reg, range->window_start, range->window_len >> sel_register, mask, val >> >> ? >> >> And would commenting these three lines make it work again? > Also try to apply this patch (while having the above lines not commented): This patch applied alone doesn't change anything. Probe still fails. However, with the mentioned 3 lines in the regmap code commented AND this patch applied, lt9611uxc driver probe also fails. Does it mean that there is really a bug in the driver? > From 0fe5fe51d8b86305a4ca1ae44ede34a24fe2f9d7 Mon Sep 17 00:00:00 2001 > From: Andy Shevchenko > Date: Fri, 17 Jan 2025 16:29:19 +0200 > Subject: [PATCH 1/1] TBD: > > Signed-off-by: Andy Shevchenko > --- > drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > index f4c3ff1fdc69..35a1dd568bbb 100644 > --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > @@ -69,7 +69,7 @@ struct lt9611uxc { > static const struct regmap_range_cfg lt9611uxc_ranges[] = { > { > .name = "register_range", > - .range_min = 0, > + .range_min = 0x0100, > .range_max = 0xd0ff, > .selector_reg = LT9611_PAGE_CONTROL, > .selector_mask = 0xff, Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland