Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp602662pxu; Wed, 14 Oct 2020 09:04:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJSH/ZR4FcaJQo5cOav1jYZxQboLXebaXxbElG4wFBOf+wDwbUx6DgqZKhtaG+F4h88NQm X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr6049082edb.335.1602691451902; Wed, 14 Oct 2020 09:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602691451; cv=none; d=google.com; s=arc-20160816; b=OyqBUSk+trP+OlY+AnY0zUTCuomEZLpZpRlileX3Uy2qC3sFlMiLa5KJYHpxjrmUH7 /q6lGmJMmVl3py37H1YxB4DZ1yrMcgG9j46WAaxe0WkpqsG/Gg2OafF0Fr7j9nBIX0M9 bUE/eZ1sP1nzAiXEs+Nxr0qZPYeFRLL5P/DXZlJSkI0Vokau/HeB0kKRl0+3Ah1VqhAf s4m8kscGFizRAzKDHrNksswtoC0IO7rK+oOa1mYcAQ9iIKmO4vGqB7BiHgLFN/gYOLEQ RsLiyAhY209idaikTz0F3GpqX5WaW/gI/+o/tvrM4+gyKTv2L96AXSsHtv9ujTW28NoI zy4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=QaTsnB/NmKVi1NdOeJ8x36SBfiUo2Aw3Dr5NQTlitH8=; b=xpr7nTlmTBhL3QezrIKgpzeZ9XINHvmpwDTMdZJxt3+mG9AoR1xRearLDdf87PdcAW b9kSLsESqAdH4g6qrCv0QCLJa0ZiGiCpCjgQ2bzJhvPE2MVFWir10Jm3gBheMqhd9ix4 /ZZiBOBPAAtCkwwo9jkxjLhgIg+Zs1G5nlbb9W+G87dDVcgxU0mnACv/cbHU2valKbbe M64LvVL6dBUh5NSO6gZlVwV+aamJU4bCzeXaOP9blRx8fyev/NsI8PWIhn13JfWoEZS2 zBEqQZfvx9PzhJI1h5e6UQqcf6UlFytFTuhm7Of50v54/85iCTX4yBxNKlQms32RZ5tg nA3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L9ozmRE3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si2446203edx.148.2020.10.14.09.03.44; Wed, 14 Oct 2020 09:04:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L9ozmRE3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387838AbgJNL3s (ORCPT + 99 others); Wed, 14 Oct 2020 07:29:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25945 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729919AbgJNL3s (ORCPT ); Wed, 14 Oct 2020 07:29:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602674986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QaTsnB/NmKVi1NdOeJ8x36SBfiUo2Aw3Dr5NQTlitH8=; b=L9ozmRE373JG0pB5f+UUvYq0nZYncriZZ8Q/nymKstcAx9a08htrAHUqRXlwE9geho2toX CKE6Lir9Gk8n3Mr/AZ0omdFbwwf7+uZo3eg9P0kMF7tpw2q0TrHcC1Fm5mnP2wNgkvaDdp GVTOW6ocHEPp6nzAXEXXtzxjvcffsBA= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-0wI13JxvNSWg2docutOBvQ-1; Wed, 14 Oct 2020 07:29:42 -0400 X-MC-Unique: 0wI13JxvNSWg2docutOBvQ-1 Received: by mail-ed1-f72.google.com with SMTP id 28so1067833edv.9 for ; Wed, 14 Oct 2020 04:29:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QaTsnB/NmKVi1NdOeJ8x36SBfiUo2Aw3Dr5NQTlitH8=; b=le31+pv5HQ4Yrh9QzV008UphOl55TQ/cMbU9BcsNBoNDnGSDXpkiUoeSTbkqTiIudU Is0yGukw/zegV3UtdV2qvwnon82z7B1R5go/ST0in/51idBUXD4RJz4DcRavio8UjGo8 cjVa1ZPnDWM9dvxdoZG1J9Be62gcK+pf0ld3a6RN+Vk/0WEhvmPR+37rH7IVpKtjC+R5 ZkkZ0huC3Gj3rsrf4apyZveh2Gyzt7wgXctqcy9S9s6e2huWDOKsWG0fPgalXX6ycsiP p4eV4XCLu9OQeWI3jMWvHXIVY3w05qjEzk0RkfkflKyBBL0vM9UBafHuF2fKJaVJtYhH XP8g== X-Gm-Message-State: AOAM531YYg9wYUK+Mfnpu3A+Oaf4yiel2Tym2wj1CNCDZP8j/Y1lXeU1 DJvPj0n4v7igPd2AKcui6r35gPEKqZfq5VyF5kMO1zqGFzCguv980IyMB9N4W8LjzuWUKNBewjQ 363K4P2yML2/orGE6gBMlr3XE X-Received: by 2002:a17:906:647:: with SMTP id t7mr4893227ejb.428.1602674981326; Wed, 14 Oct 2020 04:29:41 -0700 (PDT) X-Received: by 2002:a17:906:647:: with SMTP id t7mr4893207ejb.428.1602674981114; Wed, 14 Oct 2020 04:29:41 -0700 (PDT) Received: from x1.localdomain (2001-1c00-0c0c-fe00-d2ea-f29d-118b-24dc.cable.dynamic.v6.ziggo.nl. [2001:1c00:c0c:fe00:d2ea:f29d:118b:24dc]) by smtp.gmail.com with ESMTPSA id m16sm1398566edj.37.2020.10.14.04.29.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Oct 2020 04:29:40 -0700 (PDT) Subject: Re: [PATCH 1/2] x86: Remove led/gpio setup from pcengines platform driver To: Ed W , "Enrico Weigelt, metux IT consult" , linux-kernel@vger.kernel.org Cc: fe@dev.tdt.de, "Enrico Weigelt, metux IT consult" , Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org References: <20200921215919.3072-1-lists@wildgooses.com> <8058a804-a793-a5f8-d086-0bb0f600aef9@metux.net> <65efe44a-bbef-f982-462a-385fffe493a0@wildgooses.com> <0de126c4-f2aa-a817-0a38-32bf3ede84d1@redhat.com> From: Hans de Goede Message-ID: Date: Wed, 14 Oct 2020 13:29:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/14/20 1:21 PM, Ed W wrote: > On 14/10/2020 09:41, Hans de Goede wrote: >> >> So I have a suggested compromise: >> >> Keep the current LED/gpio setup code, but make executing it conditional >> on the BIOS version and skip the LED/gpio setup when the new BIOS is >> present to avoid having duplicate LED entries, etc. in that case. >> >> I guess this would still break userspace because if I understand things >> correctly the new ACPI based setup uses different LED names ? That >> seems unfortunate, but I guess that from the kernel pov we can just >> blame the BIOS for this, and since we definitely do not want duplicate >> LED entries for the same LED, this seems the least bad choice. >> >> Enrico, would that work for you ? > > > I'm cool with this. Enrico? > > I may have some time imminently to have a stab at a new patch. Obviously any help structuring this > would be appreciated - it feels clumsy using the existing detection mechanism, I think whatever I > come up with you should kick back and recommend a new board detection structure, but perhaps we can > shortcut that step with a few comments up front? I'm afraid I do not have any wisdom to share here. I would use the DMI bios-version or bios-date strings for the detection, but I guess that is obvious. Other then I guess I would do a preparation patch restructuring the code so that the whole conditional part becomes a single if, e.g.: if (old_bios()) { ret = register_leds_and_gpio_for_old_bios() if (ret) goto error_cleanup; } So in a separate preparation commit put all the code which you tried to remove earlier in a single helper function (feel free to pick a different name). And then in that prep patch the above would look like this: ret = register_leds_and_gpio_for_old_bios() if (ret) goto error_cleanup; And a follow-up commit adding the new/old bios detection would introduce the if. And do the same for the cleanup parts for module unloading. I hope this helps... Regards, Hans