LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 02/22] PCI: Add dummy bus_type for pci_host_bridge
From: Yinghai Lu @ 2013-01-27 19:23 UTC (permalink / raw)
  To: Bjorn Helgaas, Jiang Liu, Rafael J. Wysocki, Taku Izumi,
	Toshi Kani
  Cc: linux-ia64, Mauro Carvalho Chehab, David Airlie, linux-pci,
	dri-devel, David Howells, Paul Mackerras, sparclinux,
	linux-am33-list, Russell King, x86, linux-altix, Doug Thompson,
	Matt Turner, linux-edac, Fenghua Yu, microblaze-uclinux,
	Ivan Kokshaysky, Yinghai Lu, linux-arm-kernel, Richard Henderson,
	Michal Simek, Tony Luck, Greg Kroah-Hartman, linux-alpha,
	Koichi Yasutake, linuxppc-dev, David S. Miller
In-Reply-To: <1359314629-18651-1-git-send-email-yinghai@kernel.org>

Need to use it for looping registered host_bridge, and kill
pci_root_buses list.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Doug Thompson <dougthompson@xmission.com>
Cc: linux-edac@vger.kernel.org
Cc: x86@kernel.org
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Cc: linux-altix@sgi.com
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Cc: David Howells <dhowells@redhat.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: linux-am33-list@redhat.com
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
 drivers/pci/pci-driver.c |   11 ++++++++++-
 drivers/pci/probe.c      |    1 +
 include/linux/pci.h      |    2 ++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index acdcc3c..9fb004b 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1278,11 +1278,20 @@ struct bus_type pci_bus_type = {
 	.pm		= PCI_PM_OPS_PTR,
 };
 
+struct bus_type pci_host_bridge_bus_type = {
+	.name           = "pci_host_bridge",
+};
+
+static int __init pci_host_bridge_driver_init(void)
+{
+	return bus_register(&pci_host_bridge_bus_type);
+}
+postcore_initcall(pci_host_bridge_driver_init);
+
 static int __init pci_driver_init(void)
 {
 	return bus_register(&pci_bus_type);
 }
-
 postcore_initcall(pci_driver_init);
 
 EXPORT_SYMBOL_GPL(pci_add_dynid);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index ef50154..04ecf0d 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1692,6 +1692,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
 		goto err_out;
 
 	bridge->dev.parent = parent;
