All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 4/7] Add support for 'o' octet (bytes) format as monitor parameter.
From: Jes.Sorensen @ 2010-10-08  9:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru
In-Reply-To: <1286529360-5715-1-git-send-email-Jes.Sorensen@redhat.com>

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Octet format relies on strtosz which supports K/k, M/m, G/g, T/t
suffixes and unit support for humans, like 1.3G

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 monitor.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/monitor.c b/monitor.c
index fbb678d..6dd1926 100644
--- a/monitor.c
+++ b/monitor.c
@@ -78,6 +78,11 @@
  * 'l'          target long (32 or 64 bit)
  * 'M'          just like 'l', except in user mode the value is
  *              multiplied by 2^20 (think Mebibyte)
+ * 'o'          octets (aka bytes)
+ *              user mode accepts an optional T, t, G, g, M, m, K, k
+ *              suffix, which multiplies the value by 2^40 for
+ *              suffixes T and t, 2^30 for suffixes G and g, 2^20 for
+ *              M and m, 2^10 for K and k
  * 'f'          double
  *              user mode accepts an optional G, g, M, m, K, k suffix,
  *              which multiplies the value by 2^30 for suffixes G and
@@ -3699,6 +3704,28 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
                 qdict_put(qdict, key, qint_from_int(val));
             }
             break;
+        case 'o':
+            {
+                ssize_t val;
+                char *end;
+
+                while (qemu_isspace(*p))
+                    p++;
+                if (*typestr == '?') {
+                    typestr++;
+                    if (*p == '\0') {
+                        break;
+                    }
+                }
+                val = strtosz(p, &end);
+                if (val < 0) {
+                    monitor_printf(mon, "invalid size\n");
+                    goto fail;
+                }
+                qdict_put(qdict, key, qint_from_int(val));
+                p = end;
+            }
+            break;
         case 'f':
         case 'T':
             {
@@ -4196,6 +4223,7 @@ static int check_client_args_type(const QDict *client_args,
         case 'i':
         case 'l':
         case 'M':
+        case 'o':
             if (qobject_type(client_arg) != QTYPE_QINT) {
                 qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
                               "int");
-- 
1.7.2.3

^ permalink raw reply related

* [Qemu-devel] [PATCH 3/7] Add more error handling to strtosz()
From: Jes.Sorensen @ 2010-10-08  9:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru
In-Reply-To: <1286529360-5715-1-git-send-email-Jes.Sorensen@redhat.com>

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 cutils.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/cutils.c b/cutils.c
index 0782032..e5a135e 100644
--- a/cutils.c
+++ b/cutils.c
@@ -292,6 +292,7 @@ int fcntl_setfl(int fd, int flag)
 ssize_t strtosz(const char *nptr, char **end)
 {
     ssize_t retval = -1;
+    int64_t tmpval;
     char *endptr;
     int mul_required = 0;
     double val, mul = 1;
@@ -301,9 +302,9 @@ ssize_t strtosz(const char *nptr, char **end)
         mul_required = 1;
     }
 
+    errno = 0;
     val = strtod(nptr, &endptr);
-
-    if (val < 0)
+    if (endptr == nptr || errno != 0 || val < 0)
         goto fail;
 
     switch (*endptr++) {
@@ -332,7 +333,10 @@ ssize_t strtosz(const char *nptr, char **end)
         goto fail;
     }
 
-    retval = (ssize_t)(val * mul);
+    tmpval = (val * mul);
+    if (tmpval >= ~(size_t)0)
+        goto fail;
+    retval = tmpval;
 
     if (end)
         *end = endptr;
-- 
1.7.2.3

^ permalink raw reply related

* Re: [PATCH 05/18] fs: inode split IO and LRU lists
From: Al Viro @ 2010-10-08  9:16 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-fsdevel, linux-kernel
In-Reply-To: <1286515292-15882-6-git-send-email-david@fromorbit.com>

> -	struct list_head	i_list;		/* backing dev IO list */
> +	struct list_head	i_io;		/* backing dev IO list */
> +	struct list_head	i_lru;		/* backing dev IO list */

a) that pair of comments would be disqualified in IOCCC ;-)
b) have a pity on folks who will have to talk about the code.  I mean,
how would you say that?  Ai-Ai-Oh?

> +extern struct percpu_counter nr_inodes;
> +extern struct percpu_counter nr_inodes_unused;

Ehh...  At least take that to fs/internal.h.  Preferably don't expose at
all.

> -				list_del(&inode->i_list);
> -				list_add(&inode->i_list, &bdi->wb.b_dirty);
> +				list_del(&inode->i_io);
> +				list_add(&inode->i_io, &bdi->wb.b_dirty);

list_move()?  Ditto for the next few.  And, while that's not directed
at you, this kind of loops is Not Nice(tm)...

^ permalink raw reply

* [Qemu-devel] [PATCH 2/7] Support human unit formats in strtosz, eg. 1.0G
From: Jes.Sorensen @ 2010-10-08  9:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru
In-Reply-To: <1286529360-5715-1-git-send-email-Jes.Sorensen@redhat.com>

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 cutils.c |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/cutils.c b/cutils.c
index ee591c5..0782032 100644
--- a/cutils.c
+++ b/cutils.c
@@ -291,34 +291,52 @@ int fcntl_setfl(int fd, int flag)
  */
 ssize_t strtosz(const char *nptr, char **end)
 {
-    int64_t value;
+    ssize_t retval = -1;
     char *endptr;
+    int mul_required = 0;
+    double val, mul = 1;
+
+    endptr = (char *)nptr + strspn(nptr, " 0123456789");
+    if (*endptr == '.') {
+        mul_required = 1;
+    }
+
+    val = strtod(nptr, &endptr);
+
+    if (val < 0)
+        goto fail;
 
-    value = strtoll(nptr, &endptr, 0);
     switch (*endptr++) {
     case 'K':
     case 'k':
-        value <<= 10;
+        mul = 1 << 10;
         break;
     case 0:
+    case ' ':
+        if (mul_required) {
+            goto fail;
+        }
     case 'M':
     case 'm':
-        value <<= 20;
+        mul = 1ULL << 20;
         break;
     case 'G':
     case 'g':
-        value <<= 30;
+        mul = 1ULL << 30;
         break;
     case 'T':
     case 't':
-        value <<= 40;
+        mul = 1ULL << 40;
         break;
     default:
-        value = -1;
+        goto fail;
     }
 
+    retval = (ssize_t)(val * mul);
+
     if (end)
         *end = endptr;
 
-    return value;
+fail:
+    return retval;
 }
-- 
1.7.2.3

^ permalink raw reply related

* [Qemu-devel] [PATCH 1/7] Introduce strtosz() library function to convert a string to a byte count.
From: Jes.Sorensen @ 2010-10-08  9:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru
In-Reply-To: <1286529360-5715-1-git-send-email-Jes.Sorensen@redhat.com>

From: Jes Sorensen <Jes.Sorensen@redhat.com>

strtosz() returns -1 on error.

v2 renamed from strtobytes() to strtosz() as suggested by Markus.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 cutils.c      |   39 +++++++++++++++++++++++++++++++++++++++
 qemu-common.h |    1 +
 vl.c          |   31 ++++++++++---------------------
 3 files changed, 50 insertions(+), 21 deletions(-)

diff --git a/cutils.c b/cutils.c
index 5883737..ee591c5 100644
--- a/cutils.c
+++ b/cutils.c
@@ -283,3 +283,42 @@ int fcntl_setfl(int fd, int flag)
 }
 #endif
 
+/*
+ * Convert string to bytes, allowing either K/k for KB, M/m for MB,
+ * G/g for GB or T/t for TB. Default without any postfix is MB.
+ * End pointer will be returned in *end, if end is valid.
+ * Return -1 on error.
+ */
+ssize_t strtosz(const char *nptr, char **end)
+{
+    int64_t value;
+    char *endptr;
+
+    value = strtoll(nptr, &endptr, 0);
+    switch (*endptr++) {
+    case 'K':
+    case 'k':
+        value <<= 10;
+        break;
+    case 0:
+    case 'M':
+    case 'm':
+        value <<= 20;
+        break;
+    case 'G':
+    case 'g':
+        value <<= 30;
+        break;
+    case 'T':
+    case 't':
+        value <<= 40;
+        break;
+    default:
+        value = -1;
+    }
+
+    if (end)
+        *end = endptr;
+
+    return value;
+}
diff --git a/qemu-common.h b/qemu-common.h
index 81aafa0..0a062d4 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -153,6 +153,7 @@ time_t mktimegm(struct tm *tm);
 int qemu_fls(int i);
 int qemu_fdatasync(int fd);
 int fcntl_setfl(int fd, int flag);
+ssize_t strtosz(const char *nptr, char **end);
 
 /* path.c */
 void init_paths(const char *prefix);
diff --git a/vl.c b/vl.c
index df414ef..6043fa2 100644
--- a/vl.c
+++ b/vl.c
@@ -734,16 +734,13 @@ static void numa_add(const char *optarg)
         if (get_param_value(option, 128, "mem", optarg) == 0) {
             node_mem[nodenr] = 0;
         } else {
-            value = strtoull(option, &endptr, 0);
-            switch (*endptr) {
-            case 0: case 'M': case 'm':
-                value <<= 20;
-                break;
-            case 'G': case 'g':
-                value <<= 30;
-                break;
+            ssize_t sval;
+            sval = strtosz(option, NULL);
+            if (sval < 0) {
+                fprintf(stderr, "qemu: invalid numa mem size: %s\n", optarg);
+                exit(1);
             }
-            node_mem[nodenr] = value;
+            node_mem[nodenr] = sval;
         }
         if (get_param_value(option, 128, "cpus", optarg) == 0) {
             node_cpumask[nodenr] = 0;
@@ -2163,18 +2160,10 @@ int main(int argc, char **argv, char **envp)
                 exit(0);
                 break;
             case QEMU_OPTION_m: {
-                uint64_t value;
-                char *ptr;
+                ssize_t value;
 
-                value = strtoul(optarg, &ptr, 10);
-                switch (*ptr) {
-                case 0: case 'M': case 'm':
-                    value <<= 20;
-                    break;
-                case 'G': case 'g':
-                    value <<= 30;
-                    break;
-                default:
+                value = strtosz(optarg, NULL);
+                if (value < 0) {
                     fprintf(stderr, "qemu: invalid ram size: %s\n", optarg);
                     exit(1);
                 }
-- 
1.7.2.3

^ permalink raw reply related

* [Qemu-devel] [PATCH v4 0/7] Introduce strtosz and make use of it
From: Jes.Sorensen @ 2010-10-08  9:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, armbru

From: Jes Sorensen <Jes.Sorensen@redhat.com>

This patch introduces cutils.c: strtosz() and gets rid of the
multiple custom hacks for parsing byte sizes. In addition it adds
supports for specifying human style sizes such as 1.5G. Last it
eliminates the horrible abuse of a float to store the byte size for
migrate_set_speed in the monitor.

New in v3 I fixed the -1 case in the error handling pointed out by
Paolo and added a patch to clarify the default value for the monitor
command in the help message.

Jes

Jes Sorensen (7):
  Introduce strtosz() library function to convert a string to a byte
    count.
  Support human unit formats in strtosz, eg. 1.0G
  Add more error handling to strtosz()
  Add support for 'o' octet (bytes) format as monitor parameter.
  Switch migrate_set_speed() to take an 'o' argument rather than a
    float.
  Clarify default values in migration speed argument in monitor
  Remove obsolete 'f' double parameter type

 cutils.c        |   61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hmp-commands.hx |    5 ++-
 migration.c     |    4 +-
 monitor.c       |   46 ++++++++++++++++++++++++++---------------
 qemu-common.h   |    1 +
 vl.c            |   31 +++++++++-------------------
 6 files changed, 106 insertions(+), 42 deletions(-)

-- 
1.7.2.3

^ permalink raw reply

* Re: introduce dm-snap-mv
From: McPacino @ 2010-10-08  9:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Daniel Phillips, linux-fsdevel, linux-kernel, dm-devel,
	Andrew Morton, Alexander Viro, Nick Piggin
In-Reply-To: <20101008082231.GA2054@lst.de>

Hi Christoph,

I have to take care the cache problem If using the bio directly.
BHs can be released by kernel when necessary.

Is there any existing code using bio to read/write metadata
blocks? How do they handle the timing freeing bios? I really
wish to learn something form it.

Regards.

Cong Meng.



On Fri, Oct 8, 2010 at 4:22 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Thu, Oct 07, 2010 at 02:31:14PM -0700, Daniel Phillips wrote:
>> Hi Meng,
>>
>> The patch looks sensible, however the question is: why do you want to
>> do this?  Would it not be better to generalize your metadata format to
>> accomodate the device's native blocksize?
>
> Even if it uses fixed 4k sectors it should just read them in smaller
> chunks OR even better stop using buffer heads and just read them
> manually using submit_bio.  BHs really shouldn't be used outside of
> filesystems, and even there they slowly are on their way out.
>
>

^ permalink raw reply

* GIT pull request: arm: lpc32xx_up1
From: Russell King - ARM Linux @ 2010-10-08  9:08 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <AANLkTi=eoOYV8_7wANNucC5+eeTfVNeWKoD5SyBPOX4T@mail.gmail.com>

On Fri, Sep 03, 2010 at 12:46:39PM -0700, Kevin Wells wrote:
> Hi Russell,
> 
> Can you please pull this into your tree?
> 
>         git at lpclinux.com:linux-2.6-lpc for_rmk_0903
> 
> These are the last posted and reviewed LPC32xx updates.
> [PATCH 1/6] ARM: LPC32XX: Fix several clock device ID strings
> [PATCH 2/6] ARM: LPC32XX: Fix naming convention issues with some defines
> [PATCH 3/6] ARM: LPC32xx: Fix gpiolib bit mask macro
> [PATCH 4/6] ARM: LPC32xx: Remove MMC peripheral clock enable/disable code
> [PATCH 5/6] ARM: LPC32XX: Remove clock enable code for AMBA driver
> [PATCH 6/6] ARM: LPC32XX: Add board.h for platform_data structures

Please ensure there's a diffstat along with any pull requests.

^ permalink raw reply

* Re: P1020RDB PCI-E Interrupt problem
From: tiejun.chen @ 2010-10-08  9:10 UTC (permalink / raw)
  To: Fabian Bertholm; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikDsENpooCJZe68_WF4sb5qrQpjFN9ZqanUDMRx@mail.gmail.com>

Fabian Bertholm wrote:
> Hi,
> 
> I try to run ath9k on a P1020RDB Freescale board.
> I run into the problem similar to the Bug/Patch here:
> http://patchwork.ozlabs.org/patch/52137/
> 
> I get irq 16: nobody cared....

Firstly you should check if 'irq 16' is issue from your PCIe device.

> 
> I tried to fix the dts file in the same manner but this does not help.
> Currently I am using 2.6.33.7
> 
> Any hints? Anybody?
> 

Then if so I think it's unnecessary to add any #interrupt-map on dts since MSI
is used as interrupt mode on P1020RDB, not legacy interrupt. So please remove
all #interrupt-map on both pci nodes, then enable CONFIG_PCI_MSI to build/boot
again.

> The modified pci section from my dts:
> 
> 	pci0: pcie@ffe09000 {
> 		cell-index = <1>;
> 		compatible = "fsl,mpc8548-pcie";
> 		device_type = "pci";
> 		#interrupt-cells = <1>;
> 		#size-cells = <2>;
> 		#address-cells = <3>;
> 		reg = <0 0xffe09000 0 0x1000>;
> 		bus-range = <0 255>;
> 		ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
> 			  0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>;
> 		clock-frequency = <33333333>;
> 		interrupt-parent = <&mpic>;
> 		interrupts = <16 2>;
> 		interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
> 		interrupt-map = <
> 			/* IDSEL 0x0 */
> 			0000 0x0 0x0 0x1 &mpic 0x4 0x2
> 			0000 0x0 0x0 0x2 &mpic 0x5 0x2
> 			0000 0x0 0x0 0x3 &mpic 0x6 0x2
> 			0000 0x0 0x0 0x4 &mpic 0x7 0x2

I don't know how you generate these interrupt-map. So even you really want to
use legacy interrupt you should make sure your PCIe bus number/device
number/function number, and actual interrupt number. Especially please check
interrupt trigger sense. Sometimes incorrect sense will issue your PCIe to
receive interrupt storm. As a result no interrupt handler deal with this
spurious interrupt like you saw 'irq 16: nobody cared'.

> 			>;
> 		pcie@0 {
> 			reg = <0x0 0x0 0x0 0x0 0x0>;
> 			#size-cells = <2>;
> 			#address-cells = <3>;
> 			device_type = "pci";
> 			ranges = <0x2000000 0x0 0xa0000000
> 				  0x2000000 0x0 0xa0000000
> 				  0x0 0x20000000
> 
> 				  0x1000000 0x0 0x0
> 				  0x1000000 0x0 0x0
> 				  0x0 0x100000>;
> 		};
> 	};
> 
> 	pci1: pcie@ffe0a000 {
> 		cell-index = <2>;
> 		compatible = "fsl,mpc8548-pcie";
> 		device_type = "pci";
> 		#interrupt-cells = <1>;
> 		#size-cells = <2>;
> 		#address-cells = <3>;
> 		reg = <0 0xffe0a000 0 0x1000>;
> 		bus-range = <0 255>;
> 		ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
> 			  0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
> 		clock-frequency = <33333333>;
> 		interrupt-parent = <&mpic>;
> 		interrupts = <16 2>;
> 		interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
> 		interrupt-map = <
> 			/* IDSEL 0x0 */
> 			0000 0x0 0x0 0x1 &mpic 0x0 0x1
> 			0000 0x0 0x0 0x2 &mpic 0x1 0x1
> 			0000 0x0 0x0 0x3 &mpic 0x2 0x1
> 			0000 0x0 0x0 0x4 &mpic 0x3 0x1
> 			>;
> 

There are two PCIe controller so you also have to make sure which controller
your device exist.

-Tiejun

> 		pcie@0 {
> 			reg = <0x0 0x0 0x0 0x0 0x0>;
> 			#size-cells = <2>;
> 			#address-cells = <3>;
> 			device_type = "pci";
> 			ranges = <0x2000000 0x0 0xc0000000
> 				  0x2000000 0x0 0xc0000000
> 				  0x0 0x20000000
> 
> 				  0x1000000 0x0 0x0
> 				  0x1000000 0x0 0x0
> 				  0x0 0x100000>;
> 		};
> 	};
> 
> 
> Best Regards,
> Fabian
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 

^ permalink raw reply

* Re: [PATCH 04/18] fs: Implement lazy LRU updates for inodes.
From: Al Viro @ 2010-10-08  9:08 UTC (permalink / raw)
  To: Dave Chinner; +Cc: linux-fsdevel, linux-kernel
In-Reply-To: <1286515292-15882-5-git-send-email-david@fromorbit.com>

On Fri, Oct 08, 2010 at 04:21:18PM +1100, Dave Chinner wrote:

>  void __iget(struct inode *inode)
>  {
> -	if (atomic_inc_return(&inode->i_count) != 1)
> -		return;
> -
> -	if (!(inode->i_state & (I_DIRTY|I_SYNC)))
> -		list_move(&inode->i_list, &inode_in_use);
> -	percpu_counter_dec(&nr_inodes_unused);
> +	atomic_inc(&inode->i_count);
>  }

Umm...  Are you sure we don't rely on implict barriers present in the current
version?

^ permalink raw reply

* [alsa-devel] [PATCH 10/10] ASoC: SAMSUNG: Add Machine driver for S/PDIF PCM audio
From: Seungwhan Youn @ 2010-10-08  9:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <AANLkTikf4CAWm49Q_AfcfiQDBQUVcE_BC-a_4F7d8xOz@mail.gmail.com>

On Thu, Oct 7, 2010 at 10:33 AM, Seungwhan Youn <claude.youn@gmail.com> wrote:
> Dear Maintainers,
>
>>> >> plat-samsung would probably be fine for that also - create a file called
>>> >> common-smdk or something. ?Some other things have gone for a plat-smdk
>>> >> style approach too, though I'm not sure how tasteful I find that
>>> >> personally.
>>> > Even though I would personally like to have EPLL control for a device
>>> > in machine specific manner as part of its driver, I accept your opinion.
>>> >
>>> > Claude, let us create one arch/arm/plat-samsung/smdk.c to do common
>>> > stuff for SMKDs like EPLL control. What do you think ?
>>>
>>> Actually if we add this file on plat-samsung, board-init will be
>>> separated two-part, one is machine(board) specific and other is all
>>> smdk specific. So, If it doesn't make confusion to other guys who
>>> wants to add settings for their features on board-init, it looks good
>>> to me. But I think that we also have to listen Mr. Ben Dooks and Mr.
>>> Kukjin Kim's opinion about this before we get a conclusion.
>>
>> Hi all,
>>
>> I think, basically it'd better if could control clock stuff in each driver for it when need it such as clk_get, clk_enable and so on.
>> Actually there is no policy/protection for EPLL usage in plat-samsung or plat-s5p now and need to sort out other similar case for it also....so in my opinion, right now to proceed with the current style is helpful to me and will consider it in the future.
>>
>
> I wander to know that this is a last discussion, or more, and also
> know about finial decision. Of course, if we didn't get reached to the
> conclusion, we can talk more.
>
> Can you give me a hand to finish this? :-)
>

Dear Mr. Mark and Mr. Jassi,

Now, I'm almost finished 2nd patch for submit except this audio clock
setting. For now, I can only think that remove audio clock setting
from this machine code, and add audio clock settings in arch later(may
be after arch/arm/plat-samsung get EPLL policy as Mr. Kukjin said).

Is this okay?

BRs,
Claude.

^ permalink raw reply

* Re: [alsa-devel] [PATCH 10/10] ASoC: SAMSUNG: Add Machine driver for S/PDIF PCM audio
From: Seungwhan Youn @ 2010-10-08  9:07 UTC (permalink / raw)
  To: Jassi Brar, Mark Brown, jassi.brar
  Cc: alsa-devel, linux-samsung-soc, linux-arm-kernel, Seungwhan Youn,
	Kukjin Kim, ben-linux, lrg
In-Reply-To: <AANLkTikf4CAWm49Q_AfcfiQDBQUVcE_BC-a_4F7d8xOz@mail.gmail.com>

On Thu, Oct 7, 2010 at 10:33 AM, Seungwhan Youn <claude.youn@gmail.com> wrote:
> Dear Maintainers,
>
>>> >> plat-samsung would probably be fine for that also - create a file called
>>> >> common-smdk or something.  Some other things have gone for a plat-smdk
>>> >> style approach too, though I'm not sure how tasteful I find that
>>> >> personally.
>>> > Even though I would personally like to have EPLL control for a device
>>> > in machine specific manner as part of its driver, I accept your opinion.
>>> >
>>> > Claude, let us create one arch/arm/plat-samsung/smdk.c to do common
>>> > stuff for SMKDs like EPLL control. What do you think ?
>>>
>>> Actually if we add this file on plat-samsung, board-init will be
>>> separated two-part, one is machine(board) specific and other is all
>>> smdk specific. So, If it doesn't make confusion to other guys who
>>> wants to add settings for their features on board-init, it looks good
>>> to me. But I think that we also have to listen Mr. Ben Dooks and Mr.
>>> Kukjin Kim's opinion about this before we get a conclusion.
>>
>> Hi all,
>>
>> I think, basically it'd better if could control clock stuff in each driver for it when need it such as clk_get, clk_enable and so on.
>> Actually there is no policy/protection for EPLL usage in plat-samsung or plat-s5p now and need to sort out other similar case for it also....so in my opinion, right now to proceed with the current style is helpful to me and will consider it in the future.
>>
>
> I wander to know that this is a last discussion, or more, and also
> know about finial decision. Of course, if we didn't get reached to the
> conclusion, we can talk more.
>
> Can you give me a hand to finish this? :-)
>

Dear Mr. Mark and Mr. Jassi,

Now, I'm almost finished 2nd patch for submit except this audio clock
setting. For now, I can only think that remove audio clock setting
from this machine code, and add audio clock settings in arch later(may
be after arch/arm/plat-samsung get EPLL policy as Mr. Kukjin said).

Is this okay?

BRs,
Claude.

^ permalink raw reply

* Re: [PATCH v2 03/03] wl1271: 11n Support, functionality and configuration ability
From: Luciano Coelho @ 2010-10-08  9:05 UTC (permalink / raw)
  To: ext Shahar Levi; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1286388491-28752-5-git-send-email-shahar_levi@ti.com>

On Wed, 2010-10-06 at 20:08 +0200, ext Shahar Levi wrote:
> Add 11n ability in scan, connection and using MCS rates.
> The configuration is temporary due to the code incomplete and
> still in testing process. That plans to be remove in the future.
> 
> Signed-off-by: Shahar Levi <shahar_levi@ti.com>
> ---

Some comments below.  Again, mostly style-related.


> diff --git a/drivers/net/wireless/wl12xx/Makefile b/drivers/net/wireless/wl12xx/Makefile
> index 0d334d6..92465c8 100644
> --- a/drivers/net/wireless/wl12xx/Makefile
> +++ b/drivers/net/wireless/wl12xx/Makefile
> @@ -19,3 +19,4 @@ obj-$(CONFIG_WL1271_SDIO)	+= wl1271_sdio.o
>  
>  # small builtin driver bit
>  obj-$(CONFIG_WL12XX_PLATFORM_DATA)	+= wl12xx_platform_data.o
> +

I guess this extra empty line was included accidentally here? There are
no other changes in the Makefile, so please remove this change.


> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index bef2c24..7dd1257 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -841,10 +841,21 @@ static int wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
>  
>  	/* peek into the rates configured in the STA entry */
>  	spin_lock_irqsave(&wl->wl_lock, flags);
> -	if (sta && sta->supp_rates[conf->channel->band] != wl->sta_rate_set) {
> +	if (sta &&
> +	    (sta->supp_rates[conf->channel->band] !=
> +	    (wl->sta_rate_set & HW_BG_RATES_MASK))) {
>  		wl->sta_rate_set = sta->supp_rates[conf->channel->band];

Shouldn't this be |= here like the one below? Otherwise the HT rates
will be zeroed.  Okay, this would be fixed below, because the zeroed HT
rates will not match the configured rates, but in some cases that will
be unnecessary.


>  		set_bit(WL1271_FLAG_STA_RATES_CHANGED, &wl->flags);
>  	}
> +
> +	if (sta &&
> +	    sta->ht_cap.ht_supported &&
> +	    ((wl->sta_rate_set >> HW_HT_RATES_OFFSET) !=
> +	      sta->ht_cap.mcs.rx_mask[0])) {
> +		wl->sta_rate_set |=
> +		(sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET);
> +		set_bit(WL1271_FLAG_STA_RATES_CHANGED, &wl->flags);
> +	}
>  	spin_unlock_irqrestore(&wl->wl_lock, flags);
>  
>  	/* queue the packet */
> @@ -1697,6 +1708,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
>  {
>  	enum wl1271_cmd_ps_mode mode;
>  	struct wl1271 *wl = hw->priv;
> +	struct ieee80211_sta *sta = ieee80211_find_sta(vif, bss_conf->bssid);
>  	bool do_join = false;
>  	bool set_assoc = false;
>  	int ret;
> @@ -1915,6 +1927,21 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
>  		}
>  	}
>  
> +	if (sta) {
> +		if (changed & BSS_CHANGED_HT) {
> +			ret = wl1271_acx_set_ht_capabilities(wl,
> +							     &sta->ht_cap,
> +							     true);
> +			ret = wl1271_acx_set_ht_information(wl,
> +						bss_conf->ht_operation_mode);
> +			}
> +		else
> +			if (changed & BSS_CHANGED_ASSOC)
> +				ret = wl1271_acx_set_ht_capabilities(wl,
> +								&sta->ht_cap,
> +								false);
> +	}
> +


The closing brace is indented wrongly here.  And you should also use
braces in the else block (see Documentation/CodingStyle).

But in any case, you could reduce the indentation and prevent unaligned
parameters in the wl1271_acx_* calls if you do this:

	if (sta && changed & BSS_CHANGED_HT) {

and

	if (sta && changed & BSS_CHANGED_ASSOC)


> @@ -2255,6 +2285,7 @@ static struct ieee80211_supported_band wl1271_band_5ghz = {
>  	.n_channels = ARRAY_SIZE(wl1271_channels_5ghz),
>  	.bitrates = wl1271_rates_5ghz,
>  	.n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz),
> +	.ht_cap	= WL12xx_HT_CAP,
>  };

You forgot the #ifdef around .ht_cap here.  Actually, it might be nicer
to put the #ifdef around the macro itself, so you can explicitly set
the .ht_supported flag to false if 11n is not configured.


>  static const u8 *wl1271_band_rate_to_idx[] = {
> diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
> index 94da5dd..109a470 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_rx.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
> @@ -53,6 +53,10 @@ static void wl1271_rx_status(struct wl1271 *wl,
>  	status->band = wl->band;
>  	status->rate_idx = wl1271_rate_to_idx(wl, desc->rate);
>  
> +	/* 11n support */
> +	if (desc->rate <= CONF_HW_RXTX_RATE_MCS0)
> +		status->flag |= RX_FLAG_HT;
> +
>  	status->signal = desc->rssi;

Should this be #ifdef'ed also?

 
>  	/*
> diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
> index 1b8295c..af54fef 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_tx.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
> @@ -236,6 +236,15 @@ u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set)
>  		rate_set >>= 1;
>  	}
>  
> +	/* MCS rates indication are on bits 16 - 23 */
> +	rate_set >>= HW_HT_RATES_OFFSET - band->n_bitrates;
> +
> +	for (bit = 0; bit < 8; bit++) {
> +		if (rate_set & 0x1)
> +			enabled_rates |= (CONF_HW_BIT_RATE_MCS_0 << bit);
> +		rate_set >>= 1;
> +	}
> +

And this? #ifdef here as well, maybe? 


-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [resend][PATCH] mm: increase RECLAIM_DISTANCE to 30
From: Balbir Singh @ 2010-10-08  9:04 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Christoph Lameter, Mel Gorman, Rob Mueller, linux-kernel,
	Bron Gondwana, linux-mm, David Rientjes
In-Reply-To: <20101008104852.803E.A69D9226@jp.fujitsu.com>

* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2010-10-08 10:48:26]:

> Recently, Robert Mueller reported zone_reclaim_mode doesn't work
> properly on his new NUMA server (Dual Xeon E5520 + Intel S5520UR MB).
> He is using Cyrus IMAPd and it's built on a very traditional
> single-process model.
> 
>   * a master process which reads config files and manages the other
>     process
>   * multiple imapd processes, one per connection
>   * multiple pop3d processes, one per connection
>   * multiple lmtpd processes, one per connection
>   * periodical "cleanup" processes.
> 
> Then, there are thousands of independent processes. The problem is,
> recent Intel motherboard turn on zone_reclaim_mode by default and
> traditional prefork model software don't work fine on it.
> Unfortunatelly, Such model is still typical one even though 21th
> century. We can't ignore them.
> 
> This patch raise zone_reclaim_mode threshold to 30. 30 don't have
> specific meaning. but 20 mean one-hop QPI/Hypertransport and such
> relatively cheap 2-4 socket machine are often used for tradiotional
> server as above. The intention is, their machine don't use
> zone_reclaim_mode.
> 
> Note: ia64 and Power have arch specific RECLAIM_DISTANCE definition.
> then this patch doesn't change such high-end NUMA machine behavior.
> 
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Bron Gondwana <brong@fastmail.fm>
> Cc: Robert Mueller <robm@fastmail.fm>
> Acked-by: Christoph Lameter <cl@linux.com>
> Acked-by: David Rientjes <rientjes@google.com>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>  include/linux/topology.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/topology.h b/include/linux/topology.h
> index 64e084f..bfbec49 100644
> --- a/include/linux/topology.h
> +++ b/include/linux/topology.h
> @@ -60,7 +60,7 @@ int arch_update_cpu_topology(void);
>   * (in whatever arch specific measurement units returned by node_distance())
>   * then switch on zone reclaim on boot.
>   */
> -#define RECLAIM_DISTANCE 20
> +#define RECLAIM_DISTANCE 30
>  #endif
>  #ifndef PENALTY_FOR_NODE_WITH_CPUS
>  #define PENALTY_FOR_NODE_WITH_CPUS	(1)

I am not sure if this makes sense, since RECLAIM_DISTANCE is supposed
to be a hardware parameter. Could you please help clarify what the
access latency of a node with RECLAIM_DISTANCE 20 to that of a node
with RECLAIM_DISTANCE 30 is? Has the hardware definition of reclaim
distance changed?

I suspect the side effect is the zone_reclaim_mode is not set to 1 on
bootup for the 2-4 socket machines you mention, which results in
better VM behaviour?

-- 
	Three Cheers,
	Balbir

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [resend][PATCH] mm: increase RECLAIM_DISTANCE to 30
From: Balbir Singh @ 2010-10-08  9:04 UTC (permalink / raw)
  To: KOSAKI Motohiro
  Cc: Christoph Lameter, Mel Gorman, Rob Mueller, linux-kernel,
	Bron Gondwana, linux-mm, David Rientjes
In-Reply-To: <20101008104852.803E.A69D9226@jp.fujitsu.com>

* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2010-10-08 10:48:26]:

> Recently, Robert Mueller reported zone_reclaim_mode doesn't work
> properly on his new NUMA server (Dual Xeon E5520 + Intel S5520UR MB).
> He is using Cyrus IMAPd and it's built on a very traditional
> single-process model.
> 
>   * a master process which reads config files and manages the other
>     process
>   * multiple imapd processes, one per connection
>   * multiple pop3d processes, one per connection
>   * multiple lmtpd processes, one per connection
>   * periodical "cleanup" processes.
> 
> Then, there are thousands of independent processes. The problem is,
> recent Intel motherboard turn on zone_reclaim_mode by default and
> traditional prefork model software don't work fine on it.
> Unfortunatelly, Such model is still typical one even though 21th
> century. We can't ignore them.
> 
> This patch raise zone_reclaim_mode threshold to 30. 30 don't have
> specific meaning. but 20 mean one-hop QPI/Hypertransport and such
> relatively cheap 2-4 socket machine are often used for tradiotional
> server as above. The intention is, their machine don't use
> zone_reclaim_mode.
> 
> Note: ia64 and Power have arch specific RECLAIM_DISTANCE definition.
> then this patch doesn't change such high-end NUMA machine behavior.
> 
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Bron Gondwana <brong@fastmail.fm>
> Cc: Robert Mueller <robm@fastmail.fm>
> Acked-by: Christoph Lameter <cl@linux.com>
> Acked-by: David Rientjes <rientjes@google.com>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>  include/linux/topology.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/topology.h b/include/linux/topology.h
> index 64e084f..bfbec49 100644
> --- a/include/linux/topology.h
> +++ b/include/linux/topology.h
> @@ -60,7 +60,7 @@ int arch_update_cpu_topology(void);
>   * (in whatever arch specific measurement units returned by node_distance())
>   * then switch on zone reclaim on boot.
>   */
> -#define RECLAIM_DISTANCE 20
> +#define RECLAIM_DISTANCE 30
>  #endif
>  #ifndef PENALTY_FOR_NODE_WITH_CPUS
>  #define PENALTY_FOR_NODE_WITH_CPUS	(1)

I am not sure if this makes sense, since RECLAIM_DISTANCE is supposed
to be a hardware parameter. Could you please help clarify what the
access latency of a node with RECLAIM_DISTANCE 20 to that of a node
with RECLAIM_DISTANCE 30 is? Has the hardware definition of reclaim
distance changed?

I suspect the side effect is the zone_reclaim_mode is not set to 1 on
bootup for the 2-4 socket machines you mention, which results in
better VM behaviour?

-- 
	Three Cheers,
	Balbir

^ permalink raw reply

* [PATCH] Switch the i.MX27's PLL in a safe manner
From: Juergen Beisert @ 2010-10-08  9:02 UTC (permalink / raw)
  To: barebox
In-Reply-To: <1286528563-16026-1-git-send-email-jbe@pengutronix.de>

Changing PLL settings is somehow tricky on the i.MX27: Whenever the clock
speed of the main PLL is changed, the clock stops for about 100 us until the
PLL locks into the new frequency. While this clock stop, also the SDRAM
controller cannot refresh the memory, because it uses the same clock source.
This can lead into data loss and random system crashes.

This patch divides the PLL setting in two steps. First step is to re-program
the PLL and clock settings to values possible at a core supply of 1.25 V.
Second step is to increase the core power supply to 1.45 V and switch the
CPU clock to the specified 400 MHz.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
 arch/arm/boards/pcm038/Makefile   |    2 +-
 arch/arm/boards/pcm038/lowlevel.c |    7 ++++
 arch/arm/boards/pcm038/pcm038.c   |   65 +++++++++++++++++++---------------
 arch/arm/boards/pcm038/pll.h      |   70 +++++++++++++++++++++++++++++++++++++
 arch/arm/boards/pcm038/pll_init.S |   48 -------------------------
 5 files changed, 114 insertions(+), 78 deletions(-)
 create mode 100644 arch/arm/boards/pcm038/pll.h
 delete mode 100644 arch/arm/boards/pcm038/pll_init.S

diff --git a/arch/arm/boards/pcm038/Makefile b/arch/arm/boards/pcm038/Makefile
index a681dda..970804e 100644
--- a/arch/arm/boards/pcm038/Makefile
+++ b/arch/arm/boards/pcm038/Makefile
@@ -1,3 +1,3 @@
 
-obj-y += lowlevel.o pll_init.o
+obj-y += lowlevel.o
 obj-y += pcm038.o
diff --git a/arch/arm/boards/pcm038/lowlevel.c b/arch/arm/boards/pcm038/lowlevel.c
index eb85e8f..b50e1c8 100644
--- a/arch/arm/boards/pcm038/lowlevel.c
+++ b/arch/arm/boards/pcm038/lowlevel.c
@@ -31,6 +31,8 @@
 #include <asm/system.h>
 #include <asm-generic/memory_layout.h>
 
+#include "pll.h"
+
 #ifdef CONFIG_NAND_IMX_BOOT
 static void __bare_init __naked insdram(void)
 {
@@ -68,6 +70,11 @@ void __bare_init __naked board_init_lowlevel(void)
 	if (r > 0xa0000000 && r < 0xb0000000)
 		board_init_lowlevel_return();
 
+	/* re-program the PLL prior(!) starting the SDRAM controller */
+	MPCTL0 = MPCTL0_VAL;
+	SPCTL0 = SPCTL0_VAL;
+	CSCR = CSCR_VAL | CSCR_UPDATE_DIS | CSCR_MPLL_RESTART | CSCR_SPLL_RESTART;
+
 	/*
 	 * DDR on CSD0
 	 */
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index fda3262..3a9b413 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -44,6 +44,8 @@
 #include <mach/spi.h>
 #include <mach/iomux-mx27.h>
 
+#include "pll.h"
+
 static struct device_d cfi_dev = {
 	.id	  = -1,
 	.name     = "cfi_flash",
@@ -379,11 +381,6 @@ static struct device_d pcm038_serial_device = {
 
 static int pcm038_console_init(void)
 {
-	/* bring PLLs to reset default */
-	MPCTL0 = 0x00211803;
-	SPCTL0 = 0x1002700c;
-	CSCR = 0x33fc1307;
-
 	register_device(&pcm038_serial_device);
 
 	return 0;
@@ -391,40 +388,50 @@ static int pcm038_console_init(void)
 
 console_initcall(pcm038_console_init);
 
-extern void *pcm038_pll_init, *pcm038_pll_init_end;
-
-static int pcm038_power_init(void)
+/**
+ * The spctl0 register is a beast: Seems you can read it
+ * only one times without writing it again.
+ */
+static inline uint32_t get_pll_spctl10(void)
 {
-	int ret;
-	void *vram = (void*)0xffff4c00;
-	void (*pllfunc)(void) = vram;
+	uint32_t reg;
 
-	printf("initialising PLLs: 0x%p 0x%p\n", &pcm038_pll_init);
+	reg = SPCTL0;
+	SPCTL0 = reg;
 
-	memcpy(vram, &pcm038_pll_init, 0x100);
+	return reg;
+}
 
-	console_flush();
+/**
+ * If the PLL settings are in place switch the CPU core frequency to the max. value
+ */
+static int pcm038_power_init(void)
+{
+	uint32_t spctl0;
+	int ret;
 
-	ret = pmic_power();
-	if (ret) {
-		printf("Failed to initialize PMIC. Will continue with low CPU speed\n");
-		return 0;
+	spctl0 = get_pll_spctl10();
+
+	/* PLL registers already set to their final values? */
+	if (spctl0 == SPCTL0_VAL && MPCTL0 == MPCTL0_VAL) {
+		console_flush();
+		ret = pmic_power();
+		if (ret == 0) {
+			/* wait for required power level to run the CPU at 400 MHz */
+			udelay(100000);
+			CSCR = CSCR_VAL_FINAL;
+			PCDR0 = 0x130410c3;
+			PCDR1 = 0x09030911;
+			/* Clocks have changed. Notify clients */
+			clock_notifier_call_chain();
+		} else {
+			printf("Failed to initialize PMIC. Will continue with low CPU speed\n");
+		}
 	}
 
-	/* wait for good power level */
-	udelay(100000);
-
-	pllfunc();
-
 	/* clock gating enable */
 	GPCR = 0x00050f08;
 
-	PCDR0 = 0x130410c3;
-	PCDR1 = 0x09030911;
-
-	/* Clocks have changed. Notify clients */
-	clock_notifier_call_chain();
-
 	return 0;
 }
 
diff --git a/arch/arm/boards/pcm038/pll.h b/arch/arm/boards/pcm038/pll.h
new file mode 100644
index 0000000..13a7989
--- /dev/null
+++ b/arch/arm/boards/pcm038/pll.h
@@ -0,0 +1,70 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/**
+ * @file
+ * @brief phyCORE-i.MX27 specific PLL setup
+ */
+
+#ifndef __PCM038_PLL_H
+#define __PCM038_PLL_H
+
+/* define the PLL setting we want to run the system  */
+
+/* main clock divider settings immediately after reset (at 1.25 V core supply) */
+#define CSCR_VAL (CSCR_USB_DIV(3) |	\
+		CSCR_SD_CNT(3) |	\
+		CSCR_MSHC_SEL |		\
+		CSCR_H264_SEL |		\
+		CSCR_SSI1_SEL |		\
+		CSCR_SSI2_SEL |		\
+		CSCR_SP_SEL | /* 26 MHz reference */ \
+		CSCR_MCU_SEL | /* 26 MHz reference */ \
+		CSCR_ARM_DIV(0) | /* CPU runs at MPLL/3 clock */ \
+		CSCR_AHB_DIV(1) | /* AHB runs at MPLL/6 clock */ \
+		CSCR_SPEN |		\
+		CSCR_MPEN)
+
+/* main clock divider settings after core voltage increases to 1.45 V */
+#define CSCR_VAL_FINAL (CSCR_USB_DIV(3) |	\
+		CSCR_SD_CNT(3) |	\
+		CSCR_MSHC_SEL |		\
+		CSCR_H264_SEL |		\
+		CSCR_SSI1_SEL |		\
+		CSCR_SSI2_SEL |		\
+		CSCR_SP_SEL | /* 26 MHz reference */ \
+		CSCR_MCU_SEL | /* 26 MHz reference */ \
+		CSCR_ARM_SRC_MPLL | /* use main MPLL clock */ \
+		CSCR_ARM_DIV(0) | /* CPU run at full MPLL clock */ \
+		CSCR_AHB_DIV(1) | /* AHB runs at MPLL/6 clock */ \
+		CSCR_SPEN |		\
+		CSCR_MPEN)
+
+/* MPLL should provide a 399 MHz clock from the 26 MHz reference */
+#define MPCTL0_VAL (IMX_PLL_PD(0) |	\
+		IMX_PLL_MFD(51) |	\
+		IMX_PLL_MFI(7) |	\
+		IMX_PLL_MFN(35))
+
+/* SPLL should provide a 240 MHz clock from the 26 MHz reference */
+#define SPCTL0_VAL (IMX_PLL_PD(1) |	\
+		IMX_PLL_MFD(12) |	\
+		IMX_PLL_MFI(9) |	\
+		IMX_PLL_MFN(3))
+
+
+#endif	/* __PCM038_PLL_H */
diff --git a/arch/arm/boards/pcm038/pll_init.S b/arch/arm/boards/pcm038/pll_init.S
deleted file mode 100644
index 0c1ff13..0000000
--- a/arch/arm/boards/pcm038/pll_init.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <config.h>
-#include <mach/imx-regs.h>
-#include <mach/imx-pll.h>
-#include <linux/linkage.h>
-
-#define writel(val, reg) \
-	ldr		r0,	=reg;	\
-	ldr		r1,	=val;	\
-	str		r1,   [r0];
-
-#define CSCR_VAL CSCR_USB_DIV(3) |	\
-		 CSCR_SD_CNT(3) |	\
-		 CSCR_MSHC_SEL |	\
-		 CSCR_H264_SEL |	\
-		 CSCR_SSI1_SEL |	\
-		 CSCR_SSI2_SEL |	\
-		 CSCR_MCU_SEL |		\
-		 CSCR_ARM_SRC_MPLL |	\
-		 CSCR_SP_SEL |		\
-		 CSCR_ARM_DIV(0) |	\
-		 CSCR_FPM_EN |		\
-		 CSCR_SPEN |		\
-		 CSCR_MPEN |		\
-		 CSCR_AHB_DIV(1)
-
-ENTRY(pcm038_pll_init)
-
-	writel(IMX_PLL_PD(0) |
-		 IMX_PLL_MFD(51) |
-		 IMX_PLL_MFI(7) |
-		 IMX_PLL_MFN(35), MPCTL0) /* 399 MHz */
-
-	writel(IMX_PLL_PD(1) |
-		 IMX_PLL_MFD(12) |
-		 IMX_PLL_MFI(9) |
-		 IMX_PLL_MFN(3), SPCTL0) /* SPLL = 2 * 26 * 4.61538 MHz = 240 MHz */
-
-	writel(CSCR_VAL | CSCR_MPLL_RESTART | CSCR_SPLL_RESTART, CSCR)
-
-	ldr r2, =16000
-1:
-	subs    r2, r2, #1
-	nop
-	bcs 1b
-
-	mov     pc, lr
-ENDPROC(pcm038_pll_init)
-
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [2nd try] Switch the i.MX27's PLL in a safe manner
From: Juergen Beisert @ 2010-10-08  9:02 UTC (permalink / raw)
  To: barebox

(hopefully this time with *all* files)

This patch is required to switch the PLL of the i.MX27 at runtime without data
loss and random system crashes (but it is only required in this way if the CPU
core does not run at 1.45 V immediatly after reset).

Currently related only to the phyCORE-i.MX27 platform.


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* [Bug 16140] Suspend To RAM/ Resume broken - Radeon KMS on RV250
From: bugzilla-daemon @ 2010-10-08  9:02 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-16140-2300@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=16140





--- Comment #25 from Sedat Dilek <sedat.dilek@gmail.com>  2010-10-08 09:02:45 ---
Created an attachment (id=32822)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=32822)
Checksum for tarball of logs for Florian Mickler

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
--

^ permalink raw reply

* Re: [PATCH V2 -tip] lib,x86_64: improve the performance of memcpy() for unaligned copy
From: Miao Xie @ 2010-10-08  9:02 UTC (permalink / raw)
  To: Ma, Ling
  Cc: Ingo Molnar, Andi Kleen, H. Peter Anvin, Thomas Gleixner,
	Zhao, Yakui, Linux Kernel
In-Reply-To: <C10D3FB0CD45994C8A51FEC1227CE22F15C916E769@shsmsx502.ccr.corp.intel.com>

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

On Fri, 8 Oct 2010 15:42:45 +0800, Ma, Ling wrote:
> Could you please give us full address for each comparison result,we will do some tests on my machine.
> For unaligned cases older cpus will crossing cache line and slow down caused by load and store, but for nhm, no necessary to care about it.
> By the way in kernel 64bit mode, our access mode should be around 8byte aligned.

Would you need my benchmark tool? I think it is helpful for your test.

Thanks
Miao

> Thanks
> Ling
>
>> -----Original Message-----
>> From: Miao Xie [mailto:miaox@cn.fujitsu.com]
>> Sent: Friday, October 08, 2010 3:28 PM
>> To: Ingo Molnar; Andi Kleen; Ma, Ling; H. Peter Anvin; Thomas Gleixner; Zhao,
>> Yakui
>> Cc: Linux Kernel
>> Subject: [PATCH V2 -tip] lib,x86_64: improve the performance of memcpy() for
>> unaligned copy
>>
>> memcpy of x86_64 hasn't been optimized for the unaligned copy like other
>> architecture, this patch fixed this problem.
>>
>> I have tested this patch by my benchmark tool(doing 500 bytes memory copy
>> for 5,000,000 times)with various alignments and buffer sizes on my Core2
>> box.
>>
>> Len	Src/Dst	Old memcpy	New memcpy
>> 	align
>> ---	-------	-------------	-------------
>> 1	0/0	0s 47015us	0s 28265us
>> 1	0/4	0s 28201us	0s 28199us
>> 1	4/0	0s 28200us	0s 28199us
>> 1	4/4	0s 28199us	0s 28206us
>> 7	0/0	0s 24441us	0s 24438us
>> 7	0/4	0s 24439us	0s 24438us
>> 7	4/0	0s 24439us	0s 24438us
>> 7	4/4	0s 24439us	0s 24439us
>> 8	0/0	0s 20699us	0s 20687us
>> 8	0/4	0s 20689us	0s 20901us
>> 8	4/0	0s 20692us	0s 20679us
>> 8	4/4	0s 20679us	0s 20679us
>> 16	0/0	0s 18807us	0s 18802us
>> 16	0/4	0s 26319us	0s 18800us
>> 16	4/0	0s 18800us	0s 18806us
>> 16	4/4	0s 26317us	0s 18803us
>> 32	0/0	0s 35728us	0s 18800us
>> 32	0/4	0s 35716us	0s 18800us
>> 32	4/0	0s 35717us	0s 18800us
>> 32	4/4	0s 35724us	0s 18803us
>> 48	0/0	0s 26897us	0s 30080us
>> 48	0/4	0s 33837us	0s 33838us
>> 48	4/0	0s 27600us	0s 30079us
>> 48	4/4	0s 30087us	0s 33854us
>> 64	0/0	0s 41369us	0s 45115us
>> 64	0/4	0s 62042us	0s 65800us
>> 64	4/0	0s 56400us	0s 58278us
>> 64	4/4	0s 84596us	0s 84606us
>> 80	0/0	0s 35877us	0s 37611us
>> 80	0/4	0s 77083us	0s 56404us
>> 80	4/0	0s 52652us	0s 55611us
>> 80	4/4	0s 75200us	0s 78968us
>> 128	0/0	0s 52642us	0s 56403us
>> 128	0/4	0s 95883us	0s 95891us
>> 128	4/0	0s 114683us	0s 108511us
>> 128	4/4	0s 144780us	0s 110927us
>> 256	0/0	0s 80832us	0s 86489us
>> 256	0/4	0s 178586us	0s 163562us
>> 256	4/0	0s 208670us	0s 181719us
>> 256	4/4	0s 270705us	0s 148525us
>> 512	0/0	0s 156049us	0s 148348us
>> 512	0/4	0s 313933us	0s 298908us
>> 512	4/0	0s 411671us	0s 329025us
>> 512	4/4	0s 516971us	0s 208746us
>> 1024	0/0	0s 297067us	0s 274019us
>> 1024	0/4	0s 584703us	0s 569604us
>> 1024	4/0	0s 818104us	0s 616419us
>> 1024	4/4	1s 22839us	0s 328953us
>> 2048	0/0	0s 577077us	0s 524148us
>> 2048	0/4	1s 125953us	1s 111258us
>> 2048	4/0	1s 894000us	1s 202724us
>> 2048	4/4	2s 331807us	0s 822437us
>> 4096	0/0	1s 25881us	1s 34128us
>> 4096	0/4	2s 619273us	2s 606489us
>> 4096	4/0	3s 553989us	2s 390272us
>> 4096	4/4	4s 737789us	1s 433213us
>>
>> Signed-off-by: Miao Xie<miaox@cn.fujitsu.com>
>> ---
>>   arch/x86/lib/memcpy_64.S |  135
>> +++++++++++++++++++++++++++++++++++++++++++++-
>>   1 files changed, 134 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
>> index 75ef61e..b0224f8 100644
>> --- a/arch/x86/lib/memcpy_64.S
>> +++ b/arch/x86/lib/memcpy_64.S
>> @@ -46,9 +46,39 @@ ENTRY(memcpy)
>>   	 * Use 32bit CMP here to avoid long NOP padding.
>>   	 */
>>   	cmp  $0x20, %edx
>> -	jb .Lhandle_tail
>> +	jbe .Lhandle_tail
>>
>>   	/*
>> +	 * the code for unaligned copy is good for large-size copy(>100),
>> +	 * so if the size is small, we needn't check dst and src is aligned
>> +	 * or not.
>> +	 */
>> +	cmp $100, %edx
>> +	jb .Lboth_aligned
>> +
>> +	/*
>> +	 * unaligned access always leads to bad performance, so in order to
>> +	 * avoid unaligned access, we align the address(both src and dest)
>> +	 * first, and then copy from a aligned src to an aligned dst by using
>> +	 * shifts.
>> +	 * But we found if src is aligned, although dest is unaligned, the
>> +	 * performance of generic memory copy (That is reading data aligned
>> +	 * from the source and writing data unaligned to the dest) is better
>> +	 * than the one that uses shifts to avoid unaligned access.
>> +	 * So if src is aligned, we needn't check dest is aligned or not, just
>> +	 * goto .Lboth_aligned
>> +	 */
>> +	test $7, %esi		/* src align check */
>> +	jz .Lboth_aligned
>> +
>> +	/* if dest and src both are unaligned, goto unaligned copy */
>> +	test $7, %edi
>> +	jnz .Ldst_unaligned
>> +
>> +	jmp .Lsrc_unaligned_dst_aligned
>> +
>> +.Lboth_aligned:
>> +	/*
>>   	 * We check whether memory false dependece could occur,
>>   	 * then jump to corresponding copy mode.
>>   	 */
>> @@ -166,6 +196,109 @@ ENTRY(memcpy)
>>
>>   .Lend:
>>   	retq
>> +
>> +	.p2align 4
>> +.Ldst_unaligned:
>> +	movq %rdi, %rcx
>> +	andq $7, %rcx		/* Align the destination */
>> +	negq %rcx
>> +	andq $7, %rcx
>> +	subq %rcx, %rdx
>> +
>> +	/* tune dst address */
>> +	movq (%rsi), %r8
>> +	movq %r8, (%rdi)
>> +	addq %rcx, %rdi
>> +	addq %rcx, %rsi
>> +
>> +	test $7, %esi		/* src align check */
>> +	jz .Lboth_aligned
>> +
>> +	.p2align 4
>> +.Lsrc_unaligned_dst_aligned:
>> +	push %rbx
>> +	push %r12
>> +	push %r13
>> +	push %r14
>> +	push %r15
>> +	/*
>> +	 * Calculate how to shift a word read at the memory operation
>> +	 * aligned srcp to make it aligned for copy.
>> +	 */
>> +	movq %rsi, %r14
>> +	andq $7, %r14
>> +	shlq $3, %r14
>> +
>> +	movq $64, %r15
>> +	subq %r14, %r15
>> +
>> +	andq $-8, %rsi		/* src aligned */
>> +	movq 0*8(%rsi), %r8
>> +
>> +	movq %rdx, %rbx
>> +	shrq $5, %rbx
>> +	jz .Lsrc_unaligned_less32
>> +
>> +	/*
>> +	 * %r8 : store src[0]
>> +	 * %r9 : store src[1]
>> +	 * %r10: store src[2]
>> +	 * %r11: store src[3]
>> +	 * %r12: store src[4]
>> +	 * %r13: store the tmp data
>> +	 */
>> +	.p2align 4
>> +.Lsrc_unaligned_loop32:
>> +	movq 1*8(%rsi), %r9
>> +	movq 2*8(%rsi), %r10
>> +	movq 3*8(%rsi), %r11
>> +	movq 4*8(%rsi), %r12
>> +
>> +	movq %r9, %r13
>> +	movb %r14b, %cl
>> +	shrq %cl, %r8
>> +	shrq %cl, %r13
>> +	movb %r15b, %cl
>> +	shlq  %cl, %r9
>> +	orq %r8, %r9
>> +	movq %r10, %r8
>> +	shlq  %cl, %r10
>> +	orq %r13, %r10
>> +
>> +	movq %r11, %r13
>> +	movb %r14b, %cl
>> +	shrq %cl, %r8
>> +	shrq %cl, %r13
>> +	movb %r15b, %cl
>> +	shlq  %cl, %r11
>> +	orq %r8, %r11
>> +	movq %r12, %r8
>> +	shlq  %cl, %r12
>> +	orq %r13, %r12
>> +
>> +	movq %r9, 0*8(%rdi)
>> +	movq %r10, 1*8(%rdi)
>> +	movq %r11, 2*8(%rdi)
>> +	movq %r12, 3*8(%rdi)
>> +
>> +	leaq 4*8(%rdi), %rdi
>> +	leaq 4*8(%rsi), %rsi
>> +	decq %rbx
>> +	jnz .Lsrc_unaligned_loop32
>> +
>> +	.p2align 4
>> +.Lsrc_unaligned_less32:
>> +	shrq $3, %r14
>> +	addq %r14, %rsi
>> +	pop %r15
>> +	pop %r14
>> +	pop %r13
>> +	pop %r12
>> +	pop %rbx
>> +	andq $31, %rdx
>> +	jnz .Lhandle_tail
>> +	retq
>> +
>>   	CFI_ENDPROC
>>   ENDPROC(memcpy)
>>   ENDPROC(__memcpy)
>> --
>> 1.7.0.1
>
>


[-- Attachment #2: benchmark.tar.gz --]
[-- Type: application/x-gzip, Size: 3132 bytes --]

^ permalink raw reply

* [patch v4.1] ipvs: IPv6 tunnel mode
From: Hans Schillström @ 2010-10-08  9:02 UTC (permalink / raw)
  To: lvs-devel
  Cc: Julian Anastasov, Julius Volz, Wensong Zhang,
	Hans Schillström

From: Hans Schillstrom <hans.schillstrom@ericsson.com>

ipvs: IPv6 tunnel mode

IPv6 encapsulation uses a bad source address for the tunnel.
i.e. VIP will be used as local-addr and encap. dst addr.
Decapsulation will not accept this.

Example
LVS (eth1 2003::2:0:1/96, VIP 2003::2:0:100)
   (eth0 2003::1:0:1/96)
RS  (ethX 2003::1:0:5/96)

tcpdump
2003::2:0:100 > 2003::1:0:5:
IP6 (hlim 63, next-header TCP (6) payload length: 40)
 2003::3:0:10.50991 > 2003::2:0:100.http: Flags [S], cksum 0x7312
(correct), seq 3006460279, win 5760, options [mss 1440,sackOK,TS val
1904932 ecr 0,nop,wscale 3], length 0

In Linux IPv6 impl. you can't have a tunnel with an any cast address
receiving packets (I have not tried to interpret RFC 2473)
To have receive capabilities the tunnel must have:
 - Local address set as multicast addr or an unicast addr
 - Remote address set as an unicast addr.
 - Loop back addres or Link local address are not allowed.

This causes us to setup a tunnel in the Real Server with the
LVS as the remote address, here you can't use the VIP address since it's
used inside the tunnel.

Solution
Use outgoing interface IPv6 address (match against the destination).
i.e. use ip6_route_output() to look up the route cache and
then use ipv6_dev_get_saddr(...) to set the source address of the
encapsulated packet.

Additionally, cache the results in new destination
fields: dst_cookie and dst_saddr and properly check the
returned dst from ip6_route_output. We now add xfrm_lookup
call only for the tunneling method where the source address
is a local one.

Signed-off-by:Hans Schillstrom <hans.schillstrom@ericsson.com>

---

Original patch by Hans Schillstrom.
Check dst state and cache results for IPv6 by Julian Anastasov.
Subsequent revisions made by Hans Schillstrom:

* v1
    
  This is Julian's patch with a slightly edited version of the description
  from Hans's original patch.

* v2
    
  Updated changelog as per commends from Julian

* v3
    
  Flowi dest address used as destination instead of rt6_info in
+ip_vs_tunnel_xmit_v6()
  rt6_info somtimes contains a netw address insted of a tunnel

* v4
    
  Update destination as recommended from Julian
  i.e. use &cp->daddr.in6

* v4.1 Simon Horman
  Fix patch corruption

Julian, can I get your opinion on version 4.1?

Index: nf-next-2.6/include/net/ip_vs.h
===================================================================
--- nf-next-2.6.orig/include/net/ip_vs.h	2010-10-08 17:44:01.000000000 +0900
+++ nf-next-2.6/include/net/ip_vs.h	2010-10-08 17:45:13.000000000 +0900
@@ -529,6 +529,10 @@ struct ip_vs_dest {
 	spinlock_t		dst_lock;	/* lock of dst_cache */
 	struct dst_entry	*dst_cache;	/* destination cache entry */
 	u32			dst_rtos;	/* RT_TOS(tos) for dst */
+	u32			dst_cookie;
+#ifdef CONFIG_IP_VS_IPV6
+	struct in6_addr		dst_saddr;
+#endif
 
 	/* for virtual service */
 	struct ip_vs_service	*svc;		/* service it belongs to */
Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_xmit.c
===================================================================
--- nf-next-2.6.orig/net/netfilter/ipvs/ip_vs_xmit.c	2010-10-08 17:44:01.000000000 +0900
+++ nf-next-2.6/net/netfilter/ipvs/ip_vs_xmit.c	2010-10-08 17:45:13.000000000 +0900
@@ -26,6 +26,7 @@
 #include <net/route.h>                  /* for ip_route_output */
 #include <net/ipv6.h>
 #include <net/ip6_route.h>
+#include <net/addrconf.h>
 #include <linux/icmpv6.h>
 #include <linux/netfilter.h>
 #include <linux/netfilter_ipv4.h>
@@ -37,26 +38,27 @@
  *      Destination cache to speed up outgoing route lookup
  */
 static inline void
-__ip_vs_dst_set(struct ip_vs_dest *dest, u32 rtos, struct dst_entry *dst)
+__ip_vs_dst_set(struct ip_vs_dest *dest, u32 rtos, struct dst_entry *dst,
+		u32 dst_cookie)
 {
 	struct dst_entry *old_dst;
 
 	old_dst = dest->dst_cache;
 	dest->dst_cache = dst;
 	dest->dst_rtos = rtos;
+	dest->dst_cookie = dst_cookie;
 	dst_release(old_dst);
 }
 
 static inline struct dst_entry *
-__ip_vs_dst_check(struct ip_vs_dest *dest, u32 rtos, u32 cookie)
+__ip_vs_dst_check(struct ip_vs_dest *dest, u32 rtos)
 {
 	struct dst_entry *dst = dest->dst_cache;
 
 	if (!dst)
 		return NULL;
-	if ((dst->obsolete
-	     || (dest->af == AF_INET && rtos != dest->dst_rtos)) &&
-	    dst->ops->check(dst, cookie) == NULL) {
+	if ((dst->obsolete || rtos != dest->dst_rtos) &&
+	    dst->ops->check(dst, dest->dst_cookie) == NULL) {
 		dest->dst_cache = NULL;
 		dst_release(dst);
 		return NULL;
@@ -66,15 +68,16 @@ __ip_vs_dst_check(struct ip_vs_dest *des
 }
 
 static struct rtable *
-__ip_vs_get_out_rt(struct ip_vs_conn *cp, u32 rtos)
+__ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_conn *cp, u32 rtos)
 {
+	struct net *net = dev_net(skb->dev);
 	struct rtable *rt;			/* Route to the other host */
 	struct ip_vs_dest *dest = cp->dest;
 
 	if (dest) {
 		spin_lock(&dest->dst_lock);
 		if (!(rt = (struct rtable *)
-		      __ip_vs_dst_check(dest, rtos, 0))) {
+		      __ip_vs_dst_check(dest, rtos))) {
 			struct flowi fl = {
 				.oif = 0,
 				.nl_u = {
@@ -84,13 +87,13 @@ __ip_vs_get_out_rt(struct ip_vs_conn *cp
 						.tos = rtos, } },
 			};
 
-			if (ip_route_output_key(&init_net, &rt, &fl)) {
+			if (ip_route_output_key(net, &rt, &fl)) {
 				spin_unlock(&dest->dst_lock);
 				IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
 					     &dest->addr.ip);
 				return NULL;
 			}
-			__ip_vs_dst_set(dest, rtos, dst_clone(&rt->dst));
+			__ip_vs_dst_set(dest, rtos, dst_clone(&rt->dst), 0);
 			IP_VS_DBG(10, "new dst %pI4, refcnt=%d, rtos=%X\n",
 				  &dest->addr.ip,
 				  atomic_read(&rt->dst.__refcnt), rtos);
@@ -106,7 +109,7 @@ __ip_vs_get_out_rt(struct ip_vs_conn *cp
 					.tos = rtos, } },
 		};
 
-		if (ip_route_output_key(&init_net, &rt, &fl)) {
+		if (ip_route_output_key(net, &rt, &fl)) {
 			IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n",
 				     &cp->daddr.ip);
 			return NULL;
@@ -117,62 +120,79 @@ __ip_vs_get_out_rt(struct ip_vs_conn *cp
 }
 
 #ifdef CONFIG_IP_VS_IPV6
+
+static struct dst_entry *
+__ip_vs_route_output_v6(struct net *net, struct in6_addr *daddr,
+			struct in6_addr *ret_saddr, int do_xfrm)
+{
+	struct dst_entry *dst;
+	struct flowi fl = {
+		.oif = 0,
+		.nl_u = {
+			.ip6_u = {
+				.daddr = *daddr,
+			},
+		},
+	};
+
+	dst = ip6_route_output(net, NULL, &fl);
+	if (dst->error)
+		goto out_err;
+	if (!ret_saddr)
+		return dst;
+	if (ipv6_addr_any(&fl.fl6_src) &&
+	    ipv6_dev_get_saddr(net, ip6_dst_idev(dst)->dev,
+			       &fl.fl6_dst, 0, &fl.fl6_src) < 0)
+		goto out_err;
+	if (do_xfrm && xfrm_lookup(net, &dst, &fl, NULL, 0) < 0)
+		goto out_err;
+	ipv6_addr_copy(ret_saddr, &fl.fl6_src);
+	return dst;
+
+out_err:
+	dst_release(dst);
+	IP_VS_DBG_RL("ip6_route_output error, dest: %pI6\n", daddr);
+	return NULL;
+}
+
 static struct rt6_info *
-__ip_vs_get_out_rt_v6(struct ip_vs_conn *cp)
+__ip_vs_get_out_rt_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
+		      struct in6_addr *ret_saddr, int do_xfrm)
 {
+	struct net *net = dev_net(skb->dev);
 	struct rt6_info *rt;			/* Route to the other host */
 	struct ip_vs_dest *dest = cp->dest;
+	struct dst_entry *dst;
 
 	if (dest) {
 		spin_lock(&dest->dst_lock);
-		rt = (struct rt6_info *)__ip_vs_dst_check(dest, 0, 0);
+		rt = (struct rt6_info *)__ip_vs_dst_check(dest, 0);
 		if (!rt) {
-			struct flowi fl = {
-				.oif = 0,
-				.nl_u = {
-					.ip6_u = {
-						.daddr = dest->addr.in6,
-						.saddr = {
-							.s6_addr32 =
-								{ 0, 0, 0, 0 },
-						},
-					},
-				},
-			};
+			u32 cookie;
 
-			rt = (struct rt6_info *)ip6_route_output(&init_net,
-								 NULL, &fl);
-			if (!rt) {
+			dst = __ip_vs_route_output_v6(net, &dest->addr.in6,
+						      &dest->dst_saddr,
+						      do_xfrm);
+			if (!dst) {
 				spin_unlock(&dest->dst_lock);
-				IP_VS_DBG_RL("ip6_route_output error, dest: %pI6\n",
-					     &dest->addr.in6);
 				return NULL;
 			}
-			__ip_vs_dst_set(dest, 0, dst_clone(&rt->dst));
-			IP_VS_DBG(10, "new dst %pI6, refcnt=%d\n",
-				  &dest->addr.in6,
+			rt = (struct rt6_info *) dst;
+			cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
+			__ip_vs_dst_set(dest, 0, dst_clone(&rt->dst), cookie);
+			IP_VS_DBG(10, "new dst %pI6, src %pI6, refcnt=%d\n",
+				  &dest->addr.in6, &dest->dst_saddr,
 				  atomic_read(&rt->dst.__refcnt));
 		}
+		if (ret_saddr)
+			ipv6_addr_copy(ret_saddr, &dest->dst_saddr);
 		spin_unlock(&dest->dst_lock);
 	} else {
-		struct flowi fl = {
-			.oif = 0,
-			.nl_u = {
-				.ip6_u = {
-					.daddr = cp->daddr.in6,
-					.saddr = {
-						.s6_addr32 = { 0, 0, 0, 0 },
-					},
-				},
-			},
-		};
-
-		rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl);
-		if (!rt) {
-			IP_VS_DBG_RL("ip6_route_output error, dest: %pI6\n",
-				     &cp->daddr.in6);
+		dst = __ip_vs_route_output_v6(net, &cp->daddr.in6, ret_saddr,
+					      do_xfrm);
+		if (!dst)
 			return NULL;
-		}
+		rt = (struct rt6_info *) dst;
 	}
 
 	return rt;
@@ -248,6 +268,7 @@ int
 ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
 		  struct ip_vs_protocol *pp)
 {
+	struct net *net = dev_net(skb->dev);
 	struct rtable *rt;			/* Route to the other host */
 	struct iphdr  *iph = ip_hdr(skb);
 	u8     tos = iph->tos;
@@ -263,7 +284,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, s
 
 	EnterFunction(10);
 
-	if (ip_route_output_key(&init_net, &rt, &fl)) {
+	if (ip_route_output_key(net, &rt, &fl)) {
 		IP_VS_DBG_RL("%s(): ip_route_output error, dest: %pI4\n",
 			     __func__, &iph->daddr);
 		goto tx_error_icmp;
@@ -313,25 +334,18 @@ int
 ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
 		     struct ip_vs_protocol *pp)
 {
+	struct net *net = dev_net(skb->dev);
+	struct dst_entry *dst;
 	struct rt6_info *rt;			/* Route to the other host */
 	struct ipv6hdr  *iph = ipv6_hdr(skb);
 	int    mtu;
-	struct flowi fl = {
-		.oif = 0,
-		.nl_u = {
-			.ip6_u = {
-				.daddr = iph->daddr,
-				.saddr = { .s6_addr32 = {0, 0, 0, 0} }, } },
-	};
 
 	EnterFunction(10);
 
-	rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl);
-	if (!rt) {
-		IP_VS_DBG_RL("%s(): ip6_route_output error, dest: %pI6\n",
-			     __func__, &iph->daddr);
+	dst = __ip_vs_route_output_v6(net, &iph->daddr, NULL, 0);
+	if (!dst)
 		goto tx_error_icmp;
-	}
+	rt = (struct rt6_info *) dst;
 
 	/* MTU checking */
 	mtu = dst_mtu(&rt->dst);
@@ -397,7 +411,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, stru
 		IP_VS_DBG(10, "filled cport=%d\n", ntohs(*p));
 	}
 
-	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(iph->tos))))
+	if (!(rt = __ip_vs_get_out_rt(skb, cp, RT_TOS(iph->tos))))
 		goto tx_error_icmp;
 
 	/* MTU checking */
@@ -472,7 +486,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, s
 		IP_VS_DBG(10, "filled cport=%d\n", ntohs(*p));
 	}
 
-	rt = __ip_vs_get_out_rt_v6(cp);
+	rt = __ip_vs_get_out_rt_v6(skb, cp, NULL, 0);
 	if (!rt)
 		goto tx_error_icmp;
 
@@ -557,7 +571,6 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, s
 	struct iphdr  *old_iph = ip_hdr(skb);
 	u8     tos = old_iph->tos;
 	__be16 df = old_iph->frag_off;
-	sk_buff_data_t old_transport_header = skb->transport_header;
 	struct iphdr  *iph;			/* Our new IP header */
 	unsigned int max_headroom;		/* The extra header space needed */
 	int    mtu;
@@ -572,7 +585,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, s
 		goto tx_error;
 	}
 
-	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(tos))))
+	if (!(rt = __ip_vs_get_out_rt(skb, cp, RT_TOS(tos))))
 		goto tx_error_icmp;
 
 	tdev = rt->dst.dev;
