From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F7C1C64E7B for ; Tue, 1 Dec 2020 20:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5E0D2151B for ; Tue, 1 Dec 2020 20:36:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VAk0HA1m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387797AbgLAUge (ORCPT ); Tue, 1 Dec 2020 15:36:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56991 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727718AbgLAUgd (ORCPT ); Tue, 1 Dec 2020 15:36:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606854906; 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=A7/8+RJkGeSEwmLgpTG65Q4kAPCFxfMme+BpS8NvGD0=; b=VAk0HA1mgyneaCyj5UKfSyMxZ4sjCghT6Gwnui4TjkXLtSmJXJZ3I5b0e5SuO5ej/Hrhm7 +d4x7sIsfx8zw/OZtwmWBqd+Jrl5Ao5ZQIAGjsZiX0cxrDs5prWzyqFMHzrNoySouOd40X 3iLbJCWOwxvCuZTTL6phiaergWu+qwk= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-7j3FtaISMwGHaJGQNNwU9w-1; Tue, 01 Dec 2020 15:35:02 -0500 X-MC-Unique: 7j3FtaISMwGHaJGQNNwU9w-1 Received: by mail-ed1-f71.google.com with SMTP id ca7so1545087edb.12 for ; Tue, 01 Dec 2020 12:35:02 -0800 (PST) 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=A7/8+RJkGeSEwmLgpTG65Q4kAPCFxfMme+BpS8NvGD0=; b=Z2hMxzHqK7dbv/uTJwchI4Cal1l+PDcTXUXopJ3W+nu9vnu7SbeJjktWVnIf8MiChp HTfKSdnCwz0QqbAEQRziaqyuP3jMeJxnY3v0LvKib5IRf2pjl3EqY672Kz1L/Kb3dWfE L/eDRLOxcTENSJyqCWZZJ6g4iE2X/rULuYBnty3pE7J9ZDBU5CsifGdOzTH6jB98tvXP 8gRA9eEF5FiE7GNG/R4E/Kj951QlQ8cEhJ3PJTT/L9xs87ZThrV0dNhBfpJT8qr9nH6w SJemD4qq7Vew98GN5goJqj7KjzT5db3HEGiZQ15soQxv7IlySfkZsZ6Ttjyky8Q/c/x8 YNlA== X-Gm-Message-State: AOAM530Z6gkwuYC7H7ZoNSbhMzLwIlw5ohzW6HrxGHJzbe9992VEp9GY lt0KAZwtQdmPQepZIjqZf2ep4Q5QCxcIeB6V3zn6NtEJGxVFmCejlbguDdAWgjOJktFpHIsOERR MFPQrQnKD/yON0mFpgENDkGlx X-Received: by 2002:a05:6402:2377:: with SMTP id a23mr4959740eda.34.1606854901207; Tue, 01 Dec 2020 12:35:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLq9OZNQRnGhP9eq3qlTmDQto7T45obR28fwzCSfvUxGuqUM2j8W9ulPaAbdBh7MLqvz+s1w== X-Received: by 2002:a05:6402:2377:: with SMTP id a23mr4959715eda.34.1606854900954; Tue, 01 Dec 2020 12:35:00 -0800 (PST) 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 i2sm410497edk.93.2020.12.01.12.34.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2020 12:35:00 -0800 (PST) Subject: Re: [PATCH 18/18] ipu3: Add driver for dummy INT3472 ACPI device To: Andy Shevchenko , Laurent Pinchart Cc: Dan Scally , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, mika.westerberg@linux.intel.com, linus.walleij@linaro.org, bgolaszewski@baylibre.com, wsa@kernel.org, yong.zhi@intel.com, sakari.ailus@linux.intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux@rasmusvillemoes.dk, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, laurent.pinchart+renesas@ideasonboard.com, jorhand@linux.microsoft.com, kitakar@gmail.com, heikki.krogerus@linux.intel.com References: <20201130133129.1024662-1-djrscally@gmail.com> <20201130133129.1024662-19-djrscally@gmail.com> <20201130200719.GB4077@smile.fi.intel.com> <8a1b0f5b-1289-256b-b25d-cf8af43bdc84@gmail.com> <20201201185417.GL4077@smile.fi.intel.com> <20201201185548.GV4569@pendragon.ideasonboard.com> <20201201190523.GO4077@smile.fi.intel.com> <20201201190638.GZ4569@pendragon.ideasonboard.com> <20201201192137.GR4077@smile.fi.intel.com> From: Hans de Goede Message-ID: <4831d44a-5bcc-8cf3-964c-c7dca6827458@redhat.com> Date: Tue, 1 Dec 2020 21:34:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201201192137.GR4077@smile.fi.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 12/1/20 8:21 PM, Andy Shevchenko wrote: > On Tue, Dec 01, 2020 at 09:06:38PM +0200, Laurent Pinchart wrote: >> On Tue, Dec 01, 2020 at 09:05:23PM +0200, Andy Shevchenko wrote: >>> On Tue, Dec 01, 2020 at 08:55:48PM +0200, Laurent Pinchart wrote: >>>> On Tue, Dec 01, 2020 at 08:54:17PM +0200, Andy Shevchenko wrote: >>>>> On Tue, Dec 01, 2020 at 08:30:03AM +0000, Dan Scally wrote: >>>>>> On 30/11/2020 20:07, Andy Shevchenko wrote: >>> >>> ... >>> >>>>>>>> +static struct int3472_sensor_regulator_map int3472_sensor_regulator_maps[] = { >>>>>>>> + { "GNDF140809R", 2, miix_510_ov2680 }, >>>>>>>> + { "YHCU", 2, surface_go2_ov5693 }, >>>>>>>> + { "MSHW0070", 2, surface_book_ov5693 }, >>>>>>>> +}; >>>>>>> >>>>>>> Hmm... Usual way is to use DMI for that. I'm not sure above will not give us >>>>>>> false positive matches. >>>>>> >>>>>> I considered DMI too, no problem to switch to that if it's a better choice. >>>>> >>>>> I prefer DMI as it's a standard way to describe platform quirks in x86 world. >>>> >>>> Do you think the Windows driver would use DMI ? >>> >>> Linux is using DMI for quirks. >>> >>>> That seems quite >>>> unlikely to me, given how they would have to release a new driver binary >>>> for every machine. I'm pretty sure that a different mechanism is used to >>>> identify camera integration, and I think it would make sense to follow >>>> the same approach. That would allow us to avoid large tables of DMI >>>> identifiers that would need to be constently updated, potentially making >>>> user experience better. >>> >>> All Surface family can be matched in a way as Apple machines [1]. >>> >>> [1]: https://lkml.org/lkml/2020/4/15/1198 >> >> But not all Surface machines necessarily have the same camera >> architecture. My point is that there seems to be identifiers reported in >> ACPI for the exact purpose of identifying the camera architecture. If we >> used DMI instead, we would have to handle each machine individually. > > With help of DMI we may narrow down the search. > > But again, we are talking about uncertainity. It may be your way (a lot of > platforms that have different settings), or mine (only a few with more or less > standard sets of settings). > > DMI is simply standard in Linux (people usually easier can grep for quirks for > a specific platform). > > I would rather ask Hans' opinion since he has quite an expertise with DMI for > good and bad. So generally there are 2 ways how things like this can go: 1) There is sufficient information in the ACPI table and we use data from the ACPI tables 2) There is unsufficient info in the ACPI tables (or we don't know how to get / interpret the data) and we use DMI quirks Although we do often also use a combination, getting what we can from ACPI, combined with a set of defaults for what we cannot get from ACPI based on what reference designs use (IOW what most devices seem to have copy and pasted). Combined with DMI quirks for when the defaults do not work (which is quite often). Depending on if "not working because of wrong defaults" has bad side effects, another option is also to only allow the driver to load on devices which have the necessary info provided through a DMI match. I hope this helps. Regards, Hans