All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [v6,01/12] drivers: base: Unified device connection lookup
Date: Sun, 11 Mar 2018 19:24:18 +0100	[thread overview]
Message-ID: <bddcf7ea-e58c-637a-e546-9978fd2cb540@redhat.com> (raw)

Hi all,

On 09-03-18 18:53, Greg Kroah-Hartman wrote:
> On Fri, Mar 02, 2018 at 11:20:46AM +0100, Hans de Goede wrote:
>> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>
>> Several frameworks - clk, gpio, phy, pmw, etc. - maintain
>> lookup tables for describing connections and provide custom
>> API for handling them. This introduces a single generic
>> lookup table and API for the connections.
>>
>> The motivation for this commit is centralizing the
>> connection lookup, but the goal is to ultimately extract the
>> connection descriptions also from firmware by using the
>> fwnode_graph_* functions and other mechanisms that are
>> available.
>>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Sorry for the delay, just now reviewing this patch...
> 
> The content is fine (if not scary for the obvious reason of passing
> around 'struct device' of different bus types, but ok...), but the api
> naming is "rough":


Heikki, I think it is best if you answer Greg's remarks. FWIW I'm
fine with the changes Greg proposes.

I currently have significantly less bandwidth for this due to
personal circumstances, so if a new version of this patch-set
is necessary it would be great if you (Heikki) can do a v7.

Regards,

Hans

> 
>> --- /dev/null
>> +++ b/include/linux/connection.h
> 
> "connection.h" is vague, why not just put this in device.h? >
>> @@ -0,0 +1,34 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +
>> +#ifndef _LINUX_CONNECTION_H_
>> +#define _LINUX_CONNECTION_H_
>> +
>> +#include <linux/list.h>
>> +
>> +struct device;
>> +
>> +/**
>> + * struct devcon - Device Connection Descriptor
>> + * @endpoint: The names of the two devices connected together
>> + * @id: Unique identifier for the connection
>> + * @list: List head, private for devcon internal use only
>> + */
>> +struct devcon {
> 
> 'struct device_connection'?  Spell it out please, people might think
> this is a "developer conference" :)
> 
>> +	const char		*endpoint[2];
>> +	const char		*id;
>> +	struct list_head	list;
>> +};
>> +
>> +void *__device_find_connection(struct device *dev, const char *con_id,
>> +			       void *data,
>> +			       void *(*match)(struct devcon *con, int ep,
>> +					      void *data));
> 
> Ick, __* functions are usually "no lock needed", but here you are doing
> a lot "more" than the normal device_find_connection() call.  Why not
> make this:
> 	device_connection_find_match()?
> 
>> +
>> +struct device *device_find_connection(struct device *dev, const char *con_id);
> 
> device_connection_find()?
> 
>> +
>> +#define DEVCON(_ep0, _ep1, _id)    (struct devcon) { { _ep0, _ep1 }, _id, }
> 
> Can you use named identifiers here?
> 
>> +
>> +void add_device_connection(struct devcon *con);
>> +void remove_device_connection(struct devcon *con);
> 
> device_connection_add() and device_connection_remove()?
> 
> I can make the api name changes in an add-on patch.
> 
> thanks,
> 
> greg k-h
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v6 01/12] drivers: base: Unified device connection lookup
Date: Sun, 11 Mar 2018 19:24:18 +0100	[thread overview]
Message-ID: <bddcf7ea-e58c-637a-e546-9978fd2cb540@redhat.com> (raw)
In-Reply-To: <20180309175347.GA12150@kroah.com>

Hi all,

On 09-03-18 18:53, Greg Kroah-Hartman wrote:
> On Fri, Mar 02, 2018 at 11:20:46AM +0100, Hans de Goede wrote:
>> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>
>> Several frameworks - clk, gpio, phy, pmw, etc. - maintain
>> lookup tables for describing connections and provide custom
>> API for handling them. This introduces a single generic
>> lookup table and API for the connections.
>>
>> The motivation for this commit is centralizing the
>> connection lookup, but the goal is to ultimately extract the
>> connection descriptions also from firmware by using the
>> fwnode_graph_* functions and other mechanisms that are
>> available.
>>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Sorry for the delay, just now reviewing this patch...
> 
> The content is fine (if not scary for the obvious reason of passing
> around 'struct device' of different bus types, but ok...), but the api
> naming is "rough":


Heikki, I think it is best if you answer Greg's remarks. FWIW I'm
fine with the changes Greg proposes.

I currently have significantly less bandwidth for this due to
personal circumstances, so if a new version of this patch-set
is necessary it would be great if you (Heikki) can do a v7.

Regards,

Hans

