Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1506866pxk; Thu, 10 Sep 2020 17:54:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7YGtcinDZoCXPUeYxBZkBuyMx20WXTSdczwpuILaNclRywF1vOX+DmOcdVpV8NRBG3Xzx X-Received: by 2002:a17:906:49c6:: with SMTP id w6mr11281686ejv.445.1599785658817; Thu, 10 Sep 2020 17:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599785658; cv=none; d=google.com; s=arc-20160816; b=NZE+GhRpy9w62v05DVFo/uvPUTY1BapA7rUL3rh2nkxZ5ioKT0+Q7YwDKI/rIvrb3F lqLjPmghjhkWSOi6XWqIcrLpqA370EpbaJhuEYLYiNNwT/upeHrdJLZRKjloLPqoLe5Y T13n+YbFmGS0fbt4qywOvPmOVTpaHeDdc2yMe5zoQoEV2CqEkt0JgnVAriT2EnH4gm5H dPhR8IHFRMDvwodDrUGMJyisxxSBitenVQrTP7364OjSNbSCSnZ/UOsjtEhlArY9nusK nvBo54xiXGuLiB+s0g6zaS9urBf/9R/mkrAh2GrTDTeTyG/tigQzRFte9yFlgwKoqgU+ 7Y1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=J/p2zeJal7lu4jnKjS6joWIHZVCnBy6PqNOmdrTgyn0=; b=UpLb3IMvvwj0RMMjJ7vsAWXEcBl4DziTowvd+41JqNoC4flecFEt4vee2TW533h/oS NaRwgCY1phU2EB1FwZzjy9KJAJ9XtM4uRGs+5LlseMT8OluW1OFZJV6zU3j3Bp6Fweje bRNidvO4EvqlmKYAh33MUC2UP+SDF0JX3gti97iNQVvCtCWurAKQPTwA3XDMovC7tvCt DG2q7iWBwTpgmfnVwqDI6xq0WPFAD93rq0fSnZFQmcx04gkCJYTXpyNuoGx45XhunVZM fiDq2/QCAGAu5lWrRF3bh/0qtlXOh5ReeFLtDv3TwreWkYOoBTm1DynjdxNA1m6UgxrY +aLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TIXLBDWR; 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 y19si224024ejf.251.2020.09.10.17.53.55; Thu, 10 Sep 2020 17:54:18 -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=TIXLBDWR; 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 S1725766AbgIKAxQ (ORCPT + 99 others); Thu, 10 Sep 2020 20:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725298AbgIKAxK (ORCPT ); Thu, 10 Sep 2020 20:53:10 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F4BC061573 for ; Thu, 10 Sep 2020 17:53:09 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id s65so4282480pgb.0 for ; Thu, 10 Sep 2020 17:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=J/p2zeJal7lu4jnKjS6joWIHZVCnBy6PqNOmdrTgyn0=; b=TIXLBDWRYtUn6eLA80L6O0uvCk6TBjj4AniC+Bi8kNOuAKvzYRvLYYGIwEkpqL5nsl VaRW9u/quuoqKPHte6KKaIcjzz947FVFK1BfypoqPmk0HT5GELckByn3S1SujPonoAtb PZrRYCXHvg/zcMYnn9zT3RxYs164icUe0hsYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=J/p2zeJal7lu4jnKjS6joWIHZVCnBy6PqNOmdrTgyn0=; b=bhNDfHS7fCAbzhczlZiE1AnfejoeQ3hyjG/MWjwMzNxWANXcXezU26tWbnH3V1SfXA s6CDyOEl0h92DUd/tVkkI+e+bXfcHPxZaIOAPorcfIyat7ZdcB3lDS+8M18NulXaJRPI hwuvFmMXyVaTizlNlutctjTxavGxEIWelqFvcoBxm9kFJPElLO0UdnI7qVgwC5m+Zfag AQnsKzdQZin56i4eRpOQGMKy1zMAdSB4yw/5SK7igK1E1JX8gL3buCbK2uVJHs4xM+Jt GOLeNCtkD9MvDx3fMiqao/2fKdStSZu7VemsNIHpIqXdNpteDlNFtnPFO+73vSAfgu7/ m32g== X-Gm-Message-State: AOAM530d9qXACiy0CEW3j+83Ek4qFO2tWkoKPC6x2FF5WKgT55V5E8a3 /zZCyEPVPy2zP7h3HlcHogd4ZQ== X-Received: by 2002:a17:902:9a06:b029:d0:cb2d:f276 with SMTP id v6-20020a1709029a06b02900d0cb2df276mr7936425plp.15.1599785589359; Thu, 10 Sep 2020 17:53:09 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id y4sm287648pfr.46.2020.09.10.17.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 17:53:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <6b546379-d5ce-f0bd-7907-be36f90c15ed@collabora.com> References: <20200909224226.2177401-1-swboyd@chromium.org> <6b546379-d5ce-f0bd-7907-be36f90c15ed@collabora.com> Subject: Re: [PATCH v2] platform/chrome: Don't populate lightbar device if it isn't there From: Stephen Boyd Cc: Benson Leung , linux-kernel , Gwendal Grignou , Guenter Roeck , Lee Jones To: Enric Balletbo i Serra , Guenter Roeck Date: Thu, 10 Sep 2020 17:53:07 -0700 Message-ID: <159978558757.2295844.13766111546939928492@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 wro= te: > >>>> @@ -206,6 +209,17 @@ static int ec_device_probe(struct platform_devi= ce *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. > >> > >=20 > > 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) ? > >=20 > > if (!strcmp(ec_platform->ec_name, CROS_EC_DEV_NAME) && > > (cros_ec_check_features(ec, EC_FEATURE_LIGHTBAR) || > > dmi_match(DMI_PRODUCT_NAME, "Link")) { > >=20 >=20 > That looks a better solution, indeed. And definetely I'd prefer use the c= heck > features way. >=20 > Gwendal, can you confirm that the Pixel Chromebook (Link) is the _only_ o= ne > affected? This one is the only that comes to my mind but I might miss oth= ers. >=20 > I think that Samus has this flag (I can double check) and this was discus= sed > with you (long, long time ago :-) ) >=20 Sounds fine by me. I'll wait for Gwendal to inform us.