Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1406152rwb; Sun, 14 Aug 2022 03:08:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HgbinzXR5KRc43+Cz1Sto/RB/Vz89RsQN2k0a/cxKNp/oCkAcoDaxj7Ie3skMHO+/9vep X-Received: by 2002:a17:907:2706:b0:730:95df:66ec with SMTP id w6-20020a170907270600b0073095df66ecmr7620262ejk.260.1660471729073; Sun, 14 Aug 2022 03:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660471729; cv=none; d=google.com; s=arc-20160816; b=PGKNJVP01PUvzQl7umufP3ZXCzQ23PVYcpfBdztHh5UGJpq2koP9kQDruTW3vvMf0J X/CJ7TTDT8Kmbruu8e59fQOGavzcOHPHWLrGPd9CoLYxTC0PgN2JtswCxLu4Mx0tHyzL obcroPI88SzhAi+RPxjkd+hMp4kxvv6z3rWSFoK7Mw5mfQ+phdBFIHGavxt9QWZdceQW 0sVgDW3tBMgColXmBISx3KJgaj9ra+c3y982sGy6YmKBC2uXw6pc4xM2a48/hufhpIrN PBqc3B9iCF+eRG1s2rVjG0Dv8dKQP4lEXRj7IC+wH9xkFtVVeMQGnLHWnk/FUYx0kGQg elbw== 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:feedback-id :dkim-signature:dkim-signature; bh=FdFP/H49+rZQsPEMoSpH1blp96NX4j7NVyCsnlQOwKc=; b=ZsflkvXGHvFHmCrpuKgEAwzkVdY0JwV3WZI7N5Jx2m1BsZIBGCKHroDtO13XwpvZF3 +BqKGJcPq8C+eiZVH6OkrTy2KjJ+3R38VLopzVMPBxuxOMaO8cwepTG5k/48ERw40jkU HSu3VasJ+hRUQOdpFpZ8PObFl8mj0j6sF0z2h1qhJVx9yZ/7y/+Uojxch8evtbwT0J8g xzKU2wfHIUBddsvyUWOJurU8b0aXYXFkMoJ95K+w716beFBddp4DmyKdib2PoAbYGoaT kOOB106QuTp7GMWf7+jkEKH4ovsMlf4zDr2Vr64QrRnoPOYaeGo7O/gUsjUBPdbiY3zq y4qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=qAarWNTR; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WEq9wKKY; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me15-20020a170906aecf00b00732fd5caf3fsi4526008ejb.227.2022.08.14.03.08.21; Sun, 14 Aug 2022 03:08:49 -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=@kroah.com header.s=fm1 header.b=qAarWNTR; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WEq9wKKY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbiHNJpU (ORCPT + 99 others); Sun, 14 Aug 2022 05:45:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiHNJpS (ORCPT ); Sun, 14 Aug 2022 05:45:18 -0400 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97379B19 for ; Sun, 14 Aug 2022 02:45:15 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id A524B2B05FDE; Sun, 14 Aug 2022 05:45:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 14 Aug 2022 05:45:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1660470310; x=1660477510; bh=FdFP/H49+r ZQsPEMoSpH1blp96NX4j7NVyCsnlQOwKc=; b=qAarWNTRnx4c01YwaTDmDon3cT WoeRczFOoEi+9Yn59fFevm4BDrerzL8Qlujy0xfLMkyaoQfIjNfen2HFSFBZFB0Q XNoGICGJC2sUobGRe86muQFZE/cYsqOO0j6IYwB2CS835Qsq6BPjKB+oDCW1JO6C pvpC0Mrw3QJMLQBeUlYwEfqvZK9YB3kuH9EMynjrZLBo/InM0t4Q81pjJHfQ/p5C 0GtZsBGQ50dS2bXKJjx8WZiCTf9hqEWVJ5wm05nZnJc0C5bBQAUdT1VxX2j9oC6q rMDXsGcuxb3sCu+JA4QRd5t25AOxNytA3uK+r1ikFU+3ya5x2lNxSQ3uOUHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660470310; x=1660477510; bh=FdFP/H49+rZQsPEMoSpH1blp96NX 4j7NVyCsnlQOwKc=; b=WEq9wKKYIAAfYldO75VsevXwtHARcaxZHLAmNnNZOXvl wHUSsxEtGpaNN3dcgybyp8V9bC3iR+WQnHsnaCSZtbGUn7WqOOE+y88ew9CrEtx5 KccnnLpEFgx2sZNnrD+2QgNax+OUTUxes3cue/UpBUigm0LVysdKx6b2edhOsgZT mtz4CGcucgfqJpkzKvq1kD0ja/cYYzlwZt12b6/okBLPFIy7Zoi8WEKLybxgSkEn qIF4eT4qV55GGWIEmLBKV3yahBmceZa5NbIFCtOF0zUHfm5JHWY+3COP2i5veLeX /JfYijRGOvc4xZPuEv0vc7RWsguBIkKbVSYcmDGkGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehtddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepheegvd evvdeljeeugfdtudduhfekledtiefhveejkeejuefhtdeufefhgfehkeetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Aug 2022 05:45:09 -0400 (EDT) Date: Sun, 14 Aug 2022 11:45:06 +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: <20220814080416.7531-1-khalid.masum.92@gmail.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 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; > 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? Did you test this on real hardware? thanks, greg k-h