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:   Fri, 13 Dec 2019 09:11:27 -0600
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        tiwai@...e.de, broonie@...nel.org, vkoul@...nel.org,
        jank@...ence.com, srinivas.kandagatla@...aro.org,
        slawomir.blauciak@...el.com,
        Bard liao <yung-chuan.liao@...ux.intel.com>,
        Rander Wang <rander.wang@...ux.intel.com>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
        Sanyog Kale <sanyog.r.kale@...el.com>
Subject: Re: [alsa-devel] [PATCH v4 07/15] soundwire: slave: move uevent
 handling to slave

On 12/13/19 1:22 AM, Greg KH wrote:
> On Thu, Dec 12, 2019 at 11:04:01PM -0600, Pierre-Louis Bossart wrote:
>> Currently the code deals with uevents at the bus level, but we only care
>> for Slave events
> 
> What does this mean?  I can't understand it, can you please provide more
> information on what you are doing here?

In the earlier versions of the patch, the code looks like this and there 
was an open on what to do with a master-specific event.

  static int sdw_uevent(struct device *dev, struct kobj_uevent_env *env)
  {
+	struct sdw_master_device *md;
  	struct sdw_slave *slave;
  	char modalias[32];

-	if (is_sdw_slave(dev)) {
+	if (is_sdw_md(dev)) {
+		md = to_sdw_master_device(dev);
+		/* TODO: do we need to call add_uevent_var() ? */
+	} else if (is_sdw_slave(dev)) {
  		slave = to_sdw_slave_device(dev);
+
+		sdw_slave_modalias(slave, modalias, sizeof(modalias));
+
+		if (add_uevent_var(env, "MODALIAS=%s", modalias))
+			return -ENOMEM;
  	} else {
  		dev_warn(dev, "uevent for unknown Soundwire type\n");
  		return -EINVAL;
  	}

Vinod suggested this was not needed and suggested the code for uevents 
be moved to be slave-specific, which is what this patch does.
>> diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
>> index c87267f12a3b..014c3ece1f17 100644
>> --- a/drivers/soundwire/slave.c
>> +++ b/drivers/soundwire/slave.c
>> @@ -17,6 +17,7 @@ static void sdw_slave_release(struct device *dev)
>>   struct device_type sdw_slave_type = {
>>   	.name =		"sdw_slave",
>>   	.release =	sdw_slave_release,
>> +	.uevent = sdw_uevent,
> 
> Align this with the other ones?
> 
> does this cause any different functionality?

As mentioned above, this move was suggested by Vinod. I don't have a 
specific need for uevents for the master and there's no functionality 
limitation, that said this is way beyond my comfort zone so I will 
follow recommendations, if any.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