lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 May 2020 08:04:43 +0000
From:   "Liao, Bard" <bard.liao@...el.com>
To:     Vinod Koul <vkoul@...nel.org>,
        Bard Liao <yung-chuan.liao@...ux.intel.com>
CC:     "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "tiwai@...e.de" <tiwai@...e.de>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "jank@...ence.com" <jank@...ence.com>,
        "srinivas.kandagatla@...aro.org" <srinivas.kandagatla@...aro.org>,
        "rander.wang@...ux.intel.com" <rander.wang@...ux.intel.com>,
        "ranjani.sridharan@...ux.intel.com" 
        <ranjani.sridharan@...ux.intel.com>,
        "hui.wang@...onical.com" <hui.wang@...onical.com>,
        "pierre-louis.bossart@...ux.intel.com" 
        <pierre-louis.bossart@...ux.intel.com>,
        "Kale, Sanyog R" <sanyog.r.kale@...el.com>,
        "Blauciak, Slawomir" <slawomir.blauciak@...el.com>,
        "Lin, Mengdong" <mengdong.lin@...el.com>
Subject: RE: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support

> -----Original Message-----
> From: Vinod Koul <vkoul@...nel.org>
> Sent: Monday, May 11, 2020 2:32 PM
> To: Bard Liao <yung-chuan.liao@...ux.intel.com>
> Cc: alsa-devel@...a-project.org; linux-kernel@...r.kernel.org; tiwai@...e.de;
> broonie@...nel.org; gregkh@...uxfoundation.org; jank@...ence.com;
> srinivas.kandagatla@...aro.org; rander.wang@...ux.intel.com;
> ranjani.sridharan@...ux.intel.com; hui.wang@...onical.com; pierre-
> louis.bossart@...ux.intel.com; Kale, Sanyog R <sanyog.r.kale@...el.com>;
> Blauciak, Slawomir <slawomir.blauciak@...el.com>; Lin, Mengdong
> <mengdong.lin@...el.com>; Liao, Bard <bard.liao@...el.com>
> Subject: Re: [PATCH 3/3] soundwire: bus_type: add sdw_master_device support
> 
> On 30-04-20, 02:51, Bard Liao wrote:
> > @@ -24,9 +24,14 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct
> device *parent,
> >  	struct sdw_master_prop *prop = NULL;
> >  	int ret;
> >
> > -	if (!bus->dev) {
> > -		pr_err("SoundWire bus has no device\n");
> > -		return -ENODEV;
> 
> This check is removed and not moved into sdw_master_device_add() either, can
> you add here or in patch 1 and keep checking the parent device please

We will set bus->dev = &md->dev in the end of sdw_master_device_add().
That's why we remove the test. But now I am wandering does it make sense
to set bus->dev = &md->dev? Maybe it makes more sense to set bus->dev =
sdw control device. 
A follow up question is that should slave device a child of bus device or
master device? I would prefer bus device if it makes sense. 
I will check bus->dev and parent and remove bus->dev = &md->dev in the
next version.


> 
> > +int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
> > +			  struct fwnode_handle *fwnode)
> > +{
> > +	struct sdw_master_device *md;
> > +	int ret;
> > +
> > +	if (!bus)
> > +		return -EINVAL;
> > +
> > +	/*
> > +	 * Unlike traditional devices, there's no allocation here since the
> > +	 * sdw_master_device is embedded in the bus structure.
> > +	 */
> 
> Looking at this and empty sdw_master_device_release() above, makes me
> wonder if it is a wise move? Should we rather allocate the
> sdw_master_device() and then free that up in sdw_master_device_release() or it
> is really overkill given that this is called when we remove the sdw_bus instance
> as well...

Yes, I will allocate sdw_master_device here and free it in
sdw_master_device_release().

> 
> > +	md = &bus->md;
> > +	md->dev.bus = &sdw_bus_type;
> > +	md->dev.type = &sdw_master_type;
> > +	md->dev.parent = parent;
> > +	md->dev.of_node = parent->of_node;
> > +	md->dev.fwnode = fwnode;
> > +	md->dev.dma_mask = parent->dma_mask;
> > +
> > +	dev_set_name(&md->dev, "sdw-master-%d", bus->link_id);
> 
> This give nice sdw-master-0. In DT this comes from reg property. I dont seem to
> recall if the ACPI/Disco spec treats link_id as unique across the system, can you
> check that please, if not we would need to update this.

Sure, I will check it.

> 
> --
> ~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