From patchwork Mon Nov 27 05:14:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 169970 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2859184vqx; Sun, 26 Nov 2023 21:10:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsdTm0HspDBYjlXYVNm/RoXOMjqkZ7tHHIcH94e03CI7WsFCSJEm72hdIg9PrVFrLdK26V X-Received: by 2002:a05:6a20:430f:b0:187:6dab:578 with SMTP id h15-20020a056a20430f00b001876dab0578mr11150662pzk.40.1701061840542; Sun, 26 Nov 2023 21:10:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701061840; cv=pass; d=google.com; s=arc-20160816; b=BooMw1eR61QR1co7HvqZEybsQfyCsxJb+kwRtWItGopeMydEdRPcDpqPbd65FmYRTV WW6xcb7uY2b52B1EdPiIZKYOnIGMpJlGPU3epHiBr3WoGFhML5Gjj7n+u0zUlZZsihJo wyfvowDMjXkwpOKqhAbkafh+V2r2d/I2R3JQ4TchBlhFLdN2kaFNNzdhwJ9mUHt/saa4 1skPiOMEA9WJC6EjLmnNonzQfhcGKOtTaA6VDt9SdWgXPELFEd7EK1v0gN3iaHcWaGBO 39OhLpMvh4HhltrvUwlvsYvToMBqw63gpA6Mc87c0szHqRTDSvpODElsKl24oNILtp4Q fxNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4H8CoeRgMRXKQ1atlM4es6H/VQXCXNsOCyDVttO8y40=; fh=umrqgllYhWw5vxVpcn9kRdEyuYEdXxvnhZqsZuCDxwQ=; b=pcGSYk9nBxYuQ5YjdJjE0cpmbFDT+JRPeTScnAEXhp6nmLV1TfMZBkjcrKii4S4Mna 6XFphHooHOIAW/mmuy6Uv+AopugA0dIypoFkmRXCblg26d8ndxc5BwNzNeqbIN91NAFc zsMA8hipgVHrskxeY2Ndz6EaNjICL0brpWTkmUqnN6ru/s7ps41rEIvW3/04QdkbiD18 K2k2RaqsXf4Vh1eTz6sSRJkET30rsSfa9HJ3XOoOBW49VuY7/gpIcCVOlsjW70r479ek 6jm3Qz7eaFvkAODiMy19ZaTtZzS0w8g06E+VD0LAzc18rX/G58dLVCuFHdNScSuYrMHa m65g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=MpzsM7BD; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id gb24-20020a17090b061800b00285ca600d79si1730573pjb.85.2023.11.26.21.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 21:10:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=MpzsM7BD; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 28E488087E1C; Sun, 26 Nov 2023 21:10:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbjK0FKG (ORCPT + 99 others); Mon, 27 Nov 2023 00:10:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjK0FKD (ORCPT ); Mon, 27 Nov 2023 00:10:03 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2064.outbound.protection.outlook.com [40.107.22.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EAFC127; Sun, 26 Nov 2023 21:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwZeynRGSOIcXvwHRIx0RBcFqe1FucaqFM5wytaXDPyv+UbYvCcN7uC7on4KyHRClx+M5c1MpsndOItZ0pcAS3s5HP8+qPue1vlFd4HWaQo1ffME+8bg/HiEbbX2+nhqTWfgeSJWXACk6ioA/ENMWvOXnya0owF/lDPIYwaBTNlmRc+iMjpALsY/AtnxDQ5OQeBu+ts9O4V2fdIEaj9dqngT38x9gvSOdbOIgO71667vc7c8d3buAe0ekgeNAdnaPU7ssFfMQLLHwu4S38ICGGsy/QXDwS+i9x4WNYJrWrW+LgVVXKDVgQRK3D0Objqla6u/mWdgq39zColOACGXTg== 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=4H8CoeRgMRXKQ1atlM4es6H/VQXCXNsOCyDVttO8y40=; b=FT8B9pkNI3nuH/EjIOZnw/L6snFMAqmEoqUIm2+mKOYjOF99gvvgsxEjxyk0xqq/uGU+wmYHPwn89X8ba5T3Dm2tw8c5X54NDnVe4pzhkkR0hcVZmAEVRc0ZFK6ODJ9VVvJYz4FQoHZv/gqYU0UDP/GhwO/fRVx5Sv8cZ3HTvli/hRtTC74mSgI07HEs6nXY2l0WKds5OnR+06zI9eZOyuMM1mPLFJf0PZjVYmcGpV/oFfYnfx8QdVIh0QSN2QEdTG7Yyw2zzhv7aYof6oVIKxdqe+SkxMelhMECLQyx4vNaRdoMRRmdHxnvflPernLIyjrRchGYVBm1kSODmGUU1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4H8CoeRgMRXKQ1atlM4es6H/VQXCXNsOCyDVttO8y40=; b=MpzsM7BD2smJACHL3z589zGYFx/L902i2lEtZxZh0g5u8hlxWrCHBDIlMzz0YJoo4qAmB8p3f0efyiNQjzMKfP8VI7yBaF01dkAsXA+YoABp1V0fTuECC8/97+LZwKlHHomjxPZDkyGNBqH02AyYkdaWC3dMCZUCLxONpLmL9mw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM0PR04MB6961.eurprd04.prod.outlook.com (2603:10a6:208:180::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.21; Mon, 27 Nov 2023 05:10:07 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d99:f43f:65a3:9bf]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d99:f43f:65a3:9bf%7]) with mapi id 15.20.7046.015; Mon, 27 Nov 2023 05:10:07 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: linux-next@vger.kernel.org, sfr@canb.auug.org.au, gregkh@linuxfoundation.org, rafael@kernel.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, angelogioacchino.delregno@collabora.com, ulf.hansson@linaro.org, linus.walleij@linaro.org Subject: [PATCH v2 1/2] driver core: Export device_is_dependent() to modules Date: Mon, 27 Nov 2023 13:14:13 +0800 Message-Id: <20231127051414.3783108-2-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231127051414.3783108-1-victor.liu@nxp.com> References: <20231127051414.3783108-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2PR01CA0012.apcprd01.prod.exchangelabs.com (2603:1096:4:191::8) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM0PR04MB6961:EE_ X-MS-Office365-Filtering-Correlation-Id: 05668dcf-cf8a-4525-b087-08dbef071f21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ghIeuuMjoVMyO6nJC1YOydTyD9tCcKeaNUaJN7lZP1Nb47nsjzl3P74I/dLLeRpdifTIBIi5h8l7uMYKnkYWiHOZk7tLYSR4XCxY05G6At/SdCr5KZsRWSd3SRP0a0ojqS1Yk7Z3x7nSD8punuikQnmyQLWyuIR9Mcf4uHYCZslJBk3Rq7rwWWywVXxWku2CwHJMOxlQVL2MgRZsay7r4J/83KDsOH7Z8UvplmL7HKVpRvGrc2jiujU1Hzdgb7tTy2hyP0nxpQFeWzHU8+g0yqixEKBUyOA6/pfHl3D8VS9bvWqoldpo9Sic4MBSbcQsww/NI5ikA3DlXtP2JXnhHyH90UD30NyklkbbCw7FJITrPiN96JudM72OhPwL6L8lFHb9nJmywzMUnnHz7rYolP1yGoOdtf4PbauOPXRQNoKx3UDdnO+l1x7216lJ/K0N4IO33lkGu5JqXma0n0lNzWzsvj5v7DdR2eL43b5tMUPBJ83ONkIlaMVxdyo2AMLhZ/N7qA8PEXzCVNF/Bl5yVJmT0pO+VmUoyiQvUai/Kn5rdT5BMs8Z4l6cIZrvIVB554egHpAtV7cOSStrya6ksNDN5f3RAltlCEsV52GQe8pno0zSsige+TFj1Cn+ZBb5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(6512007)(6506007)(1076003)(2616005)(6486002)(478600001)(52116002)(6666004)(4744005)(7416002)(2906002)(5660300002)(41300700001)(66946007)(66556008)(66476007)(316002)(4326008)(8936002)(8676002)(38100700002)(38350700005)(86362001)(36756003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FhwI5jK8lk5xtvcwbm2wORVAu1+1ihHUlYvOrsjvz+sVTyLzxh46Q4/gB/yKYDl8zQwZKINWABarzxRYq+FJ3/1SOqCysnaKTbLC/quLNLw73yOYUJYCMhNkTEYco9GfE0F/cdq9cEOHJJLUxs+NQHFDZ9IE7O2FaKryJysi/Cccwg4B30fhL4xqy+rXWksjc+zA/ucq3SlJrSn1igO0S8IvqH+TLylgkj6dMWDEJ0JB0XwCxGQ65GyedRvZfSxkyCylHOBAU+8MbgvScGQLJiQluuNSqLh8Jkx+XZjKR2wpqUiklFO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O+zjipLFJxi2iY+gABWhtJkBAkyAdftzaOgRT2P61GYMrFdnDdU73c0H3PQ45sXqO3vRiiVN0N++BuULwfnqo349TJb1N9j8M9vtu81Gj6Kk6kFjjZDKBjyeH51m3jhgB3qawaqTRWSOuV8dMBIGttwtelcCecQ7Ei8eYUBJu/d47IAn7aZ83DB+M6p/9bKcYlpuyArzreo7MzAtKLFi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05668dcf-cf8a-4525-b087-08dbef071f21 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:10:07.2510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HAz6MsCAZfx5tfOCjkg/mSKjan0upAJLZP1WWtwa+yM21R6i8syeXpQJegXzBbFIhQeX7Du+WGcPVeN7cMlM1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6961 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 26 Nov 2023 21:10:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783692620569257833 X-GMAIL-MSGID: 1783692620569257833 Export device_is_dependent() since the drm_kms_helper module is starting to use it. Signed-off-by: Liu Ying --- v2: * Newly introduced as needed by patch 2. drivers/base/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index 67ba592afc77..bfd2bf0364b7 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -328,6 +328,7 @@ int device_is_dependent(struct device *dev, void *target) } return ret; } +EXPORT_SYMBOL_GPL(device_is_dependent); static void device_link_init_status(struct device_link *link, struct device *consumer, From patchwork Mon Nov 27 05:14:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 169971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2859285vqx; Sun, 26 Nov 2023 21:11:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQFqyvXIlIGY7+kqmuEYpXnPmZL15aEEgBbvohHm3LGA5ieO7PoYEn46Xzf7uWeY5zZ0kx X-Received: by 2002:a17:902:708b:b0:1cf:d634:367 with SMTP id z11-20020a170902708b00b001cfd6340367mr631587plk.56.1701061860429; Sun, 26 Nov 2023 21:11:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701061860; cv=pass; d=google.com; s=arc-20160816; b=j0rkEzkVUATrswzhObnxFfzKhGKoDOQGOQNlfA1UkyPoPK3V03CQakYnUL8z/bgKk2 XsA6pJekc5czEAYkd3j0zBv+tzsxfrq6CbbKGWc62sDQzMB6zcJf9xAVAEY7fr6X8VWq Lt/VEmLVL9yAk+OdfN2GUeLa+SC04sYYlK5UeGYmDUG/o71T4oc1bAv47NJ4qH+sFY3F EXPbOda2f/4CK3DNYzSkjKlr1Yk3YEipXSwLwx/LsiM4pqzo/Fkah7CXlFKDlaWm9hmZ skYbaiI04XspcW3J5MoH/tYelD0FkveK2kNvALb40JToWzjIkUWMWcEe4wg0v0AQ3vH+ cM4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K5zWOZmsGTeT8xFxJ8FHYZvgDxLdC87QS8N39Aej3dE=; fh=umrqgllYhWw5vxVpcn9kRdEyuYEdXxvnhZqsZuCDxwQ=; b=bQABHDLxrNSccjRgGaVddrH9ySqtr5/qoqX0UrEgAQHVJB+WTzNB9v7/HDe6qDN/re rajV+t4Z46JfobdoP3z+JFdES2DFcuj1C8egggUeVIu6nkCm23b7mE83gn8F0cbNE+6N e++dbqaQi7ZLS93bzZlku9xTp2zjMaGyDG34Eo/GlzkO/MO2ynm8Me6GixGLOLStsVq2 qHPch7idqqKX7x49CJpLXfLGcJYpmSuURSeFzeYULuRFTWpPtwfujRQ4Vdozhpz3T4Fl zg40+NQo6QyLMAns4F9Jt9DZu4pCnuidqmlHlTz9k5Qghye7/iHaAPJ9NHKAVZpeLki9 bOdA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PFfaT4jd; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id w8-20020a170902904800b001cfb6a76794si3979105plz.397.2023.11.26.21.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 21:11:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PFfaT4jd; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C530C8087E27; Sun, 26 Nov 2023 21:10:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjK0FKK (ORCPT + 99 others); Mon, 27 Nov 2023 00:10:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjK0FKJ (ORCPT ); Mon, 27 Nov 2023 00:10:09 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2086.outbound.protection.outlook.com [40.107.22.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF8012F; Sun, 26 Nov 2023 21:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZSsKEX/JI8ePpXCwTg+9tnoc+TJ6Lkqe8sbh99m37Y6HDGrTekjDHiEJNB09vsJRHry2qc3yCdb5Vg7jSoIGmKW1IGUMmvPfeJ/gv5RgnKo0aB6BBYIkmG7cvtYB5wuMiTMw/sKidO9Jl3V2CIeA4Ye1rwphcwojFFd9sk7QAHvImMLU0/qgaxYgrZF6kFMdSBSuUFHZjswsizbUlQbFVoDXRJjJIEIUpxyefiaN+X2Aivq5RextZUVYRzV092RRe/9W3QbFGbJQ+Okt/FaqpY+rr3cESil4dINfXdYCh6G3sPfaKJWdFTXF2iQKyJmIasykHJQvA2xiNfR07cDrGA== 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=K5zWOZmsGTeT8xFxJ8FHYZvgDxLdC87QS8N39Aej3dE=; b=oJ4RdkSU+d2n6ia0weBlv36F4ED1blonNtb4mBcE4D0mSFkcDvZJJD+sRh9TYSYrDijHhoyiyHnoQ4XPiFZx5BsG/EKtqSlZcYilpyNBEeV6An24h9pfokiVCyGDEEP3dCQTiqjOMduDDeAKcHC9URpuKXCY3He2n3+0/TW87qNxEepFkX3XVCs1DSO7dzmMCTpjR3zeeuyQlBKccsEf3DcPYsOaho7BOe96PlUKJQ9KJ0kxH8s8D4ZmhUxXa5qMEGe5J/hIcLb6flup548C4f3QOe7bzjSw+nMKRECnkIAXBenFpA0Ln1NxGfnIpc9kbiCENfhC6EqD2k/OIXMvyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K5zWOZmsGTeT8xFxJ8FHYZvgDxLdC87QS8N39Aej3dE=; b=PFfaT4jdBODUK4bJtGg7gE5RsJFdgCBmEqT/duS0TS3fNtxiI3wegiduygloj43NZ2o/0JPnrK84k8GQ+vOYz95M240wjkGSQo4qbNapuH6Wftnl8B07eafSfWm/klzxcENtOHA1aECMnh4ScHCEH+VcH9vmdt0m/5QXDHYiVvI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM0PR04MB6961.eurprd04.prod.outlook.com (2603:10a6:208:180::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.21; Mon, 27 Nov 2023 05:10:12 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d99:f43f:65a3:9bf]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d99:f43f:65a3:9bf%7]) with mapi id 15.20.7046.015; Mon, 27 Nov 2023 05:10:12 +0000 From: Liu Ying To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: linux-next@vger.kernel.org, sfr@canb.auug.org.au, gregkh@linuxfoundation.org, rafael@kernel.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, angelogioacchino.delregno@collabora.com, ulf.hansson@linaro.org, linus.walleij@linaro.org Subject: [PATCH v2 2/2] drm/bridge: panel: Check device dependency before managing device link Date: Mon, 27 Nov 2023 13:14:14 +0800 Message-Id: <20231127051414.3783108-3-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231127051414.3783108-1-victor.liu@nxp.com> References: <20231127051414.3783108-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2PR01CA0012.apcprd01.prod.exchangelabs.com (2603:1096:4:191::8) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM0PR04MB6961:EE_ X-MS-Office365-Filtering-Correlation-Id: 130cf83e-8372-4e41-9fad-08dbef072298 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r92LQc+yAEo6qAPCnIvN2cJcKjShHhRaF2V45SdlgXKZR3Q+Ln0ooRNUw/BaGnlw90wtGCrhKq01ywseBcNRHj5LjN5+FGFQyB1BIKaOhu3hKgQNKiLCljs35+NRJuQAfxYKfGCFqo3/8ANb0UHXidpqmiOB8/8cd0xrG//7OAOupeIo2fV1W6aXQfnAJ/ixc3SLiGffblUgR9vekxpPwHRtlphWSKwPlDebZmVb+AqtDg21EWp4ZNDbzJdMxoGArbQJvcBr1mHQ3kGm4REElqei9I0FWwpdyruKfmhlH5LazQwgzIxiB5AAoQMSLHtk/5PYpg7leNRMt3WT+ysUUeDGP40kZB/lZgri5P6ZTFRpp++ODIt4eD5zXAfRZ/XhTAV8q5KtnTtjspkHbiwzvcRUL9jzXNByywSxO69AP5UCdCwXkJ2Q0mASd+0/02oBXQ14FBbVAwzPqtgLdyOsJg+Y4Ax/v8F01POhO/Pic8QvyCSiYivWeM1BSe9EfvNUchNxDlIEMs9a2m2zEVRfP418UYoee5gAr73ISaKinaT7MNnd/j4Aj9Ic8xne2r6Ue6mtitW4C0mNQ8FDrpQ0SMzN1e4hNPAVX0ZGXH8g1Xw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(6512007)(6506007)(1076003)(2616005)(6486002)(478600001)(52116002)(966005)(83380400001)(7416002)(2906002)(5660300002)(41300700001)(66946007)(66556008)(66476007)(316002)(4326008)(8936002)(8676002)(38100700002)(38350700005)(86362001)(36756003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData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FigJonP2yI41SV/j1lF3MEGZroOGXV4pOODBjGqDKBcVqvnm0iJiVfwQTOZ9hAl8zNFZA5m9ZbXHNgXt6pPfJf6tIb1pBrwsai/o6d4VcR+Ev7JAyLhaY3KRW81zPet8ld11k/Hi1JjQ3QWoBCNVVMPJ3uXA4P0ainseSSbNAHWTdn8yqDHGfEtnFvctBOb3MdYOvqlLl9ggTbd5NnPrGc8jC+Hr8ixXDSPZBi/wpayjyZxNle5A3XSnU6tM7U/XuBnDZIiK4w4hM6sagKFrMXI2JdbjG9FDn48nf5HFO5KL3v2rbbk7wKietGRC+EWdwU/AA1Isx8wjg8ME/RM2bbzb5Wa5wxVoEoUT5kPVFvvkAmxnvYHpZcKQUvcuNqCWOkw2kBGAzymLBlud2oTDfJhubXg97bcC8oxIBcm3ELJ0ruAjARptFYseQD8v0KEYZXtRzlCIBLVmBwPDb15BFkWzXyfLW2pG0Q8A3x7d6LSQlZYXS7LVgmW0UXEkZK5wvNYsL4+h18yVTr8WJT+EpmMIemS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 130cf83e-8372-4e41-9fad-08dbef072298 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:10:12.9275 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dHo0h4fqvwmozg5qC3vr04Tpjch7TvsbPlNh7A05b+cumK4bhM+Csg4kwYjfQHA5P/xCc4D7OQ8UCE7gdGA6Ow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6961 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 26 Nov 2023 21:10:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783692593064136351 X-GMAIL-MSGID: 1783692641664466342 Some panel devices already depend on DRM device, like the panel in arch/arm/boot/dts/st/ste-ux500-samsung-skomer.dts, because DRM device is the ancestor of those panel devices. device_link_add() would fail by returning a NULL pointer for those panel devices because of the existing dependency. So, check the dependency by calling device_is_dependent() before adding or deleting device link between panel device and DRM device so that the link is managed only for independent panel devices. Fixes: 887878014534 ("drm/bridge: panel: Fix device link for DRM_BRIDGE_ATTACH_NO_CONNECTOR") Fixes: 199cf07ebd2b ("drm/bridge: panel: Add a device link between drm device and panel device") Reported-by: Linus Walleij Closes: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/ Tested-by: Linus Walleij Signed-off-by: Liu Ying --- v2: * No change. drivers/gpu/drm/bridge/panel.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index e48823a4f1ed..5e8980023407 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -23,6 +23,7 @@ struct panel_bridge { struct drm_panel *panel; struct device_link *link; u32 connector_type; + bool is_independent; }; static inline struct panel_bridge * @@ -67,12 +68,17 @@ static int panel_bridge_attach(struct drm_bridge *bridge, struct drm_device *drm_dev = bridge->dev; int ret; - panel_bridge->link = device_link_add(drm_dev->dev, panel->dev, - DL_FLAG_STATELESS); - if (!panel_bridge->link) { - DRM_ERROR("Failed to add device link between %s and %s\n", - dev_name(drm_dev->dev), dev_name(panel->dev)); - return -EINVAL; + panel_bridge->is_independent = !device_is_dependent(drm_dev->dev, + panel->dev); + + if (panel_bridge->is_independent) { + panel_bridge->link = device_link_add(drm_dev->dev, panel->dev, + DL_FLAG_STATELESS); + if (!panel_bridge->link) { + DRM_ERROR("Failed to add device link between %s and %s\n", + dev_name(drm_dev->dev), dev_name(panel->dev)); + return -EINVAL; + } } if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) @@ -80,7 +86,8 @@ static int panel_bridge_attach(struct drm_bridge *bridge, if (!bridge->encoder) { DRM_ERROR("Missing encoder\n"); - device_link_del(panel_bridge->link); + if (panel_bridge->is_independent) + device_link_del(panel_bridge->link); return -ENODEV; } @@ -92,7 +99,8 @@ static int panel_bridge_attach(struct drm_bridge *bridge, panel_bridge->connector_type); if (ret) { DRM_ERROR("Failed to initialize connector\n"); - device_link_del(panel_bridge->link); + if (panel_bridge->is_independent) + device_link_del(panel_bridge->link); return ret; } @@ -115,7 +123,8 @@ static void panel_bridge_detach(struct drm_bridge *bridge) struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); struct drm_connector *connector = &panel_bridge->connector; - device_link_del(panel_bridge->link); + if (panel_bridge->is_independent) + device_link_del(panel_bridge->link); /* * Cleanup the connector if we know it was initialized.