arch_update_cpu_topology function is called by the scheduler
before building its sched_domain hierarchy. Prepare the update
of the cpu topology masks in this function in addition to set
it in the the store_cpu_topology which is executed only once per cpu.
Signed-off-by: Vincent Guittot <vincent.guittot(a)linaro.org>
---
arch/arm/kernel/topology.c | 108 +++++++++++++++++++++++++++++++++++---------
1 files changed, 87 insertions(+), 21 deletions(-)
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 8200dea..90352cb 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -43,12 +43,76 @@
struct cputopo_arm cpu_topology[NR_CPUS];
+/*
+ * cpu topology mask management
+ */
+
+unsigned int advanced_topology = 0;
+
+/*
+ * default topology function
+ */
+
const struct cpumask *cpu_coregroup_mask(int cpu)
{
return &cpu_topology[cpu].core_sibling;
}
/*
+ * clear cpu topology masks
+ */
+static void clear_cpu_topology_mask(void)
+{
+ unsigned int cpuid;
+ for_each_possible_cpu(cpuid) {
+ struct cputopo_arm *cpuid_topo = &(cpu_topology[cpuid]);
+ cpumask_clear(&cpuid_topo->core_sibling);
+ cpumask_clear(&cpuid_topo->thread_sibling);
+ }
+ smp_wmb();
+}
+
+/*
+ * default_cpu_topology_mask set the core and thread mask as described in the
+ * ARM ARM
+ */
+static inline void default_cpu_topology_mask(unsigned int cpuid)
+{
+ struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid];
+ unsigned int cpu;
+
+ for_each_possible_cpu(cpu) {
+ struct cputopo_arm *cpu_topo = &cpu_topology[cpu];
+
+ if (cpuid_topo->socket_id == cpu_topo->socket_id) {
+ cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
+ if (cpu != cpuid)
+ cpumask_set_cpu(cpu,
+ &cpuid_topo->core_sibling);
+
+ if (cpuid_topo->core_id == cpu_topo->core_id) {
+ cpumask_set_cpu(cpuid,
+ &cpu_topo->thread_sibling);
+ if (cpu != cpuid)
+ cpumask_set_cpu(cpu,
+ &cpuid_topo->thread_sibling);
+ }
+ }
+ }
+ smp_wmb();
+}
+
+static void normal_cpu_topology_mask(void)
+{
+ unsigned int cpuid;
+
+ for_each_possible_cpu(cpuid) {
+ default_cpu_topology_mask(cpuid);
+ }
+ smp_wmb();
+}
+
+/*
* store_cpu_topology is called at boot when only one cpu is running
* and with the mutex cpu_hotplug.lock locked, when several cpus have booted,
* which prevents simultaneous write access to cpu_topology array
@@ -57,7 +121,6 @@ void store_cpu_topology(unsigned int cpuid)
{
struct cputopo_arm *cpuid_topo = &cpu_topology[cpuid];
unsigned int mpidr;
- unsigned int cpu;
/* If the cpu topology has been already set, just return */
if (cpuid_topo->core_id != -1)
@@ -99,26 +162,11 @@ void store_cpu_topology(unsigned int cpuid)
cpuid_topo->socket_id = -1;
}
- /* update core and thread sibling masks */
- for_each_possible_cpu(cpu) {
- struct cputopo_arm *cpu_topo = &cpu_topology[cpu];
-
- if (cpuid_topo->socket_id == cpu_topo->socket_id) {
- cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
- if (cpu != cpuid)
- cpumask_set_cpu(cpu,
- &cpuid_topo->core_sibling);
-
- if (cpuid_topo->core_id == cpu_topo->core_id) {
- cpumask_set_cpu(cpuid,
- &cpu_topo->thread_sibling);
- if (cpu != cpuid)
- cpumask_set_cpu(cpu,
- &cpuid_topo->thread_sibling);
- }
- }
- }
- smp_wmb();
+ /*
+ * The core and thread sibling masks can also be updated during the
+ * call of arch_update_cpu_topology
+ */
+ default_cpu_topology_mask(cpuid);
printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
cpuid, cpu_topology[cpuid].thread_id,
@@ -127,6 +175,24 @@ void store_cpu_topology(unsigned int cpuid)
}
/*
+ * arch_update_cpu_topology is called by the scheduler before building
+ * a new sched_domain hierarchy.
+ */
+int arch_update_cpu_topology(void)
+{
+ if (!advanced_topology)
+ return 0;
+
+ /* clear core mask */
+ clear_cpu_topology_mask();
+
+ /* update core and thread sibling masks */
+ normal_cpu_topology_mask();
+
+ return 1;
+}
+
+/*
* init_cpu_topology is called at boot when only one cpu is running
* which prevent simultaneous write access to cpu_topology array
*/
--
1.7.4.1
Just wanted to announce that the initial Linaro+Android-3.1 kernel for
11.11 is available.
I've tagged it as: linux-linaro-3.1-2011.11-0-android-0
>From the branch:
git://android.git.linaro.org/kernel/linaro-android.git linaro-android-3.1-agreen-rebase
Please remember Nico is freezing the 11.11 linaro kernel on Monday, and
I'll be tagging the 11.11 linaro-android kernel shortly there after.
thanks
-john
W dniu 11.11.2011 03:55, Adilson Oliveira pisze:
Hi.
I'm re-posting a question from a canonical folk about Efika MX, I think
the audience here will be more capable of helping out.
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello
>
> I got an Efika MX and I wondered if anyone qwas able to instrall a
> more recent Ubuntu on it. I tried Linaro's image but the SD is not
> recognized at boot time. Am I missing something or was the SD supposed
> to be detected automatically?
>
> TIA
>
> Adilson.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk68jroACgkQYaKG37RGLIp/pACdFvTB3hVssnVCeXNL9EulVb9Z
> UccAn3z3YUvON/ji1gdRDaRuHq/IZrA1
> =73EU
> -----END PGP SIGNATURE-----
Some pinctrl drivers (Tegra at least) program a pin to be a GPIO in a
completely different manner than they select which function to mux out of
that pin. In order to support a single "free" pinmux_op, the driver would
need to maintain a per-pin state of requested-for-gpio vs. requested-for-
function. However, that's a lot of work when the core already has explicit
separate paths for gpio request/free and function request/free.
So, add a gpio_disable_free op to struct pinmux_ops, and make pin_free()
call it when appropriate.
When doing this, I noticed that when calling pin_request():
!!gpio == (gpio_range != NULL)
... and so I collapsed those two parameters in both pin_request(), and
when adding writing the new code in pin_free().
Also, for pin_free():
!!free_func == (gpio_range != NULL)
However, I didn't want pin_free() to know about the GPIO function naming
special case, so instead, I reworked pin_free() to always return the pin's
previously requested function, and now pinmux_free_gpio() calls
kfree(function). This is much more balanced with the allocation having
been performed in pinmux_request_gpio().
Signed-off-by: Stephen Warren <swarren(a)nvidia.com>
---
drivers/pinctrl/pinmux.c | 39 +++++++++++++++++++++++++--------------
include/linux/pinctrl/pinmux.h | 3 +++
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index a5467f8..8a95e45 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -98,12 +98,11 @@ struct pinmux_hog {
* @function: a functional name to give to this pin, passed to the driver
* so it knows what function to mux in, e.g. the string "gpioNN"
* means that you want to mux in the pin for use as GPIO number NN
- * @gpio: if this request concerns a single GPIO pin
* @gpio_range: the range matching the GPIO pin if this is a request for a
* single GPIO pin
*/
static int pin_request(struct pinctrl_dev *pctldev,
- int pin, const char *function, bool gpio,
+ int pin, const char *function,
struct pinctrl_gpio_range *gpio_range)
{
struct pin_desc *desc;
@@ -152,7 +151,7 @@ static int pin_request(struct pinctrl_dev *pctldev,
* If there is no kind of request function for the pin we just assume
* we got it by default and proceed.
*/
- if (gpio && ops->gpio_request_enable)
+ if (gpio_range && ops->gpio_request_enable)
/* This requests and enables a single GPIO pin */
status = ops->gpio_request_enable(pctldev, gpio_range, pin);
else if (ops->request)
@@ -182,29 +181,39 @@ out:
* pin_free() - release a single muxed in pin so something else can be muxed
* @pctldev: pin controller device handling this pin
* @pin: the pin to free
- * @free_func: whether to free the pin's assigned function name string
+ * @gpio_range: the range matching the GPIO pin if this is a request for a
+ * single GPIO pin
*/
-static void pin_free(struct pinctrl_dev *pctldev, int pin, int free_func)
+static const char *pin_free(struct pinctrl_dev *pctldev, int pin,
+ struct pinctrl_gpio_range *gpio_range)
{
const struct pinmux_ops *ops = pctldev->desc->pmxops;
struct pin_desc *desc;
+ const char *func;
desc = pin_desc_get(pctldev, pin);
if (desc == NULL) {
dev_err(&pctldev->dev,
"pin is not registered so it cannot be freed\n");
- return;
+ return NULL;
}
- if (ops->free)
+ /*
+ * If there is no kind of request function for the pin we just assume
+ * we got it by default and proceed.
+ */
+ if (gpio_range && ops->gpio_disable_free)
+ ops->gpio_disable_free(pctldev, gpio_range, pin);
+ else if (ops->free)
ops->free(pctldev, pin);
spin_lock(&desc->lock);
- if (free_func)
- kfree(desc->mux_function);
+ func = desc->mux_function;
desc->mux_function = NULL;
spin_unlock(&desc->lock);
module_put(pctldev->owner);
+
+ return func;
}
/**
@@ -234,7 +243,7 @@ int pinmux_request_gpio(unsigned gpio)
if (!function)
return -EINVAL;
- ret = pin_request(pctldev, pin, function, true, range);
+ ret = pin_request(pctldev, pin, function, range);
if (ret < 0)
kfree(function);
@@ -252,6 +261,7 @@ void pinmux_free_gpio(unsigned gpio)
struct pinctrl_gpio_range *range;
int ret;
int pin;
+ const char *func;
ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
if (ret)
@@ -260,7 +270,8 @@ void pinmux_free_gpio(unsigned gpio)
/* Convert to the pin controllers number space */
pin = gpio - range->base;
- pin_free(pctldev, pin, true);
+ func = pin_free(pctldev, pin, range);
+ kfree(func);
}
EXPORT_SYMBOL_GPL(pinmux_free_gpio);
@@ -350,7 +361,7 @@ static int acquire_pins(struct pinctrl_dev *pctldev,
/* Try to allocate all pins in this group, one by one */
for (i = 0; i < num_pins; i++) {
- ret = pin_request(pctldev, pins[i], func, false, NULL);
+ ret = pin_request(pctldev, pins[i], func, NULL);
if (ret) {
dev_err(&pctldev->dev,
"could not get pin %d for function %s "
@@ -360,7 +371,7 @@ static int acquire_pins(struct pinctrl_dev *pctldev,
/* On error release all taken pins */
i--; /* this pin just failed */
for (; i >= 0; i--)
- pin_free(pctldev, pins[i], false);
+ pin_free(pctldev, pins[i], NULL);
return -ENODEV;
}
}
@@ -390,7 +401,7 @@ static void release_pins(struct pinctrl_dev *pctldev,
return;
}
for (i = 0; i < num_pins; i++)
- pin_free(pctldev, pins[i], false);
+ pin_free(pctldev, pins[i], NULL);
}
/**
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h
index 3c430e7..350e32a 100644
--- a/include/linux/pinctrl/pinmux.h
+++ b/include/linux/pinctrl/pinmux.h
@@ -73,6 +73,9 @@ struct pinmux_ops {
int (*gpio_request_enable) (struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned offset);
+ void (*gpio_disable_free) (struct pinctrl_dev *pctldev,
+ struct pinctrl_gpio_range *range,
+ unsigned offset);
};
/* External interface to pinmux */
--
1.7.0.4
Enclosed please find the link to the Weekly Status & Individual Activity
reports
for the kernel working group for the week ending 2011-11-11
== Weekly Status Report ==
https://wiki.linaro.org/WorkingGroups/Kernel/Status/2011-11-10
== Individual Activity Report ==
https://wiki.linaro.org/WorkingGroups/Kernel/ActivityReports/2011-11-04
== Summary ==
(For more details, refer to the Weekly Status & Individual Activity
Reports)
* Most of the KWG team has attended Linaro Connect, many good sessions,
discussion and hacking has happened.
Deepak has summarized the event for KWG:
http://www.linaro.org/linaro-blog/2011/11/09/kernel-working-group-a-linaro-…
* Due to Thanksgiving holiday, this month's Linaro kernel release will be
as follows: Freeze on Monday 2011-11-14 and release on Thursday 2011-11-17.
* Based on discussions at LCQ4.11 Connect in Orlando, there will be a new
process for the Kernel WG, new sub-team will be designated for each major
area.
* Device Tree
* Submitted rebased version of the samsung's sdhci driver DT patches.
* Regulator core DT patches Acked by Mark. Some more minor comments from
Olof, will need another final repost.
* Initial omap hsmmc DT patches posted.
* Pinctrl
* Linus Torvalds has pulled the pinctrl subssystem for Linux v3.2.
* All GPIO cleanups initially started in the Cambourne sprint in
cooperation with Ben Dooks, have been pulled into Linus Torvalds' tree.
Best regards,
Mounir
--
Mounir Bsaibes
Project Manager
Follow Linaro.org:
facebook.com/pages/Linaro/155974581091106http://twitter.com/#!/linaroorghttp://www.linaro.org/linaro-blog <http://www.linaro.org/linaro-blog>
Hi,
I have made some modification to the SMSC LAN911X driver for both UBoot and QEMU in order to be able to use SMSC LAN9X based network drivers during the u-boot stage.
1) U-Boot
In UBoot, when the LAN911X device is reseted, the READY bit is checked and device is wake up by writing onto the TEST_BYTE register if the READY bit cleared (0b). But from the datasheet of the SMSC LAN9118/LAN9115/LAN9220 in the section Power Management (3.10), it is said that READY bit is cleared when PM_MODE is set to D1 or D2 and set only when in D0 mode.
3.10.2
Functional Description
There is one normal operating power state, D0 and there are two power saving states: D1, and D2.
Upon entry into either of the two power saving states, only the PMT_CTRL register is accessible for
read operations. In either of the power saving states the READY bit in the PMT_CTRL register will be
cleared. Reads of any other addresses are forbidden until the READY bit is set. All writes, with the
exception of the wakeup write to BYTE_TEST, are also forbidden until the READY bit is set. Only when
in the D0 (Normal) state, when the READY bit is set, can the rest of the device be accessed.
So I modified the code (drivers/net/smc911x.h) to wake up the device only if the READY bit is cleared (0b). If it is set (1b) then we just do nothing.
Patch is contained in following commit : https://bitbucket.org/bca/u-boot-linaro-stable/changeset/b870326105da
2) QEMU
In the driver for the SMSC LAN9118 device (hw/lan9118.c), I modify the code to update the PM_CTRL register (switch PM_MODE bits to D0 and set (1b) READY bit ) when writing to the BYTE_TEST register.
Writing to PM_CTRL was not permitted before this modification => raise an harware error => QEMU crash when happen. So when you try to perform network connection in u-boot stage in QEMU, QEMU crashed.
Patch is contained in the following commit : https://bitbucket.org/bca/qemu-linaro/changeset/0aa1f76e5141
If you have any question, or if you find any mistake in my understanding, please feel free to contact me.
Hope it helps others and a bit thanks for the Linaro initiative
--
Bertrand Cachet, Ingénieur CPE (Lyon, France)
Institut REDS, Reconfigurable & Embedded Digital Systems
Tél : +41 24/55 77 372
Email : bertrand.cachet(a)heig-vd.ch<mailto:bertrand.cachet@heig-vd.ch>
Internet: http://www.reds.ch
HEIG-VD, Haute Ecole d'Ingénierie et de Gestion du Canton de Vaud
Rte de Cheseaux 1
CH-1401 Yverdon-les-Bains
Internet: http://www.heig-vd.ch
Here's a quick status update on the server upgrade we performed today. The
major things we were doing were:
* Memory upgrades - we now have about 7.5x the memory we had previously,
things are *much* faster now
* OS updates - We're now running on the latest version of Ubuntu Server
* LAVA updates
If you take a look at http://validation.linaro.org, you will now see the
version we had in staging last week at the connect, with more Linaro
theming, menu improvements, and bug fixes.
Jobs are running again, and we've mostly cleared the backlog but seem to be
having some network problems that are unrelated to the upgrades, causing
failures in some of the jobs. The validation team is currently looking at
what can be done to improve this soon.
Thanks,
Paul Larson
On Thu, Nov 10, 2011 at 2:31 AM, Dave Pigott <dave.pigott(a)linaro.org> wrote:
> Hi all,
>
> Just a reminder that validation.linaro.org will be taken down in 30
> minutes, at 09:00 UTC.
>
> Thanks
>
> Dave Pigott
> Validation Engineer
> T: +44 1223 45 00 24 | M +44 7940 45 93 44
> Linaro.org <http://www.linaro.org/>* **│ *Open source software for ARM
> SoCs****
> Follow *Linaro: *Facebook <http://www.facebook.com/pages/Linaro> | Twitter<http://twitter.com/#%21/linaroorg>
> | Blog <http://www.linaro.org/linaro-blog/>
>
>