@@ -616,7 +629,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, s
 		old_iph = ip_hdr(skb);
 	}
 
-	skb->transport_header = old_transport_header;
+	skb->transport_header = skb->network_header;
 
 	/* fix old IP header checksum */
 	ip_send_check(old_iph);
@@ -670,9 +683,9 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb
 		     struct ip_vs_protocol *pp)
 {
 	struct rt6_info *rt;		/* Route to the other host */
+	struct in6_addr saddr;		/* Source for tunnel */
 	struct net_device *tdev;	/* Device to other host */
 	struct ipv6hdr  *old_iph = ipv6_hdr(skb);
-	sk_buff_data_t old_transport_header = skb->transport_header;
 	struct ipv6hdr  *iph;		/* Our new IP header */
 	unsigned int max_headroom;	/* The extra header space needed */
 	int    mtu;
@@ -687,17 +700,17 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb
 		goto tx_error;
 	}
 
-	rt = __ip_vs_get_out_rt_v6(cp);
+	rt = __ip_vs_get_out_rt_v6(skb, cp, &saddr, 1);
 	if (!rt)
 		goto tx_error_icmp;
 
 	tdev = rt->dst.dev;
 
 	mtu = dst_mtu(&rt->dst) - sizeof(struct ipv6hdr);
-	/* TODO IPv6: do we need this check in IPv6? */
-	if (mtu < 1280) {
+	if (mtu < IPV6_MIN_MTU) {
 		dst_release(&rt->dst);
-		IP_VS_DBG_RL("%s(): mtu less than 1280\n", __func__);
+		IP_VS_DBG_RL("%s(): mtu less than %d\n", __func__,
+			     IPV6_MIN_MTU);
 		goto tx_error;
 	}
 	if (skb_dst(skb))
@@ -730,7 +743,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb
 		old_iph = ipv6_hdr(skb);
 	}
 
