Re: [PATCH] Update sched_domains_numa_masks when new cpus are onlined.

2012-09-23 Thread Tang Chen

Hi,

Would you please help to review this patch ?

Thanks. :)

On 09/18/2012 06:12 PM, Tang Chen wrote:

Once array sched_domains_numa_masks is defined, it is never updated.
When a new cpu on a new node is onlined, the coincident member in
sched_domains_numa_masks is not initialized, and all the masks are 0.
As a result, the build_overlap_sched_groups() will initialize a NULL
sched_group for the new cpu on the new node, which will lead to kernel panic.

[ 3189.403280] Call Trace:
[ 3189.403286]  [] warn_slowpath_common+0x7f/0xc0
[ 3189.403289]  [] warn_slowpath_null+0x1a/0x20
[ 3189.403292]  [] build_sched_domains+0x467/0x470
[ 3189.403296]  [] partition_sched_domains+0x307/0x510
[ 3189.403299]  [] ? partition_sched_domains+0x142/0x510
[ 3189.403305]  [] cpuset_update_active_cpus+0x83/0x90
[ 3189.403308]  [] cpuset_cpu_active+0x38/0x70
[ 3189.403316]  [] notifier_call_chain+0x67/0x150
[ 3189.403320]  [] ? native_cpu_up+0x18a/0x1b5
[ 3189.403328]  [] __raw_notifier_call_chain+0xe/0x10
[ 3189.40]  [] __cpu_notify+0x20/0x40
[ 3189.403337]  [] _cpu_up+0xe9/0x131
[ 3189.403340]  [] cpu_up+0xdb/0xee
[ 3189.403348]  [] store_online+0x9c/0xd0
[ 3189.403355]  [] dev_attr_store+0x20/0x30
[ 3189.403361]  [] sysfs_write_file+0xa3/0x100
[ 3189.403368]  [] vfs_write+0xd0/0x1a0
[ 3189.403371]  [] sys_write+0x54/0xa0
[ 3189.403375]  [] system_call_fastpath+0x16/0x1b
[ 3189.403377] ---[ end trace 1e6cf85d0859c941 ]---
[ 3189.403398] BUG: unable to handle kernel NULL pointer dereference at 
0018

This patch registers a new notifier for cpu hotplug notify chain, and
updates sched_domains_numa_masks every time a new cpu is onlined or offlined.

Signed-off-by: Tang Chen
---
  kernel/sched/core.c |   62 +++
  1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fbf1fd0..66b36ab 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6711,6 +6711,14 @@ static void sched_init_numa(void)
 * numbers.
 */

+   /*
+* Since sched_domains_numa_levels is also used in other functions as
+* an index for sched_domains_numa_masks[][], we should reset it here in
+* case sched_domains_numa_masks[][] fails to be initialized. And set it
+* to 'level' when sched_domains_numa_masks[][] is fully initialized.
+*/
+   sched_domains_numa_levels = 0;
+
sched_domains_numa_masks = kzalloc(sizeof(void *) * level, GFP_KERNEL);
if (!sched_domains_numa_masks)
return;
@@ -6765,11 +6773,64 @@ static void sched_init_numa(void)
}

sched_domain_topology = tl;
+
+   sched_domains_numa_levels = level;
+}
+
+static void sched_domains_numa_masks_set(int cpu)
+{
+   int i, j;
+   int node = cpu_to_node(cpu);
+
+   for (i = 0; i<  sched_domains_numa_levels; i++)
+   for (j = 0; j<  nr_node_ids; j++)
+   if (node_distance(j, node)<= 
sched_domains_numa_distance[i])
+   cpumask_set_cpu(cpu, 
sched_domains_numa_masks[i][j]);
+}
+
+static void sched_domains_numa_masks_clear(int cpu)
+{
+   int i, j;
+   for (i = 0; i<  sched_domains_numa_levels; i++)
+   for (j = 0; j<  nr_node_ids; j++)
+   cpumask_clear_cpu(cpu, sched_domains_numa_masks[i][j]);
+}
+
+/*
+ * Update sched_domains_numa_masks[level][node] array when new cpus
+ * are onlined.
+ */
+static int sched_domains_numa_masks_update(struct notifier_block *nfb,
+  unsigned long action,
+  void *hcpu)
+{
+   int cpu = (int)hcpu;
+
+   switch (action&  ~CPU_TASKS_FROZEN) {
+   case CPU_ONLINE:
+   sched_domains_numa_masks_set(cpu);
+   break;
+
+   case CPU_DEAD:
+   sched_domains_numa_masks_clear(cpu);
+   break;
+
+   default:
+   return NOTIFY_DONE;
+   }
+   return NOTIFY_OK;
  }
  #else
  static inline void sched_init_numa(void)
  {
  }
+
+static int sched_domains_numa_masks_update(struct notifier_block *nfb,
+   unsigned long action,
+   void *hcpu)
+{
+   return 0;
+}
  #endif /* CONFIG_NUMA */

  static int __sdt_alloc(const struct cpumask *cpu_map)
@@ -7218,6 +7279,7 @@ void __init sched_init_smp(void)
mutex_unlock(_domains_mutex);
put_online_cpus();

+   hotcpu_notifier(sched_domains_numa_masks_update, CPU_PRI_SCHED_ACTIVE);
hotcpu_notifier(cpuset_cpu_active, CPU_PRI_CPUSET_ACTIVE);
hotcpu_notifier(cpuset_cpu_inactive, CPU_PRI_CPUSET_INACTIVE);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  

RE: [PATCH v2] lis3lv02d: Add STMicroelectronics lis331dlh digital accelerometer

2012-09-23 Thread AnilKumar, Chimata
Hi Eric,

Thanks for the comments,

On Mon, Sep 24, 2012 at 03:08:19, Éric Piel wrote:
> On 22-08-12 08:30, AnilKumar Ch wrote:
> > This patch adds support for lis331dlh digital accelerometer to the
> > lis3lv02d driver family. Adds ID field for detecting the lis331dlh
> > module, based on this ID field lis3lv02d driver will export the
> > lis331dlh module functionality.
> 
> Hello AnilKumar,
> 
> Sorry for taking so long to review your patch. Overall, it looks great :-)
> 
> There are just a few points that almost code-style/comment that needs to 
> be fixed. See below. Could you fix these small issues, and submit a new 
> patch for Andrew to pick it in his queue?

As I can see this patch is already in linux-next, I will submit
a new patch by addressing all your comments.

> 
> Here is my:
> Reviewed-by: Éric Piel 
> 
> 
> >
> > Signed-off-by: AnilKumar Ch 
> > ---
> > Changes from v1:
> > - Removed G range sysfs entry from v1
> > - Modified documentation to specify lis331dlh is supported
> >
> >   Documentation/misc-devices/lis3lv02d   |3 ++-
> >   drivers/misc/lis3lv02d/lis3lv02d.c |   42 
> > +-
> >   drivers/misc/lis3lv02d/lis3lv02d.h |   44 
> > +++-
> >   drivers/misc/lis3lv02d/lis3lv02d_i2c.c |7 -
> >   4 files changed, 87 insertions(+), 9 deletions(-)
> >
> > diff --git a/Documentation/misc-devices/lis3lv02d 
> > b/Documentation/misc-devices/lis3lv02d
> > index f1a4ec8..af815b9 100644
> > --- a/Documentation/misc-devices/lis3lv02d
> > +++ b/Documentation/misc-devices/lis3lv02d
> > @@ -4,7 +4,8 @@ Kernel driver lis3lv02d
> >   Supported chips:
> >
> > * STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision)
> > -  * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits)
> > +  * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits) and
> > +LIS331DLH (16 bits)
> >
> >   Authors:
> >   Yan Burman 
> > diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
> > b/drivers/misc/lis3lv02d/lis3lv02d.c
> > index 29d12a7..c0a9199 100644
> > --- a/drivers/misc/lis3lv02d/lis3lv02d.c
> > +++ b/drivers/misc/lis3lv02d/lis3lv02d.c
> > @@ -80,6 +80,14 @@
> >   #define LIS3_SENSITIVITY_12B  ((LIS3_ACCURACY * 1000) / 1024)
> >   #define LIS3_SENSITIVITY_8B   (18 * LIS3_ACCURACY)
> >
> > +/*
> > + * LIS3331DLH spec says 1LSBs corresponds 4G/1024 -> 1LSB is 1000/1024 mG.
> > + * Sensitivity values for +/-2G, outdata in 12 bits for +/-2G scale. so 4
> > + * bits adjustment is required
> > + */
> > +#define LIS3DLH_SENSITIVITY_2G ((LIS3_ACCURACY * 1000) / 1024)
> > +#define SHIFT_ADJ_2G   4
> > +
> You said later:
> >
> > Typo mistake this should be 4G/4096
> Could you fix the comment. Even better, change LIS3331DLH to LIS331DLH
> 
> Also, if I understand correctly, there is currently no support for 
> changing the sensitivity. It stays at 2G all the time, right? In such 
> case, please add a sentence in this comment that the driver does only 
> support the 2G sensitivity for now.

I will do this

> 
> 
> >   #define LIS3_DEFAULT_FUZZ_12B 3
> >   #define LIS3_DEFAULT_FLAT_12B 3
> >   #define LIS3_DEFAULT_FUZZ_8B  1
> > @@ -133,6 +141,19 @@ static s16 lis3lv02d_read_12(struct lis3lv02d *lis3, 
> > int reg)
> > return (s16)((hi << 8) | lo);
> >   }
> >
> > +/* 12bits for 2G range, 13 bits for 4G range and 14 bits for 8G range */
> > +static s16 lis3lv02d_read_16(struct lis3lv02d *lis3, int reg)
> > +{
> > +   u8 lo, hi;
> > +   int v;
> > +
> > +   lis3->read(lis3, reg - 1, );
> > +   lis3->read(lis3, reg, );
> > +   v = (int) ((hi << 8) | lo);
> > +
> > +   return (s16) v >> lis3->shift_adj;
> > +}
> As the method reads 12, 13, or 14 bits, it's a bit tricky to call it 
> "*_read_16". I'd suggest maybe "lis3lv02d_read_12_14", 
> "lis3lv02d_read_adj_16", or even "lis331dlh_read_data". Pick the one you 
> prefer :-)

Comment is available to convey the number of bits so I am changing it to
"lis331dlh_read_data".

> 
> 
> >   /**
> >* lis3lv02d_get_axis - For the given axis, give the value converted
> >* @axis:  1,2,3 - can also be negative
> > @@ -193,6 +214,7 @@ static void lis3lv02d_get_xyz(struct lis3lv02d *lis3, 
> > int *x, int *y, int *z)
> >   static int lis3_12_rates[4] = {40, 160, 640, 2560};
> >   static int lis3_8_rates[2] = {100, 400};
> >   static int lis3_3dc_rates[16] = {0, 1, 10, 25, 50, 100, 200, 400, 1600, 
> > 5000};
> > +static int lis3_3dlh_rates[4] = {50, 100, 400, 1000};
> >
> >   /* ODR is Output Data Rate */
> >   static int lis3lv02d_get_odr(struct lis3lv02d *lis3)
> > @@ -265,7 +287,7 @@ static int lis3lv02d_selftest(struct lis3lv02d *lis3, 
> > s16 results[3])
> > (LIS3_IRQ1_DATA_READY | LIS3_IRQ2_DATA_READY));
> > }
> >
> > -   if (lis3->whoami == WAI_3DC) {
> > +   if ((lis3->whoami == WAI_3DC) || (lis3->whoami == WAI_3DLH)) {
> > ctlreg = 

Re: [PATCH scsi] Add NULL checking of return value from scsi_cmd_to_driver()

2012-09-23 Thread James Bottomley
On Mon, 2012-09-24 at 13:30 +0800, Li Zhong wrote:
> Just noticed that after commit 919f797, it is possible that 
> scsi_cmd_to_driver() returns NULL. This patch adds the NULL checking for drv 
> returned from the above function. 
> 
> Maybe it is not possible at run time, but from the code itself, we'd better
> have this check?  

There's not much point having a check that never trips, unless it's an
assert, in which case a NULL deref does that.  All it does is add
pointless instructions to the critical path.  only REQ_TYPE_BLOCK_PC
commands can be submitted without a driver, so the check above would
seem to preclude that.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: performance degradation on kernel upgrade (due to commit ab0a9735e06914ce4d2a94ffa41497dbc142fe7f)

2012-09-23 Thread Jagdish Motwani

On 09/21/2012 07:55 PM, Andres Freund wrote:

Hi,

On Friday, September 21, 2012 03:47:56 PM Jagdish Motwani wrote:

Recently i upgraded my kernel from 2.6.29.6 to 2.6.35.14.

After upgrading i got very poor performance on my postgre database.


My test.sql contains 1 postgre insert query


Linux  2.6.29.6

time psql -U user -d database -f test.sql  > /dev/null
real0m 7.23s
user0m 0.38s
sys 0m 0.12s



Linux  2.6.35.14

# time psql -U user -d database -f test.sql  > /dev/null
real1m 4.05s
user0m 0.44s
sys0m 0.12

How do the results to this look if you use psql -1/--single-transaction?
Using single transaction solves the problem - but that's not what i 
really want.



I even tried Linux 3.5.4 and got similar results.

Using git bisect, i got commit ab0a9735e06914ce4d2a94ffa41497dbc142fe7f

Is it a behavior change or am i missing something? Are there any
workarounds for this?

I guess youre using some form of virtualization? I think what youre observing
is just that access via raw devices previously lied about consistency. As the
commit observes several virtualization solutions can use raw device access.

If all those 1 inserts above happen in individual transactions - which
would happen if youre not using transactions explicitly -  each and every one
of them will cause a single disk write if they are executed sequentially.
A typical rotating disks can do between 80-160 such writes. If you devide 10k
transactions by 150 synchronous writes a second you get ~66s which pretty
nicely fits your time above.

If you don't care about loosing a very small amount of transactions (up to a
second with the default settings) you can disable the synchronous_commit
setting in postgres. No earlier commits/changes will be lost/corrupted.
You can change that setting per transaction, per session/connection, per user,
per database or globally.

Greetings,

Andres

Thanks Andres,

I disabled synchronous_commit, and got results similar to 2.6.32.

Regards,
Jagdish Motwani
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH scsi] Add NULL checking of return value from scsi_cmd_to_driver()

2012-09-23 Thread Li Zhong
Just noticed that after commit 919f797, it is possible that 
scsi_cmd_to_driver() returns NULL. This patch adds the NULL checking for drv 
returned from the above function. 

Maybe it is not possible at run time, but from the code itself, we'd better
have this check?  