+	bridge->dev.bus = &pci_host_bridge_bus_type;
 	bridge->dev.release = pci_release_host_bridge_dev;
 	dev_set_name(&bridge->dev, "pci%04x:%02x", pci_domain_nr(b), bus);
 	error = pcibios_root_bridge_prepare(bridge);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 056d3d6..9da06ec 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -669,6 +669,7 @@ enum pcie_bus_config_types {
 
 extern enum pcie_bus_config_types pcie_bus_config;
 
+extern struct bus_type pci_host_bridge_bus_type;
 extern struct bus_type pci_bus_type;
 
 /* Do NOT directly access these two variables, unless you are arch specific pci
@@ -740,6 +741,7 @@ void pci_stop_root_bus(struct pci_bus *bus);
 void pci_remove_root_bus(struct pci_bus *bus);
 void pci_setup_cardbus(struct pci_bus *bus);
 extern void pci_sort_breadthfirst(void);
+#define dev_is_pci_host_bridge(d) ((d)->bus == &pci_host_bridge_bus_type)
 #define dev_is_pci(d) ((d)->bus == &pci_bus_type)
 #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
 #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH v3 20/22] PCI, powerpc: Kill pci_root_buses in resources reservations
From: Yinghai Lu @ 2013-01-27 19:23 UTC (permalink / raw)
  To: Bjorn Helgaas, Jiang Liu, Rafael J. Wysocki, Taku Izumi,
	Toshi Kani
  Cc: Greg Kroah-Hartman, linux-pci, linuxppc-dev, Paul Mackerras,
	Yinghai Lu
In-Reply-To: <1359314629-18651-1-git-send-email-yinghai@kernel.org>

Replace that with hotplug-safe version iteration.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/kernel/pci-common.c |   13 ++++++-------
 arch/powerpc/kernel/pci_64.c     |    8 ++++----
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index abc0d08..9ccecbe 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1398,11 +1398,11 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
 
 void __init pcibios_resource_survey(void)
 {
-	struct pci_bus *b;
+	struct pci_host_bridge *host_bridge = NULL;
 
 	/* Allocate and assign resources */
-	list_for_each_entry(b, &pci_root_buses, node)
-		pcibios_allocate_bus_resources(b);
+	for_each_pci_host_bridge(host_bridge)
+		pcibios_allocate_bus_resources(host_bridge->bus);
 	pcibios_allocate_resources(0);
 	pcibios_allocate_resources(1);
 
@@ -1410,10 +1410,9 @@ void __init pcibios_resource_survey(void)
 	 * the low IO area and the VGA memory area if they intersect the
 	 * bus available resources to avoid allocating things on top of them
 	 */
-	if (!pci_has_flag(PCI_PROBE_ONLY)) {
-		list_for_each_entry(b, &pci_root_buses, node)
-			pcibios_reserve_legacy_regions(b);
-	}
+	if (!pci_has_flag(PCI_PROBE_ONLY))
+		for_each_pci_host_bridge(host_bridge)
+			pcibios_reserve_legacy_regions(host_bridge->bus);
 
 	/* Now, if the platform didn't decide to blindly trust the firmware,
 	 * we proceed to assigning things that were left unassigned
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 2cbe676..f848325 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -208,9 +208,9 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 			  unsigned long in_devfn)
 {
 	struct pci_controller* hose;
-	struct list_head *ln;
-	struct pci_bus *bus = NULL;
+	struct pci_bus *bus;
 	struct device_node *hose_node;
+	struct pci_host_bridge *host_bridge = NULL;
 
 	/* Argh ! Please forgive me for that hack, but that's the
 	 * simplest way to get existing XFree to not lockup on some
@@ -230,8 +230,8 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 	 * used on pre-domains setup. We return the first match
 	 */
 
-	for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
-		bus = pci_bus_b(ln);
+	for_each_pci_host_bridge(host_bridge) {
+		bus = host_bridge->bus;
 		if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
 			break;
 		bus = NULL;
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH v2 20/22] PCI, powerpc: Kill pci_root_buses in resources reservations
From: Yinghai Lu @ 2013-01-27  5:36 UTC (permalink / raw)
  To: Bjorn Helgaas, Jiang Liu, Rafael J. Wysocki, Taku Izumi
  Cc: linux-pci, Yinghai Lu, linuxppc-dev, Paul Mackerras
In-Reply-To: <1359265003-16166-1-git-send-email-yinghai@kernel.org>

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/kernel/pci-common.c |   13 ++++++-------
 arch/powerpc/kernel/pci_64.c     |    8 ++++----
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index abc0d08..9ccecbe 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1398,11 +1398,11 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
 
 void __init pcibios_resource_survey(void)
 {
-	struct pci_bus *b;
+	struct pci_host_bridge *host_bridge = NULL;
 
 	/* Allocate and assign resources */
-	list_for_each_entry(b, &pci_root_buses, node)
-		pcibios_allocate_bus_resources(b);
+	for_each_pci_host_bridge(host_bridge)
+		pcibios_allocate_bus_resources(host_bridge->bus);
 	pcibios_allocate_resources(0);
 	pcibios_allocate_resources(1);
 
@@ -1410,10 +1410,9 @@ void __init pcibios_resource_survey(void)
 	 * the low IO area and the VGA memory area if they intersect the
 	 * bus available resources to avoid allocating things on top of them
 	 */
-	if (!pci_has_flag(PCI_PROBE_ONLY)) {
-		list_for_each_entry(b, &pci_root_buses, node)
-			pcibios_reserve_legacy_regions(b);
-	}
+	if (!pci_has_flag(PCI_PROBE_ONLY))
+		for_each_pci_host_bridge(host_bridge)
+			pcibios_reserve_legacy_regions(host_bridge->bus);
 
 	/* Now, if the platform didn't decide to blindly trust the firmware,
 	 * we proceed to assigning things that were left unassigned
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 2cbe676..f848325 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -208,9 +208,9 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 			  unsigned long in_devfn)
 {
 	struct pci_controller* hose;
-	struct list_head *ln;
-	struct pci_bus *bus = NULL;
+	struct pci_bus *bus;
 	struct device_node *hose_node;
+	struct pci_host_bridge *host_bridge = NULL;
 
 	/* Argh ! Please forgive me for that hack, but that's the
 	 * simplest way to get existing XFree to not lockup on some
@@ -230,8 +230,8 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 	 * used on pre-domains setup. We return the first match
 	 */
 
-	for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
-		bus = pci_bus_b(ln);
+	for_each_pci_host_bridge(host_bridge) {
+		bus = host_bridge->bus;
 		if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
 			break;
 		bus = NULL;
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH Bug fix 0/5] Bug fix for physical memory hot-remove.
From: Toshi Kani @ 2013-01-25 18:19 UTC (permalink / raw)
  To: Tang Chen
  Cc: linux-mm, paulus, hpa, cl, sfr, x86, linux-acpi, isimatu.yasuaki,
	linfeng, mgorman, kosaki.motohiro, rientjes, len.brown, jiang.liu,
	wency, julian.calaby, glommer, wujianguo, yinghai, laijs,
	linux-kernel, minchan.kim, akpm, linuxppc-dev
In-Reply-To: <1358854984-6073-1-git-send-email-tangchen@cn.fujitsu.com>

On Tue, 2013-01-22 at 19:42 +0800, Tang Chen wrote:
> Here are some bug fix patches for physical memory hot-remove. All these
> patches are based on the latest -mm tree.
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
> 
> And patch1 and patch3 are very important.
> patch1: free compound pages when freeing memmap, otherwise the kernel
>         will panic the next time memory is hot-added.
> patch3: the old way of freeing pagetable pages was wrong. We should never
>         split larger pages into small ones.
> 
> 
> Lai Jiangshan (1):
>   Bug-fix: mempolicy: fix is_valid_nodemask()
> 
> Tang Chen (3):
>   Bug fix: Do not split pages when freeing pagetable pages.
>   Bug fix: Fix section mismatch problem of
>     release_firmware_map_entry().
>   Bug fix: Fix the doc format in drivers/firmware/memmap.c
> 
> Wen Congyang (1):
>   Bug fix: consider compound pages when free memmap
> 
>  arch/x86/mm/init_64.c     |  148 ++++++++++++++-------------------------------
>  drivers/firmware/memmap.c |   16 +++---
>  mm/mempolicy.c            |   36 +++++++----
>  mm/sparse.c               |    2 +-
>  4 files changed, 77 insertions(+), 125 deletions(-)

This patchset fixed a blocker panic I was hitting in my memory hot-plug
testing.  Memory hotplug works fine with this patchset (for testing my
hotplug framework patchset :).  For the series:

Tested-by: Toshi Kani <toshi.kani@hp.com>

Thanks,
-Toshi

^ permalink raw reply

* Re: [PATCH Bug fix 0/5] Bug fix for physical memory hot-remove.
From: Michal Hocko @ 2013-01-25 13:17 UTC (permalink / raw)
  To: Simon Jeons
  Cc: Tang Chen, linux-mm, paulus, hpa, cl, sfr, x86, linux-acpi,
	isimatu.yasuaki, linfeng, mgorman, kosaki.motohiro, rientjes,
	len.brown, jiang.liu, wency, julian.calaby, glommer, wujianguo,
	yinghai, laijs, linux-kernel, minchan.kim, akpm, linuxppc-dev
In-Reply-To: <1358944171.3351.1.camel@kernel>

On Wed 23-01-13 06:29:31, Simon Jeons wrote:
> On Tue, 2013-01-22 at 19:42 +0800, Tang Chen wrote:
> > Here are some bug fix patches for physical memory hot-remove. All these
> > patches are based on the latest -mm tree.
> > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
> > 
> > And patch1 and patch3 are very important.
> > patch1: free compound pages when freeing memmap, otherwise the kernel
> >         will panic the next time memory is hot-added.
> > patch3: the old way of freeing pagetable pages was wrong. We should never
> >         split larger pages into small ones.
> > 
> > 
> 
> Hi Tang,
> 
> I remember your big physical memory hot-remove patchset has already
> merged by Andrew, but where I can find it? Could you give me git tree 
> address?

Andrew tree is also mirrored into a git tree.
http://git.kernel.org/?p=linux/kernel/git/mhocko/mm.git;a=summary

It contains only Memory management patches on top of the last major
release (since-.X.Y branch).
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply

* Re: [GIT PULL 00/74] perf/core improvements and fixes
From: Ingo Molnar @ 2013-01-25 10:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Feng Tang, Srikar Dronamraju, Peter Zijlstra, Frederic Weisbecker,
	Al Cooper, H.C. Lee, linuxppc-dev, Jon Stanley, Andi Kleen,
	Paul Mackerras, Frederik Deweerdt, Masami Hiramatsu, Jiri Olsa,
	Thomas Jarosch, Namhyung Kim, Ulrich Drepper, Hitoshi Mitake,
	Joshua Zhu, Xiao Guangrong, Akihiro Nagai,
	Arnaldo Carvalho de Melo, Sasha Levin, Sukadev Bhattiprolu,
	Stefan Beller, Corey Ashford, Namhyung Kim, Anton Blanchard,
	Steven Rostedt, Arnaldo Carvalho de Melo, Stephane Eranian,
	Namhyung Kim, Tom Zanussi, Hitoshi Mitake, Vince Weaver,
	Mike Galbraith, linux-kernel, Pekka Enberg, David Ahern
In-Reply-To: <1359058103-31645-1-git-send-email-acme@infradead.org>


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 203e04c16330c880538588e932743f404ee4fd66:
> 
>   Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-01-24 16:30:45 +0100)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo
> 
> for you to fetch changes up to 2ae828786c65ab8f587647bd0f22f8fe00f1f238:
> 
>   perf test: Allow skipping tests (2013-01-24 16:40:53 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes
> 
> . Allow skipping problematic entries in 'perf test'.
> 
> . Fix some namespace problems in the event parsing routines.
> 
> . Add 'perf test' entry to make sure the python binding doesn't have
>   linking problems.
> 
> . Adjust 'perf test' attr tests verbosity levels.
> 
> . Make tools/perf build with GNU make v3.80, fix from Al Cooper.
> 
> . Do missing feature fallbacks in just one place, removing duplicated
>   code in multiple tools.
> 
> . Fix some memory leaks, from David Ahern.
> 
> . Fix segfault when drawing out-of-bounds jumps, from Frederik Deweerdt.
> 
> . Allow of casting an array of char to string in 'perf probe', from
>   Hyeoncheol Lee.
> 
> . Add support for wildcard in tracepoint system name, from Jiri Olsa.
> 
> . Update FSF postal address to be URL's, from Jon Stanley.
> 
> . Add anonymous huge page recognition, from Joshua Zhu.
> 
> . Remove some needless feature test checks, from Namhyung Kim.
> 
> . Multiple improvements to the sort routines, from Namhyung Kim.
> 
> . Fix warning on '>=' operator in libtraceevent, from Namhyung Kim.
> 
> . Use ARRAY_SIZE instead of reinventing it in 'perf script' and 'perf kmem',
>   from Sasha Levin.
> 
> . Remove some redundant checks, from Sasha Levin.
> 
> . Test correct variable after allocation in libtraceevent, fix from Sasha Levin.
> 
> . Mark branch_info maps as referenced, fix from Stephane Eranian.
> 
> . Fix PMU format parsing test failure, from Sukadev Bhattiprolu.
> 
> . Fix possible (unlikely) buffer overflow, from Thomas Jarosch.
> 
> . Multiple 'perf script' fixes, from Tom Zanussi.
> 
> . Add missing field in PERF_RECORD_SAMPLE documentation, from Vince Weaver.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Al Cooper (1):
>       perf tools: Fix GNU make v3.80 compatibility issue
> 
> Arnaldo Carvalho de Melo (24):
>       perf test: Remove leftover temp file left by one of the attr tests
>       perf tests: Adjust some message log levels to help diagnosing problems in attr tests
>       perf evsel: Do missing feature fallbacks in just one place
>       perf evsel: Introduce event fallback method
>       perf evsel: Introduce perf_evsel__open_strerror method
>       perf test: Check for linking problems in the python binding
>       perf python: Fix breakage introduced by the test_attr infrastructure
>       perf record: Don't pass host machine to guest synthesizer
>       perf hists: Rename hists__fprintf_nr_events to events_stats__fprintf
>       perf session: There is no need for a per session hists instance
>       perf machine: Introduce struct machines
>       perf machine: Simplify accessing the host machine
>       perf kvm: Initialize file_name var to fix segfault
>       perf tests: Don't fail if a matching vmlinux isn't found, skip that test
>       perf tools: Fix usage of __ in parse_events_term struct
>       perf pmu: Fix usage of __ in struct names
>       perf ui browsers: Fix usage of __ in struct names
>       perf tools: Fix usage of __ in event parsing struct names
>       perf tests: Use ARRAY_SIZE() were applicable
>       perf pmu: Privatize perf_pmu_{format,alias} structs
>       perf tools: Remove some needless die() calls from the main routine
>       perf tools: Allow passing NULL to intlist__find
>       perf tools: Allow passing a list to intlist__new
>       perf test: Allow skipping tests
> 
> David Ahern (3):
>       perf symbols: Move name malloc to when needed in dso__load
>       perf symbols: Mark vmlinux filename as allocated
>       perf tools: Move get_term_dimensions from top to util.c
> 
> Frederik Deweerdt (1):
>       perf annotate browser: Fix segfault when drawing out-of-bounds jumps
> 
> Hyeoncheol Lee (1):
>       perf probe: Allow of casting an array of char to string
> 
> Jiri Olsa (6):
>       perf tools: Add missing closedir in multi tracepoint processing
>       perf tools: Add support for wildcard in tracepoint system name
>       perf tests: Add event parsing test for '*:*' tracepoints
>       perf tests: Fix PYTHONPATH for python-use test tracepoints
>       perf tests: Add return states enum for tests
>       perf tools: Remove unused 'unset' parameter from parse_events
> 
> Jon Stanley (2):
>       tools lib traceevent: Update FSF postal address to be URL's.
>       tools lib traceevent: Add copyright header
> 
> Joshua Zhu (1):
>       perf tools: Add anonymous huge page recognition
> 
> Namhyung Kim (22):
>       perf hists: Exchange order of comparing items when collapsing hists
>       perf hists: Link hist entries before inserting to an output tree
>       perf diff: Use internal rb tree for compute resort
>       perf test: Add a test case for hists__{match,link}
>       perf tests: Check python path on attr and binding test
>       perf header: Ensure read/write finished successfully
>       perf ui/gtk: Factor out common browser routines
>       perf ui/gtk: Setup browser window early
>       perf symbols: Include elf.h header regardless LIBELF_SUPPORT
>       perf bench: Flush stdout before starting bench suite
>       perf sort: Move misplaced sort entry functions
>       perf sort: Get rid of unnecessary __maybe_unused
>       perf sort: Fix --sort pid output
>       perf sort: Align cpu column to right
>       perf sort: Calculate parent column width too
>       perf sort: Clean up sort__first_dimension setting
>       perf sort: Separate out branch stack specific sort keys
>       perf report: Update documentation for sort keys
>       tools lib traceevent: Fix warning on '>=' operator
>       perf tools: Get rid of unused include of config.mak
>       perf tools: Do not include PERF-VERSION-FILE to Makefile
>       perf tools: Move ltrim() to util/string.c
> 
> Sasha Levin (5):
>       perf tools: remove redundant checks from _sort__sym_cmp
>       perf kmem: use ARRAY_SIZE instead of reinventing it
>       perf script: use ARRAY_SIZE instead of reinventing it
>       uprobes: remove redundant check
>       tools lib traceevent: test correct variable after allocation
> 
> Stephane Eranian (1):
>       perf tools: Mark branch_info maps as referenced
> 
> Sukadev Bhattiprolu (1):
>       perf tools: Fix PMU format parsing test failure
> 
> Thomas Jarosch (1):
>       perf tools: Fix possible (unlikely) buffer overflow
> 
> Tom Zanussi (4):
>       perf tools: Reinstate 'signed' field flag for tracepoints
>       perf script: Don't display trace info when invoking scripts
>       perf script: hook up perf_scripting_context->pevent
>       perf script: Remove workqueue-stats script
> 
> Vince Weaver (1):
>       perf: Missing field in PERF_RECORD_SAMPLE documentation
> 
>  include/uapi/linux/perf_event.h                    |   3 +-
>  kernel/events/uprobes.c                            |   3 +-
>  tools/lib/traceevent/event-parse.c                 |  10 +-
>  tools/lib/traceevent/event-parse.h                 |   3 +-
>  tools/lib/traceevent/event-utils.h                 |   3 +-
>  tools/lib/traceevent/parse-filter.c                |   3 +-
>  tools/lib/traceevent/parse-utils.c                 |  19 +
>  tools/lib/traceevent/trace-seq.c                   |   3 +-
>  tools/perf/Documentation/perf-report.txt           |  38 +-
>  tools/perf/Documentation/perf-script-python.txt    |   2 -
>  tools/perf/Documentation/perf-test.txt             |   4 +
>  tools/perf/Makefile                                |  17 +-
>  tools/perf/builtin-bench.c                         |   2 +
>  tools/perf/builtin-diff.c                          |  92 ++--
>  tools/perf/builtin-kmem.c                          |  10 +-
>  tools/perf/builtin-kvm.c                           |   3 +-
>  tools/perf/builtin-record.c                        | 127 +-----
>  tools/perf/builtin-report.c                        |   6 +-
>  tools/perf/builtin-sched.c                         |   6 +-
>  tools/perf/builtin-script.c                        |  17 +-
>  tools/perf/builtin-stat.c                          |  46 +-
>  tools/perf/builtin-top.c                           | 106 +----
>  tools/perf/config/utilities.mak                    |   6 +-
>  tools/perf/perf.c                                  |  32 +-
>  tools/perf/perf.h                                  |   6 -
>  tools/perf/scripts/perl/bin/workqueue-stats-record |   2 -
>  tools/perf/scripts/perl/bin/workqueue-stats-report |   3 -
>  tools/perf/scripts/perl/workqueue-stats.pl         | 129 ------
>  tools/perf/tests/attr.c                            |   4 +-
>  tools/perf/tests/attr.py                           |  27 +-
>  tools/perf/tests/attr/test-record-group1           |   2 +-
>  tools/perf/tests/builtin-test.c                    |  40 +-
>  tools/perf/tests/evsel-roundtrip-name.c            |   4 +-
>  tools/perf/tests/hists_link.c                      | 499 +++++++++++++++++++++
>  tools/perf/tests/parse-events.c                    |  98 +++-
>  tools/perf/tests/pmu.c                             |  11 +-
>  tools/perf/tests/python-use.c                      |  23 +
>  tools/perf/tests/tests.h                           |   8 +
>  tools/perf/tests/vmlinux-kallsyms.c                |   3 +-
>  tools/perf/ui/browser.c                            |   4 +-
>  tools/perf/ui/browsers/annotate.c                  |  33 +-
>  tools/perf/ui/gtk/browser.c                        | 227 +---------
>  tools/perf/ui/gtk/gtk.h                            |   9 +-
>  tools/perf/ui/gtk/hists.c                          | 226 ++++++++++
>  tools/perf/ui/stdio/hist.c                         |   6 +-
>  tools/perf/ui/util.c                               |  11 -
>  tools/perf/util/PERF-VERSION-GEN                   |   4 +-
>  tools/perf/util/debug.h                            |   1 -
>  tools/perf/util/evsel.c                            | 108 ++++-
>  tools/perf/util/evsel.h                            |   6 +
>  tools/perf/util/header.c                           |  75 ++--
>  tools/perf/util/hist.c                             |  79 +++-
>  tools/perf/util/hist.h                             |   4 +-
>  tools/perf/util/include/linux/bitops.h             |   1 +
>  tools/perf/util/intlist.c                          |  36 +-
>  tools/perf/util/intlist.h                          |   2 +-
>  tools/perf/util/machine.c                          |  64 ++-
>  tools/perf/util/machine.h                          |  32 +-
>  tools/perf/util/map.c                              |   3 +-
>  tools/perf/util/parse-events.c                     |  87 +++-
>  tools/perf/util/parse-events.h                     |  21 +-
>  tools/perf/util/parse-events.y                     |  64 +--
>  tools/perf/util/pmu.c                              |  46 +-
>  tools/perf/util/pmu.h                              |  15 +-
>  tools/perf/util/probe-finder.c                     |  10 +-
>  tools/perf/util/python.c                           |   9 +
>  .../perf/util/scripting-engines/trace-event-perl.c |   1 +
>  .../util/scripting-engines/trace-event-python.c    |   1 +
>  tools/perf/util/session.c                          |  75 ++--
>  tools/perf/util/session.h                          |  30 +-
>  tools/perf/util/sort.c                             | 230 +++++-----
>  tools/perf/util/sort.h                             |   8 +-
>  tools/perf/util/string.c                           |  18 +
>  tools/perf/util/symbol-elf.c                       |   3 -
>  tools/perf/util/symbol-minimal.c                   |   1 -
>  tools/perf/util/symbol.c                           |  14 +-
>  tools/perf/util/symbol.h                           |   2 +-
>  tools/perf/util/sysfs.c                            |   2 +-
>  tools/perf/util/top.h                              |   2 -
>  tools/perf/util/util.c                             |  24 +
>  tools/perf/util/util.h                             |   4 +
>  81 files changed, 1816 insertions(+), 1202 deletions(-)
>  delete mode 100644 tools/perf/scripts/perl/bin/workqueue-stats-record
>  delete mode 100644 tools/perf/scripts/perl/bin/workqueue-stats-report
>  delete mode 100644 tools/perf/scripts/perl/workqueue-stats.pl
>  create mode 100644 tools/perf/tests/hists_link.c
>  create mode 100644 tools/perf/tests/python-use.c
>  create mode 100644 tools/perf/ui/gtk/hists.c

Pulled, thanks a lot Arnaldo!

	Ingo

^ permalink raw reply

* [PATCH powerpc] Use VPA subfunction macros instead of numbers for vpa calls
From: Li Zhong @ 2013-01-25  8:12 UTC (permalink / raw)
  To: PowerPC email list; +Cc: Paul Mackerras

Use macros in vpa calls. 

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/plpar_wrappers.h |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index f368668..f35787b 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -58,40 +58,39 @@ static inline long extended_cede_processor(unsigned long latency_hint)
 static inline long vpa_call(unsigned long flags, unsigned long cpu,
 		unsigned long vpa)
 {
-	/* flags are in bits 16-18 (counting from most significant bit) */
-	flags = flags << (63 - 18);
+	flags = flags << H_VPA_FUNC_SHIFT;
 
 	return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
 }
 
 static inline long unregister_vpa(unsigned long cpu)
 {
-	return vpa_call(0x5, cpu, 0);
+	return vpa_call(H_VPA_DEREG_VPA, cpu, 0);
 }
 
 static inline long register_vpa(unsigned long cpu, unsigned long vpa)
 {
-	return vpa_call(0x1, cpu, vpa);
+	return vpa_call(H_VPA_REG_VPA, cpu, vpa);
 }
 
 static inline long unregister_slb_shadow(unsigned long cpu)
 {
-	return vpa_call(0x7, cpu, 0);
+	return vpa_call(H_VPA_DEREG_SLB, cpu, 0);
 }
 
 static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)
 {
-	return vpa_call(0x3, cpu, vpa);
+	return vpa_call(H_VPA_REG_SLB, cpu, vpa);
 }
 
 static inline long unregister_dtl(unsigned long cpu)
 {
-	return vpa_call(0x6, cpu, 0);
+	return vpa_call(H_VPA_DEREG_DTL, cpu, 0);
 }
 
 static inline long register_dtl(unsigned long cpu, unsigned long vpa)
 {
-	return vpa_call(0x2, cpu, vpa);
+	return vpa_call(H_VPA_REG_DTL, cpu, vpa);
 }
 
 static inline long plpar_page_set_loaned(unsigned long vpa)
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v2 powerpc ] Avoid debug_smp_processor_id() check in SHARED_PROCESSOR
From: Li Zhong @ 2013-01-25  7:51 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Paul E. McKenney, PowerPC email list
In-Reply-To: <1359063889.29726.36.camel@pasglop>