-	skb->transport_header = old_transport_header;
+	skb->transport_header = skb->network_header;
 
 	skb_push(skb, sizeof(struct ipv6hdr));
 	skb_reset_network_header(skb);
@@ -750,8 +763,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb
 	be16_add_cpu(&iph->payload_len, sizeof(*old_iph));
 	iph->priority		=	old_iph->priority;
 	memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl));
-	iph->daddr		=	rt->rt6i_dst.addr;
-	iph->saddr		=	cp->vaddr.in6; /* rt->rt6i_src.addr; */
+	ipv6_addr_copy(&iph->daddr, &cp->daddr.in6);
+	ipv6_addr_copy(&iph->saddr, &saddr);
 	iph->hop_limit		=	old_iph->hop_limit;
 
 	/* Another hack: avoid icmp_send in ip_fragment */
@@ -791,7 +804,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struc
 
 	EnterFunction(10);
 
-	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(iph->tos))))
+	if (!(rt = __ip_vs_get_out_rt(skb, cp, RT_TOS(iph->tos))))
 		goto tx_error_icmp;
 
 	/* MTU checking */
@@ -843,7 +856,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, st
 
 	EnterFunction(10);
 
-	rt = __ip_vs_get_out_rt_v6(cp);
+	rt = __ip_vs_get_out_rt_v6(skb, cp, NULL, 0);
 	if (!rt)
 		goto tx_error_icmp;
 