This patch actually is a delta of my previous patch 
[https://lkml.org/lkml/2012/4/11/814] and commit 919f797

Signed-off-by: Li Zhong 
---

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2936b44..b9dd7f0 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -832,7 +832,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
 if (cmd->request->cmd_type != REQ_TYPE_BLOCK_PC) {
int old_good_bytes = good_bytes;
drv = scsi_cmd_to_driver(cmd);
-   if (drv->done)
+   if (drv && drv->done)
good_bytes = drv->done(cmd);
/*
 * USB may not give sense identifying bad sector and


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the edac tree with Linus' tree

2012-09-23 Thread Stephen Rothwell
Hi Mauro,

Today's linux-next merge of the edac tree got a conflict in 
drivers/edac/edac_mc.c between commit faa2ad09c01c ("edac_mc: edac_mc_free() 
cannot assume mem_ctl_info is registered in sysfs") from Linus' tree and commit 
12c3ab9422cc ("edac: edac_mc_free() cannot assume mem_ctl_info is registered in 
sysfs") from the edac tree.

Two versions of the same patch. I just used the version from the edac
tree and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpWSd1NV6n6Y.pgp
Description: PGP signature


Re: [PATCH 10/11] userns: Convert the udf filesystem to use kuid/kgid where appropriate

2012-09-23 Thread Jan Kara
On Fri 21-09-12 18:35:11, Eric W. Biederman wrote:
> From: "Eric W. Biederman" 
> 
> Cc: Jan Kara 
> Acked-by: Serge Hallyn 
> Signed-off-by: Eric W. Biederman 
  The patch looks good. You can add:
Acked-by: Jan Kara 

Honza
> ---
>  fs/udf/inode.c |   20 
>  init/Kconfig   |1 -
>  2 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/udf/inode.c b/fs/udf/inode.c
> index fafaad7..2e6fb4d 100644
> --- a/fs/udf/inode.c
> +++ b/fs/udf/inode.c
> @@ -1250,6 +1250,8 @@ static void udf_fill_inode(struct inode *inode, struct 
> buffer_head *bh)
>   struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
>   struct udf_inode_info *iinfo = UDF_I(inode);
>   unsigned int link_count;
> + uid_t i_uid;
> + gid_t i_gid;
>  
>   fe = (struct fileEntry *)bh->b_data;
>   efe = (struct extendedFileEntry *)bh->b_data;
> @@ -1309,17 +1311,19 @@ static void udf_fill_inode(struct inode *inode, 
> struct buffer_head *bh)
>   }
>  
>   read_lock(>s_cred_lock);
> - inode->i_uid = le32_to_cpu(fe->uid);
> - if (inode->i_uid == -1 ||
> + i_uid = le32_to_cpu(fe->uid);
> + if (i_uid == -1 ||
>   UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_IGNORE) ||
>   UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_SET))
> - inode->i_uid = UDF_SB(inode->i_sb)->s_uid;
> + i_uid = UDF_SB(inode->i_sb)->s_uid;
> + i_uid_write(inode, i_uid);
>  
> - inode->i_gid = le32_to_cpu(fe->gid);
> - if (inode->i_gid == -1 ||
> + i_gid = le32_to_cpu(fe->gid);
> + if (i_gid == -1 ||
>   UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_IGNORE) ||
>   UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_SET))
> - inode->i_gid = UDF_SB(inode->i_sb)->s_gid;
> + i_gid = UDF_SB(inode->i_sb)->s_gid;
> + i_gid_write(inode, i_gid);
>  
>   if (fe->icbTag.fileType != ICBTAG_FILE_TYPE_DIRECTORY &&
>   sbi->s_fmode != UDF_INVALID_MODE)
> @@ -1539,12 +1543,12 @@ static int udf_update_inode(struct inode *inode, int 
> do_sync)
>   if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET))
>   fe->uid = cpu_to_le32(-1);
>   else
> - fe->uid = cpu_to_le32(inode->i_uid);
> + fe->uid = cpu_to_le32(i_uid_read(inode));
>  
>   if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_GID_FORGET))
>   fe->gid = cpu_to_le32(-1);
>   else
> - fe->gid = cpu_to_le32(inode->i_gid);
> + fe->gid = cpu_to_le32(i_gid_read(inode));
>  
>   udfperms = ((inode->i_mode & S_IRWXO)) |
>  ((inode->i_mode & S_IRWXG) << 2) |
> diff --git a/init/Kconfig b/init/Kconfig
> index 21adc1c..6f9819a 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -939,7 +939,6 @@ config UIDGID_CONVERTED
>   depends on NFSD = n
>   depends on NFS_FS = n
>   depends on OCFS2_FS = n
> - depends on UDF_FS = n
>   depends on UFS_FS = n
>   depends on XFS_FS = n
>  
> -- 
> 1.7.5.4
> 
-- 
Jan Kara 
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6.38-3.x] [BUG] soft lockup - CPU#X stuck for 23s! (vfs, autofs, vserver)

2012-09-23 Thread Paweł Sikora
On Sunday 23 of September 2012 18:10:30 Linus Torvalds wrote:
> On Sat, Sep 22, 2012 at 11:09 PM, Paweł Sikora  wrote:
> >
> > br_read_lock(vfsmount_lock);
> 
> The vfsmount_lock is a "local-global" lock, where a read-lock is
> rather cheap and takes just a per-cpu lock, but the downside is that a
> write-lock is *very* expensive, and can cause serious trouble.
> 
> And the write lock is taken by the [un]mount() paths. Do *not* do
> crazy things. If you do some insane "unmount and remount autofs" on a
> 1s granularity, you're doing insane things.
> 
> Why do you have that 1s timeout? Insane.

1s unmount timeout is *only* for fast bug reproduction (in few seconds after 
opteron startup)
and testing potential patches. normally with 60s timeout it happens in few 
minutes..hours
(depends on machine i/o+cpu load) and makes server unusable (permament 
soft-lockup).
can we redesign vserver's mnt_is_reachable() for better locking to avoid total 
soft-lockup?

BR,
Paweł.

ps).
i'm adding Herbert to CC.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Conditional Unlink

2012-09-23 Thread NeilBrown
On Fri, 21 Sep 2012 10:32:36 -0700 "Fox, Kevin M"  wrote:

> Quick question:
> Is there a syscall or some algorithm that would allow an unlink that would 
> only happen if no writes to the file have occurred between a stat and an 
> unlink, race free?
> 
> Background:
> I'm writing a program that sync's files up to a server. I would like to 
> unlink the files that have successfully been uploaded. There is a race 
> though. If the file changed after uploading but before the unlink (I do not 
> control who can write to the files), the next upload should take care of 
> things and the unlink should fail. Otherwise, data could be lost!

Probably your best bet is to rename the file in there.
 mv file file.tmp
 sleep 5
 cp file.tmp $server/file
 rm file.tmp

The "sleep 5" might not work for you, one would need to know more about total
context.

Is any locking done when writing to the file, or will there only ever be one
writer?

NeilBrown


signature.asc
Description: PGP signature


Re: [PATCH v3 1/7] KVM: MMU: fix release noslot pfn

2012-09-23 Thread Xiao Guangrong
On 09/23/2012 05:13 PM, Gleb Natapov wrote:
> On Fri, Sep 21, 2012 at 02:57:19PM +0800, Xiao Guangrong wrote:
>> We can not directly call kvm_release_pfn_clean to release the pfn
>> since we can meet noslot pfn which is used to cache mmio info into
>> spte
>>
> Wouldn't it be better to move the check into kvm_release_pfn_clean()?

I think there is no reason for us to prefer to adding this branch in
the common code. :)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 2/5] fat: allocate persistent inode numbers

2012-09-23 Thread Namjae Jeon
2012/9/24, OGAWA Hirofumi :
> Namjae Jeon  writes:
>
>>> I think we don't need this. Because FH and ino is not necessary to have
>>> relation.
>>>
>>> Can we re-introduce ->encode_fh() handler, and export i_pos again?  With
>>> this, I think we can get i_pos correctly. Otherwise, ino may not contain
>>> all bits of i_pos.
>> I already tried to fix this issue using encode_fh without stable ino
>> before.
>> But I reached conclusion that we should use stable inode number.
>>
>> e.g. If we rebuild inode number using i_pos of fh, inode number is
>> changed by i_unique.
>> And It is not match with inode number of FH on NFS client. So estale
>> error will happen.
>
> What is problem if i_ino + i_generation is not match? I think, even if
> those didn't match, i_pos in FH should resolve issue, no?
No, It can not resolve issue.
in NFS file handle, there is a reference to the current inode number.
So, if by eviction that is changed - that it will results in "file id
changed" error.
even though using the i_pos we can reconstruct and get the INODE on
the Server, but the NFS handle is no more valid. As the inode number
is also changed, iunique() for the file will result in different
number this time.

Thanks.
> --
> OGAWA Hirofumi 
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] block: makes bio_split support bio without data

2012-09-23 Thread NeilBrown

Hi Jens,
 this patch has been sitting in my -next tree for a little while and I was
 hoping for it to go in for the next merge window.
 It simply allows bio_split() to be used on bios without a payload, such as
 'discard'.
 Are you happy with it going in though my 'md' tree, or would you rather take
 it though your 'block' tree?

Thanks,
NeilBrown


From: Shaohua Li 
Date: Thu, 20 Sep 2012 09:36:03 +1000
Subject: [PATCH] block: makes bio_split support bio without data

discard bio hasn't data attached. We hit a BUG_ON with such bio. This makes
bio_split works for such bio.

Signed-off-by: Shaohua Li 
Signed-off-by: NeilBrown 

diff --git a/fs/bio.c b/fs/bio.c
index 71072ab..dbb7a6c 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1501,7 +1501,7 @@ struct bio_pair *bio_split(struct bio *bi, int 
first_sectors)
trace_block_split(bdev_get_queue(bi->bi_bdev), bi,
bi->bi_sector + first_sectors);
 
-   BUG_ON(bi->bi_vcnt != 1);
+   BUG_ON(bi->bi_vcnt != 1 && bi->bi_vcnt != 0);
BUG_ON(bi->bi_idx != 0);
atomic_set(>cnt, 3);
bp->error = 0;
@@ -1511,17 +1511,19 @@ struct bio_pair *bio_split(struct bio *bi, int 
first_sectors)
bp->bio2.bi_size -= first_sectors << 9;
bp->bio1.bi_size = first_sectors << 9;
 
-   bp->bv1 = bi->bi_io_vec[0];
-   bp->bv2 = bi->bi_io_vec[0];
-   bp->bv2.bv_offset += first_sectors << 9;
-   bp->bv2.bv_len -= first_sectors << 9;
-   bp->bv1.bv_len = first_sectors << 9;
+   if (bi->bi_vcnt != 0) {
+   bp->bv1 = bi->bi_io_vec[0];
+   bp->bv2 = bi->bi_io_vec[0];
+   bp->bv2.bv_offset += first_sectors << 9;
+   bp->bv2.bv_len -= first_sectors << 9;
+   bp->bv1.bv_len = first_sectors << 9;
 
-   bp->bio1.bi_io_vec = >bv1;
-   bp->bio2.bi_io_vec = >bv2;
+   bp->bio1.bi_io_vec = >bv1;
+   bp->bio2.bi_io_vec = >bv2;
 
-   bp->bio1.bi_max_vecs = 1;
-   bp->bio2.bi_max_vecs = 1;
+   bp->bio1.bi_max_vecs = 1;
+   bp->bio2.bi_max_vecs = 1;
+   }
 
bp->bio1.bi_end_io = bio_pair_end_1;
bp->bio2.bi_end_io = bio_pair_end_2;


signature.asc
Description: PGP signature


RE: gpmc_cs_request() causes early boot hang

2012-09-23 Thread Mohammed, Afzal
Hi Mark,

On Sat, Sep 22, 2012 at 00:57:38, Mark Jackson wrote:
> I'm developing a beaglebone cape board which requires the use of a GPMC 
> chip select.
> 
> I've chosen GPMC_CS0, and in board-am335xevm.c, I have added the following:-
> 
> static void gpmc_test()
> {
>  unsigned long base = 0x12345678;
>  gpmc_cs_request(0, SZ_16M, );
>  printk(KERN_INFO "gpmc base @ 0x%08lx\n", base);
> }
> 
> ... and added a call to gpmc_test() at the end of am335x_evm_init().
> 
> If I try to run this code, the kernel fails to boot, and simply hangs at:-
> 
> Uncompressing Linux... done, booting the kernel.
> 
> If I comment out the call to gpmc_cs_request(), the system boots as 
> expected (but without my required cs).
> 
> I've looked at the use of this call in other board files, and can't see 
> that their code does anything special so I'm stuck on why this simple 
> code fails to work.
> 
> Can anyone shed light on what I'm doing wrong ?
> 
> Do I have to initialise the gpmc beforehand in some way ?

It seems you are using PSP Kernel.

Invoking omap_init_gpmc before gpmc request should help.

Regards
Afzal
N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a���
0��h���i

Re: [PATCH 00/14] Media Controller capture driver for DM365

2012-09-23 Thread Prabhakar Lad
Hi Sakari,

On Sun, Sep 23, 2012 at 8:46 PM, Sakari Ailus  wrote:
> Hi Prabhakar,
>
>
> Prabhakar Lad wrote:
>>
>> From: Lad, Prabhakar 
>>
>> This patch set adds media controller based capture driver for
>> DM365.
>
>
> Thanks for the set. Do you happen to have an updated version of the same
> documentation you posted to the list a while ago?
>
Yes I have included the documentation patch in same series.
'Documentation/video4linux/davinci-vpfe-mc.txt' is the one
which contains the documentation.

Regards,
--Prabhakar Lad

> Kind regards,
>
> --
> Sakari Ailus
> sakari.ai...@iki.fi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 2/5] fat: allocate persistent inode numbers

2012-09-23 Thread OGAWA Hirofumi
Namjae Jeon  writes:

>> I think we don't need this. Because FH and ino is not necessary to have
>> relation.
>>
>> Can we re-introduce ->encode_fh() handler, and export i_pos again?  With
>> this, I think we can get i_pos correctly. Otherwise, ino may not contain
>> all bits of i_pos.
> I already tried to fix this issue using encode_fh without stable ino before.
> But I reached conclusion that we should use stable inode number.
>
> e.g. If we rebuild inode number using i_pos of fh, inode number is
> changed by i_unique.
> And It is not match with inode number of FH on NFS client. So estale
> error will happen.

What is problem if i_ino + i_generation is not match? I think, even if
those didn't match, i_pos in FH should resolve issue, no?
-- 
OGAWA Hirofumi 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Btrfs: check range early in map_private_extent_buffer

2012-09-23 Thread Wang Sheng-Hui
Check range early to avoid further check/compute in case
of range error.

Signed-off-by: Wang Sheng-Hui 
---
 fs/btrfs/extent_io.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 4c87847..9250cf5 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4643,6 +4643,14 @@ int map_private_extent_buffer(struct extent_buffer *eb, 
unsigned long start,
unsigned long end_i = (start_offset + start + min_len - 1) >>
PAGE_CACHE_SHIFT;
 
+   if (start + min_len > eb->len) {
+   printk(KERN_ERR "btrfs bad mapping eb start %llu len %lu, "
+  "wanted %lu %lu\n", (unsigned long long)eb->start,
+  eb->len, start, min_len);
+   WARN_ON(1);
+   return -EINVAL;
+   }
+
if (i != end_i)
return -EINVAL;
 
@@ -4654,14 +4662,6 @@ int map_private_extent_buffer(struct extent_buffer *eb, 
unsigned long start,
*map_start = ((u64)i << PAGE_CACHE_SHIFT) - start_offset;
}
 
-   if (start + min_len > eb->len) {
-   printk(KERN_ERR "btrfs bad mapping eb start %llu len %lu, "
-  "wanted %lu %lu\n", (unsigned long long)eb->start,
-  eb->len, start, min_len);
-   WARN_ON(1);
-   return -EINVAL;
-   }
-
p = extent_buffer_page(eb, i);
kaddr = page_address(p);
*map = kaddr + offset;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC v4 Patch 0/4] fs/inode.c: optimization for inode lock usage

2012-09-23 Thread Dave Chinner
On Mon, Sep 24, 2012 at 10:42:21AM +0800, Guo Chao wrote:
> On Sat, Sep 22, 2012 at 08:49:12AM +1000, Dave Chinner wrote:
> 
> > On Fri, Sep 21, 2012 at 05:31:02PM +0800, Guo Chao wrote:
> > > This patchset optimizes several places which take the per inode spin lock.
> > > They have not been fully tested yet, thus they are marked as RFC. 
> > 
> > Inodes are RCU freed. The i_lock spinlock on the i_state field forms
> > part of the memory barrier that allows the RCU read side to
> > correctly detect a freed inode during a RCU protected cache lookup
> > (hash list traversal for the VFS, or a radix tree traversal for XFS).
> > The i_lock usage around the hahs list operations ensures the hash
> > list operations are atomic with state changes so that such changes
> > are correctly detected during RCU-protected traversals...
> > 
> > IOWs, removing the i_lock from around the i_state transitions and
> > inode hash insert/remove/traversal operations will cause races in
> > the RCU lookups and result in incorrectly using freed inodes instead
> > of failing the lookup and creating a new one.
> > 
> > So I don't think this is a good idea at all...
> >
> 
> Hello, Dave:
> 
>   Thanks for your explanation.
>  
>   Though I can't fully understand it, your concern seems to be that
> RCU inode lookup will be bothered by this change. But we do not have 
> RCU inode lookup in VFS: inode lookup is done by rather a tranditional
> way. 

Ah, I'd forgotten that neither of these RCU-based lookups ever got
merged:

https://lkml.org/lkml/2010/6/23/397
http://thread.gmane.org/gmane.linux.kernel/1056494

That, however, is the approach that the inode caches shoul dbe
moving towards - RCU lookups to reduce locking, not changing
i_lock/i_state atomicity that has been designed to facilitate RCU
safe lookups...

>   XFS gives me the impression that it implements its own inode cache.
> There may be such thing there. I have little knowledge on XFS, but I
> guess it's unlikely impacted by the change of code implementing VFS 
> inode cache.

Yeah, I dropped the generic inode hash RCU conversion - the
SLAB_DESTROY_BY_RCU was proving to be rather complex, and I didn't
have any motiviation to see it through because I'd already converted
XFs to avoid the global inode_hash_lock and use RCU lookups on it's
internal inode cache...

>   As far as I can see, RCU inode free is for RCU dentry lookup, which
> seems have nothing to do with 'detect a freed inode'.

If you know nothing of the history of this, then it might seem that
way

> Taking i_lock in these
> places looks like to me a result of following old lock scheme blindly when 
> breaking the big global inode lock.

The i_state/i_hash_list/i_lock relationship was created specifically
during the inode_lock breakup to allow us to guarantee that certain
fields of the inode are unchanging without needing to take multiple
nested locks:

$ gl -n 1 250df6e
commit 250df6ed274d767da844a5d9f05720b804240197
Author: Dave Chinner 
Date:   Tue Mar 22 22:23:36 2011 +1100

fs: protect inode->i_state with inode->i_lock

Protect inode state transitions and validity checks with the
inode->i_lock. This enables us to make inode state transitions
independently of the inode_lock and is the first step to peeling
away the inode_lock from the code.

This requires that __iget() is done atomically with i_state checks
during list traversals so that we don't race with another thread
marking the inode I_FREEING between the state check and grabbing the
reference.

Also remove the unlock_new_inode() memory barrier optimisation
required to avoid taking the inode_lock when clearing I_NEW.
Simplify the code by simply taking the inode->i_lock around the
state change and wakeup. Because the wakeup is no longer tricky,
remove the wake_up_inode() function and open code the wakeup where
necessary.

Signed-off-by: Dave Chinner 
Signed-off-by: Al Viro 

The inode hash lookup needs to check i_state atomically during the
traversal so inodes being freed are skipped (e.g. I_FREEING,
I_WILL_FREE). those i_state flags are set only with the i_lock held,
and so inode hash lookups need to take the i_lock to guarantee the
i_state field is correct. This inode data field synchronisation is
separate to the cache hash list traversal protection.

The only way to do this is to have an inner lock (inode->i_lock)
that protects both the inode->i_hash_list and inode->i_state fields,
and a lock order that provides outer list traversal protections
(inode_hash_lock). Whether the outer lock is the inode_hash_lock or
rcu_read_lock(), the lock order and the data fields the locks are
protecting are the same

> Of course, maybe they are there for something. Could you speak
> more about the race this change (patch 1,2?) brings up? Thank you.

When you drop the lock from the i_state initialisation, you end up
dropping the implicit unlock->lock memory barrier that the

Re: [PATCH v3 4/5] fat (exportfs): rebuild directory-inode if fat_dget() fails

2012-09-23 Thread Namjae Jeon
2012/9/22, OGAWA Hirofumi :
> Namjae Jeon  writes:
>
>> From: Namjae Jeon 
>>
>> This patch enables rebuilding of directory inodes which are not present
>> in the cache.This is done by traversing the disk clusters to find the
>> directory entry of the parent directory and using its i_pos to build the
>> inode.
>
> Hmm... Is this functionality is necessary to work correctly? If we
> didn't provide this, which case do server return ESTALE?
Yes, we should rebuild parent inode if parent directory is not
connected(parent inode eviction).
So this function is surely needed.

Let me know your opinion if you have any question.

Thanks for review. OGAWA!.
>
> Well, this looks like duplication of lookup, we may need to consolidate.
>
>> Signed-off-by: Namjae Jeon 
>> Signed-off-by: Ravishankar N 
>> Signed-off-by: Amit Sahrawat 
>> ---
>>  fs/fat/nfs.c |  132
>> --
>>  1 file changed, 128 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/fat/nfs.c b/fs/fat/nfs.c
>> index 3cf5412..bb4262c 100644
>> --- a/fs/fat/nfs.c
>> +++ b/fs/fat/nfs.c
>> @@ -104,6 +104,93 @@ struct dentry *fat_fh_to_parent(struct super_block
>> *sb, struct fid *fid,
>>  }
>>
>>  /*
>> + * Read the directory entries of 'search_clus' and find the entry
>> + * which contains 'match_ipos' for the starting cluster.If the entry
>> + * is found, rebuild its inode.
>> + */
>> +static struct inode *fat_traverse_cluster(struct super_block *sb,
>> +int search_clus, int match_ipos)
>> +{
>> +struct msdos_sb_info *sbi = MSDOS_SB(sb);
>> +struct buffer_head *bh;
>> +sector_t blknr;
>> +int parent_ipos, search_ipos;
>> +int i;
>> +struct msdos_dir_entry *de;
>> +struct inode *inode = NULL;
>> +int iterations = sbi->cluster_size >> sb->s_blocksize_bits;
>> +blknr = fat_clus_to_blknr(sbi, search_clus);
>> +
>> +do {
>> +bh = sb_bread(sb, blknr);
>> +if (!bh) {
>> +fat_msg(sb, KERN_ERR,
>> + "NFS:unable to read block(%llu) while 
>> traversing cluster(%d)",
>> +(llu)blknr, search_clus);
>> +inode = ERR_PTR(-EIO);
>> +goto out;
>> +}
>> +de = (struct msdos_dir_entry *)bh->b_data;
>> +for (i = 0; i < sbi->dir_per_block; i++) {
>> +if (de[i].name[0] == FAT_ENT_FREE) {
>> +/*Reached end of directory*/
>> +brelse(bh);
>> +inode = ERR_PTR(-ENODATA);
>> +goto out;
>> +}
>> +if (de[i].name[0] == DELETED_FLAG)
>> +continue;
>> +if (de[i].attr == ATTR_EXT)
>> +continue;
>> +if (!(de[i].attr & ATTR_DIR))
>> +continue;
>> +else {
>> +search_ipos = fat_get_start(sbi, [i]);
>> +if (search_ipos == match_ipos) {
>> +/*Success.Now build the inode*/
>> +parent_ipos = (loff_t)i +
>> + (blknr << sbi->dir_per_block_bits);
>> +inode = fat_build_inode(sb, [i],
>> +parent_ipos);
>> +brelse(bh);
>> +goto out;
>> +}
>> +}
>> +}
>> +brelse(bh);
>> +blknr += 1;
>> +} while (--iterations > 0);
>> +out:
>> +return inode;
>> +}
>> +
>> +/*
>> + * Read the FAT to find the next cluster in the chain
>> + * corresponding to 'search_clus'.
>> + */
>> +static int fat_read_next_clus(struct super_block *sb, int search_clus)
>> +{
>> +struct msdos_sb_info *sbi = MSDOS_SB(sb);
>> +/*bits 31 to 7 give relative sector number*/
>> +sector_t blknr = search_clus >> 7;
>> +/*bits 6 to 0 give offset*/
>> +unsigned int offset = search_clus & 0x7F;
>> +__le32 *address;
>> +unsigned int next_cluster;
>> +struct buffer_head *bh = sb_bread(sb, blknr + sbi->fat_start);
>> +if (!bh) {
>> +fat_msg(sb, KERN_ERR,
>> +"NFS:unable to read block(%llu) for finding the next 
>> cluster in FAT
>> chain",
>> +(llu)blknr);
>> +return -EIO;
>> +}
>> +address = (__le32 *) bh->b_data;
>> +next_cluster = (le32_to_cpu(address[offset])) & 0x0FFF;
>> +brelse(bh);
>> +return next_cluster;
>> +}
>> +
>> +/*
>>   * Find the parent for a directory that is not currently connected to
>>   * the filesystem root.
>>   *
>> @@ -112,15 +199,52 @@ struct dentry *fat_fh_to_parent(struct super_block
>> 

Re: [PATCH v3 3/5] fat (exportfs): rebuild inode if ilookup() fails

2012-09-23 Thread Namjae Jeon
2012/9/22, OGAWA Hirofumi :
> Namjae Jeon  writes:
>
>> +if (inode == NULL && MSDOS_SB(sb)->options.nfs == FAT_NFS_LIMITED) {
>> +struct buffer_head *bh = NULL;
>> +struct msdos_dir_entry *de ;
>> +loff_t i_pos = (loff_t)ino;
>> +int bits = MSDOS_SB(sb)->dir_per_block_bits;
>> +loff_t blocknr = i_pos >> bits;
>> +bh = sb_bread(sb, blocknr);
>> +if (!bh) {
>> +fat_msg(sb, KERN_ERR,
>> + "unable to read block(%llu) for building NFS 
>> inode",
>> +(llu)blocknr);
>> +return inode;
>> +}
>> +de = (struct msdos_dir_entry *)bh->b_data;
>> +/* If a file is deleted on server and client is not updated
>> + * yet, we must not build the inode upon a lookup call.
>> + */
>> +if (de[i_pos&((1<
> IS_FREE() would be better.
Okay~ I will change.
>
>> +
>> +inode = NULL;
>> +else
>> +inode = fat_build_inode(sb, [i_pos&((1<> +i_pos);
>> +brelse(bh);
>> +}
>>
>>  return inode;
>>  }
>
> 1 << bits == sbi->dir_per_block
>
> It would be better to add helper to decode i_pos to blocknr and offset.
> And it should be shared on fat_write_inode and this.
Okay, I will change.

Thanks.
> --
> OGAWA Hirofumi 
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 2/5] fat: allocate persistent inode numbers

2012-09-23 Thread Namjae Jeon
2012/9/22, OGAWA Hirofumi :
> Namjae Jeon  writes:
>
>> -inode->i_ino = iunique(sb, MSDOS_ROOT_INO);
>> +if (MSDOS_SB(sb)->options.nfs == FAT_NFS_LIMITED)
>> +inode->i_ino = i_pos;
>> +else
>> +inode->i_ino = iunique(sb, MSDOS_ROOT_INO);
>>  inode->i_version = 1;
>>  err = fat_fill_inode(inode, de);
>>  if (err) {
>
> I think we don't need this. Because FH and ino is not necessary to have
> relation.
>
> Can we re-introduce ->encode_fh() handler, and export i_pos again?  With
> this, I think we can get i_pos correctly. Otherwise, ino may not contain
> all bits of i_pos.
I already tried to fix this issue using encode_fh without stable ino before.
But I reached conclusion that we should use stable inode number.

e.g. If we rebuild inode number using i_pos of fh, inode number is
changed by i_unique.
And It is not match with inode number of FH on NFS client. So estale
error will happen.

Thanks.
> --
> OGAWA Hirofumi 
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ahci: add a boot option to enable promise ahci

2012-09-23 Thread Tony Hung - PTT 洪瑞嶸
linux-3.2.0/drivers/ata/ahci.c: In function 'hptiop_host_request_callback':

Use min_t(size_t, ...) to fix.

Signed-off-by: Tony Hung 
---

diff --git a/linux-3.2.0/drivers/ata/ahci.c b/linux-3.2.0/drivers/ata/ahci.c
--- a/linux-3.2.0/drivers/ata/ahci.c2012-08-29 13:40:26.046851693 +0800
+++ b/linux-3.2.0/drivers/ata/ahci.c2012-08-30 17:23:10.207838960 +0800
@@ -430,6 +430,9 @@ static int marvell_enable = 1;
 module_param(marvell_enable, int, 0644);
 MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");

+static int promise_enable;
+module_param(promise_enable, int, 0644);
+MODULE_PARM_DESC(promise_enable, "Promise SATA via AHCI (1 = enabled)");

 static void ahci_pci_save_initial_config(struct pci_dev *pdev,
 struct ahci_host_priv *hpriv)
@@ -1049,6 +1052,16 @@ static int ahci_init_one(struct pci_dev
if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable)
return -ENODEV;

+/*
+ * In RAID mode, Promise software RAID need to replace
+ * original AHCI module, but if AHCI driver build-in kernel,
+ * Promise AHCI module need a boot option to disable it
+ */
+if (promise_enable &&
+((pdev->class >> 8) == PCI_CLASS_STORAGE_RAID) &&
+ (pdev->vendor == PCI_VENDOR_ID_ATI ||
+  pdev->vendor == PCI_VENDOR_ID_AMD))
+return -ENODEV;
+
/*
 * For some reason, MCP89 on MacBook 7,1 doesn't work with
 * ahci, use ata_generic instead. 

To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



Re: [PATCH v3 1/5] fat: modify nfs mount option

2012-09-23 Thread Namjae Jeon
2012/9/22, OGAWA Hirofumi :
> Namjae Jeon  writes:
>
>> +case Opt_nfs_full:
>> +opts->nfs = FAT_NFS_FULL;
>> +break;
>> +case Opt_nfs_limited:
>> +opts->nfs = FAT_NFS_LIMITED;
>> +sb->s_flags |= MS_RDONLY;
>> +break;
>
Hi. OGAWA.
> Check opt->nfs at end of parse_option(). Otherwise, multiple nfs options
> would confuse it.
Yes, I will check it.
>
> E.g.
>
>   mount -o nfs=limited_stable,nfs=full_unstable
>
> --
> OGAWA Hirofumi 
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build failure after merge of the sound and sound-asoc trees

2012-09-23 Thread Stephen Rothwell
Hi all,

After merging the sound tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from include/linux/skbuff.h:31:0,
 from include/linux/if_ether.h:135,
 from include/linux/netdevice.h:29,
 from arch/powerpc/net/bpf_jit_comp.c:14:
include/linux/dmaengine.h: In function 'dmaengine_prep_dma_cyclic':
include/linux/dmaengine.h:659:24: error: 'flags' undeclared (first use in this 
function)

and lots more similar.

Caused by commit ec8b5e48c037 ("dmaengine: Pass flags via
device_prep_dma_cyclic() callback").  Was this version of this patch
build tested at all?

I have used the sound and sound-asoc trees from next-20120921 for today.
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpGVRuyloJJJ.pgp
Description: PGP signature


linux-next: build failure after merge of the drm tree

2012-09-23 Thread Stephen Rothwell
Hi Dave,

After merging the drm tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/gpu/drm/i915/intel_hdmi.c: In function 'intel_enable_hdmi':
drivers/gpu/drm/i915/intel_hdmi.c:633:31: error: 'mode' undeclared (first use 
in this function)

Caused by commit b98b60167279 ("drm/i915: HDMI - Clear Audio Enable bit
for Hot Plug") from Linus' tree interacting with commit 5ab432ef4997
("drm/i915/hdmi: convert to encoder->disable/enable") from the drm tree.

I added the following merge fix patch (which may be wrong, of course):

From: Stephen Rothwell 
Date: Mon, 24 Sep 2012 13:14:40 +1000
Subject: [PATCH] drm/i915: HDMI: update for API change

Signed-off-by: Stephen Rothwell 
---
 drivers/gpu/drm/i915/intel_hdmi.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c 
b/drivers/gpu/drm/i915/intel_hdmi.c
index 2ec9c76..d39ed58 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -630,7 +630,7 @@ static void intel_enable_hdmi(struct intel_encoder *encoder)
u32 temp;
u32 enable_bits = SDVO_ENABLE;
 
-   if (intel_hdmi->has_audio || mode != DRM_MODE_DPMS_ON)
+   if (intel_hdmi->has_audio)
enable_bits |= SDVO_AUDIO_ENABLE;
 
temp = I915_READ(intel_hdmi->sdvox_reg);
@@ -676,8 +676,7 @@ static void intel_disable_hdmi(struct intel_encoder 
*encoder)
u32 temp;
u32 enable_bits = SDVO_ENABLE;
 
-   if (intel_hdmi->has_audio)
-   enable_bits |= SDVO_AUDIO_ENABLE;
+   enable_bits |= SDVO_AUDIO_ENABLE;
 
temp = I915_READ(intel_hdmi->sdvox_reg);
 
-- 
1.7.10.280.gaa39

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpeXwKnIlEge.pgp
Description: PGP signature


[PATCH] ARM: gic: fix irq affinity mismatch.

2012-09-23 Thread Chanho Min
Even if we set affinity to multiple cpus via procfs, gic_set_affinity
allows to set one target only. But, '/proc/irq/xxx/smp_affinity' shows
as we are successful in the setting of multiple affinity. Thus irq_data->
affinity mismatches with the GICD_ITARGETSRs.

fix it as bellows.
- Set the default affinity to the boot cpu in gic_dist_init. thereafter,
irq_data->affinity will be set to default 1-bit affinity.
- Even if we write multiple bits to smp_affinity, both irq_data and gic
register will be set one cpu. procfs will show 1 bit affinity as well.

Signed-off-by: Chanho Min 
---
 arch/arm/common/gic.c |   12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index aa52699..fb8ac8e 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -249,6 +249,12 @@ static int gic_set_affinity(struct irq_data *d,
const struct cpumask *mask_val,
writel_relaxed(val | bit, reg);
raw_spin_unlock(_controller_lock);

+   if (cpumask_next_and(cpu, mask_val, cpu_present_mask) < nr_cpu_ids) {
+   cpumask_clear(d->affinity);
+   cpumask_set_cpu(cpu, d->affinity);
+   return IRQ_SET_MASK_OK_NOCOPY;
+   }
+
return IRQ_SET_MASK_OK;
 }
 #endif
@@ -355,6 +361,12 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
cpumask |= cpumask << 8;
cpumask |= cpumask << 16;

+#ifdef CONFIG_SMP
+   /* Set the default affinity to the boot cpu. */
+   cpumask_clear(irq_default_affinity);
+   cpumask_set_cpu(cpu, irq_default_affinity);
+#endif
+
writel_relaxed(0, base + GIC_DIST_CTRL);

/*
-- 
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] Ceph fixes for 3.6

2012-09-23 Thread Sage Weil
Hi Linus,

Please pull the following fixes for Ceph from

  git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git for-linus

The first fixes a leak in the rbd setup error path, and the second fixes a 
more serious problem with mismatched kmap/kunmap that surfaced after the 
recent refactoring work.

Thanks!
sage



Alex Elder (2):
  rbd: drop dev reference on error in rbd_open()
  libceph: only kunmap kmapped pages

 drivers/block/rbd.c  |7 +++
 net/ceph/messenger.c |5 +
 2 files changed, 4 insertions(+), 8 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC PATCH 01/13] ARM: davinci: move private EDMA API to arm/common

2012-09-23 Thread Hebbar, Gururaja
On Thu, Sep 20, 2012 at 20:13:34, Porter, Matt wrote:
> Move mach-davinci/dma.c to common/edma.c so it can be used
> by OMAP (specifically AM33xx atm) as well. This just moves
> the private EDMA API but does not support OMAP.
> 
> Signed-off-by: Matt Porter 
> ---
>  arch/arm/Kconfig   |1 +
>  arch/arm/common/Kconfig|3 +
>  arch/arm/common/Makefile   |1 +
>  arch/arm/common/edma.c | 1588 
> 
>  arch/arm/include/asm/mach/edma.h   |  267 +
>  arch/arm/mach-davinci/Makefile |2 +-
>  arch/arm/mach-davinci/devices.c|3 +-
>  arch/arm/mach-davinci/dm355.c  |2 +-
>  arch/arm/mach-davinci/dm365.c  |2 +-
>  arch/arm/mach-davinci/dm644x.c |2 +-
>  arch/arm/mach-davinci/dm646x.c |2 +-
>  arch/arm/mach-davinci/dma.c| 1588 
> 


>  arch/arm/mach-davinci/include/mach/asp.h   |2 +-

This will clash with patch "ASoC/ARM: Davinci: McASP: split asp header
into platform and audio specific" queued in ASoC tree by Mark Brown 
tree (Auio - ASoC Tree)

I forgot to mention this last time.  Sorry

>  arch/arm/mach-davinci/include/mach/da8xx.h |3 +-
>  arch/arm/mach-davinci/include/mach/edma.h  |  267 -
>  arch/arm/mach-davinci/include/mach/spi.h   |2 +-
>  arch/arm/plat-omap/Kconfig |1 +
>  17 files changed, 1872 insertions(+), 1864 deletions(-)
>  create mode 100644 arch/arm/common/edma.c
>  create mode 100644 arch/arm/include/asm/mach/edma.h
>  delete mode 100644 arch/arm/mach-davinci/dma.c
>  delete mode 100644 arch/arm/mach-davinci/include/mach/edma.h
> 
...snip...
...snip...


Regards, 
Gururaja
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC v4 Patch 0/4] fs/inode.c: optimization for inode lock usage

2012-09-23 Thread Guo Chao
On Sat, Sep 22, 2012 at 08:49:12AM +1000, Dave Chinner wrote:

> On Fri, Sep 21, 2012 at 05:31:02PM +0800, Guo Chao wrote:
> > This patchset optimizes several places which take the per inode spin lock.
> > They have not been fully tested yet, thus they are marked as RFC. 
> 
> Inodes are RCU freed. The i_lock spinlock on the i_state field forms
> part of the memory barrier that allows the RCU read side to
> correctly detect a freed inode during a RCU protected cache lookup
> (hash list traversal for the VFS, or a radix tree traversal for XFS).
> The i_lock usage around the hahs list operations ensures the hash
> list operations are atomic with state changes so that such changes
> are correctly detected during RCU-protected traversals...
> 
> IOWs, removing the i_lock from around the i_state transitions and
> inode hash insert/remove/traversal operations will cause races in
> the RCU lookups and result in incorrectly using freed inodes instead
> of failing the lookup and creating a new one.
> 
> So I don't think this is a good idea at all...
>

Hello, Dave:

  Thanks for your explanation.
 
  Though I can't fully understand it, your concern seems to be that
RCU inode lookup will be bothered by this change. But we do not have 
RCU inode lookup in VFS: inode lookup is done by rather a tranditional
way. 

  XFS gives me the impression that it implements its own inode cache.
There may be such thing there. I have little knowledge on XFS, but I
guess it's unlikely impacted by the change of code implementing VFS 
inode cache.

  As far as I can see, RCU inode free is for RCU dentry lookup, which
seems have nothing to do with 'detect a freed inode'. Taking i_lock in these
places looks like to me a result of following old lock scheme blindly when 
breaking the big global inode lock. Of course, maybe they are there for
something. Could you speak more about the race this change (patch 1,2?) brings 
up? Thank you.

Regards,
Guo Chao

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> da...@fromorbit.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 05/14] userns: Convert hostfs to use kuid and kgid where appropriate

2012-09-23 Thread Eric W. Biederman
Richard Weinberger  writes:

> Am 21.09.2012 02:28, schrieb Eric W. Biederman:
>> From: "Eric W. Biederman" 
>> 
>> Cc: Jeff Dike 
>> Cc: Richard Weinberger 
>> Acked-by: Serge Hallyn 
>> Signed-off-by: Eric W. Biederman 
>> ---
>
> Looks sane to me.
>
> Acked-by: Richard Weinberger 
>
> BTW: How you do test your user namespace patches?
> Is there a generic way to compare/verify uids within a namespace
> vs. the initial namespace?

I start with a well tested set of primites, and a simple design.

Ultimately the goal is to get the conversion functions make_kuid and
from_kuid inserted into the proper locations.

When user namespaces are enabled kuid_t and uid_t are not assignment
compatible so in most places where something needs to be done I get
a compile error.

If the other value is an internal kernel value I change it's type.
If the other value is a userspace or on disk value I insert a conversion
function.

So as a first approximation I can test just by enabling usernamespace
support and compiling the code.

My second line of defense is to keep my patches simple and easily
reviewable.

I impose upon myself the discipline of letting my patches set for a
while so that I review them with a fresh mind before sending them
out to the list.

I am careful when making my patches to actually read the code and
understand what is going on, so hopefully I catch the tricky cases.

With the user namespace support disabled the code performs the same with
except for the conversion functions so things like my conversion of the
core kernel in 3.5 continue to be tested for correctness in general.

Right now for filesystems I am converting them so they will work when
all of the user space interfaces have values coming to the filesystem in
kuid_t and kgid_t, but the values in the filesystem are stored in
the initial user namespace.  So it is trivial to know that I have
useful the correct conversions.

Since my big question is do I have the conversions in all of the
locations needed, compile errors and the discipline of pushing kuid_t
and kgid_t as deep as possible into the kernel data structures as
possible are my primary means of where conversions need to go.

Beyond that I actually run a kernel with all of my patches applied and I
do some spot testing, and I have had my development tree with everything
patched out for a while so that other people can play with it as well.

I also compile test each patch with allyesconfig and with as much
enabled as I can and still leave the usernamespace support enabled,
ensuring each patch is good and safe on it's own (at least compilewise).

So that is how I test.

As to a generic way to compare/verify uids within a namespace vs the
initial namespace hmm.  I don't know that there is a generic tool.  The
mappings are available in /proc//uid_maps, and /proc//gid_maps
so it isn't hard to look to see if the expected conversion is happening
by looking from outside the namespace. But there isn't a generic tool
that I know of at this point.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] drivers/char/tpm: remove tasklet and cleanup

2012-09-23 Thread James Morris
On Wed, 12 Sep 2012, Ashley Lai wrote:

> This patch removed the tasklet and moved the wait queue into the
> private structure.  It also cleaned up the response CRQ path.
> 
> Signed-off-by: Ashley Lai 


Kent: any comment on this?  You should probably push this to me via your 
tree.


> ---
> James,
> 
> This patch is based on your "next" branch.
> git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git
> 
> Thanks,
> Ashley Lai
> ---
>  drivers/char/tpm/tpm_ibmvtpm.c | 81 
> +++---
>  drivers/char/tpm/tpm_ibmvtpm.h |  5 ++-
>  2 files changed, 30 insertions(+), 56 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
> index efc4ab3..88a95ea 100644
> --- a/drivers/char/tpm/tpm_ibmvtpm.c
> +++ b/drivers/char/tpm/tpm_ibmvtpm.c
> @@ -38,8 +38,6 @@ static struct vio_device_id tpm_ibmvtpm_device_table[] 
> __devinitdata = {
>  };
>  MODULE_DEVICE_TABLE(vio, tpm_ibmvtpm_device_table);
>  
> -DECLARE_WAIT_QUEUE_HEAD(wq);
> -
>  /**
>   * ibmvtpm_send_crq - Send a CRQ request
>   * @vdev:vio device struct
> @@ -83,6 +81,7 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, 
> size_t count)
>  {
>   struct ibmvtpm_dev *ibmvtpm;
>   u16 len;
> + int sig;
>  
>   ibmvtpm = (struct ibmvtpm_dev *)chip->vendor.data;
>  
> @@ -91,22 +90,23 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 
> *buf, size_t count)
>   return 0;
>   }
>  
> - wait_event_interruptible(wq, ibmvtpm->crq_res.len != 0);
> + sig = wait_event_interruptible(ibmvtpm->wq, ibmvtpm->res_len != 0);
> + if (sig)
> + return -EINTR;
> +
> + len = ibmvtpm->res_len;
>  
> - if (count < ibmvtpm->crq_res.len) {
> + if (count < len) {
>   dev_err(ibmvtpm->dev,
>   "Invalid size in recv: count=%ld, crq_size=%d\n",
> - count, ibmvtpm->crq_res.len);
> + count, len);
>   return -EIO;
>   }
>  
>   spin_lock(>rtce_lock);
> - memcpy((void *)buf, (void *)ibmvtpm->rtce_buf, ibmvtpm->crq_res.len);
> - memset(ibmvtpm->rtce_buf, 0, ibmvtpm->crq_res.len);
> - ibmvtpm->crq_res.valid = 0;
> - ibmvtpm->crq_res.msg = 0;
> - len = ibmvtpm->crq_res.len;
> - ibmvtpm->crq_res.len = 0;
> + memcpy((void *)buf, (void *)ibmvtpm->rtce_buf, len);
> + memset(ibmvtpm->rtce_buf, 0, len);
> + ibmvtpm->res_len = 0;
>   spin_unlock(>rtce_lock);
>   return len;
>  }
> @@ -273,7 +273,6 @@ static int __devexit tpm_ibmvtpm_remove(struct vio_dev 
> *vdev)
>   int rc = 0;
>  
>   free_irq(vdev->irq, ibmvtpm);
> - tasklet_kill(>tasklet);
>  
>   do {
>   if (rc)
> @@ -372,7 +371,6 @@ static int ibmvtpm_reset_crq(struct ibmvtpm_dev *ibmvtpm)
>  static int tpm_ibmvtpm_resume(struct device *dev)
>  {
>   struct ibmvtpm_dev *ibmvtpm = ibmvtpm_get_data(dev);
> - unsigned long flags;
>   int rc = 0;
>  
>   do {
> @@ -387,10 +385,11 @@ static int tpm_ibmvtpm_resume(struct device *dev)
>   return rc;
>   }
>  
> - spin_lock_irqsave(>lock, flags);
> - vio_disable_interrupts(ibmvtpm->vdev);
> - tasklet_schedule(>tasklet);
> - spin_unlock_irqrestore(>lock, flags);
> + rc = vio_enable_interrupts(ibmvtpm->vdev);
> + if (rc) {
> + dev_err(dev, "Error vio_enable_interrupts rc=%d\n", rc);
> + return rc;
> + }
>  
>   rc = ibmvtpm_crq_send_init(ibmvtpm);
>   if (rc)
> @@ -467,7 +466,7 @@ static struct ibmvtpm_crq *ibmvtpm_crq_get_next(struct 
> ibmvtpm_dev *ibmvtpm)
>   if (crq->valid & VTPM_MSG_RES) {
>   if (++crq_q->index == crq_q->num_entry)
>   crq_q->index = 0;
> - rmb();
> + smp_rmb();
>   } else
>   crq = NULL;
>   return crq;
> @@ -535,11 +534,9 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
>   ibmvtpm->vtpm_version = crq->data;
>   return;
>   case VTPM_TPM_COMMAND_RES:
> - ibmvtpm->crq_res.valid = crq->valid;
> - ibmvtpm->crq_res.msg = crq->msg;
> - ibmvtpm->crq_res.len = crq->len;
> - ibmvtpm->crq_res.data = crq->data;
> - wake_up_interruptible();
> + /* len of the data in rtce buffer */
> + ibmvtpm->res_len = crq->len;
> + wake_up_interruptible(>wq);
>   return;
>   default:
>   return;
> @@ -559,38 +556,19 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
>  static irqreturn_t ibmvtpm_interrupt(int irq, void *vtpm_instance)
>  {
>   struct ibmvtpm_dev *ibmvtpm = (struct ibmvtpm_dev *) vtpm_instance;
> - unsigned long flags;
> -
> - spin_lock_irqsave(>lock, flags);
> - 

[PATCH]scripts:kconfig:meconf: Add Save button to save config at anytime

2012-09-23 Thread Wang YanQing
mconf make me annoying I have to make menuconfig && exit to save
the config when I am tuning .config time by time, it is even
worse I have to search down to my desire submenu time by time.
So I add "Save" button to save our time. With "Save" button,
I can use CRTL-Z after save config, and then use "%" or fg to
resume menuconfig and go on tuning.

Signed-off-by: Wang YanQing 
---
 scripts/kconfig/lxdialog/menubox.c |  7 +--
 scripts/kconfig/mconf.c| 32 +++-
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/lxdialog/menubox.c 
b/scripts/kconfig/lxdialog/menubox.c
index 1d60473..a469f09 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
  *
  **)  A bugfix for the Page-Down problem
  *
- **)  Formerly when I used Page Down and Page Up, the cursor would be set 
+ **)  Formerly when I used Page Down and Page Up, the cursor would be set
  *to the first position in the menu box.  Now lxdialog is a bit
  *smarter and works more like other menu systems (just have a look at
  *it).
@@ -160,6 +160,7 @@ static void print_buttons(WINDOW * win, int height, int 
width, int selected)
print_button(win, gettext("Select"), y, x, selected == 0);
print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
print_button(win, gettext(" Help "), y, x + 24, selected == 2);
+   print_button(win, gettext(" Save "), y, x + 36, selected == 3);
 
wmove(win, y, x + 1 + 12 * selected);
wrefresh(win);
@@ -372,9 +373,11 @@ do_resize:
case TAB:
case KEY_RIGHT:
button = ((key == KEY_LEFT ? --button : ++button) < 0)
-   ? 2 : (button > 2 ? 0 : button);
+   ? 3 : (button > 3 ? 0 : button);
 
print_buttons(dialog, height, width, button);
+   if (button == 3)
+   button = 9;
wrefresh(menu);
break;
case ' ':
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index f584a28..beb5ebf9 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -521,6 +521,7 @@ static void conf(struct menu *menu)
struct symbol *sym;
struct menu *active_menu = NULL;
int res;
+   int yesno;
int s_scroll = 0;
 
while (1) {
@@ -615,6 +616,36 @@ static void conf(struct menu *menu)
case 8:
show_all_options = !show_all_options;
break;
+   case 9:
+   if (!conf_get_changed()) {
+   show_helptext(_("Notice"),
+   _("\n\n"
+   "Your configuration have not 
been changed."
+   "\n\n"));
+   break;
+   }
+
+   yesno = dialog_yesno(NULL,
+   _("Do you wish to save your "
+   "new configuration?\n"
+   " to continue."),
+   6, 60);
+   if (yesno == 0) {
+   if (conf_write(filename)) {
+   show_helptext(_("Notice"),
+   _("\n\n"
+   "Error while writing of 
the configuration.\n"
+   "Your configuration 
changes were NOT saved."
+   "\n\n"));
+   } else {
+   show_helptext(_("Notice"),
+   _("\n\n"
+   "Your configuration 
changes were saved."
+   "\n\n"));
+
+   }
+   }
+   break;
}
}
 }
@@ -879,4 +910,3 @@ int main(int ac, char **av)
 
return res;
 }
-
-- 
1.7.11.1.116.g8228a23

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4] create sun sysfs file

2012-09-23 Thread Yasuaki Ishimatsu
Hi Len,

Ping...
I want you to merge the patch into your tree for linux-3.7.

Thanks,
Yasuaki Ishimatsu

2012/08/30 10:34, Yasuaki Ishimatsu wrote:
> Hi Len,
> 
> Three weeks passed after I post the patch.
> All comments have already been applied to it. And I think there is no
> comments about it. So I want you to merge it into your tree.
> 
> Thanks,
> Yasuaki Ishimatsu
> 
> 2012/08/07 9:36, Yasuaki Ishimatsu wrote:
>> Even if a device has _SUN method, there is no way to know the slot unique-ID.
>> Thus the patch creates "sun" file in sysfs so that we can recognize it.
>>
>> Reviewed-by: Toshi Kani 
>> Signed-off-by: Yasuaki Ishimatsu 
>>
>> ---
>>drivers/acpi/scan.c |   24 
>>include/acpi/acpi_bus.h |1 +
>>2 files changed, 25 insertions(+)
>>
>> Index: linux-3.5/include/acpi/acpi_bus.h
>> ===
>> --- linux-3.5.orig/include/acpi/acpi_bus.h   2012-07-30 10:06:49.722171575 
>> +0900
>> +++ linux-3.5/include/acpi/acpi_bus.h2012-08-07 08:57:45.678204360 
>> +0900
>> @@ -209,6 +209,7 @@ struct acpi_device_pnp {
>>  struct list_head ids;   /* _HID and _CIDs */
>>  acpi_device_name device_name;   /* Driver-determined */
>>  acpi_device_class device_class; /*"  */
>> +unsigned long sun;  /* _SUN */
>>};
>>
>>#define acpi_device_bid(d)((d)->pnp.bus_id)
>> Index: linux-3.5/drivers/acpi/scan.c
>> ===
>> --- linux-3.5.orig/drivers/acpi/scan.c   2012-07-30 10:06:49.713171688 
>> +0900
>> +++ linux-3.5/drivers/acpi/scan.c2012-08-07 09:01:38.196203659 +0900
>> @@ -192,10 +192,20 @@ end:
>>}
>>static DEVICE_ATTR(path, 0444, acpi_device_path_show, NULL);
>>
>> +static ssize_t
>> +acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
>> + char *buf) {
>> +struct acpi_device *acpi_dev = to_acpi_device(dev);
>> +
>> +return sprintf(buf, "%lu\n", acpi_dev->pnp.sun);
>> +}
>> +static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL);
>> +
>>static int acpi_device_setup_files(struct acpi_device *dev)
>>{
>>  acpi_status status;
>>  acpi_handle temp;
>> +unsigned long long sun;
>>  int result = 0;
>>
>>  /*
>> @@ -217,6 +227,16 @@ static int acpi_device_setup_files(struc
>>  goto end;
>>  }
>>
>> +status = acpi_evaluate_integer(dev->handle, "_SUN", NULL, );
>> +if (ACPI_SUCCESS(status)) {
>> +dev->pnp.sun = (unsigned long)sun;
>> +result = device_create_file(>dev, _attr_sun);
>> +if (result)
>> +goto end;
>> +} else {
>> +dev->pnp.sun = (unsigned long)-1;
>> +}
>> +
>>/*
>> * If device has _EJ0, 'eject' file is created that is used to 
>> trigger
>> * hot-removal function from userland.
>> @@ -241,6 +261,10 @@ static void acpi_device_remove_files(str
>>  if (ACPI_SUCCESS(status))
>>  device_remove_file(>dev, _attr_eject);
>>
>> +status = acpi_get_handle(dev->handle, "_SUN", );
>> +if (ACPI_SUCCESS(status))
>> +device_remove_file(>dev, _attr_sun);
>> +
>>  device_remove_file(>dev, _attr_modalias);
>>  device_remove_file(>dev, _attr_hid);
>>  if (dev->handle)
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Thermal: Fix bug on generic thermal framework.

2012-09-23 Thread Jonghwa Lee
When system fails to bind cooling devices to thermal zone device during
registering thermal zone device, it leaves registering without canceling
delayed work. It probably makes panic if polling rate is not enough to release
that work from workqueue. So it is better to ignore initialization of polling
work to prevent that unexpected state.

Signed-off-by: Jonghwa Lee 
---
 drivers/thermal/thermal_sys.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 2ab31e4..744e69d 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1351,12 +1351,14 @@ struct thermal_zone_device 
*thermal_zone_device_register(const char *type,
}
mutex_unlock(_list_lock);
 
+   if (result)
+   goto unregister;
+
INIT_DELAYED_WORK(&(tz->poll_queue), thermal_zone_device_check);
 
thermal_zone_device_update(tz);
 
-   if (!result)
-   return tz;
+   return tz;
 
 unregister:
release_idr(_tz_idr, _idr_lock, tz->id);
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 3.6-rc7

2012-09-23 Thread Stephen Rothwell
On Sun, 23 Sep 2012 18:51:04 -0700 Linus Torvalds 
 wrote:
>
> Ho humm. I really *really* want to say that this is the last -rc, but
> we do have a few small things pending still. So who knows. There may
> be a -rc8, we'll just have to see.

And this means that *everything* destined for the merge window (i.e. 3.7)
should be in linux-next by now and maintainers will spend the new week
just testing what they have (and not unnecessarily rebasing their trees)
and being prepared to inundate Linus as soon as he releases 3.6.   And
pigs might fly :-)

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpCA85V3WCjY.pgp
Description: PGP signature


Linux 3.6-rc7

2012-09-23 Thread Linus Torvalds
Ho humm. I really *really* want to say that this is the last -rc, but
we do have a few small things pending still. So who knows. There may
be a -rc8, we'll just have to see.

That said, nothing here looks really bad. You can get a fairly good
feel for the flavor of fixes form the appended shortlog, and most of
it really is very tiny - oneliners and "fewliners". Nothing really
looks scary, although the powernow-k8/workqueue changes are pretty
core (but fix a bug and actually clean stuff up). I think the biggest
patch is there is an s390 page table walking fix, and even that isn't
really all that big.

So if everything works out well, and the upcoming week is calmer
still, I suspect I can avoid another -rc. Fingers crossed.

Anyway, see below. Most of this is in drivers (net, gpu, infiniband,
block..), architecture code (s390 and x86) and misc (xfs, workqueue,
networking).

It should all be pretty safe to test, so if you have held off because
you're nervous about rc's, please don't. The more testing we get, the
better,

Linus

---

Al Viro (1):
  sh: Fix up TIF_NOTIFY_RESUME sans TIF_SIGPENDING handling.

Alan Cox (1):
  blk: add an upper sanity check on partition adding

Alex Deucher (1):
  Revert "drm/radeon: rework pll selection (v3)"

Andi Kleen (1):
  compiler.h: add __visible

Andreas Herrmann (1):
  hwmon: (fam15h_power) Tweak runavg_range on resume

Andreas Larsson (1):
  sparc32: Enable the relocation target R_SPARC_DISP32 for sparc32

Andrew Vagin (1):
  pid-namespace: limit value of ns_last_pid to (0, max_pid)

Andrey Vagin (1):
  tcp: restore rcv_wscale in a repair mode (v2)

Anisse Astier (1):
  Input: i8042 - disable mux on Toshiba C850D

Arend van Spriel (1):
  brcmsmac: fix mismatch in number of custom regulatory rules

Ariel Elior (1):
  bnx2x: remove false warning regarding interrupt number

Asai Thambi S P (6):
  mtip32xx: Add support for new devices
  mtip32xx: Handle NCQ commands during the security locked state
  mtip32xx: Increase timeout for standby command
  mtip32xx: Proper reporting of write protect status on big-endian
  mtip32xx: Change printk to pr_
  mtip32xx: Remove dead code

Axel Lin (2):
  Input: edt-ft5x06 - return -EFAULT on copy_to_user() error
  HID: lenovo-tpkbd: Fix memory leak in tpkbd_remove_tp()

Ben Myers (1):
  xfs: stop the sync worker before xfs_unmountfs

Bjørn Mork (1):
  net: qmi_wwan: adding Huawei E367, ZTE MF683 and Pantech P4200

Carlos Maiolino (1):
  xfs: fix race while discarding buffers [V4]

Chris Wilson (1):
  drm/i915: Reduce a pin-leak BUG into a WARN

Chuck Lever (1):
  include/net/sock.h: squelch compiler warning in sk_rmem_schedule()

Colin Ian King (1):
  brcm80211: fix missing allocation failure check

Daniel Vetter (1):
  drm/i915: enable lvds pin pairs before dpll on gen2

Dave Airlie (2):
  Revert "drm/nv50-/gpio: initialise to vbios defaults during init"
  drm/nouveau: add dmi quirk for gpio reset

David Milburn (1):
  mtip32xx: fix user_buffer check in exec_drive_command

David Rientjes (1):
  debugfs: fix race in u32_array_read and allocate array at open

Devendra Naga (1):
  at91ether: return PTR_ERR if call to clk_get fails

Dmitry Torokhov (1):
  Revert "input: ab8500-ponkey: Create AB8500 domain IRQ mapping"

Ed L. Cashin (2):
  aoe: assert AoE packets marked as requiring no checksum
  net: do not disable sg for packets requiring no checksum

Eddie Wai (1):
  [SCSI] bnx2i: Fixed NULL ptr deference for 1G bnx2 Linux iSCSI offload

Eric Dumazet (2):
  net: rt_cache_flush() cleanup
  tcp: fix regression in urgent data handling

Fabio Estevam (2):
  Input: imx_keypad - fix missing clk conversions
  ARM: imx: armadillo5x0: Fix illegal register access

Felix Fietkau (1):
  ath9k: make PA linearization optional, disabled by default and fix checks

Fengguang Wu (1):
  edac_mc: fix messy kfree calls in the error path

Fernando Guzman Lugo (1):
  rpmsg: fix dma_free_coherent dev parameter

Forest Bond (1):
  Input: usbtouchscreen - initialize eGalax devices

Francesco Ruggeri (1):
  fs/proc: fix potential unregister_sysctl_table hang

Gang Wei (1):
  MAINTAINERS: fix TXT maintainer list and source repo path

Gerald Schaefer (3):
  s390/mm: fix deadlock in unmap_hugepage_range()
  s390/hugetlb: use direct TLB flushing for hugetlbfs pages
  s390/mm: fix user access page-table walk code

Guenter Roeck (3):
  hwmon: (ads7871) Add 'name' sysfs attribute
  hwmon: (ad7314) Add 'name' sysfs attribute
  linux/kernel.h: Fix warning seen with W=1 due to change in
DIV_ROUND_CLOSEST

Hante Meuleman (2):
  brcmfmac: fix big endian bug in i-scan.
  brcmfmac: Fix big endian host configuration data.

Ira W. Snyder (1):
  can: janz-ican3: fix support for older hardware revisions

Jean-Christophe PLAGNIOL-VILLARD (1):
  ARM: 

linux-next: manual merge of the vfs tree with Linus' tree

2012-09-23 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the vfs tree got a conflict in fs/stat.c
between commit 55815f70147d ("vfs: make O_PATH file descriptors usable
for 'fstat()'") from Linus' tree and commit 19ba95358327 ("switch simple
cases of fget_light to fdget") from the vfs tree.

I just used the vfs tree version and can carry the fix as necessary (no
action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpowxCFvUvtH.pgp
Description: PGP signature


linux-next: manual merge of the vfs tree with the tree

2012-09-23 Thread Stephen Rothwell
Hi Al,

Today's linux-next merge of the vfs tree got a conflict in
kernel/events/core.c between commit a6fa941d94b4 ("perf_event: Switch to
internal refcount, fix race with close()") from Linus' and the vfs trees
and commit 19ba95358327 ("switch simple cases of fget_light to fdget")
from the vfs tree.

I just used the vfs tree version and can carry the fix as necessary (no
action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp9n461WWp0w.pgp
Description: PGP signature


Re: [PATCH] x86: Distinguish TLB shootdown interrupts from other functions call interrupts

2012-09-23 Thread Alex Shi
On 09/20/2012 04:50 PM, Tomoki Sekiyama wrote:

>   unsigned int irq_resched_count;
>   unsigned int irq_call_count;
> + /* irq_tlb_count is double-counted in irq_call_count, so it must be
> +subtracted from irq_call_count when displaying irq_call_count */
>   unsigned int irq_tlb_count;


Review again this patch, above comments is not kernel compatible format.
Could you change it like standard comment format:

/*
 * xxx
 * 
 */

-- 
Thanks
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [2.6.38-3.x] [BUG] soft lockup - CPU#X stuck for 23s! (vfs, autofs, vserver)

2012-09-23 Thread Linus Torvalds
On Sat, Sep 22, 2012 at 11:09 PM, Paweł Sikora  wrote:
>
> br_read_lock(vfsmount_lock);

The vfsmount_lock is a "local-global" lock, where a read-lock is
rather cheap and takes just a per-cpu lock, but the downside is that a
write-lock is *very* expensive, and can cause serious trouble.

And the write lock is taken by the [un]mount() paths. Do *not* do
crazy things. If you do some insane "unmount and remount autofs" on a
1s granularity, you're doing insane things.

Why do you have that 1s timeout? Insane.

  Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] leds: lm3642: Use regmap_update_bits() in lm3642_chip_init()

