linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] VSP-Tests: unbind:
@ 2020-09-18 20:26 Kieran Bingham
  2020-09-18 20:26 ` [PATCH 1/3] scripts: vsp-lib.sh: Remove unused variable Kieran Bingham
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kieran Bingham @ 2020-09-18 20:26 UTC (permalink / raw)
  To: Laurent Pinchart, linux-renesas-soc; +Cc: Kieran Bingham

The VSP unbind test recently added causes an issue when the VSP utilised
by the DU is unbound and rebound.

That needs to be fixed, but will be handled separately - so we limit the
scope to allow running the remaining tests for now.

As the unbind test requires root to run, skip it if it's run by a normal
user, and while were here - remove an unused variable identified during
the creation of these patches.

Kieran Bingham (3):
  scripts: vsp-lib.sh: Remove unused variable
  tests: Skip unbind/bind tests when not root
  tests: unbind/bind: Only test non display VSPs

 scripts/vsp-lib.sh          |  2 --
 tests/vsp-unit-test-0026.sh | 17 +++++++++++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

-- 
2.25.1


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

* [PATCH 1/3] scripts: vsp-lib.sh: Remove unused variable
  2020-09-18 20:26 [PATCH 0/3] VSP-Tests: unbind: Kieran Bingham
@ 2020-09-18 20:26 ` Kieran Bingham
  2020-09-18 20:26 ` [PATCH 2/3] tests: Skip unbind/bind tests when not root Kieran Bingham
  2020-09-18 20:26 ` [PATCH 3/3] tests: unbind/bind: Only test non display VSPs Kieran Bingham
  2 siblings, 0 replies; 7+ messages in thread
From: Kieran Bingham @ 2020-09-18 20:26 UTC (permalink / raw)
  To: Laurent Pinchart, linux-renesas-soc; +Cc: Kieran Bingham

The dev identifier is not used until after a media device has been
selected, at which point the vsp1_device function is re-called.