Use local_paca directly in macro SHARED_PROCESSOR, as all processors
have the same value for the field shared_proc, so we don't need care
racy here.

Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/spinlock.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 7124fc0..5b23f91 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -96,7 +96,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
 
 #if defined(CONFIG_PPC_SPLPAR)
 /* We only yield to the hypervisor if we are in shared processor mode */
-#define SHARED_PROCESSOR (get_lppaca()->shared_proc)
+#define SHARED_PROCESSOR (local_paca->lppaca_ptr->shared_proc)
 extern void __spin_yield(arch_spinlock_t *lock);
 extern void __rw_yield(arch_rwlock_t *lock);
 #else /* SPLPAR */
-- 
1.7.1

^ permalink raw reply related

* [Solved] SD Card over SPI, not working for MPC8313
From: R.Patil @ 2013-01-25  4:41 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <OF36C99B74.048D73FE-ON65257AF5.004A3F3C-65257AF5.004A3F44@LocalDomain>

Hello All,

The problem has been resolved.

After some debugging, we observed that problem was in initialisation of 'fs=
l=5Fspi' driver. The 'fsl=5Fspi' driver extracts platform data from device =
tree. This platform data contains gpio number for chip-select control (cs=
=5Fcontrol). Since, MPC8313E platform doesn't support 'gpiolib', 'fsl=5Fspi=
' was unable to extract gpio number for chip-select control. This was forci=
ng it to work without chip-select line. So we did (dirty) work around to in=
itialise 'cs=5Fcontrol' field explicitly (in function 'of=5Ffsl=5Fspi=5Fget=
=5Fchipselects' defined in spi=5Ffsl=5Fspi.c) with our customised handler w=
hich toggles gpio controlling chip-select. This did the job and SD card is =
working fine now.

Still we have some questions just for understanding purpose. We alternately=
 tried to initialise spi platform data by old method i.e specifying it in '=
mpc831x=5Frdb.c' as it is done in 'mpc832x=5Frdb.c' but that didn't work. S=
o our first question is, does it work for MPC8323ERDB? And one more questio=
n is, does 'MPC8313ERDB' platform support 'gpiolib' driver available in mai=
nline kernel?
The answers might help us to clean our code and also to improve our underst=
anding.

Thanks and Regards,
Rahul Patil
=20
-----R Patil/SW HW Dev/Pune EL2/R N D/Messung wrote: -----

To: linuxppc-dev@lists.ozlabs.org
From: R Patil/SW HW Dev/Pune EL2/R N D/Messung
Date: 01/16/2013 07:00PM
Subject: SD Card over SPI, not working for MPC8313=20

 Hello,

We are working on board based on Freescale MPC8313ERDB. We have ported linu=
x 3.0.46 kernel on it. We have to use SD card over SPI. We are trying to us=
e 'mmc=5Fspi' driver for the same. We are able to detect SD card insertion =
by the interrupt (gpio interrupt is used to detect card insertion). But we =
are not able to initialise the card. Is the 'mmc=5Fspi' support for MPC8313=
ERDB broken?=20

If no, what could be the reason we are getting timeout error by function 'm=
mc=5Fspi=5Fresponse=5Fget()'? =20

If anybody could just give a hint to solve or debug the problem. =20

Thanks and Regards,
Rahul Patil



Email Disclaimer:
  ---------------------------

This e-mail and any files transmitted with it are for the sole use of the i=
ntended recipient(s) and may contain confidential and  privileged informati=
on. Computer viruses can be transmitted via email.The recipient should chec=
k this email and any  attachments for the presence of viruses. The company =
accepts no liability for any damage caused by any virus transmitted by this=
 email.

^ permalink raw reply

* Re: [PATCH 2/8] mm: use vm_unmapped_area() on alpha architecture
From: Michael Cree @ 2013-01-25  3:49 UTC (permalink / raw)
  To: Michel Lespinasse
  Cc: Rik van Riel, Tony Luck, linux-ia64, linux-parisc,
	James E.J. Bottomley, linux-kernel, David Howells, linux-mm,
	linux-alpha, Matt Turner, linuxppc-dev, Andrew Morton
In-Reply-To: <1357694895-520-3-git-send-email-walken@google.com>

On 9/01/2013, at 2:28 PM, Michel Lespinasse wrote:
> Update the alpha arch_get_unmapped_area function to make use of
> vm_unmapped_area() instead of implementing a brute force search.
>
> Signed-off-by: Michel Lespinasse <walken@google.com>

'Tis running fine on my alpha.

Tested-by: Michael Cree <mcree@orcon.net.nz>

Cheers
Michael.

^ permalink raw reply

* Re: Freescale P2020 CPU Freeze over PCIe abort signal
From: Scott Wood @ 2013-01-25  1:03 UTC (permalink / raw)
  To: siva kumar; +Cc: linuxppc-dev
In-Reply-To: <CAJrcUeRfz3m_NcE+HaVA8_3bGGuwaTM0ocPc7SYnhVaEaJyF2w@mail.gmail.com>

On 01/24/2013 05:53:51 AM, siva kumar wrote:
> Thank you Scott for the reply.
> May I know did u got out of this issue and   can i get some brief on =20
> what
> changes they had suggested.

I wasn't the one that had the issue.  Why not send an e-mail to Eran =20
Liberty?

-Scott

> On Thu, Jan 24, 2013 at 3:10 AM, Scott Wood <scottwood@freescale.com> =20
> wrote:
>=20
> > On 01/23/2013 11:41:26 AM, siva kumar wrote:
> >
> >> Hi ,
> >>
> >> Is there any update on this , am getting in to the same state .
> >> https://lists.ozlabs.org/**pipermail/linuxppc-dev/2010-**
> >> =20
> October/086680.html<https://lists.ozlabs.org/pipermail/linuxppc-dev/2010-=
October/086680.html>
> >>
> >
> > Eran's initial comment of "This should probably go to the Freescale
> > support" seems right.  You can reach Freescale support at
> > support@freescale.com.
> >
> > -Scott
> >
>=20

=

^ permalink raw reply

* [PATCH 2/2] powerpc: Change hardware breakpoint to allow longer ranges
From: Michael Neuling @ 2013-01-25  1:02 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Neuling, linuxppc-dev
In-Reply-To: <1359075779-27492-1-git-send-email-mikey@neuling.org>

Change the hardware breakpoint code so that we can support wider ranged
breakpoints.

This means both ptrace and perf hardware breakpoints can use upto 512 byte long
breakpoints when using the DAWR and only 8 byte when using the DABR.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/include/asm/hw_breakpoint.h |    2 --
 arch/powerpc/kernel/hw_breakpoint.c      |   12 ++++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
index 96437e5..eb0f4ac 100644
--- a/arch/powerpc/include/asm/hw_breakpoint.h
+++ b/arch/powerpc/include/asm/hw_breakpoint.h
@@ -57,8 +57,6 @@ struct pmu;
 struct perf_sample_data;
 
 #define HW_BREAKPOINT_ALIGN 0x7
-/* Maximum permissible length of any HW Breakpoint */
-#define HW_BREAKPOINT_LEN 0x8
 
 extern int hw_breakpoint_slots(int type);
 extern int arch_bp_generic_fields(int type, int *gen_bp_type);
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 2a3e8dd..a949bdf 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -142,7 +142,7 @@ int arch_bp_generic_fields(int type, int *gen_bp_type)
  */
 int arch_validate_hwbkpt_settings(struct perf_event *bp)
 {
-	int ret = -EINVAL;
+	int ret = -EINVAL, length_max;
 	struct arch_hw_breakpoint *info = counter_arch_bp(bp);
 
 	if (!bp)
@@ -171,8 +171,16 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
 	 * HW_BREAKPOINT_ALIGN by rounding off to the lower address, the
 	 * 'symbolsize' should satisfy the check below.
 	 */
+	length_max = 8; /* DABR */
+	if (cpu_has_feature(CPU_FTR_DAWR)) {
+		length_max = 512 ; /* 64 doublewords */
+		/* DAWR region can't cross 512 boundary */
+		if ((bp->attr.bp_addr >> 10) != 
+		    ((bp->attr.bp_addr + bp->attr.bp_len) >> 10))
+			return -EINVAL;
+	}
 	if (info->len >
-	    (HW_BREAKPOINT_LEN - (info->address & HW_BREAKPOINT_ALIGN)))
+	    (length_max - (info->address & HW_BREAKPOINT_ALIGN)))
 		return -EINVAL;
 	return 0;
 }
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 1/2] powerpc: Add length setting to set_dawr
From: Michael Neuling @ 2013-01-25  1:02 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Neuling, linuxppc-dev

Currently we set the length field in the DAWR to 0 which defaults it to one
double word (64bits) which is the same as the DABR.

Change this so that we can set it to longer values as supported by the DAWR.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/process.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index bccc81b..f49a05f 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -420,7 +420,7 @@ static inline int set_dabr(struct arch_hw_breakpoint *brk)
 
 static inline int set_dawr(struct arch_hw_breakpoint *brk)
 {
-	unsigned long dawr, dawrx;
+	unsigned long dawr, dawrx, mrd;
 
 	dawr = brk->address;
 
@@ -430,6 +430,14 @@ static inline int set_dawr(struct arch_hw_breakpoint *brk)
 		                   << (63 - 59); //* translate */
 	dawrx |= (brk->type & (HW_BRK_TYPE_PRIV_ALL)) \
 		                   >> 3; //* PRIM bits */
+	/* dawr length is stored in field MDR bits 48:53.  Matches range in
+	   doublewords (64 bits) baised by -1 eg. 0b000000=1DW and
+	   0b111111=64DW.
+	   brk->len is in bytes.
+	   This aligns up to double word size, shifts and does the bias.
+	*/
+	mrd = ((brk->len + 7) >> 3) - 1;
+	dawrx |= (mrd & 0x3f) << (63 - 53);
 
 	if (ppc_md.set_dawr)
 		return ppc_md.set_dawr(dawr, dawrx);
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH] perf/Power: PERF_EVENT_IOC_ENABLE does not reenable event
From: Sukadev Bhattiprolu @ 2013-01-24 23:29 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Anton Blanchard, Maynard Johnson
In-Reply-To: <20130124050505.GA14070@drongo>

Paul Mackerras [paulus@samba.org] wrote:
| > +	/*
| > +	 * If this event was disabled in record_and_restart() because we
| > +	 * exceeded the ->event_limit, this is probably a good time to
| > +	 * re-enable the event ? If we don't reenable the event, we will
| > +	 * never notify the user again about this event.
| > +	 */
| 
| The comment seems a bit tentative. :)  If the PERF_EF_START bit is set
| then we are being told to restart the event.
| 
| >  	if (!(ef_flags & PERF_EF_START))
| >  		event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
| > +	else
| > +		event->hw.state &= ~PERF_HES_STOPPED;
| 
| This looks fine, though I think you could equally well just set
| event->hw.state to 0 in the else clause.  That would clear the
| UPTODATE flag too, which is appropriate since we are about to put the
| event on a hardware counter.

Agree. I submitted a new patch with better comments and patch description
and cleared the state to 0.

Thanks for the review.

Sukadev

^ permalink raw reply

* [PATCH][v2] perf/Power: PERF_EVENT_IOC_ENABLE does not reenable event
From: Sukadev Bhattiprolu @ 2013-01-24 23:25 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Maynard Johnson, Anton Blanchard, Paul Mackerras, linuxppc-dev

perf/Power: PERF_EVENT_IOC_ENABLE does not reenable event

If we disable a perf event because we exceeded the specified ->event_limit,
power_pmu_stop() sets the PERF_HES_STOPPED flag on the event.

If the application then re-enables the event using PERF_EVENT_IOC_ENABLE
ioctl, we don't ever clear this STOPPED flag. Consequently, the user space
is never notified of the event.

Following message has more background and test case.

    http://lists.eecs.utk.edu/pipermail/ptools-perfapi/2012-October/002528.html

