* Re: [PATCH 1/1] powerpc: Increase COMMAND_LINE_SIZE to 2048 from 512.
From: Joseph Salisbury @ 2014-04-16 18:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus, linux-kernel, stable, anton
In-Reply-To: <1397555363.14218.6.camel@pasglop>
On 04/15/2014 05:49 AM, Benjamin Herrenschmidt wrote:
> On Mon, 2014-04-14 at 14:58 -0400, Joseph Salisbury wrote:
>> After further review, it appears ppc does not actually use the define
>> in
>> the ppc headers but uses the common generic
>> default(include/uapi/asm-generic/setup.h). COMMAND_LINE_SIZE should
>> probably become a kernel config option. Do folks agree that is the
>> correct thing to do? If so, I can re-work the patch.
> No objection on my side.
>
> Make sure you remove any unused arch define while at it.
>
> Cheers,
> Ben.
>
>
Hi Ben,
I can think of two ways to add the new config option. One would be to
have a large entry in ~/arch/Kconfig, with a default COMMAND_LINE_SIZE
line for each architecture. The other way would be to have the default
value for COMMAND_LINE_SIZE in the architecture sub-directory Kconfig
file: ~/arch/powerpc/Kconfig for example.
Do you have a preference for either way?
Thanks,
Joe
^ permalink raw reply
* Re: [PATCH v4] powerpc: kvm: make _PAGE_NUMA take effect
From: Alexander Graf @ 2014-04-16 12:27 UTC (permalink / raw)
To: Liu Ping Fan, linuxppc-dev, kvm-ppc; +Cc: Paul Mackerras, Aneesh Kumar K.V, kvm
In-Reply-To: <1397550820-29993-1-git-send-email-pingfank@linux.vnet.ibm.com>
On 15.04.14 10:33, Liu Ping Fan wrote:
> Numa fault is a method which help to achieve auto numa balancing.
> When such a page fault takes place, the page fault handler will check
> whether the page is placed correctly. If not, migration should be
> involved to cut down the distance between the cpu and pages.
>
> A pte with _PAGE_NUMA help to implement numa fault. It means not to
> allow the MMU to access the page directly. So a page fault is triggered
> and numa fault handler gets the opportunity to run checker.
>
> As for the access of MMU, we need special handling for the powernv's guest.
> When we mark a pte with _PAGE_NUMA, we already call mmu_notifier to
> invalidate it in guest's htab, but when we tried to re-insert them,
> we firstly try to map it in real-mode. Only after this fails, we fallback
> to virt mode, and most of important, we run numa fault handler in virt
> mode. This patch guards the way of real-mode to ensure that if a pte is
> marked with _PAGE_NUMA, it will NOT be mapped in real mode, instead, it will
> be mapped in virt mode and have the opportunity to be checked with placement.
>
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thanks, applied to for-3.15.
Alex
^ permalink raw reply
* Re: [v3] mtd: m25p80: Modify the name of mtd_info
From: Brian Norris @ 2014-04-16 6:53 UTC (permalink / raw)
To: Hou Zhiqiang
Cc: Scott Wood, linuxppc-dev@ozlabs.org, Mingkai.Hu@freescale.com,
linux-mtd@lists.infradead.org, David Woodhouse
In-Reply-To: <1395478518-22308-1-git-send-email-B48286@freescale.com>
On Sat, Mar 22, 2014 at 1:55 AM, Hou Zhiqiang <B48286@freescale.com> wrote:
> v3:
> Fix a bug, matching unsigned long long with "%llx".
> v2:
> 1. Fix some code style issue.
> 2. Cast physical address to unsigned long long.
I missed v2 and v3 and commented on v1 instead, sorry. Same comments
apply here though.
Also, can you please include PATCH in the subject? (e.g., [PATCH v3])
See Documentation/SubmittingPatches, item 11.
Thanks,
Brian
^ permalink raw reply
* Re: [PATCH] mtd: m25p80: Modify the name of mtd_info
From: Brian Norris @ 2014-04-16 6:48 UTC (permalink / raw)
To: Hou Zhiqiang; +Cc: scottwood, linuxppc-dev, mingkai.hu, linux-mtd, dwmw2
In-Reply-To: <1395400578-5637-1-git-send-email-B48286@freescale.com>
On Fri, Mar 21, 2014 at 07:16:18PM +0800, Hou Zhiqiang wrote:
> To specify spi flash layouts by "mtdparts=..." in cmdline, we must
> give mtd_info a fixed name,because the cmdlinepart's parser will
> match the name of mtd_info given in cmdline.
> Now, if use DT, the mtd_info's name will be spi->dev->name. It
> consists of spi_master->bus_num, and the spi_master->bus_num maybe
> dynamically fetched. So, in this case, replace the component bus_num
> with thei physical address of spi master.
>
> Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
> ---
> drivers/mtd/devices/m25p80.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 7eda71d..64450a2 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -30,6 +30,7 @@
> #include <linux/mtd/cfi.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/partitions.h>
> +#include <linux/of_address.h>
> #include <linux/of_platform.h>
>
> #include <linux/spi/spi.h>
> @@ -934,9 +935,11 @@ static int m25p_probe(struct spi_device *spi)
> struct flash_platform_data *data;
> struct m25p *flash;
> struct flash_info *info;
> - unsigned i;
> + unsigned i, ret;
> struct mtd_part_parser_data ppdata;
> struct device_node *np = spi->dev.of_node;
> + struct resource res;
> + struct device_node *mnp = spi->master->dev.of_node;
>
> /* Platform data helps sort out which chip type we have, as
> * well as how this board partitions it. If we don't have
> @@ -1009,8 +1012,17 @@ static int m25p_probe(struct spi_device *spi)
>
> if (data && data->name)
> flash->mtd.name = data->name;
> - else
> - flash->mtd.name = dev_name(&spi->dev);
> + else{
> + ret = of_address_to_resource(mnp, 0, &res);
You're making a lot assumptions about the SPI master/device
relationship -- that the master has a device-node; that the first
resource of the master is its physical address (this is not guaranteed
by DT semantics). Please do not do this.
> + if (ret) {
> + dev_err(&spi->dev, "failed to get spi master resource\n");
> + return ret;
This is wrong. It breaks all !CONFIG_OF cases which didn't specify a
name via platform data.
> + }
> + flash->mtd.name = kasprintf(GFP_KERNEL, "spi%x.%d",
> + (unsigned)res.start, spi->chip_select);
> + if (!flash->mtd.name)
> + return -ENOMEM;
> + }
>
> flash->mtd.type = MTD_NORFLASH;
> flash->mtd.writesize = 1;
Brian
^ permalink raw reply
* RE: [PATCH 2/2] fsl/mpic_timer: make mpic_timer to support deep sleep feature
From: Dongsheng.Wang @ 2014-04-16 6:06 UTC (permalink / raw)
To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id0IHVzZSBm
c2xfZ2V0X3N5c19mcmVxKCkuDQo+IA0KDQpObywgd2UgY2Fubm90IHVzZSBkcml2ZXJzL2Nsay8u
IEJlY2F1c2UgY2xrLXBwYy1jb3JlbmV0LmMgb25seSBzdXBwb3J0IGNvcmVuZXQgcGxhdGZvcm0u
DQoNCj4gPiA+ID4gK3N0YXRpYyBpbnQgbmVlZF90b19zd2l0Y2hfZnJlcSh2b2lkKQ0KPiA+ID4g
PiArew0KPiA+ID4gPiArCXUzMiBzdnI7DQo+ID4gPiA+ICsNCj4gPiA+ID4gKwlzdnIgPSBtZnNw
cihTUFJOX1NWUik7DQo+ID4gPiA+ICsJaWYgKFNWUl9TT0NfVkVSKHN2cikgPT0gU1ZSX1QxMDQw
IHx8DQo+ID4gPiA+ICsJCQlTVlJfU09DX1ZFUihzdnIpID09IFNWUl9UMTA0MikNCj4gPiA+ID4g
KwkJcmV0dXJuIDE7DQo+ID4gPg0KPiA+ID4gRXhwbGFpbiB3aHkgdGhpcyBpcyBzcGVjaWZpYyB0
byBUMTA0eC4NCj4gPiA+DQo+ID4NCj4gPiBNcGljIHRpbWVyIGZyZXEgd2lsbCBiZSBjaGFuZ2Ug
d2hlbiBzeXN0ZW0gZ29pbmcgdG8gZGVlcCBzbGVlcC4gU28gd2UgbmVlZCB0bw0KPiByZWNhbGN1
bGF0ZSB0aGUgdGltZS4NCj4gDQo+IERvIGFueSBvdGhlciBjaGlwcyB3aXRoIGRlZXAgc2xlZXAg
aGF2ZSB0aGlzIHByb2JsZW0/DQo+IA0KDQpPbmx5IGhhcyBvbiBUMTA0eCByaWdodCBub3cuDQoN
ClJlZ2FyZHMsDQotRG9uZ3NoZW5nDQoNCj4gLVNjb3R0DQo+IA0KDQo=
^ permalink raw reply
* Re: [PATCH v2] power, sched: stop updating inside arch_update_cpu_topology() when nothing to be update
From: Michael wang @ 2014-04-16 3:14 UTC (permalink / raw)
To: linuxppc-dev, LKML, benh, paulus, nfont, sfr, Andrew Morton, rcj,
jlarrew, srivatsa.bhat, alistair
In-Reply-To: <53436AC8.5020705@linux.vnet.ibm.com>
On 04/08/2014 11:19 AM, Michael wang wrote:
> Since v1:
> Edited the comment according to Srivatsa's suggestion.
>
> During the testing, we encounter below WARN followed by Oops:
Is there any more comments on this issue? Should we apply this fix?
Regards,
Michael Wang
>
> WARNING: at kernel/sched/core.c:6218
> ...
> NIP [c000000000101660] .build_sched_domains+0x11d0/0x1200
> LR [c000000000101358] .build_sched_domains+0xec8/0x1200
> PACATMSCRATCH [800000000000f032]
> Call Trace:
> [c00000001b103850] [c000000000101358] .build_sched_domains+0xec8/0x1200
> [c00000001b1039a0] [c00000000010aad4] .partition_sched_domains+0x484/0x510
> [c00000001b103aa0] [c00000000016d0a8] .rebuild_sched_domains+0x68/0xa0
> [c00000001b103b30] [c00000000005cbf0] .topology_work_fn+0x10/0x30
> ...
> Oops: Kernel access of bad area, sig: 11 [#1]
> ...
> NIP [c00000000045c000] .__bitmap_weight+0x60/0xf0
> LR [c00000000010132c] .build_sched_domains+0xe9c/0x1200
> PACATMSCRATCH [8000000000029032]
> Call Trace:
> [c00000001b1037a0] [c000000000288ff4] .kmem_cache_alloc_node_trace+0x184/0x3a0
> [c00000001b103850] [c00000000010132c] .build_sched_domains+0xe9c/0x1200
> [c00000001b1039a0] [c00000000010aad4] .partition_sched_domains+0x484/0x510
> [c00000001b103aa0] [c00000000016d0a8] .rebuild_sched_domains+0x68/0xa0
> [c00000001b103b30] [c00000000005cbf0] .topology_work_fn+0x10/0x30
> ...
>
> This was caused by that 'sd->groups == NULL' after building groups, which
> was caused by the empty 'sd->span'.
>
> The cpu's domain contained nothing because the cpu was assigned to a wrong
> node, due to the following unfortunate sequence of events:
>
> 1. The hypervisor sent a topology update to the guest OS, to notify changes
> to the cpu-node mapping. However, the update was actually redundant - i.e.,
> the "new" mapping was exactly the same as the old one.
>
> 2. Due to this, the 'updated_cpus' mask turned out to be empty after exiting
> the 'for-loop' in arch_update_cpu_topology().
>
> 3. So we ended up calling stop-machine() with an empty cpumask list, which made
> stop-machine internally elect cpumask_first(cpu_online_mask), i.e., CPU0 as
> the cpu to run the payload (the update_cpu_topology() function).
>
> 4. This causes update_cpu_topology() to be run by CPU0. And since 'updates'
> is kzalloc()'ed inside arch_update_cpu_topology(), update_cpu_topology()
> finds update->cpu as well as update->new_nid to be 0. In other words, we
> end up assigning CPU0 (and eventually its siblings) to node 0, incorrectly.
>
> Along with the following wrong updating, it causes the sched-domain rebuild
> code to break and crash the system.
>
> Fix this by skipping the topology update in cases where we find that
> the topology has not actually changed in reality (ie., spurious updates).
>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> CC: Stephen Rothwell <sfr@canb.auug.org.au>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Robert Jennings <rcj@linux.vnet.ibm.com>
> CC: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
> CC: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
> CC: Alistair Popple <alistair@popple.id.au>
> Suggested-by: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
> Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
> ---
> arch/powerpc/mm/numa.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index 30a42e2..4ebbb9e 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -1591,6 +1591,20 @@ int arch_update_cpu_topology(void)
> cpu = cpu_last_thread_sibling(cpu);
> }
>
> + /*
> + * In cases where we have nothing to update (because the updates list
> + * is too short or because the new topology is same as the old one),
> + * skip invoking update_cpu_topology() via stop-machine(). This is
> + * necessary (and not just a fast-path optimization) since stop-machine
> + * can end up electing a random CPU to run update_cpu_topology(), and
> + * thus trick us into setting up incorrect cpu-node mappings (since
> + * 'updates' is kzalloc()'ed).
> + *
> + * And for the similar reason, we will skip all the following updating.
> + */
> + if (!cpumask_weight(&updated_cpus))
> + goto out;
> +
> stop_machine(update_cpu_topology, &updates[0], &updated_cpus);
>
> /*
> @@ -1612,6 +1626,7 @@ int arch_update_cpu_topology(void)
> changed = 1;
> }
>
> +out:
> kfree(updates);
> return changed;
> }
>
^ permalink raw reply
* RE: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
From: Dongsheng.Wang @ 2014-04-16 2:58 UTC (permalink / raw)
To: Scott Wood
Cc: linuxppc-dev@lists.ozlabs.org, haokexin@gmail.com,
prabhakar@freescale.com, Jason.Jin@freescale.com
In-Reply-To: <1397590755.20280.250.camel@snotra.buserror.net>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogV2VkbmVzZGF5LCBBcHJpbCAxNiwgMjAxNCAzOjM5IEFNDQo+IFRvOiBXYW5n
IERvbmdzaGVuZy1CNDA1MzQNCj4gQ2M6IEppbiBaaGVuZ3hpb25nLVI2NDE4ODsgaGFva2V4aW5A
Z21haWwuY29tOyBLdXNod2FoYSBQcmFiaGFrYXItQjMyNTc5Ow0KPiBsaW51eHBwYy1kZXZAbGlz
dHMub3psYWJzLm9yZw0KPiBTdWJqZWN0OiBSZTogW1BBVENIIHYyIDEvMl0gZnNsL2NvcmVuZXRf
Z2VuZXJpYzogYWRkIGEgcGFydGljdWxhciBpbml0aWFsaXphdGlvbg0KPiBmb3IgcGxhdGZvcm0N
Cj4gDQo+IE9uIFR1ZSwgMjAxNC0wNC0xNSBhdCAxMzo1MyArMDgwMCwgRG9uZ3NoZW5nIFdhbmcg
d3JvdGU6DQo+ID4gRnJvbTogV2FuZyBEb25nc2hlbmcgPGRvbmdzaGVuZy53YW5nQGZyZWVzY2Fs
ZS5jb20+DQo+ID4NCj4gPiBDb3JlbmV0X2dlbmVy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9sbG93aW5nIGJvYXJkcyBhcmUgc3VwcG9ydGVk
IGZvciBib3RoIDMyYml0IGFuZCA2NGJpdCBrZXJuZWw6DQo+ID4gIAkgICAgUDUwMjAgRFMgYW5k
IFA1MDQwIERTDQo+ID4NCj4gPiArY29uZmlnIEZJWF9HRU5FUklDX1BMQVRGT1JNX0lOSVQNCj4g
PiArCWJvb2wgIkZpeCBHZW5lcmljIEluaXRpYWxpemF0aW9uIg0KPiA+ICsJZGVwZW5kcyBvbiBD
T1JFTkVUX0dFTkVSSUMNCj4gDQo+IFdoeSBkb2VzIHRoaXMgZGVwZW5kIG9uIENPUkVORVRfR0VO
RVJJQz8NCj4gDQoNCkJlY2F1c2UgQ09SRU5FVF9HRU5FUklDIGlzIGEgbXVsdGlib2FyZHMgZmls
ZSwgVGhpcyBpcyBkZXNpZ25lZCB0byBoYW5kbGUgdGhpcyBzaXR1YXRpb24uDQoNCj4gPiArCWRl
ZmF1bHQgeQ0KPiANCj4gTm8uDQo+IA0KDQpXaHkgbm90PyBUaGlzIHdpbGwgbm90IGluY3JlYXNl
IGFueSByZWR1bmRhbnQgb3BlcmF0aW9ucyBpZiB0aGVyZSBpcyBub3QgYW55IGJvYXJkcyBuZWVk
IGZpeC4NCllvdSBjYW4gc2VlIG15IGZpeC5jIGNvZGUuDQoNClJlZ2FyZHMsDQotRG9uZ3NoZW5n
DQoNCj4gLVNjb3R0DQo+IA0KDQo=
^ permalink raw reply
* [PATCH v2 2/8] cpufreq: Use cpufreq_for_each_* macros for frequency table iteration
From: Stratos Karafotis @ 2014-04-15 22:25 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
Cc: Kukjin Kim, linux-pm, LKML, cpufreq@vger.kernel.org,
linux-samsung-soc, Sudeep Holla, Olof Johansson, linuxppc-dev,
linux-arm-kernel@lists.infradead.org
The cpufreq core now supports the cpufreq_for_each_entry and
cpufreq_for_each_valid_entry macros helpers for iteration over the
cpufreq_frequency_table, so use them.
It should have no functional changes.
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
---
drivers/cpufreq/acpi-cpufreq.c | 9 +++---
drivers/cpufreq/arm_big_little.c | 16 +++++------
drivers/cpufreq/cpufreq_stats.c | 24 ++++++----------
drivers/cpufreq/dbx500-cpufreq.c | 8 ++----
drivers/cpufreq/elanfreq.c | 9 +++---
drivers/cpufreq/exynos-cpufreq.c | 11 ++++---
drivers/cpufreq/exynos5440-cpufreq.c | 30 +++++++++----------
drivers/cpufreq/freq_table.c | 56 ++++++++++++++++--------------------
drivers/cpufreq/longhaul.c | 13 ++++-----
drivers/cpufreq/pasemi-cpufreq.c | 10 +++----
drivers/cpufreq/powernow-k6.c | 14 ++++-----
drivers/cpufreq/ppc_cbe_cpufreq.c | 9 +++---
drivers/cpufreq/s3c2416-cpufreq.c | 40 +++++++++++---------------
drivers/cpufreq/s3c64xx-cpufreq.c | 15 ++++------
14 files changed, 117 insertions(+), 147 deletions(-)
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 000e4e0..b0c18ed 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -213,7 +213,7 @@ static unsigned extract_io(u32 value, struct acpi_cpufreq_data *data)
static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
{
- int i;
+ struct cpufreq_frequency_table *pos;
struct acpi_processor_performance *perf;
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
@@ -223,10 +223,9 @@ static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
perf = data->acpi_data;
- for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
- if (msr == perf->states[data->freq_table[i].driver_data].status)
- return data->freq_table[i].frequency;
- }
+ cpufreq_for_each_entry(pos, data->freq_table)
+ if (msr == perf->states[pos->driver_data].status)
+ return pos->frequency;
return data->freq_table[0].frequency;
}
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index bad2ed3..1f4d4e3 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -226,22 +226,22 @@ static inline u32 get_table_count(struct cpufreq_frequency_table *table)
/* get the minimum frequency in the cpufreq_frequency_table */
static inline u32 get_table_min(struct cpufreq_frequency_table *table)
{
- int i;
+ struct cpufreq_frequency_table *pos;
uint32_t min_freq = ~0;
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++)
- if (table[i].frequency < min_freq)
- min_freq = table[i].frequency;
+ cpufreq_for_each_entry(pos, table)
+ if (pos->frequency < min_freq)
+ min_freq = pos->frequency;
return min_freq;
}
/* get the maximum frequency in the cpufreq_frequency_table */
static inline u32 get_table_max(struct cpufreq_frequency_table *table)
{
- int i;
+ struct cpufreq_frequency_table *pos;
uint32_t max_freq = 0;
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++)
- if (table[i].frequency > max_freq)
- max_freq = table[i].frequency;
+ cpufreq_for_each_entry(pos, table)
+ if (pos->frequency > max_freq)
+ max_freq = pos->frequency;
return max_freq;
}
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index ecaaebf..0cd9b4d 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -182,11 +182,11 @@ static void cpufreq_stats_free_table(unsigned int cpu)
static int __cpufreq_stats_create_table(struct cpufreq_policy *policy)
{
- unsigned int i, j, count = 0, ret = 0;
+ unsigned int i, count = 0, ret = 0;
struct cpufreq_stats *stat;
unsigned int alloc_size;
unsigned int cpu = policy->cpu;
- struct cpufreq_frequency_table *table;
+ struct cpufreq_frequency_table *pos, *table;
table = cpufreq_frequency_get_table(cpu);
if (unlikely(!table))
@@ -205,12 +205,8 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy)
stat->cpu = cpu;
per_cpu(cpufreq_stats_table, cpu) = stat;
- for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) {
- unsigned int freq = table[i].frequency;
- if (freq == CPUFREQ_ENTRY_INVALID)
- continue;
+ cpufreq_for_each_valid_entry(pos, table)
count++;
- }
alloc_size = count * sizeof(int) + count * sizeof(u64);
@@ -228,15 +224,11 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy)
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
stat->trans_table = stat->freq_table + count;
#endif
- j = 0;
- for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) {
- unsigned int freq = table[i].frequency;
- if (freq == CPUFREQ_ENTRY_INVALID)
- continue;
- if (freq_table_get_index(stat, freq) == -1)
- stat->freq_table[j++] = freq;
- }
- stat->state_num = j;
+ i = 0;
+ cpufreq_for_each_valid_entry(pos, table)
+ if (freq_table_get_index(stat, pos->frequency) == -1)
+ stat->freq_table[i++] = pos->frequency;
+ stat->state_num = i;
spin_lock(&cpufreq_stats_lock);
stat->last_time = get_jiffies_64();
stat->last_index = freq_table_get_index(stat, policy->cur);
diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c
index 412a78b..4bebc1b 100644
--- a/drivers/cpufreq/dbx500-cpufreq.c
+++ b/drivers/cpufreq/dbx500-cpufreq.c
@@ -45,7 +45,7 @@ static struct cpufreq_driver dbx500_cpufreq_driver = {
static int dbx500_cpufreq_probe(struct platform_device *pdev)
{
- int i = 0;
+ struct cpufreq_frequency_table *pos;
freq_table = dev_get_platdata(&pdev->dev);
if (!freq_table) {
@@ -60,10 +60,8 @@ static int dbx500_cpufreq_probe(struct platform_device *pdev)
}
pr_info("dbx500-cpufreq: Available frequencies:\n");
- while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
- pr_info(" %d Mhz\n", freq_table[i].frequency/1000);
- i++;
- }
+ cpufreq_for_each_entry(pos, freq_table)
+ pr_info(" %d Mhz\n", pos->frequency / 1000);
return cpufreq_register_driver(&dbx500_cpufreq_driver);
}
diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c
index 7f5d2a6..1c06e78 100644
--- a/drivers/cpufreq/elanfreq.c
+++ b/drivers/cpufreq/elanfreq.c
@@ -147,7 +147,7 @@ static int elanfreq_target(struct cpufreq_policy *policy,
static int elanfreq_cpu_init(struct cpufreq_policy *policy)
{
struct cpuinfo_x86 *c = &cpu_data(0);
- unsigned int i;
+ struct cpufreq_frequency_table *pos;
/* capability check */
if ((c->x86_vendor != X86_VENDOR_AMD) ||
@@ -159,10 +159,9 @@ static int elanfreq_cpu_init(struct cpufreq_policy *policy)
max_freq = elanfreq_get_cpu_frequency(0);
/* table init */
- for (i = 0; (elanfreq_table[i].frequency != CPUFREQ_TABLE_END); i++) {
- if (elanfreq_table[i].frequency > max_freq)
- elanfreq_table[i].frequency = CPUFREQ_ENTRY_INVALID;
- }
+ cpufreq_for_each_entry(pos, elanfreq_table)
+ if (pos->frequency > max_freq)
+ pos->frequency = CPUFREQ_ENTRY_INVALID;
/* cpuinfo and default policy values */
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index f99cfe2..9c13255 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -29,17 +29,16 @@ static unsigned int locking_frequency;
static int exynos_cpufreq_get_index(unsigned int freq)
{
struct cpufreq_frequency_table *freq_table = exynos_info->freq_table;
- int index;
+ struct cpufreq_frequency_table *pos;
- for (index = 0;
- freq_table[index].frequency != CPUFREQ_TABLE_END; index++)
- if (freq_table[index].frequency == freq)
+ cpufreq_for_each_entry(pos, freq_table)
+ if (pos->frequency == freq)
break;
- if (freq_table[index].frequency == CPUFREQ_TABLE_END)
+ if (pos->frequency == CPUFREQ_TABLE_END)
return -EINVAL;
- return index;
+ return pos - freq_table;
}
static int exynos_cpufreq_scale(unsigned int target_freq)
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index a6b8214..f33f25b 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -114,25 +114,23 @@ static struct cpufreq_freqs freqs;
static int init_div_table(void)
{
- struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table;
+ struct cpufreq_frequency_table *pos, *freq_tbl = dvfs_info->freq_table;
unsigned int tmp, clk_div, ema_div, freq, volt_id;
- int i = 0;
struct dev_pm_opp *opp;
rcu_read_lock();
- for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
-
+ cpufreq_for_each_entry(pos, freq_tbl) {
opp = dev_pm_opp_find_freq_exact(dvfs_info->dev,
- freq_tbl[i].frequency * 1000, true);
+ pos->frequency * 1000, true);
if (IS_ERR(opp)) {
rcu_read_unlock();
dev_err(dvfs_info->dev,
"failed to find valid OPP for %u KHZ\n",
- freq_tbl[i].frequency);
+ pos->frequency);
return PTR_ERR(opp);
}
- freq = freq_tbl[i].frequency / 1000; /* In MHZ */
+ freq = pos->frequency / 1000; /* In MHZ */
clk_div = ((freq / CPU_DIV_FREQ_MAX) & P0_7_CPUCLKDEV_MASK)
<< P0_7_CPUCLKDEV_SHIFT;
clk_div |= ((freq / CPU_ATB_FREQ_MAX) & P0_7_ATBCLKDEV_MASK)
@@ -157,7 +155,8 @@ static int init_div_table(void)
tmp = (clk_div | ema_div | (volt_id << P0_7_VDD_SHIFT)
| ((freq / FREQ_UNIT) << P0_7_FREQ_SHIFT));
- __raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * i);
+ __raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 *
+ (pos - freq_tbl));
}
rcu_read_unlock();
@@ -166,8 +165,9 @@ static int init_div_table(void)
static void exynos_enable_dvfs(unsigned int cur_frequency)
{
- unsigned int tmp, i, cpu;
+ unsigned int tmp, cpu;
struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table;
+ struct cpufreq_frequency_table *pos;
/* Disable DVFS */
__raw_writel(0, dvfs_info->base + XMU_DVFS_CTRL);
@@ -182,15 +182,15 @@ static void exynos_enable_dvfs(unsigned int cur_frequency)
__raw_writel(tmp, dvfs_info->base + XMU_PMUIRQEN);
/* Set initial performance index */
- for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++)
- if (freq_table[i].frequency == cur_frequency)
+ cpufreq_for_each_entry(pos, freq_table)
+ if (pos->frequency == cur_frequency)
break;
- if (freq_table[i].frequency == CPUFREQ_TABLE_END) {
+ if (pos->frequency == CPUFREQ_TABLE_END) {
dev_crit(dvfs_info->dev, "Boot up frequency not supported\n");
/* Assign the highest frequency */
- i = 0;
- cur_frequency = freq_table[i].frequency;
+ pos = freq_table;
+ cur_frequency = pos->frequency;
}
dev_info(dvfs_info->dev, "Setting dvfs initial frequency = %uKHZ",
@@ -199,7 +199,7 @@ static void exynos_enable_dvfs(unsigned int cur_frequency)
for (cpu = 0; cpu < CONFIG_NR_CPUS; cpu++) {
tmp = __raw_readl(dvfs_info->base + XMU_C0_3_PSTATE + cpu * 4);
tmp &= ~(P_VALUE_MASK << C0_3_PSTATE_NEW_SHIFT);
- tmp |= (i << C0_3_PSTATE_NEW_SHIFT);
+ tmp |= ((pos - freq_table) << C0_3_PSTATE_NEW_SHIFT);
__raw_writel(tmp, dvfs_info->base + XMU_C0_3_PSTATE + cpu * 4);
}
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index 08e7bbc..cf004a5 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -21,22 +21,19 @@
int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table)
{
+ struct cpufreq_frequency_table *pos;
unsigned int min_freq = ~0;
unsigned int max_freq = 0;
- unsigned int i;
+ unsigned int freq;
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
- unsigned int freq = table[i].frequency;
- if (freq == CPUFREQ_ENTRY_INVALID) {
- pr_debug("table entry %u is invalid, skipping\n", i);
+ cpufreq_for_each_valid_entry(pos, table) {
+ freq = pos->frequency;
- continue;
- }
if (!cpufreq_boost_enabled()
- && (table[i].flags & CPUFREQ_BOOST_FREQ))
+ && (pos->flags & CPUFREQ_BOOST_FREQ))
continue;
- pr_debug("table entry %u: %u kHz\n", i, freq);
+ pr_debug("table entry %lu: %u kHz\n", pos - table, freq);
if (freq < min_freq)
min_freq = freq;
if (freq > max_freq)
@@ -57,7 +54,8 @@ EXPORT_SYMBOL_GPL(cpufreq_frequency_table_cpuinfo);
int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table)
{
- unsigned int next_larger = ~0, freq, i = 0;
+ struct cpufreq_frequency_table *pos;
+ unsigned int freq, next_larger = ~0;
bool found = false;
pr_debug("request for verification of policy (%u - %u kHz) for cpu %u\n",
@@ -65,9 +63,9 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
cpufreq_verify_within_cpu_limits(policy);
- for (; freq = table[i].frequency, freq != CPUFREQ_TABLE_END; i++) {
- if (freq == CPUFREQ_ENTRY_INVALID)
- continue;
+ cpufreq_for_each_valid_entry(pos, table) {
+ freq = pos->frequency;
+
if ((freq >= policy->min) && (freq <= policy->max)) {
found = true;
break;
@@ -118,7 +116,8 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
.driver_data = ~0,
.frequency = 0,
};
- unsigned int i;
+ struct cpufreq_frequency_table *pos;
+ unsigned int freq, i = 0;
pr_debug("request for target %u kHz (relation: %u) for cpu %u\n",
target_freq, relation, policy->cpu);
@@ -132,10 +131,10 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
break;
}
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
- unsigned int freq = table[i].frequency;
- if (freq == CPUFREQ_ENTRY_INVALID)
- continue;
+ cpufreq_for_each_valid_entry(pos, table) {
+ freq = pos->frequency;
+
+ i = pos - table;
if ((freq < policy->min) || (freq > policy->max))
continue;
switch (relation) {
@@ -184,8 +183,7 @@ EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target);
int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
unsigned int freq)
{
- struct cpufreq_frequency_table *table;
- int i;
+ struct cpufreq_frequency_table *pos, *table;
table = cpufreq_frequency_get_table(policy->cpu);
if (unlikely(!table)) {
@@ -193,10 +191,9 @@ int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
return -ENOENT;
}
- for (i = 0; table[i].frequency != CPUFREQ_TABLE_END; i++) {
- if (table[i].frequency == freq)
- return i;
- }
+ cpufreq_for_each_valid_entry(pos, table)
+ if (pos->frequency == freq)
+ return pos - table;
return -EINVAL;
}
@@ -208,16 +205,13 @@ EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_index);
static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf,
bool show_boost)
{
- unsigned int i = 0;
ssize_t count = 0;
- struct cpufreq_frequency_table *table = policy->freq_table;
+ struct cpufreq_frequency_table *pos, *table = policy->freq_table;
if (!table)
return -ENODEV;
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
- if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
- continue;
+ cpufreq_for_each_valid_entry(pos, table) {
/*
* show_boost = true and driver_data = BOOST freq
* display BOOST freqs
@@ -229,10 +223,10 @@ static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf,
* show_boost = false and driver_data != BOOST freq
* display NON BOOST freqs
*/
- if (show_boost ^ (table[i].flags & CPUFREQ_BOOST_FREQ))
+ if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ))
continue;
- count += sprintf(&buf[count], "%d ", table[i].frequency);
+ count += sprintf(&buf[count], "%d ", pos->frequency);
}
count += sprintf(&buf[count], "\n");
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index d00e5d1..5e12646 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -528,6 +528,7 @@ static int longhaul_get_ranges(void)
static void longhaul_setup_voltagescaling(void)
{
+ struct cpufreq_frequency_table *freq_pos;
union msr_longhaul longhaul;
struct mV_pos minvid, maxvid, vid;
unsigned int j, speed, pos, kHz_step, numvscales;
@@ -606,18 +607,16 @@ static void longhaul_setup_voltagescaling(void)
/* Calculate kHz for one voltage step */
kHz_step = (highest_speed - min_vid_speed) / numvscales;
- j = 0;
- while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) {
- speed = longhaul_table[j].frequency;
+ cpufreq_for_each_entry(freq_pos, longhaul_table) {
+ speed = freq_pos->frequency;
if (speed > min_vid_speed)
pos = (speed - min_vid_speed) / kHz_step + minvid.pos;
else
pos = minvid.pos;
- longhaul_table[j].driver_data |= mV_vrm_table[pos] << 8;
+ freq_pos->driver_data |= mV_vrm_table[pos] << 8;
vid = vrm_mV_table[mV_vrm_table[pos]];
- printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n",
- speed, j, vid.mV);
- j++;
+ printk(KERN_INFO PFX "f: %u kHz, index: %u, vid: %d mV\n",
+ speed, freq_pos - longhaul_table, vid.mV);
}
can_scale_voltage = 1;
diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c
index 84c84b5..9a64492 100644
--- a/drivers/cpufreq/pasemi-cpufreq.c
+++ b/drivers/cpufreq/pasemi-cpufreq.c
@@ -136,9 +136,10 @@ void restore_astate(int cpu)
static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
+ struct cpufreq_frequency_table *pos;
const u32 *max_freqp;
u32 max_freq;
- int i, cur_astate;
+ int cur_astate;
struct resource res;
struct device_node *cpu, *dn;
int err = -ENODEV;
@@ -197,10 +198,9 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
pr_debug("initializing frequency table\n");
/* initialize frequency table */
- for (i=0; pas_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) {
- pas_freqs[i].frequency =
- get_astate_freq(pas_freqs[i].driver_data) * 100000;
- pr_debug("%d: %d\n", i, pas_freqs[i].frequency);
+ cpufreq_for_each_entry(pos, pas_freqs) {
+ pos->frequency = get_astate_freq(pos->driver_data) * 100000;
+ pr_debug("%lu: %d\n", pos - pas_freqs, pos->frequency);
}
cur_astate = get_cur_astate(policy->cpu);
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c
index 49f120e..a133236 100644
--- a/drivers/cpufreq/powernow-k6.c
+++ b/drivers/cpufreq/powernow-k6.c
@@ -159,6 +159,7 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
{
+ struct cpufreq_frequency_table *pos;
unsigned int i, f;
unsigned khz;
@@ -176,12 +177,11 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
}
}
if (param_max_multiplier) {
- for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
- if (clock_ratio[i].driver_data == param_max_multiplier) {
+ cpufreq_for_each_entry(pos, clock_ratio)
+ if (pos->driver_data == param_max_multiplier) {
max_multiplier = param_max_multiplier;
goto have_max_multiplier;
}
- }
printk(KERN_ERR "powernow-k6: invalid max_multiplier parameter, valid parameters 20, 30, 35, 40, 45, 50, 55, 60\n");
return -EINVAL;
}
@@ -209,12 +209,12 @@ have_busfreq:
param_busfreq = busfreq * 10;
/* table init */
- for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
- f = clock_ratio[i].driver_data;
+ cpufreq_for_each_entry(pos, clock_ratio) {
+ f = pos->driver_data;
if (f > max_multiplier)
- clock_ratio[i].frequency = CPUFREQ_ENTRY_INVALID;
+ pos->frequency = CPUFREQ_ENTRY_INVALID;
else
- clock_ratio[i].frequency = busfreq * f;
+ pos->frequency = busfreq * f;
}
/* cpuinfo and default policy values */
diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c
index 5be8a48..b550d5c 100644
--- a/drivers/cpufreq/ppc_cbe_cpufreq.c
+++ b/drivers/cpufreq/ppc_cbe_cpufreq.c
@@ -67,9 +67,10 @@ static int set_pmode(unsigned int cpu, unsigned int slow_mode)
static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
+ struct cpufreq_frequency_table *pos;
const u32 *max_freqp;
u32 max_freq;
- int i, cur_pmode;
+ int cur_pmode;
struct device_node *cpu;
cpu = of_get_cpu_node(policy->cpu, NULL);
@@ -102,9 +103,9 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy)
pr_debug("initializing frequency table\n");
/* initialize frequency table */
- for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) {
- cbe_freqs[i].frequency = max_freq / cbe_freqs[i].driver_data;
- pr_debug("%d: %d\n", i, cbe_freqs[i].frequency);
+ cpufreq_for_each_entry(pos, cbe_freqs) {
+ pos->frequency = max_freq / pos->driver_data;
+ pr_debug("%lu: %d\n", pos - cbe_freqs, pos->frequency);
}
/* if DEBUG is enabled set_pmode() measures the latency
diff --git a/drivers/cpufreq/s3c2416-cpufreq.c b/drivers/cpufreq/s3c2416-cpufreq.c
index 4626f90..2fd53ea 100644
--- a/drivers/cpufreq/s3c2416-cpufreq.c
+++ b/drivers/cpufreq/s3c2416-cpufreq.c
@@ -266,7 +266,7 @@ out:
static void __init s3c2416_cpufreq_cfg_regulator(struct s3c2416_data *s3c_freq)
{
int count, v, i, found;
- struct cpufreq_frequency_table *freq;
+ struct cpufreq_frequency_table *pos;
struct s3c2416_dvfs *dvfs;
count = regulator_count_voltages(s3c_freq->vddarm);
@@ -275,12 +275,11 @@ static void __init s3c2416_cpufreq_cfg_regulator(struct s3c2416_data *s3c_freq)
return;
}
- freq = s3c_freq->freq_table;
- while (count > 0 && freq->frequency != CPUFREQ_TABLE_END) {
- if (freq->frequency == CPUFREQ_ENTRY_INVALID)
- continue;
+ if (!count)
+ goto out;
- dvfs = &s3c2416_dvfs_table[freq->driver_data];
+ cpufreq_for_each_valid_entry(pos, s3c_freq->freq_table) {
+ dvfs = &s3c2416_dvfs_table[pos->driver_data];
found = 0;
/* Check only the min-voltage, more is always ok on S3C2416 */
@@ -292,13 +291,12 @@ static void __init s3c2416_cpufreq_cfg_regulator(struct s3c2416_data *s3c_freq)
if (!found) {
pr_debug("cpufreq: %dkHz unsupported by regulator\n",
- freq->frequency);
- freq->frequency = CPUFREQ_ENTRY_INVALID;
+ pos->frequency);
+ pos->frequency = CPUFREQ_ENTRY_INVALID;
}
-
- freq++;
}
+out:
/* Guessed */
s3c_freq->regulator_latency = 1 * 1000 * 1000;
}
@@ -338,7 +336,7 @@ static struct notifier_block s3c2416_cpufreq_reboot_notifier = {
static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy)
{
struct s3c2416_data *s3c_freq = &s3c2416_cpufreq;
- struct cpufreq_frequency_table *freq;
+ struct cpufreq_frequency_table *pos;
struct clk *msysclk;
unsigned long rate;
int ret;
@@ -427,31 +425,27 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy)
s3c_freq->regulator_latency = 0;
#endif
- freq = s3c_freq->freq_table;
- while (freq->frequency != CPUFREQ_TABLE_END) {
+ cpufreq_for_each_entry(pos, s3c_freq->freq_table) {
/* special handling for dvs mode */
- if (freq->driver_data == 0) {
+ if (pos->driver_data == 0) {
if (!s3c_freq->hclk) {
pr_debug("cpufreq: %dkHz unsupported as it would need unavailable dvs mode\n",
- freq->frequency);
- freq->frequency = CPUFREQ_ENTRY_INVALID;
+ pos->frequency);
+ pos->frequency = CPUFREQ_ENTRY_INVALID;
} else {
- freq++;
continue;
}
}
/* Check for frequencies we can generate */
rate = clk_round_rate(s3c_freq->armdiv,
- freq->frequency * 1000);
+ pos->frequency * 1000);
rate /= 1000;
- if (rate != freq->frequency) {
+ if (rate != pos->frequency) {
pr_debug("cpufreq: %dkHz unsupported by clock (clk_round_rate return %lu)\n",
- freq->frequency, rate);
- freq->frequency = CPUFREQ_ENTRY_INVALID;
+ pos->frequency, rate);
+ pos->frequency = CPUFREQ_ENTRY_INVALID;
}
-
- freq++;
}
/* Datasheet says PLL stabalisation time must be at least 300us,
diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c
index ff7d3ec..176e84c 100644
--- a/drivers/cpufreq/s3c64xx-cpufreq.c
+++ b/drivers/cpufreq/s3c64xx-cpufreq.c
@@ -118,11 +118,10 @@ static void __init s3c64xx_cpufreq_config_regulator(void)
pr_err("Unable to check supported voltages\n");
}
- freq = s3c64xx_freq_table;
- while (count > 0 && freq->frequency != CPUFREQ_TABLE_END) {
- if (freq->frequency == CPUFREQ_ENTRY_INVALID)
- continue;
+ if (!count)
+ goto out;
+ cpufreq_for_each_valid_entry(freq, s3c64xx_freq_table) {
dvfs = &s3c64xx_dvfs_table[freq->driver_data];
found = 0;
@@ -137,10 +136,9 @@ static void __init s3c64xx_cpufreq_config_regulator(void)
freq->frequency);
freq->frequency = CPUFREQ_ENTRY_INVALID;
}
-
- freq++;
}
+out:
/* Guess based on having to do an I2C/SPI write; in future we
* will be able to query the regulator performance here. */
regulator_latency = 1 * 1000 * 1000;
@@ -179,8 +177,7 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
}
#endif
- freq = s3c64xx_freq_table;
- while (freq->frequency != CPUFREQ_TABLE_END) {
+ cpufreq_for_each_entry(freq, s3c64xx_freq_table) {
unsigned long r;
/* Check for frequencies we can generate */
@@ -196,8 +193,6 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
* frequency is the maximum we can support. */
if (!vddarm && freq->frequency > clk_get_rate(policy->clk) / 1000)
freq->frequency = CPUFREQ_ENTRY_INVALID;
-
- freq++;
}
/* Datasheet says PLL stabalisation time (if we were to use
--
1.9.0
^ permalink raw reply related
* Re: [PATCH 2/2] fsl/pci: fix EP device sometimes hangup when system resume from sleep
From: Scott Wood @ 2014-04-15 21:11 UTC (permalink / raw)
To: Dongsheng Wang; +Cc: linuxppc-dev, jason.jin
In-Reply-To: <1397547799-29464-2-git-send-email-dongsheng.wang@freescale.com>
On Tue, 2014-04-15 at 15:43 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
>
> Root cause is pcie power management state transition need a delay.
> The delay time define in "PCI Bus Power Management Interface Specification".
>
> D0, D1 or D2 --> D3 need to delay 10ms.
> D3 --> D0 need to delay 10ms.
>
> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Could you describe the other changes besides the addition of a delay at
the end?
-Scott
^ permalink raw reply
* Re: [PATCH 2/2] fsl/mpic_timer: make mpic_timer to support deep sleep feature
From: Scott Wood @ 2014-04-15 21:06 UTC (permalink / raw)
To: Wang Dongsheng-B40534
Cc: linuxppc-dev@lists.ozlabs.org, Zhao Chenhui-B35336,
Jin Zhengxiong-R64188
In-Reply-To: <b1be56f51f4c4985af837685450f4eb2@BN1PR03MB188.namprd03.prod.outlook.com>
On Mon, 2014-04-14 at 22:23 -0500, Wang Dongsheng-B40534 wrote:
>
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Tuesday, April 15, 2014 7:36 AM
> > To: Wang Dongsheng-B40534
> > Cc: Jin Zhengxiong-R64188; Li Yang-Leo-R58472; Zhao Chenhui-B35336; linuxppc-
> > dev@lists.ozlabs.org
> > Subject: Re: [PATCH 2/2] fsl/mpic_timer: make mpic_timer to support deep sleep
> > feature
> >
> > On Mon, 2014-04-14 at 10:24 +0800, Dongsheng Wang wrote:
> > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > >
> > > At T104x platfrom the timer clock will be changed when system going to
> > > deep sleep.
> >
> > Could you elaborate on what is changing and why?
> >
>
> Okay.
>
> > > +#include <asm/mpc85xx.h>
> > > #include <asm/mpic_timer.h>
> >
> > So much for, "The driver currently is only tested on fsl chip, but it can
> > potentially support other global timers complying to OpenPIC standard."
> >
> > > #define FSL_GLOBAL_TIMER 0x1
> > > @@ -71,8 +74,10 @@ struct timer_group_priv {
> > > struct timer_regs __iomem *regs;
> > > struct mpic_timer timer[TIMERS_PER_GROUP];
> > > struct list_head node;
> > > + unsigned long idle;
> > > unsigned int timerfreq;
> > > - unsigned int idle;
> >
> > Why?
> >
>
> Um... It shouldn't be happened...i will remove this.
>
> > > + unsigned int suspended_timerfreq;
> > > + unsigned int resume_timerfreq;
> > > unsigned int flags;
> > > spinlock_t lock;
> > > void __iomem *group_tcr;
> > > @@ -88,6 +93,7 @@ static struct cascade_priv cascade_timer[] = { };
> > >
> > > static LIST_HEAD(timer_group_list);
> > > +static int switch_freq_flag;
> >
> > Needs documentation, and based on "_flag" it should probably be a bool.
> >
>
> Okay.
>
> > > static void convert_ticks_to_time(struct timer_group_priv *priv,
> > > const u64 ticks, struct timeval *time) @@ -423,6 +429,33 @@ struct
> > > mpic_timer *mpic_request_timer(irq_handler_t fn, void *dev, }
> > > EXPORT_SYMBOL(mpic_request_timer);
> > >
> > > +static void timer_group_get_suspended_freq(struct timer_group_priv
> > > +*priv) {
> > > + struct device_node *np;
> > > +
> > > + np = of_find_compatible_node(NULL, NULL, "fsl,qoriq-clockgen-2.0");
> > > + if (!np) {
> > > + pr_err("mpic timer: Missing clockgen device node.\n");
> >
> > Why is it an error to not have a 2.0 QorIQ clockgen?
> >
>
> This will affect the accuracy of the timer. But not means the timer cannot work.
> Maybe you are right, this pr_err should be a pr_warn.
What I mean is, what if the mpic timer driver is used with deep sleep on
a different chip such as mpc8536?
> > > + return;
> > > + }
> > > +
> > > + of_property_read_u32(np, "clock-frequency", &priv->suspended_timerfreq);
> > > + of_node_put(np);
> >
> > Shouldn't this go through the clock API?
> >
>
> Sorry, I'm not clear about clock API, you mean fsl_get_sys_freq()? Or ?
No, I mean drivers/clk/
Though I suppose manually reading clock-frequency is OK, as the
clock-frequency on the clockgen node predated the introduction of clock
bindings to the device tree.
Don't use fsl_get_sys_freq().
> The timer operates on sys_ref_clk frequency during deep sleep. And The timer runs on
> platform clock/2 during normal operation.
Sigh... I wish hardware people would consult us before doing screwy
things like this. If the platform clock is unavailable in deep sleep
(Can that really be true? Surely there are other wakeup sources that
need it), why not run it at sys_ref_clk all the time?
Where is this documented?
> > > +static int need_to_switch_freq(void)
> > > +{
> > > + u32 svr;
> > > +
> > > + svr = mfspr(SPRN_SVR);
> > > + if (SVR_SOC_VER(svr) == SVR_T1040 ||
> > > + SVR_SOC_VER(svr) == SVR_T1042)
> > > + return 1;
> >
> > Explain why this is specific to T104x.
> >
>
> Mpic timer freq will be change when system going to deep sleep. So we need to recalculate the time.
Do any other chips with deep sleep have this problem?
-Scott
^ permalink raw reply
* Re: [PATCH v2 1/2] fsl/corenet_generic: add a particular initialization for platform
From: Scott Wood @ 2014-04-15 19:39 UTC (permalink / raw)
To: Dongsheng Wang; +Cc: linuxppc-dev, haokexin, prabhakar, jason.jin
In-Reply-To: <1397541229-34383-1-git-send-email-dongsheng.wang@freescale.com>
On Tue, 2014-04-15 at 13:53 +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
>
> Corenet_generic is a generic platform initialization. Those based on
> the corenet_generic board maybe need a particular initialize to
> enable/set some IP-Blocks. So add "Fix Generic Initialization" to solve
> this kind of special cases.
I still don't understand what you mean by "fix". What are you fixing,
or what is fixed?
There is no need for adding an infrastructure layer here. Just add a
new piece of code for t104x diu, and have it be called by an appropriate
initfunc.
> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> ---
> *v2*
> 1/ Split DIU code.
> 2/ make fix.c as a independent driver.
> diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
> index c17aae8..fce2341 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -269,6 +269,17 @@ config CORENET_GENERIC
> The following boards are supported for both 32bit and 64bit kernel:
> P5020 DS and P5040 DS
>
> +config FIX_GENERIC_PLATFORM_INIT
> + bool "Fix Generic Initialization"
> + depends on CORENET_GENERIC
Why does this depend on CORENET_GENERIC?
> + default y
No.
-Scott
^ permalink raw reply
* Re: [PATCH 1/2] powerpc/mpc85xx: add two functions to get suspend state which is standby or mem
From: Scott Wood @ 2014-04-15 19:35 UTC (permalink / raw)
To: Wang Dongsheng-B40534
Cc: linuxppc-dev@lists.ozlabs.org, Zhao Chenhui-B35336,
Jin Zhengxiong-R64188
In-Reply-To: <46de6945e1144ab086253c52dd551e9f@BN1PR03MB188.namprd03.prod.outlook.com>
On Mon, 2014-04-14 at 21:19 -0500, Wang Dongsheng-B40534 wrote:
>
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Tuesday, April 15, 2014 7:27 AM
> > To: Wang Dongsheng-B40534
> > Cc: Jin Zhengxiong-R64188; Li Yang-Leo-R58472; Zhao Chenhui-B35336; linuxppc-
> > dev@lists.ozlabs.org
> > Subject: Re: [PATCH 1/2] powerpc/mpc85xx: add two functions to get suspend state
> > which is standby or mem
> >
> > On Mon, 2014-04-14 at 10:24 +0800, Dongsheng Wang wrote:
> > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > >
> > > Add set_pm_suspend_state & pm_suspend_state functions to set/get suspend state.
> > > When system going to sleep, devices can get the system suspend
> > > state(STANDBY/MEM) through pm_suspend_state function and handle different
> > situations.
> > >
> > > Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> > >
> > > diff --git a/arch/powerpc/platforms/85xx/common.c
> > > b/arch/powerpc/platforms/85xx/common.c
> > > index b564b5e..3853d43 100644
> > > --- a/arch/powerpc/platforms/85xx/common.c
> > > +++ b/arch/powerpc/platforms/85xx/common.c
> > > @@ -8,6 +8,7 @@
> > >
> > > #include <linux/of_irq.h>
> > > #include <linux/of_platform.h>
> > > +#include <linux/suspend.h>
> > >
> > > #include <asm/qe.h>
> > > #include <sysdev/cpm2_pic.h>
> > > @@ -47,6 +48,19 @@ int __init mpc85xx_common_publish_devices(void)
> > > {
> > > return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL); }
> > > +
> > > +static suspend_state_t pm_state;
> > > +
> > > +void set_pm_suspend_state(suspend_state_t state) {
> > > + pm_state = state;
> > > +}
> > > +
> > > +suspend_state_t pm_suspend_state(void) {
> > > + return pm_state;
> > > +}
> >
> > These need to be namespaced to indicate that they apply only to mpc85xx.
> > Where do you plan on using these from, that mpc85xx can be safely assumed?
> >
>
> Mpic timer and PCIe driver.
The PCIe driver is not mpc85xx-specific.
-Scott
^ permalink raw reply
* [PATCHv2] powerpc/85xx: Add OCA4080 board support
From: Martijn de Gouw @ 2014-04-15 17:51 UTC (permalink / raw)
To: linuxppc-dev, scottwood; +Cc: stef.van.os, Martijn de Gouw
From: Martijn de Gouw <martijn.de.gouw@prodrive.nl>
OCA4080 overview:
- 1.466 GHz Freescale QorIQ P4080E Processor
- 4Gbyte DDR3 on board
- 8Mbyte Nor flash
- Serial RapidIO 1.2
- 1 x 10/100/1000 BASE-T front ethernet
- 1 x 1000 BASE-BX ethernet on AMC connector
Signed-off-by: Martijn de Gouw <martijn.de.gouw@prodrive.nl>
---
arch/powerpc/boot/dts/oca4080.dts | 118 +++++++++++++++++++++++++
arch/powerpc/configs/corenet32_smp_defconfig | 1 +
arch/powerpc/platforms/85xx/Kconfig | 2 +-
arch/powerpc/platforms/85xx/corenet_generic.c | 4 +-
4 files changed, 122 insertions(+), 3 deletions(-)
create mode 100644 arch/powerpc/boot/dts/oca4080.dts
diff --git a/arch/powerpc/boot/dts/oca4080.dts b/arch/powerpc/boot/dts/oca4080.dts
new file mode 100644
index 0000000..3d4c751
--- /dev/null
+++ b/arch/powerpc/boot/dts/oca4080.dts
@@ -0,0 +1,118 @@
+/*
+ * OCA4080 Device Tree Source
+ *
+ * Copyright 2014 Prodrive Technologies B.V.
+ *
+ * Based on:
+ * P4080DS Device Tree Source
+ * Copyright 2009-2011 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/include/ "fsl/p4080si-pre.dtsi"
+
+/ {
+ model = "fsl,OCA4080";
+ compatible = "fsl,OCA4080";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ interrupt-parent = <&mpic>;
+
+ memory {
+ device_type = "memory";
+ };
+
+ dcsr: dcsr@f00000000 {
+ ranges = <0x00000000 0xf 0x00000000 0x01008000>;
+ };
+
+ soc: soc@ffe000000 {
+ ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
+ reg = <0xf 0xfe000000 0 0x00001000>;
+
+ i2c@118000 {
+ status = "disabled";
+ };
+
+ i2c@118100 {
+ status = "disabled";
+ };
+
+ i2c@119000 {
+ status = "disabled";
+ };
+
+ i2c@119100 {
+ status = "disabled";
+ };
+
+ usb0: usb@210000 {
+ status = "disabled";
+ };
+
+ usb1: usb@211000 {
+ status = "disabled";
+ };
+ };
+
+ rio: rapidio@ffe0c0000 {
+ reg = <0xf 0xfe0c0000 0 0x11000>;
+
+ port1 {
+ ranges = <0 0 0xc 0x20000000 0 0x10000000>;
+ };
+ };
+
+ lbc: localbus@ffe124000 {
+ reg = <0xf 0xfe124000 0 0x1000>;
+ ranges = <0 0 0xf 0xef800000 0x800000>;
+
+ flash@0,0 {
+ compatible = "cfi-flash";
+ reg = <0 0 0x00800000>;
+ bank-width = <2>;
+ device-width = <2>;
+ };
+ };
+
+ pci0: pcie@ffe200000 {
+ status = "disabled";
+ };
+
+ pci1: pcie@ffe201000 {
+ status = "disabled";
+ };
+
+ pci2: pcie@ffe202000 {
+ status = "disabled";
+ };
+};
+
+/include/ "fsl/p4080si-post.dtsi"
diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index bbd794d..c19ff05 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -72,6 +72,7 @@ CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_M25P80=y
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index c17aae8..2e2d8ab 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -263,7 +263,7 @@ config CORENET_GENERIC
help
This option enables support for the FSL CoreNet based boards.
For 32bit kernel, the following boards are supported:
- P2041 RDB, P3041 DS and P4080 DS
+ P2041 RDB, P3041 DS, OCA4080 and P4080 DS
For 64bit kernel, the following boards are supported:
T4240 QDS and B4 QDS
The following boards are supported for both 32bit and 64bit kernel:
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index fbd871e..f3685047 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -55,8 +55,6 @@ void __init corenet_gen_setup_arch(void)
mpc85xx_smp_init();
swiotlb_detect_4g();
-
- pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
}
static const struct of_device_id of_device_ids[] = {
@@ -99,6 +97,7 @@ int __init corenet_gen_publish_devices(void)
static const char * const boards[] __initconst = {
"fsl,P2041RDB",
"fsl,P3041DS",
+ "fsl,OCA4080",
"fsl,P4080DS",
"fsl,P5020DS",
"fsl,P5040DS",
@@ -112,6 +111,7 @@ static const char * const boards[] __initconst = {
static const char * const hv_boards[] __initconst = {
"fsl,P2041RDB-hv",
"fsl,P3041DS-hv",
+ "fsl,OCA4080-hv",
"fsl,P4080DS-hv",
"fsl,P5020DS-hv",
"fsl,P5040DS-hv",
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] powerpc/85xx: Add OCA4080 board support
From: Scott Wood @ 2014-04-15 17:15 UTC (permalink / raw)
To: Martijn de Gouw; +Cc: stef.van.os, Martijn de Gouw, linuxppc-dev
In-Reply-To: <534D16F6.9090305@prodrive-technologies.com>
On Tue, 2014-04-15 at 13:24 +0200, Martijn de Gouw wrote:
> On 04/15/2014 12:28 AM, Scott Wood wrote:
> > On Mon, 2014-04-14 at 14:35 +0200, Martijn de Gouw wrote:
> >> + lbc: localbus@ffe124000 {
> >> + reg = <0xf 0xfe124000 0 0x1000>;
> >> + ranges = <0 0 0xf 0xef800000 0x800000>;
> >> +
> >> + flash@0,0 {
> >> + #address-cells = <1>;
> >> + #size-cells = <1>;
> >> + compatible = "cfi-flash";
> >> + reg = <0 0 0x00800000>;
> >> + bank-width = <2>;
> >> + device-width = <2>;
> >> + partition@rcw {
> >> + label = "rcw";
> >> + reg = <0x00000000 0x00020000>;
> >> + };
> >> + partition@fman-ucode {
> >> + label = "fman-ucode";
> >> + reg = <0x00020000 0x00020000>;
> >> + };
> >> + partition@user {
> >> + label = "user";
> >> + reg = <0x00040000 0x00680000>;
> >> + };
> >> + partition@env0 {
> >> + label = "env0";
> >> + reg = <0x006c0000 0x00020000>;
> >> + };
> >> + partition@env1 {
> >> + label = "env1";
> >> + reg = <0x006e0000 0x00020000>;
> >> + };
> >> + partition@u-boot {
> >> + label = "u-boot";
> >> + reg = <0x00700000 0x00080000>;
> >> + };
> >> + partition@u-boot-backup {
> >> + label = "u-boot-backup";
> >> + reg = <0x00780000 0x00080000>;
> >> + };
> >
> > These are not valid unit addresses. Regardless, please don't put
> > partition info in the dts.
>
> How is this different than the partitions defined in i.e. p4080ds.dts?
If you mean the unit addresses, they're supposed to be hex numbers that
match reg. If you mean why are they there at all in p4080ds.dts, a lot
of existing trees have them but it's bad to mix configuration in with
hardware description and we're discouraging putting partitions in new
dts files. It would be nice to clean up the old dts files as well,
though I'm concerned about people who are currently relying on them.
OTOH I'm also concerned about users for whom the dts partitions don't
match reality...
> Of course I can remove them from the dts, but where should they be defined?
Either use mtdparts on the kernel command line, or have U-Boot generate
the partition nodes at runtime based on the mtdparts environment
variable (there is already code for this).
-Scott
^ permalink raw reply
* [PATCH v2 6/6] powerpc/perf/hv-24x7: catalog version number is be64, not be32
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
In-Reply-To: <1397581855-4585-1-git-send-email-cody@linux.vnet.ibm.com>
The catalog version number was changed from a be32 (with proceeding
32bits of padding) to a be64, update the code to treat it as a be64
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
arch/powerpc/perf/hv-24x7.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 95a67f8..9d4badc 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -171,7 +171,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
}
static unsigned long h_get_24x7_catalog_page(char page[],
- u32 version, u32 index)
+ u64 version, u32 index)
{
return h_get_24x7_catalog_page_(virt_to_phys(page),
version, index);
@@ -185,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
ssize_t ret = 0;
size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
loff_t page_offset = 0;
- uint32_t catalog_version_num = 0;
+ uint64_t catalog_version_num = 0;
void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
struct hv_24x7_catalog_page_0 *page_0 = page;
if (!page)
@@ -197,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
goto e_free;
}
- catalog_version_num = be32_to_cpu(page_0->version);
+ catalog_version_num = be64_to_cpu(page_0->version);
catalog_page_len = be32_to_cpu(page_0->length);
catalog_len = catalog_page_len * 4096;
@@ -255,7 +255,7 @@ e_free: \
static DEVICE_ATTR_RO(_name)
PAGE_0_ATTR(catalog_version, "%lld\n",
- (unsigned long long)be32_to_cpu(page_0->version));
+ (unsigned long long)be64_to_cpu(page_0->version));
PAGE_0_ATTR(catalog_len, "%lld\n",
(unsigned long long)be32_to_cpu(page_0->length) * 4096);
static BIN_ATTR_RO(catalog, 0/* real length varies */);
--
1.9.2
^ permalink raw reply related
* [PATCH v2 2/6] powerpc/perf/hv_gpci: probe failures use pr_debug(), and padding reduced
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
In-Reply-To: <1397581855-4585-1-git-send-email-cody@linux.vnet.ibm.com>
fixup for "powerpc/perf: Add support for the hv gpci (get performance
counter info) interface".
Makes the "not enabled" message less awful (and hidden unless
debugging).
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
arch/powerpc/perf/hv-gpci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c
index 278ba7b..8fee1dc 100644
--- a/arch/powerpc/perf/hv-gpci.c
+++ b/arch/powerpc/perf/hv-gpci.c
@@ -273,13 +273,13 @@ static int hv_gpci_init(void)
struct hv_perf_caps caps;
if (!firmware_has_feature(FW_FEATURE_LPAR)) {
- pr_info("not a virtualized system, not enabling\n");
+ pr_debug("not a virtualized system, not enabling\n");
return -ENODEV;
}
hret = hv_perf_caps_get(&caps);
if (hret) {
- pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n",
+ pr_debug("could not obtain capabilities, not enabling, rc=%ld\n",
hret);
return -ENODEV;
}
--
1.9.2
^ permalink raw reply related
* [PATCH v2 1/6] powerpc/perf/hv_24x7: probe errors changed to pr_debug(), padding fixed
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
In-Reply-To: <1397581855-4585-1-git-send-email-cody@linux.vnet.ibm.com>
fixup for "powerpc/perf: Add support for the hv 24x7 interface"
Makes the "not enabled" message less awful (and hides it in most cases).
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
arch/powerpc/perf/hv-24x7.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 297c9105..f5bca73 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -485,13 +485,13 @@ static int hv_24x7_init(void)
struct hv_perf_caps caps;
if (!firmware_has_feature(FW_FEATURE_LPAR)) {
- pr_info("not a virtualized system, not enabling\n");
+ pr_debug("not a virtualized system, not enabling\n");
return -ENODEV;
}
hret = hv_perf_caps_get(&caps);
if (hret) {
- pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n",
+ pr_debug("could not obtain capabilities, not enabling, rc=%ld\n",
hret);
return -ENODEV;
}
--
1.9.2
^ permalink raw reply related
* [PATCH v2 5/6] powerpc/perf/hv-24x7: remove [static 4096], sparse chokes on it
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
In-Reply-To: <1397581855-4585-1-git-send-email-cody@linux.vnet.ibm.com>
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
arch/powerpc/perf/hv-24x7.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index 3e8f60a..95a67f8 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -170,7 +170,7 @@ static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
index);
}
-static unsigned long h_get_24x7_catalog_page(char page[static 4096],
+static unsigned long h_get_24x7_catalog_page(char page[],
u32 version, u32 index)
{
return h_get_24x7_catalog_page_(virt_to_phys(page),
--
1.9.2
^ permalink raw reply related
* [PATCH v2 4/6] powerpc/perf/hv-24x7: use (unsigned long) not (u32) values when calling plpar_hcall_norets()
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
In-Reply-To: <1397581855-4585-1-git-send-email-cody@linux.vnet.ibm.com>
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
arch/powerpc/perf/hv-24x7.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
index f5bca73..3e8f60a 100644
--- a/arch/powerpc/perf/hv-24x7.c
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -155,16 +155,28 @@ static ssize_t read_offset_data(void *dest, size_t dest_len,
return copy_len;
}
-static unsigned long h_get_24x7_catalog_page(char page[static 4096],
- u32 version, u32 index)
+static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096,
+ unsigned long version,
+ unsigned long index)
{
- WARN_ON(!IS_ALIGNED((unsigned long)page, 4096));
+ pr_devel("h_get_24x7_catalog_page(0x%lx, %lu, %lu)",
+ phys_4096,
+ version,
+ index);
+ WARN_ON(!IS_ALIGNED(phys_4096, 4096));
return plpar_hcall_norets(H_GET_24X7_CATALOG_PAGE,
- virt_to_phys(page),
+ phys_4096,
version,
index);
}
+static unsigned long h_get_24x7_catalog_page(char page[static 4096],
+ u32 version, u32 index)
+{
+ return h_get_24x7_catalog_page_(virt_to_phys(page),
+ version, index);
+}
+
static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t offset, size_t count)
--
1.9.2
^ permalink raw reply related
* [PATCH v2 3/6] powerpc/perf/hv-gpci: make device attr static
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
In-Reply-To: <1397581855-4585-1-git-send-email-cody@linux.vnet.ibm.com>
Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
arch/powerpc/perf/hv-gpci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c
index 8fee1dc..c9d399a 100644
--- a/arch/powerpc/perf/hv-gpci.c
+++ b/arch/powerpc/perf/hv-gpci.c
@@ -78,7 +78,7 @@ static ssize_t kernel_version_show(struct device *dev,
return sprintf(page, "0x%x\n", COUNTER_INFO_VERSION_CURRENT);
}
-DEVICE_ATTR_RO(kernel_version);
+static DEVICE_ATTR_RO(kernel_version);
HV_CAPS_ATTR(version, "0x%x\n");
HV_CAPS_ATTR(ga, "%d\n");
HV_CAPS_ATTR(expanded, "%d\n");
--
1.9.2
^ permalink raw reply related
* [PATCH v2 0/6] powerpc/perf/hv_{gpci,24x7}: fixes
From: Cody P Schafer @ 2014-04-15 17:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Linux PPC, LKML, David.Laight, Anton Blanchard, Cody P Schafer
- 24x7 and gpci probing now uses pr_debug() and doesn't pad to 80 characters
- Catalog access is fixed for LE kernels
- remove c99 feature sparse doesn't like
- 1 device attr made static
Cody P Schafer (6):
powerpc/perf/hv_24x7: probe errors changed to pr_debug(), padding
fixed
powerpc/perf/hv_gpci: probe failures use pr_debug(), and padding
reduced
powerpc/perf/hv-gpci: make device attr static
powerpc/perf/hv-24x7: use (unsigned long) not (u32) values when
calling plpar_hcall_norets()
powerpc/perf/hv-24x7: remove [static 4096], sparse chokes on it
powerpc/perf/hv-24x7: catalog version number is be64, not be32
arch/powerpc/perf/hv-24x7.c | 30 +++++++++++++++++++++---------
arch/powerpc/perf/hv-gpci.c | 6 +++---
2 files changed, 24 insertions(+), 12 deletions(-)
--
1.9.2
^ permalink raw reply
* [PATCH] powerpc/mm: Fix ".__node_distance" undefined
From: Mike Qiu @ 2014-04-15 14:00 UTC (permalink / raw)
To: linuxppc-dev
Cc: sfr, jlarrew, Mike Qiu, paulus, srivatsa.bhat, alistair, nfont,
akpm, rcj
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
...
Building modules, stage 2.
WARNING: 1 bad relocations
c0000000013d6a30 R_PPC64_ADDR64 uprobes_fetch_type_table
WRAP arch/powerpc/boot/zImage.pseries
WRAP arch/powerpc/boot/zImage.epapr
MODPOST 1849 modules
ERROR: ".__node_distance" [drivers/block/nvme.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....
The reason is symbol "__node_distance" not been exported in powerpc.
Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
---
arch/powerpc/mm/numa.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 4ebbb9e..3b181b2 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -232,6 +232,7 @@ int __node_distance(int a, int b)
return distance;
}
+EXPORT_SYMBOL(__node_distance);
static void initialize_distance_lookup_table(int nid,
const __be32 *associativity)
--
1.8.3.1
^ permalink raw reply related
* Re: Build regressions/improvements in v3.15-rc1
From: Geert Uytterhoeven @ 2014-04-15 11:44 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org
Cc: linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org,
adi-buildroot-devel, Linux MIPS Mailing List
In-Reply-To: <1397561816-9289-1-git-send-email-geert@linux-m68k.org>
On Tue, Apr 15, 2014 at 1:36 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Below is the list of build error/warning regressions/improvements in
> v3.15-rc1[1] compared to v3.14[2].
>
> Summarized:
> - build errors: +30/-3
> 30 regressions:
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_ANDCOND' undeclared (first use in this function): => 178:17,
100:16
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_AVPN' undeclared (first use in this function): => 213:16, 99:16,
177:17
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_BULK_REMOVE' undeclared (first use in this function): => 268:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_CEDE' undeclared (first use in this function): => 272:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_CPPR' undeclared (first use in this function): => 279:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_ENTER' undeclared (first use in this function): => 262:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_EOI' undeclared (first use in this function): => 280:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_EXACT' undeclared (first use in this function): => 56:6
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_IPI' undeclared (first use in this function): => 281:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_IPOLL' undeclared (first use in this function): => 282:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_NOT_FOUND' undeclared (first use in this function): => 211:8, 97:8
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_PARAMETER' undeclared (first use in this function): => 155:10
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_PROTECT' undeclared (first use in this function): => 266:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_PTEG_FULL' undeclared (first use in this function): => 55:8
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_PUT_TCE' undeclared (first use in this function): => 270:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_REMOVE' undeclared (first use in this function): => 264:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_RTAS' undeclared (first use in this function): => 287:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_SUCCESS' undeclared (first use in this function): => 108:8, 229:8,
141:12, 75:8
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_TOO_HARD' undeclared (first use in this function): => 246:12
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_XIRR' undeclared (first use in this function): => 278:7
+ /scratch/kisskb/src/arch/powerpc/kvm/book3s_pr_papr.c: error:
'H_XIRR_X' undeclared (first use in this function): => 283:7
+ /scratch/kisskb/src/include/linux/kvm_host.h: error: array
subscript is above array bounds [-Werror=array-bounds]: => 436:19
powerpc-randconfig
+ /scratch/kisskb/src/drivers/cpufreq/powernv-cpufreq.c: error:
implicit declaration of function 'cpu_sibling_mask'
[-Werror=implicit-function-declaration]: => 241:2
ppc64_defconfig
+ /scratch/kisskb/src/drivers/spi/spi-bfin5xx.c: error: implicit
declaration of function 'gpio_direction_output'
[-Werror=implicit-function-declaration]: => 1102:4
+ /scratch/kisskb/src/drivers/spi/spi-bfin5xx.c: error: implicit
declaration of function 'gpio_free'
[-Werror=implicit-function-declaration]: => 1130:3
+ /scratch/kisskb/src/drivers/spi/spi-bfin5xx.c: error: implicit
declaration of function 'gpio_request'
[-Werror=implicit-function-declaration]: => 1097:4
+ /scratch/kisskb/src/drivers/spi/spi-bfin5xx.c: error: implicit
declaration of function 'gpio_set_value'
[-Werror=implicit-function-declaration]: => 169:3
BF537-STAMP_defconfig
+ error: "__invalidate_icache_range" [drivers/misc/lkdtm.ko]
undefined!: => N/A
xtensa-allmodconfig (fix available, IIRC)
+ error: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined!: => N/A
mips-allmodconfig (fix available, IIRC)
+ error: No rule to make target drivers/scsi/aic7xxx/aicasm/*.[chyl]: => N/A
x86_64-randconfig
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvald
^ permalink raw reply
* Re: [PATCH] powerpc/85xx: Add OCA4080 board support
From: Martijn de Gouw @ 2014-04-15 11:24 UTC (permalink / raw)
To: Scott Wood; +Cc: stef.van.os, Martijn de Gouw, linuxppc-dev
In-Reply-To: <1397514507.20280.223.camel@snotra.buserror.net>
On 04/15/2014 12:28 AM, Scott Wood wrote:
> On Mon, 2014-04-14 at 14:35 +0200, Martijn de Gouw wrote:
>> + lbc: localbus@ffe124000 {
>> + reg = <0xf 0xfe124000 0 0x1000>;
>> + ranges = <0 0 0xf 0xef800000 0x800000>;
>> +
>> + flash@0,0 {
>> + #address-cells = <1>;
>> + #size-cells = <1>;
>> + compatible = "cfi-flash";
>> + reg = <0 0 0x00800000>;
>> + bank-width = <2>;
>> + device-width = <2>;
>> + partition@rcw {
>> + label = "rcw";
>> + reg = <0x00000000 0x00020000>;
>> + };
>> + partition@fman-ucode {
>> + label = "fman-ucode";
>> + reg = <0x00020000 0x00020000>;
>> + };
>> + partition@user {
>> + label = "user";
>> + reg = <0x00040000 0x00680000>;
>> + };
>> + partition@env0 {
>> + label = "env0";
>> + reg = <0x006c0000 0x00020000>;
>> + };
>> + partition@env1 {
>> + label = "env1";
>> + reg = <0x006e0000 0x00020000>;
>> + };
>> + partition@u-boot {
>> + label = "u-boot";
>> + reg = <0x00700000 0x00080000>;
>> + };
>> + partition@u-boot-backup {
>> + label = "u-boot-backup";
>> + reg = <0x00780000 0x00080000>;
>> + };
>
> These are not valid unit addresses. Regardless, please don't put
> partition info in the dts.
How is this different than the partitions defined in i.e. p4080ds.dts?
Of course I can remove them from the dts, but where should they be defined?
--
Martijn de Gouw
Engineer
Prodrive Technologies B.V.
Mobile: +31 63 17 76 161
Phone: +31 40 26 76 200
^ permalink raw reply
* [PATCH RFC v11 6/6] dma: mpc512x: register for device tree channel lookup
From: Alexander Popov @ 2014-04-15 10:54 UTC (permalink / raw)
To: Gerhard Sittig, Dan Williams, Vinod Koul, Lars-Peter Clausen,
Arnd Bergmann, Anatolij Gustschin, Andy Shevchenko,
Alexander Popov, linuxppc-dev, dmaengine
Cc: devicetree
In-Reply-To: <1397559250-17680-1-git-send-email-a13xp0p0v88@gmail.com>
Register the controller for device tree based lookup of DMA channels
(non-fatal for backwards compatibility with older device trees) and
provide the '#dma-cells' property in the shared mpc5121.dtsi file
Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Alexander Popov <a13xp0p0v88@gmail.com>
---
arch/powerpc/boot/dts/mpc5121.dtsi | 1 +
drivers/dma/mpc512x_dma.c | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi
index 2c0e155..7f9d14f 100644
--- a/arch/powerpc/boot/dts/mpc5121.dtsi
+++ b/arch/powerpc/boot/dts/mpc5121.dtsi
@@ -498,6 +498,7 @@
compatible = "fsl,mpc5121-dma";
reg = <0x14000 0x1800>;
interrupts = <65 0x8>;
+ #dma-cells = <1>;
};
};
diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index 1b90b3b..ab70012 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -52,6 +52,7 @@
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
+#include <linux/of_dma.h>
#include <linux/of_platform.h>
#include <linux/random.h>
@@ -1031,7 +1032,15 @@ static int mpc_dma_probe(struct platform_device *op)
if (retval)
goto err_free2;
- return retval;
+ /* Register with OF helpers for DMA lookups (nonfatal) */
+ if (dev->of_node) {
+ retval = of_dma_controller_register(dev->of_node,
+ of_dma_xlate_by_chan_id, mdma);
+ if (retval)
+ dev_warn(dev, "Could not register for OF lookup\n");
+ }
+
+ return 0;
err_free2:
if (mdma->is_mpc8308)
@@ -1052,6 +1061,8 @@ static int mpc_dma_remove(struct platform_device *op)
struct device *dev = &op->dev;
struct mpc_dma *mdma = dev_get_drvdata(dev);
+ if (dev->of_node)
+ of_dma_controller_free(dev->of_node);
dma_async_device_unregister(&mdma->dma);
if (mdma->is_mpc8308) {
free_irq(mdma->irq2, mdma);
--
1.8.4.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox