Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Andrew Murray <andrew.murray@arm.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	"jgunthorpe@obsidianresearch.com"
	<jgunthorpe@obsidianresearch.com>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"siva.kallam@samsung.com" <siva.kallam@samsung.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"devicetree-discuss@lists.ozlabs.org" 
	<devicetree-discuss@lists.ozlabs.org>,
	"jg1.han@samsung.com" <jg1.han@samsung.com>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org" 
	<linux-samsung-soc@vger.kernel.org>,
	"kgene.kim@samsung.com" <kgene.kim@samsung.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"suren.reddy@samsung.com" <suren.reddy@samsung.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"monstr@monstr.eu" <monstr@monstr.eu>,
	"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	"paulus@samba.org" <paulus@samba.org>,
	"thomas.petazzoni@free-electrons.com" 
	<thomas.petazzoni@free-electrons.com>,
	"thierry.reding@avionic-design.de"
	<thierry.reding@avionic-design.de>,
	"thomas.abraham@linaro.org" <thomas.abraham@linaro.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Subject: Re: [PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property
Date: Mon, 22 Apr 2013 11:57:24 +0100	[thread overview]
Message-ID: <20130422105724.GB17007@arm.com> (raw)
In-Reply-To: <20130418134401.84AEE3E1319@localhost>

On Thu, Apr 18, 2013 at 02:44:01PM +0100, Grant Likely wrote:
> On Tue, 16 Apr 2013 11:18:27 +0100, Andrew Murray <Andrew.Murray@arm.com> wrote:

> 
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> But comments below...
> 

I've updated the patchset (now v8) to reflect your feedback, after a closer
look...

> > -
> > -		pr_debug("pci_space: 0x%08x pci_addr:0x%016llx ",
> > -				pci_space, pci_addr);
> > -		pr_debug("cpu_addr:0x%016llx size:0x%016llx\n",
> > -					cpu_addr, size);
> > -
> > -		ranges += np;
> > +		pr_debug("pci_space: 0x%08x pci_addr: 0x%016llx ",
> > +				range.pci_space, range.pci_addr);
> > +		pr_debug("cpu_addr: 0x%016llx size: 0x%016llx\n",
> > +				range.cpu_addr, range.size);
> 
> Nit: the patch changed whitespace on the pr_debug() statements, so even
> though the first line of each is identical, they look different in the
> patch.
> 

Actually the first line isn't identical, the original file was inconsistent
with its use of spaces between ':' and '0x%0' - my patch ensured that there
was always a space. I guess this could have been done as a separate patch.

> >  
> >  		/* If we failed translation or got a zero-sized region
> >  		 * (some FW try to feed us with non sensical zero sized regions
> >  		 * such as power3 which look like some kind of attempt
> >  		 * at exposing the VGA memory hole)
> >  		 */
> > -		if (cpu_addr == OF_BAD_ADDR || size == 0)
> > +		if (range.cpu_addr == OF_BAD_ADDR || range.size == 0)
> >  			continue;
> 
> Can this also be rolled into the parsing iterator?
> 

I decided not to do this. Mainly because ARM drivers use the parser directly
(instead of pci_process_bridge_OF_ranges function) and it seemed perfectly
valid for the parser to return a range of size 0 if that is what was present in
the DT.

> >  
> > -		/* Now consume following elements while they are contiguous */
> > -		for (; rlen >= np * sizeof(u32);
> > -		     ranges += np, rlen -= np * 4) {
> > -			if (ranges[0] != pci_space)
> > -				break;
> > -			pci_next = of_read_number(ranges + 1, 2);
> > -			cpu_next = of_translate_address(dev, ranges + 3);
> > -			if (pci_next != pci_addr + size ||
> > -			    cpu_next != cpu_addr + size)
> > -				break;
> > -			size += of_read_number(ranges + pna + 3, 2);
> > -		}
> > -
> >  		/* Act based on address space type */
> >  		res = NULL;
> > -		switch ((pci_space >> 24) & 0x3) {
> > -		case 1:		/* PCI IO space */
> > +		res_type = range.flags & IORESOURCE_TYPE_BITS;
> > +		if (res_type == IORESOURCE_IO) {
> 
> Why the change from switch() to an if/else if sequence?

I think this was an artifact of the patches evolution, I've reverted back to
the switch.

> 
> But those are mostly nitpicks. If this is deferred to v3.10 then I would
> suggest fixing them up and posting for another round of review.

Andrew Murray

  parent reply	other threads:[~2013-04-22 10:57 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:18 [PATCH v7 0/3] of/pci: Provide common support for PCI DT parsing Andrew Murray
2013-04-16 10:18 ` [PATCH v7 1/3] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC Andrew Murray
2013-04-16 10:30   ` Andrew Murray
2013-04-16 10:30     ` Andrew Murray
2013-04-17 16:00     ` Grant Likely
2013-04-17 16:00       ` Grant Likely
2013-04-17 16:10       ` Jason Cooper
2013-04-17 16:10         ` Jason Cooper
2013-04-17 16:17         ` Grant Likely
2013-04-17 16:17           ` Grant Likely
2013-04-17 16:22           ` Jason Cooper
2013-04-17 16:22             ` Jason Cooper
2013-04-18 12:48             ` Grant Likely
2013-04-18 12:48               ` Grant Likely
2013-04-16 10:18 ` [PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property Andrew Murray
2013-04-18 13:44   ` Grant Likely
2013-04-18 13:44     ` Grant Likely
2013-04-18 14:24     ` Andrew Murray
2013-04-18 14:24       ` Andrew Murray
2013-04-18 15:29       ` Grant Likely
2013-04-18 15:29         ` Grant Likely
2013-04-18 15:38         ` Andrew Murray
2013-04-18 15:38           ` Andrew Murray
2013-04-22 10:57     ` Andrew Murray [this message]
2013-04-22 10:57       ` Andrew Murray
2013-04-16 10:18 ` [PATCH v7 3/3] of/pci: mips: convert to common of_pci_range_parser Andrew Murray
2013-04-17 15:42   ` Linus Walleij
2013-04-17 15:42     ` Linus Walleij
2013-04-18 12:59     ` Andrew Murray
2013-04-18 12:59       ` Andrew Murray
2013-04-18 13:09       ` Jason Cooper
2013-04-18 13:09         ` Jason Cooper
2013-04-19  7:19         ` Gabor Juhos
2013-04-19  7:19           ` Gabor Juhos
2013-04-20 22:33           ` Jason Cooper
2013-04-20 22:33             ` Jason Cooper
2013-04-21  7:27             ` Gabor Juhos
2013-04-21  7:27               ` Gabor Juhos
2013-04-22 10:49               ` Andrew Murray
2013-04-22 10:49                 ` Andrew Murray
2013-04-18 13:45   ` Grant Likely
2013-04-18 13:45     ` Grant Likely
2013-04-18 14:26     ` Andrew Murray
2013-04-18 14:26       ` Andrew Murray
2013-04-16 15:05 ` [PATCH v7 0/3] of/pci: Provide common support for PCI DT parsing Jason Cooper

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=20130422105724.GB17007@arm.com \
    --to=andrew.murray@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jg1.han@samsung.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=kgene.kim@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=monstr@monstr.eu \
    --cc=paulus@samba.org \
    --cc=rob.herring@calxeda.com \
    --cc=siva.kallam@samsung.com \
    --cc=suren.reddy@samsung.com \
    --cc=thierry.reding@avionic-design.de \
    --cc=thomas.abraham@linaro.org \
    --cc=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox