Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp289203imm; Tue, 15 May 2018 01:32:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZorkDjnzPxEvoS5BOi0ufQMQ5H+pqmf/PmYp8SgtO63YBkjw8WiUVK/hYXR5egRvwU1wolv X-Received: by 2002:a63:824a:: with SMTP id w71-v6mr11532533pgd.37.1526373134670; Tue, 15 May 2018 01:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526373134; cv=none; d=google.com; s=arc-20160816; b=FC1x8onxC+m2R8CPSw1gpACxM2fR0i7PD8MSYK9YnLSLxjcmIbShUj8Y6WXXdDNG5J 6iQOz0HqDj2Aa19iLNZQKicz895SSBkSUEvNHNfC7NYvivLYpL0x0zH20lbrV/L6My8F Frpm1DvzgCNPBYciukQoN3v8MJn7oUtniXrb/zVg4qnQsy8ABlzKju5C4Dwbzp7MnvJD 2qe0fOaJjPrCcJyTD3gROd1ZxjIXJ5J5DpuQ9TGMcGigBxnhE+hmqvGg+GEnE6lbFyJ/ NqJ3J0c9TexlrToE8ac0cc8/1Kbxmzuk4Vwg8QXyN7h+ukLB3nPGF37DomATfJ8RsBk0 n8kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=mAjC17wogJMwNPWSrc+n+T2FrLnd1+dq8gmwPeH9TBw=; b=MnYsH6ryQ9XgF5QPzMwD9s86sVzrmkuZUjR5F8EDsx6hYo84TFo4aKBSSJjRRq0Gxf o6IwmYsM6AxxdSWLdmM+m9H9Wgk6MrROTKeT8dE8FfB1oDNjLD2aPdeY4RzSZwQTxLPC rL7hc74GzM9+iCUVx2A8URsP1pG8fsUPYy7WxIiwyotAIVrxE2t44+hjS/8M3szUGU6t WBDm3QI7qosocYSfur5zcZnoTbHtIxpq1qCAMVlbJk81W9/9lyEi37cENgeWwSI6XTyd H6QCX0NHBh9zEzSEmKfRVXaG5YqJtc9ifAqPpwOhLZbegwcTm6305swJfGapV2e7C0sU HmIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25-v6si9441006pgc.42.2018.05.15.01.32.00; Tue, 15 May 2018 01:32:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbeEOIbF (ORCPT + 99 others); Tue, 15 May 2018 04:31:05 -0400 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:55691 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbeEOIbD (ORCPT ); Tue, 15 May 2018 04:31:03 -0400 Received: from [IPv6:2001:420:44c1:2579:c189:b26f:32c3:bc5b] ([IPv6:2001:420:44c1:2579:c189:b26f:32c3:bc5b]) by smtp-cloud9.xs4all.net with ESMTPA id IVMIfGa0oJbleIVMLf2Qda; Tue, 15 May 2018 10:31:02 +0200 Subject: Re: [RFC PATCH 5/5] media: platform: Add Chrome OS EC CEC driver To: Neil Armstrong , airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Cc: sadolfsson@google.com, felixe@google.com, bleung@google.com, darekm@google.com, marcheu@chromium.org, fparent@baylibre.com, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <1526337639-3568-1-git-send-email-narmstrong@baylibre.com> <1526337639-3568-6-git-send-email-narmstrong@baylibre.com> <331d45a4-e496-d0f0-5a0b-ead2cc66da6f@xs4all.nl> <43b84663-da56-25fd-8e16-ba67f5a7c762@baylibre.com> From: Hans Verkuil Message-ID: <809adc05-90a1-03f4-d0d6-23cd47f0da1a@xs4all.nl> Date: Tue, 15 May 2018 10:30:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <43b84663-da56-25fd-8e16-ba67f5a7c762@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfKQ7IuwhtIBn7TL45/rIezhmkwaVFRfN1TkCXwblD/A/Igy4fvULP6Mdoo+mpKcEbLP7sFEl33E0G7gJNzF8wytb5YQjx9IUWwwtTOjxoh5LbSHwk5a5 XF3/GGJIdAJBSjJ3urxzdI+5omnCY175L6q86SLALE519VgO/g9s7cR0zfLKoT5eC8DBkPbFSjS8hjb6gPRtzTQYOB+CVCjRi32Qhg32Fp/VbBfzAWvrzHGQ UyH6VuVG5k8FmzqnTFK4LVJCdHVUOHgPdZnwBIXxP37QHhfK9ilStXal32s5WbSNoUqCiTitRHrzde2o0yuw2U2kVLcG7pVziLOIzaPUJDglDQEUR1jIirA/ xyPfEz4EjvVkORB1ab7uVDrL9KQqpRy2WumyJypiWfowpIgf/IMI/RvsY/RKRcytYGly4XN7sh8lJs139o++Q0aKyFdM0Ff/HVC8OPpBbosDD3+Es9o5k8pG 5W7wjsK8PtSPpBPp6gDoPIZ9hSH4excYqjSCPRfpfL2TEVAP1SVrXVZ5UWBALRDP8UYXL2FhhFGIXHUYnyRDoVZCcbWDxSD9m3kz/4hl9opCa+zltEz6K05G NKA6dPwP4c8a/sj8eOpNV1KxwK9wLB3bDynbgQQ7ZX+X1M11l/ym5+/CHwYfkJMtNhG5Db7L4FAkhUy/DuehyhaUCU4GJFt+b1QutXzc+sgYEhfKeFfDDWNX WX2G8mYv7srONoCTwH1kdC3ZC8vNYdG6wZLh4SyGOMUxo3SS/+tHPZuhkB7MJkkc8SSMX8QXcWhUy6Zl5JqxJGMvbuj2axILpXgANwruEmR2mDgAvaWMEQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/15/18 10:28, Neil Armstrong wrote: >>>>> + int ret; >>>>> + >>>>> + cros_ec_cec = devm_kzalloc(&pdev->dev, sizeof(*cros_ec_cec), >>>>> + GFP_KERNEL); >>>>> + if (!cros_ec_cec) >>>>> + return -ENOMEM; >>>>> + >>>>> + platform_set_drvdata(pdev, cros_ec_cec); >>>>> + cros_ec_cec->cros_ec = cros_ec; >>>>> + >>>>> + ret = cros_ec_cec_get_notifier(&cros_ec_cec->notify); >>>>> + if (ret) { >>>>> + dev_warn(&pdev->dev, "no CEC notifier available\n"); >>>>> + cec_caps |= CEC_CAP_PHYS_ADDR; >>>> >>>> Can this happen? What hardware has this? I am strongly opposed to CEC drivers >>>> using this capability unless there is no other option. It's a pain for userspace. >>> >>> It's in case an HW having a CEC capable FW but not in the cec_dmi_match_table, in this case >>> it won't fail but still enable the CEC interface without a notifier. >> >> I don't think that's a good idea. CAP_PHYS_ADDR should *only* be used in situations >> where it is truly impossible to tell which output is connected to the CEC adapter. >> That's the case with e.g. USB CEC dongles where you have no idea how the user >> connected the HDMI cables. >> >> But I assume that in this case it just means that the cec_dmi_match_table needs >> to be updated, i.e. it is a driver bug. > > Yep, maybe a dev_warn should be added to notify this bug ? Yes, a dev_warn and then return -ENODEV. > >> >> Another thing: this driver assumes that there is only one CEC adapter for only >> one HDMI output. But what if there are more HDMI outputs? Will there be one >> CEC adapter for each output? Or does the hardware have no provisions for that? > > The current EC interface only exposes a single CEC interface for now, there is no > plan yet for multiple HDMI outputs handling. > >> >> Something should be mentioned about this in a comment. > > Ok Thanks! Hans