Used the following test cases to verify that this patch works on latest PAPI.

	$ papi.git/src/ctests/nonthread PAPI_TOT_CYC@5000000

	$ papi.git/src/ctests/overflow_single_event

Changelog[v2]:
	- [Paul Mackerras] Also clear PERF_HES_UPTODATE flag since we are
	  restarting the event; cleanup comments and patch description.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/perf/core-book3s.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index aa2465e..4b1e584 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -880,8 +880,16 @@ static int power_pmu_add(struct perf_event *event, int ef_flags)
 	cpuhw->events[n0] = event->hw.config;
 	cpuhw->flags[n0] = event->hw.event_base;
 
+	/*
+	 * This event may have been disabled/stopped in record_and_restart()
+	 * because we exceeded the ->event_limit. If re-starting the event,
+	 * clear the ->hw.state (STOPPED and UPTODATE flags), so the user
+	 * notification is re-enabled.
+	 */
 	if (!(ef_flags & PERF_EF_START))
 		event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
+	else
+		event->hw.state = 0;
 
 	/*
 	 * If group events scheduling transaction was started,
-- 
1.7.1

^ permalink raw reply related

* RE: [PATCH 2/2] powerpc/85xx: describe the PAMU topology in the device tree
From: Yoder Stuart-B08248 @ 2013-01-24 22:57 UTC (permalink / raw)
  To: Gala Kumar-B11780, Wood Scott-B07421
  Cc: linuxppc-dev@ozlabs.org list, Timur Tabi
In-Reply-To: <CF1EE7AED478CD48A05574C8E2DA142D6DA7A5@039-SN1MPN1-005.039d.mgd.msft.net>



> -----Original Message-----
> From: Gala Kumar-B11780
> Sent: Wednesday, January 23, 2013 11:27 AM
> To: Wood Scott-B07421; Yoder Stuart-B08248
> Cc: linuxppc-dev@ozlabs.org list; Timur Tabi
> Subject: Re: [PATCH 2/2] powerpc/85xx: describe the PAMU topology in the =
device tree
>=20
>=20
> On Jan 17, 2013, at 4:34 PM, Timur Tabi wrote:
>=20
> > From: Timur Tabi <timur@freescale.com>
> >
> > The PAMU caches use the LIODNs to determine which cache lines hold the
> > entries for the corresponding LIODs.  The LIODNs must therefore be
> > carefully assigned to avoid cache thrashing -- two active LIODs with
> > LIODNs that put them in the same cache line.
> >
> > Currently, LIODNs are statically assigned by U-Boot, but this has
> > limitations.  LIODNs are assigned even for devices that may be disabled
> > or unused by the kernel.  Static assignments also do not allow for devi=
ce
> > drivers which may know which LIODs can be used simultaneously.  In
> > other words, we really should assign LIODNs dynamically in Linux.
> >
> > To do that, we need to describe the PAMU device and cache topologies in
> > the device trees.
> >
> > Signed-off-by: Timur Tabi <timur@freescale.com>
> > ---
> > .../devicetree/bindings/powerpc/fsl/guts.txt       |   14 ++-
> > .../devicetree/bindings/powerpc/fsl/pamu.txt       |  142 +++++++++++++=
+++++++
> > arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |   87 +++++++++++--
> > arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |   87 +++++++++++--
> > arch/powerpc/boot/dts/fsl/p4080si-post.dtsi        |   68 +++++++++-
> > arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |   92 +++++++++++--
> > arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |   92 +++++++++++--
> > 7 files changed, 533 insertions(+), 49 deletions(-)
> > create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/pamu.t=
xt
>=20
> Scott, Stuart, does this have your guys Ack?

Ack

^ permalink raw reply

* [PATCH][v3] KVM: PPC: add paravirt idle loop for 64-bit book E
From: Stuart Yoder @ 2013-01-24 22:11 UTC (permalink / raw)
  To: benh; +Cc: kvm-ppc, linuxppc-dev, agraf, kvm, Stuart Yoder

From: Stuart Yoder <stuart.yoder@freescale.com>

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---

-v3
   -whitespace cleanup, deleted stray comma, added comment

 arch/powerpc/kernel/epapr_hcalls.S |    2 ++
 arch/powerpc/kernel/idle_book3e.S  |   32 ++++++++++++++++++++++++++++++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
index 62c0dc2..9f1ebf7 100644
--- a/arch/powerpc/kernel/epapr_hcalls.S
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -17,6 +17,7 @@
 #include <asm/asm-compat.h>
 #include <asm/asm-offsets.h>
 
+#ifndef CONFIG_PPC64
 /* epapr_ev_idle() was derived from e500_idle() */
 _GLOBAL(epapr_ev_idle)
 	CURRENT_THREAD_INFO(r3, r1)
@@ -42,6 +43,7 @@ epapr_ev_idle_start:
 	 * _TLF_NAPPING.
 	 */
 	b	idle_loop
+#endif
 
 /* Hypercall entry point. Will be patched with device tree instructions. */
 .global epapr_hypercall_start
diff --git a/arch/powerpc/kernel/idle_book3e.S b/arch/powerpc/kernel/idle_book3e.S
index 4c7cb400..bfb73cc 100644
--- a/arch/powerpc/kernel/idle_book3e.S
+++ b/arch/powerpc/kernel/idle_book3e.S
@@ -16,11 +16,13 @@
 #include <asm/ppc-opcode.h>
 #include <asm/processor.h>
 #include <asm/thread_info.h>
+#include <asm/epapr_hcalls.h>
 
 /* 64-bit version only for now */
 #ifdef CONFIG_PPC64
 
-_GLOBAL(book3e_idle)
+.macro BOOK3E_IDLE name loop
+_GLOBAL(\name)
 	/* Save LR for later */
 	mflr	r0
 	std	r0,16(r1)
@@ -67,7 +69,33 @@ _GLOBAL(book3e_idle)
 
 	/* We can now re-enable hard interrupts and go to sleep */
 	wrteei	1
-1:	PPC_WAIT(0)
+	\loop
+
+.endm
+
+.macro BOOK3E_IDLE_LOOP
+1:
+	PPC_WAIT(0)
 	b	1b
+.endm
+
+/* epapr_ev_idle_start below is patched with the proper hcall
+   opcodes during kernel initialization */
+.macro EPAPR_EV_IDLE_LOOP
+idle_loop:
+	LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
+
+.global epapr_ev_idle_start
+epapr_ev_idle_start:
+	li      r3, -1
+	nop
+	nop
+	nop
+	b       idle_loop
+.endm
+
+BOOK3E_IDLE epapr_ev_idle EPAPR_EV_IDLE_LOOP
+
+BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
 
 #endif /* CONFIG_PPC64 */
-- 
1.7.9.7

^ permalink raw reply related

* Re: [PATCH powerpc ] Avoid debug_smp_processor_id() check in arch_spin_unlock_wait()
From: Benjamin Herrenschmidt @ 2013-01-24 21:44 UTC (permalink / raw)
  To: Li Zhong; +Cc: Paul Mackerras, Paul E. McKenney, PowerPC email list
In-Reply-To: <1359022384.2666.46.camel@ThinkPad-T5421.cn.ibm.com>

On Thu, 2013-01-24 at 18:13 +0800, Li Zhong wrote:
> I'm not very clear about the "risk" you mentioned above. It seems to me
> that the freeing of lppaca only appeared in free_unused_pacas(), called
> by early setup code, at which time hotplug seems impossible. 
> 
> I must missed something ...

No you are right, we don't free them at the moment.

> I'll update the SHARED_PROCESSOR directly, it seems better to me now.
> (wonder why I gave it up immediately when it first came into my mind
> while I was doing the last update...)

Cheers,
Ben.

^ permalink raw reply

* [GIT PULL 00/74] perf/core improvements and fixes
From: Arnaldo Carvalho de Melo @ 2013-01-24 20:07 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Feng Tang, Srikar Dronamraju, Peter Zijlstra, Frederic Weisbecker,
	Al Cooper, H.C. Lee, linuxppc-dev, Jon Stanley, Andi Kleen,
	Paul Mackerras, Frederik Deweerdt, Masami Hiramatsu, Jiri Olsa,
	Arnaldo Carvalho de Melo, Namhyung Kim, Ulrich Drepper,
	Hitoshi Mitake, Joshua Zhu, Xiao Guangrong, Akihiro Nagai,
	Arnaldo Carvalho de Melo, Sasha Levin, Sukadev Bhattiprolu,
	Stefan Beller, Thomas Jarosch, Corey Ashford, Namhyung Kim,
	Anton Blanchard, Steven Rostedt, Arnaldo Carvalho de Melo,
	Stephane Eranian, Namhyung Kim, Tom Zanussi, Hitoshi Mitake,
	Vince Weaver, Mike Galbraith, linux-kernel, Pekka Enberg,
	David Ahern

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit 203e04c16330c880538588e932743f404ee4fd66:

  Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2013-01-24 16:30:45 +0100)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-core-for-mingo

for you to fetch changes up to 2ae828786c65ab8f587647bd0f22f8fe00f1f238:

  perf test: Allow skipping tests (2013-01-24 16:40:53 -0300)

----------------------------------------------------------------
perf/core improvements and fixes

. Allow skipping problematic entries in 'perf test'.

. Fix some namespace problems in the event parsing routines.

. Add 'perf test' entry to make sure the python binding doesn't have
  linking problems.

. Adjust 'perf test' attr tests verbosity levels.

. Make tools/perf build with GNU make v3.80, fix from Al Cooper.

. Do missing feature fallbacks in just one place, removing duplicated
  code in multiple tools.

. Fix some memory leaks, from David Ahern.

. Fix segfault when drawing out-of-bounds jumps, from Frederik Deweerdt.

. Allow of casting an array of char to string in 'perf probe', from
  Hyeoncheol Lee.

. Add support for wildcard in tracepoint system name, from Jiri Olsa.

. Update FSF postal address to be URL's, from Jon Stanley.

. Add anonymous huge page recognition, from Joshua Zhu.

. Remove some needless feature test checks, from Namhyung Kim.

. Multiple improvements to the sort routines, from Namhyung Kim.

