Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2184626rwb; Sun, 14 Aug 2022 23:51:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR72wve7tx+XW8LL9a4KJYcTf2Z52kPLQJ3gPiMTGVTxq4dp7lGIEreKTvhP4ivxAdOsWhRR X-Received: by 2002:a63:1a09:0:b0:415:fa9a:ae57 with SMTP id a9-20020a631a09000000b00415fa9aae57mr12543964pga.181.1660546268147; Sun, 14 Aug 2022 23:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660546268; cv=none; d=google.com; s=arc-20160816; b=q1q5a9za1Y78FCBQKJvsFzdSybZ2Q3OKcW+RwLU3oRlQkwAfigdMZLKeRMNWv9rpYv Vm/sfY4FWhvFwNGfLDhRmR80EeTLELsQoDJlDCNVKnX2KiRmBrUkqooB958Q79pWh+Zu 1XM4YyriwdxDmiFPpRH8y3/poZcqGChbn8bYya9C1nqMqBh6Lw3iKhVrat9XJJwVmG6d NMEuAz7d2DPVLBSIdZ0i8Oi7FCHjzrn7Z56Vqrh9fhAi5DluU5GPeCyrwb4aNUNVGr5W B194aR0za1qlcU3INiw/Vebleyy24zkDZJE+PinnZ3Z7nUhYXiOsXsV8QG51f5mGA1iH bDzQ== 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=A2TL3y49h2EpGeRup0F+Po87t0O4Awr84qJYCqB89Vg=; b=Ew5W6QWoMcw6kIFdY+Lln7p+r3Je3401wyEnXcY7jm4lRgULcvQ/Qt8QUKL/FFn22B k1zmCJ1BisWFPiweiYE0vruPBhZaR2hjdl9LfI7QkIF3qH6l+mISsbF3ynQnkkDeWKTL eCOCpuF+cKg9m6JLLTlov7wWdQNUHrDvKNVCDSWDd4+bfi83bZDHRn9ohprmN0opNECf PDhhRyhSqKSgI8FFBkBxb2a1EJ/KrkXAZDvm+YO3wfmgPLUNkVTXApgFZMg+uC012k+/ OvsHnbOPMA4eicODpdRUL7Cwc2YwvRuHUgSnRjUas7dOwdhjDZrfxdEtz7DTA9XG6Dub mAsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dOLsO0eW; 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 me11-20020a17090b17cb00b001f4f259febesi11666629pjb.163.2022.08.14.23.50.55; Sun, 14 Aug 2022 23:51:08 -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=dOLsO0eW; 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 S231293AbiHOGhx (ORCPT + 99 others); Mon, 15 Aug 2022 02:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbiHOGhw (ORCPT ); Mon, 15 Aug 2022 02:37:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3389019C2E; Sun, 14 Aug 2022 23:37: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 ams.source.kernel.org (Postfix) with ESMTPS id E228CB80C87; Mon, 15 Aug 2022 06:37:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 743EAC433D7; Mon, 15 Aug 2022 06:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660545468; bh=i3Lhu29DAuR1+5toOtx6WUN5Q9/XjYipUqxecRURQhc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dOLsO0eWL1louTh1erlzYfiyxe3e1GCuC6rITTMB6BAFW0KYj4VI2sod/q921wwgf qgeNPTQAt9VclhBL3OLkn0QO3EDriXGrjbiBwZf5gf4gjsOO8njLu3nhbLUBuuPqQE mSU/BTQYvSJzrPgD6m1fVkeJrGXt3Yx+Tzq0GG6U= Date: Mon, 15 Aug 2022 08:37:44 +0200 From: Greg KH To: Khalid Masum Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Heikki Krogerus , "Rafael J . Wysocki" , Pierre-Louis Bossart , Daniel Scally , Vinod Koul , Sakari Ailus , Sanyog Kale , Andy Shevchenko , Bard Liao , Len Brown Subject: Re: [RFC PATCH] Soundwire: Initialize multi_link with fwnode props Message-ID: References: <20220814080416.7531-1-khalid.masum.92@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.2 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,T_SCC_BODY_TEXT_LINE 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 Mon, Aug 15, 2022 at 10:08:07AM +0600, Khalid Masum wrote: > On 8/14/22 15:45, Greg KH wrote: > > On Sun, Aug 14, 2022 at 02:04:15PM +0600, Khalid Masum wrote: > > > According to the TODO, In sw_bus_master_add, bus->multi_link is to be > > > populated with properties from FW node props. Make this happen by > > > creating a new fwnode_handle flag FWNODE_FLAG_MULTI_LINKED and use > > > the flag to store the multi_link value from intel_link_startup. Use > > > this flag to initialize bus->multi_link. > > > > > > Signed-off-by: Khalid Masum > > > --- > > > I do not think adding a new flag for fwnode_handle is a good idea. > > > So, what would be the best way to initialize bus->multilink with > > > fwnode props? > > > > > > -- Khalid Masum > > > > > > drivers/soundwire/bus.c | 4 ++-- > > > drivers/soundwire/intel.c | 1 + > > > include/linux/fwnode.h | 1 + > > > 3 files changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c > > > index a2bfb0434a67..80df1672c60b 100644 > > > --- a/drivers/soundwire/bus.c > > > +++ b/drivers/soundwire/bus.c > > > @@ -74,9 +74,9 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent, > > > /* > > > * Initialize multi_link flag > > > - * TODO: populate this flag by reading property from FW node > > > */ > > > - bus->multi_link = false; > > > + bus->multi_link = (fwnode->flags & FWNODE_FLAG_MULTI_LINKED) > > > + == FWNODE_FLAG_MULTI_LINKED; I missed that this was an if statement here, please write this to be more obvious and readable. > > > if (bus->ops->read_prop) { > > > ret = bus->ops->read_prop(bus); > > > if (ret < 0) { > > > diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c > > > index 505c5ef061e3..034d1c523ddf 100644 > > > --- a/drivers/soundwire/intel.c > > > +++ b/drivers/soundwire/intel.c > > > @@ -1347,6 +1347,7 @@ int intel_link_startup(struct auxiliary_device *auxdev) > > > */ > > > bus->multi_link = true; > > > bus->hw_sync_min_links = 1; > > > + dev->fwnode->flags |= FWNODE_FLAG_MULTI_LINKED; > > > } > > > /* Initialize shim, controller */ > > > diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h > > > index 9a81c4410b9f..446a52744953 100644 > > > --- a/include/linux/fwnode.h > > > +++ b/include/linux/fwnode.h > > > @@ -32,6 +32,7 @@ struct device; > > > #define FWNODE_FLAG_NOT_DEVICE BIT(1) > > > #define FWNODE_FLAG_INITIALIZED BIT(2) > > > #define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3) > > > +#define FWNODE_FLAG_MULTI_LINKED BIT(4) > > > > What does this commit actually change? > > The new flag will lets us save if the device has multilink in fwnode_handle > whenever needed. > Then for soundwire/intel, save the multi_link flag into fwnode during > startup. > Later at master_add, as written in todo, initialize the multilink flag with > fwnode's flag property. And what does that allow to happen? What changes with all of this? thanks, greg k-h