> 
>> --- /dev/null
>> +++ b/include/linux/connection.h
> 
> "connection.h" is vague, why not just put this in device.h? >
>> @@ -0,0 +1,34 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +
>> +#ifndef _LINUX_CONNECTION_H_
>> +#define _LINUX_CONNECTION_H_
>> +
>> +#include <linux/list.h>
>> +
>> +struct device;
>> +
>> +/**
>> + * struct devcon - Device Connection Descriptor
>> + * @endpoint: The names of the two devices connected together
>> + * @id: Unique identifier for the connection
>> + * @list: List head, private for devcon internal use only
>> + */
>> +struct devcon {
> 
> 'struct device_connection'?  Spell it out please, people might think
> this is a "developer conference" :)
> 
>> +	const char		*endpoint[2];
>> +	const char		*id;
>> +	struct list_head	list;
>> +};
>> +
>> +void *__device_find_connection(struct device *dev, const char *con_id,
>> +			       void *data,
>> +			       void *(*match)(struct devcon *con, int ep,
>> +					      void *data));
> 
> Ick, __* functions are usually "no lock needed", but here you are doing
> a lot "more" than the normal device_find_connection() call.  Why not
> make this:
> 	device_connection_find_match()?
> 
>> +
>> +struct device *device_find_connection(struct device *dev, const char *con_id);
> 
> device_connection_find()?
> 
>> +
>> +#define DEVCON(_ep0, _ep1, _id)    (struct devcon) { { _ep0, _ep1 }, _id, }
> 
> Can you use named identifiers here?
> 
>> +
>> +void add_device_connection(struct devcon *con);
>> +void remove_device_connection(struct devcon *con);
> 
> device_connection_add() and device_connection_remove()?
> 
> I can make the api name changes in an add-on patch.
> 
> thanks,
> 
> greg k-h
> 

             reply	other threads:[~2018-03-11 18:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 18:24 Hans de Goede [this message]
2018-03-11 18:24 ` [PATCH v6 01/12] drivers: base: Unified device connection lookup Hans de Goede
  -- strict thread matches above, loose matches on Subject: below --
2018-03-12  9:24 [v6,01/12] " Heikki Krogerus
2018-03-12  9:24 ` [PATCH v6 01/12] " Heikki Krogerus
2018-03-12  9:19 [v6,01/12] " Hans de Goede
2018-03-12  9:19 ` [PATCH v6 01/12] " Hans de Goede
2018-03-12  8:13 [v6,01/12] " Heikki Krogerus
2018-03-12  8:13 ` [PATCH v6 01/12] " Heikki Krogerus
2018-03-09 17:53 [v6,01/12] " Greg Kroah-Hartman
2018-03-09 17:53 ` [PATCH v6 01/12] " Greg Kroah-Hartman
2018-03-02 10:20 [v6,12/12] extcon: axp288: Set USB role where necessary Hans de Goede
2018-03-02 10:20 ` [PATCH v6 12/12] " Hans de Goede
2018-03-02 10:20 [v6,11/12] platform/x86: intel_cht_int33fe: Add device connections for the Type-C port Hans de Goede
2018-03-02 10:20 ` [PATCH v6 11/12] " Hans de Goede
2018-03-02 10:20 [v6,10/12] usb: typec: driver for Pericom PI3USB30532 Type-C cross switch Hans de Goede
2018-03-02 10:20 ` [PATCH v6 10/12] " Hans de Goede
2018-03-02 10:20 [v6,09/12] usb: roles: Add Intel xHCI USB role switch driver Hans de Goede
2018-03-02 10:20 ` [PATCH v6 09/12] " Hans de Goede
2018-03-02 10:20 [v6,08/12] xhci: Add Intel extended cap / otg phy mux handling Hans de Goede
2018-03-02 10:20 ` [PATCH v6 08/12] " Hans de Goede
2018-03-02 10:20 [v6,07/12] xhci: Add option to get next extended capability in list by passing id = 0 Hans de Goede
2018-03-02 10:20 ` [PATCH v6 07/12] " Hans de Goede
2018-03-02 10:20 [v6,06/12] usb: typec: tcpm: Use new Type-C switch/mux and usb-role-switch functions Hans de Goede
2018-03-02 10:20 ` [PATCH v6 06/12] " Hans de Goede
2018-03-02 10:20 [v6,05/12] usb: typec: tcpm: Set USB role switch to device mode when configured as such Hans de Goede
2018-03-02 10:20 ` [PATCH v6 05/12] " Hans de Goede
2018-03-02 10:20 [v6,04/12] usb: common: Small class for USB role switches Hans de Goede
2018-03-02 10:20 ` [PATCH v6 04/12] " Hans de Goede
2018-03-02 10:20 [v6,03/12] usb: typec: API for controlling USB Type-C Multiplexers Hans de Goede
2018-03-02 10:20 ` [PATCH v6 03/12] " Hans de Goede
2018-03-02 10:20 [v6,02/12] usb: typec: Start using ERR_PTR Hans de Goede
2018-03-02 10:20 ` [PATCH v6 02/12] " Hans de Goede
2018-03-02 10:20 [v6,01/12] drivers: base: Unified device connection lookup Hans de Goede
2018-03-02 10:20 ` [PATCH v6 01/12] " Hans de Goede
2018-03-02 10:20 [PATCH v6 00/12] USB Type-C device-connection, mux and switch support Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bddcf7ea-e58c-637a-e546-9978fd2cb540@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy@infradead.org \
    --cc=cw00.choi@samsung.com \
    --cc=dvhart@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mathias.nyman@intel.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.