Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756094AbdLVLjx (ORCPT ); Fri, 22 Dec 2017 06:39:53 -0500 Received: from mga01.intel.com ([192.55.52.88]:20615 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756042AbdLVLju (ORCPT ); Fri, 22 Dec 2017 06:39:50 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,440,1508828400"; d="scan'208";a="4561467" Date: Fri, 22 Dec 2017 17:13:44 +0530 From: Vinod Koul To: Greg Kroah-Hartman Cc: ALSA , Charles Keepax , Sudheer Papothi , Takashi , plai@codeaurora.org, LKML , Pierre , patches.audio@intel.com, Mark , srinivas.kandagatla@linaro.org, Sagar Dharia , alan@linux.intel.com Subject: Re: [alsa-devel] [PATCH v5 10/15] soundwire: Add sysfs for SoundWire DisCo properties Message-ID: <20171222114344.GS18649@localhost> References: <1512575231-4154-1-git-send-email-vinod.koul@intel.com> <1512575231-4154-11-git-send-email-vinod.koul@intel.com> <20171213091537.GA6269@kroah.com> <20171213095430.GO18649@localhost> <20171213162821.GB17132@kroah.com> <20171213165246.GQ18649@localhost> <20171213165922.GA6501@kroah.com> <20171222082656.GQ18649@localhost> <20171222083344.GA11307@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171222083344.GA11307@kroah.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2169 Lines: 53 On Fri, Dec 22, 2017 at 09:33:44AM +0100, Greg Kroah-Hartman wrote: > On Fri, Dec 22, 2017 at 01:56:56PM +0530, Vinod Koul wrote: > > Hey Greg, > > > > So I have spent couple of days on this but don't have a solution. > > > > I can create a subdirectory using dynamic attribute group by giving it a > > name. Works as advertised:). But I am unable to create subdirectory under > > newly created subdir. The properties defined by MIPI follow a certain > > hierarchy so we need subdirectories to represent that. > > Yes, you can't create directories 2 levels deep, sorry, didn't realize > you wanted to do that. > > > Second issue am facing with these is getting the sdw_bus context. I tried > > adding it but nothing looks elegant. I tried making sdw_attributes on top of > > struct attribute and pass around the bus but doesn't seem to work for me. > > > > On the contrary, the current design of creating kobjects looked more > > cleaner. It has been used in bunch of other places, I double checked ref > > counting and cleanup looks okay to me. Btw I tested with libudev as well, > > its works well as we do send the event using kobject_uevent(). > > Where has it been used in other parts of the kernel like this? Time to > go yell at people :) > > And the issue isn't that you will not catch the uevent, but that this is > an attribute of the "parent" device, which is now not a device, but a > "raw" kobject on no bus at all. > > So, just create these as real struct devices, with a different "type" > and have them all live on the bus properly. Look at how the greybus > code does it as one example (USB is another one, but it's much more > complex.) Thanks for the quick reply. Are you sure greybus is a right example? Looking at audio_manager.c we seem to create kset thus kobject without a device. It lives off global sysfs! Probing further I think you wanted to point me to gb_interface_create() which I think would be similar to sdw_add_bus_master(). So we should create a device without a driver for this and make kobjects live off it. So IIUC it is okay to create kbojects but make sure we they live with a 'device' right? Thanks -- ~Vinod