2012-09-23 Thread gshark

2012년 09월 22일 15:40, Axel Lin 쓴 글:

Use regmap_update_bits() to replace regmap_read() + regmap_write().
With this patch, we only show the error message when regmap_update_bits()
fails.

Looks good..You're right.  Thank you Alex.


Signed-off-by: Axel Lin 

Acked-by: G.Shark Jeong

---
  drivers/leds/leds-lm3642.c |   15 +++
  1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/leds/leds-lm3642.c b/drivers/leds/leds-lm3642.c
index 924853b..3285006 100644
--- a/drivers/leds/leds-lm3642.c
+++ b/drivers/leds/leds-lm3642.c
@@ -95,23 +95,14 @@ struct lm3642_chip_data {
  /* chip initialize */
  static int __devinit lm3642_chip_init(struct lm3642_chip_data *chip)
  {
-   unsigned int reg_val;
int ret;
struct lm3642_platform_data *pdata = chip->pdata;
  
  	/* set enable register */

-   ret = regmap_read(chip->regmap, REG_ENABLE, _val);
+   ret = regmap_update_bits(chip->regmap, REG_ENABLE, EX_PIN_ENABLE_MASK,
+pdata->tx_pin);
if (ret < 0)
-   goto out;
-
-   reg_val &= (~EX_PIN_ENABLE_MASK);
-   reg_val |= pdata->tx_pin;
-   ret = regmap_write(chip->regmap, REG_ENABLE, reg_val);
-   if (ret < 0)
-   goto out;
-
-out:
-   dev_err(chip->dev, "Failed to read REG_ENABLE Register\n");
+   dev_err(chip->dev, "Failed to update REG_ENABLE Register\n");
return ret;
  }
  


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4] KSM: numa awareness sysfs knob

2012-09-23 Thread Petr Holasek
Introduces new sysfs boolean knob /sys/kernel/mm/ksm/merge_across_nodes
which control merging pages across different numa nodes.
When it is set to zero only pages from the same node are merged,
otherwise pages from all nodes can be merged together (default behavior).

Typical use-case could be a lot of KVM guests on NUMA machine
and cpus from more distant nodes would have significant increase
of access latency to the merged ksm page. Sysfs knob was choosen
for higher variability when some users still prefers higher amount
of saved physical memory regardless of access latency.

Every numa node has its own stable & unstable trees because of faster
searching and inserting. Changing of merge_nodes value is possible only
when there are not any ksm shared pages in system.

I've tested this patch on numa machines with 2, 4 and 8 nodes and
measured speed of memory access inside of KVM guests with memory pinned
to one of nodes with this benchmark:

http://pholasek.fedorapeople.org/alloc_pg.c

Population standard deviations of access times in percentage of average
were following:

merge_nodes=1
2 nodes 1.4%
4 nodes 1.6%
8 nodes 1.7%

merge_nodes=0
2 nodes 1%
4 nodes 0.32%
8 nodes 0.018%

RFC: https://lkml.org/lkml/2011/11/30/91
v1: https://lkml.org/lkml/2012/1/23/46
v2: https://lkml.org/lkml/2012/6/29/105
v3: https://lkml.org/lkml/2012/9/14/550

Changelog:

v2: Andrew's objections were reflected:
- value of merge_nodes can't be changed while there are some ksm
pages in system
- merge_nodes sysfs entry appearance depends on CONFIG_NUMA
- more verbose documentation
- added some performance testing results

v3: - more verbose documentation
- fixed race in merge_nodes store function
- introduced share_all debugging knob proposed by Andrew
- minor cleanups

v4: - merge_nodes was renamed to merge_across_nodes
- share_all debug knob was dropped
- get_kpfn_nid helper
- fixed page migration behaviour

Signed-off-by: Petr Holasek 
---
 Documentation/vm/ksm.txt |   7 +++
 mm/ksm.c | 135 ---
 2 files changed, 122 insertions(+), 20 deletions(-)

diff --git a/Documentation/vm/ksm.txt b/Documentation/vm/ksm.txt
index b392e49..100d58d 100644
--- a/Documentation/vm/ksm.txt
+++ b/Documentation/vm/ksm.txt
@@ -58,6 +58,13 @@ sleep_millisecs  - how many milliseconds ksmd should sleep 
before next scan
e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs"
Default: 20 (chosen for demonstration purposes)
 
+merge_nodes  - specifies if pages from different numa nodes can be merged.
+   When set to 0, ksm merges only pages which physically
+   reside in the memory area of same NUMA node. It brings
+   lower latency to access to shared page. Value can be
+   changed only when there is no ksm shared pages in system.
+   Default: 1
+
 run  - set 0 to stop ksmd from running but keep merged pages,
set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run",
set 2 to stop ksmd and unmerge all pages currently merged,
diff --git a/mm/ksm.c b/mm/ksm.c
index 47c8853..7c82032 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include "internal.h"
@@ -140,7 +141,10 @@ struct rmap_item {
unsigned long address;  /* + low bits used for flags below */
unsigned int oldchecksum;   /* when unstable */
union {
-   struct rb_node node;/* when node of unstable tree */
+   struct {
+   struct rb_node node;/* when node of unstable tree */
+   struct rb_root *root;
+   };
struct {/* when listed from stable tree */
struct stable_node *head;
struct hlist_node hlist;
@@ -153,8 +157,8 @@ struct rmap_item {
 #define STABLE_FLAG0x200   /* is listed from the stable tree */
 
 /* The stable and unstable tree heads */
-static struct rb_root root_stable_tree = RB_ROOT;
-static struct rb_root root_unstable_tree = RB_ROOT;
+static struct rb_root root_unstable_tree[MAX_NUMNODES] = { RB_ROOT, };
+static struct rb_root root_stable_tree[MAX_NUMNODES] = { RB_ROOT, };
 
 #define MM_SLOTS_HASH_SHIFT 10
 #define MM_SLOTS_HASH_HEADS (1 << MM_SLOTS_HASH_SHIFT)
@@ -189,6 +193,9 @@ static unsigned int ksm_thread_pages_to_scan = 100;
 /* Milliseconds ksmd should sleep between batches */
 static unsigned int ksm_thread_sleep_millisecs = 20;
 
+/* Zeroed when merging across nodes is not allowed */
+static unsigned int ksm_merge_across_nodes = 1;
+
 #define KSM_RUN_STOP   0
 #define KSM_RUN_MERGE  1
 #define KSM_RUN_UNMERGE2
@@ -447,10 +454,25 @@ out:  page = NULL;
return page;
 }
 

Re: [PATCH 0/2] struct pid-ify autofs4

2012-09-23 Thread Ian Kent
On Fri, 2012-09-21 at 17:44 +0200, Miklos Szeredi wrote:
> Miklos Szeredi  writes:
> 
> > These two patches change autofs4 to store struct pid pointers instead of 
> > pid_t
> > values.
> >
> > Fixed various issues with the previous post.  Not tested, handle with
> > care!
> 
> Customer gave positive test results.

For what exactly, there's no problem description in these patches?

> 
> Thanks,
> Miklos
> 
> >
> > Thanks,
> > Miklos
> > ---
> >
> >
> > Serge Hallyn (1):
> >   autofs4: store struct pids in autofs_waitqs
> >
> > Sukadev Bhattiprolu (1):
> >   Replace pid_t in autofs4 with struct pid reference.
> >
> > ---
> >  fs/autofs4/autofs_i.h  |8 
> >  fs/autofs4/dev-ioctl.c |3 ++-
> >  fs/autofs4/inode.c |   22 +++---
> >  fs/autofs4/waitq.c |   19 +--
> >  4 files changed, 34 insertions(+), 18 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: cifs: fix return value in cifsConvertToUTF16

2012-09-23 Thread Jeff Layton
On Sun, 23 Sep 2012 23:18:19 +0100
Anton Altaparmakov  wrote:

> Hi Steve,
> 
> Hey, I sent you that exact same patch on the 12th June!  Would have saved you 
> and others some valuable time if you hadn't ignored it then!  (-;
> 
> Told you it was an obvious logic bug!  (-;
> 
> Best regards,
> 
>   Anton
> 
> On 22 Sep 2012, at 21:28, Linux Kernel Mailing List 
>  wrote:
> 
> > Gitweb: 
> > http://git.kernel.org/linus/;a=commit;h=c73f693989d7a7d99ec66a7065295a0c93d0b127
> > Commit: c73f693989d7a7d99ec66a7065295a0c93d0b127
> > Parent: 4651afbbae968772efd6dc4ba461cba9b49bb9d8
> > Author: Jeff Layton 
> > AuthorDate: Tue Sep 18 14:21:01 2012 -0400
> > Committer:  Steve French 
> > CommitDate: Tue Sep 18 15:35:25 2012 -0500
> > 
> >cifs: fix return value in cifsConvertToUTF16
> > 
> >This function returns the wrong value, which causes the callers to get
> >the length of the resulting pathname wrong when it contains non-ASCII
> >characters.
> > 
> >This seems to fix https://bugzilla.samba.org/show_bug.cgi?id=6767
> > 
> >Cc: 
> >Reported-by: Baldvin Kovacs 
> >Reported-and-Tested-by: Nicolas Lefebvre 
> >Signed-off-by: Jeff Layton 
> >Signed-off-by: Steve French 
> > ---
> > fs/cifs/cifs_unicode.c |2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
> > index 7dab9c0..53cf2aa 100644
> > --- a/fs/cifs/cifs_unicode.c
> > +++ b/fs/cifs/cifs_unicode.c
> > @@ -328,7 +328,7 @@ cifsConvertToUTF16(__le16 *target, const char *source, 
> > int srclen,
> > }
> > 
> > ctoUTF16_out:
> > -   return i;
> > +   return j;
> > }
> > 
> > #ifdef CONFIG_CIFS_SMB2
> 

My apologies, Anton. I would have just asked Steve to include that
patch instead of reposting it, but I didn't recall seeing you post it
to the list.

-- 
Jeff Layton 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: cifs: fix return value in cifsConvertToUTF16

2012-09-23 Thread Steve French
You are right - this should have gone in 3.5.

Please remind me if you see an important patch not make linux-next (or
equivalently the cifs-2.6.git for-next branch).  I get a big volume of
email.

On Sun, Sep 23, 2012 at 5:18 PM, Anton Altaparmakov  wrote:
> Hi Steve,
>
> Hey, I sent you that exact same patch on the 12th June!  Would have saved you 
> and others some valuable time if you hadn't ignored it then!  (-;
>
> Told you it was an obvious logic bug!  (-;
>
> Best regards,
>
> Anton
>
> On 22 Sep 2012, at 21:28, Linux Kernel Mailing List 
>  wrote:
>
>> Gitweb: 
>> http://git.kernel.org/linus/;a=commit;h=c73f693989d7a7d99ec66a7065295a0c93d0b127
>> Commit: c73f693989d7a7d99ec66a7065295a0c93d0b127
>> Parent: 4651afbbae968772efd6dc4ba461cba9b49bb9d8
>> Author: Jeff Layton 
>> AuthorDate: Tue Sep 18 14:21:01 2012 -0400
>> Committer:  Steve French 
>> CommitDate: Tue Sep 18 15:35:25 2012 -0500
>>
>>cifs: fix return value in cifsConvertToUTF16
>>
>>This function returns the wrong value, which causes the callers to get
>>the length of the resulting pathname wrong when it contains non-ASCII
>>characters.
>>
>>This seems to fix https://bugzilla.samba.org/show_bug.cgi?id=6767
>>
>>Cc: 
>>Reported-by: Baldvin Kovacs 
>>Reported-and-Tested-by: Nicolas Lefebvre 
>>Signed-off-by: Jeff Layton 
>>Signed-off-by: Steve French 
>> ---
>> fs/cifs/cifs_unicode.c |2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
>> index 7dab9c0..53cf2aa 100644
>> --- a/fs/cifs/cifs_unicode.c
>> +++ b/fs/cifs/cifs_unicode.c
>> @@ -328,7 +328,7 @@ cifsConvertToUTF16(__le16 *target, const char *source, 
>> int srclen,
>>   }
>>
>> ctoUTF16_out:
>> - return i;
>> + return j;
>> }
>>
>> #ifdef CONFIG_CIFS_SMB2
>
> --
> Anton Altaparmakov  (replace at with @)
> Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
> Linux NTFS maintainer, http://www.linux-ntfs.org/
>



-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 3.6-rc6

2012-09-23 Thread Notifications
Works fine on my (localized) desktop, except with bootparameter  
"threadirqs" which has not been working since it was introduced.
Jitterlevels are very low now, regular os-jitter is typically below 1 ms.  
(with a low jitter config) Which means audioapps run 1 ms latency, without  
rt-threads, and opengl is very smooth.
I would really love to get that down to 250uS though, after which I don`t  
care.


I also did the low-jitter config on the latest ubuntu-kernel, and wrote a  
little bit about it here.  
http://paradoxuncreated.com/Blog/wordpress/?p=2268


Paece Be With You.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: cifs: fix return value in cifsConvertToUTF16

2012-09-23 Thread Anton Altaparmakov
Hi Steve,

Hey, I sent you that exact same patch on the 12th June!  Would have saved you 
and others some valuable time if you hadn't ignored it then!  (-;

Told you it was an obvious logic bug!  (-;

Best regards,

Anton

On 22 Sep 2012, at 21:28, Linux Kernel Mailing List 
 wrote:

> Gitweb: 
> http://git.kernel.org/linus/;a=commit;h=c73f693989d7a7d99ec66a7065295a0c93d0b127
> Commit: c73f693989d7a7d99ec66a7065295a0c93d0b127
> Parent: 4651afbbae968772efd6dc4ba461cba9b49bb9d8
> Author: Jeff Layton 
> AuthorDate: Tue Sep 18 14:21:01 2012 -0400
> Committer:  Steve French 
> CommitDate: Tue Sep 18 15:35:25 2012 -0500
> 
>cifs: fix return value in cifsConvertToUTF16
> 
>This function returns the wrong value, which causes the callers to get
>the length of the resulting pathname wrong when it contains non-ASCII
>characters.
> 
>This seems to fix https://bugzilla.samba.org/show_bug.cgi?id=6767
> 
>Cc: 
>Reported-by: Baldvin Kovacs 
>Reported-and-Tested-by: Nicolas Lefebvre 
>Signed-off-by: Jeff Layton 
>Signed-off-by: Steve French 
> ---
> fs/cifs/cifs_unicode.c |2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
> index 7dab9c0..53cf2aa 100644
> --- a/fs/cifs/cifs_unicode.c
> +++ b/fs/cifs/cifs_unicode.c
> @@ -328,7 +328,7 @@ cifsConvertToUTF16(__le16 *target, const char *source, 
> int srclen,
>   }
> 
> ctoUTF16_out:
> - return i;
> + return j;
> }
> 
> #ifdef CONFIG_CIFS_SMB2

-- 
Anton Altaparmakov  (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT] kbuild rc fixes

2012-09-23 Thread Michal Marek
Hi Linus,

there are two more kbuild fixes for 3.6. One fixes a race between x86's
archscripts target and the rule (re)building scripts/basic/fixdep. The
second is a fix for the previous attempt at fixing make firmware_install
with make 3.82. This new solution should work with any version of GNU make.

Thanks,
Michal

The following changes since commit 6c7080a61fc7b46b3ac8573952b5a3e9d5f68bc4:

  firmware: fix directory creation rule matching with make 3.82 (2012-08-30 
16:27:13 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git rc-fixes

for you to fetch changes up to 24cc7fb69a5b5edfdff1d38c6a213d6a33648829:

  x86/kbuild: archscripts depends on scripts_basic (2012-09-21 13:49:47 +0200)


Jeff Mahoney (1):
  x86/kbuild: archscripts depends on scripts_basic

Mark Asselstine (1):
  firmware: fix directory creation rule matching with make 3.80

 arch/x86/Makefile   |2 +-
 scripts/Makefile.fwinst |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 05/14] userns: Convert hostfs to use kuid and kgid where appropriate

2012-09-23 Thread Richard Weinberger
Am 21.09.2012 02:28, schrieb Eric W. Biederman:
> From: "Eric W. Biederman" 
> 
> Cc: Jeff Dike 
> Cc: Richard Weinberger 
> Acked-by: Serge Hallyn 
> Signed-off-by: Eric W. Biederman 
> ---

Looks sane to me.

Acked-by: Richard Weinberger 

BTW: How you do test your user namespace patches?
Is there a generic way to compare/verify uids within a namespace vs. the 
initial namespace?

Thanks,
//richard



signature.asc
Description: OpenPGP digital signature


[PATCH v2 1/1] perf stat: implement --big-num grouping

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

In glibc, printf supports ' to group numbers with thousands' grouping
characters. Bionic does not support ' for printf.

Implement thousands's grouping for numbers according to locale.
The implementation uses the algorithm from glibc
(http://www.gnu.org/software/libc/).

Bionic does not implement locales, so we need to add a configuration
option NO_LOCALE. If NO_LOCALE is defined, default values for thousands
separator and grouping are used.

Signed-off-by: Irina Tirdea 
---

Changes in v2:
This is a rewrite of http://lkml.org/lkml/2012/9/13/574
Instead of disabling big num for Android, I added the implementation in perf
(as Ingo suggested).

 tools/perf/Makefile |8 +++
 tools/perf/builtin-stat.c   |  112 ---
 tools/perf/config/feature-tests.mak |   18 ++
 3 files changed, 131 insertions(+), 7 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 5077f8e..74e21cf 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -769,6 +769,14 @@ else
endif
 endif
 
+ifdef NO_LOCALE
+   BASIC_CFLAGS += -DNO_LOCALE
+else
+   ifneq ($(call try-cc,$(SOURCE_LOCALE),),y)
+   BASIC_CFLAGS += -DNO_LOCALE
+   endif
+endif
+
 ifdef ASCIIDOC8
export ASCIIDOC8
 endif
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index e0f65fe..cb8b399 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -60,6 +60,8 @@
 #include 
 #include 
 
+/* max double number have E+308 + \0 + sign */
+#define MAX_NR_STR 310
 #define DEFAULT_SEPARATOR  " "
 #define CNTR_NOT_SUPPORTED ""
 #define CNTR_NOT_COUNTED   ""
@@ -744,18 +746,112 @@ static void print_ll_cache_misses(int cpu,
fprintf(output, " of all LL-cache hits   ");
 }
 
+/* Group the digits according to the grouping rules of the current locale.
+   The interpretation of GROUPING is as in `struct lconv' from .  */
+static int group_number_locale(char *number, char **gnumber)
+{
+   const char *thousands_sep = NULL, *grouping = NULL;
+   int glen, tlen, dest_alloc_size, src_size, ret = 0, cnt;
+   char *dest_alloc_ptr, *dest_end, *src_start, *src_end;
+
+#ifdef NO_LOCALE
+   thousands_sep = ",";
+   grouping = "\x3";
+#else
+   struct lconv *lc = localeconv();
+   if (lc != NULL) {
+   thousands_sep = lc->thousands_sep;
+   grouping = lc->grouping;
+   }
+#endif
+
+   *gnumber = NULL;
+   /* No grouping */
+   if (thousands_sep == NULL || grouping == NULL ||
+   *thousands_sep == '\0' || *grouping == CHAR_MAX || *grouping <= 0) {
+   *gnumber = strdup(number);
+   if (*gnumber == NULL)
+   ret = -ENOMEM;
+   goto out;
+   }
+
+   glen = *grouping++;
+   tlen = strlen(thousands_sep);
+
+   src_size = strlen(number);
+   /* Worst case scenario we have 1-character grouping */
+   dest_alloc_size = (src_size + src_size * tlen) * sizeof(char);
+   dest_alloc_ptr = zalloc(dest_alloc_size);
+   if (dest_alloc_ptr == NULL) {
+   ret = -ENOMEM;
+   goto out;
+   }
+   /* -1 for '\0' */
+   dest_end = dest_alloc_ptr + dest_alloc_size - 1;
+
+   src_start = number;
+   src_end = number + src_size;
+
+   while (src_end > src_start) {
+   *--dest_end = *--src_end;
+   if (--glen == 0 && src_end > src_start) {
+   /* A new group */
+   cnt = tlen;
+   do
+   *--dest_end = thousands_sep[--cnt];
+   while (cnt > 0);
+
+   if (*grouping == CHAR_MAX || *grouping < 0) {
+   /* No further grouping to be done.
+  Copy the rest of the number. */
+   do
+   *--dest_end = *--src_end;
+   while (src_end > src_start);
+   break;
+   } else if (*grouping != '\0') {
+   glen = *grouping++;
+   } else {
+   /* The previous grouping repeats ad infinitum */
+   glen = grouping[-1];
+   }
+   }
+   }
+
+   /* Make a copy with the exact needed size of the grouped number */
+   *gnumber = strdup(dest_end);
+   if (*gnumber == NULL) {
+   ret = -ENOMEM;
+   goto out_free_dest;
+   }
+
+   /* fall through */
+out_free_dest:
+   free(dest_alloc_ptr);
+out:
+   return ret;
+}
+
 static void abs_printout(int cpu, struct perf_evsel *evsel, double avg)
 {
double total, ratio = 0.0;
char cpustr[16] = { '\0', };
const char *fmt;
+   char avgstr[MAX_NR_STR], 

Re: [PATCH 6/7][RFC] netfilter: xt_IDLETIMER: Add new netlink msg type

2012-09-23 Thread Pablo Neira Ayuso
On Fri, Sep 21, 2012 at 10:10:52PM -0400, John Stultz wrote:
> From: JP Abgrall 
> 
> Send notifications when the label becomes active after an idle period.
> Send netlink message notifications in addition to sysfs notifications.
> Using a uevent with
>   subsystem=xt_idletimer
>   INTERFACE=...
>   STATE={active,inactive}
> 
> This is backport from common android-3.0
> commit: beb914e987cbbd368988d2b94a6661cb907c4d5a
> with uevent support instead of a new netlink message type.

I think this can be candidate to be included once some comestical
issues are fixed.

> Cc: net...@vger.kernel.org
> Cc: JP Abgrall 
> Cc: Ashish Sharma 
> Cc: Peter P Waskiewicz Jr 
> Signed-off-by: Ashish Sharma 
> Signed-off-by: JP Abgrall 
> Signed-off-by: John Stultz 
> ---
>  include/linux/netfilter/xt_IDLETIMER.h |8 
>  net/netfilter/xt_IDLETIMER.c   |   78 
> +---
>  2 files changed, 79 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/netfilter/xt_IDLETIMER.h 
> b/include/linux/netfilter/xt_IDLETIMER.h
> index 208ae93..faaa28b 100644
> --- a/include/linux/netfilter/xt_IDLETIMER.h
> +++ b/include/linux/netfilter/xt_IDLETIMER.h
> @@ -4,6 +4,7 @@
>   * Header file for Xtables timer target module.
>   *
>   * Copyright (C) 2004, 2010 Nokia Corporation
> + *

we can live without that extra line above.

>   * Written by Timo Teras 
>   *
>   * Converted to x_tables and forward-ported to 2.6.34
> @@ -32,12 +33,19 @@
>  #include 
>  
>  #define MAX_IDLETIMER_LABEL_SIZE 28
> +#define NLMSG_MAX_SIZE 64

better define this NLMSG_MAX_SIZE inside xt_IDLETIMER.c, this header
is exported to user-space and that definition is not useful.

> +
> +#define NL_EVENT_TYPE_INACTIVE 0
> +#define NL_EVENT_TYPE_ACTIVE 1
>  
>  struct idletimer_tg_info {
>   __u32 timeout;
>  
>   char label[MAX_IDLETIMER_LABEL_SIZE];
>  
> + /* Use netlink messages for notification in addition to sysfs */
> + __u8 send_nl_msg;
> +
>   /* for kernel module internal use only */
>   struct idletimer_tg *timer __attribute__((aligned(8)));
>  };

you have to define two structures:

struct idletimer_tg_info
struct idletimer_tg_info_v1

and register both revisions. This (rudimentary) mechanism allows us to
keep backward compatibility.

See net/netfilter/xt_socket.c for instance.

> diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
> index f407ebc1..df91e26 100644
> --- a/net/netfilter/xt_IDLETIMER.c
> +++ b/net/netfilter/xt_IDLETIMER.c
> @@ -5,6 +5,7 @@
>   * After timer expires a kevent will be sent.
>   *
>   * Copyright (C) 2004, 2010 Nokia Corporation
> + *
>   * Written by Timo Teras 
>   *
>   * Converted to x_tables and reworked for upstream inclusion
> @@ -38,8 +39,10 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
> +#include 
>  
>  struct idletimer_tg_attr {
>   struct attribute attr;
> @@ -56,6 +59,8 @@ struct idletimer_tg {
>   struct idletimer_tg_attr attr;
>  
>   unsigned int refcnt;
> + bool send_nl_msg;
> + bool active;
>  };
>  
>  static LIST_HEAD(idletimer_tg_list);
> @@ -63,6 +68,32 @@ static DEFINE_MUTEX(list_mutex);
>  
>  static struct kobject *idletimer_tg_kobj;
>  
> +static void notify_netlink_uevent(const char *iface, struct idletimer_tg 
> *timer)
> +{
> + char iface_msg[NLMSG_MAX_SIZE];
> + char state_msg[NLMSG_MAX_SIZE];
> + char *envp[] = { iface_msg, state_msg, NULL };
> + int res;
> +
> + res = snprintf(iface_msg, NLMSG_MAX_SIZE, "INTERFACE=%s",
> +iface);
> + if (NLMSG_MAX_SIZE <= res) {
> + pr_err("message too long (%d)", res);
> + return;
> + }
> + res = snprintf(state_msg, NLMSG_MAX_SIZE, "STATE=%s",
> +timer->active ? "active" : "inactive");
> + if (NLMSG_MAX_SIZE <= res) {
> + pr_err("message too long (%d)", res);
> + return;
> + }
> + pr_debug("putting nlmsg: <%s> <%s>\n", iface_msg, state_msg);
> + kobject_uevent_env(idletimer_tg_kobj, KOBJ_CHANGE, envp);
> + return;
> +
> +

extra lines.

> +}
> +
>  static
>  struct idletimer_tg *__idletimer_tg_find_by_label(const char *label)
>  {
> @@ -83,6 +114,7 @@ static ssize_t idletimer_tg_show(struct kobject *kobj, 
> struct attribute *attr,
>  {
>   struct idletimer_tg *timer;
>   unsigned long expires = 0;
> + unsigned long now = jiffies;
>  
>   mutex_lock(_mutex);
>  
> @@ -92,11 +124,15 @@ static ssize_t idletimer_tg_show(struct kobject *kobj, 
> struct attribute *attr,
>  
>   mutex_unlock(_mutex);
>  
> - if (time_after(expires, jiffies))
> + if (time_after(expires, now))
>   return sprintf(buf, "%u\n",
> -jiffies_to_msecs(expires - jiffies) / 1000);
> +jiffies_to_msecs(expires - now) / 1000);
>  
> - return sprintf(buf, "0\n");
> + if (timer->send_nl_msg)
> + return 

Re: [PATCH v2] lis3lv02d: Add STMicroelectronics lis331dlh digital accelerometer

2012-09-23 Thread Éric Piel

On 22-08-12 08:30, AnilKumar Ch wrote:

This patch adds support for lis331dlh digital accelerometer to the
lis3lv02d driver family. Adds ID field for detecting the lis331dlh
module, based on this ID field lis3lv02d driver will export the
lis331dlh module functionality.


Hello AnilKumar,

Sorry for taking so long to review your patch. Overall, it looks great :-)

There are just a few points that almost code-style/comment that needs to 
be fixed. See below. Could you fix these small issues, and submit a new 
patch for Andrew to pick it in his queue?


Here is my:
Reviewed-by: Éric Piel 




Signed-off-by: AnilKumar Ch 
---
Changes from v1:
- Removed G range sysfs entry from v1
- Modified documentation to specify lis331dlh is supported

  Documentation/misc-devices/lis3lv02d   |3 ++-
  drivers/misc/lis3lv02d/lis3lv02d.c |   42 +-
  drivers/misc/lis3lv02d/lis3lv02d.h |   44 +++-
  drivers/misc/lis3lv02d/lis3lv02d_i2c.c |7 -
  4 files changed, 87 insertions(+), 9 deletions(-)

diff --git a/Documentation/misc-devices/lis3lv02d 
b/Documentation/misc-devices/lis3lv02d
index f1a4ec8..af815b9 100644
--- a/Documentation/misc-devices/lis3lv02d
+++ b/Documentation/misc-devices/lis3lv02d
@@ -4,7 +4,8 @@ Kernel driver lis3lv02d
  Supported chips:

* STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision)
-  * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits)
+  * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits) and
+LIS331DLH (16 bits)

  Authors:
  Yan Burman 
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
b/drivers/misc/lis3lv02d/lis3lv02d.c
index 29d12a7..c0a9199 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -80,6 +80,14 @@
  #define LIS3_SENSITIVITY_12B  ((LIS3_ACCURACY * 1000) / 1024)
  #define LIS3_SENSITIVITY_8B   (18 * LIS3_ACCURACY)

+/*
+ * LIS3331DLH spec says 1LSBs corresponds 4G/1024 -> 1LSB is 1000/1024 mG.
+ * Sensitivity values for +/-2G, outdata in 12 bits for +/-2G scale. so 4
+ * bits adjustment is required
+ */
+#define LIS3DLH_SENSITIVITY_2G ((LIS3_ACCURACY * 1000) / 1024)
+#define SHIFT_ADJ_2G   4
+

You said later:


Typo mistake this should be 4G/4096

Could you fix the comment. Even better, change LIS3331DLH to LIS331DLH

Also, if I understand correctly, there is currently no support for 
changing the sensitivity. It stays at 2G all the time, right? In such 
case, please add a sentence in this comment that the driver does only 
support the 2G sensitivity for now.




  #define LIS3_DEFAULT_FUZZ_12B 3
  #define LIS3_DEFAULT_FLAT_12B 3
  #define LIS3_DEFAULT_FUZZ_8B  1
@@ -133,6 +141,19 @@ static s16 lis3lv02d_read_12(struct lis3lv02d *lis3, int 
reg)
return (s16)((hi << 8) | lo);
  }

+/* 12bits for 2G range, 13 bits for 4G range and 14 bits for 8G range */
+static s16 lis3lv02d_read_16(struct lis3lv02d *lis3, int reg)
+{
+   u8 lo, hi;
+   int v;
+
+   lis3->read(lis3, reg - 1, );
+   lis3->read(lis3, reg, );
+   v = (int) ((hi << 8) | lo);
+
+   return (s16) v >> lis3->shift_adj;
+}
As the method reads 12, 13, or 14 bits, it's a bit tricky to call it 
"*_read_16". I'd suggest maybe "lis3lv02d_read_12_14", 
"lis3lv02d_read_adj_16", or even "lis331dlh_read_data". Pick the one you 
prefer :-)





  /**
   * lis3lv02d_get_axis - For the given axis, give the value converted
   * @axis:  1,2,3 - can also be negative
@@ -193,6 +214,7 @@ static void lis3lv02d_get_xyz(struct lis3lv02d *lis3, int 
*x, int *y, int *z)
  static int lis3_12_rates[4] = {40, 160, 640, 2560};
  static int lis3_8_rates[2] = {100, 400};
  static int lis3_3dc_rates[16] = {0, 1, 10, 25, 50, 100, 200, 400, 1600, 5000};
+static int lis3_3dlh_rates[4] = {50, 100, 400, 1000};

  /* ODR is Output Data Rate */
  static int lis3lv02d_get_odr(struct lis3lv02d *lis3)
@@ -265,7 +287,7 @@ static int lis3lv02d_selftest(struct lis3lv02d *lis3, s16 
results[3])
(LIS3_IRQ1_DATA_READY | LIS3_IRQ2_DATA_READY));
}

-   if (lis3->whoami == WAI_3DC) {
+   if ((lis3->whoami == WAI_3DC) || (lis3->whoami == WAI_3DLH)) {
ctlreg = CTRL_REG4;
selftest = CTRL4_ST0;
} else {
@@ -396,9 +418,17 @@ int lis3lv02d_poweron(struct lis3lv02d *lis3)
lis3->read(lis3, CTRL_REG2, );
if (lis3->whoami ==  WAI_12B)
reg |= CTRL2_BDU | CTRL2_BOOT;
+   else if (lis3->whoami ==  WAI_3DLH)
+   reg |= CTRL2_BOOT_3DLH;
else
reg |= CTRL2_BOOT_8B;
lis3->write(lis3, CTRL_REG2, reg);
+
+   if (lis3->whoami ==  WAI_3DLH) {
+   lis3->read(lis3, CTRL_REG4, );
+   reg |= CTRL4_BDU;
+   lis3->write(lis3, 

Re: Fwd: [PATCH 1/14] drivers/media/platform/soc_camera/soc_camera.c: fix error return code

2012-09-23 Thread Guennadi Liakhovetski
Hi Mauro, Peter

On Sun, 23 Sep 2012, Mauro Carvalho Chehab wrote:

> Please review.
> Please review.
> 
> Regards,
> Mauro.
> 
>  Mensagem original 
> Assunto: [PATCH 1/14] drivers/media/platform/soc_camera/soc_camera.c: fix 
> error return code
> Data: Thu,  6 Sep 2012 17:24:00 +0200
> De: Peter Senna Tschudin 
> Para: Mauro Carvalho Chehab 
> CC: kernel-janit...@vger.kernel.org, julia.law...@lip6.fr, 
> linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org
> 
> From: Peter Senna Tschudin 
> 
> Convert a nonnegative error return code to a negative one, as returned
> elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // 
> (
> if@p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
> when != 
> *if(...)
> {
>   ... when != ret = e2
>   when forall
>  return ret;
> }
> 
> // 
> 
> Signed-off-by: Peter Senna Tschudin 
> 
> ---
>  drivers/media/platform/soc_camera/soc_camera.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/soc_camera/soc_camera.c 
> b/drivers/media/platform/soc_camera/soc_camera.c
> index 10b57f8..a4beb6c 100644
> --- a/drivers/media/platform/soc_camera/soc_camera.c
> +++ b/drivers/media/platform/soc_camera/soc_camera.c
> @@ -1184,7 +1184,8 @@ static int soc_camera_probe(struct soc_camera_device 
> *icd)
>   sd->grp_id = soc_camera_grp_id(icd);
>   v4l2_set_subdev_hostdata(sd, icd);
>  
> - if (v4l2_ctrl_add_handler(>ctrl_handler, sd->ctrl_handler))
> + ret = v4l2_ctrl_add_handler(>ctrl_handler, sd->ctrl_handler);
> + if (ret)
>   goto ectrl;

Yes, this is a correct fix. I'm actually also fixing it in one of my 
current experimental patches, I don't think it's occurring too often in 
real life, so, I didn't bother sending a separate fix:-) But yes, let's 
fix it properly. Please, update the other patch to mx2_camera and I'll 
send a "fixes" pull request with these two and an ov2640 fix.

Thanks
Guennadi

>  
>   /* At this point client .probe() should have run already */

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/7][RFC] netfilter: add xt_qtaguid matching module

2012-09-23 Thread Pablo Neira Ayuso
Hi John,

Cc'ing netfilter-devel (better than only netdev, to attract the
attention from other Netfilter hacker fellows).

Some comments on this:

On Fri, Sep 21, 2012 at 10:10:48PM -0400, John Stultz wrote:
> From: JP Abgrall 
> 
> This module allows tracking stats at the socket level for given UIDs.
> It replaces xt_owner.
> If the --uid-owner is not specified, it will just count stats based on
> who the skb belongs to. This will even happen on incoming skbs as it
> looks into the skb via xt_socket magic to see who owns it.
> If an skb is lost, it will be assigned to uid=0.
> 
> To control what sockets of what UIDs are tagged by what, one uses:
>   echo t $sock_fd $accounting_tag $the_billed_uid \
>  > /proc/net/xt_qtaguid/ctrl
>  So whenever an skb belongs to a sock_fd, it will be accounted against
>$the_billed_uid
>   and matching stats will show up under the uid with the given
>$accounting_tag.
> 
> Because the number of allocations for the stats structs is not that big:
>   ~500 apps * 32 per app
> we'll just do it atomic. This avoids walking lists many times, and
> the fancy worker thread handling. Slabs will grow when needed later.
> 
> It use netdevice and inetaddr notifications instead of hooks in the core dev
> code to track when a device comes and goes. This removes the need for
> exposed iface_stat.h.
> 
> Put procfs dirs in /proc/net/xt_qtaguid/
>   ctrl
>   stats
>   iface_stat//...
> The uid stats are obtainable in ./stats.

Unless I'm missing anything worth in this patch, this seems to me like
a combo match of owner + nfacct infrastructure.

I guess you can probably get all done with one single rule, but that
is not enough to justify its inclusion in mainline.

In case you are not familiar with the nfacct infrastructure:

http://lwn.net/Articles/472094/

I'd be happy anyway if you provide more examples on you use this, so I
can assure you we can do this with the existing infrastructure in
mainstream.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fwd: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error return code

2012-09-23 Thread Guennadi Liakhovetski
Hi Peter

Thanks for the patch, but I think it can be improved:

On Sun, 23 Sep 2012, Mauro Carvalho Chehab wrote:

> Please review,
> 
> Regards,
> Mauro.
> 
> 
>  Mensagem original 
> Assunto: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix 
> error return code
> Data: Thu,  6 Sep 2012 17:23:59 +0200
> De: Peter Senna Tschudin 
> Para: Mauro Carvalho Chehab 
> CC: kernel-janit...@vger.kernel.org, julia.law...@lip6.fr, 
> linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org
> 
> From: Peter Senna Tschudin 
> 
> Convert a nonnegative error return code to a negative one, as returned
> elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // 
> (
> if@p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
> when != 
> *if(...)
> {
>   ... when != ret = e2
>   when forall
>  return ret;
> }
> 
> // 
> 
> Signed-off-by: Peter Senna Tschudin 
> 
> ---
>  drivers/media/platform/soc_camera/mx2_camera.c |5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/soc_camera/mx2_camera.c 
> b/drivers/media/platform/soc_camera/mx2_camera.c
> index 256187f..f8884a7 100644
> --- a/drivers/media/platform/soc_camera/mx2_camera.c
> +++ b/drivers/media/platform/soc_camera/mx2_camera.c
> @@ -1800,13 +1800,16 @@ static int __devinit mx2_camera_probe(struct 
> platform_device *pdev)
>  
>   if (!res_emma || !irq_emma) {
>   dev_err(>dev, "no EMMA resources\n");
> + err = -ENODEV;
>   goto exit_free_irq;
>   }
>  
>   pcdev->res_emma = res_emma;
>   pcdev->irq_emma = irq_emma;
> - if (mx27_camera_emma_init(pcdev))
> + if (mx27_camera_emma_init(pcdev)) {
> + err = -ENODEV;

I think, propagating the error, returned by mx27_camera_emma_init() to the 
caller would be better, than using -ENODEV.

Thanks
Guennadi

>   goto exit_free_irq;
> + }
>   }
>  
>   pcdev->soc_host.drv_name= MX2_CAM_DRV_NAME,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] leds: add led_trigger_rename function

2012-09-23 Thread Fabio Baltieri
Hello Bryan,

On Sat, Sep 15, 2012 at 06:18:44PM +0200, Fabio Baltieri wrote:
> Implements a "led_trigger_rename" function to rename a trigger with
> proper locking.
> 
> This assumes that led name was originally allocated in non-constant
> storage.

Did you have any chance to review this patch?

I'm interested into getting some opinion for this feature for use in
another patches currently in a can-next branch.

Thanks,
Fabio

-- 
Fabio Baltieri
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kexec/kdump kernel fails to start

2012-09-23 Thread Yinghai Lu
On Sun, Sep 23, 2012 at 1:27 PM, Dan Carpenter  wrote:
> On Wed, Sep 05, 2012 at 11:34:25PM +0800, Cong Wang wrote:
>> On Wed, Sep 5, 2012 at 1:32 AM, Flavio Leitner  wrote:
>> > Hi folks,
>> >
>> > I have system that no longer boots kdump kernel. Basically,
>> >
>> > # echo c > /proc/sysrq-trigger
>> >
>> > to dump a vmcore doesn't work. It just hangs after showing the usual
>> > panic messages. I've bisected the problem and the commit introducing
>> > the issue is the one below.
>> >
>> > Any idea?
>> >
>> > commit 722bc6b16771ed80871e1fd81c86d3627dda2ac8
>> > Author: WANG Cong   2012-03-05 20:05:13
>> > Committer: Ingo Molnar   2012-03-06 05:38:26
>> > Parent: 550cf00dbc8ee402bef71628cb71246493dd4500 (Merge tag 
>> > 'mmc-fixes-for-3.3' of 
>> > git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc)
>> > Child:  a6fca40f1d7f3e232c9de27c1cebbb9f787fbc4f (x86, tlb: Switch cr3 in 
>> > leave_mm() only when needed)
>> > Branches: master, remotes/origin/master
>> > Follows: v3.3-rc6
>> > Precedes: v3.5-rc1
>> >
>> > x86/mm: Fix the size calculation of mapping tables
>>
>> There was some attempt to fix this:
>> https://patchwork.kernel.org/patch/1195751/
>>
>> but for some reason it is not accepted.
>
> I filed a bug for this:
> https://bugzilla.kernel.org/show_bug.cgi?id=47881
>
> Is it fixed now?

that offending patch should be reverted...

722bc6b16771ed80871e1fd81c86d3627dda2ac8
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-23 Thread Konrad Rzeszutek Wilk
On Fri, Sep 21, 2012 at 11:27:00AM -0700, Yinghai Lu wrote:
> On Fri, Sep 21, 2012 at 9:50 AM, Konrad Rzeszutek Wilk
>  wrote:
> > On Wed, Sep 19, 2012 at 10:49:00AM -0700, Yinghai Lu wrote:
> >
> > Can you include the stack trace?
> 
> [  414.997281] pci_bus :00: freeing pci_bus info
> [  415.017221]  pci:00: freeing pci_host_bridge info
> [  415.017468] general protection fault:  [#1] SMP
> [  415.036758] Modules linked in:
> [  415.036959] CPU 0
> [  415.037051] Pid: 4, comm: kworker/0:0 Not tainted
> 3.6.0-rc6-yh-03463-gbcab6f1-dirty #303 Oracle Corporation  Sun Fire
> X4800 M2 /
> [  415.056989] RIP: 0010:[]  []
> __release_resource+0x11/0x3e
> [  415.076854] RSP: 0018:883f4cea39f0  EFLAGS: 00010206
> [  415.077112] RAX: 0d30 RBX: 897ea6cd4070 RCX: 
> 8c6318c6318c6320
> [  415.097000] RDX: 883f9d60e190 RSI: 8265f228 RDI: 
> 897ea6cd4070
> [  415.116627] RBP: 883f4cea39f0 R08: 0005 R09: 
> 810755de
> [  415.116953] R10: 81e2e7df R11:  R12: 
> 0002
> [  415.136790] R13: 897ea6d18600 R14: 826f18c0 R15: 
> 883f9d60d800
> [  415.156541] FS:  () GS:883f9d60()
> knlGS:
> [  415.156953] CS:  0010 DS:  ES:  CR0: 8005003b
> [  415.176622] CR2: 00619718 CR3: 0263f000 CR4: 
> 07f0
> [  415.196401] DR0:  DR1:  DR2: 
> 
> [  415.196761] DR3:  DR6: 0ff0 DR7: 
> 0400
> [  415.216702] Process kworker/0:0 (pid: 4, threadinfo
> 883f4cea2000, task 883f4cea8000)
> [  415.236370] Stack:
> [  415.236475]  883f4cea3a20 810755e6 883f4cea3a60
> 883f
> [  415.236866]  824884ad 88fea6ce2440 883f4cea3a40
> 81c2cfc5
> [  415.256682]  88bf4a1ec800 88bf4a1ec800 883f4cea3a50
> 81c2d023
> [  415.276452] Call Trace:
> [  415.276611]  [] release_resource+0x25/0x3e
> [  415.296206]  [] __release_pci_root_info+0x35/0x7e
> [  415.296556]  [] release_pci_root_info+0x15/0x1a
> [  415.316249]  [] pci_release_bus_bridge_dev+0x37/0x4f
> [  415.316581]  [] device_release+0x93/0xcb
> [  415.336365]  [] kobject_release+0x51/0x67
> [  415.33]  [] kobject_put+0x4a/0x4e
> [  415.361466]  [] put_device+0x17/0x19
> [  415.361734]  [] pci_remove_root_bus+0x5a/0x64
> [  415.376188]  [] acpi_pci_root_remove+0xeb/0x114
> [  415.376509]  [] acpi_device_remove+0x86/0xa5
> [  415.396230]  [] __device_release_driver+0x86/0xdc
> [  415.396551]  [] device_release_driver+0x25/0x32
> [  415.416198]  [] acpi_bus_trim+0x86/0x110
> [  415.416473]  [] handle_root_bridge_removal+0x4f/0x118
> [  415.436227]  [] _handle_hotplug_event_root+0xe1/0x121
> [  415.455957]  [] process_one_work+0x28a/0x453
> [  415.456228]  [] ? process_one_work+0x1f5/0x453
> [  415.475980]  [] ? handle_root_bridge_removal+0x118/0x118
> [  415.476311]  [] worker_thread+0x12a/0x201
> [  415.495995]  [] ? manage_workers+0xed/0xed
> [  415.496301]  [] kthread+0xe7/0xef
> [  415.515957]  [] ? _raw_spin_unlock_irq+0x2e/0x33
> [  415.516257]  [] kernel_thread_helper+0x4/0x10
> [  415.535926]  [] ? retint_restore_args+0xe/0xe
> [  415.536242]  [] ? __init_kthread_worker+0x5a/0x5a
> [  415.555959]  [] ? gs_change+0xb/0xb
> [  415.556209] Code: 48 89 31 48 89 46 20 31 c0 eb 0d 48 39 7a 08 48
> 8d 4a 28 72 da 48 89 d0 5d c3 66 66 66 66 90 48 8b 47 20 55 48 89 e5
> 48 83 c0 30 <48> 8b 10 48 85 d2 74 1e 48 39 fa 75 13 48 8b 57 28 48 89
> 10 48
> [  415.596509] RIP  [] __release_resource+0x11/0x3e
> [  415.615741]  RSP 
> [  415.616020] ---[ end trace 8bcbc1bea9c3e0bc ]---
> 
> whole log is attached.

I meant it (and a filtered with just the valid lines in it) in terms of the 
patch commit description.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c: Replace kmemdup for kstrdup

2012-09-23 Thread Mauro Carvalho Chehab
Em Mon, 10 Sep 2012 14:45:54 +0200
Peter Senna Tschudin  escreveu:

> From: Peter Senna Tschudin 
> 
> Replace kmemdup for kstrdup and cleaning up the code.
> 
> Signed-off-by: Peter Senna Tschudin 

Maintainers/interested parties not copied. Also:

Hunk #1 succeeded at 708 (offset 1 line).
Hunk #2 FAILED at 742.
1 out of 2 hunks FAILED -- saving rejects to file 
drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c.rej
 tmp/cx25821-video-upstream-ch2.c |   27 +--
 1 file changed, 9 insertions(+), 18 deletions(-)

> 
> ---
> It depends on the patch http://patchwork.linuxtv.org/patch/14231/
> 
>  tmp/cx25821-video-upstream-ch2.c |   27 +--
>  1 file changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c 
> b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
> index 273df94..b663dac 100644
> --- a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c
> +++ b/tmp/cx25821-video-upstream-ch2.c
> @@ -707,7 +707,6 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, 
> int channel_select,
>   int err = 0;
>   int data_frame_size = 0;
>   int risc_buffer_size = 0;
> - int str_length = 0;
>  
>   if (dev->_is_running_ch2) {
>   pr_info("Video Channel is still running so return!\n");
> @@ -743,24 +742,16 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev 
> *dev, int channel_select,
>   risc_buffer_size = dev->_isNTSC_ch2 ?
>   NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE;
>  
> - if (dev->input_filename_ch2) {
> - str_length = strlen(dev->input_filename_ch2);
> - dev->_filename_ch2 = kmemdup(dev->input_filename_ch2,
> -  str_length + 1, GFP_KERNEL);
> -
> - if (!dev->_filename_ch2) {
> - err = -ENOENT;
> - goto error;
> - }
> - } else {
> - str_length = strlen(dev->_defaultname_ch2);
> - dev->_filename_ch2 = kmemdup(dev->_defaultname_ch2,
> -  str_length + 1, GFP_KERNEL);
> + if (dev->input_filename_ch2)
> + dev->_filename_ch2 = kstrdup(dev->input_filename_ch2,
> + GFP_KERNEL);
> + else
> + dev->_filename_ch2 = kstrdup(dev->_defaultname_ch2,
> + GFP_KERNEL);
>  
> - if (!dev->_filename_ch2) {
> - err = -ENOENT;
> - goto error;
> - }
> + if (!dev->_filename_ch2) {
> + err = -ENOENT;
> + goto error;
>   }
>  
>   /* Default if filename is empty string */
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kexec/kdump kernel fails to start

2012-09-23 Thread Dan Carpenter
On Wed, Sep 05, 2012 at 11:34:25PM +0800, Cong Wang wrote:
> On Wed, Sep 5, 2012 at 1:32 AM, Flavio Leitner  wrote:
> > Hi folks,
> >
> > I have system that no longer boots kdump kernel. Basically,
> >
> > # echo c > /proc/sysrq-trigger
> >
> > to dump a vmcore doesn't work. It just hangs after showing the usual
> > panic messages. I've bisected the problem and the commit introducing
> > the issue is the one below.
> >
> > Any idea?
> >
> > commit 722bc6b16771ed80871e1fd81c86d3627dda2ac8
> > Author: WANG Cong   2012-03-05 20:05:13
> > Committer: Ingo Molnar   2012-03-06 05:38:26
> > Parent: 550cf00dbc8ee402bef71628cb71246493dd4500 (Merge tag 
> > 'mmc-fixes-for-3.3' of 
> > git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc)
> > Child:  a6fca40f1d7f3e232c9de27c1cebbb9f787fbc4f (x86, tlb: Switch cr3 in 
> > leave_mm() only when needed)
> > Branches: master, remotes/origin/master
> > Follows: v3.3-rc6
> > Precedes: v3.5-rc1
> >
> > x86/mm: Fix the size calculation of mapping tables
> 
> There was some attempt to fix this:
> https://patchwork.kernel.org/patch/1195751/
> 
> but for some reason it is not accepted.

I filed a bug for this:
https://bugzilla.kernel.org/show_bug.cgi?id=47881

Is it fixed now?

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] uprobes: Introduce copy_opcode(), kill read_opcode()

2012-09-23 Thread Oleg Nesterov
No functional changes, preparations.

1. Extract the kmap-and-memcpy code from read_opcode() into the
   new trivial helper, copy_opcode(). The next patch will add
   another user.

2. read_opcode() becomes really trivial, fold it into its single
   caller, is_swbp_at_addr().

3. Remove "auprobe" argument from write_opcode(), it is not used
   since f403072c6.

Signed-off-by: Oleg Nesterov 
---
 kernel/events/uprobes.c |   63 ++
 1 files changed, 19 insertions(+), 44 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 04f3259..100a920 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -183,19 +183,25 @@ bool __weak is_swbp_insn(uprobe_opcode_t *insn)
return *insn == UPROBE_SWBP_INSN;
 }
 
+static void copy_opcode(struct page *page, unsigned long vaddr, 
uprobe_opcode_t *opcode)
+{
+   void *kaddr = kmap_atomic(page);
+   memcpy(opcode, kaddr + (vaddr & ~PAGE_MASK), UPROBE_SWBP_INSN_SIZE);
+   kunmap_atomic(kaddr);
+}
+
 /*
  * NOTE:
  * Expect the breakpoint instruction to be the smallest size instruction for
  * the architecture. If an arch has variable length instruction and the
  * breakpoint instruction is not of the smallest length instruction
- * supported by that architecture then we need to modify read_opcode /
+ * supported by that architecture then we need to modify is_swbp_at_addr and
  * write_opcode accordingly. This would never be a problem for archs that
  * have fixed length instructions.
  */
 
 /*
  * write_opcode - write the opcode at a given virtual address.
- * @auprobe: arch breakpointing information.
  * @mm: the probed process address space.
  * @vaddr: the virtual address to store the opcode.
  * @opcode: opcode to be written at @vaddr.
@@ -206,8 +212,8 @@ bool __weak is_swbp_insn(uprobe_opcode_t *insn)
  * For mm @mm, write the opcode at @vaddr.
  * Return 0 (success) or a negative errno.
  */
-static int write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
-   unsigned long vaddr, uprobe_opcode_t opcode)
+static int write_opcode(struct mm_struct *mm, unsigned long vaddr,
+   uprobe_opcode_t opcode)
 {
struct page *old_page, *new_page;
void *vaddr_old, *vaddr_new;
@@ -253,40 +259,9 @@ put_old:
return ret;
 }
 
-/**
- * read_opcode - read the opcode at a given virtual address.
- * @mm: the probed process address space.
- * @vaddr: the virtual address to read the opcode.
- * @opcode: location to store the read opcode.
- *
- * Called with mm->mmap_sem held (for read and with a reference to
- * mm.
- *
- * For mm @mm, read the opcode at @vaddr and store it in @opcode.
- * Return 0 (success) or a negative errno.
- */
-static int read_opcode(struct mm_struct *mm, unsigned long vaddr, 
uprobe_opcode_t *opcode)
-{
-   struct page *page;
-   void *vaddr_new;
-   int ret;
-
-   ret = get_user_pages(NULL, mm, vaddr, 1, 0, 1, , NULL);
-   if (ret <= 0)
-   return ret;
-
-   vaddr_new = kmap_atomic(page);
-   vaddr &= ~PAGE_MASK;
-   memcpy(opcode, vaddr_new + vaddr, UPROBE_SWBP_INSN_SIZE);
-   kunmap_atomic(vaddr_new);
-
-   put_page(page);
-
-   return 0;
-}
-
 static int is_swbp_at_addr(struct mm_struct *mm, unsigned long vaddr)
 {
+   struct page *page;
uprobe_opcode_t opcode;
int result;
 
@@ -300,14 +275,14 @@ static int is_swbp_at_addr(struct mm_struct *mm, unsigned 
long vaddr)
goto out;
}
 
-   result = read_opcode(mm, vaddr, );
-   if (result)
+   result = get_user_pages(NULL, mm, vaddr, 1, 0, 1, , NULL);
+   if (result < 0)
return result;
-out:
-   if (is_swbp_insn())
-   return 1;
 
-   return 0;
+   copy_opcode(page, vaddr, );
+   put_page(page);
+ out:
+   return is_swbp_insn();
 }
 
 /**
@@ -321,7 +296,7 @@ out:
  */
 int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, 
unsigned long vaddr)
 {
-   return write_opcode(auprobe, mm, vaddr, UPROBE_SWBP_INSN);
+   return write_opcode(mm, vaddr, UPROBE_SWBP_INSN);
 }
 
 /**
@@ -345,7 +320,7 @@ set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct 
*mm, unsigned long v
if (result != 1)
return result;
 
-   return write_opcode(auprobe, mm, vaddr, *(uprobe_opcode_t 
*)auprobe->insn);
+   return write_opcode(mm, vaddr, *(uprobe_opcode_t *)auprobe->insn);
 }
 
 static int match_uprobe(struct uprobe *l, struct uprobe *r)
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: WARNING: at block/genhd.c:1570 disk_clear_events+0xbf/0xd0()

2012-09-23 Thread Dan Carpenter
Hi,

I have created a bug for this:
https://bugzilla.kernel.org/show_bug.cgi?id=47871

Please add the following information:
*) Last known good kernel version
*) Current broken kernel version
*) Complete dmesg

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/4] uprobes: remove is_swbp_at_addr() from register/unregister

2012-09-23 Thread Oleg Nesterov
Hello.

1. the usage of is_swbp_at_addr() is confusing. This series tries
   to answer the questions we got during the discussion about
   powerpc port which has multiple trap insns.

   Ananth, please review too ;) at least the changelog in 1/4.

   Note: the changelog doesn't mention is_swbp_insn(). If powerpc
   wants to change it, we need 2 helpers for verify_opcode() and
   for is_swbp_at_addr().

2. This is also preparation for the pre-filtering I am working on.

   In particular, this series tries to make clear the fact that
   register/unregister should be "idempotent".

Oleg.

 kernel/events/uprobes.c |  165 +--
 1 files changed, 59 insertions(+), 106 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] uprobes: Kill set_orig_insn()->is_swbp_at_addr()

2012-09-23 Thread Oleg Nesterov
Unlike set_swbp(), set_orig_insn()->is_swbp_at_addr() makes sense,
although it can't prevent all confusions.

But the usage of is_swbp_at_addr() is equally confusing, and it adds
the extra get_user_pages() we can avoid.

This patch removes set_orig_insn()->is_swbp_at_addr() but changes
write_opcode() to do the necessary checks before replace_page().

Perhaps it also makes sense to ensure PAGE_MAPPING_ANON in unregister
case.

find_active_uprobe() becomes the only user of is_swbp_at_addr(),
we can change its semantics.

Signed-off-by: Oleg Nesterov 
---
 kernel/events/uprobes.c |   32 +++-
 1 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 100a920..17454fb 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -190,6 +190,25 @@ static void copy_opcode(struct page *page, unsigned long 
vaddr, uprobe_opcode_t
kunmap_atomic(kaddr);
 }
 
+static int verify_opcode(struct page *page, unsigned long vaddr, 
uprobe_opcode_t *new_opcode)
+{
+   uprobe_opcode_t old_opcode;
+   bool is_swbp;
+
+   copy_opcode(page, vaddr, _opcode);
+   is_swbp = is_swbp_insn(_opcode);
+
+   if (is_swbp_insn(new_opcode)) {
+   if (is_swbp)/* register: already installed? */
+   return 0;
+   } else {
+   if (!is_swbp)   /* unregister: was it changed by us? */
+   return -EINVAL;
+   }
+
+   return 1;
+}
+
 /*
  * NOTE:
  * Expect the breakpoint instruction to be the smallest size instruction for
@@ -226,6 +245,10 @@ retry:
if (ret <= 0)
return ret;
 
+   ret = verify_opcode(old_page, vaddr, );
+   if (ret <= 0)
+   goto put_old;
+
ret = -ENOMEM;
new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vaddr);
if (!new_page)
@@ -311,15 +334,6 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct 
mm_struct *mm, unsigned
 int __weak
 set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long 
vaddr)
 {
-   int result;
-
-   result = is_swbp_at_addr(mm, vaddr);
-   if (!result)
-   return -EINVAL;
-
-   if (result != 1)
-   return result;
-
return write_opcode(mm, vaddr, *(uprobe_opcode_t *)auprobe->insn);
 }
 
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] uprobes: Simplify is_swbp_at_addr(), remove stale comments

2012-09-23 Thread Oleg Nesterov
After the previous change is_swbp_at_addr() is always called with
current->mm. Remove this check and move it close to its single caller.

Also, remove the obsolete comment about is_swbp_at_addr() and
uprobe_state.count.

Signed-off-by: Oleg Nesterov 
---
 kernel/events/uprobes.c |   73 +++---
 1 files changed, 24 insertions(+), 49 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 17454fb..a741ba7 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -282,32 +282,6 @@ put_old:
return ret;
 }
 
-static int is_swbp_at_addr(struct mm_struct *mm, unsigned long vaddr)
-{
-   struct page *page;
-   uprobe_opcode_t opcode;
-   int result;
-
-   if (current->mm == mm) {
-   pagefault_disable();
-   result = __copy_from_user_inatomic(, (void __user*)vaddr,
-   sizeof(opcode));
-   pagefault_enable();
-
-   if (likely(result == 0))
-   goto out;
-   }
-
-   result = get_user_pages(NULL, mm, vaddr, 1, 0, 1, , NULL);
-   if (result < 0)
-   return result;
-
-   copy_opcode(page, vaddr, );
-   put_page(page);
- out:
-   return is_swbp_insn();
-}
-
 /**
  * set_swbp - store breakpoint at a given address.
  * @auprobe: arch specific probepoint information.
@@ -589,29 +563,6 @@ static int copy_insn(struct uprobe *uprobe, struct file 
*filp)
return __copy_insn(mapping, filp, uprobe->arch.insn, bytes, 
uprobe->offset);
 }
 
-/*
- * How mm->uprobes_state.count gets updated
- * uprobe_mmap() increments the count if
- * - it successfully adds a breakpoint.
- * - it cannot add a breakpoint, but sees that there is a underlying
- *   breakpoint (via a is_swbp_at_addr()).
- *
- * uprobe_munmap() decrements the count if
- * - it sees a underlying breakpoint, (via is_swbp_at_addr)
- *   (Subsequent uprobe_unregister wouldnt find the breakpoint
- *   unless a uprobe_mmap kicks in, since the old vma would be
- *   dropped just after uprobe_munmap.)
- *
- * uprobe_register increments the count if:
- * - it successfully adds a breakpoint.
- *
- * uprobe_unregister decrements the count if:
- * - it sees a underlying breakpoint and removes successfully.
- *   (via is_swbp_at_addr)
- *   (Subsequent uprobe_munmap wouldnt find the breakpoint
- *   since there is no underlying breakpoint after the
- *   breakpoint removal.)
- */
 static int
 install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
struct vm_area_struct *vma, unsigned long vaddr)
@@ -1389,6 +1340,30 @@ static void mmf_recalc_uprobes(struct mm_struct *mm)
clear_bit(MMF_HAS_UPROBES, >flags);
 }
 
+static int is_swbp_at_addr(struct mm_struct *mm, unsigned long vaddr)
+{
+   struct page *page;
+   uprobe_opcode_t opcode;
+   int result;
+
+   pagefault_disable();
+   result = __copy_from_user_inatomic(, (void __user*)vaddr,
+   sizeof(opcode));
+   pagefault_enable();
+
+   if (likely(result == 0))
+   goto out;
+
+   result = get_user_pages(NULL, mm, vaddr, 1, 0, 1, , NULL);
+   if (result < 0)
+   return result;
+
+   copy_opcode(page, vaddr, );
+   put_page(page);
+ out:
+   return is_swbp_insn();
+}
+
 static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
 {
struct mm_struct *mm = current->mm;
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] uprobes: Kill set_swbp()->is_swbp_at_addr()

2012-09-23 Thread Oleg Nesterov
A separate patch for better documentation.

set_swbp()->is_swbp_at_addr() is not needed for correctness, it is
harmless to do the unnecessary __replace_page(old_page, new_page)
when these 2 pages are identical.

And it can not be counted as optimization. mmap/register races are
very unlikely, while in the likely case is_swbp_at_addr() adds the
extra get_user_pages() even if the caller is uprobe_mmap(current->mm)
and returns false.

Note also that the semantics/usage of is_swbp_at_addr() in uprobe.c
is confusing. set_swbp() uses it to detect the case when this insn
was already modified by uprobes, that is why it should always compare
the opcode with UPROBE_SWBP_INSN even if the hardware (like powerpc)
has other trap insns. It doesn't matter if this "int3" was in fact
installed by gdb or application itself, we are going to "steal" this
breakpoint anyway and execute the original insn from vm_file even if
it no longer matches the memory.

OTOH, handle_swbp()->find_active_uprobe() uses is_swbp_at_addr() to
figure out whether we need to send SIGTRAP or not if we can not find
uprobe, so in this case it should return true for all trap variants,
not only for UPROBE_SWBP_INSN.

This patch removes set_swbp()->is_swbp_at_addr(), the next patches
will remove it from set_orig_insn() which is similar to set_swbp()
in this respect. So the only caller will be handle_swbp() and we
can make its semantics clear.

Signed-off-by: Oleg Nesterov 
---
 kernel/events/uprobes.c |   11 ---
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 78364a2..04f3259 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -321,17 +321,6 @@ out:
  */
 int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, 
unsigned long vaddr)
 {
-   int result;
-   /*
-* See the comment near uprobes_hash().
-*/
-   result = is_swbp_at_addr(mm, vaddr);
-   if (result == 1)
-   return 0;
-
-   if (result)
-   return result;
-
return write_opcode(auprobe, mm, vaddr, UPROBE_SWBP_INSN);
 }
 
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/5] video: msm: Remove useless mach/* includes

2012-09-23 Thread Florian Tobias Schandinat
On 09/19/2012 07:00 AM, Stephen Boyd wrote:
> This driver doesn't need to use these mach includes so remove
> them. This is a necessary step to support a single zImage.
> 
> Cc: Florian Tobias Schandinat 
> Signed-off-by: Stephen Boyd 

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/msm/mddi.c   | 3 ---
>  drivers/video/msm/mdp.c| 1 -
>  drivers/video/msm/mdp_hw.h | 1 -
>  3 files changed, 5 deletions(-)
> 
> diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
> index b061d70..d43e178 100644
> --- a/drivers/video/msm/mddi.c
> +++ b/drivers/video/msm/mddi.c
> @@ -26,9 +26,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
> -#include 
> -#include 
>  #include 
>  #include "mddi_hw.h"
>  
> diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c
> index cb2ddf1..752eff7 100644
> --- a/drivers/video/msm/mdp.c
> +++ b/drivers/video/msm/mdp.c
> @@ -25,7 +25,6 @@
>  #include 
>  #include 
>  
> -#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/video/msm/mdp_hw.h b/drivers/video/msm/mdp_hw.h
> index d804774..2a84137 100644
> --- a/drivers/video/msm/mdp_hw.h
> +++ b/drivers/video/msm/mdp_hw.h
> @@ -15,7 +15,6 @@
>  #ifndef _MDP_HW_H_
>  #define _MDP_HW_H_
>  
> -#include 
>  #include 
>  
>  struct mdp_info {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/10] drivers/video/mb862xx/mb862xxfbdrv.c: fix error return code

2012-09-23 Thread Florian Tobias Schandinat
Applied all 10 patches of this series.


Thanks,

Florian Tobias Schandinat


On 09/18/2012 12:07 PM, Peter Senna Tschudin wrote:
> From: Peter Senna Tschudin 
> 
> Convert a nonnegative error return code to a negative one, as returned
> elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // 
> (
> if@p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
> when != 
> *if(...)
> {
>   ... when != ret = e2
>   when forall
>  return ret;
> }
> // 
> 
> Signed-off-by: Peter Senna Tschudin 
> ---
>  drivers/video/mb862xx/mb862xxfbdrv.c | 10 +++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c 
> b/drivers/video/mb862xx/mb862xxfbdrv.c
> index 57d940b..d68e332 100644
> --- a/drivers/video/mb862xx/mb862xxfbdrv.c
> +++ b/drivers/video/mb862xx/mb862xxfbdrv.c
> @@ -1052,12 +1052,14 @@ static int __devinit mb862xx_pci_probe(struct pci_dev 
> *pdev,
>   break;
>   default:
>   /* should never occur */
> + ret = -EIO;
>   goto rel_reg;
>   }
>  
>   par->fb_base = ioremap(par->fb_base_phys, par->mapped_vram);
>   if (par->fb_base == NULL) {
>   dev_err(dev, "Cannot map framebuffer\n");
> + ret = -EIO;
>   goto rel_reg;
>   }
>  
> @@ -1073,11 +1075,13 @@ static int __devinit mb862xx_pci_probe(struct pci_dev 
> *pdev,
>   dev_dbg(dev, "mmio phys 0x%llx 0x%lx\n",
>   (unsigned long long)par->mmio_base_phys, (ulong)par->mmio_len);
>  
> - if (mb862xx_pci_gdc_init(par))
> + ret = mb862xx_pci_gdc_init(par);
> + if (ret)
>   goto io_unmap;
>  
> - if (request_irq(par->irq, mb862xx_intr, IRQF_SHARED,
> - DRV_NAME, (void *)par)) {
> + ret = request_irq(par->irq, mb862xx_intr, IRQF_SHARED,
> +   DRV_NAME, (void *)par);
> + if (ret) {
>   dev_err(dev, "Cannot request irq\n");
>   goto io_unmap;
>   }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 4/4] perf tools: configure addr2line path at compile time

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

The default name for addr2line is hardcoded to "addr2line".
When cross-compiling the name of addr2line will be different
(e.g. arm-eabi-addr2line in Android).

Set the default addr2line name in the Makefile with DEFAULT_ADDR2LINE_PATH.

Signed-off-by: Irina Tirdea 
---

Changes in v3:
 () Fixed typo in commit message.

 tools/perf/Makefile|6 +-
 tools/perf/util/annotate.c |3 ++-
 tools/perf/util/sort.c |2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7a3f572..745d12b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -141,6 +141,7 @@ endif
 lib = lib
 PERF_TMP_DIR = /tmp
 OBJDUMP = $(CROSS_COMPILE)objdump
+ADDR2LINE = $(CROSS_COMPILE)addr2line
 
 export prefix bindir sharedir sysconfdir
 
@@ -885,7 +886,7 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c 
$(OUTPUT)PERF-CFLAGS
$<
 
 $(OUTPUT)util/annotate.o: util/annotate.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_OBJDUMP_PATH='"$(OBJDUMP)"' $<
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_OBJDUMP_PATH='"$(OBJDUMP)"' -DDEFAULT_ADDR2LINE_PATH='"$(ADDR2LIN)"' 
$<
 
 $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
@@ -896,6 +897,9 @@ $(OUTPUT)util/dso-test-data.o: util/dso-test-data.c 
$(OUTPUT)PERF-CFLAGS
 $(OUTPUT)util/map.o: util/map.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
+$(OUTPUT)util/sort.o: util/sort.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_ADDR2LINE_PATH='"$(addr2line)"' $<
+
 $(OUTPUT)util/symbol.o: util/symbol.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index d7036b3..7734a03 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -915,7 +915,8 @@ static int symbol__get_source_line(struct symbol *sym, 
struct map *map,
continue;
 
offset = start + i;
-   sprintf(cmd, "addr2line -e %s %016" PRIx64, filename, offset);
+   sprintf(cmd, DEFAULT_ADDR2LINE_PATH " -e %s %016" PRIx64,
+   filename, offset);
fp = popen(cmd, "r");
if (!fp)
continue;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index b5b1b92..357dfc8 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -260,7 +260,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry 
*self, char *bf,
if (path != NULL)
goto out_path;
 
-   snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64,
+   snprintf(cmd, sizeof(cmd), DEFAULT_ADDR2LINE_PATH " -e %s %016" PRIx64,
 self->ms.map->dso->long_name, self->ip);
fp = popen(cmd, "r");
if (!fp)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] fbdev: jz4740: Use devm_request_and_ioremap

2012-09-23 Thread Florian Tobias Schandinat
On 09/09/2012 03:38 PM, Lars-Peter Clausen wrote:
> Use devm_request_and_ioremap instead of request_mem_region + devm_ioremap.
> 
> This also fixes the following compile error introduced in commit b2ca7f4d
> ("drivers/video/jz4740_fb.c: use devm_ functions"):
> 
> drivers/video/jz4740_fb.c: In function 'jzfb_probe':
>   drivers/video/jz4740_fb.c:676:2: error: implicit declaration of 
> function 'devm_ioremap'
>   drivers/video/jz4740_fb.c:676:13: warning: assignment makes pointer 
> from integer without a cast
> 
> Signed-off-by: Lars-Peter Clausen 

Applied. Thanks for pointing this out and fixing it.


Best regards,

Florian Tobias Schandinat

> ---
>  drivers/video/jz4740_fb.c |   24 +++-
>  1 files changed, 3 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
> index 7669770..b0df279 100644
> --- a/drivers/video/jz4740_fb.c
> +++ b/drivers/video/jz4740_fb.c
> @@ -632,23 +632,10 @@ static int __devinit jzfb_probe(struct platform_device 
> *pdev)
>   return -ENXIO;
>   }
>  
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!mem) {
> - dev_err(>dev, "Failed to get register memory resource\n");
> - return -ENXIO;
> - }
> -
> - mem = request_mem_region(mem->start, resource_size(mem), pdev->name);
> - if (!mem) {
> - dev_err(>dev, "Failed to request register memory 
> region\n");
> - return -EBUSY;
> - }
> -
>   fb = framebuffer_alloc(sizeof(struct jzfb), >dev);
>   if (!fb) {
>   dev_err(>dev, "Failed to allocate framebuffer device\n");
> - ret = -ENOMEM;
> - goto err_release_mem_region;
> + return -ENOMEM;
>   }
>  
>   fb->fbops = _ops;
> @@ -657,7 +644,6 @@ static int __devinit jzfb_probe(struct platform_device 
> *pdev)
>   jzfb = fb->par;
>   jzfb->pdev = pdev;
>   jzfb->pdata = pdata;
> - jzfb->mem = mem;
>  
>   jzfb->ldclk = devm_clk_get(>dev, "lcd");
>   if (IS_ERR(jzfb->ldclk)) {
> @@ -673,9 +659,9 @@ static int __devinit jzfb_probe(struct platform_device 
> *pdev)
>   goto err_framebuffer_release;
>   }
>  
> - jzfb->base = devm_ioremap(>dev, mem->start, resource_size(mem));
> + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + jzfb->base = devm_request_and_ioremap(>dev, mem);
>   if (!jzfb->base) {
> - dev_err(>dev, "Failed to ioremap register memory 
> region\n");
>   ret = -EBUSY;
>   goto err_framebuffer_release;
>   }
> @@ -736,8 +722,6 @@ err_free_devmem:
>   jzfb_free_devmem(jzfb);
>  err_framebuffer_release:
>   framebuffer_release(fb);
> -err_release_mem_region:
> - release_mem_region(mem->start, resource_size(mem));
>   return ret;
>  }
>  
> @@ -750,8 +734,6 @@ static int __devexit jzfb_remove(struct platform_device 
> *pdev)
>   jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
>   jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
>  
> - release_mem_region(jzfb->mem->start, resource_size(jzfb->mem));
> -
>   fb_dealloc_cmap(>fb->cmap);
>   jzfb_free_devmem(jzfb);
>  

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/10] drivers/video/sis/initextlfb.c: removes unnecessary semicolon

2012-09-23 Thread Florian Tobias Schandinat
On 09/06/2012 04:09 PM, Peter Senna Tschudin wrote:
> From: Peter Senna Tschudin 
> 
> removes unnecessary semicolon
> 
> Found by Coccinelle: http://coccinelle.lip6.fr/
> 
> Signed-off-by: Peter Senna Tschudin 

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/sis/initextlfb.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/video/sis/initextlfb.c b/drivers/video/sis/initextlfb.c
> --- a/drivers/video/sis/initextlfb.c
> +++ b/drivers/video/sis/initextlfb.c
> @@ -65,7 +65,7 @@ sisfb_mode_rate_to_dclock(struct SiS_Pri
>  }
>  #endif
>  
> -if(!(SiS_SearchModeID(SiS_Pr, , ))) {;
> +if(!(SiS_SearchModeID(SiS_Pr, , ))) {
> printk(KERN_ERR "Could not find mode %x\n", ModeNo);
> return 65000;
>  }
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] video: mbxfb: Include linux/io.h instead of asm/io.h

2012-09-23 Thread Florian Tobias Schandinat
On 08/31/2012 01:39 PM, Axel Lin wrote:
> This fixes below build error:
> 
>   CC [M]  drivers/video/mbx/mbxfb.o
> drivers/video/mbx/mbxfb.c: In function 'mbxfb_probe':
> drivers/video/mbx/mbxfb.c:942:2: error: implicit declaration of function 
> 'devm_ioremap_nocache' [-Werror=implicit-function-declaration]
> drivers/video/mbx/mbxfb.c:942:22: warning: assignment makes pointer from 
> integer without a cast [enabled by default]
> drivers/video/mbx/mbxfb.c:952:21: warning: assignment makes pointer from 
> integer without a cast [enabled by default]
> cc1: some warnings being treated as errors
> 
> Signed-off-by: Axel Lin 

Applied. Thanks for pointing this out and fixing it.


Best regards,

Florian Tobias Schandinat

> ---
>  drivers/video/mbx/mbxfb.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
> index 9229acf..6563e50 100644
> --- a/drivers/video/mbx/mbxfb.c
> +++ b/drivers/video/mbx/mbxfb.c
> @@ -26,8 +26,7 @@
>  #include 
>  #include 
>  #include 
> -
> -#include 
> +#include 
>  
>  #include 
>  

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fwd: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error return code

2012-09-23 Thread Mauro Carvalho Chehab
Please review,

Regards,
Mauro.


 Mensagem original 
Assunto: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error 
return code
Data: Thu,  6 Sep 2012 17:23:59 +0200
De: Peter Senna Tschudin 
Para: Mauro Carvalho Chehab 
CC: kernel-janit...@vger.kernel.org, julia.law...@lip6.fr, 
linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org

From: Peter Senna Tschudin 

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// 
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != 
*if(...)
{
  ... when != ret = e2
  when forall
 return ret;
}

// 

Signed-off-by: Peter Senna Tschudin 

---
 drivers/media/platform/soc_camera/mx2_camera.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/mx2_camera.c 
b/drivers/media/platform/soc_camera/mx2_camera.c
index 256187f..f8884a7 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -1800,13 +1800,16 @@ static int __devinit mx2_camera_probe(struct 
platform_device *pdev)
 
if (!res_emma || !irq_emma) {
dev_err(>dev, "no EMMA resources\n");
+   err = -ENODEV;
goto exit_free_irq;
}
 
pcdev->res_emma = res_emma;
pcdev->irq_emma = irq_emma;
-   if (mx27_camera_emma_init(pcdev))
+   if (mx27_camera_emma_init(pcdev)) {
+   err = -ENODEV;
goto exit_free_irq;
+   }
}
 
pcdev->soc_host.drv_name= MX2_CAM_DRV_NAME,

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




Fwd: [PATCH 1/14] drivers/media/platform/soc_camera/soc_camera.c: fix error return code

2012-09-23 Thread Mauro Carvalho Chehab
Please review.
Please review.

Regards,
Mauro.

 Mensagem original 
Assunto: [PATCH 1/14] drivers/media/platform/soc_camera/soc_camera.c: fix error 
return code
Data: Thu,  6 Sep 2012 17:24:00 +0200
De: Peter Senna Tschudin 
Para: Mauro Carvalho Chehab 
CC: kernel-janit...@vger.kernel.org, julia.law...@lip6.fr, 
linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org

From: Peter Senna Tschudin 

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// 
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != 
*if(...)
{
  ... when != ret = e2
  when forall
 return ret;
}

// 

Signed-off-by: Peter Senna Tschudin 

---
 drivers/media/platform/soc_camera/soc_camera.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera.c 
b/drivers/media/platform/soc_camera/soc_camera.c
index 10b57f8..a4beb6c 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1184,7 +1184,8 @@ static int soc_camera_probe(struct soc_camera_device *icd)
sd->grp_id = soc_camera_grp_id(icd);
v4l2_set_subdev_hostdata(sd, icd);
 
-   if (v4l2_ctrl_add_handler(>ctrl_handler, sd->ctrl_handler))
+   ret = v4l2_ctrl_add_handler(>ctrl_handler, sd->ctrl_handler);
+   if (ret)
goto ectrl;
 
/* At this point client .probe() should have run already */

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




Re: [PATCH] video: Remove pnx4008 driver

2012-09-23 Thread Florian Tobias Schandinat
On 08/26/2012 02:23 PM, Roland Stigge wrote:
> This patch removes the video driver for pnx4008. The architecture is being
> removed via the arm-soc tree.
> 
> Signed-off-by: Roland Stigge 

Applied as it doesn't make sense to keep it around if there is no
architecture left that can use it. Though I didn't get any technical
reason why the architecture is removed at all, just reasons why it might
be okay to do so. But it doesn't matter as I don't have to decide this
anyway.


Best regards,

Florian Tobias Schandinat

> ---
>  drivers/video/Kconfig|   15 
>  drivers/video/Makefile   |2 
>  drivers/video/pnx4008/Makefile   |7 
>  drivers/video/pnx4008/dum.h  |  211 -
>  drivers/video/pnx4008/fbcommon.h |   43 -
>  drivers/video/pnx4008/pnxrgbfb.c |  198 
>  drivers/video/pnx4008/sdum.c |  861 
> ---
>  drivers/video/pnx4008/sdum.h |  136 --
>  8 files changed, 1473 deletions(-)
> 
> --- linux-2.6.orig/drivers/video/Kconfig
> +++ linux-2.6/drivers/video/Kconfig
> @@ -2151,21 +2151,6 @@ config FB_UDL
> mplayer -vo fbdev. Supports all USB 2.0 era DisplayLink devices.
> To compile as a module, choose M here: the module name is udlfb.
>  
> -config FB_PNX4008_DUM
> - tristate "Display Update Module support on Philips PNX4008 board"
> - depends on FB && ARCH_PNX4008
> - ---help---
> -   Say Y here to enable support for PNX4008 Display Update Module (DUM)
> -
> -config FB_PNX4008_DUM_RGB
> - tristate "RGB Framebuffer support on Philips PNX4008 board"
> - depends on FB_PNX4008_DUM
> - select FB_CFB_FILLRECT
> - select FB_CFB_COPYAREA
> - select FB_CFB_IMAGEBLIT
> - ---help---
> -   Say Y here to enable support for PNX4008 RGB Framebuffer
> -
>  config FB_IBM_GXT4500
>   tristate "Framebuffer support for IBM GXT4500P adaptor"
>   depends on FB && PPC
> --- linux-2.6.orig/drivers/video/Makefile
> +++ linux-2.6/drivers/video/Makefile
> @@ -128,8 +128,6 @@ obj-$(CONFIG_FB_S3C)+= s3c-fb.o
>  obj-$(CONFIG_FB_S3C2410)   += s3c2410fb.o
>  obj-$(CONFIG_FB_FSL_DIU)   += fsl-diu-fb.o
>  obj-$(CONFIG_FB_COBALT)   += cobalt_lcdfb.o
> -obj-$(CONFIG_FB_PNX4008_DUM)   += pnx4008/
> -obj-$(CONFIG_FB_PNX4008_DUM_RGB)  += pnx4008/
>  obj-$(CONFIG_FB_IBM_GXT4500)   += gxt4500.o
>  obj-$(CONFIG_FB_PS3)   += ps3fb.o
>  obj-$(CONFIG_FB_SM501)+= sm501fb.o
> --- linux-2.6.orig/drivers/video/pnx4008/Makefile
> +++ /dev/null
> @@ -1,7 +0,0 @@
> -#
> -# Makefile for the new PNX4008 framebuffer device driver
> -#
> -
> -obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o
> -obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnxrgbfb.o
> -
> --- linux-2.6.orig/drivers/video/pnx4008/dum.h
> +++ /dev/null
> @@ -1,211 +0,0 @@
> -/*
> - * linux/drivers/video/pnx4008/dum.h
> - *
> - * Internal header for SDUM
> - *
> - * 2005 (c) Koninklijke Philips N.V. This file is licensed under
> - * the terms of the GNU General Public License version 2. This program
> - * is licensed "as is" without any warranty of any kind, whether express
> - * or implied.
> - */
> -
> -#ifndef __PNX008_DUM_H__
> -#define __PNX008_DUM_H__
> -
> -#include 
> -
> -#define PNX4008_DUMCONF_VA_BASE  IO_ADDRESS(PNX4008_DUMCONF_BASE)
> -#define PNX4008_DUM_MAIN_VA_BASE IO_ADDRESS(PNX4008_DUM_MAINCFG_BASE)
> -
> -/* DUM CFG ADDRESSES */
> -#define DUM_CH_BASE_ADR  (PNX4008_DUMCONF_VA_BASE + 0x00)
> -#define DUM_CH_MIN_ADR   (PNX4008_DUMCONF_VA_BASE + 0x00)
> -#define DUM_CH_MAX_ADR   (PNX4008_DUMCONF_VA_BASE + 0x04)
> -#define DUM_CH_CONF_ADR  (PNX4008_DUMCONF_VA_BASE + 0x08)
> -#define DUM_CH_STAT_ADR  (PNX4008_DUMCONF_VA_BASE + 0x0C)
> -#define DUM_CH_CTRL_ADR  (PNX4008_DUMCONF_VA_BASE + 0x10)
> -
> -#define CH_MARG  (0x100 / sizeof(u32))
> -#define DUM_CH_MIN(i)(*((volatile u32 *)DUM_CH_MIN_ADR + (i) * 
> CH_MARG))
> -#define DUM_CH_MAX(i)(*((volatile u32 *)DUM_CH_MAX_ADR + (i) * 
> CH_MARG))
> -#define DUM_CH_CONF(i)   (*((volatile u32 *)DUM_CH_CONF_ADR + (i) * 
> CH_MARG))
> -#define DUM_CH_STAT(i)   (*((volatile u32 *)DUM_CH_STAT_ADR + (i) * 
> CH_MARG))
> -#define DUM_CH_CTRL(i)   (*((volatile u32 *)DUM_CH_CTRL_ADR + (i) * 
> CH_MARG))
> -
> -#define DUM_CONF_ADR  (PNX4008_DUM_MAIN_VA_BASE + 0x00)
> -#define DUM_CTRL_ADR  (PNX4008_DUM_MAIN_VA_BASE + 0x04)
> -#define DUM_STAT_ADR  (PNX4008_DUM_MAIN_VA_BASE + 0x08)
> -#define DUM_DECODE_ADR(PNX4008_DUM_MAIN_VA_BASE + 0x0C)
> -#define DUM_COM_BASE_ADR  (PNX4008_DUM_MAIN_VA_BASE + 0x10)
> -#define DUM_SYNC_C_ADR(PNX4008_DUM_MAIN_VA_BASE + 0x14)
> -#define DUM_CLK_DIV_ADR   (PNX4008_DUM_MAIN_VA_BASE + 0x18)
> -#define DUM_DIRTY_LOW_ADR (PNX4008_DUM_MAIN_VA_BASE + 0x20)
> -#define DUM_DIRTY_HIGH_ADR(PNX4008_DUM_MAIN_VA_BASE + 0x24)
> -#define DUM_FORMAT_ADR

Fwd: [PATCH v2] drivers/media/platform/s5p-tv/sdo_drv.c: fix error return code

2012-09-23 Thread Mauro Carvalho Chehab
Sylwester,

Please review.

Regards,
Mauro

 Mensagem original 
Assunto: [PATCH v2] drivers/media/platform/s5p-tv/sdo_drv.c: fix error return 
code
Data: Thu,  6 Sep 2012 10:38:29 +0200
De: Peter Senna Tschudin 
Para: peter.se...@gmail.com, Mauro Carvalho Chehab 
CC: linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org

From: Peter Senna Tschudin 

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// 
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != 
*if(...)
{
  ... when != ret = e2
  when forall
 return ret;
}

// 

Signed-off-by: Peter Senna Tschudin 

---
 drivers/media/platform/s5p-tv/sdo_drv.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c 
b/drivers/media/platform/s5p-tv/sdo_drv.c
index ad68bbe..58cf56d 100644
--- a/drivers/media/platform/s5p-tv/sdo_drv.c
+++ b/drivers/media/platform/s5p-tv/sdo_drv.c
@@ -369,6 +369,7 @@ static int __devinit sdo_probe(struct platform_device *pdev)
sdev->fout_vpll = clk_get(dev, "fout_vpll");
if (IS_ERR_OR_NULL(sdev->fout_vpll)) {
dev_err(dev, "failed to get clock 'fout_vpll'\n");
+   ret = -ENXIO;
goto fail_dacphy;
}
dev_info(dev, "fout_vpll.rate = %lu\n", clk_get_rate(sclk_vpll));
@@ -377,11 +378,13 @@ static int __devinit sdo_probe(struct platform_device 
*pdev)
sdev->vdac = devm_regulator_get(dev, "vdd33a_dac");
if (IS_ERR_OR_NULL(sdev->vdac)) {
dev_err(dev, "failed to get regulator 'vdac'\n");
+   ret = -ENXIO;
goto fail_fout_vpll;
}
sdev->vdet = devm_regulator_get(dev, "vdet");
if (IS_ERR_OR_NULL(sdev->vdet)) {
dev_err(dev, "failed to get regulator 'vdet'\n");
+   ret = -ENXIO;
goto fail_fout_vpll;
}
 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[PATCH v2 4/4] perf tools: configure addr2line path at compile time

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

The default name for addr2line is hardcoded to "addr2line".
When cross-compiling the name of addr2line will be different
(e.g. arm-eabi-addr2line in Android).

Sett the default addr2line name in the Makefile with DEFAULT_ADDR2LINE_PATH.

Signed-off-by: Irina Tirdea 
---
 tools/perf/Makefile|6 +-
 tools/perf/util/annotate.c |3 ++-
 tools/perf/util/sort.c |2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7a3f572..745d12b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -141,6 +141,7 @@ endif
 lib = lib
 PERF_TMP_DIR = /tmp
 OBJDUMP = $(CROSS_COMPILE)objdump
+ADDR2LINE = $(CROSS_COMPILE)addr2line
 
 export prefix bindir sharedir sysconfdir
 
@@ -885,7 +886,7 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c 
$(OUTPUT)PERF-CFLAGS
$<
 
 $(OUTPUT)util/annotate.o: util/annotate.c $(OUTPUT)PERF-CFLAGS
-   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_OBJDUMP_PATH='"$(OBJDUMP)"' $<
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_OBJDUMP_PATH='"$(OBJDUMP)"' -DDEFAULT_ADDR2LINE_PATH='"$(ADDR2LIN)"' 
$<
 
 $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
@@ -896,6 +897,9 @@ $(OUTPUT)util/dso-test-data.o: util/dso-test-data.c 
$(OUTPUT)PERF-CFLAGS
 $(OUTPUT)util/map.o: util/map.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
+$(OUTPUT)util/sort.o: util/sort.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_ADDR2LINE_PATH='"$(addr2line)"' $<
+
 $(OUTPUT)util/symbol.o: util/symbol.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index d7036b3..7734a03 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -915,7 +915,8 @@ static int symbol__get_source_line(struct symbol *sym, 
struct map *map,
continue;
 
offset = start + i;
-   sprintf(cmd, "addr2line -e %s %016" PRIx64, filename, offset);
+   sprintf(cmd, DEFAULT_ADDR2LINE_PATH " -e %s %016" PRIx64,
+   filename, offset);
fp = popen(cmd, "r");
if (!fp)
continue;
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index b5b1b92..357dfc8 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -260,7 +260,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry 
*self, char *bf,
if (path != NULL)
goto out_path;
 
-   snprintf(cmd, sizeof(cmd), "addr2line -e %s %016" PRIx64,
+   snprintf(cmd, sizeof(cmd), DEFAULT_ADDR2LINE_PATH " -e %s %016" PRIx64,
 self->ms.map->dso->long_name, self->ip);
fp = popen(cmd, "r");
if (!fp)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 2/4] perf tools: configure shell path at compile time

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

Shell path /bin/sh is hardcoded in various places in perf. Android has a
different folder structure and does not have /bin/sh.

Set the shell path at compile time in the Makefile by setting PERF_SHELL_PATH.
By default it is set to /bin/sh.

Signed-off-by: Irina Tirdea 
---
 tools/perf/Makefile |6 +-
 tools/perf/builtin-help.c   |2 +-
 tools/perf/builtin-script.c |   12 ++--
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index eab4a36..fae52c8 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -828,7 +828,11 @@ $(OUTPUT)builtin-help.o: builtin-help.c 
$(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFL
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-   '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
+   '-DPERF_INFO_PATH="$(infodir_SQ)"' \
+   '-DPERF_SHELL_PATH="/bin/sh"' $<
+
+$(OUTPUT)builtin-script.o: builtin-script.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_SHELL_PATH='"/bin/sh"' $<
 
 $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h 
$(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 25c8b94..e7d640c 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -171,7 +171,7 @@ static void exec_man_cmd(const char *cmd, const char *page)
 {
struct strbuf shell_cmd = STRBUF_INIT;
strbuf_addf(_cmd, "%s %s", cmd, page);
-   execl("/bin/sh", "sh", "-c", shell_cmd.buf, NULL);
+   execl(PERF_SHELL_PATH, "sh", "-c", shell_cmd.buf, NULL);
warning("failed to exec '%s': %s", cmd, strerror(errno));
 }
 
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 1be843a..b626cf1 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1326,7 +1326,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
goto out;
}
 
-   __argv[j++] = "/bin/sh";
+   __argv[j++] = PERF_SHELL_PATH;
__argv[j++] = rec_script_path;
if (system_wide)
__argv[j++] = "-a";
@@ -1337,7 +1337,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
__argv[j++] = argv[i];
__argv[j++] = NULL;
 
-   execvp("/bin/sh", (char **)__argv);
+   execvp(PERF_SHELL_PATH, (char **)__argv);
free(__argv);
exit(-1);
}
@@ -1353,7 +1353,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
}
 
j = 0;
-   __argv[j++] = "/bin/sh";
+   __argv[j++] = PERF_SHELL_PATH;
__argv[j++] = rep_script_path;
for (i = 1; i < rep_args + 1; i++)
__argv[j++] = argv[i];
@@ -1361,7 +1361,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
__argv[j++] = "-";
__argv[j++] = NULL;
 
-   execvp("/bin/sh", (char **)__argv);
+   execvp(PERF_SHELL_PATH, (char **)__argv);
free(__argv);
exit(-1);
}
@@ -1390,7 +1390,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
goto out;
}
 
-   __argv[j++] = "/bin/sh";
+   __argv[j++] = PERF_SHELL_PATH;
__argv[j++] = script_path;
if (system_wide)
__argv[j++] = "-a";
@@ -1398,7 +1398,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
__argv[j++] = argv[i];
__argv[j++] = NULL;
 
-   execvp("/bin/sh", (char **)__argv);
+   execvp(PERF_SHELL_PATH, (char **)__argv);
free(__argv);
exit(-1);
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/4] perf annotate: configure objdump path at compile time

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

The default name for objdump is "objdump". For cross-compiling the name of
objdump will be different (e.g. arm-eabi-objdump in Android).

Set the default objdump name in the Makefile with DEFAULT_OBJDUMP_PATH.

Signed-off-by: Irina Tirdea 
---
 tools/perf/Makefile|4 
 tools/perf/util/annotate.c |2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index fae52c8..7a3f572 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -140,6 +140,7 @@ ETC_PERFCONFIG = etc/perfconfig
 endif
 lib = lib
 PERF_TMP_DIR = /tmp
+OBJDUMP = $(CROSS_COMPILE)objdump
 
 export prefix bindir sharedir sysconfdir
 
@@ -883,6 +884,9 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c 
$(OUTPUT)PERF-CFLAGS
'-DPREFIX="$(prefix_SQ)"' \
$<
 
+$(OUTPUT)util/annotate.o: util/annotate.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DDEFAULT_OBJDUMP_PATH='"$(OBJDUMP)"' $<
+
 $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
 
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index f0a9103..d7036b3 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -824,7 +824,7 @@ fallback:
 "%s %s%s --start-address=0x%016" PRIx64
 " --stop-address=0x%016" PRIx64
 " -d %s %s -C %s|grep -v %s|expand",
-objdump_path ? objdump_path : "objdump",
+objdump_path ? objdump_path : DEFAULT_OBJDUMP_PATH,
 disassembler_style ? "-M " : "",
 disassembler_style ? disassembler_style : "",
 map__rip_2objdump(map, sym->start),
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/4] perf tools: configure tmp path at build time

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

Temporary perf files are hardcoded to point to /tmp. Android does not have
a /tmp directory so it needs to set this path at compile time.

Add a compile-time definition (PERF_TMP_DIR) in the Makefile that sets the path
to temp directory. By default it points to /tmp.

Signed-off-by: Irina Tirdea 
---
 tools/perf/Documentation/jit-interface.txt |4 +++-
 tools/perf/Makefile|   16 +++-
 tools/perf/perf-archive.sh |   13 +++--
 tools/perf/util/dso-test-data.c|2 +-
 tools/perf/util/map.c  |3 ++-
 tools/perf/util/pmu.c  |2 +-
 tools/perf/util/symbol.c   |4 +++-
 tools/perf/util/trace-event-info.c |2 +-
 8 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/tools/perf/Documentation/jit-interface.txt 
b/tools/perf/Documentation/jit-interface.txt
index a8656f5..10cb6ec 100644
--- a/tools/perf/Documentation/jit-interface.txt
+++ b/tools/perf/Documentation/jit-interface.txt
@@ -1,7 +1,9 @@
 perf supports a simple JIT interface to resolve symbols for dynamic code 
generated
 by a JIT.
 
-The JIT has to write a /tmp/perf-%d.map  (%d = pid of process) file
+The JIT has to write a $PERF_TMP_DIR/perf-%d.map  (%d = pid of process) file.
+You can set $PERF_TMP_DIR at compile time in the Makefile.
+By default it is /tmp.
 
 This is a text file.
 
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 5077f8e..eab4a36 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -139,6 +139,7 @@ sysconfdir = $(prefix)/etc
 ETC_PERFCONFIG = etc/perfconfig
 endif
 lib = lib
+PERF_TMP_DIR = /tmp
 
 export prefix bindir sharedir sysconfdir
 
