Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp199555rwb; Thu, 17 Nov 2022 23:31:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qYH+clAVru5zqxWqhgP5V2L3C9CY15/O9QKCgGFb0WOaGd+XYXK5kSzS0OTvGqlABzPGd X-Received: by 2002:a62:4e96:0:b0:56d:a89d:fb9b with SMTP id c144-20020a624e96000000b0056da89dfb9bmr6676670pfb.24.1668756679903; Thu, 17 Nov 2022 23:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668756679; cv=none; d=google.com; s=arc-20160816; b=uOi0SZDjJ0RnIKbVMMETOr0aeSUt059SaZM9DEK3HZdOo3+jhInjDUEYQTF616FvPM NLmN1li6FJJnXtG/K2ZNbr+D6Ba13NEggbNwJSBjJ4eUQ4bk2y5GSLQPWf1eFdvNOeyG W9LilzjQ7TJMVdQYg0gNg6UcLxOdGI/NIQQ2q2cukRyJOPgg1yNGE3clGKx1A1LvGvZt 9HLzJ7Yysn4rDOblJifNClBgSaHIFxbYkpt0uVQNb3S/MYy1yemX49lopdoC40HeD/cs OUsVU3L29lQwC5gs4CnkcMbNjm5tk6BFD6+XNuZ2JajMUDqvUQdZ2BeaqdcUvdI7j355 m6+w== 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=FvKOgk3tDLWwb1NWyXvWAnYN0/RQ3NdysbGyQyA74cI=; b=GJ6TWGQQTzQz/U7Um3Wgm+EKe2dwBurylvklJXyMadSQl84mhmeKNUTp2NA/33dGlR zy/y34o7NmKxxD/7o7zPYiVfV2QI+SaEd43wrAUDXveSD5xDgEZ1mUSWCfnePy9bf5BE y8eDD4uNmAsvg0SbT3XuCvDkaIIWzb/1kPGbVjjs+KN824c6muYxQz8BBqqBOnGP9c+f mSXfU0ucvorkKm7OM5pu05J+MgTaI5EPtauXCUk0B/dEhvdjcZSKdGtSflr6/UA9DVze B733sEbJrVfBeYWCa95+YtGjlrQzQYyabxKEOQe0DBcyRJOqGWek4wBipqliavL8T1Jn 6jKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oRbo7GGh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nu10-20020a17090b1b0a00b00217ec4647afsi3406733pjb.14.2022.11.17.23.31.08; Thu, 17 Nov 2022 23:31:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oRbo7GGh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241349AbiKRGn2 (ORCPT + 91 others); Fri, 18 Nov 2022 01:43:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241205AbiKRGmx (ORCPT ); Fri, 18 Nov 2022 01:42:53 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978818CF31 for ; Thu, 17 Nov 2022 22:41:23 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id a14so7805347wru.5 for ; Thu, 17 Nov 2022 22:41:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FvKOgk3tDLWwb1NWyXvWAnYN0/RQ3NdysbGyQyA74cI=; b=oRbo7GGhWbJy2l8Rp7U1zQwZT6/x3xPfk/o5CkW3c8VNo4reSbqCG8/TCGHEesG5q7 DDh2Ktjw+wy/gcb4aoTuTXgByV27VgTT8fC7JvOTWwcSndMkN3MCHzYGx687pJKdIUPn B4TbhU1quOtj4jCTQr96QRTcM00sN8Ixkifas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FvKOgk3tDLWwb1NWyXvWAnYN0/RQ3NdysbGyQyA74cI=; b=jOvHQOxt2siUw991DXOEgrE5kZGzLqguhuFYdb7QTBr7+31fu7DJ1KnjjC6UieEbXm SA3PddsolaoSXDLrALHaTrKpgd/nOR97KS3SB/WjZSk9RGtG4/Iv5tsjYRZ07tvK/9Rz gocFAN9BWAX+1t7RGO8ILc6V0AT3pIMfleAM8z9g9JNty4bqjB1WVfzIA8Jm7ssLqC8y qFZS1RyJ/qWM0KEqlnWCXskE06QIX7GlrRE9AKjMRx2ll3JKP5eQC4cg5YHhIEAlZNib /BPRaMoDS7tWnXKtr1x6nM7891QCLHzKe8UNO0TWowUh7VFfh6dIsWSBTGcH0euT0hL2 vFxg== X-Gm-Message-State: ANoB5pmMWavzOmLfNnpT5+XWr/3vnAzpYlhW1fqZ6t/n9mcw5iS1NAc0 otD8wony4Ot8o9ufaCa4TIkSFEsvfO1Ej+DIEDMq7w== X-Received: by 2002:a5d:6a85:0:b0:241:bd77:f243 with SMTP id s5-20020a5d6a85000000b00241bd77f243mr1744786wru.393.1668753677438; Thu, 17 Nov 2022 22:41:17 -0800 (PST) MIME-Version: 1.0 References: <20210804213139.4139492-1-gwendal@chromium.org> <20210804213139.4139492-2-gwendal@chromium.org> In-Reply-To: From: Gwendal Grignou Date: Thu, 17 Nov 2022 22:41:06 -0800 Message-ID: Subject: Re: [PATCH v3 1/1] platform/chrome: Poke kb_wake_angle attribute visibility when needed To: Tzung-Bi Shih Cc: dtor@chromium.org, jwerner@chromium.org, bleung@chromium.org, enric.balletbo@collabora.com, groeck@chromium.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 6:01 PM Tzung-Bi Shih wrote: > > On Wed, Nov 16, 2022 at 10:23:38AM -0800, Gwendal Grignou wrote: > > [+chrome-platform@lists.linux.dev] > > Please also Cc to the mailing list if the patch gets chance to have > next version. > > > On Mon, Nov 14, 2022 at 8:10 PM Gwendal Grignou wrote: > [...] > > > > Expose the attribute group to alter to close a potiential race between > > > > cros-ec-sensorhub and cros-ec-sysfs (that creates the attribute group > > > > on behalf of the class driver). > > I failed to realize the potential race. Could you explain it a bit? The decision to show or not an attribute is done at the attribute file creation time, once. If the module cros_ec_sysfs is loaded before cros_ec_sensorhub, the attribute kb_wake_angle will never be shown. If it is loaded after, and there are 2 accelerometers, the is_visible() function will return true and the attribute is shown. This patch ensures the attribute is_visible() is run again after the sensorhub driver is loaded. Gwendal. > > > > > diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h > > > > index 02599687770c5..c6dca260bbd5d 100644 > > > > --- a/include/linux/platform_data/cros_ec_proto.h > > > > +++ b/include/linux/platform_data/cros_ec_proto.h > > > > @@ -191,6 +191,7 @@ struct cros_ec_platform { > > > > /** > > > > * struct cros_ec_dev - ChromeOS EC device entry point. > > > > * @class_dev: Device structure used in sysfs. > > > > + * @groups: sysfs attributes groups for this EC. > > The field name has extra "s".