Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1064606lqb; Wed, 29 May 2024 21:41:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWidKrGktFDDe4nzsV2UH6sqwxeGDCqUfXHdchz+GHMFYk5TmAgd0i5ll0duApDl5ftKSjuCdf/wwWUA7BHK65QfRO7DvJ1GHFmcZkbNw== X-Google-Smtp-Source: AGHT+IGuQEwHSQWOqeU9b/cv9mzmkuLmYGncNqd0PrLEW16ZoPGb7EGDq7gN8z8QPAyqujXWua77 X-Received: by 2002:a17:906:38d6:b0:a65:f504:6d48 with SMTP id a640c23a62f3a-a65f5046ee0mr43853166b.2.1717044088793; Wed, 29 May 2024 21:41:28 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a63d165a733si181812566b.588.2024.05.29.21.41.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 21:41:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Z95ScKKF; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-194938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3F9461F22F6F for ; Thu, 30 May 2024 04:41:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27936143893; Thu, 30 May 2024 04:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Z95ScKKF" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2059.outbound.protection.outlook.com [40.107.243.59]) (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 770E414373D for ; Thu, 30 May 2024 04:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.59 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717044080; cv=fail; b=jUeEQd3txXV0zQCMsSt8mCweSQDo5bckmQzkYF6eJSdo6h3Ax2To8XwiWOk+QEPIp1e2UrAMMaulMYvANt3beqLxLE37q5XAbI5ViyKvqAAYhkyefY3Dp+k+l9Lwv9nQuzR+/g7QAr6/4bDQto65BlqEivCriv6e5Q4AThW/yHI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717044080; c=relaxed/simple; bh=U1DVeDie0JPGL44g5KX+O+4ZpYRQewIWXz+Detxx3b8=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=X06nFnuDOBI+fAnZy3KN41PU3HA0B3xeTrDjubpONMuplbNXWiVW0Qm40JZvEiRQ8EGJT/o5vsQV25E5q19Oic1nmkY8nmoGvFhk3NSO7qbggmbn3Pi2eRU7P/Pbc8ULCLW2Ts773XPvxdShhFZlrbV83pJgFZH/yW2tBW3xuBQ= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Z95ScKKF; arc=fail smtp.client-ip=40.107.243.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FGIfKJzZgiBnx3MBj3GMS2724BRtpSqf9A7GE9fUW0qH37Mxm2URJ3ne5BYFrb5hQOOS8Old7ZEQ8dVK2q3tFnodchlgv+2nQw4jUTPuXm/HDy9ZAC0wW/UE1+I9jwDcl0eh7q2kbvo0a9gmzliBsHukA8NGAvImiWLcP8mlaPYy+oasyUsfWOZnxejYR3iAcdBO1Flma0i/bkZWaQvVM69v9Opo1CgVZdFN0FcGV2lZW/lSI4E4mOZ/LoM3FTUF1yv18b52Yab6tiPc1qkrbVxKzuHcYTdW4BU3/j1z/7yRCK9amJ9AFVN+7uii2DLVMyZs5c4Vepw8PHoj+HOJ+A== 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=9o4db4Zej+T6vEPp/wPvNpo2adBWMwjPNP+YlOdzA3U=; b=T3am9fpvpOt+9sd/P/wo82buH066WY7JMFy8j4kvt/z3sIqsIBsvbMzboRNa8xA9VPvOaGTG5haMorKd4EGwJh7YKF7ik8JL8+0SnafZri60PhLAgsFgO0s8gOKgDMBlUDRvhCFBZQcJrVwS/uy3r/yjLGjcyfnzPe7moMhcp2jX2Hkp+K5oTjZ6WeOhFmVNK1Hi3qtsufuIAIHrwVt6apqTSamNLwYzHM5gZy3ycopr6/kHBaqNdKLtMjsqcF3SWT+E27vdxb15gMrRVWPUX9MEZGs/eVJZI0Ck+auQnKmw1iFrIQ4+BCRaYamJ689h3/KOimhO183yLdw9wKFXJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9o4db4Zej+T6vEPp/wPvNpo2adBWMwjPNP+YlOdzA3U=; b=Z95ScKKFyDTxM1gxZb1I1pK+NahYBBn/TqsAVslxoYFJqiU4QoQPZkP+Z+KHWq1cJzxKlVS2xuLS3vXR2W5YSjI26YGzOSlOEncvGCh7MRan6ZOdMoVrHe6OwL4gB9HNja4LKDLkdkmEp56LlTILCyAiodZ4eIbMjeGmDAM5hAg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by DM4PR12MB5748.namprd12.prod.outlook.com (2603:10b6:8:5f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Thu, 30 May 2024 04:41:16 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::37ee:a763:6d04:81ca]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::37ee:a763:6d04:81ca%7]) with mapi id 15.20.7633.018; Thu, 30 May 2024 04:41:16 +0000 Message-ID: <873b7a7b-139d-498e-89da-098cb3d7599d@amd.com> Date: Wed, 29 May 2024 23:41:12 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] drm/client: Detect when ACPI lid is closed during initialization To: Dmitry Baryshkov , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, Chris Bainbridge , hughsient@gmail.com References: <20240528210319.1242-1-mario.limonciello@amd.com> <197d195f-9206-41dd-8ff1-f4bb4988fb9b@amd.com> Content-Language: en-US From: "Limonciello, Mario" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DM6PR18CA0026.namprd18.prod.outlook.com (2603:10b6:5:15b::39) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|DM4PR12MB5748:EE_ X-MS-Office365-Filtering-Correlation-Id: f6ca288c-5d9d-44e9-38b0-08dc8062bdf1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|7416005|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?QVJHWFQyRk0yZUc5VW5PbmZOT3BHWjVOMTY2a3NSRGI1UmlDUmVnb0d6WGRa?= =?utf-8?B?ejlEQTRLay94YmsyR3plK3o4UVZHb3duQzhCM2hKelY3MWdVQ0w3emtiUHY2?= =?utf-8?B?a29GaU9CRXdPTnRSa0xKVWtUdE4wM2s1bG9va2VxaHIrcFJnTlZKZy9tUmlv?= =?utf-8?B?TnhtYWNkajlwTlhUS3U5M2pJblJWMzl5TlBCeDRQeVB4OHVNRDRsajhDZklQ?= =?utf-8?B?M0NoYmY3dWk3M0RPbTcrU09FOGljOGlvSk03T0xTbXhnYVA5L3lsbjJ4WVZv?= =?utf-8?B?aFZzd285djZxMUxndWFpb1YwbTR6L3hKeGhZYjA4MjZpdmt4NWVzTWxuWHBQ?= =?utf-8?B?enlnVG02bS9uL0lJcFNkVkFyNFJqT1ZkemtJWEU1VWpCV05RTUxYdjZhUnF2?=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xTkR2OHB6SlRu?= =?utf-8?B?WXNvWXdGV1hRS245WVlySUZPUE1KVnVoVC8rK2lDb0ptREtzcGY1Q0JPYlJy?= =?utf-8?B?SWs0QWdodUZXaFphaFpLRWNvbzVhOTBDS0psRXNnRWc4Y3pBY1NQZnBvOTU3?= =?utf-8?B?WkYvZFhnYjdNTXMyMTlmZ2Y4cTdlVHlSVmF1MlpNY1g4MldkTS9vL0tLa29T?= =?utf-8?B?QXdlVnc0aUdZNXZEVmRSRTc1NE5JYzI3ZGhqR3JickNZRkc5V1dtcUd0Nzda?= =?utf-8?B?REtPNkd1YU41UDlaeGdqbmlvZm1iRDBURTNXUUxiUnRSVHY0UkllK2ROblJ4?= =?utf-8?B?NVA2cmU2VDg2ZG1vS0g0Y1NtNHBQOFNZbjNxT0FKUHdMVnR4UFkrdVVwQXZM?= =?utf-8?B?aVR3NWcydkI5U3RDc3dyUlZ5SW5RNGZ3cHVMQzBvVlYyMEpKM3ZaZW5nPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(7416005)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c1M0M3E0anozSjR2YVJSQ3g1VEJRTjNVb2MvOGg0ZFRtVjNRckdub2twMlhn?= =?utf-8?B?Z1p1UDM1Yi9INDdaNktEUEowbEJmanhNYTI1bUxKZElxWk4wQXYvYWdRR2ZP?= =?utf-8?B?UjJKWXZCOUZITlkxa0g3dU5iK1RVVnVCakN5bTdxNnRTTFdGdzJFcVMwcUNM?= =?utf-8?B?R0hNL01TQ2thbzBueHNKZFNncFJSQWVBLzRkNkZ1NmRzWTVLcW94VTBQZGNG?= =?utf-8?B?RHY2VnM0YzhzSzdiSDRDQk9iRzRlT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T0NnanpBUkVMcTVlMmc3SzlvTzdOcmNvem1HQXQxdjRDWHZNR2FsMUoz?= =?utf-8?Q?oYq1D3vSTT1VD+Hqy71cgkhf1?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6ca288c-5d9d-44e9-38b0-08dc8062bdf1 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 04:41:16.2969 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cA3StnI0+0/wer/09otnb/KGuGMXw+nrDZqrZ6gkxcN8ELxG4NWCgYxEOQDVaXFwqUoR/cWH4+nn3v5eyN2qHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5748 >> Also a direct acpi_lid_open() call seems a bit iffy. But I guess if >> someone needs this to work on non-ACPI system they get to figure out >> how to abstract it better. acpi_lid_open() does seem to return != 0 >> when ACPI is not supported, so at least it would err on the side >> of enabling everything. > > Thanks. I was going to comment, but you got it first. I think a proper > implementation should check for SW_LID input device instead of simply > using acpi_lid_open(). This will handle the issue for other, > non-ACPI-based laptops. > Can you suggest how this would actually work? AFAICT the only way to discover if input devices support SW_LID would be to iterate all the input devices in the kernel and look for whether ->swbit has SW_LID set. This then turns into a dependency problem of whether any myriad of drivers have started to report SW_LID. It's also a state machine problem because other drivers can be unloaded at will. And then what do you if more than one sets SW_LID? IOW - a lot of complexity for a non-ACPI system. Does such a problem exist in non-ACPI systems?