All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Butler <marc@plastictigers.com>
To: Sagar Dharia <sdharia@codeaurora.org>
Cc: ohad@wizery.com, rusty@rustcorp.com.au, rob@landley.net,
	joerg.roedel@amd.com, linux-doc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	linux-arm-msm@vger.kernel.org, linus.walleij@linaro.org,
	broonie@opensource.wolfsonmicro.com, bryanh@codeaurora.org,
	rob.herring@calxeda.com, linux-kernel@vger.kernel.org,
	grant.likely@secretlab.ca, kheitke@codeaurora.org,
	ak@linux.intel.com, gclemson@audience.com,
	gregkh@linuxfoundation.org, davidb@codeaurora.org, trenn@suse.de,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] slimbus: Linux driver framework for SLIMbus.
Date: Thu, 31 May 2012 20:16:17 -0400	[thread overview]
Message-ID: <20120601001617.GA16311@plastictigers.com> (raw)
In-Reply-To: <1338340310-4473-1-git-send-email-sdharia@codeaurora.org>

On Tue, May 29, 2012 at 07:11:33PM -0600, Sagar Dharia wrote:
> SLIMbus (Serial Low Power Interchip Media Bus) is a specification
> developed by MIPI (Mobile Industry Processor Interface) alliance.

These are initial comments. A full review of the patch will take some
time. While I am posting this email, this is the result of work both
by myself, and my colleague Greg Clemson (cc'ed).

1. enum slim_ch_proto

The enumeration slim_ch_proto is incorrect. It declares 2 transport
protocols which do not exist in the specification: SLIM_HARD_ISO;
SLIM_AUTO_ISO.

This in turn causes the subsequent values for the other protocols such
as SLIM_PUSH, to be incorrectly coded in the NEXT_DEFINE_CHANNEL
message generated in slim_reconfigure_now(). That is the push protocol
is incorrectly encoded as 3 instead of 2 as per the specification
(Table 47).

I believe a correct definition would be:

enum slim_ch_proto {
        SLIM_ISO,
	SLIM_PUSH,
	SLIM_PULL,
	SLIM_LOCKED,
	SLIM_ASYNC_SMPLX,
	SLIM_ASYNC_HALF_DUP,
	SLIM_EXT_SMPLX,
	SLIM_EXT_HALF_DUP,
	SLIM_USER_DEF1 = 14,
	SLIM_USER_DEF2 = 15
};

However doing so will break the logic in slim_nextdefine_ch().

2. Use of the term elemental address.

Commentary around the use of struct slim_eaddr uses the term
"elemental address". However, the term used in the specification is
"enumeration address". There is no elemental address in the
specification, and using this term may result confusion when referring
to accessing the information and value elements.

I suggest that term "enumeration address" should be used. 

3. Probing sequence for drivers.

The current probing sequence for drivers appears to make some
assumptions, that are problematic.

a) The code assumes that when the controller is registered the bus is
operational (booted). No allowance is made for any problems the active
framer may have synchronizing the bus. 

The drivers really should not be probed until the bus has at least
booted. This can be worked around by only registering the controller
after it has booted the bus. This should be noted in the comments.

b) Similarly to (a) the driver may be probed before the device has
been given a logical address (LA). This makes sense in the case of
driver that turns on the device (say via gpio) once the bus has
booted. However, the driver then needs to sit and poll
slim_get_logical_addr() until the logical address.

A possible alternate solution would be to add a parameter to probe:

enum slim_dev_status {
        SLIM_BUS_READY,
	SLIM_DEV_READY
};

int (*probe)(struct slim_device *sldev, enum slim_dev_status status);

Where SLIM_BUS_READY == bus has booted, and SLIM_DEV_READY == device
has been assigned its logical address.

Alternatively you could have 2 separate probe type callbacks. 

This would make the driver logical simpler.

WARNING: multiple messages have this Message-ID (diff)
From: marc@plastictigers.com (Marc Butler)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] slimbus: Linux driver framework for SLIMbus.
Date: Thu, 31 May 2012 20:16:17 -0400	[thread overview]
Message-ID: <20120601001617.GA16311@plastictigers.com> (raw)
In-Reply-To: <1338340310-4473-1-git-send-email-sdharia@codeaurora.org>

On Tue, May 29, 2012 at 07:11:33PM -0600, Sagar Dharia wrote:
> SLIMbus (Serial Low Power Interchip Media Bus) is a specification
> developed by MIPI (Mobile Industry Processor Interface) alliance.

These are initial comments. A full review of the patch will take some
time. While I am posting this email, this is the result of work both
by myself, and my colleague Greg Clemson (cc'ed).

1. enum slim_ch_proto

The enumeration slim_ch_proto is incorrect. It declares 2 transport
protocols which do not exist in the specification: SLIM_HARD_ISO;
SLIM_AUTO_ISO.

This in turn causes the subsequent values for the other protocols such
as SLIM_PUSH, to be incorrectly coded in the NEXT_DEFINE_CHANNEL
message generated in slim_reconfigure_now(). That is the push protocol
is incorrectly encoded as 3 instead of 2 as per the specification
(Table 47).

I believe a correct definition would be:

enum slim_ch_proto {
        SLIM_ISO,
	SLIM_PUSH,
	SLIM_PULL,
	SLIM_LOCKED,
	SLIM_ASYNC_SMPLX,
	SLIM_ASYNC_HALF_DUP,
	SLIM_EXT_SMPLX,
	SLIM_EXT_HALF_DUP,
	SLIM_USER_DEF1 = 14,
	SLIM_USER_DEF2 = 15
};

However doing so will break the logic in slim_nextdefine_ch().

2. Use of the term elemental address.

Commentary around the use of struct slim_eaddr uses the term
"elemental address". However, the term used in the specification is
"enumeration address". There is no elemental address in the
specification, and using this term may result confusion when referring
to accessing the information and value elements.

I suggest that term "enumeration address" should be used. 

3. Probing sequence for drivers.

The current probing sequence for drivers appears to make some
assumptions, that are problematic.

a) The code assumes that when the controller is registered the bus is
operational (booted). No allowance is made for any problems the active
framer may have synchronizing the bus. 

The drivers really should not be probed until the bus has at least
booted. This can be worked around by only registering the controller
after it has booted the bus. This should be noted in the comments.

b) Similarly to (a) the driver may be probed before the device has
been given a logical address (LA). This makes sense in the case of
driver that turns on the device (say via gpio) once the bus has
booted. However, the driver then needs to sit and poll
slim_get_logical_addr() until the logical address.

A possible alternate solution would be to add a parameter to probe:

enum slim_dev_status {
        SLIM_BUS_READY,
	SLIM_DEV_READY
};

int (*probe)(struct slim_device *sldev, enum slim_dev_status status);

Where SLIM_BUS_READY == bus has booted, and SLIM_DEV_READY == device
has been assigned its logical address.

Alternatively you could have 2 separate probe type callbacks. 

This would make the driver logical simpler.

WARNING: multiple messages have this Message-ID (diff)
From: Marc Butler <marc@plastictigers.com>
To: Sagar Dharia <sdharia@codeaurora.org>
Cc: davidb@codeaurora.org, bryanh@codeaurora.org,
	kheitke@codeaurora.org, gclemson@audience.com,
	broonie@opensource.wolfsonmicro.com,
	linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, rob@landley.net,
	grant.likely@secretlab.ca, rob.herring@calxeda.com,
	ohad@wizery.com, gregkh@linuxfoundation.org,
	linus.walleij@linaro.org, rusty@rustcorp.com.au,
	joerg.roedel@amd.com, trenn@suse.de, ak@linux.intel.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] slimbus: Linux driver framework for SLIMbus.
Date: Thu, 31 May 2012 20:16:17 -0400	[thread overview]
Message-ID: <20120601001617.GA16311@plastictigers.com> (raw)
In-Reply-To: <1338340310-4473-1-git-send-email-sdharia@codeaurora.org>

On Tue, May 29, 2012 at 07:11:33PM -0600, Sagar Dharia wrote:
> SLIMbus (Serial Low Power Interchip Media Bus) is a specification
> developed by MIPI (Mobile Industry Processor Interface) alliance.

