All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] video: treat signal like timeout as failure
Date: Tue, 10 Mar 2015 12:43:57 +0000	[thread overview]
Message-ID: <54FEE70D.3010307@ti.com> (raw)
In-Reply-To: <1421731430-13207-1-git-send-email-der.herr@hofr.at>

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

On 20/01/15 07:23, Nicholas Mc Guire wrote:
> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout and cleans up.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
> 
> Only the timeout case was being handled, return of 0 in 
> wait_for_completion_interruptible_timeout, the signal case (-ERESTARTSYS)
> was treated just like the case of successful completion, which is most 
> likely not reasonable.
> 
> Note that exynos_mipi_dsi_wr_data/exynos_mipi_dsi_rd_data return values
> are not checked at the call sites in s6e8ax0.c (cmd_read/cmd_write)!
> 
> This patch simply treats the signal case the same way as the timeout case,
> by releasing locks and returning 0 - which might not be the right thing to
> do - this needs a review by someone knowing the details of this driver.

While I agree that this patch is a bit better than the current state,
the code still looks wrong as Russell said.

I can merge this, but I'd rather have someone from Samsung look at the
code and change it to use wait_for_completion_killable_timeout() if
that's what this code is really supposed to use.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Nicholas Mc Guire <der.herr@hofr.at>, Inki Dae <inki.dae@samsung.com>
Cc: Donghwa Lee <dh09.lee@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Kukjin Kim <kgene@kernel.org>,
	linux-fbdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH] video: treat signal like timeout as failure
Date: Tue, 10 Mar 2015 14:43:57 +0200	[thread overview]
Message-ID: <54FEE70D.3010307@ti.com> (raw)
In-Reply-To: <1421731430-13207-1-git-send-email-der.herr@hofr.at>

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

On 20/01/15 07:23, Nicholas Mc Guire wrote:
> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout and cleans up.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
> 
> Only the timeout case was being handled, return of 0 in 
> wait_for_completion_interruptible_timeout, the signal case (-ERESTARTSYS)
> was treated just like the case of successful completion, which is most 
> likely not reasonable.
> 
> Note that exynos_mipi_dsi_wr_data/exynos_mipi_dsi_rd_data return values
> are not checked at the call sites in s6e8ax0.c (cmd_read/cmd_write)!
> 
> This patch simply treats the signal case the same way as the timeout case,
> by releasing locks and returning 0 - which might not be the right thing to
> do - this needs a review by someone knowing the details of this driver.

While I agree that this patch is a bit better than the current state,
the code still looks wrong as Russell said.

I can merge this, but I'd rather have someone from Samsung look at the
code and change it to use wait_for_completion_killable_timeout() if
that's what this code is really supposed to use.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: tomi.valkeinen@ti.com (Tomi Valkeinen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] video: treat signal like timeout as failure
Date: Tue, 10 Mar 2015 14:43:57 +0200	[thread overview]
Message-ID: <54FEE70D.3010307@ti.com> (raw)
In-Reply-To: <1421731430-13207-1-git-send-email-der.herr@hofr.at>

On 20/01/15 07:23, Nicholas Mc Guire wrote:
> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout and cleans up.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
> 
> Only the timeout case was being handled, return of 0 in 
> wait_for_completion_interruptible_timeout, the signal case (-ERESTARTSYS)
> was treated just like the case of successful completion, which is most 
> likely not reasonable.
> 
> Note that exynos_mipi_dsi_wr_data/exynos_mipi_dsi_rd_data return values
> are not checked at the call sites in s6e8ax0.c (cmd_read/cmd_write)!
> 
> This patch simply treats the signal case the same way as the timeout case,
> by releasing locks and returning 0 - which might not be the right thing to
> do - this needs a review by someone knowing the details of this driver.

While I agree that this patch is a bit better than the current state,
the code still looks wrong as Russell said.

I can merge this, but I'd rather have someone from Samsung look at the
code and change it to use wait_for_completion_killable_timeout() if
that's what this code is really supposed to use.

 Tomi


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150310/43bc402a/attachment.sig>

  parent reply	other threads:[~2015-03-10 12:43 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20  5:23 [PATCH] video: treat signal like timeout as failure Nicholas Mc Guire
2015-01-20  5:23 ` Nicholas Mc Guire
2015-01-20  5:23 ` Nicholas Mc Guire
2015-01-26 12:50 ` Tomi Valkeinen
2015-01-26 12:50   ` Tomi Valkeinen
2015-01-26 12:50   ` Tomi Valkeinen
2015-01-26 12:59 ` Russell King - ARM Linux
2015-01-26 12:59   ` Russell King - ARM Linux
2015-01-26 12:59   ` Russell King - ARM Linux
2015-01-29  9:43   ` Nicholas Mc Guire
2015-01-29  9:43     ` Nicholas Mc Guire
2015-01-29  9:43     ` Nicholas Mc Guire
2015-03-10 12:43 ` Tomi Valkeinen [this message]
2015-03-10 12:43   ` Tomi Valkeinen
2015-03-10 12:43   ` Tomi Valkeinen
2015-03-10 12:51   ` Nicholas Mc Guire
2015-03-10 12:51     ` Nicholas Mc Guire
2015-03-10 12:51     ` Nicholas Mc Guire
2015-03-10 14:15     ` Russell King - ARM Linux
2015-03-10 14:15       ` Russell King - ARM Linux
2015-03-10 14:15       ` Russell King - ARM Linux
2015-03-10 14:39       ` Nicholas Mc Guire
2015-03-10 14:39         ` Nicholas Mc Guire
2015-03-10 14:39         ` Nicholas Mc Guire
2015-03-10 14:46         ` Russell King - ARM Linux
2015-03-10 14:46           ` Russell King - ARM Linux
2015-03-10 14:46           ` Russell King - ARM Linux
2015-03-10 14:55           ` Tomi Valkeinen
2015-03-10 14:55             ` Tomi Valkeinen
2015-03-10 14:55             ` Tomi Valkeinen
2015-03-10 15:26             ` Russell King - ARM Linux
2015-03-10 15:26               ` Russell King - ARM Linux
2015-03-10 15:26               ` Russell King - ARM Linux

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=54FEE70D.3010307@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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.