devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fsi: add property to avoid scanning at boot
@ 2018-01-30  5:51 Joel Stanley
       [not found] ` <20180130055116.17411-1-joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
  2018-01-30  5:51 ` [PATCH 2/2] fsi: core: Add check for master " Joel Stanley
  0 siblings, 2 replies; 5+ messages in thread
From: Joel Stanley @ 2018-01-30  5:51 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, devicetree
  Cc: Jeremy Kerr, Christopher Bostic, Eddie James, linux-kernel

These two patches from Chris add an optional property that says the
FSI attached hardware cannot cope with being probed unless the state of
that hardware is known.

This allows the driver to eg. defer to userspace which can make this
decision.

I am collecting patches for a FSI tree to send to Greg, so I am just after
review from the device tree people.

Christopher Bostic (2):
  dt-bindings: fsi: Add optional property no-scan-on-init
  fsi: core: Add check for master property no-scan-on-init

 Documentation/devicetree/bindings/fsi/fsi.txt | 7 +++++++
 drivers/fsi/fsi-core.c                        | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] dt-bindings: fsi: Add optional property no-scan-on-init
       [not found] ` <20180130055116.17411-1-joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
@ 2018-01-30  5:51   ` Joel Stanley
  2018-02-05  6:07     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Stanley @ 2018-01-30  5:51 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Christopher Bostic, Jeremy Kerr, Eddie James,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Christopher Bostic <cbostic-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

Add an optional FSI master property 'no-scan-on-init.  This
can be specified to indicate that a master should not be
automatically scanned at init time.  This is required in cases
where a scan could interfere with another FSI master on the same
bus.

Signed-off-by: Christopher Bostic <cbostic-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Acked-by: Jeremy Kerr <jk-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>
Signed-off-by: Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
---
 Documentation/devicetree/bindings/fsi/fsi.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/fsi/fsi.txt b/Documentation/devicetree/bindings/fsi/fsi.txt
index 4eaf488d4015..ab516c673a4b 100644
--- a/Documentation/devicetree/bindings/fsi/fsi.txt
+++ b/Documentation/devicetree/bindings/fsi/fsi.txt
@@ -56,6 +56,13 @@ addresses (link index and slave ID), and no size:
     #address-cells = <2>;
     #size-cells = <0>;
 
+An optional boolean property can be added to indicate that a particular master
+should not scan for connected devices at initialization time.  This is
+necessary in cases where a scan could cause arbitration issues with other
+masters that may be present on the bus.
+
+    no-scan-on-init;
+
 FSI slaves
 ----------
 
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] fsi: core: Add check for master property no-scan-on-init
  2018-01-30  5:51 [PATCH 0/2] fsi: add property to avoid scanning at boot Joel Stanley
       [not found] ` <20180130055116.17411-1-joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
@ 2018-01-30  5:51 ` Joel Stanley
  1 sibling, 0 replies; 5+ messages in thread
From: Joel Stanley @ 2018-01-30  5:51 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, devicetree
  Cc: Christopher Bostic, Jeremy Kerr, Eddie James, linux-kernel

From: Christopher Bostic <cbostic@linux.vnet.ibm.com>

Prior to scanning a master check if the optional property
no-scan-on-init is present.  If it is then avoid scanning.  This is
necessary in cases where a master scan could interfere with another
FSI master on the same bus.

Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 drivers/fsi/fsi-core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 8d8b25809452..4c03d6933646 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -901,6 +901,7 @@ static DEVICE_ATTR(break, 0200, NULL, master_break_store);
 int fsi_master_register(struct fsi_master *master)
 {
 	int rc;
+	struct device_node *np;
 
 	if (!master)
 		return -EINVAL;
@@ -928,7 +929,9 @@ int fsi_master_register(struct fsi_master *master)
 		return rc;
 	}
 