. Fix warning on '>=' operator in libtraceevent, from Namhyung Kim.

. Use ARRAY_SIZE instead of reinventing it in 'perf script' and 'perf kmem',
  from Sasha Levin.

. Remove some redundant checks, from Sasha Levin.

. Test correct variable after allocation in libtraceevent, fix from Sasha Levin.

. Mark branch_info maps as referenced, fix from Stephane Eranian.

. Fix PMU format parsing test failure, from Sukadev Bhattiprolu.

. Fix possible (unlikely) buffer overflow, from Thomas Jarosch.

. Multiple 'perf script' fixes, from Tom Zanussi.

. Add missing field in PERF_RECORD_SAMPLE documentation, from Vince Weaver.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Al Cooper (1):
      perf tools: Fix GNU make v3.80 compatibility issue

Arnaldo Carvalho de Melo (24):
      perf test: Remove leftover temp file left by one of the attr tests
      perf tests: Adjust some message log levels to help diagnosing problems in attr tests
      perf evsel: Do missing feature fallbacks in just one place
      perf evsel: Introduce event fallback method
      perf evsel: Introduce perf_evsel__open_strerror method
      perf test: Check for linking problems in the python binding
      perf python: Fix breakage introduced by the test_attr infrastructure
      perf record: Don't pass host machine to guest synthesizer
      perf hists: Rename hists__fprintf_nr_events to events_stats__fprintf
      perf session: There is no need for a per session hists instance
      perf machine: Introduce struct machines
      perf machine: Simplify accessing the host machine
      perf kvm: Initialize file_name var to fix segfault
      perf tests: Don't fail if a matching vmlinux isn't found, skip that test
      perf tools: Fix usage of __ in parse_events_term struct
      perf pmu: Fix usage of __ in struct names
      perf ui browsers: Fix usage of __ in struct names
      perf tools: Fix usage of __ in event parsing struct names
      perf tests: Use ARRAY_SIZE() were applicable
      perf pmu: Privatize perf_pmu_{format,alias} structs
      perf tools: Remove some needless die() calls from the main routine
      perf tools: Allow passing NULL to intlist__find
      perf tools: Allow passing a list to intlist__new
      perf test: Allow skipping tests

David Ahern (3):
      perf symbols: Move name malloc to when needed in dso__load
      perf symbols: Mark vmlinux filename as allocated
      perf tools: Move get_term_dimensions from top to util.c

Frederik Deweerdt (1):
      perf annotate browser: Fix segfault when drawing out-of-bounds jumps

Hyeoncheol Lee (1):
      perf probe: Allow of casting an array of char to string

Jiri Olsa (6):
      perf tools: Add missing closedir in multi tracepoint processing
      perf tools: Add support for wildcard in tracepoint system name
      perf tests: Add event parsing test for '*:*' tracepoints
      perf tests: Fix PYTHONPATH for python-use test tracepoints
      perf tests: Add return states enum for tests
      perf tools: Remove unused 'unset' parameter from parse_events

Jon Stanley (2):
      tools lib traceevent: Update FSF postal address to be URL's.
      tools lib traceevent: Add copyright header

Joshua Zhu (1):
      perf tools: Add anonymous huge page recognition

Namhyung Kim (22):
      perf hists: Exchange order of comparing items when collapsing hists
      perf hists: Link hist entries before inserting to an output tree
      perf diff: Use internal rb tree for compute resort
      perf test: Add a test case for hists__{match,link}
      perf tests: Check python path on attr and binding test
      perf header: Ensure read/write finished successfully
      perf ui/gtk: Factor out common browser routines
      perf ui/gtk: Setup browser window early
      perf symbols: Include elf.h header regardless LIBELF_SUPPORT
      perf bench: Flush stdout before starting bench suite
      perf sort: Move misplaced sort entry functions
      perf sort: Get rid of unnecessary __maybe_unused
      perf sort: Fix --sort pid output
      perf sort: Align cpu column to right
      perf sort: Calculate parent column width too
      perf sort: Clean up sort__first_dimension setting
      perf sort: Separate out branch stack specific sort keys
      perf report: Update documentation for sort keys
      tools lib traceevent: Fix warning on '>=' operator
      perf tools: Get rid of unused include of config.mak
      perf tools: Do not include PERF-VERSION-FILE to Makefile
      perf tools: Move ltrim() to util/string.c

Sasha Levin (5):
      perf tools: remove redundant checks from _sort__sym_cmp
      perf kmem: use ARRAY_SIZE instead of reinventing it
      perf script: use ARRAY_SIZE instead of reinventing it
      uprobes: remove redundant check
      tools lib traceevent: test correct variable after allocation

Stephane Eranian (1):
      perf tools: Mark branch_info maps as referenced

Sukadev Bhattiprolu (1):
      perf tools: Fix PMU format parsing test failure

Thomas Jarosch (1):
      perf tools: Fix possible (unlikely) buffer overflow

Tom Zanussi (4):
      perf tools: Reinstate 'signed' field flag for tracepoints
      perf script: Don't display trace info when invoking scripts
      perf script: hook up perf_scripting_context->pevent
      perf script: Remove workqueue-stats script

Vince Weaver (1):
      perf: Missing field in PERF_RECORD_SAMPLE documentation

 include/uapi/linux/perf_event.h                    |   3 +-
 kernel/events/uprobes.c                            |   3 +-
 tools/lib/traceevent/event-parse.c                 |  10 +-
 tools/lib/traceevent/event-parse.h                 |   3 +-
 tools/lib/traceevent/event-utils.h                 |   3 +-
 tools/lib/traceevent/parse-filter.c                |   3 +-
 tools/lib/traceevent/parse-utils.c                 |  19 +
 tools/lib/traceevent/trace-seq.c                   |   3 +-
 tools/perf/Documentation/perf-report.txt           |  38 +-
 tools/perf/Documentation/perf-script-python.txt    |   2 -
 tools/perf/Documentation/perf-test.txt             |   4 +
 tools/perf/Makefile                                |  17 +-
 tools/perf/builtin-bench.c                         |   2 +
 tools/perf/builtin-diff.c                          |  92 ++--
 tools/perf/builtin-kmem.c                          |  10 +-
 tools/perf/builtin-kvm.c                           |   3 +-
 tools/perf/builtin-record.c                        | 127 +-----
 tools/perf/builtin-report.c                        |   6 +-
 tools/perf/builtin-sched.c                         |   6 +-
 tools/perf/builtin-script.c                        |  17 +-
 tools/perf/builtin-stat.c                          |  46 +-
 tools/perf/builtin-top.c                           | 106 +----
 tools/perf/config/utilities.mak                    |   6 +-
 tools/perf/perf.c                                  |  32 +-
 tools/perf/perf.h                                  |   6 -
 tools/perf/scripts/perl/bin/workqueue-stats-record |   2 -
 tools/perf/scripts/perl/bin/workqueue-stats-report |   3 -
 tools/perf/scripts/perl/workqueue-stats.pl         | 129 ------
 tools/perf/tests/attr.c                            |   4 +-
 tools/perf/tests/attr.py                           |  27 +-
 tools/perf/tests/attr/test-record-group1           |   2 +-
 tools/perf/tests/builtin-test.c                    |  40 +-
 tools/perf/tests/evsel-roundtrip-name.c            |   4 +-
 tools/perf/tests/hists_link.c                      | 499 +++++++++++++++++++++
 tools/perf/tests/parse-events.c                    |  98 +++-
 tools/perf/tests/pmu.c                             |  11 +-
 tools/perf/tests/python-use.c                      |  23 +
 tools/perf/tests/tests.h                           |   8 +
 tools/perf/tests/vmlinux-kallsyms.c                |   3 +-
 tools/perf/ui/browser.c                            |   4 +-
 tools/perf/ui/browsers/annotate.c                  |  33 +-
 tools/perf/ui/gtk/browser.c                        | 227 +---------
 tools/perf/ui/gtk/gtk.h                            |   9 +-
 tools/perf/ui/gtk/hists.c                          | 226 ++++++++++
 tools/perf/ui/stdio/hist.c                         |   6 +-
 tools/perf/ui/util.c                               |  11 -
 tools/perf/util/PERF-VERSION-GEN                   |   4 +-
 tools/perf/util/debug.h                            |   1 -
 tools/perf/util/evsel.c                            | 108 ++++-
 tools/perf/util/evsel.h                            |   6 +
 tools/perf/util/header.c                           |  75 ++--
 tools/perf/util/hist.c                             |  79 +++-
 tools/perf/util/hist.h                             |   4 +-
 tools/perf/util/include/linux/bitops.h             |   1 +
 tools/perf/util/intlist.c                          |  36 +-
 tools/perf/util/intlist.h                          |   2 +-
 tools/perf/util/machine.c                          |  64 ++-
 tools/perf/util/machine.h                          |  32 +-
 tools/perf/util/map.c                              |   3 +-
 tools/perf/util/parse-events.c                     |  87 +++-
 tools/perf/util/parse-events.h                     |  21 +-
 tools/perf/util/parse-events.y                     |  64 +--
 tools/perf/util/pmu.c                              |  46 +-
 tools/perf/util/pmu.h                              |  15 +-
 tools/perf/util/probe-finder.c                     |  10 +-
 tools/perf/util/python.c                           |   9 +
 .../perf/util/scripting-engines/trace-event-perl.c |   1 +
 .../util/scripting-engines/trace-event-python.c    |   1 +
 tools/perf/util/session.c                          |  75 ++--
 tools/perf/util/session.h                          |  30 +-
 tools/perf/util/sort.c                             | 230 +++++-----
 tools/perf/util/sort.h                             |   8 +-
 tools/perf/util/string.c                           |  18 +
 tools/perf/util/symbol-elf.c                       |   3 -
 tools/perf/util/symbol-minimal.c                   |   1 -
 tools/perf/util/symbol.c                           |  14 +-
 tools/perf/util/symbol.h                           |   2 +-
 tools/perf/util/sysfs.c                            |   2 +-
 tools/perf/util/top.h                              |   2 -
 tools/perf/util/util.c                             |  24 +
 tools/perf/util/util.h                             |   4 +
 81 files changed, 1816 insertions(+), 1202 deletions(-)
 delete mode 100644 tools/perf/scripts/perl/bin/workqueue-stats-record
 delete mode 100644 tools/perf/scripts/perl/bin/workqueue-stats-report
 delete mode 100644 tools/perf/scripts/perl/workqueue-stats.pl
 create mode 100644 tools/perf/tests/hists_link.c
 create mode 100644 tools/perf/tests/python-use.c
 create mode 100644 tools/perf/ui/gtk/hists.c

