Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7818110rwp; Wed, 19 Jul 2023 00:13:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHn5uU5o4IFc/HjfWGOOwHIu1Y6hytvwNn4YLlCgx13iYC2cz7WFQqBQo7Xc1cK7dC/kCli X-Received: by 2002:a05:6358:4289:b0:134:e5e7:fb0b with SMTP id s9-20020a056358428900b00134e5e7fb0bmr15558385rwc.0.1689750826380; Wed, 19 Jul 2023 00:13:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689750826; cv=pass; d=google.com; s=arc-20160816; b=m7tY6EHLytIiz1WUfCdZo/fWEgOO/ZOYHV4gM+Qeosbu/h5jGmRb/hfSlVaeaFY3hD m6QEfJZz98bRjTDkKjkGXuZhgvdTywENwkjn5WTWHsuZ3AU0Bx5FhbLq5XiqMWj7U8wt rqwSFn7Xr1F3Fwgn+ity0PwABeFPWeggS9JJcbtE/6A47nI5osm39cMpWsIcixyX2YjO P3nWM+LFph1+622F4pXGPX+UTpSbF/076sTmSFL8DWLPZKFs3EEnlfjCAjihnpSO+9gG o3YOmIx5LPVrGbP5Vlx4CZBtGY3BSfU1TxsF0GN6BtyHDOeiwpxIxJ3EkuVK9PE7Nb20 I1Ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:from:references:cc:to :content-language:subject:user-agent:date:message-id:dkim-signature; bh=60bAOovYqz9okvS2znDa6EQJzhWfazvsJs4mc07ObpU=; fh=dWk1s1px1xBycXNUqgku+p4Z8/0Os+hWDB6HWs5Mjvs=; b=nI/XlVmQUTX3kA2Wle/hxZj6c/p8ux3guRNuhbeV2bd4rMRuQfv3cQ/WbbKLiTCcEq XBrZM1zYsNM/KsjWH4duBPCxfXZ+QjNI50in9KoG8jAL7n/f95Ish2yrJ31Y6hd11nrx Hv68OttriImM9JKeADsn0/x4Y+PnhE8gHK8PCloLWbc2udukAzJwpVbuKiEpj/soNJry /pq+rdwmgotrZXnhRMTtJtCeNPekMuYu3vEEi6RdKB0hn1lLflCUn7FA9/sGS8wtebgp e7g427JVFjYBhCEv4vhFenT9F/N4J4BVjRNtmIpIlr6yBwEaiVqidXeMJzIEcByy+JkD lQ0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=YtU1x3fM; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a631c11000000b0055785aa5282si2832079pgc.81.2023.07.19.00.13.33; Wed, 19 Jul 2023 00:13:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=YtU1x3fM; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229461AbjGSHGE (ORCPT + 99 others); Wed, 19 Jul 2023 03:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGSHGC (ORCPT ); Wed, 19 Jul 2023 03:06:02 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2101.outbound.protection.outlook.com [40.107.15.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E37D0E43 for ; Wed, 19 Jul 2023 00:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sjr9BnH8JSCkF8WPAPv5NEdZ2KAw8E3EcYlL694gQiZ/rSD0VEkNq4wq+rQUWZ4WqFeP18r/AV1/dt4qBFQ8ppu0Looki8WZbm13Hgwz8eZ9MMXI9o3rv+S8Bm+IoXetDlxgFFk3tZ3J0/sB806br/yf/xaw293G9xr4KogTOGRDsyys6rZiaWoI6MIRn/FrciLtSdM2N3+DfoINUFQfpDsjzaRnJYW0viOGfbtVL0gYMWuVwbiyhRyOVZU88tjhJPBykgJ5YLTKHxAh5FtSu5LEnTdFjHI78iOfM9zgzznNMC+KpvG1XdfuB230jOU/X6qn2F94/pJER50p5tymWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=60bAOovYqz9okvS2znDa6EQJzhWfazvsJs4mc07ObpU=; b=JUPlSZSKN14M1/reirOl55FYgdtWqTAWQ7pkBMl9k3uebSDx6n6Nk0L1dnPRLkkFJmCB+8pPSvVZB+AXzsW0rI4468zVpAW7BIGe7fhednY7B169o1RtigosVcB4m5Bke4FuFGYeUzcYzjUa1nfjLbXfAxrEtCrfi4A5nzlY/zTgdaCf5V6aruDnzhK9i2WIhnCvrA6FRBkGrjaSTd3xo9yA3wLajepQRaTW+yR2Ut7eU5ME9lpHwgydedLxbkr39OKPgBfYRP786FZ+CqAv4m6H3SkzFy/L3V0yrduTsBOaU1UTW4u0wafhOx2DjBg1qVDZ4GAMeUZ8kzvf3V3IGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kontron.de; dmarc=pass action=none header.from=kontron.de; dkim=pass header.d=kontron.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mysnt.onmicrosoft.com; s=selector2-mysnt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=60bAOovYqz9okvS2znDa6EQJzhWfazvsJs4mc07ObpU=; b=YtU1x3fMh3PkLTbuZRhf+LGnbfuLgXQbsbzXzBKUcZvyoKu5U5ZegL9mUS6sGWP83MjEHuEKlXwvS6IFy7hWsfkFRSAU9TkWfjwoi1tJ2k8MVsdgiPGs6Ws0vU8lpmx/Unx08Uy4i5LRvEofq7t8p+XhMSZltsAEStaPZKnwgsY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kontron.de; Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) by GVXPR10MB8057.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:115::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Wed, 19 Jul 2023 07:05:57 +0000 Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::95ae:6cb:e93:cce0]) by PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::95ae:6cb:e93:cce0%6]) with mapi id 15.20.6588.031; Wed, 19 Jul 2023 07:05:57 +0000 Content-Type: multipart/mixed; boundary="------------54UFMZPBl967hchf9akXemI5" Message-ID: <2a57622c-402b-5df6-73b3-9ba9aad9843d@kontron.de> Date: Wed, 19 Jul 2023 09:05:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/2] drm: bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec Content-Language: en-US, de-DE To: Tim Harvey , Marek Vasut Cc: Frieder Schrempf , Alexander Stein , Jagan Teki , Adam Ford , Andrzej Hajda , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, Inki Dae , linux-kernel@vger.kernel.org, Marek Szyprowski , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Jonas Karlman References: <20230503163313.2640898-1-frieder@fris.de> <20230503163313.2640898-2-frieder@fris.de> <5dc55bcf-abec-78cd-74b8-54fa67fd1fb2@kontron.de> From: Frieder Schrempf In-Reply-To: X-ClientProxiedBy: AM8P191CA0016.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21a::21) To PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5681:EE_|GVXPR10MB8057:EE_ X-MS-Office365-Filtering-Correlation-Id: e4be990d-2d5a-49c1-5493-08db8826997c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iB1SvgaxaOILpqdp8q8MYwxV5kwIszzcyErbb28q9mCaUFpNIBRoAj2pS4f5xXKU3uP+rTelEVE6cXkQkzuNU9WFfCAdW1AI5woPYlClv/M8hgkqwl2A/wuTDcSGdmNUb07sWnYWCE/kKGd21Wp8x444Kuqb2iQv8VnPoWWGC8Yo7fcISgwfOsTn84HGTUnkYVAuhwZSIgeZ+VTL1rchdnsRdUFADSxrlA8W/yYHxRL4sk+379Kynux4N4Bo/dRdLoctJ/qoaiwZoszA8DdTlrPB4uozIvH0sO2+FNmC213DhEYq5PUFD3wc0hQ/l0dyXrxHZK9A0QK2BvGnQUB5YMOhw3aNx7okjiOmfG7IXSmT1AKaZQCf8vfRUvvna7Am0fyjJg1G+bxqP5c5OzJxDgU2nlSxMyJgBGJSHXyzjyQJRAJP2g4W1+P1OGAj3ptL6PH7tScl590EWpKyMU1kjULFfj3tFSaf7/HixrlyBykYbPTzEqBF7vG1jcbF7YKSPFazk95uhTLuP3V7bSna3ZfObzOtBb7Uq67dui74MROzHqJygIFWsRYkBdAJwR7S/h/TuAf46PTIFWHUFIQRgSONkJhEBp4nRxaagEIo2JhAx7maCuLy9ehFeXq90wb5kdLNwJD5AWchUsv2QCmFWg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(39860400002)(396003)(376002)(346002)(451199021)(31686004)(33964004)(6486002)(45080400002)(6666004)(54906003)(478600001)(110136005)(6506007)(83380400001)(2616005)(36756003)(86362001)(31696002)(2906002)(26005)(44832011)(53546011)(186003)(966005)(6512007)(38100700002)(8936002)(66556008)(66476007)(316002)(66946007)(4326008)(41300700001)(235185007)(8676002)(5660300002)(7416002)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NUsrM3RJYmFxem90c3VCNDZTbVZaa1QyZ0pSR09Yc1RqNG9GZU1WSUtoL0Zn?= =?utf-8?B?bUhDZGU1U0JZVGhsQkFBRmZNemxZNWFzQjdDNWpDTFRIajU1TStTQXRjSUpi?= =?utf-8?B?UDN3MVhTNHZlZVJjYndhakRoclZsYW1TTTRYWVJUTkpIaDl4U2lGMEhVUHNR?= =?utf-8?B?bzNGclRXL2ZjNVJEa0tqMDJNNlJkYzRCbjUwNDRveHl0dlFqSThySldNc0Vo?= =?utf-8?B?TlBkb1lFT0RRNjdvVi8rLzZ4K095eW5kMXNuOEwybXdsSGhCaUVxMUVVOEtH?= =?utf-8?B?MUo3N216dVNUdnVyVmZnamh4MHEvM29VOVh2VndiM0VseUlIeFZoRGl6Mlh2?= =?utf-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KcGc4Y2JHOFJtVTB3?= =?utf-8?B?WUE9PQ==?= X-OriginatorOrg: kontron.de X-MS-Exchange-CrossTenant-Network-Message-Id: e4be990d-2d5a-49c1-5493-08db8826997c X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 07:05:56.9782 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8c9d3c97-3fd9-41c8-a2b1-646f3942daf1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WBvq6vRPhRaAoRYkGeB35C5IKPhiw3do4BtrOgrpw9TY/NsDDDFydbMpcijqRAr9YJY6LhOexIy35E7fgA6Jq5c6fvf7Tpvg8clA2B6gdHc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR10MB8057 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --------------54UFMZPBl967hchf9akXemI5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Tim, On 19.07.23 01:03, Tim Harvey wrote: > On Thu, Jul 13, 2023 at 3:01 AM Frieder Schrempf > wrote: >> >> Hi Tim, >> >> On 13.07.23 09:18, Frieder Schrempf wrote: >>> Hi Tim, >>> >>> On 13.07.23 00:34, Tim Harvey wrote: >>>> On Wed, May 3, 2023 at 9:33 AM Frieder Schrempf wrote: >>>>> >>>>> From: Frieder Schrempf >>>>> >>>>> According to the documentation [1] the proper enable flow is: >>>>> >>>>> 1. Enable DSI link and keep data lanes in LP-11 (stop state) >>>>> 2. Disable stop state to bring data lanes into HS mode >>>>> >>>>> Currently we do this all at once within enable(), which doesn't >>>>> allow to meet the requirements of some downstream bridges. >>>>> >>>>> To fix this we now enable the DSI in pre_enable() and force it >>>>> into stop state using the FORCE_STOP_STATE bit in the ESCMODE >>>>> register until enable() is called where we reset the bit. >>>>> >>>>> We currently do this only for i.MX8M as Exynos uses a different >>>>> init flow where samsung_dsim_init() is called from >>>>> samsung_dsim_host_transfer(). >>>>> >>>>> [1] https://docs.kernel.org/gpu/drm-kms-helpers.html#mipi-dsi-bridge-operation >>>>> >>>>> Signed-off-by: Frieder Schrempf >>>>> --- >>>>> Changes for v2: >>>>> * Drop RFC >>>>> --- >>>>> drivers/gpu/drm/bridge/samsung-dsim.c | 25 +++++++++++++++++++++++-- >>>>> 1 file changed, 23 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c >>>>> index e0a402a85787..9775779721d9 100644 >>>>> --- a/drivers/gpu/drm/bridge/samsung-dsim.c >>>>> +++ b/drivers/gpu/drm/bridge/samsung-dsim.c >>>>> @@ -859,6 +859,10 @@ static int samsung_dsim_init_link(struct samsung_dsim *dsi) >>>>> reg = samsung_dsim_read(dsi, DSIM_ESCMODE_REG); >>>>> reg &= ~DSIM_STOP_STATE_CNT_MASK; >>>>> reg |= DSIM_STOP_STATE_CNT(driver_data->reg_values[STOP_STATE_CNT]); >>>>> + >>>>> + if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) >>>>> + reg |= DSIM_FORCE_STOP_STATE; >>>>> + >>>>> samsung_dsim_write(dsi, DSIM_ESCMODE_REG, reg); >>>>> >>>>> reg = DSIM_BTA_TIMEOUT(0xff) | DSIM_LPDR_TIMEOUT(0xffff); >>>>> @@ -1340,6 +1344,9 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, >>>>> ret = samsung_dsim_init(dsi); >>>>> if (ret) >>>>> return; >>>>> + >>>>> + samsung_dsim_set_display_mode(dsi); >>>>> + samsung_dsim_set_display_enable(dsi, true); >>>>> } >>>>> } >>>>> >>>>> @@ -1347,9 +1354,16 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, >>>>> struct drm_bridge_state *old_bridge_state) >>>>> { >>>>> struct samsung_dsim *dsi = bridge_to_dsi(bridge); >>>>> + u32 reg; >>>>> >>>>> - samsung_dsim_set_display_mode(dsi); >>>>> - samsung_dsim_set_display_enable(dsi, true); >>>>> + if (samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) { >>>>> + samsung_dsim_set_display_mode(dsi); >>>>> + samsung_dsim_set_display_enable(dsi, true); >>>>> + } else { >>>>> + reg = samsung_dsim_read(dsi, DSIM_ESCMODE_REG); >>>>> + reg &= ~DSIM_FORCE_STOP_STATE; >>>>> + samsung_dsim_write(dsi, DSIM_ESCMODE_REG, reg); >>>>> + } >>>>> >>>>> dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; >>>>> } >>>>> @@ -1358,10 +1372,17 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge, >>>>> struct drm_bridge_state *old_bridge_state) >>>>> { >>>>> struct samsung_dsim *dsi = bridge_to_dsi(bridge); >>>>> + u32 reg; >>>>> >>>>> if (!(dsi->state & DSIM_STATE_ENABLED)) >>>>> return; >>>>> >>>>> + if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type)) { >>>>> + reg = samsung_dsim_read(dsi, DSIM_ESCMODE_REG); >>>>> + reg |= DSIM_FORCE_STOP_STATE; >>>>> + samsung_dsim_write(dsi, DSIM_ESCMODE_REG, reg); >>>>> + } >>>>> + >>>>> dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; >>>>> } >>>>> >>>>> -- >>>>> 2.40.0 >>>>> >>>> >>>> Hi Frieder, >>>> >>>> I found this patch to break mipi-dsi display on my board which has: >>>> - FocalTech FT5406 10pt touch controller (with no interrupt) >>>> - Powertip PH800480T013-IDF02 compatible panel >>>> - Toshiba TC358762 compatible DSI to DBI bridge >>>> - ATTINY based regulator used for backlight controller and panel enable >>>> >>>> I enable this via a dt overlay in a pending patch >>>> imx8mm-venice-gw72xx-0x-rpidsi.dtso [1] which works on 6.4 but not >>>> 6.5-rc1 which has this patch. >>>> >>>> The issue appears as: >>>> [ 6.110585] samsung-dsim 32e60000.dsi: xfer timed out: 29 06 00 00 >>>> 64 01 05 00 00 00 >>>> [ 6.326588] tc358762 32e60000.dsi.0: error initializing bridge (-110) >>>> >>>> Instead of >>>> [ 1.011729] samsung-dsim 32e10000.dsi: supply vddcore not found, >>>> using dummy regulator >>>> [ 1.019829] samsung-dsim 32e10000.dsi: supply vddio not found, >>>> using dummy regulator >>>> [ 5.649928] samsung-dsim 32e10000.dsi: >>>> [drm:samsung_dsim_host_attach] Attached tc358762 device >>>> >>>> I'm curious what board/panel were you needing this for and do you have >>>> any ideas why it broke my setup? >>>> >>>> I'm also curious what board/panel Alexander tested this with and if >>>> Adam or Jagan (or others) have tested this with their hardware? >>> >>> Sorry for breaking your setup. My test- and use-case is the same as >>> Alexander's. I have the SN65DSI84 downstream bridge and without this >>> patch it fails to come up in some cases. >>> >>> The failure is probably related to your downstream bridge being >>> controlled by the DSI itself using command mode. The SN65DSI84 is >>> instead controlled via I2C. >>> >>> Actually we should have tested this with a bridge that uses command mode >>> before merging, now that I think of it. But I wasn't really aware of >>> this until now. >>> >>> I'll have a closer look at the issue and then will get back to you. In >>> the meantime if anyone can help analyze the problem or has proposals how >>> to fix it, please let us know. >> >> With my patch samsung_dsim_init() now initializes the DSIM to stop >> state. When being called from samsung_dsim_atomic_pre_enable() this >> works as the stop state is cleared later in samsung_dsim_atomic_enable(). >> >> When being called from samsung_dsim_host_transfer() to handle transfers >> before samsung_dsim_atomic_pre_enable() was called, the stop state is >> never cleared and transfers will fail. >> >> This is the case in your setup as tc358762_init() is called in >> tc358762_pre_enable(). >> >> I think that requiring to initialize the DSI host during transfer could >> be avoided in this case by moving tc358762_init() from >> tc358762_pre_enable() to tc358762_enable(). >> >> But at the same time according to the docs at [1] this seems to be a >> valid case that we need to support in the DSIM driver: >> >> Whilst it is valid to call host_transfer prior to pre_enable or >> after post_disable, the exact state of the lanes is undefined at >> this point. The DSI host should initialise the interface, transmit >> the data, and then disable the interface again. >> >> Therefore I would propose to try a fix like in the attachement. If you >> could test this, that would be great. >> >> Thanks >> Frieder >> >> [1] >> https://docs.kernel.org/gpu/drm-kms-helpers.html#mipi-dsi-bridge-operation > > Hi Frieder, > > The patch does not resolve the issue. I still get the 'xfer timed out' > from samsung-dsim but noticing today that this issue doesn't exist in > linux-next I've found that its resolved by Marek's patch: > commit 8a4b2fc9c91a ("drm/bridge: tc358762: Split register programming > from pre-enable to enable") Thanks for testing. I didn't notice there already is a patch from Marek for the tc358762 driver. This is exactly the change that I was considering above as a fix on the downstream bridge side. > > I'm not clear on how that patch is staged in linux-next. If we can get > that pulled into 6.5 then it will resolve the breakage. Still the documentation says that the DSI host must be able to handle this and there might be other drivers that are not yet fixed like this or can't be changed to make DSI transfers only after the host's pre_enable() was called. Therefore I would prefer to fix the DSIM driver and apply this fix to 6.5-rc instead of backporting the tc358762 patch. I gave it another shot and maybe you could do one more test with the attached patch and without the fix in tc358762. Thanks Frieder --------------54UFMZPBl967hchf9akXemI5 Content-Type: text/x-patch; charset=UTF-8; name="0001-drm-bridge-samsung-dsim-Fix-init-during-host-transfe.patch" Content-Disposition: attachment; filename*0="0001-drm-bridge-samsung-dsim-Fix-init-during-host-transfe.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAyMDM5ODQ3MzJkNmFmNDVkOWE4YmQ3MWQwZTEyMzQ5NjU5NjBlZDE5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGcmllZGVyIFNjaHJlbXBmIDxmcmllZGVy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