@@ -919,7 +932,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, str
 	 * mangle and send the packet here (only for VS/NAT)
 	 */
 
-	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(ip_hdr(skb)->tos))))
+	if (!(rt = __ip_vs_get_out_rt(skb, cp, RT_TOS(ip_hdr(skb)->tos))))
 		goto tx_error_icmp;
 
 	/* MTU checking */
@@ -993,7 +1006,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb,
 	 * mangle and send the packet here (only for VS/NAT)
 	 */
 
-	rt = __ip_vs_get_out_rt_v6(cp);
+	rt = __ip_vs_get_out_rt_v6(skb, cp, NULL, 0);
 	if (!rt)
 		goto tx_error_icmp;
 

^ permalink raw reply

* [Bug 16140] Suspend To RAM/ Resume broken - Radeon KMS on RV250
From: bugzilla-daemon @ 2010-10-08  9:01 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-16140-2300@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=16140





--- Comment #24 from Sedat Dilek <sedat.dilek@gmail.com>  2010-10-08 09:01:37 ---
Created an attachment (id=32812)
 --> (https://bugzilla.kernel.org/attachment.cgi?id=32812)
Tarball of logs for Florian Mickler

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
--

^ permalink raw reply

* Re: introduce dm-snap-mv
From: McPacino @ 2010-10-08  9:01 UTC (permalink / raw)
  To: Daniel Phillips, Christoph Hellwig
  Cc: linux-fsdevel, linux-kernel, dm-devel, Andrew Morton,
	Alexander Viro, Nick Piggin
In-Reply-To: <201010071431.14937.phillips@phunq.net>

Hi Daniel,

It is very cumbersome to deal with small (512, 1024 or 2048) blocksize.

I used fixed size (4096 bytes) block to save the exception list.

If the blocksize is 512 byte, I have to invoke __getblk() 8 times to read
the exception list. And what more cumbersome is, my exception list
struct might scatter in 8 non-continuous memory segments.

In my code, each exception is presented by a 6-bytes struct. 4K
block can present an exception list containing at most about 670
exceptions. If I used 512 bytes block to present an exception list,
the number is just about 80. That is too small.

So, it's really a big favor to me if __getblk() could read 4K buffer
head in any case.

PS: There is no other kernel component have the demand like my
case? I am learning ext FS code now.

Regards.

Cong Meng.



On Fri, Oct 8, 2010 at 5:31 AM, Daniel Phillips <phillips@phunq.net> wrote:
> Hi Meng,
>
> The patch looks sensible, however the question is: why do you want to
> do this?  Would it not be better to generalize your metadata format to
> accomodate the device's native blocksize?
>
> Regards,
>
> Daniel
>
>> a kernel patch
>> --------------
>> Now, dm-snap-mv highly depends on a kernel patch below, which make __getblk()
>> can get a 4K buffer head while block size of the disk is NOT 4K.
>>
>> Signed-off-by: Cong Meng <mcpacino@gmail.com>
>> ---
>>  fs/buffer.c |    7 ++-----
>>  1 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/buffer.c b/fs/buffer.c
>> index 3e7dca2..f7f9d33 100644
>> --- a/fs/buffer.c
>> +++ b/fs/buffer.c
>> @@ -1051,10 +1051,7 @@ grow_buffers(struct block_device *bdev, sector_t block, int size)
>>       pgoff_t index;
>>       int sizebits;
>>
>> -     sizebits = -1;
>> -     do {
>> -             sizebits++;
>> -     } while ((size << sizebits) < PAGE_SIZE);
>> +     sizebits = PAGE_CACHE_SHIFT - bdev->bd_inode->i_blkbits;
>>
>>       index = block >> sizebits;
>>
>> @@ -2924,7 +2921,7 @@ int submit_bh(int rw, struct buffer_head * bh)
>>        */
>>       bio = bio_alloc(GFP_NOIO, 1);
>>
>> -     bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9);
>> +     bio->bi_sector = bh->b_blocknr << (bh->b_bdev->bd_inode->i_blkbits - 9);
>>       bio->bi_bdev = bh->b_bdev;
>>       bio->bi_io_vec[0].bv_page = bh->b_page;
>>       bio->bi_io_vec[0].bv_len = bh->b_size;
>