^ permalink raw reply

* [PATCH 59/74] perf tools: Fix PMU format parsing test failure
From: Arnaldo Carvalho de Melo @ 2013-01-24 20:08 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Anton Blanchard, linux-kernel, Arnaldo Carvalho de Melo,
	linuxppc-dev, Paul Mackerras, Sukadev Bhattiprolu, Jiri Olsa
In-Reply-To: <1359058103-31645-1-git-send-email-acme@infradead.org>

From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>

On POWER, the 'perf format parsing' test always fails.

Looks like it is because memset() is being passed number of longs rather
than number of bytes. It is interesting that the test always passes on
my x86 box.

With this patch, the test passes on POWER and continues to pass on x86.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Anton Blanchard <anton@au1.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Link: http://lkml.kernel.org/r/20130117172814.GA18882@us.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/include/linux/bitops.h | 1 +
 tools/perf/util/pmu.c                  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h
index a55d8cf..45cf10a 100644
--- a/tools/perf/util/include/linux/bitops.h
+++ b/tools/perf/util/include/linux/bitops.h
@@ -14,6 +14,7 @@
 #define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
 #define BITS_TO_U64(nr)         DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64))
 #define BITS_TO_U32(nr)         DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
+#define BITS_TO_BYTES(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE)
 
 #define for_each_set_bit(bit, addr, size) \
 	for ((bit) = find_first_bit((addr), (size));		\
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 9bdc60c..b93ff14 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -548,7 +548,7 @@ void perf_pmu__set_format(unsigned long *bits, long from, long to)
 	if (!to)
 		to = from;
 
-	memset(bits, 0, BITS_TO_LONGS(PERF_PMU_FORMAT_BITS));
+	memset(bits, 0, BITS_TO_BYTES(PERF_PMU_FORMAT_BITS));
 	for (b = from; b <= to; b++)
 		set_bit(b, bits);
 }
-- 
1.8.1.1.361.gec3ae6e

^ permalink raw reply related

* Re: [RFC/PATCH 32/32] usb: gadget: drop now unnecessary flag
From: Felipe Balbi @ 2013-01-24 19:09 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: kgene.kim, eric.y.miao, kuninori.morimoto.gx, alexander.shishkin,
	gregkh, yoshihiro.shimoda.uh, Linux USB Mailing List,
	nicolas.ferre, linux-geode, Felipe Balbi, Linux OMAP Mailing List,
	linux-samsung-soc, haojian.zhuang, ben-linux, dahlmann.thomas,
	linux, linuxppc-dev, linux-arm-kernel
In-Reply-To: <2268214.yJrDJgELNj@flatron>

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

On Thu, Jan 24, 2013 at 07:52:52PM +0100, Tomasz Figa wrote:
> Hi Felipe,
> 
> On Thursday 24 of January 2013 17:46:10 Felipe Balbi wrote:
> > We don't need the ->register_my_device flag
> > anymore because all UDC drivers have been
> > properly converted.
> > 
> > Let's remove every history of it.
> > 
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> >  drivers/usb/chipidea/udc.c             | 1 -
> >  drivers/usb/dwc3/gadget.c              | 1 -
> >  drivers/usb/gadget/amd5536udc.c        | 1 -
> >  drivers/usb/gadget/at91_udc.c          | 1 -
> >  drivers/usb/gadget/atmel_usba_udc.c    | 1 -
> >  drivers/usb/gadget/bcm63xx_udc.c       | 1 -
> >  drivers/usb/gadget/dummy_hcd.c         | 1 -
> >  drivers/usb/gadget/fsl_qe_udc.c        | 1 -
> >  drivers/usb/gadget/fsl_udc_core.c      | 1 -
> >  drivers/usb/gadget/fusb300_udc.c       | 1 -
> >  drivers/usb/gadget/goku_udc.c          | 1 -
> >  drivers/usb/gadget/imx_udc.c           | 1 -
> >  drivers/usb/gadget/lpc32xx_udc.c       | 1 -
> >  drivers/usb/gadget/m66592-udc.c        | 1 -
> >  drivers/usb/gadget/mv_u3d_core.c       | 1 -
> >  drivers/usb/gadget/mv_udc_core.c       | 1 -
> >  drivers/usb/gadget/net2272.c           | 1 -
> >  drivers/usb/gadget/net2280.c           | 1 -
> >  drivers/usb/gadget/omap_udc.c          | 1 -
> >  drivers/usb/gadget/pch_udc.c           | 1 -
> >  drivers/usb/gadget/pxa25x_udc.c        | 1 -
> >  drivers/usb/gadget/pxa27x_udc.c        | 1 -
> >  drivers/usb/gadget/r8a66597-udc.c      | 1 -
> >  drivers/usb/gadget/s3c-hsotg.c         | 1 -
> >  drivers/usb/gadget/s3c-hsudc.c         | 1 -
> >  drivers/usb/gadget/s3c2410_udc.c       | 1 -
> >  drivers/usb/gadget/udc-core.c          | 3 ---
> >  drivers/usb/musb/musb_gadget.c         | 1 -
> >  drivers/usb/renesas_usbhs/mod_gadget.c | 1 -
> >  include/linux/usb/gadget.h             | 4 ----
> >  30 files changed, 35 deletions(-)
> > 
> [snip]
> > diff --git a/drivers/usb/gadget/udc-core.c
> > b/drivers/usb/gadget/udc-core.c index 9195054..4ee0efc 100644
> > --- a/drivers/usb/gadget/udc-core.c
> > +++ b/drivers/usb/gadget/udc-core.c
> > @@ -173,7 +173,6 @@ int usb_add_gadget_udc(struct device *parent, struct
> > usb_gadget *gadget) if (!udc)
> >  		goto err1;
> > 
> > -	if (gadget->register_my_device) {
> >  		dev_set_name(&gadget->dev, "gadget");
> > 
> >  		ret = device_register(&gadget->dev);
> > @@ -211,7 +210,6 @@ err3:
> >  	put_device(&udc->dev);
> > 
> >  err2:
> > -	if (gadget->register_my_device)
> >  		put_device(&gadget->dev);
> >  err1:
> >  	return ret;
> > @@ -267,7 +265,6 @@ found:
> >  	kobject_uevent(&udc->dev.kobj, KOBJ_REMOVE);
> >  	device_unregister(&udc->dev);
> > 
> > -	if (gadget->register_my_device)
> >  		device_unregister(&gadget->dev);
> 
> Correct me if I am wrong, but doesn't this patch leave us with incorrect 
> indentation?

right, I fixed it up on my branch, see [1]. That was me trusting my poor
sed skills and not verifying the result ;-)

[1] http://git.kernel.org/?p=linux/kernel/git/balbi/usb.git;a=commitdiff;h=d0bdf2970dd68677c65671be9bd56759593cfaf1

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [RFC/PATCH 24/32] usb: gadget: s3c-hsotg: let udc-core manage gadget->dev
From: Tomasz Figa @ 2013-01-24 19:00 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: kgene.kim, eric.y.miao, kuninori.morimoto.gx, alexander.shishkin,
	gregkh, yoshihiro.shimoda.uh, Linux USB Mailing List,
	nicolas.ferre, linux-geode, haojian.zhuang,
	Linux OMAP Mailing List, linux-samsung-soc, ben-linux,
	dahlmann.thomas, linux, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1359042370-4358-25-git-send-email-balbi@ti.com>

Hi Felipe,

On Thursday 24 of January 2013 17:46:02 Felipe Balbi wrote:
> By simply setting a flag, we can drop some
> boilerplate code.
> 
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
>  drivers/usb/gadget/s3c-hsotg.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c-hsotg.c
> b/drivers/usb/gadget/s3c-hsotg.c index 833d85b..bd8292d 100644
> --- a/drivers/usb/gadget/s3c-hsotg.c
> +++ b/drivers/usb/gadget/s3c-hsotg.c
> @@ -3552,17 +3552,13 @@ static int s3c_hsotg_probe(struct
> platform_device *pdev)
> 
>  	dev_info(dev, "regs %p, irq %d\n", hsotg->regs, hsotg->irq);
> 
> -	device_initialize(&hsotg->gadget.dev);
> -
> -	dev_set_name(&hsotg->gadget.dev, "gadget");
> -
>  	hsotg->gadget.max_speed = USB_SPEED_HIGH;
>  	hsotg->gadget.ops = &s3c_hsotg_gadget_ops;
>  	hsotg->gadget.name = dev_name(dev);
> -
>  	hsotg->gadget.dev.parent = dev;
>  	hsotg->gadget.dev.dma_mask = dev->dma_mask;
>  	hsotg->gadget.dev.release = s3c_hsotg_release;
> +	hsotg->gadget.register_my_device = true;
> 
>  	/* reset the system */
> 
> @@ -3643,12 +3639,6 @@ static int s3c_hsotg_probe(struct platform_device
> *pdev)
> 
>  	s3c_hsotg_phy_disable(hsotg);
> 
> -	ret = device_add(&hsotg->gadget.dev);
> -	if (ret) {
> -		put_device(&hsotg->gadget.dev);
> -		goto err_ep_mem;
> -	}
> -
>  	ret = usb_add_gadget_udc(&pdev->dev, &hsotg->gadget);
>  	if (ret)
>  		goto err_ep_mem;
> @@ -3687,10 +3677,8 @@ static int s3c_hsotg_remove(struct
> platform_device *pdev) }
> 
>  	s3c_hsotg_phy_disable(hsotg);
> -
>  	clk_disable_unprepare(hsotg->clk);
> 
> -	device_unregister(&hsotg->gadget.dev);
>  	return 0;
>  }

Looks good.

Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>

Best regards,
Tomasz Figa

^ permalink raw reply

* Re: [RFC/PATCH 01/32] usb: gadget: udc-core: allow udc class register gadget device
From: Tomasz Figa @ 2013-01-24 18:57 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: kgene.kim, eric.y.miao, kuninori.morimoto.gx, alexander.shishkin,
	gregkh, yoshihiro.shimoda.uh, Linux USB Mailing List,
	nicolas.ferre, linux-geode, haojian.zhuang,
	Linux OMAP Mailing List, linux-samsung-soc, ben-linux,
	dahlmann.thomas, linux, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1359042370-4358-2-git-send-email-balbi@ti.com>

Hi Felipe,

On Thursday 24 of January 2013 17:45:39 Felipe Balbi wrote:
> Currently all UDC drivers are calling
> device_register() before calling
> usb_add_gadget_udc(). In order to avoid
> code duplication, we can allow udc-core.c
> register that device.
> 
> However that would become a really large patch,
> so to cope with the meanwhile and allow us
> to write bite-sized patches, we're adding
> a flag which will be set by UDC driver once
> it removes the code for registering the
> gadget device.
> 
> Once all are converted, the new flag will
> be removed.
> 
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
>  drivers/usb/gadget/udc-core.c | 23 +++++++++++++++++++----
>  include/linux/usb/gadget.h    |  4 ++++
>  2 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc-core.c
> b/drivers/usb/gadget/udc-core.c index 2a9cd36..9195054 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -173,6 +173,14 @@ int usb_add_gadget_udc(struct device *parent,
> struct usb_gadget *gadget) if (!udc)
>  		goto err1;
> 
> +	if (gadget->register_my_device) {
> +		dev_set_name(&gadget->dev, "gadget");
> +
> +		ret = device_register(&gadget->dev);
> +		if (ret)
> +			goto err2;
> +	}
> +
>  	device_initialize(&udc->dev);
>  	udc->dev.release = usb_udc_release;
>  	udc->dev.class = udc_class;
> @@ -180,7 +188,7 @@ int usb_add_gadget_udc(struct device *parent, struct
> usb_gadget *gadget) udc->dev.parent = parent;
>  	ret = dev_set_name(&udc->dev, "%s", kobject_name(&parent->kobj));
>  	if (ret)
> -		goto err2;
> +		goto err3;

Just a nitpick: If you are at changing labels of error path, wouldn't it 
be better to give them some meaningful names? Like err_del_unlock, 
err_put_udc, err_put_gadget, err_ret.

Otherwise looks good. Nice idea.

Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>

Best regards,
Tomasz Figa

>  	udc->gadget = gadget;
> 
> @@ -189,18 +197,22 @@ int usb_add_gadget_udc(struct device *parent,
> struct usb_gadget *gadget)
> 
>  	ret = device_add(&udc->dev);
>  	if (ret)
> -		goto err3;
> +		goto err4;
> 
>  	mutex_unlock(&udc_lock);
> 
>  	return 0;
> -err3:
> +
> +err4:
>  	list_del(&udc->list);
>  	mutex_unlock(&udc_lock);
> 
> -err2:
> +err3:
>  	put_device(&udc->dev);
> 
> +err2:
> +	if (gadget->register_my_device)
> +		put_device(&gadget->dev);
>  err1:
>  	return ret;
>  }
> @@ -254,6 +266,9 @@ found:
> 
>  	kobject_uevent(&udc->dev.kobj, KOBJ_REMOVE);
>  	device_unregister(&udc->dev);
> +
> +	if (gadget->register_my_device)
> +		device_unregister(&gadget->dev);
>  }
>  EXPORT_SYMBOL_GPL(usb_del_gadget_udc);
> 
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index 2e297e8..fcd9ef8 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -494,6 +494,9 @@ struct usb_gadget_ops {
>   *	only supports HNP on a different root port.
>   * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
>   *	enabled HNP support.
> + * @register_my_device: Flag telling udc-core that UDC driver didn't
> + *	register the gadget device to the driver model. Temporary until
> + *	all UDC drivers are fixed up properly.
>   * @name: Identifies the controller hardware type.  Used in diagnostics
> *	and sometimes configuration.
>   * @dev: Driver model state for this abstract device.
> @@ -531,6 +534,7 @@ struct usb_gadget {
>  	unsigned			b_hnp_enable:1;
>  	unsigned			a_hnp_support:1;
>  	unsigned			a_alt_hnp_support:1;
> +	unsigned			register_my_device:1;
>  	const char			*name;
>  	struct device			dev;
>  	unsigned			out_epnum;

^ permalink raw reply

* Re: [RFC/PATCH 32/32] usb: gadget: drop now unnecessary flag
From: Tomasz Figa @ 2013-01-24 18:52 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: kgene.kim, eric.y.miao, kuninori.morimoto.gx, alexander.shishkin,
	gregkh, yoshihiro.shimoda.uh, Linux USB Mailing List,
	nicolas.ferre, linux-geode, haojian.zhuang,
	Linux OMAP Mailing List, linux-samsung-soc, ben-linux,
	dahlmann.thomas, linux, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1359042370-4358-33-git-send-email-balbi@ti.com>

Hi Felipe,

On Thursday 24 of January 2013 17:46:10 Felipe Balbi wrote:
> We don't need the ->register_my_device flag
> anymore because all UDC drivers have been
> properly converted.
> 
> Let's remove every history of it.
> 
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
>  drivers/usb/chipidea/udc.c             | 1 -
>  drivers/usb/dwc3/gadget.c              | 1 -
>  drivers/usb/gadget/amd5536udc.c        | 1 -
>  drivers/usb/gadget/at91_udc.c          | 1 -
>  drivers/usb/gadget/atmel_usba_udc.c    | 1 -
>  drivers/usb/gadget/bcm63xx_udc.c       | 1 -
>  drivers/usb/gadget/dummy_hcd.c         | 1 -
>  drivers/usb/gadget/fsl_qe_udc.c        | 1 -
>  drivers/usb/gadget/fsl_udc_core.c      | 1 -
>  drivers/usb/gadget/fusb300_udc.c       | 1 -
>  drivers/usb/gadget/goku_udc.c          | 1 -
>  drivers/usb/gadget/imx_udc.c           | 1 -
>  drivers/usb/gadget/lpc32xx_udc.c       | 1 -
>  drivers/usb/gadget/m66592-udc.c        | 1 -
>  drivers/usb/gadget/mv_u3d_core.c       | 1 -
>  drivers/usb/gadget/mv_udc_core.c       | 1 -
>  drivers/usb/gadget/net2272.c           | 1 -
>  drivers/usb/gadget/net2280.c           | 1 -
>  drivers/usb/gadget/omap_udc.c          | 1 -
>  drivers/usb/gadget/pch_udc.c           | 1 -
>  drivers/usb/gadget/pxa25x_udc.c        | 1 -
>  drivers/usb/gadget/pxa27x_udc.c        | 1 -
>  drivers/usb/gadget/r8a66597-udc.c      | 1 -
>  drivers/usb/gadget/s3c-hsotg.c         | 1 -
>  drivers/usb/gadget/s3c-hsudc.c         | 1 -
>  drivers/usb/gadget/s3c2410_udc.c       | 1 -
>  drivers/usb/gadget/udc-core.c          | 3 ---
>  drivers/usb/musb/musb_gadget.c         | 1 -
>  drivers/usb/renesas_usbhs/mod_gadget.c | 1 -
>  include/linux/usb/gadget.h             | 4 ----
>  30 files changed, 35 deletions(-)
> 
[snip]
> diff --git a/drivers/usb/gadget/udc-core.c
> b/drivers/usb/gadget/udc-core.c index 9195054..4ee0efc 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -173,7 +173,6 @@ int usb_add_gadget_udc(struct device *parent, struct
> usb_gadget *gadget) if (!udc)
>  		goto err1;
> 
> -	if (gadget->register_my_device) {
>  		dev_set_name(&gadget->dev, "gadget");
> 
>  		ret = device_register(&gadget->dev);
> @@ -211,7 +210,6 @@ err3:
>  	put_device(&udc->dev);
> 
>  err2:
> -	if (gadget->register_my_device)
>  		put_device(&gadget->dev);
>  err1:
>  	return ret;
> @@ -267,7 +265,6 @@ found:
>  	kobject_uevent(&udc->dev.kobj, KOBJ_REMOVE);
>  	device_unregister(&udc->dev);
> 
> -	if (gadget->register_my_device)
>  		device_unregister(&gadget->dev);

Correct me if I am wrong, but doesn't this patch leave us with incorrect 
indentation?

Otherwise looks good.

Best regards,
Tomasz Figa

^ permalink raw reply

* RE: [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E
From: Yoder Stuart-B08248 @ 2013-01-24 18:26 UTC (permalink / raw)
  To: Wood Scott-B07421
  Cc: kvm@vger.kernel.org, agraf@suse.de, kvm-ppc@vger.kernel.org,
	linuxppc-dev@ozlabs.org
In-Reply-To: <1359051740.24865.10@snotra>



> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, January 24, 2013 12:22 PM
> To: Yoder Stuart-B08248
> Cc: agraf@suse.de; benh@kernel.crashing.org; linuxppc-dev@ozlabs.org; kvm=
-ppc@vger.kernel.org;
> kvm@vger.kernel.org; Yoder Stuart-B08248
> Subject: Re: [PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book=
 E
>=20
> On 01/22/2013 05:54:43 PM, Stuart Yoder wrote:
> > +.macro BOOK3E_IDLE_LOOP
> > +1:
> > +	PPC_WAIT(0)
> >  	b	1b
> > +.endm
> > +
> > +.macro EPAPR_EV_IDLE_LOOP
> > +idle_loop:
> > +       LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
> > +
> > +.global epapr_ev_idle_start
> > +epapr_ev_idle_start:
> > +       li      r3, -1
> > +       nop
> > +       nop
> > +       nop
> > +       b       idle_loop
> > +.endm
> > +
> > +BOOK3E_IDLE epapr_ev_idle, EPAPR_EV_IDLE_LOOP
> > +
> > +BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
>=20
> Why the comma after epapr_ev_idle but not after book3e_idle?
>=20
> Also you have spaces where there should be tabs.
>=20
> Otherwise looks good.

Hmm...there shouldn't be a comma there.  I'll respin
and fix the whitespace too.

Stuart

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox