From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5AB3C00144 for ; Fri, 29 Jul 2022 15:14:51 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 79FF615CC; Fri, 29 Jul 2022 17:13:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 79FF615CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1659107689; bh=yXwKBem/pIh5VcizuE/JJL37vzadKBIwU9OceZYtNwI=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hGITqGo3AevwpgSIlN34O/YkDt/UbhXlxU5OpuMnvh7cCuM8sO0JvuAyhBO3kw2cq t98D75tbNKHs9kEV5HtRiX7Wj400M2uXsE15bsy3/0VRZJIs1sGovCs08qY47yAvRL 2SJduoDSeOb2gPZ1bAXS8NGnAKHjZsswiVMQ69F8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0C9EBF800BD; Fri, 29 Jul 2022 17:13:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 48643F8049C; Fri, 29 Jul 2022 17:13:57 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C1FD8F800BD for ; Fri, 29 Jul 2022 17:13:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C1FD8F800BD Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YhXSlkk8" 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 D81FB61B86; 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 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> Cc: Sanyog Kale , alsa-devel@alsa-project.org, Bard Liao , Vinod Koul , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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