-	fsi_master_scan(master);
+	np = dev_of_node(&master->dev);
+	if (!of_property_read_bool(np, "no-scan-on-init"))
+		fsi_master_scan(master);
 
 	return 0;
 }
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: fsi: Add optional property no-scan-on-init
  2018-01-30  5:51   ` [PATCH 1/2] dt-bindings: fsi: Add optional property no-scan-on-init Joel Stanley
@ 2018-02-05  6:07     ` Rob Herring
  2018-02-05  6:08       ` Joel Stanley
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2018-02-05  6:07 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Mark Rutland, devicetree, Christopher Bostic, Jeremy Kerr,
	Eddie James, linux-kernel

On Tue, Jan 30, 2018 at 04:21:15PM +1030, Joel Stanley wrote:
> From: Christopher Bostic <cbostic@linux.vnet.ibm.com>
> 
> Add an optional FSI master property 'no-scan-on-init.  This
> can be specified to indicate that a master should not be
> automatically scanned at init time.  This is required in cases
> where a scan could interfere with another FSI master on the same
> bus.
> 
> Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
> Acked-by: Jeremy Kerr <jk@ozlabs.org>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>  Documentation/devicetree/bindings/fsi/fsi.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/fsi/fsi.txt b/Documentation/devicetree/bindings/fsi/fsi.txt
> index 4eaf488d4015..ab516c673a4b 100644
> --- a/Documentation/devicetree/bindings/fsi/fsi.txt
> +++ b/Documentation/devicetree/bindings/fsi/fsi.txt
> @@ -56,6 +56,13 @@ addresses (link index and slave ID), and no size:
>      #address-cells = <2>;
>      #size-cells = <0>;
>  
> +An optional boolean property can be added to indicate that a particular master
> +should not scan for connected devices at initialization time.  This is
> +necessary in cases where a scan could cause arbitration issues with other
> +masters that may be present on the bus.
> +
> +    no-scan-on-init;
> +

The formatting here is a bit strange compared to most bindings, but no 
point in reformatting the document to add one property.

Reviewed-by: Rob Herring <robh@kernel.org>

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: fsi: Add optional property no-scan-on-init
  2018-02-05  6:07     ` Rob Herring
@ 2018-02-05  6:08       ` Joel Stanley
  0 siblings, 0 replies; 5+ messages in thread
From: Joel Stanley @ 2018-02-05  6:08 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Rutland, devicetree, Christopher Bostic, Jeremy Kerr,
	Eddie James, Linux Kernel Mailing List

On Mon, Feb 5, 2018 at 4:37 PM, Rob Herring <robh@kernel.org> wrote:
> On Tue, Jan 30, 2018 at 04:21:15PM +1030, Joel Stanley wrote:
>> From: Christopher Bostic <cbostic@linux.vnet.ibm.com>
>>
>> Add an optional FSI master property 'no-scan-on-init.  This
>> can be specified to indicate that a master should not be
>> automatically scanned at init time.  This is required in cases
>> where a scan could interfere with another FSI master on the same
>> bus.
>>
>> Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
>> Acked-by: Jeremy Kerr <jk@ozlabs.org>
>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>> ---
>>  Documentation/devicetree/bindings/fsi/fsi.txt | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/fsi/fsi.txt b/Documentation/devicetree/bindings/fsi/fsi.txt
>> index 4eaf488d4015..ab516c673a4b 100644
>> --- a/Documentation/devicetree/bindings/fsi/fsi.txt
>> +++ b/Documentation/devicetree/bindings/fsi/fsi.txt
>> @@ -56,6 +56,13 @@ addresses (link index and slave ID), and no size:
>>      #address-cells = <2>;
>>      #size-cells = <0>;
>>
>> +An optional boolean property can be added to indicate that a particular master
>> +should not scan for connected devices at initialization time.  This is
>> +necessary in cases where a scan could cause arbitration issues with other
>> +masters that may be present on the bus.
>> +
>> +    no-scan-on-init;
>> +
>
> The formatting here is a bit strange compared to most bindings, but no
> point in reformatting the document to add one property.

I'll keep that in mind next time we're working in this area.

Thanks Rob.

>
> Reviewed-by: Rob Herring <robh@kernel.org>
>
> Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-05  6:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30  5:51 [PATCH 0/2] fsi: add property to avoid scanning at boot Joel Stanley
     [not found] ` <20180130055116.17411-1-joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>
2018-01-30  5:51   ` [PATCH 1/2] dt-bindings: fsi: Add optional property no-scan-on-init Joel Stanley
2018-02-05  6:07     ` Rob Herring
2018-02-05  6:08       ` Joel Stanley
2018-01-30  5:51 ` [PATCH 2/2] fsi: core: Add check for master " Joel Stanley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).