All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jayachandran C. <jchandra@broadcom.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: <linux-mips@linux-mips.org>, <ralf@linux-mips.org>
Subject: Re: [PATCH 04/17] MIPS: Netlogic: Disable writing IRT for disabled blocks
Date: Fri, 9 Jan 2015 15:18:19 +0530	[thread overview]
Message-ID: <20150109094818.GA18823@jayachandranc.netlogicmicro.com> (raw)
In-Reply-To: <54AD67EF.2080406@cogentembedded.com>

On Wed, Jan 07, 2015 at 08:07:59PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 01/07/2015 02:28 PM, Jayachandran C wrote:
> 
> >If the device header of a block is not present, return invalid IRT
> >value so that we do not program an incorrect offset.
> 
> >Signed-off-by: Jayachandran C <jchandra@broadcom.com>
> >---
> >  arch/mips/netlogic/xlp/nlm_hal.c | 25 ++++++++++++++++---------
> >  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> >diff --git a/arch/mips/netlogic/xlp/nlm_hal.c b/arch/mips/netlogic/xlp/nlm_hal.c
> >index 7e0d224..de41fb5 100644
> >--- a/arch/mips/netlogic/xlp/nlm_hal.c
> >+++ b/arch/mips/netlogic/xlp/nlm_hal.c
> >@@ -170,16 +170,23 @@ static int xlp_irq_to_irt(int irq)
> >  	}
> >
> >  	if (devoff != 0) {
> >+		uint32_t val;
> >+
> >  		pcibase = nlm_pcicfg_base(devoff);
> >-		irt = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG) & 0xffff;
> >-		/* HW weirdness, I2C IRT entry has to be fixed up */
> >-		switch (irq) {
> >-		case PIC_I2C_1_IRQ:
> >-			irt = irt + 1; break;
> >-		case PIC_I2C_2_IRQ:
> >-			irt = irt + 2; break;
> >-		case PIC_I2C_3_IRQ:
> >-			irt = irt + 3; break;
> >+		val = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG);
> >+		if (val == 0xffffffff) {
> >+			irt = -1;
> >+		} else {
> >+			irt = val & 0xffff;
> >+			/* HW weirdness, I2C IRT entry has to be fixed up */
> >+			switch (irq) {
> >+			case PIC_I2C_1_IRQ:
> >+				irt = irt + 1; break;
> >+			case PIC_I2C_2_IRQ:
> >+				irt = irt + 2; break;
> >+			case PIC_I2C_3_IRQ:
> >+				irt = irt + 3; break;
> 
>    Why not 'irt += n' in all 3 cases?
>    And don't place *break* on the same line -- this upsets checkpatch.pl IIRC.

checkpatch did not complain, and also I did not want to mix formatting
change with actual fix. But agree that the code can cleaned up a bit.
I will sent out a patch for this next cycle.

JC.

WARNING: multiple messages have this Message-ID (diff)
From: Jayachandran C. <jchandra@broadcom.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH 04/17] MIPS: Netlogic: Disable writing IRT for disabled blocks
Date: Fri, 9 Jan 2015 15:18:19 +0530	[thread overview]
Message-ID: <20150109094818.GA18823@jayachandranc.netlogicmicro.com> (raw)
Message-ID: <20150109094819.iPQM9EiBoPE3CABB6ayDukobHoaxLyPqV3NjOuw4NPk@z> (raw)
In-Reply-To: <54AD67EF.2080406@cogentembedded.com>

On Wed, Jan 07, 2015 at 08:07:59PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 01/07/2015 02:28 PM, Jayachandran C wrote:
> 
> >If the device header of a block is not present, return invalid IRT
> >value so that we do not program an incorrect offset.
> 
> >Signed-off-by: Jayachandran C <jchandra@broadcom.com>
> >---
> >  arch/mips/netlogic/xlp/nlm_hal.c | 25 ++++++++++++++++---------
> >  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> >diff --git a/arch/mips/netlogic/xlp/nlm_hal.c b/arch/mips/netlogic/xlp/nlm_hal.c
> >index 7e0d224..de41fb5 100644
> >--- a/arch/mips/netlogic/xlp/nlm_hal.c
> >+++ b/arch/mips/netlogic/xlp/nlm_hal.c
> >@@ -170,16 +170,23 @@ static int xlp_irq_to_irt(int irq)
> >  	}
> >
> >  	if (devoff != 0) {
> >+		uint32_t val;
> >+
> >  		pcibase = nlm_pcicfg_base(devoff);
> >-		irt = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG) & 0xffff;
> >-		/* HW weirdness, I2C IRT entry has to be fixed up */
> >-		switch (irq) {
> >-		case PIC_I2C_1_IRQ:
> >-			irt = irt + 1; break;
> >-		case PIC_I2C_2_IRQ:
> >-			irt = irt + 2; break;
> >-		case PIC_I2C_3_IRQ:
> >-			irt = irt + 3; break;
> >+		val = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG);
> >+		if (val == 0xffffffff) {
> >+			irt = -1;
> >+		} else {
> >+			irt = val & 0xffff;
> >+			/* HW weirdness, I2C IRT entry has to be fixed up */
> >+			switch (irq) {
> >+			case PIC_I2C_1_IRQ:
> >+				irt = irt + 1; break;
> >+			case PIC_I2C_2_IRQ:
> >+				irt = irt + 2; break;
> >+			case PIC_I2C_3_IRQ:
> >+				irt = irt + 3; break;
> 
>    Why not 'irt += n' in all 3 cases?
>    And don't place *break* on the same line -- this upsets checkpatch.pl IIRC.

checkpatch did not complain, and also I did not want to mix formatting
change with actual fix. But agree that the code can cleaned up a bit.
I will sent out a patch for this next cycle.

JC.

  reply	other threads:[~2015-01-09  9:40 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-07 11:28 [PATCH 00/17] Netlogic XLP updates Jayachandran C
2015-01-07 11:28 ` Jayachandran C
2015-01-07 11:28 ` [PATCH 01/17] MIPS: Netlogic: Fix wait for slave CPUs Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 02/17] MIPS: Netlogic: Fix nlm_xlp2_get_pic_frequency to use ref_div Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 03/17] MIPS: Netlogic: Fix cop0 prid check in AHCI init Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 04/17] MIPS: Netlogic: Disable writing IRT for disabled blocks Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 17:07   ` Sergei Shtylyov
2015-01-09  9:48     ` Jayachandran C. [this message]
2015-01-09  9:48       ` Jayachandran C.
2015-01-09 11:35       ` Sergei Shtylyov
2015-01-07 11:28 ` [PATCH 05/17] MIPS: Netlogic: Fix for SATA PHY init Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 06/17] MIPS: Netlogic: Fix frequency calculation register Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 07/17] MIPS: MSI: Update MSI handling for XLP Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 08/17] MIPS: Netlogic: Use MIPS topology.h Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 09/17] MIPS: Netlogic: Move cores per node out of multi-node.h Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 10/17] MIPS: Netlogic: nlm_core_id for xlp9xx Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 11/17] MIPS: Netlogic: Added HugeTLB as default Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 12/17] MIPS: Netlogic: Update function to read DRAM BARs Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 13/17] MIPS: Netlogic: Handle XLP hardware errata Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 17:21   ` Sergei Shtylyov
2015-01-07 19:33     ` David Daney
2015-01-09  9:51     ` Jayachandran C.
2015-01-09  9:51       ` Jayachandran C.
2015-01-09 10:43       ` Jayachandran C
2015-01-09 10:43         ` Jayachandran C
2015-01-07 11:28 ` [PATCH 14/17] MIPS: Netlogic: Do not enable SUE for core Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 15/17] MIPS: Netlogic: Add irq mapping and setup for XHCI port 3 Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 16/17] MIPS: Netlogic: i2c IRQ mappings for XLP9XX Jayachandran C
2015-01-07 11:28   ` Jayachandran C
2015-01-07 11:28 ` [PATCH 17/17] MIPS: Netlogic: Add built-in dts for XLP5xx boards Jayachandran C
2015-01-07 11:28   ` Jayachandran C

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=20150109094818.GA18823@jayachandranc.netlogicmicro.com \
    --to=jchandra@broadcom.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sergei.shtylyov@cogentembedded.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.