Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp306142imn; Wed, 3 Aug 2022 04:46:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR58SPiOcjm/aMdfCsTF7nocz8PPeLo40D3VVLXGsAj64THgonG78elZ5B+qCvERvO8rJrwB X-Received: by 2002:a17:90b:388d:b0:1f5:13c4:8ba0 with SMTP id mu13-20020a17090b388d00b001f513c48ba0mr4488388pjb.162.1659527167141; Wed, 03 Aug 2022 04:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659527167; cv=none; d=google.com; s=arc-20160816; b=KC9YIfHjitQrQLzlm5+gh17eMj2L734Gel7ZOb1TibZZPWMgzEqQnFvtWU/JQBs6RX oPzPI4emd8irzFmu2zx+3XQrAcQt180ty6czmF/EcGTvBjfoZqlzqTxPGEOtQ+XEAi2B k4ocblufetM5IpCeaIJtaca21k3+O93ytMAwmUBXbK+GUTKfeLrOVdvyhTXydlXCSM7L 7n9Fu5UDWtK+gnrgNI+NBUHVbToeKqMsh3PzrDlCudTraayIqawIb6CVfSqFv5RKd8TW bOL1vmyy2ZnEwvKfUcuVDWmNHawoTYOUVNfyObf2Npv8nzwEue+lfJ/RWFYnsJELKxYJ /lFg== 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=pq2P2Xn8nHWnqSQfrsALh+5vzPmgAQDujmNhLNfM3P4=; b=a/gJu00TE6TaWfLz/DltRmrJPZjptaCAliWEnkeiZLYUNB9ro/g9JXUyS0zVPFaloG S1RMpBkKJuvp9l090s45fWj43K9te5ak8fX7MbB2Y0pAbKre+McSqnGnaDtRqbgMmX8P 0B/MPOggZxzLcmgqkdh1myJy2K1BTUYWIRNpL6v4kqu5eQ1nZjvr/vL8KZTsSWZYoQCG 3SOJeM2q9tmuMkexGj3X3PcdRQtnYbIYnYUcWjvhqIab3O0Mk0i7GlojcJnJHlFWxgnu BrioBF0KHVuopslYX7uWwGV9erhsOzFzFs0EC1OpENcGrhT8vt6HASGthoC26B10Qk4t FxAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SCK6oyzz; 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 f12-20020a63754c000000b0041c114955b6si9022530pgn.2.2022.08.03.04.45.44; Wed, 03 Aug 2022 04:46:07 -0700 (PDT) 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=SCK6oyzz; 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 S237701AbiHCLd7 (ORCPT + 99 others); Wed, 3 Aug 2022 07:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237709AbiHCLds (ORCPT ); Wed, 3 Aug 2022 07:33:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73C5E4E61E for ; Wed, 3 Aug 2022 04:33:46 -0700 (PDT) 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 DF75C61166 for ; Wed, 3 Aug 2022 11:33:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9E25C433C1; Wed, 3 Aug 2022 11:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659526425; bh=UuC8t1XbxVc7Rt5F5aq9a2luz/J8OSnn12GRcik7TNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SCK6oyzzY+t/Cu7RXiQsdewruNE3+q80OoTvMFJXOMcZBsNSPnz7lahX8F344S61R Abqm5MnsO2BdmEJAvuEEEUDsDXhjX1Vq22b3LP60NVGKvbjJrDK6Yj5tZDRk/jhsgO z/W1jJXUAJkxFAO3SHvHWno+KQ98Ny94AbZMG/To3jHE6/UuP0TF+ZHF1p+KiTum9D CdfvnQ7ssZeSCTIVGTheU0v8inq+K8zaqbDbiSYyLjTSkW2Ps/o7YtpVj+eWm1ZhTT EgeQ/GF2X94bNiXoINEpJM1Dqg9/1pLW5TLx0XRh8qX5uGO2KUKKxJmbbHfSPMkJHg +wDZ664RQ31uA== Date: Wed, 3 Aug 2022 17:03:41 +0530 From: Vinod Koul To: Greg Kroah-Hartman Cc: Pierre-Louis Bossart , alsa-devel@alsa-project.org, Bard Liao , Sanyog Kale , linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] soundwire: sysfs: remove sdw_slave_sysfs_init() Message-ID: References: <20220729135041.2285908-1-gregkh@linuxfoundation.org> <20220729135041.2285908-4-gregkh@linuxfoundation.org> <95dcb89d-bfc7-7bc4-5ec5-04537bc0758d@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.7 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 29-07-22, 17:13, Greg Kroah-Hartman wrote: > On Fri, Jul 29, 2022 at 10:00:42AM -0500, Pierre-Louis Bossart wrote: > > > > > > > diff --git a/drivers/soundwire/sysfs_slave_dpn.c b/drivers/soundwire/sysfs_slave_dpn.c > > > index c4b6543c09fd..a3fb380ee519 100644 > > > --- a/drivers/soundwire/sysfs_slave_dpn.c > > > +++ b/drivers/soundwire/sysfs_slave_dpn.c > > > @@ -283,6 +283,9 @@ int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave) > > > int ret; > > > int i; > > > > > > + if (!slave->prop.source_ports && !slave->prop.sink_ports) > > > + return 0; > > > + > > > mask = slave->prop.source_ports; > > > for_each_set_bit(i, &mask, 32) { > > > ret = add_all_attributes(&slave->dev, i, 1); > > > > I am struggling with this one since the driver is still adding > > attributes manually. You mentioned in the other thread that > > > > " > > That's what the is_visible() callback is for in the groups structure, > > you determine if the attribute is visable or not at runtime, you don't > > rely on the driver itself to add/remove attributes, that does not scale > > and again, is racy. > > " > > > > I interpret that as "there's still a race here", no? > > Yes, there is, BUT as you are creating all of these attributes "on the > fly" for now, I don't see a simple conversion to fix that up. Let me do > these, the easy ones first. Your dynamic attribute allocations are the > harder things to do, let me think about those after I've fixed the rest > of the tree up with the trivial ones :) Sounds good to me.. Yes the dynamic ones are the one that need attention. How do you propose to handle these? -- ~Vinod