Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1037791pxj; Thu, 27 May 2021 18:40:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLsSwfIGNyEoNuyS6nQ/xZU0OgP7OXaRntK5U7387yE8wyjUlQNX2GvPmyk6IZ7X3DGr4c X-Received: by 2002:a17:906:5608:: with SMTP id f8mr6740361ejq.390.1622166026675; Thu, 27 May 2021 18:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622166026; cv=none; d=google.com; s=arc-20160816; b=P+vcBQHO439OKr7c4XzRPcNtvQQDMnjW9YXReKDSugREh1eIGzpxUynd86iNubiXG3 AAIebMFbkhFScOHdoEmS4PY4u4ejBhu0kJh9gttbkXW2zePcrsdQFciQ8la13mx+dRpy jb8+JGhZv2X2FxGpwr7EOZAqee+ls4EHg/LfOMGx+goU09FpHraTUGsSkRxCXphe9aji 31SYyGkYZFjVW6Cd2MEEW9szqlF86HXC3+S+/rOlnc2oeFbE4rS8ntVjn+qVelJScAHp GJMtBQWH11B2XxDO5dlYJ/c/SEfPjKM8qR2MhRX7oPnqnY14cH/mVTGpPoZouR16QdS6 repA== 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=5k+QoYElPvv/JEIJG27i2r98ODrDTXojL8bBx2Ub4FU=; b=qDBQJUClC/2sh30e3J3NDwzqsILS1iDYAKSZAf5mdQNvoXeiGgjFXta+rLGnXIgWfG FbOIwoq7sMoohPwzgtHFl6uTCUCqUUME0FUtyv+k3yKwCHkFdf+4B03YPEAqkGh1T1jP QM0yIKIBGWUixHcVUrFmuoWwCPVQGp4bZn3/c6LjLBPg1C65qKVovsAG6UZ/De4VWXxU HJL/lMwyttuLEZGUql206KGDDsN93MXoy4c9B7Mr4kmcvYULe2Rh9JkcXiFcX4o8YA4q 0Iwq82fSgMSg4dUk/V0BNCLXdMTg+IAizOyp++MBn6UZVCKq8ZXhkD4In3zGCNDf8J5p eUPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BUozctgw; 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 j20si3494944eje.346.2021.05.27.18.40.04; Thu, 27 May 2021 18:40:26 -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=BUozctgw; 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 S234059AbhE0VDV (ORCPT + 99 others); Thu, 27 May 2021 17:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233969AbhE0VDU (ORCPT ); Thu, 27 May 2021 17:03:20 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4FFC061574 for ; Thu, 27 May 2021 14:01:47 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id c2so1469555ilo.11 for ; Thu, 27 May 2021 14:01:47 -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=5k+QoYElPvv/JEIJG27i2r98ODrDTXojL8bBx2Ub4FU=; b=BUozctgwF93n24U0ffApDB78imp2Sksep1yrBASZyXgVCWWSl3usAYapuhoUUReR41 /weePwO8Vhgj5Y68w7lcQ5ErFW+gQzwVL38U6pmYBGyWRz5raYcZu3bOSf3hlyw8TPhD SShyZFspCKH3CHwLPl86qYQ8OoGV10Ww3wlN8= 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=5k+QoYElPvv/JEIJG27i2r98ODrDTXojL8bBx2Ub4FU=; b=K0ONOvywnu9WcBg/9t6W5/XuQ/HURBJ7+NfqhVjXFKsLf1wzmWoCMBXsbyhuOuxqGW jP/GVvpYMAXn9ftMVx36Vb5sNgHeVctC3pwNuq+tRfmETqbvgWDZyByENjxBIppW47Ws bucpZ0vrM/gPHyfVXInujgeNJcMsOsqs0V9V5Xq8wGMkdQ+2GGn1MYCZRwwE4zMicFEy gB+bBNqmhOGmIpT/s/3SLvDpMh0gXdiJHgiN/0WK0K/Aw7pFcHjA37K4X3u6oko/XZwv 0rEDEXekRWawjagorvwv/0BaIt8xqTdRjzdw0m55/+9LvGy+1dSEKQrzBnxe1XmC/Qfk ZhYQ== X-Gm-Message-State: AOAM530h1vAMCMBRR7Gx+0otz6AeHFxy3YDFmeH25hTGUs6tHAKmsHvi gqq0bzWRCnokwMD1iT3Z5FhvcgEM8nPduSwOHZxQUw== X-Received: by 2002:a92:dc45:: with SMTP id x5mr4174288ilq.95.1622149306562; Thu, 27 May 2021 14:01:46 -0700 (PDT) MIME-Version: 1.0 References: <20210405202857.1265308-1-gwendal@google.com> In-Reply-To: <20210405202857.1265308-1-gwendal@google.com> From: Gwendal Grignou Date: Thu, 27 May 2021 14:01:34 -0700 Message-ID: Subject: Re: [PATCH v2 0/2] platform/chrome: Update cros_ec sysfs attribute after sensors are found To: Benson Leung , Enric Balletbo i Serra , Guenter Roeck Cc: linux-kernel , Gwendal Grignou , Dmitry Torokhov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+dtor] Is this change acceptable? I was worried it could break when asynchronous probing is used [https://lwn.net/Articles/629895/], but since all probes are deferred in a single thread, it is safe. Gwendal. Gwendal. On Mon, Apr 5, 2021 at 1:29 PM Gwendal Grignou wrote: > > Attribute "kb_wake_angle" in /sys//chromeos/cros_ec, > used to set at which angle the embedded controller must wake up the > host, is only set when there is at least 2 accelerometers in the > chromebook. > > The detection of these sensors is done in cros_ec_sensorhub, driver that > can be probed after the cros_ec_sysfs driver that sets the attribute. > Therefore, we need to upgrade the cros_ec sysfs groups in the sensorhub > probe routine. > > The first patch cleans up cros_ec_sysfs by using .dev_groups driver > field, the second patch fixes the problem. > > Gwendal Grignou (2): > platform/chrome: Use dev_groups to set device sysfs attributes > platform/chrome: Update cros_ec sysfs attributes on sensors discovery > > drivers/platform/chrome/cros_ec_sensorhub.c | 5 ++++- > drivers/platform/chrome/cros_ec_sysfs.c | 22 +++++++-------------- > include/linux/platform_data/cros_ec_proto.h | 2 ++ > 3 files changed, 13 insertions(+), 16 deletions(-) > > -- > 2.31.0.208.g409f899ff0-goog >