Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp337924imn; Fri, 29 Jul 2022 08:21:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uXmqEEvfw5x8yhbMWjWJh5EyK8dXbc4B9t7Rz6ggDI4e1QQtWd7B964VQX8kkRKcA5qOhi X-Received: by 2002:a17:907:97d1:b0:72e:5ee:2ea8 with SMTP id js17-20020a17090797d100b0072e05ee2ea8mr3160700ejc.592.1659108105810; Fri, 29 Jul 2022 08:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659108105; cv=none; d=google.com; s=arc-20160816; b=DqabvXr6CIILi/vs4lYjIzIDa8/s5TlPobuuQTTlcaHnhBRmvgt3ialeXX8UFndcV2 H1up8MSphi8mAAdui7ONzl1GtISqAaX7qphbdZhOG9BL+/sep71EBq/sKiu+dS6qfNR4 /VrumfLdZfVp+6DptKthYzySfC6McCJNGLEQSSNofxT31/Q/3QfE/Z39mceB+UTVblEk i/oT85OduKm+2tswyum+YKokZQ6rkyXcR1ruUGYCWFd5mjHLLLGmlSzjI/aO/riRIoee 35gmXr9OCAMRsydMeyLAHkAgVdFP5MMWZo2zQWiOLDyp4/RMJpNLKAyXqTgd1oBFKwaR Hh5w== 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=TTG/y6jEq+GAxO2TUEdbB200LYcy5VmN5lqqg0iPAQU=; b=z7QJaxcb93OEVJ73e2en5/iqPSHZuaYs/qFxpJfV73lh7rc5SItFNs6BkCyvI6D+g6 4BjYdD9Z5j4v/4ZUb9ssWVzIMC0Qo9V6R9gnEyas96eLHNV5YTBc5et70WltmyjwhnAd TmtkHopXzMEkvUoHAwybWohE/ZOlb1VYjVgQNSrkQTcRY8T/xYz6QHhUbxhGnjfOretp 47mktt0mH6WxSx3JuSvbWDls6KsjkEOYNzNXrtEsikNhvwnuRzkveQ6P5vg8780Nlw9w sGTi1f8xx47EHoTaEDomYW5ICdi3jHLZKmV4bzHytRIVWFFcjKfXgDRuwUBiTYjOlYPw Xqmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YhXSlkk8; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a05640207c300b0043ba4a8a3e6si3053592edy.144.2022.07.29.08.21.20; Fri, 29 Jul 2022 08:21:45 -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=@linuxfoundation.org header.s=korg header.b=YhXSlkk8; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236704AbiG2PNx (ORCPT + 99 others); Fri, 29 Jul 2022 11:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231158AbiG2PNv (ORCPT ); Fri, 29 Jul 2022 11:13:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E719DF69 for ; Fri, 29 Jul 2022 08:13:51 -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 DCC5161B87 for ; Fri, 29 Jul 2022 15:13:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9AAFC433D6; Fri, 29 Jul 2022 15:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659107630; bh=yXwKBem/pIh5VcizuE/JJL37vzadKBIwU9OceZYtNwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YhXSlkk8SXs2rVej5JJoT/xtkxn8M0yyI2WG3XtIHH+06+gfFP9DX750bb5wftqgZ oR+4hHTDOl79Z4wHMHmKfxunmKAxqOXgbSRclQ8DId2wl01hpBVs13h234voxLRXuk 0D6G4Ow4XBs71JHb+M5oK7G7Awbrj8c6dhFSV8S0= Date: Fri, 29 Jul 2022 17:13:47 +0200 From: Greg Kroah-Hartman To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, Vinod Koul , 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: <95dcb89d-bfc7-7bc4-5ec5-04537bc0758d@linux.intel.com> 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 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 :) thanks, greg k-h