^ permalink raw reply

* [Bug 16140] Suspend To RAM/ Resume broken - Radeon KMS on RV250
From: bugzilla-daemon @ 2010-10-08  9:00 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-16140-2300@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=16140





--- Comment #23 from Sedat Dilek <sedat.dilek@gmail.com>  2010-10-08 09:00:24 ---
Thanks Florian for taking care of this BR.

I applied your patch from above against 2.6.36-rc7 and will attach the logs.

Here the legend to my logs (messages, kern.log and debug):

1: 2010-10-08 10:35: boot-up into runlevel-3
2: 2010-10-08 10:36: startx
3: 2010-10-08 10:37: pm-suspend
4. 2010-10-08 10:38: power-on/pm-resume
5. 2010-10-08 10:39: poweroff

EXAMPLE:
So "3_debug.txt" covers all logs written to /var/log/debug after running
"pm-suspend" command.

I hope this helps narrowing down the problem.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
--

^ permalink raw reply

* Re: [Xenomai-help] kernel oopses when killing realtime task
From: Philippe Gerum @ 2010-10-08  9:00 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai@xenomai.org
In-Reply-To: <1286528239.13186.104.camel@domain.hid>

On Fri, 2010-10-08 at 10:57 +0200, Philippe Gerum wrote:
> On Fri, 2010-10-08 at 10:41 +0200, Jan Kiszka wrote:
> > Am 08.10.2010 10:17, Philippe Gerum wrote:
> > > On Fri, 2010-10-08 at 09:01 +0200, Pavel Machek wrote:
> > >> Hi!
> > >>
> > >>>> I have... quite an interesting setup here.
> > >>>>
> > >>>> SMP machine, with special PCI card; that card has GPIOs and serial
> > >>>> ports. Unfortunately, there's only one interrupt, shared between
> > >>>> serials and GPIO pins, and serials are way too complex to be handled
> > >>>> by realtime layer.
> > >>>>
> > >>>> So I ended up with
> > >>>>
> > >>>>         // we also have an interrupt handler:                                                                                                                 
> > >>>>         ret = rtdm_irq_request(&my_context->irq_handle,
> > >>>>         gpio_rt_config.irq, demo_interrupt,
> > >>>>                                RTDM_IRQTYPE_SHARED,
> > >>>>         context->device->proc_name, my_context);
> > >>>>
> > >>>> and 
> > >>>>
> > >>>> static int demo_interrupt(rtdm_irq_t *irq_context)
> > >>>> {
> > >>>>         struct demodrv_context *ctx;
> > >>>>         int           dev_id;
> > >>>>         int           ret = RTDM_IRQ_HANDLED; // usual return value                                                                                           
> > >>>>         unsigned pending, output;
> > >>>>
> > >>>>         ctx = rtdm_irq_get_arg(irq_context, struct demodrv_context);
> > >>>>         dev_id    = ctx->dev_id;
> > >>>>
> > >>>>         if (!ctx->ready) {
> > >>>>                 printk(KERN_CRIT "Unexpected interrupt\n");
> > >>>>                 return XN_ISR_PROPAGATE;
> > >>>
> > >>> Who sets ready and when? Looks racy.
> > >>
> > >> Debugging aid; yes, this one is racy.
> > >>
> > >>>>         rtdm_lock_put(&ctx->lock);
> > >>>>  
> > >>>>         /* We need to propagate the interrupt, so that PMC-6L serials                                                                                         
> > >>>>            work. Result is that interrupt latencies can't be                                                                                                  
> > >>>>            guaranteed when serials are in use.  */
> > >>>>
> > >>>>          return RTDM_IRQ_HANDLED;
> > >>>> }
> > >>>>
> > >>>> Unregistration is:
> > >>>>         my_context->ready = 0;
> > >>>>         rtdm_irq_disable(&my_context->irq_handle);
> > >>>
> > >>> Where is rtdm_irq_free? Again, this ready flag looks racy.
> > >>
> > >> Aha, sorry, I quoted wrong snippet. rtdm_irq_free() follows
> > >> immediately, like this:
> > >>
> > >> int demo_close_rt(struct rtdm_dev_context   *context,
> > >>                   rtdm_user_info_t          *user_info)
> > >> {
> > >>         struct demodrv_context  *my_context;
> > >>         rtdm_lockctx_t          lock_ctx;
> > >>         // get the context                                                                                                                                    
> > >>         my_context = (struct demodrv_context *)context->dev_private;
> > >>
> > >>         // if we need to do some stuff with preemption disabled:                                                                                              
> > >>         rtdm_lock_get_irqsave(&my_context->lock, lock_ctx);
> > >>
> > >>         my_context->ready = 0;
> > >>         rtdm_irq_disable(&my_context->irq_handle);
> > >>
> > >>
> > >>         // free irq in RTDM                                                                                                                                   
> > >>         rtdm_irq_free(&my_context->irq_handle);
> > >>
> > >>         // destroy our interrupt signal/event                                                                                                                 
> > >>         rtdm_event_destroy(&my_context->irq_event);
> > >>
> > >>         // other stuff here                                                                                                                                   
> > >>         rtdm_lock_put_irqrestore(&my_context->lock, lock_ctx);
> > >>
> > >>         return 0;
> > >> }
> > >>
> > >> Now... I'm aware that lock_get/put around irq_free should be
> > >> unneccessary, as should be irq_disable and my ->ready flag. Those were
> > >> my attempts to work around the problem. I'll attach the full source at
> > >> the end.
> > >>
> > >>>> Unfortunately, when the userspace app is ran and killed repeatedly (so
> > >>>> that interrupt is registered/unregistered all the time), I get
> > >>>> oopses in __ipipe_dispatch_wired() -- it seems to call into the NULL
> > >>>> pointer.
> > >>>>
> > >>>> I decided that "wired" interrupt when the source is shared between
> > >>>> Linux and Xenomai, is wrong thing, so I disable "wired" interrupts
> > >>>> altogether, but that only moved oops to __virq_end. 
> > >>>
> > >>> This is wrong. The only way to get a determistically shared IRQs across
> > >>> domains is via the wired path, either using the pattern Gilles cited or,
> > >>> in a slight variation, signaling down via a separate rtdm_nrtsig.
> > >>
> > >> For now, I'm trying to get it not to oops; deterministic latencies are
> > >> the next topic :-(.
> > > 
> > > The main issue is that we don't lock our IRQ descriptors (the pipeline
> > > ones) when running the handlers, so another CPU clearing them via
> > > ipipe_virtualize_irq() may well sink the boat...
> > > 
> > > The unwritten rule has always been to assume that drivers would stop
> > > _and_ drain interrupts on all CPUs before unregistering handlers, then
> > > exiting the code. Granted, that's a bit much.
> > 
> > IIRC, we drain at nucleus-level if statistic are enabled. I guess we
> > should make this unconditional.
> 
> Draining is currently performed after the descriptor release via
> rthal_irq_release() in this code, and it depends on the stat counters to
> determine whether the IRQ handler is still running on any CPU it seems.
> A saner way would be to define a draining service in the pipeline, and
> have rtdm_irq_free() invoke it early.

s,rtdm_irq_free,xnintr_detach,

> 

-- 
Philippe.




^ permalink raw reply

* [lm-sensors] [PATCH] coretemp: fix reading of microcode revision
From: Jan Beulich @ 2010-10-08  8:59 UTC (permalink / raw)
  To: lm-sensors
In-Reply-To: <4CADB0A1020000780001B335@vpn.id2.novell.com>

According to the documentation, simply reading the respective MSR
isn't sufficient: It should be written with zeros, cpuid(1) be
executed, and then read (see arch/x86/kernel/cpu/intel.c for an
example).

v2: Fail probe when microcode revision cannot be determined, but is
needed to check for proper operation.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Chen Gong <gong.chen@linux.intel.com>
Cc: Jean Delvare <khali@linux-fr.org>

---
 drivers/hwmon/coretemp.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

--- linux-2.6.36-rc7/drivers/hwmon/coretemp.c
+++ 2.6.36-rc7-coretemp-ucode/drivers/hwmon/coretemp.c
@@ -292,6 +292,15 @@ static int __devinit get_tjmax(struct cp
 	}
 }
 
+static void __devinit get_ucode_rev_on_cpu(void *edx)
+{
+	u32 eax;
+
+	wrmsr(MSR_IA32_UCODE_REV, 0, 0);
+	sync_core();
+	rdmsr(MSR_IA32_UCODE_REV, eax, *(u32 *)edx);
+}
+
 static int __devinit coretemp_probe(struct platform_device *pdev)
 {
 	struct coretemp_data *data;
@@ -327,8 +336,15 @@ static int __devinit coretemp_probe(stru
 
 	if ((c->x86_model = 0xe) && (c->x86_mask < 0xc)) {
 		/* check for microcode update */
-		rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
-		if (edx < 0x39) {
+		err = smp_call_function_single(data->id, get_ucode_rev_on_cpu,
+					       &edx, 1);
+		if (err) {
+			dev_err(&pdev->dev,
+				"Cannot determine microcode revision of "
+				"CPU#%u (%d)!\n", data->id, err);
+			err = -ENODEV;
+			goto exit_free;
+		} else if (edx < 0x39) {
 			err = -ENODEV;
 			dev_err(&pdev->dev,
 				"Errata AE18 not fixed, update BIOS or "




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.