Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1091024pxy; Wed, 28 Apr 2021 22:41:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxnz4SaTP6+Ua5hoJAUagFEem841ZEz4CQNXfmY9VqQwV1j9h0UmIDt6QmJYh6Djv0pFOT X-Received: by 2002:a05:6402:51cd:: with SMTP id r13mr15955577edd.116.1619674901069; Wed, 28 Apr 2021 22:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619674901; cv=none; d=google.com; s=arc-20160816; b=0H2hbh4Emj9XfYzcmM0Oan1Q4H/+Ypdow/MjrY922J0gkAMmfqFH5S4W2RX3TufweA xpVz+iq8ViYHfK2yY4cSkSnXdXqP/CXC52wmmCv+bb6hIHRWYLdfdCa6l0NvpLnvc8m2 bnVspsGn5Ia2uJUZDiR+0Mxulw6On+3SoVhMRb9PqutWbPSSgDb4sUCfd6sP0ORjLiPR gDFynGWndUt9mJNKQHPyuoCetBnXBwWyzbTeUCaIEFwUqUpY6avvZ8to7x0LJi4isPMD +xytfLmXgAjscBJ2Iak2FMW7ZXqc3GAJmmEVGp5W8UNK3tChu4rF9IB5Pza++J7WJRA5 oUwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xZdjO0RFzZ36whN0nqHe2gpIIEZmqiH1THH/jtnnt+U=; b=CPCBEkAlqjOsjWVDkPO+wT+EO3vk8t/mDgl49E14+pIAJgUvUw4Vm6HaEVLEuY1xRF v/KMFp2oXeR42XPvLJc9y+gPJvEt7DxaF5b6WSsiuv3G89JlXPRldpMHVoL0itKWPIWZ 3+qn9tAUf4+Ib/HfrgL0b6CZYKij/jvuihIp3B/TDd6SQmI5b84AcIFbdv/fH17GrkT1 Ial+uAa3nJ5T+YKxTaa9Q06cZEOS5ETcIkZDg3776CbVXXkbbRc0dexliq1oaHVhZwoY Te3doVodI3/udQgW8AjWaC2cE9xkJ9j/wcTIydvaDF6Fo6Xs5XWowqgelMlUXIAfNpzL Q2yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CWIBXDif; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo9si2097121ejb.552.2021.04.28.22.41.16; Wed, 28 Apr 2021 22:41:41 -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=@chromium.org header.s=google header.b=CWIBXDif; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231781AbhD2Fhr (ORCPT + 99 others); Thu, 29 Apr 2021 01:37:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbhD2Fhq (ORCPT ); Thu, 29 Apr 2021 01:37:46 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D112C06138B for ; Wed, 28 Apr 2021 22:37:00 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id j4so63498498lfp.0 for ; Wed, 28 Apr 2021 22:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xZdjO0RFzZ36whN0nqHe2gpIIEZmqiH1THH/jtnnt+U=; b=CWIBXDifnBdQIfmH7fbeslO7HP2eB+tTmyS2+tE28FSFjzEoZbGTu0dwfbn2UFv+gO 5GC4piK1lG0xbMdstaNzlVQvx+loNPyJ77w2K99aZCLdLZzAsUJeEg/qqDPNCmcGa61c EufhXxsrRrt/3dTxVhgt7dfueNJVuDHmw1hpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xZdjO0RFzZ36whN0nqHe2gpIIEZmqiH1THH/jtnnt+U=; b=MlrKzYLp3mwtSgvgNK77jzVONT/wjhyo9e5Lybz8fSC3+hv/LzUs0UgEmNtpnUUcjS I4hoL5Mq06wQ+xmBaIgZA48p0mXCpwXQR9r6xraAnGMMGM6/ygbiSUy6rAMhksRtf3vq hD4ZV+G+fEL7gDNBL/seaPDNyQJ3W67ua1aGP9m/MOrzwdm8NCKfSyi2bG7Sx1Gzu4wj DYnVza86qFnRfqIr0RI0ZTRZZ9Di4uCU49VxndZSWt8tLCv0i7i25NlNLOOwYmkA+G/S 7UdWSdwAZa/0Yf4c1ksWYNn7IR6XaysFuM1Muv3NdiROaONuThLHW+13IhHY0Mx6+f6u iEMg== X-Gm-Message-State: AOAM530/E0tk1ywNLizzOnoRKA9GCFge3n8Hln1sboqzR6nWhkLhuwcW iF+TjtNq1IBbbSVaVurqX1Kxh8IEYG6NKYc2KaMuCA== X-Received: by 2002:a19:6d10:: with SMTP id i16mr19428164lfc.126.1619674618681; Wed, 28 Apr 2021 22:36:58 -0700 (PDT) MIME-Version: 1.0 References: <20200909224226.2177401-1-swboyd@chromium.org> <6b546379-d5ce-f0bd-7907-be36f90c15ed@collabora.com> <159978558757.2295844.13766111546939928492@swboyd.mtv.corp.google.com> <161801995912.3764895.7559313428958998666@swboyd.mtv.corp.google.com> In-Reply-To: <161801995912.3764895.7559313428958998666@swboyd.mtv.corp.google.com> From: Gwendal Grignou Date: Wed, 28 Apr 2021 22:36:46 -0700 Message-ID: Subject: Re: [PATCH v2] platform/chrome: Don't populate lightbar device if it isn't there To: Stephen Boyd Cc: Enric Balletbo i Serra , Guenter Roeck , Benson Leung , linux-kernel , Guenter Roeck , Lee Jones Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 9, 2021 at 6:59 PM Stephen Boyd wrote: > > Quoting Stephen Boyd (2020-09-10 17:53:07) > > Quoting Enric Balletbo i Serra (2020-09-10 08:49:42) > > > On 10/9/20 16:52, Guenter Roeck wrote: > > > > On Thu, Sep 10, 2020 at 7:32 AM Enric Balletbo i Serra > > > > wrote: > > > >> On 10/9/20 16:18, Guenter Roeck wrote: > > > >>> On Wed, Sep 9, 2020 at 3:42 PM Stephen Boyd wrote: > > > >>>> @@ -206,6 +209,17 @@ static int ec_device_probe(struct platform_device *pdev) > > > >>>> } > > > >>>> } > > > >>>> > > > >>>> + if (!strcmp(ec_platform->ec_name, CROS_EC_DEV_NAME) && > > > >>>> + !cros_ec_get_lightbar_version(ec, NULL, NULL)) { > > > >>> > > > >>> Any idea why the lightbar code doesn't use cros_ec_check_features() ? > > > >>> There is a definition for EC_FEATURE_LIGHTBAR, but it doesn't seem to > > > >>> be used. It would be much more convenient if that feature check could > > > >>> be used instead of moving the get_lightbar_version command and its > > > >>> helper function around. > > > >>> > > > >> > > > >> IIRC it was to support a very old device, the Pixel Chromebook (Link). This flag > > > >> is not set in this device but has a lightbar, hence we had this 'weird' way to > > > >> detect the lightbar. > > > >> > > > > > > > > If that is the only reason, wouldn't it be better to use something > > > > else (eg dmi_match) to determine if the system in question is a Pixel > > > > Chromebook (Link) ? > > > > > > > > if (!strcmp(ec_platform->ec_name, CROS_EC_DEV_NAME) && > > > > (cros_ec_check_features(ec, EC_FEATURE_LIGHTBAR) || > > > > dmi_match(DMI_PRODUCT_NAME, "Link")) { check_features supporting lightbar was introduced with crrev.com/c/263463 in 2015. It is present devices with lightbar like Pixel C and backported to Pixel 2 (samus) with crrev.com/c/274047. Remaining boards that have lightbar support and not check_features support are: link bolt (reference board for early samus). Therefore, that solution is right. I will send a patch based on that code snippet. Gwendal. > > > > > > > > > > That looks a better solution, indeed. And definetely I'd prefer use the check > > > features way. > > > > > > Gwendal, can you confirm that the Pixel Chromebook (Link) is the _only_ one > > > affected? This one is the only that comes to my mind but I might miss others. > > > > > > I think that Samus has this flag (I can double check) and this was discussed > > > with you (long, long time ago :-) ) > > > > > > > Sounds fine by me. I'll wait for Gwendal to inform us. > > Anything come of this? I haven't seen any updates.