Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp909011rwp; Thu, 13 Jul 2023 03:10:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlEq90xXV9E8MPVuawgbo5AS+ATP4sBdHK2MWnIrr/UiMQ9aP/gxUUqH1XDNQLezBS8egw67 X-Received: by 2002:aa7:c709:0:b0:51a:7bcd:a82d with SMTP id i9-20020aa7c709000000b0051a7bcda82dmr1277797edq.23.1689243010656; Thu, 13 Jul 2023 03:10:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689243010; cv=pass; d=google.com; s=arc-20160816; b=0dLdr/dUQtYqeOYR5cywzQ2v3peaXWGUgwNcbHLinAaXQ0GLNxr1DFkJKUa+ZGlAXg lM8jBHmi8s26unEbAr2MhPS35FNrPyRloKX+Ktn/ZZ7daxsDHhEpupFoOuO9HGcmFlJV Wnj1wERVlaeAgFi6VRlFDFNESzUtX+npmsxjHsAEPVlljbl3tsoBu50hFifD9EzsXuZA p76mLtCnQnFVgGXICLtiMk4A+6QCoiCCgjZUzM1mlB2Hx2mzEHeKrLA47XgZhIbT/iN0 LbcpIy9OdnP69n63xpBioVWzWlEQaU88uhP+4akx9nNeYHuoaw7U7hpvHQ05/rJw/HZZ VzZw== 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:references:cc:to:from :content-language:subject:user-agent:date:message-id:dkim-signature; bh=/gQNij1Sy5mTM5AL6AtSVeP59fnPTxZRhfGHV1rUIJE=; fh=UxPCHswG+noFAin8TUl1Tp9v90ptIXWnUhW7qR/61oo=; b=t++Y5shmKp1gU0r25LCALtLXrMLWNqYMR/FqGTyKlc5pSVh13x+8+mQSaqGFmEBnTx yrG4ZW101sTZY6ogC8cXydR3BrOXmoNXdQKEmbMK0jkGzQOqmWhBR/6L3Jeg/zrD5eDJ Wim35lCRtNDSqw428QsqEDuWP4znD5u7wXN4Jh2rRBkDLE8UXRSgA5kIS7vKaZzi/lFt o4x7Ksz2hzNucQHVnFbCxPZUSnaTFZclVkXwDCfZKh8xsVOVNWSC6Nq2zdqHAm9q56nd i9Gf+e62cYw7klJ3MTOmpBis7s/LbhDvxG19Ta15lOpW0zZhz8a8mc11beWBWCS0euVk Jz/g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=YXzGuqos; 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 m23-20020a056402051700b0051ddf67cb47si6869845edv.204.2023.07.13.03.09.45; Thu, 13 Jul 2023 03:10:10 -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=YXzGuqos; 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 S234292AbjGMKCe (ORCPT + 99 others); Thu, 13 Jul 2023 06:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233565AbjGMKCH (ORCPT ); Thu, 13 Jul 2023 06:02:07 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2124.outbound.protection.outlook.com [40.107.15.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9E22698 for ; Thu, 13 Jul 2023 03:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JfFW2yWjrfcvWHvGVoh7HhARgddtBBQ+xmDvKjmx8tu9dn9t26kt+gBHc9Evvyp4jck7G4HReG0su76EhePhn3HHI13x35LbumR4g8IFXQ2OOPT1QGRcX8TPYn2Axtk5NaPO+JR7cZfN+P1108bB3BkB2kLn8tEuixOTdeTO/9U9wupmYaL0psXi5ChFMK8DohvO0LPlhfQcHmJfnUQRKlz34alQZIyS+FIblK4YQcw5gylJbQFbprqBdtnrozP/RfRmLYzCsMJioMVbVPsA0zuAoKJxXAvphXPCpfqRqTyeDUFmvz4rapuhYYRA0dPih37n/R1Xio+x6i9DAT1oNg== 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=/gQNij1Sy5mTM5AL6AtSVeP59fnPTxZRhfGHV1rUIJE=; b=Sq7hCwieeeTZIE2NnjEhksxB4zN2wuO2BbZeR9JRnvS9/U8KIRGT9VpXDEzpSWRnOdvqznX1W768L1NyVAtN0QZu6am4twk/AHI7z3RMirBN03ZYzWxQgkp1mlrV+V05lbRyw1JovfOcoc89em3LvdmyiXAPMqmZ2KcQ5TZlWO0oZDD9afpsMPvR8J12VQtRiIe/E/BIsUOwh8e0YZyTej2s5b0e1MT+G0U48TNEaZjCpB3YlZ1YXvcu/xack6HdWyiRcu4XNLPLwp/wCTayX9x2Hdmri6PiMaqg4jybTj3LRdsfxUFsHMjDNZLSyg8kVVVWLmGnwnB4Ngl4PjgZXA== 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=/gQNij1Sy5mTM5AL6AtSVeP59fnPTxZRhfGHV1rUIJE=; b=YXzGuqos5iMt89J/du57LIVfJHhdtah8UzWzwYGvO6l+742aV6MHeFtlCWtnbbLH/WhfrJTaT2DOjU8TB+F8+C8WFAttdEyoPR+BfLWpyfOG+KFAygNavthCQf/ERQ69jJDvZ2HKQmzumB3Cevlll0MpEEgygtnA4jx+t6IJ95w= 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 AS8PR10MB7522.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5ad::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Thu, 13 Jul 2023 10:01:44 +0000 Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::1b98:7428:fb6b:3b65]) by PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::1b98:7428:fb6b:3b65%7]) with mapi id 15.20.6588.024; Thu, 13 Jul 2023 10:01:44 +0000 Content-Type: multipart/mixed; boundary="------------ZmkQ6mz0M1TULVxmkV6e5Nbh" Message-ID: Date: Thu, 13 Jul 2023 12:01:40 +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 From: Frieder Schrempf To: Tim Harvey , Frieder Schrempf , Alexander Stein , Jagan Teki , Adam Ford Cc: Andrzej Hajda , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, Inki Dae , linux-kernel@vger.kernel.org, Marek Szyprowski , Neil Armstrong , Robert Foss , Marek Vasut , 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> In-Reply-To: <5dc55bcf-abec-78cd-74b8-54fa67fd1fb2@kontron.de> X-ClientProxiedBy: BE1P281CA0202.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:89::18) To PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5681:EE_|AS8PR10MB7522:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e30393b-3b12-477a-34af-08db838829b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1thxvPbUFjiUX1SNkYb/u10cdjS9q9QsYCPVDLHUAW78qfiQgB8zdnB7FIKQoYuYm7KGSI+gqFhYwOC1q8nDPqC8vKEc9Xph8lvJOFhBFDEv+YYiNT3D9EM19sTSXdpDf2Uz35rSZwnmEVxzjjEMfj9zzNSe3qxxDWil+mIfTAa+q4bxijERhZe3Af18uiQXCHTwnW0sJ1R8dbu0dUNBG3p5F3YswLOvb0EU1IkGgv9D4hX7zjL6rw76clrkvd+W9y6znWORR3YdZF/6lR+8Y5c+0wWV0pZg+ghUjZwL5jZBMAc9eCi4fv8kXkHLnHcUq0aDod4bZtJdLy7KzA+1XkjYC4MyaRA9Q5XWy0Xry+Afhjqxz69iBOkNreaVc12lOdO07tmp32dSSuI/PlQnkinH8GZGOhBVjNr2u0k7pb4jNDRp8WgWbFXEdga2k/aXcZEOJrV/37ZLxvZKZyMl6gHK2QiVz/+TYKo7YYP+Ly9AROS+aoI3iFTki8QX61kL9xjAmgMyPzx6OdwJXX07+LQ36Bp95G7HlmkRL7dnrO2vQYF7UhwR/EDodnZnZXC9ipb+Ut1v8C5725t/Hs5RBOLI2LikRsNZ/aESXrU9hbVrdmEDmVtSqPMTDizSG/XrvIB3/b8fXD8Uz7Rnk7Ob4A== 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)(396003)(376002)(346002)(39860400002)(136003)(451199021)(31696002)(38100700002)(86362001)(31686004)(186003)(36756003)(54906003)(33964004)(110136005)(6486002)(6666004)(966005)(6506007)(26005)(5660300002)(2616005)(53546011)(6512007)(66946007)(66556008)(45080400002)(316002)(44832011)(66476007)(8676002)(7416002)(478600001)(83380400001)(235185007)(8936002)(2906002)(4326008)(41300700001)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M0c4Z0FWODZEYjlvWE5JYm1rektTbkxrZjhyd1VYSHl0NUY0WmtKQ0FFenBP?= =?utf-8?B?RkNGSnNiVEtwZ08rYTVaaUg4Y0VRS1RCQmZNQTJtOHgyYi85ek9VaVRqMXl3?= =?utf-8?B?RFBLbkUweFJ4MFFoNEV3QWlsMEpBK2xXWGNuS0RrdWlrditncUd4UDZCZDMx?= =?utf-8?B?bXhiVkdPTFo4T0Y1ajdDSVpUVStBQkNqUkxsaXc1SFk1RTNYbE5mN3JmUXM5?= =?utf-8?B?QlNNYjBBU29ldnRIamJ1c3drd1JGL1B1cEJ1d3ZzRmFtMDdBeXpRMncxVlBp?= =?utf-8?B?WjltWURjdFlBR1pkdGhkYndQNzFSQlBqZ3Q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=?utf-8?B?M3pKYURPeWRLTkg4KzQ4ak1uL3NTS29lZlA5eHZBWVpjMWRrZ3l1MXluZits?= =?utf-8?B?Y0E9PQ==?= X-OriginatorOrg: kontron.de X-MS-Exchange-CrossTenant-Network-Message-Id: 6e30393b-3b12-477a-34af-08db838829b6 X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 10:01:44.3195 (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: fFRB60DIGbwT3jxkG+PtJp22LkmbK5YItGTUfQB1dhCg1W1VKEqiWCpMLu/gxRlHtOBRlsHqOkDv+N2GBNrIPSIxZJsGNHuxwlqZ56FbJf8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB7522 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 --------------ZmkQ6mz0M1TULVxmkV6e5Nbh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --------------ZmkQ6mz0M1TULVxmkV6e5Nbh 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 RnJvbSA3NzBlNDc2MzI1NWJhNWJmMDg2YWU3YjAxNDMzMDY1MWUwMDdiY2I3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGcmllZGVyIFNjaHJlbXBmIDxmcmllZGVyLnNjaHJlbXBmQGtv bnRyb24uZGU+CkRhdGU6IFRodSwgMTMgSnVsIDIwMjMgMTE6NDc6NDcgKzAyMDAKU3ViamVjdDog W1BBVENIXSBkcm06IGJyaWRnZTogc2Ftc3VuZy1kc2ltOiBGaXggaW5pdCBkdXJpbmcgaG9zdCB0 cmFuc2ZlcgoKSW4gY2FzZSB0aGUgZG93bnN0cmVhbSBicmlkZ2Ugb3IgcGFuZWwgdXNlcyBEU0kg dHJhbnNmZXJzIGJlZm9yZSB0aGUKRFNJIGhvc3Qgd2FzIGFjdHVhbGx5IGluaXRpYWxpemVkIHRo cm91Z2ggc2Ftc3VuZ19kc2ltX2F0b21pY19lbmFibGUoKQp3aGljaCBjbGVhcnMgdGhlIHN0b3Ag c3RhdGUgKExQMTEpIG1vZGUsIGFsbCB0cmFuc2ZlcnMgd2lsbCBmYWlsLgoKVGhpcyBoYXBwZW5z IHdpdGggZG93bnN0cmVhbSBicmlkZ2VzIHRoYXQgYXJlIGNvbnRyb2xsZWQgYnkgRFNJCmNvbW1h bmRzIHN1Y2ggYXMgdGhlIHRjMzU4NzYyLgoKVG8gZml4IHRoaXMgZG8gbm90IGVuYWJsZSBzdG9w IHN0YXRlIHdoZW4gdGhlIERTSSBob3N0IHdhcyBpbml0aWFsaXplZAp0aHJvdWdoIHNhbXN1bmdf ZHNpbV9ob3N0X3RyYW5zZmVyKCkgd2hpY2ggcmVzdG9yZXMgdGhlIHByZXZpb3VzCmJlaGF2aW9y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