All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markos Chandras <Markos.Chandras@imgtec.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	<linux-mips@linux-mips.org>, <nbd@openwrt.org>,
	<james.hogan@imgtec.com>, <jchandra@broadcom.com>,
	<paul.burton@imgtec.com>, <david.daney@cavium.com>,
	<linux-kernel@vger.kernel.org>, <ralf@linux-mips.org>,
	<macro@linux-mips.org>, <manuel.lauss@gmail.com>,
	<jerinjacobk@gmail.com>, <chenhc@lemote.com>,
	<blogic@openwrt.org>
Subject: Re: [PATCH V2] MIPS: bugfix of coherentio variable default setup
Date: Thu, 11 Sep 2014 11:03:41 +0100	[thread overview]
Message-ID: <5411737D.4070801@imgtec.com> (raw)
In-Reply-To: <20140908191002.13852.47842.stgit@linux-yegoshin>

Hi Leonid,

On 09/08/2014 08:10 PM, Leonid Yegoshin wrote:
> Patch commit b6d92b4a6bdb880b39789c677b952c53a437028d
> 
>     MIPS: Add option to disable software I/O coherency.
> 
>     Some MIPS controllers have hardware I/O coherency. This patch
>     detects those and turns off software coherency. A new kernel
>     command line option also allows the user to manually turn
>     software coherency on or off.
> 
> in fact enforces L2 cache flushes even on systems with IOCU.
> The default value of coherentio is 0 and is not changed even with IOCU.
> It is a serious performance problem because it destroys all IOCU performance
> advantages.
> 
> It is fixed by setting coherentio to tri-state with default value as (-1) and
> setup a final value during platform coherency setup.
> 
> Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> [...]
> diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c
> index db7c9e5..48039fd 100644
> --- a/arch/mips/mti-malta/malta-setup.c
> +++ b/arch/mips/mti-malta/malta-setup.c
> @@ -147,13 +147,17 @@ static void __init plat_setup_iocoherency(void)
>  	if (plat_enable_iocoherency()) {
>  		if (coherentio == 0)
>  			pr_info("Hardware DMA cache coherency disabled\n");
> -		else
> +		else {
> +			coherentio = 1;
>  			pr_info("Hardware DMA cache coherency enabled\n");
> +		}
>  	} else {
>  		if (coherentio == 1)
>  			pr_info("Hardware DMA cache coherency unsupported, but enabled from command line!\n");
> -		else
> +		else {
> +			coherentio = 0;
>  			pr_info("Software DMA cache coherency enabled\n");
> +		}

This is not acceptable coding style for the kernel. See
Documentation/CodingStyle, Chapter 3. Since you are adding braces in the
"else" case, you should also add them in the "if" case as well.

-- 
markos

WARNING: multiple messages have this Message-ID (diff)
From: Markos Chandras <Markos.Chandras@imgtec.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>,
	linux-mips@linux-mips.org, nbd@openwrt.org,
	james.hogan@imgtec.com, jchandra@broadcom.com,
	paul.burton@imgtec.com, david.daney@cavium.com,
	linux-kernel@vger.kernel.org, ralf@linux-mips.org,
	macro@linux-mips.org, manuel.lauss@gmail.com,
	jerinjacobk@gmail.com, chenhc@lemote.com, blogic@openwrt.org
Subject: Re: [PATCH V2] MIPS: bugfix of coherentio variable default setup
Date: Thu, 11 Sep 2014 11:03:41 +0100	[thread overview]
Message-ID: <5411737D.4070801@imgtec.com> (raw)
Message-ID: <20140911100341.8R9Hhy3Ca66dXcSpZ6R15YAIDszPCosVBrEvfZ8zWYM@z> (raw)
In-Reply-To: <20140908191002.13852.47842.stgit@linux-yegoshin>

Hi Leonid,

On 09/08/2014 08:10 PM, Leonid Yegoshin wrote:
> Patch commit b6d92b4a6bdb880b39789c677b952c53a437028d
> 
>     MIPS: Add option to disable software I/O coherency.
> 
>     Some MIPS controllers have hardware I/O coherency. This patch
>     detects those and turns off software coherency. A new kernel
>     command line option also allows the user to manually turn
>     software coherency on or off.
> 
> in fact enforces L2 cache flushes even on systems with IOCU.
> The default value of coherentio is 0 and is not changed even with IOCU.
> It is a serious performance problem because it destroys all IOCU performance
> advantages.
> 
> It is fixed by setting coherentio to tri-state with default value as (-1) and
> setup a final value during platform coherency setup.
> 
> Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> [...]
> diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c
> index db7c9e5..48039fd 100644
> --- a/arch/mips/mti-malta/malta-setup.c
> +++ b/arch/mips/mti-malta/malta-setup.c
> @@ -147,13 +147,17 @@ static void __init plat_setup_iocoherency(void)
>  	if (plat_enable_iocoherency()) {
>  		if (coherentio == 0)
>  			pr_info("Hardware DMA cache coherency disabled\n");
> -		else
> +		else {
> +			coherentio = 1;
>  			pr_info("Hardware DMA cache coherency enabled\n");
> +		}
>  	} else {
>  		if (coherentio == 1)
>  			pr_info("Hardware DMA cache coherency unsupported, but enabled from command line!\n");
> -		else
> +		else {
> +			coherentio = 0;
>  			pr_info("Software DMA cache coherency enabled\n");
> +		}

This is not acceptable coding style for the kernel. See
Documentation/CodingStyle, Chapter 3. Since you are adding braces in the
"else" case, you should also add them in the "if" case as well.

-- 
markos

  reply	other threads:[~2014-09-11 10:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 19:10 [PATCH V2] MIPS: bugfix of coherentio variable default setup Leonid Yegoshin
2014-09-08 19:10 ` Leonid Yegoshin
2014-09-11 10:03 ` Markos Chandras [this message]
2014-09-11 10:03   ` Markos Chandras
2014-09-11 12:56 ` James Hogan
2014-09-11 12:56   ` James Hogan
2014-09-12 18:35 ` Sergei Shtylyov

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=5411737D.4070801@imgtec.com \
    --to=markos.chandras@imgtec.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=blogic@openwrt.org \
    --cc=chenhc@lemote.com \
    --cc=david.daney@cavium.com \
    --cc=james.hogan@imgtec.com \
    --cc=jchandra@broadcom.com \
    --cc=jerinjacobk@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    --cc=manuel.lauss@gmail.com \
    --cc=nbd@openwrt.org \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.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.