Remove the redundant assignment.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 scripts/vsp-lib.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh
index a8898e80a879..04a8127f6073 100755
--- a/scripts/vsp-lib.sh
+++ b/scripts/vsp-lib.sh
@@ -1040,8 +1040,6 @@ test_init() {
 	local best_mdev=
 
 	for mdev in /dev/media* ; do
-		dev=$(vsp1_device $mdev)
-
 		local match='true'
 		for feature in $features ; do
 			$(vsp1_has_feature "$feature") || {
-- 
2.25.1


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

* [PATCH 2/3] tests: Skip unbind/bind tests when not root
  2020-09-18 20:26 [PATCH 0/3] VSP-Tests: unbind: Kieran Bingham
  2020-09-18 20:26 ` [PATCH 1/3] scripts: vsp-lib.sh: Remove unused variable Kieran Bingham
@ 2020-09-18 20:26 ` Kieran Bingham
  2020-09-18 20:45   ` Kieran Bingham
  2020-09-18 20:52   ` [PATCH v2] " Kieran Bingham
  2020-09-18 20:26 ` [PATCH 3/3] tests: unbind/bind: Only test non display VSPs Kieran Bingham
  2 siblings, 2 replies; 7+ messages in thread
From: Kieran Bingham @ 2020-09-18 20:26 UTC (permalink / raw)
  To: Laurent Pinchart, linux-renesas-soc; +Cc: Kieran Bingham

The user must be root to be able to perform the unbind/bind cycle.
Skip this test when the user does not have root privilidges.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 tests/vsp-unit-test-0026.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
index 0e013cec881b..88038f3fdebf 100755
--- a/tests/vsp-unit-test-0026.sh
+++ b/tests/vsp-unit-test-0026.sh
@@ -41,6 +41,12 @@ test_copy() {
 test_main() {
 	local format
 
+	if [ ! "$(id -u)" = 0 ] ; then
+		# Root is required to run unbind tests
+		test_complete skip
+		return
+	fi
+
 	# Unbind and rebind VSPs individually
 	for v in $vsps; do
 		unbind_vsp $v
-- 
2.25.1


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

* [PATCH 3/3] tests: unbind/bind: Only test non display VSPs
  2020-09-18 20:26 [PATCH 0/3] VSP-Tests: unbind: Kieran Bingham
  2020-09-18 20:26 ` [PATCH 1/3] scripts: vsp-lib.sh: Remove unused variable Kieran Bingham
  2020-09-18 20:26 ` [PATCH 2/3] tests: Skip unbind/bind tests when not root Kieran Bingham
@ 2020-09-18 20:26 ` Kieran Bingham
  2020-09-19  8:38   ` Sergei Shtylyov
  2 siblings, 1 reply; 7+ messages in thread
From: Kieran Bingham @ 2020-09-18 20:26 UTC (permalink / raw)
  To: Laurent Pinchart, linux-renesas-soc; +Cc: Kieran Bingham

Only perform bind/unbind testing on VSPs which expose a media-device.
Unbinding a VSP which is connected to a DU causes the display pipeline
to fail, and is not currently supported.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 tests/vsp-unit-test-0026.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
index 88038f3fdebf..4185bb23d05b 100755
--- a/tests/vsp-unit-test-0026.sh
+++ b/tests/vsp-unit-test-0026.sh
@@ -10,7 +10,14 @@
 features="rpf.0 wpf.0"
 
 vsp1_driver=/sys/bus/platform/drivers/vsp1
-vsps=$(cd /sys/bus/platform/devices/; ls | grep vsp)
+
+# List all VSPs with a media device.
+# This exludes VSP devices used by the DU.
+list_vsps() {
+	for mdev in /dev/media* ; do
+		echo -n $(vsp1_device $mdev) | grep vsp
+	done
+}
 
 unbind_vsp() {
 	echo $1 > $vsp1_driver/unbind
@@ -48,7 +55,7 @@ test_main() {
 	fi
 
 	# Unbind and rebind VSPs individually
-	for v in $vsps; do
+	for v in $(list_vsps); do
 		unbind_vsp $v
 		bind_vsp $v
 	done
-- 
2.25.1


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

* Re: [PATCH 2/3] tests: Skip unbind/bind tests when not root
  2020-09-18 20:26 ` [PATCH 2/3] tests: Skip unbind/bind tests when not root Kieran Bingham
@ 2020-09-18 20:45   ` Kieran Bingham
  2020-09-18 20:52   ` [PATCH v2] " Kieran Bingham
  1 sibling, 0 replies; 7+ messages in thread
From: Kieran Bingham @ 2020-09-18 20:45 UTC (permalink / raw)
  To: Laurent Pinchart, linux-renesas-soc

Hi Kieran

On 18/09/2020 21:26, Kieran Bingham wrote:
> The user must be root to be able to perform the unbind/bind cycle.
> Skip this test when the user does not have root privilidges.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  tests/vsp-unit-test-0026.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
> index 0e013cec881b..88038f3fdebf 100755
> --- a/tests/vsp-unit-test-0026.sh
> +++ b/tests/vsp-unit-test-0026.sh
> @@ -41,6 +41,12 @@ test_copy() {
>  test_main() {
>  	local format
>  
> +	if [ ! "$(id -u)" = 0 ] ; then
> +		# Root is required to run unbind tests
> +		test_complete skip

Ugh, this is a bit annoying as it generates a warning on the output
actually, as we haven't yet called test_start.

We could do a test_start "Rebinding VSPs", and then it will either skip
or pass. But any failures would be in the kernel logs...

> +		return
> +	fi
> +
>  	# Unbind and rebind VSPs individually
>  	for v in $vsps; do
>  		unbind_vsp $v
> 

-- 
Regards
--
Kieran

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

* [PATCH v2] tests: Skip unbind/bind tests when not root
  2020-09-18 20:26 ` [PATCH 2/3] tests: Skip unbind/bind tests when not root Kieran Bingham
  2020-09-18 20:45   ` Kieran Bingham
@ 2020-09-18 20:52   ` Kieran Bingham
  1 sibling, 0 replies; 7+ messages in thread
From: Kieran Bingham @ 2020-09-18 20:52 UTC (permalink / raw)
  To: Laurent Pinchart, linux-renesas-soc; +Cc: Kieran Bingham

The user must be root to be able to perform the unbind/bind cycle.
Skip this test when the user does not have root privilidges.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
v2:
 - Provide a test_start to match the test_complete operations.


 tests/vsp-unit-test-0026.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
index 0e013cec881b..391986e77336 100755
--- a/tests/vsp-unit-test-0026.sh
+++ b/tests/vsp-unit-test-0026.sh
@@ -41,12 +41,23 @@ test_copy() {
 test_main() {
 	local format
 
+	test_start "rebinding VSPs"
+
+	if [ ! "$(id -u)" = 0 ] ; then
+		# Root is required to run unbind tests
+		test_complete skip
+		return
+	fi
+
 	# Unbind and rebind VSPs individually
 	for v in $vsps; do
 		unbind_vsp $v
 		bind_vsp $v
 	done
 
+	# The test passes if the kernel doesn't crash
+	test_complete pass
+
 	# Perform a simple copy test to validate HW is alive
 	test_copy RGB24 128x128
 }
-- 
2.25.1


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

* Re: [PATCH 3/3] tests: unbind/bind: Only test non display VSPs
  2020-09-18 20:26 ` [PATCH 3/3] tests: unbind/bind: Only test non display VSPs Kieran Bingham
@ 2020-09-19  8:38   ` Sergei Shtylyov
  0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2020-09-19  8:38 UTC (permalink / raw)
  To: Kieran Bingham, Laurent Pinchart, linux-renesas-soc

Hello!

On 18.09.2020 23:26, Kieran Bingham wrote:

> Only perform bind/unbind testing on VSPs which expose a media-device.
> Unbinding a VSP which is connected to a DU causes the display pipeline
> to fail, and is not currently supported.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>   tests/vsp-unit-test-0026.sh | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/vsp-unit-test-0026.sh b/tests/vsp-unit-test-0026.sh
> index 88038f3fdebf..4185bb23d05b 100755
> --- a/tests/vsp-unit-test-0026.sh
> +++ b/tests/vsp-unit-test-0026.sh
> @@ -10,7 +10,14 @@
>   features="rpf.0 wpf.0"
>   
>   vsp1_driver=/sys/bus/platform/drivers/vsp1
> -vsps=$(cd /sys/bus/platform/devices/; ls | grep vsp)
> +
> +# List all VSPs with a media device.
> +# This exludes VSP devices used by the DU.

    Excludes. :-)

[...]

MBR, Sergei

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

end of thread, other threads:[~2020-09-19  8:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 20:26 [PATCH 0/3] VSP-Tests: unbind: Kieran Bingham
2020-09-18 20:26 ` [PATCH 1/3] scripts: vsp-lib.sh: Remove unused variable Kieran Bingham
2020-09-18 20:26 ` [PATCH 2/3] tests: Skip unbind/bind tests when not root Kieran Bingham
2020-09-18 20:45   ` Kieran Bingham
2020-09-18 20:52   ` [PATCH v2] " Kieran Bingham
2020-09-18 20:26 ` [PATCH 3/3] tests: unbind/bind: Only test non display VSPs Kieran Bingham
2020-09-19  8:38   ` Sergei Shtylyov

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).