Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp188523rwb; Thu, 17 Nov 2022 23:17:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7RSYLbVGyGeu6NVIbQZdWzujD9yU5l6yQD8VKlmAgIDVTIkf6oyDqiv5tVedsgNXfCuwdJ X-Received: by 2002:a17:906:1b51:b0:78d:a30f:3f3a with SMTP id p17-20020a1709061b5100b0078da30f3f3amr4921177ejg.386.1668755871529; Thu, 17 Nov 2022 23:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668755871; cv=none; d=google.com; s=arc-20160816; b=tL612CEFLRUFUpK173KBae90p27F/a9Cevn0OCgsbjPyXlG99a7Pmpkkw8c1dWqZdG EISRXFy3N9lrCLsHtPwxUMv6GnrkTgs53Rrqtqzposmw7jEH+orutvk4zv4EPLlBVusr 17r52tCwCecRFmvg7gbNj38v2t4CYKSs5K81qGoe+nrsu/8UpgzaNMwgHIAPNysYFwFw 4t2xFR30dXQ5qg3RgBUWJyovuw2IOkOxDu8aYjgaAOut5yXu/Jk5VrmrsvwO/ToN01rf a/4dHF2B95IlrLI2JeetEZSupegsTeNmmGZvnG4IhuPmgnRrjfx6SLT9AKDZ+6uBn08w 3Fjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jHNoDShsonlNAUXwahyalxP13wmHphuPUMLhhUtGniM=; b=p7ToJ7GT3aTgrJ49iw5qt8A+tmBejvPOCsO7qRZ8iFcYYHsDaCCLrHGvEv5AgLkobt /7vLpePoxQusyvLARBIXIjkS53LZsErDYw1mKT85rvyOfYAkIq5lxiWuFbndTkfxRvxq 3a9L3hfoWsK+2kjOP/DkBwDYjDGYjmEDRefMb4IXBiE0UupToks3OIfNBqXYrMMQx8SS IFFkOVSVGZXidAy21icNskZRxmkA9BPj6TOo96QMmvmCWWywbEXXVXd6MkG8beRjcYxf qq3CLDE5/d47LBfUBFZd+7siJKhrM6Z5Z8tKAws/AjD9AaUjLBAFSnoRJLuAt30cvEX+ hcQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JtACASBG; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by12-20020a0564021b0c00b0045c9313faf7si2519277edb.353.2022.11.17.23.17.28; Thu, 17 Nov 2022 23:17:51 -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=@kernel.org header.s=k20201202 header.b=JtACASBG; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241148AbiKRGsk (ORCPT + 91 others); Fri, 18 Nov 2022 01:48:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiKRGsi (ORCPT ); Fri, 18 Nov 2022 01:48:38 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DCDC11146 for ; Thu, 17 Nov 2022 22:48:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2447622CB for ; Fri, 18 Nov 2022 06:48:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9537EC433C1; Fri, 18 Nov 2022 06:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668754116; bh=e4KWQDcqGgcaW/J8qpDH882iV2/keATd9urAwilXHuE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JtACASBGtiC4T1CxunomRtyGWWg3aGo9PW1JAYzw0l1nC93AsD4ZiBcYekHAlaYyZ 4+QViW+A5yM9Jz6GVCJKHr7/ZerkrWPDCft7P1qPc4rvo3PpxAoL6yLLHdZfxMlRR2 iKAykWVaP+qmAiQOBZ/FjmJdDEPQFmRo9X7VHZrCIgdMICV7bu7BBJLKY4AxN6Hm9C XLX6I6Tr9xA0+yX5bZCyaZrp/BdwSGUTLpfrNgtFkZVszcXSWiLkf5vs2NfswSLy/y yiGNny98ZFj22WHnEPXj4/S+O9xOd2go1+UJlQL6OklIbbDw5gS45KTytDfunCEXUI bUkjnmZwxwqQg== Date: Fri, 18 Nov 2022 14:48:32 +0800 From: Tzung-Bi Shih To: Gwendal Grignou 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 Subject: Re: [PATCH v3 1/1] platform/chrome: Poke kb_wake_angle attribute visibility when needed Message-ID: References: <20210804213139.4139492-1-gwendal@chromium.org> <20210804213139.4139492-2-gwendal@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 10:41:06PM -0800, Gwendal Grignou wrote: > 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. I see. Thanks.