These are initial comments. A full review of the patch will take some
time. While I am posting this email, this is the result of work both
by myself, and my colleague Greg Clemson (cc'ed).

1. enum slim_ch_proto

The enumeration slim_ch_proto is incorrect. It declares 2 transport
protocols which do not exist in the specification: SLIM_HARD_ISO;
SLIM_AUTO_ISO.

This in turn causes the subsequent values for the other protocols such
as SLIM_PUSH, to be incorrectly coded in the NEXT_DEFINE_CHANNEL
message generated in slim_reconfigure_now(). That is the push protocol
is incorrectly encoded as 3 instead of 2 as per the specification
(Table 47).

I believe a correct definition would be:

enum slim_ch_proto {
        SLIM_ISO,
	SLIM_PUSH,
	SLIM_PULL,
	SLIM_LOCKED,
	SLIM_ASYNC_SMPLX,
	SLIM_ASYNC_HALF_DUP,
	SLIM_EXT_SMPLX,
	SLIM_EXT_HALF_DUP,
	SLIM_USER_DEF1 = 14,
	SLIM_USER_DEF2 = 15
};

However doing so will break the logic in slim_nextdefine_ch().

2. Use of the term elemental address.

Commentary around the use of struct slim_eaddr uses the term
"elemental address". However, the term used in the specification is
"enumeration address". There is no elemental address in the
specification, and using this term may result confusion when referring
to accessing the information and value elements.

I suggest that term "enumeration address" should be used. 

3. Probing sequence for drivers.

The current probing sequence for drivers appears to make some
assumptions, that are problematic.

a) The code assumes that when the controller is registered the bus is
operational (booted). No allowance is made for any problems the active
framer may have synchronizing the bus. 

The drivers really should not be probed until the bus has at least
booted. This can be worked around by only registering the controller
after it has booted the bus. This should be noted in the comments.

b) Similarly to (a) the driver may be probed before the device has
been given a logical address (LA). This makes sense in the case of
driver that turns on the device (say via gpio) once the bus has
booted. However, the driver then needs to sit and poll
slim_get_logical_addr() until the logical address.

A possible alternate solution would be to add a parameter to probe:

enum slim_dev_status {
        SLIM_BUS_READY,
	SLIM_DEV_READY
};

int (*probe)(struct slim_device *sldev, enum slim_dev_status status);

Where SLIM_BUS_READY == bus has booted, and SLIM_DEV_READY == device
has been assigned its logical address.

Alternatively you could have 2 separate probe type callbacks. 

This would make the driver logical simpler.


  parent reply	other threads:[~2012-06-01  0:16 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  1:11 [PATCH] slimbus: Linux driver framework for SLIMbus Sagar Dharia
2012-05-30  1:11 ` Sagar Dharia
2012-05-30 18:13 ` Mark Brown
2012-05-30 18:13   ` Mark Brown
2012-06-04  9:54   ` Sagar Dharia
2012-06-04  9:54     ` Sagar Dharia
2012-06-01  0:16 ` Marc Butler [this message]
2012-06-01  0:16   ` Marc Butler
2012-06-01  0:16   ` Marc Butler
2012-06-04 10:21   ` Sagar Dharia
2012-06-04 10:21     ` Sagar Dharia
2012-06-04 10:27     ` Mark Brown
2012-06-04 10:27       ` Mark Brown
2012-06-04 10:36       ` Sagar Dharia
2012-06-04 10:36         ` Sagar Dharia
2012-06-04 10:42         ` Mark Brown
2012-06-04 10:42           ` Mark Brown
2012-06-04 17:13     ` Marc Butler
2012-06-04 17:13       ` Marc Butler
2012-06-06  8:13       ` Sagar Dharia
2012-06-06  8:13         ` Sagar Dharia
     [not found] ` <1338340310-4473-1-git-send-email-sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2012-06-03 16:34   ` Joe Perches
2012-06-03 16:34     ` Joe Perches
2012-06-03 16:34     ` Joe Perches
2012-06-04 10:25     ` Sagar Dharia
2012-06-04 10:25       ` Sagar Dharia
2012-06-04  3:14 ` Rob Landley
2012-06-04  3:14   ` Rob Landley
2012-06-04  7:29   ` Mark Brown
2012-06-04  7:29     ` Mark Brown
2012-06-04  9:51   ` Sagar Dharia
2012-06-04  9:51     ` Sagar Dharia
2012-06-04 23:41 ` Ryan Mallon
2012-06-04 23:41   ` Ryan Mallon
2012-06-06  8:19   ` Sagar Dharia
2012-06-06  8:19     ` Sagar Dharia
2012-06-05 20:57 ` Marc Butler
2012-06-05 20:57   ` Marc Butler

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=20120601001617.GA16311@plastictigers.com \
    --to=marc@plastictigers.com \
    --cc=ak@linux.intel.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=gclemson@audience.com \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=kheitke@codeaurora.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=rusty@rustcorp.com.au \
    --cc=sdharia@codeaurora.org \
    --cc=trenn@suse.de \
    /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.