@@ -246,7 +247,8 @@ $(OUTPUT)util/pmu-bison.c: util/pmu.y
$(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c 
$(OUTPUT)util/parse-events-bison.c
-$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
+$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu.c $(OUTPUT)util/pmu-flex.c 
$(OUTPUT)util/pmu-bison.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
 
 LIB_FILE=$(OUTPUT)libperf.a
 
@@ -880,6 +882,18 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c 
$(OUTPUT)PERF-CFLAGS
 $(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
 
+$(OUTPUT)util/dso-test-data.o: util/dso-test-data.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
+
+$(OUTPUT)util/map.o: util/map.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
+
+$(OUTPUT)util/symbol.o: util/symbol.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
+
+$(OUTPUT)util/trace-event-info.o: util/trace-event-info.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) 
-DPERF_TMP_DIR='"$(PERF_TMP_DIR)"' $<
+
 $(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
 
diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh
index e919306..058c3b7 100644
--- a/tools/perf/perf-archive.sh
+++ b/tools/perf/perf-archive.sh
@@ -18,7 +18,16 @@ else
 PERF_BUILDID_DIR=$PERF_BUILDID_DIR/
 fi
 
-BUILDIDS=$(mktemp /tmp/perf-archive-buildids.XX)
+#
+# PERF_TMP_DIR environment variable set by perf
+# path to temp directory, default to /tmp
+#
+if [ -z $PERF_TMP_DIR ]; then
+   PERF_TMP_DIR=/tmp
+fi
+
+
+BUILDIDS=$(mktemp $PERF_TMP_DIR/perf-archive-buildids.XX)
 NOBUILDID=
 
 perf buildid-list -i $PERF_DATA --with-hits | grep -v "^$NOBUILDID " > 
$BUILDIDS
@@ -28,7 +37,7 @@ if [ ! -s $BUILDIDS ] ; then
exit 1
 fi
 
-MANIFEST=$(mktemp /tmp/perf-archive-manifest.XX)
+MANIFEST=$(mktemp $PERF_TMP_DIR/perf-archive-manifest.XX)
 PERF_BUILDID_LINKDIR=$(readlink -f $PERF_BUILDID_DIR)/
 
 cut -d ' ' -f 1 $BUILDIDS | \
diff --git a/tools/perf/util/dso-test-data.c b/tools/perf/util/dso-test-data.c
index c6caede..ca81e65 100644
--- a/tools/perf/util/dso-test-data.c
+++ b/tools/perf/util/dso-test-data.c
@@ -18,7 +18,7 @@ do { \
 
 static char *test_file(int size)
 {
-   static char buf_templ[] = "/tmp/test-XX";
+   static char buf_templ[] = PERF_TMP_DIR "/test-XX";
char *templ = buf_templ;
int fd, i;
unsigned char *buf;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index b442ee4..c5b4632 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -59,7 +59,8 @@ struct map *map__new(struct list_head *dsos__list, u64 start, 
u64 len,
no_dso = is_no_dso_memory(filename);
 
if (anon) {
-

[PATCH v2 0/4] perf: android: configure hardcoded paths

2012-09-23 Thread Irina Tirdea
From: Irina Tirdea 

This is version 2 of the set of patches that replace hardcoded paths used
in perf with configurable options in the Makefile.

First version can be found at https://lkml.org/lkml/2012/9/20/537.

Thanks everybody for the reviews! This version fixes all issues mentioned in
reviews.

Changes for v2:
() updated tools/perf/Documentation/jit-interface.txt regarding PERF_TMP_DIR
(patch 1)
() fixed hardcoded size for PERF_TMP_DIR"/perf-"  (patch 1)
() use PERF_SHELL_PATH instead of PERF_SHELL_DIR  (patch 2)
() use DEFAULT_OBJDUMP_PATH and DEFAULT_ADDR2LINE_PATH (patch 3,4)
() add CROSS_COMPILE prefix to addr2line and objdump in Makefile (patch 3,4)

Thanks,
Irina

Irina Tirdea (4):
  perf tools: configure tmp path at build time
  perf tools: configure shell path at compile time
  perf annotate: configure objdump path at compile time
  perf tools: configure addr2line path at compile time

 tools/perf/Documentation/jit-interface.txt |4 +++-
 tools/perf/Makefile|   30 ++--
 tools/perf/builtin-help.c  |2 +-
 tools/perf/builtin-script.c|   12 +--
 tools/perf/perf-archive.sh |   13 ++--
 tools/perf/util/annotate.c |5 +++--
 tools/perf/util/dso-test-data.c|2 +-
 tools/perf/util/map.c  |3 ++-
 tools/perf/util/pmu.c  |2 +-
 tools/perf/util/sort.c |2 +-
 tools/perf/util/symbol.c   |4 +++-
 tools/perf/util/trace-event-info.c |2 +-
 12 files changed, 61 insertions(+), 20 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] video: hpfb: Fix error handling

2012-09-23 Thread Florian Tobias Schandinat
On 08/20/2012 06:32 PM, Emil Goode wrote:
> This patch solves problems with the error handling by
> introducing labels for proper error paths and it also
> frees resources that where missed.
> 
> Signed-off-by: Emil Goode 

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/hpfb.c |   28 +---
>  1 file changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
> index ebf8495..7324865 100644
> --- a/drivers/video/hpfb.c
> +++ b/drivers/video/hpfb.c
> @@ -210,6 +210,7 @@ static int __devinit hpfb_init_one(unsigned long 
> phys_base,
>  unsigned long virt_base)
>  {
>   unsigned long fboff, fb_width, fb_height, fb_start;
> + int ret;
>  
>   fb_regs = virt_base;
>   fboff = (in_8(fb_regs + HPFB_FBOMSB) << 8) | in_8(fb_regs + 
> HPFB_FBOLSB);
> @@ -290,19 +291,29 @@ static int __devinit hpfb_init_one(unsigned long 
> phys_base,
>   fb_info.var   = hpfb_defined;
>   fb_info.screen_base = (char *)fb_start;
>  
> - fb_alloc_cmap(_info.cmap, 1 << hpfb_defined.bits_per_pixel, 0);
> + ret = fb_alloc_cmap(_info.cmap, 1 << hpfb_defined.bits_per_pixel, 0);
> + if (ret < 0)
> + goto unmap_screen_base;
>  
> - if (register_framebuffer(_info) < 0) {
> - fb_dealloc_cmap(_info.cmap);
> - iounmap(fb_info.screen_base);
> - fb_info.screen_base = NULL;
> - return 1;
> - }
> + ret = register_framebuffer(_info);
> + if (ret < 0)
> + goto dealloc_cmap;
>  
>   printk(KERN_INFO "fb%d: %s frame buffer device\n",
>  fb_info.node, fb_info.fix.id);
>  
>   return 0;
> +
> +dealloc_cmap:
> + fb_dealloc_cmap(_info.cmap);
> +
> +unmap_screen_base:
> + if (fb_info.screen_base) {
> + iounmap(fb_info.screen_base);
> + fb_info.screen_base = NULL;
> + }
> +
> + return ret;
>  }
>  
>  /* 
> @@ -345,6 +356,9 @@ static void __devexit hpfb_remove_one(struct dio_dev *d)
>   if (d->scode >= DIOII_SCBASE)
>   iounmap((void *)fb_regs);
>   release_mem_region(d->resource.start, resource_size(>resource));
> + fb_dealloc_cmap(_info.cmap);
> + if (fb_info.screen_base)
> + iounmap(fb_info.screen_base);
>  }
>  
>  static struct dio_device_id hpfb_dio_tbl[] = {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] lxt PHY: Support for the buggy LXT973 rev A2

2012-09-23 Thread Lutz Jaenicke
On Sat, Sep 22, 2012 at 06:21:38PM +0200, leroy christophe wrote:
> 
> Le 10/09/2012 20:17, Lutz Jaenicke a écrit :
> >On Mon, Sep 10, 2012 at 05:45:49PM +0200, Christophe Leroy wrote:
> >>This patch adds proper handling of the buggy revision A2 of LXT973 phy, 
> >>adding
> >>precautions linked to ERRATA Item 4:
> >>
> >>Item 4: MDIO Interface and Repeated Polling
> >>Problem: Repeated polling of odd-numbered registers via the MDIO interface
> >>randomly returns the contents of the previous even register.
> >>Implication: Managed applications may not obtain the correct register 
> >>contents
> >>when a particular register is monitored for device status.
> >>Workaround: None.
> >>Status: This erratum has been previously fixed (in rev A3)
> >Hmm. Were did you get the hardware from? We have been using LXT973 in
> >our products and the A2 was replaced by A3 in 2003.
> >
> >Best regards,
> > Lutz
> They are custom boards that my company manufactures. Most boards
> manufactured before 2006 or 2007 have this buggy chip.

Ok, so this problem indeed is related to (very) old hardware.
I would not be sure whether the hack needed to work around
this bug should be added one decade after the chip has
been fixed.

Best regards,
Lutz
PS.Yes, we have used the same workaround with such hardware, fortunately
we only had a few first boards using A2 and the series production
started just with A3 at that time.
-- 
Dr.-Ing. Lutz Jänicke
CTO
Innominate Security Technologies AG  /protecting industrial networks/
tel: +49.30.921028-200
fax: +49.30.921028-020
Rudower Chaussee 13
D-12489 Berlin, Germany
www.innominate.com

Register Court: AG Charlottenburg, HR B 81603
Management Board: Dirk Seewald
Chairman of the Supervisory Board: Christoph Leifer
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] i2c: busses: i2c-ocores: switch to devm_request_and_ioremap

2012-09-23 Thread Peter Korsgaard
> "Maxin" == Maxin B John  writes:

 Maxin> This drops a few lines of code and allows common APIs to handle
 Maxin> those for us.

 Maxin> Signed-off-by: Maxin B. John 

Acked-by: Peter Korsgaard 

-- 
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/4] lib: vsprintf: Optimize put_dec_trunc8

2012-09-23 Thread Michal Nazarewicz
On Fri, Aug 03 2012, George Spelvin wrote:
> If you're going to have a conditional branch after
> each 32x32->64-bit multiply, might as well shrink the code
> and make it a loop.
>
> This also avoids using the long multiply for small integers.
>
> (This leaves the comments in a confusing state, but that's a separate
> patch to make review easier.)
>
> Signed-off-by: George Spelvin 

NAK.

> ---
>  lib/vsprintf.c |   20 ++--
>  1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index a8e7392..3ca77b8 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -174,20 +174,12 @@ char *put_dec_trunc8(char *buf, unsigned r)
>   unsigned q;
>  
>   /* Copy of previous function's body with added early returns */
> - q  = (r * (uint64_t)0x199a) >> 32;
> - *buf++ = (r - 10 * q) + '0'; /* 2 */
> - if (q == 0)
> - return buf;
> - r  = (q * (uint64_t)0x199a) >> 32;
> - *buf++ = (q - 10 * r) + '0'; /* 3 */
> - if (r == 0)
> - return buf;
> - q  = (r * (uint64_t)0x199a) >> 32;
> - *buf++ = (r - 10 * q) + '0'; /* 4 */
> - if (q == 0)
> - return buf;
> - r  = (q * (uint64_t)0x199a) >> 32;
> - *buf++ = (q - 10 * r) + '0'; /* 5 */
> + while (r >= 1) {
> + q = r + '0';
> + r  = (r * (uint64_t)0x199a) >> 32;
> + *buf++ = q - 10*r;
> + }

This loop looks nothing like the original code.  Why are you adding '0'
at the beginning?  Also, the original code switches the role of q and r,
the loop does not.

>   if (r == 0)
>   return buf;
>   q  = (r * 0x199a) >> 16;

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--

pgpSw0MhJNqOH.pgp
Description: PGP signature


Re: [PATCH 1/2] i2c: busses: i2c-ocores: Fix documentation filename

2012-09-23 Thread Peter Korsgaard
> "Maxin" == Maxin B John  writes:

 Maxin> Fixes the wrong filename.
 Maxin> Signed-off-by: Maxin B. John 

Acked-by: Peter Korsgaard 

-- 
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/5] drivers/media/platform/omap3isp/isp.c: fix error return code

2012-09-23 Thread Peter Senna Tschudin
On Sun, Sep 23, 2012 at 7:39 PM, Mauro Carvalho Chehab
 wrote:
> Laurent,
>
> Could you please review this patch?
>
> Peter,
>
> Please, always c/c the driver maintainer/author on patches you submit.
>
> You can check it with scripts/get_maintainer.pl.
Sorry for that. I'll be more careful next time. Thanks!

>
> Regards,
> Mauro
>
>  Mensagem original 
> Assunto: [PATCH 5/5] drivers/media/platform/omap3isp/isp.c: fix error return 
> code
> Data: Tue,  4 Sep 2012 18:14:25 +0200
> De: Peter Senna Tschudin 
> Para: Mauro Carvalho Chehab 
> CC: kernel-janit...@vger.kernel.org, julia.law...@lip6.fr, 
> linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org
>
> From: Peter Senna Tschudin 
>
> Convert a nonnegative error return code to a negative one, as returned
> elsewhere in the function.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // 
> (
> if@p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
> when != 
> *if(...)
> {
>   ... when != ret = e2
>   when forall
>  return ret;
> }
>
> // 
>
> Signed-off-by: Peter Senna Tschudin 
>
> ---
>  drivers/media/platform/omap3isp/isp.c |4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/omap3isp/isp.c 
> b/drivers/media/platform/omap3isp/isp.c
> index e0096e0..91fcaef 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -2102,8 +2102,10 @@ static int __devinit isp_probe(struct platform_device 
> *pdev)
> if (ret < 0)
> goto error;
>
> -   if (__omap3isp_get(isp, false) == NULL)
> +   if (__omap3isp_get(isp, false) == NULL) {
> +   ret = -EBUSY; /* Not sure if EBUSY is best for here */
> goto error;
> +   }
>
> ret = isp_reset(isp);
> if (ret < 0)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>



-- 
Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/4] devpts: fix devpts mount behavior

2012-09-23 Thread H. Peter Anvin

On 09/23/2012 10:42 AM, Eric W. Biederman wrote:



Greg, Kay, any idea how to make ptmx show up in devtmpfs as a symlink
to pts/pmtx instead of as a device node?


The conversation stalled in January with that very question.

What I am proposing doesn't conflict with any effort like that.



I just looked at the archive, and it apparently really comes down to 
"noone wants to take responsibility for it".  The real problem appears 
to be that with devtmpfs device name policy is actually split between 
user space and kernel, which is the worst possible configuration.


-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/4] devpts: fix devpts mount behavior

2012-09-23 Thread Eric W. Biederman
"H. Peter Anvin"  writes:

> On 09/22/2012 08:47 PM, Eric W. Biederman wrote:
>> Making /dev/ptmx a symlink sounds simple, but in practice no one could
>> actually figure out how to make it happen.
>
> This feels particularly ridiculous since udev now requires devtmpfs
> (as in it will no longer work without it), which means this is all
> done in the kernel, so we should just be able to fix this in the
> kernel.

Some versions of udev require devtmpfs.  At best we could have something
conditional in the kernel that does this.

> Greg, Kay, any idea how to make ptmx show up in devtmpfs as a symlink
> to pts/pmtx instead of as a device node?

The conversation stalled in January with that very question.

What I am proposing doesn't conflict with any effort like that.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fwd: [PATCH 5/5] drivers/media/platform/omap3isp/isp.c: fix error return code

2012-09-23 Thread Mauro Carvalho Chehab
Laurent,

Could you please review this patch?

Peter,

Please, always c/c the driver maintainer/author on patches you submit.

You can check it with scripts/get_maintainer.pl.

Regards,
Mauro

 Mensagem original 
Assunto: [PATCH 5/5] drivers/media/platform/omap3isp/isp.c: fix error return 
code
Data: Tue,  4 Sep 2012 18:14:25 +0200
De: Peter Senna Tschudin 
Para: Mauro Carvalho Chehab 
CC: kernel-janit...@vger.kernel.org, julia.law...@lip6.fr, 
linux-me...@vger.kernel.org, linux-kernel@vger.kernel.org

From: Peter Senna Tschudin 

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// 
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != 
*if(...)
{
  ... when != ret = e2
  when forall
 return ret;
}

// 

Signed-off-by: Peter Senna Tschudin 

---
 drivers/media/platform/omap3isp/isp.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index e0096e0..91fcaef 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2102,8 +2102,10 @@ static int __devinit isp_probe(struct platform_device 
*pdev)
if (ret < 0)
goto error;
 
-   if (__omap3isp_get(isp, false) == NULL)
+   if (__omap3isp_get(isp, false) == NULL) {
+   ret = -EBUSY; /* Not sure if EBUSY is best for here */
goto error;
+   }
 
ret = isp_reset(isp);
if (ret < 0)

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




Re: [PATCH 2/4] lib: vsprintf: Optimize division by 10000

2012-09-23 Thread Michal Nazarewicz
On Fri, Aug 03 2012, George Spelvin wrote:
> The same multiply-by-inverse technique can be used to
> convert division by 1 to a 32x32->64-bit multiply.
>
> Signed-off-by: George Spelvin 

You are using a 64-bit multiply in a path that is designed for 32-bit
processors, which makes me feel that it will be slower.

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--

pgpopqkAMIww1.pgp
Description: PGP signature


Re: [PATCH 1/4] lib: vsprintf: Optimize division by 10 for small integers.

2012-09-23 Thread Michal Nazarewicz
On Fri, Aug 03 2012, George Spelvin  wrote:
> Shrink the reciprocal approximations used in put_dec_full4
> based on the comments in put_dec_full9.
>
> Signed-off-by: George Spelvin 
> Cc: Denys Vlasenko 
> Cc: Michal Nazarewicz 

Have you verified that the comment is correct?

> ---
>  lib/vsprintf.c |5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> I was looking over the code and noticed that the constants could be smaller.
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index c3f36d41..2f32fe8 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -243,13 +243,14 @@ char *put_dec(char *buf, unsigned long long n)
>  
>  /* Second algorithm: valid only for 64-bit long longs */
>  
> +/* See comment in put_dec_full9 for choice of constants */
>  static noinline_for_stack
>  char *put_dec_full4(char *buf, unsigned q)
>  {
>   unsigned r;
> - r  = (q * 0xcccd) >> 19;
> + r  = (q * 0xccd) >> 15;
>   *buf++ = (q - 10 * r) + '0';
> - q  = (r * 0x199a) >> 16;
> + q  = (r * 0xcd) >> 11;
>   *buf++ = (r - 10 * q)  + '0';
>   r  = (q * 0xcd) >> 11;

If you are changing everything, this could also be changed to:

r  = (q * 0x67) >> 10;

no?

>   *buf++ = (q - 10 * r)  + '0';

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--

pgphxPh3rOuGX.pgp
Description: PGP signature


Re: [PATCH v2 3/4] sta2x11_vip: convert to videobuf2 and control framework

2012-09-23 Thread Federico Vaga
> > +struct sta2x11_vip_fh {
> > +   struct v4l2_fh fh;
> > +};
> 
> No need to make a sta2x11_vip_fh struct, just use v4l2_fh directly. It
> doesn't add anything. In fact, it's not even used.

Thank you :)


> >  static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
> >  
> >   struct v4l2_format *f)
> >  
> >  {
> > 
> > -   struct video_device *dev = priv;
> > -   struct sta2x11_vip *vip = video_get_drvdata(dev);
> > +   struct sta2x11_vip *vip = video_drvdata(file);
> > 
> > int interlace_lim;
> > 
> > -   if (V4L2_PIX_FMT_UYVY != f->fmt.pix.pixelformat)
> > -   return -EINVAL;
> > -
> > 
> > if (V4L2_STD_525_60 & vip->std)
> > 
> > interlace_lim = 240;
> > 
> > else
> > 
> > @@ -827,6 +522,8 @@ static int vidioc_try_fmt_vid_cap(struct file
> > *file, void *priv,> 
> > return -EINVAL;
> 
> No -EINVAL allowed anymore in try_fmt_vid_cap. I generally handle
> unknown field values in try_fmt_vid_cap as if FIELD_ANY was
> specified.

ok, unknown -> any

> > 
> > memcpy(>format, >fmt.pix, sizeof(struct 
v4l2_pix_format));
> 
> Just use an assignment: vip->format = f->fmt.pix
> 

> > 
> > memcpy(>fmt.pix, >format, sizeof(struct 
v4l2_pix_format));
> 
> Assignment
> 

Fixed


> > -
> > 
> >  static const struct v4l2_ioctl_ops vip_ioctl_ops = {
> >  
> > .vidioc_querycap = vidioc_querycap,
> > 
> > -   .vidioc_s_std = vidioc_s_std,
> > +   /* FMT handling */
> > +   .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
> > +   .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
> > +   .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
> > +   .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
> > +   /* Buffer handlers */
> > +   .vidioc_reqbufs = vb2_ioctl_reqbufs,
> > +   .vidioc_querybuf = vb2_ioctl_querybuf,
> > +   .vidioc_qbuf = vb2_ioctl_qbuf,
> > +   .vidioc_dqbuf = vb2_ioctl_dqbuf,
> > +   .vidioc_create_bufs = vb2_ioctl_create_bufs,
> 
> If you want to use create_bufs, then in queue_setup() you need to
> handle the fmt argument. See e.g. vivi.c for an example.

Fixed

I will send a patch v3 tomorrow
-- 
Federico Vaga
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 0/3] MIPS: JZ4740: Move PWM driver to PWM framework

2012-09-23 Thread Thierry Reding
On Sun, Sep 23, 2012 at 03:56:35PM +0200, Ralf Baechle wrote:
> On Sat, Sep 22, 2012 at 09:41:45AM +0200, Thierry Reding wrote:
> 
> > Have you had a chance to look at this? It is the last remaining PWM
> > driver that isn't moved to the PWM framework yet. All the others are
> > either in linux-next already and queued for 3.7 or have recently got
> > Acked-by the respective maintainers (Unicore32). Patches 2 and 3 were
> > already acked and tested by Lars-Peter who did the initial porting.
> > Patch 1 can probably be dropped since I seem to be the only one running
> > into that issue.
> > 
> > I really want to take this in for 3.7 so I can use the 3.7 cycle to
> > transition from the legacy API to the new API and possibly even get rid
> > of the legacy parts altogether. However I don't want to do this without
> > the Acked-by from the MIPS maintainer.
> 
> Acked-by: Ralf Baechle 
> 
> for 2/3 and 3/3.

Alright, thanks. I'll take those through the PWM tree.

> I now can reproduce the build error that 1/3 is supposed to fix.  The issue
> is not as first suspected an odd bug in just your compiler.  The tree
> (I was testing on today's -next) is building fine when compiling in-tree
> but fails out of tree:

Okay, that makes sense. I rarely if even build in-tree nowadays.

>   CC  arch/mips/jz4740/irq.o
> In file included from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/irq.h:18:0,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/irq.h:27,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/asm-generic/hardirq.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/hardirq.h:16,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/hardirq.h:7,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/interrupt.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:19:
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.h:20:39: error: 
> ‘struct irq_data’ declared inside parameter list [-Werror]
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.h:20:39: error: its 
> scope is only this definition or declaration, which is probably not what you 
> want [-Werror]
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.h:21:38: error: 
> ‘struct irq_data’ declared inside parameter list [-Werror]
> In file included from 
> /home/ralf/src/linux/linux-jz4740/include/linux/irq.h:356:0,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/asm-generic/hardirq.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/hardirq.h:16,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/hardirq.h:7,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/interrupt.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:19:
> /home/ralf/src/linux/linux-jz4740/include/linux/irqdesc.h:73:33: error: 
> ‘NR_IRQS’ undeclared here (not in a function)
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c: In function 
> ‘jz4740_cascade’:
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:49:39: error: 
> ‘JZ4740_IRQ_BASE’ undeclared (first use in this function)
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:49:39: note: each 
> undeclared identifier is reported only once for each function it appears in
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c: At top level:
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:62:6: error: 
> conflicting types for ‘jz4740_irq_suspend’
> In file included from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/irq.h:18:0,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/irq.h:27,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/asm-generic/hardirq.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/hardirq.h:16,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/hardirq.h:7,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/interrupt.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:19:
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.h:20:13: note: 
> previous declaration of ‘jz4740_irq_suspend’ was here
> /home/ralf/src/linux/linux-jz4740/arch/mips/jz4740/irq.c:68:6: error: 
> conflicting types for ‘jz4740_irq_resume’
> In file included from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/irq.h:18:0,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/irq.h:27,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/asm-generic/hardirq.h:12,
>  from 
> /home/ralf/src/linux/linux-jz4740/arch/mips/include/asm/hardirq.h:16,
>  from 
> /home/ralf/src/linux/linux-jz4740/include/linux/hardirq.h:7,

[PATCH] net: scm: moving dereference after NULL check

2012-09-23 Thread Maxin B. John
scm_destroy_cred() dereferences 'scm' before null check

Signed-off-by: Maxin B. John 
---
diff --git a/include/net/scm.h b/include/net/scm.h
index 7dc0854..ed25aa1 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -64,9 +64,11 @@ static __inline__ void scm_destroy_cred(struct scm_cookie 
*scm)
 
 static __inline__ void scm_destroy(struct scm_cookie *scm)
 {
-   scm_destroy_cred(scm);
-   if (scm && scm->fp)
-   __scm_destroy(scm);
+   if (scm) {
+   scm_destroy_cred(scm);
+   if (scm->fp)
+   __scm_destroy(scm);
+   }
 }
 
 static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/4] devpts: fix devpts mount behavior

2012-09-23 Thread H. Peter Anvin

On 09/22/2012 08:47 PM, Eric W. Biederman wrote:

Making /dev/ptmx a symlink sounds simple, but in practice no one could
actually figure out how to make it happen.


This feels particularly ridiculous since udev now requires devtmpfs (as 
in it will no longer work without it), which means this is all done in 
the kernel, so we should just be able to fix this in the kernel.


Greg, Kay, any idea how to make ptmx show up in devtmpfs as a symlink to 
pts/pmtx instead of as a device node?


-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Areca hardware RAID / first-ever SCSI bus reset: am I about to lose this disk controller?

2012-09-23 Thread Nix
On 19 Sep 2012, Chris Murphy outgrape:

>
> On Sep 19, 2012, at 12:52 PM, Nix wrote:
>
>> So I have this x86-64 server running Linux 3.5.1 with a SATA-on-PCIe
>> Areca 1210 hardware RAID-5 controller 
>
> Did you find this? Same controller family. Weird that this just shows
> up now, but perhaps instead of it being "bad hardware" out the gate,
> something's happened to it and now it's failing as you suspect.

Hm, it's possible I suppose. Just as possible that a disk is dying.


It looks to have been a one-off transient -- no recurrence yet, touch
wood :)

-- 
NULL && (void)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Question on /sys/class/tty/tty0/active

2012-09-23 Thread Alan Cox
On Sun, 23 Sep 2012 16:40:07 +0200
richard -rw- weinberger  wrote:

> Hi!
> 
> I'm booting 3.6-rc6 using KVM and observe the following output:
> $ tty
> /dev/tty0
> $ cat /sys/class/tty/tty0/active
> tty1
> 
> Why does the active file say I'm on tty1?
> There is no tty1, I'm on tty0.
> (Also "who" reports tty0)

tty0 is the current vt, tty1 is a direct mapping to that vt.

So it looks correct to me.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] i2c: busses: i2c-ocores: Fix documentation filename

2012-09-23 Thread Rob Herring
On 09/23/2012 08:30 AM, Maxin B. John wrote:
> Fixes the wrong filename.
> 
> Signed-off-by: Maxin B. John 
> ---

Acked-by: Rob Herring 

> diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
> index bffd550..e39c122 100644
> --- a/drivers/i2c/busses/i2c-ocores.c
> +++ b/drivers/i2c/busses/i2c-ocores.c
> @@ -11,7 +11,7 @@
>  
>  /*
>   * This driver can be used from the device tree, see
> - * Documentation/devicetree/bindings/i2c/ocore-i2c.txt
> + * Documentation/devicetree/bindings/i2c/i2c-ocores.txt
>   */
>  #include 
>  #include 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


PROBLEM: kernel 3.6.rc6 bug report (usb 3.0 external hard drive problem)

2012-09-23 Thread Gabor Takacs
Bug report for kernel version 3.6.rc6

Content of message:

- One-line description
- Full description
- Keywords
- CPU info
- Modules info
- Kernel version
- Loaded driver and hardware information
- PCI information
- SCSI information

One-line description: Western Digital My Passport USB 3.0 hard drive not
handled by kernel

Full description: under 3.6.rc6 kernel on an Asus Zenbook Prime UX21A,
when plugging in my
Western Digital My Passport USB 3.0 hard drive, the system does not
mount it. It worked with
previous (3.4.x) kernels.

# mount /dev/sdb1 /mnt
mount: special device /dev/sdb1 does not exist

Running dmesg reveals the following:

[  744.054410] usb 4-1: new SuperSpeed USB device number 7 using xhci_hcd
[  744.066695] usb 4-1: New USB device found, idVendor=1058, idProduct=0730
[  744.066705] usb 4-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[  744.066710] usb 4-1: Product: My Passport 0730
[  744.066714] usb 4-1: Manufacturer: Western Digital
[  744.066718] usb 4-1: SerialNumber: 575846314139304E30363638
[  744.068280] scsi7 : usb-storage 4-1:1.0
[  755.053758] scsi 7:0:0:0: Direct-Access WD   My Passport 0730
1008 PQ: 0 ANSI: 6
[  755.054732] sd 7:0:0:0: [sdb] 976707584 512-byte logical blocks: (500
GB/465 GiB)
[  755.054901] sd 7:0:0:0: Attached scsi generic sg1 type 0
[  755.055009] sd 7:0:0:0: [sdb] Write Protect is off
[  755.055025] sd 7:0:0:0: [sdb] Mode Sense: 47 00 10 08
[  755.055451] sd 7:0:0:0: [sdb] No Caching mode page present
[  755.055462] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[  755.056757] sd 7:0:0:0: [sdb] No Caching mode page present
[  755.056772] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[  755.091464]  sdb: sdb1 sdb2
[  755.093493] sd 7:0:0:0: [sdb] No Caching mode page present
[  755.093503] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[  755.093509] sd 7:0:0:0: [sdb] Attached SCSI disk
[  755.097771] usb 4-1: Disable of device-initiated U1 failed.
[  755.097854] usb 4-1: Disable of device-initiated U2 failed.
[  755.199967] usb 4-1: Device not responding to set address.
[  755.400520] usb 4-1: Device not responding to set address.
[  755.601230] usb 4-1: device not accepting address 7, error -71
[  755.703214] usb 4-1: Device not responding to set address.
[  755.903825] usb 4-1: Device not responding to set address.
[  756.104468] usb 4-1: device not accepting address 7, error -71
[  756.206429] usb 4-1: Device not responding to set address.
[  756.407090] usb 4-1: Device not responding to set address.
[  756.607692] usb 4-1: device not accepting address 7, error -71
[  756.709677] usb 4-1: Device not responding to set address.
[  756.910348] usb 4-1: Device not responding to set address.
[  757.110950] usb 4-1: device not accepting address 7, error -71
[  757.111010] usb 4-1: USB disconnect, device number 7
[  757.114782] xhci_hcd :00:14.0: xHCI xhci_drop_endpoint called
with disabled ep 880036c07400
[  757.114794] xhci_hcd :00:14.0: xHCI xhci_drop_endpoint called
with disabled ep 880036c073c0
[  757.216889] usb 4-1: Device not responding to set address.
[  757.417560] usb 4-1: Device not responding to set address.
[  757.618212] usb 4-1: device not accepting address 8, error -71

(the last three lines keep repeating)

Keywords: usb-storage, external usb hard disk

System info follows.

CPU info:

> cat /proc/cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 6
model: 58
model name: Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz
stepping: 9
microcode: 0x12
cpu MHz: 800.000
cache size: 4096 KB
physical id: 0
siblings: 4
core id: 0
cpu cores: 2
apicid: 0
initial apicid: 0
fpu: yes
fpu_exception: yes
cpuid level: 13
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall
nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer
aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm
tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips: 4788.82
clflush size: 64
cache_alignment: 64
address sizes: 36 bits physical, 48 bits virtual
power management:

processor: 1
vendor_id: GenuineIntel
cpu family: 6
model: 58
model name: Intel(R) Core(TM) i7-3517U CPU @ 1.90GHz
stepping: 9
microcode: 0x12
cpu MHz: 800.000
cache size: 4096 KB
physical id: 0
siblings: 4
core id: 1
cpu cores: 2
apicid: 2
initial apicid: 2
fpu: yes
fpu_exception: yes
cpuid level: 13
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall
nx rdtscp lm 

Re: [PATCH 01/40] PCI: fix default vga ref_count

2012-09-23 Thread Jiang Liu
On 09/20/2012 02:54 AM, Yinghai Lu wrote:
> when __ARCH_HAS_VGA_DEFAULT_DEVICE is not defined, aka EFIFB is not used,
> for static path, vga_default setting is through vga_arbiter_add_pci_device.
> and later x86 pci_fixup_video, will skip setting again.
> - subsys_initcall(vga_arb_device_init) come first to call 
> vga_arbiter_add_pci_device. It will call pci_get_dev to hold one reference.
> 
> for hotplug add path, even vga_arbiter_add_pci_device is called via notifier,
> but it will check VGA_RSRC_LEGACY_MASK that is not set for hotplug path.
> So x86 pci_fixup_video will take over to call vga_set_default_device().
> It will not hold one refrence.
> 
> Later for hotplug remove path, vga_arbiter_del_pci_device that does not check
> VGA_RSRC_LEGACY_MASK will call put_device and it will cause ref_count to
> decrease extra. that will have that pci device get deleted early wrongly.
> 
> Need to make get/put balance for both cases.
> 
> -v2: According to Bjorn, update vga_set_default_device instead...
> 
> Signed-off-by: Yinghai Lu 
> Cc: x...@kernel.org
> Cc: Dave Airlie 
> Cc: Andrew Morton 
> Cc: Julia Lawall 
> Cc: Matthew Garrett 
> ---
>  drivers/gpu/vga/vgaarb.c |   14 +-
>  1 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
> index b6852b7..0888951e 100644
> --- a/drivers/gpu/vga/vgaarb.c
> +++ b/drivers/gpu/vga/vgaarb.c
> @@ -141,6 +141,12 @@ EXPORT_SYMBOL_GPL(vga_default_device);
>  
>  void vga_set_default_device(struct pci_dev *pdev)
>  {
> + if (vga_default)
> + pci_dev_put(vga_default);
> +
> + if (pdev)
> + pdev = pci_dev_get(pdev);
> +
>   vga_default = pdev;
>  }
Seems it could be simplified as
void vga_set_default_device(struct pci_dev *pdev)
{
pci_dev_put(vga_default);
vga_default = pci_dev_get(pdev);
}
--Gerry

>  #endif
> @@ -577,7 +583,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev 
> *pdev)
>  #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
>   if (vga_default == NULL &&
>   ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK))
> - vga_default = pci_dev_get(pdev);
> + vga_set_default_device(pdev);
>  #endif
>  
>   vga_arbiter_check_bridge_sharing(vgadev);
> @@ -613,10 +619,8 @@ static bool vga_arbiter_del_pci_device(struct pci_dev 
> *pdev)
>   }
>  
>  #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
> - if (vga_default == pdev) {
> - pci_dev_put(vga_default);
> - vga_default = NULL;
> - }
> + if (vga_default == pdev)
> + vga_set_default_device(NULL);
>  #endif
>  
>   if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM))
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   >