All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Tony K Nadackal <tony.kn@samsung.com>
Cc: linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
	mchehab@osg.samsung.com, kgene@kernel.org, k.debski@samsung.com,
	s.nawrocki@samsung.com, robh+dt@kernel.org, mark.rutland@arm.com,
	bhushan.r@samsung.com
Subject: Re: [PATCH v2 1/2] [media] s5p-jpeg: Fix modification sequence of interrupt enable register
Date: Wed, 07 Jan 2015 11:08:11 +0100	[thread overview]
Message-ID: <54AD058B.6070900@samsung.com> (raw)
In-Reply-To: <1418974680-5837-2-git-send-email-tony.kn@samsung.com>

Hi Tony,

On 12/19/2014 08:37 AM, Tony K Nadackal wrote:
> Fix the bug in modifying the interrupt enable register.

For Exynos4 this was not a bug as there are only five bit fields
used in the EXYNOS4_INT_EN_REG - all of them enable related
interrupt signal and EXYNOS4_INT_EN_ALL value is 0x1f which
just sets these bit fields to 1.

If for Exynos7 there are other bit fields in this register
and it has to be read prior setting to find out current
state then I'd parametrize this function with version argument
as you do it in the patch adding support for Exynos7, but
for Exynos4 case I'd left the behaviour as it is currenlty, i.e.
avoid reading the register and do it only for Exynos7 case.
Effectively, this patch is not required, as it doesn't fix
anything but adds redundant call to readl.

> Signed-off-by: Tony K Nadackal <tony.kn@samsung.com>
> ---
>   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> index e53f13a..a61ff7e 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> @@ -155,7 +155,10 @@ void exynos4_jpeg_set_enc_out_fmt(void __iomem *base, unsigned int out_fmt)
>
>   void exynos4_jpeg_set_interrupt(void __iomem *base)
>   {
> -	writel(EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
> +	unsigned int reg;
> +
> +	reg = readl(base + EXYNOS4_INT_EN_REG) & ~EXYNOS4_INT_EN_MASK;
> +	writel(reg | EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
>   }
>
>   unsigned int exynos4_jpeg_get_int_status(void __iomem *base)
>


-- 
Best Regards,
Jacek Anaszewski

WARNING: multiple messages have this Message-ID (diff)
From: j.anaszewski@samsung.com (Jacek Anaszewski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] [media] s5p-jpeg: Fix modification sequence of interrupt enable register
Date: Wed, 07 Jan 2015 11:08:11 +0100	[thread overview]
Message-ID: <54AD058B.6070900@samsung.com> (raw)
In-Reply-To: <1418974680-5837-2-git-send-email-tony.kn@samsung.com>

Hi Tony,

On 12/19/2014 08:37 AM, Tony K Nadackal wrote:
> Fix the bug in modifying the interrupt enable register.

For Exynos4 this was not a bug as there are only five bit fields
used in the EXYNOS4_INT_EN_REG - all of them enable related
interrupt signal and EXYNOS4_INT_EN_ALL value is 0x1f which
just sets these bit fields to 1.

If for Exynos7 there are other bit fields in this register
and it has to be read prior setting to find out current
state then I'd parametrize this function with version argument
as you do it in the patch adding support for Exynos7, but
for Exynos4 case I'd left the behaviour as it is currenlty, i.e.
avoid reading the register and do it only for Exynos7 case.
Effectively, this patch is not required, as it doesn't fix
anything but adds redundant call to readl.

> Signed-off-by: Tony K Nadackal <tony.kn@samsung.com>
> ---
>   drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> index e53f13a..a61ff7e 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c
> @@ -155,7 +155,10 @@ void exynos4_jpeg_set_enc_out_fmt(void __iomem *base, unsigned int out_fmt)
>
>   void exynos4_jpeg_set_interrupt(void __iomem *base)
>   {
> -	writel(EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
> +	unsigned int reg;
> +
> +	reg = readl(base + EXYNOS4_INT_EN_REG) & ~EXYNOS4_INT_EN_MASK;
> +	writel(reg | EXYNOS4_INT_EN_ALL, base + EXYNOS4_INT_EN_REG);
>   }
>
>   unsigned int exynos4_jpeg_get_int_status(void __iomem *base)
>


-- 
Best Regards,
Jacek Anaszewski

  reply	other threads:[~2015-01-07 10:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19  7:37 [PATCH v2 0/2] Adding support for Exynos7 Jpeg variant Tony K Nadackal
2014-12-19  7:37 ` Tony K Nadackal
2014-12-19  7:37 ` [PATCH v2 1/2] [media] s5p-jpeg: Fix modification sequence of interrupt enable register Tony K Nadackal
2014-12-19  7:37   ` Tony K Nadackal
2015-01-07 10:08   ` Jacek Anaszewski [this message]
2015-01-07 10:08     ` Jacek Anaszewski
2015-01-07 11:46     ` Tony K Nadackal
2015-01-07 11:46       ` Tony K Nadackal
2014-12-19  7:38 ` [PATCH v2 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant Tony K Nadackal
2014-12-19  7:38   ` Tony K Nadackal
2015-01-07 10:12   ` Jacek Anaszewski
2015-01-07 10:12     ` Jacek Anaszewski
2015-01-07 11:22     ` Tony K Nadackal
2015-01-07 11:22       ` Tony K Nadackal
2015-01-07 12:11       ` Jacek Anaszewski
2015-01-07 12:11         ` Jacek Anaszewski
2015-01-05  5:15 ` [PATCH v2 0/2] Adding support for Exynos7 Jpeg variant Tony K Nadackal
2015-01-05  5:15   ` Tony K Nadackal

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=54AD058B.6070900@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=bhushan.r@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=k.debski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@osg.samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tony.kn@samsung.com \
    /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.