Wednesday, February 24, 2010

linux.kernel - 26 new messages in 19 topics - digest

linux.kernel
http://groups.google.com/group/linux.kernel?hl=en

linux.kernel@googlegroups.com

Today's topics:

* tuntap with tun_no_pi and X25 question - 2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/f3bea71da0cc010e?hl=en
* supress uid comparison test if core output files are pipes - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/755d4f35ceb69b4d?hl=en
* Congratulations!! Lucky Winner Contact Mr Gore William For Claims - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/4dd5cda71fa6c5a9?hl=en
* sysctl: add proc_do_large_bitmap - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/7fe3356887639418?hl=en
* Regulators: lp3971 - fail if platform data was not supplied - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/9b85fe4e35c44d4b?hl=en
* pps: time synchronization over LPT - 7 messages, 1 author
http://groups.google.com/group/linux.kernel/t/87e7bf64d340f6b6?hl=en
* 2.6.33-rc8-rt1 on Beagle - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/5a89e5a484626839?hl=en
* arch/microblaze fixes for 2.6.33 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/285b25e7bf6c841e?hl=en
* doc: console doc should read "bind & unbind" instead of "bind & bind" - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/8be50e53595724f9?hl=en
* kernel bug? - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/f3dcde8bac39d517?hl=en
* cgroups: fix failure path in cgroup_write_event_control() - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/176cb09b26f07afc?hl=en
* cgroup: fix typo in error handling in cgroup_write_event_control() - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/ebaa5f3813976a68?hl=en
* SB600 64-bit DMA BIOS misconfiguration (formerly RE: [PATCH 2.6.34] ehci-hcd:
add option to enable 64-bit DMA support) - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/b67cc9ede900ffc8?hl=en
* UIO support for >32-bit physical addresses on 32-bit platforms - 1 messages,
1 author
http://groups.google.com/group/linux.kernel/t/14003789bff9cd10?hl=en
* kprobes: Kprobes jump optimization support - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/1c14630811838ef7?hl=en
* windfarm: init sysfs attributes - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/8667019ee9a5d536?hl=en
* Staging: samsung-laptop: fix coding style - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/0504a4f3b31faddf?hl=en
* Bugfixing and improvement of the AT91 MCI driver - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/ab4c21059ddeb36e?hl=en
* Reminder: [PATCH 1/1] Staging: samsung-laptop: fix coding style - 1 messages,
1 author
http://groups.google.com/group/linux.kernel/t/1efeb7fd3990b24d?hl=en

==============================================================================
TOPIC: tuntap with tun_no_pi and X25 question
http://groups.google.com/group/linux.kernel/t/f3bea71da0cc010e?hl=en
==============================================================================

== 1 of 2 ==
Date: Wed, Feb 24 2010 4:00 am
From: andrew hendry


Setting up tun using X25, I can read X25 from the tun but cannot write
to it, hitting this -EINVAL on write.

/* Get packet from user space buffer */
static __inline__ ssize_t tun_get_user(struct tun_struct *tun,
const struct iovec *iv, size_t count,
int noblock)
{

....
case TUN_TUN_DEV:
if (tun->flags & TUN_NO_PI) {
switch (skb->data[0] & 0xf0) {
case 0x40:
pi.proto = htons(ETH_P_IP);
break;
case 0x60:
pi.proto = htons(ETH_P_IPV6);
break;
default:
tun->dev->stats.rx_dropped++;
kfree_skb(skb);
return -EINVAL;
}
}
....

The 0x40 and 0x60 comes from the first byte of the IP which has the
version there?
With X.25 the first byte changes depending on the call sequence, so it
cant be detected and set in the same way.

Is there a way to for a combination of TUNSETIFF with IFF_TUN |
IFF_NO_PI and TUNSETLINK with ARPHRD_X25 to work?
Probably all the non IP type protocols in if_arp.h have the same issue
with IFF_NO_PI?

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


== 2 of 2 ==
Date: Wed, Feb 24 2010 5:10 am
From: Rémi Denis-Courmont

On Wed, 24 Feb 2010 22:52:27 +1100, andrew hendry <andrew.hendry@gmail.com>
wrote:
> The 0x40 and 0x60 comes from the first byte of the IP which has the
> version there?

Yes.

> With X.25 the first byte changes depending on the call sequence, so it
> cant be detected and set in the same way.

Then you need to use PI. That's what it's meant for.

--
Rémi Denis-Courmont
http://www.remlab.net
http://fi.linkedin.com/in/remidenis

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

==============================================================================
TOPIC: supress uid comparison test if core output files are pipes
http://groups.google.com/group/linux.kernel/t/755d4f35ceb69b4d?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 24 2010 4:00 am
From: Neil Horman


On Wed, Feb 24, 2010 at 12:09:03PM +0100, Oleg Nesterov wrote:
> On 02/22, Neil Horman wrote:
> >
> > --- a/fs/exec.c
> > +++ b/fs/exec.c
> > @@ -1987,8 +1987,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
> > /*
> > * Dont allow local users get cute and trick others to coredump
> > * into their pre-created files:
> > + * Note, this is not relevant for pipes
> > */
> > - if (inode->i_uid != current_fsuid())
> > + if (!ispipe && (inode->i_uid != current_fsuid()))
> > goto close_fail;
>
> Ah. This is because the previous recursion-check moved create_write_pipe()
> from current's context to kthread's context, right?
>
Yes, thats correct.

> Looks like a right (and "must have") fix for recent -mm changes to me.
>
Also correct.

>
>
> This also reminds me do_coredump() asks for cleanup. I'll try to redo/resend
> my old cleanup patches on top of your changes.
>
Cool, thanks!
Neil

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

==============================================================================
TOPIC: Congratulations!! Lucky Winner Contact Mr Gore William For Claims
http://groups.google.com/group/linux.kernel/t/4dd5cda71fa6c5a9?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 24 2010 4:10 am
From: British Promo


Congrats..you have won,confirm receipt by sending your Name,Address, Age, Phone
Number Etc to ( bnlclaims@9.cn )
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

==============================================================================
TOPIC: sysctl: add proc_do_large_bitmap
http://groups.google.com/group/linux.kernel/t/7fe3356887639418?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 24 2010 4:10 am
From: Octavian Purdila

On Wednesday 24 February 2010 07:24:00 you wrote:
> Octavian Purdila wrote:
> > Here is a new version of this patch which fixes both the comma and
> > invalid value issues, please give it a try.
>
> Sorry, it is even worse. :(
>
> > [net-next PATCH v5 2/3] sysctl: add proc_do_large_bitmap
> >
> > The new function can be used to read/write large bitmaps via /proc. A
> > comma separated range format is used for compact output and input
> > (e.g. 1,3-4,10-10).
>
> Writing "50000-50100" gets EINVAL, it should be success.
> Writing "50000,50100" fails too.
>

Hmm, they don't fail for me :-/

> Please, at least, do some basic testing.
>

I do test them, I've attached the current test batch I was using.

Anyways, today I've noticed that "1,2 3" does not fail and even more
importantly the final value is "3".

Being that I don't see a way of fixing this without not acknowledging 1,2 even
though we will do set these values, I revisited the "1 2 3" issue. And I don't
understand why this is actually an issue, we are just being more permissive
(i.e. we are allowing as separators both whitespaces and ,).


> Also some comments below.
>
> > diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> > index 5259727..d8ea839 100644
> > --- a/kernel/sysctl.c
> > +++ b/kernel/sysctl.c
> > @@ -2635,6 +2635,140 @@ static int proc_do_cad_pid(struct ctl_table
> > *table, int write,
>
> The above line is wrong, it should be a part of previous line.
>

Probably my email client corrupted the patch, sorry about that, I will be more
careful next time.

> > + int left = *lenp, err = 0;
>
> 'left' should be size_t.
>

Will fix, thanks for catching this.

I will resend the whole patch series once we get this formatting issue
resolved.

==============================================================================
TOPIC: Regulators: lp3971 - fail if platform data was not supplied
http://groups.google.com/group/linux.kernel/t/9b85fe4e35c44d4b?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Feb 24 2010 4:20 am
From: Mark Brown


On Tue, Feb 23, 2010 at 11:38:17PM -0800, Dmitry Torokhov wrote:
> There is no point in completing probe if platform data is missing so
> let's abort loading early.
>
> Also, use kcalloc when allocating several instances of the same data
> structure and mark setup_regulators() as __devinit since it is only
> called from lp3971_i2c_probe() which is __devinit.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

but this *really* should have been split into multiple patches, there's
a large number of different changes mixed in here, with random coding
style tweaks overlapping with substantial changes to the handling of
probe.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

==============================================================================
TOPIC: pps: time synchronization over LPT
http://groups.google.com/group/linux.kernel/t/87e7bf64d340f6b6?hl=en
==============================================================================

== 1 of 7 ==
Date: Wed, Feb 24 2010 4:30 am
From: Alexander Gordeev


This patchset adds a complete solution (well, the kernel part) for fast
high-precision time synchronization between computers using their LPT
ports. My tests show that it is able to achieve synchronization in the
order of 1-2 microseconds and keep it for as long as needed. We are
using this facility in my company for distributed real-time simulation.

The idea is to have a single master computer whose local clock is used
as a standard. It then provides time information through both PPS
high-precision signal over LPT and NTP over network. Then any other
computer can combine these two time sources (this is what ntpd can do).
Client-side ntpd constantly checks that the local time divergence from
the master's time is less then 128ms. If this is true it uses PPS
signal to further decrease the difference. ntpd can try to do itself
but it's too slow and imprecise. This is really a job for the kernel.

All stuff related to the PPS signals in Linux kernel is handled by the
code from LinuxPPS project. It can be controlled from user-space
through PPSAPI (RFC 2783) and ntpd can use it to pass control over
synchronization to the kernel. Unfortunately this is an optional
feature of PPSAPI and it was not implemented. Also Linux code from
NTPv4 reference model was missing all the pieces that deal with PPS.
This patchset closes both gaps to achieve the highest precision and
speed. It:

* adds missing hardpps() function to the NTPv4 Linux kernel code

* adds getnstime_raw_and_real() to atomically get both MONOTONIC_RAW
and REALTIME clock timestamps for hardpps()

* adds missing optional PPSAPI method to bind the particular PPS
source to feed information to the time subsystem through hardpps()

Also it adds the actual parallel port PPS generator and client.

This patchset is tested against the vanilla 2.6.32.9 kernel. But we are
actually using it on 2.6.31.12-rt20 rt-preempt kernel most of the time.
Also there is a version which should be applied on top of LinuxPPS out
of tree patches (i.e. all clients and low-level irq timestamps stuff).
Those who are interested in other versions of the patchset can find
them in my git repository:
http://lvk.cs.msu.su/~lasaine/timesync/linux-2.6-timesync.git

There is one problem however: hardpps() works bad when used on top
of 2.6.33-rc* with CONFIG_NO_HZ enabled. The reason for this is commit
a092ff0f90cae22b2ac8028ecd2c6f6c1a9e4601. Without it hardpps() is able
to sync to 1us precision in about 10 seconds. With it

Changelog
v1 -> v2:
* fix issues pointed out by John Stultz:
* style fixes
* add a about the authorship of the original code
* replace timespec with pps_normtime struct where timespec is used
in a wrong way
* fix seqlock usage in hardpps()
* unbind kernel consumer on device removal
* send raw timestamp instead of the last difference to hardpps() which
simplifies the code and is less error-prone
* update comments in the kernel consumer code to match the reality
* other small fixes

Alexander Gordeev (6):
ntp: add hardpps implementation
pps: unify timestamp gathering
pps: capture MONOTONIC_RAW timestamps as well
pps: add kernel consumer support
pps: add parallel port PPS signal generator
pps: add parallel port PPS client

Documentation/ioctl/ioctl-number.txt | 2 +-
drivers/pps/Kconfig | 5 +
drivers/pps/Makefile | 1 +
drivers/pps/clients/Kconfig | 16 ++
drivers/pps/clients/Makefile | 9 +
drivers/pps/clients/pps_parport.c | 211 +++++++++++++++
drivers/pps/generators/Kconfig | 17 ++
drivers/pps/generators/Makefile | 9 +
drivers/pps/generators/pps_gen_parport.c | 264 +++++++++++++++++++
drivers/pps/kapi.c | 41 +++-
drivers/pps/pps.c | 67 +++++-
include/linux/pps.h | 7 +
include/linux/pps_kernel.h | 30 ++-
include/linux/time.h | 2 +
include/linux/timex.h | 1 +
kernel/time/Kconfig | 7 +
kernel/time/ntp.c | 420 ++++++++++++++++++++++++++++-
kernel/time/timekeeping.c | 34 +++
18 files changed, 1119 insertions(+), 24 deletions(-)
create mode 100644 drivers/pps/clients/Kconfig
create mode 100644 drivers/pps/clients/Makefile
create mode 100644 drivers/pps/clients/pps_parport.c
create mode 100644 drivers/pps/generators/Kconfig
create mode 100644 drivers/pps/generators/Makefile
create mode 100644 drivers/pps/generators/pps_gen_parport.c

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


== 2 of 7 ==
Date: Wed, Feb 24 2010 4:30 am
From: Alexander Gordeev


Add an optional feature of PPSAPI, kernel consumer support, which uses
the added hardpps() function.

Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su>
---
Documentation/ioctl/ioctl-number.txt | 2 +-
drivers/pps/kapi.c | 26 +++++++++++++
drivers/pps/pps.c | 67 +++++++++++++++++++++++++++++++++-
include/linux/pps.h | 7 ++++
include/linux/pps_kernel.h | 6 +++
5 files changed, 106 insertions(+), 2 deletions(-)

diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 9473749..d68718b 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -152,7 +152,7 @@ Code Seq# Include File Comments
'p' 40-7F linux/nvram.h
'p' 80-9F user-space parport
<mailto:tim@cyberelk.net>
-'p' a1-a4 linux/pps.h LinuxPPS
+'p' a1-a5 linux/pps.h LinuxPPS
<mailto:giometti@linux.it>
'q' 00-1F linux/serio.h
'q' 80-FF Internet PhoneJACK, Internet LineJACK
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index b87f699..5871744 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -25,6 +25,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/time.h>
+#include <linux/timex.h>
#include <linux/spinlock.h>
#include <linux/idr.h>
#include <linux/fs.h>
@@ -37,6 +38,12 @@
DEFINE_SPINLOCK(pps_idr_lock);
DEFINE_IDR(pps_idr);

+/* state variables to bind kernel consumer */
+/* PPS API (RFC 2783): current source and mode for ``kernel consumer'' */
+DEFINE_SPINLOCK(pps_kc_hardpps_lock);
+void *pps_kc_hardpps_dev; /* some unique pointer to device */
+int pps_kc_hardpps_mode; /* mode bits for kernel consumer */
+
/*
* Local functions
*/
@@ -248,6 +255,15 @@ void pps_unregister_source(int source)
}
spin_unlock_irq(&pps_idr_lock);

+ spin_lock_irq(&pps_kc_hardpps_lock);
+ if (pps == pps_kc_hardpps_dev) {
+ pps_kc_hardpps_mode = 0;
+ pps_kc_hardpps_dev = NULL;
+ spin_unlock_irq(&pps_kc_hardpps_lock);
+ pr_info("unbound kernel consumer on device removal\n");
+ } else
+ spin_unlock_irq(&pps_kc_hardpps_lock);
+
pps_unregister_cdev(pps);
pps_put_source(pps);
}
@@ -325,6 +341,16 @@ void pps_event(int source, struct pps_event_time *ts, int event, void *data)

captured = ~0;
}
+ spin_lock(&pps_kc_hardpps_lock);
+ if (pps == pps_kc_hardpps_dev && event & pps_kc_hardpps_mode) {
+ struct timespec p_ts = {
+ .tv_sec = ts->ts_real.sec,
+ .tv_nsec = ts->ts_real.nsec
+ };
+
+ hardpps(&p_ts, &ts->ts_raw);
+ }
+ spin_unlock(&pps_kc_hardpps_lock);

/* Wake up iif captured somthing */
if (captured) {
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index ca5183b..22fdcfe 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -62,6 +62,8 @@ static long pps_cdev_ioctl(struct file *file,
struct pps_device *pps = file->private_data;
struct pps_kparams params;
struct pps_fdata fdata;
+ struct pps_bind_args bind_args;
+ unsigned long irq_flags;
unsigned long ticks;
void __user *uarg = (void __user *) arg;
int __user *iuarg = (int __user *) arg;
@@ -186,9 +188,72 @@ static long pps_cdev_ioctl(struct file *file,

break;

+ case PPS_KC_BIND:
+ pr_info("PPS_KC_BIND: source %d\n", pps->id);
+
+ /* Check the capabilities */
+ if (!capable(CAP_SYS_TIME))
+ return -EPERM;
+
+ if (copy_from_user(&bind_args, uarg,
+ sizeof(struct pps_bind_args)))
+ return -EFAULT;
+
+ /* Check for supported capabilities */
+ if ((bind_args.edge & ~pps->info.mode) != 0) {
+ pr_err("PPS_KC_BIND: "
+ "unsupported capabilities (%x)\n",
+ bind_args.edge);
+ return -EINVAL;
+ }
+
+ /* Validate parameters roughly */
+ if (bind_args.tsformat != PPS_TSFMT_TSPEC ||
+ (bind_args.edge & ~PPS_CAPTUREBOTH) != 0 ||
+ bind_args.consumer != PPS_KC_HARDPPS) {
+ pr_err("PPS_KC_BIND: "
+ "invalid kcbind parameters (%x)\n",
+ bind_args.edge);
+ return -EINVAL;
+ }
+
+ /* Check if another consumer is already bound */
+ spin_lock_irqsave(&pps_kc_hardpps_lock, irq_flags);
+
+ if (bind_args.edge == 0)
+ if (pps_kc_hardpps_dev == pps) {
+ pps_kc_hardpps_mode = 0;
+ pps_kc_hardpps_dev = NULL;
+ spin_unlock_irqrestore(&pps_kc_hardpps_lock,
+ irq_flags);
+ pr_info("unbound kernel consumer\n");
+ } else {
+ spin_unlock_irqrestore(&pps_kc_hardpps_lock,
+ irq_flags);
+ pr_err("selected kernel consumer"
+ " is not bound\n");
+ return -EINVAL;
+ }
+ else
+ if (pps_kc_hardpps_dev == NULL ||
+ pps_kc_hardpps_dev == pps) {
+ pps_kc_hardpps_mode = bind_args.edge;
+ pps_kc_hardpps_dev = pps;
+ spin_unlock_irqrestore(&pps_kc_hardpps_lock,
+ irq_flags);
+ pr_info("bound kernel consumer: dev=%p, "
+ "edge=0x%x\n", pps, bind_args.edge);
+ } else {
+ spin_unlock_irqrestore(&pps_kc_hardpps_lock,
+ irq_flags);
+ pr_err("another kernel consumer"
+ " is already bound\n");
+ return -EINVAL;
+ }
+ break;
+
default:
return -ENOTTY;
- break;
}

return 0;
diff --git a/include/linux/pps.h b/include/linux/pps.h
index 0194ab0..a9bb1d9 100644
--- a/include/linux/pps.h
+++ b/include/linux/pps.h
@@ -114,11 +114,18 @@ struct pps_fdata {
struct pps_ktime timeout;
};

+struct pps_bind_args {
+ int tsformat; /* format of time stamps */
+ int edge; /* selected event type */
+ int consumer; /* selected kernel consumer */
+};
+
#include <linux/ioctl.h>

#define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *)
#define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *)
#define PPS_GETCAP _IOR('p', 0xa3, int *)
#define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *)
+#define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate