All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6 4/4] usb: add USB support for Efika
From: Stefano Babic @ 2011-10-31 15:23 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <CAB+7RbGhb5tGhtxFiaVqEcBu_EJACciwKsbA2X6eo8fYPoevzw@mail.gmail.com>

On 10/31/2011 03:58 PM, Jana Rapava wrote:
> 
> 
> 2011/10/31 Stefano Babic <sbabic at denx.de <mailto:sbabic@denx.de>>
> 
>     > There are some issues with: [PATCH 3/4] EHCI: adjust for mx5
>     > If you have already applied it
> 
>     Jana, can you answer / fix this point ?
> 
> 
> I really don't know what happens there. Code file looks aligned, but
> when I generate a patch with git-format-patch, aligning is messed up.

Wait: this can be due to the different positions of the TAB characters,
and to the leading + to mark an added line. It is not a problem.

> So
> I fix it in git-send-email,

Do you mean you change the patch generated by git format-patch ? You
should not do it.

Take a look at your patch. Some defines are removed, and in the patch
you see them as:

-#ifdef CONFIG_MX25
-#define MX25_USB_CTRL_IP_PUE_DOWN_BIT  (1<<6)
-#define MX25_USB_CTRL_HSTD_BIT         (1<<5)
-#define MX25_USB_CTRL_USBTE_BIT                (1<<4)
-#define MX25_USB_CTRL_OCPOL_OTG_BIT    (1<<3)
-#endif

It seems that even in the original file the defines were not aligned.
But this is not true, the disalignment is introduced by the leading "-".

However, when we see some lines later, the defines are added again and
they seem aligned.

+#ifdef CONFIG_MX25
+#define MX25_USB_CTRL_IP_PUE_DOWN_BIT  (1<<6)
+#define MX25_USB_CTRL_HSTD_BIT         (1<<5)
+#define MX25_USB_CTRL_USBTE_BIT        (1<<4)
+#define MX25_USB_CTRL_OCPOL_OTG_BIT    (1<<3)
+#endif

But when we apply the patch, they defines are disaligned again. maybe
you are worrying too much: let the tools doing their work. You have to
check that your changed file is correct (without whitespace instead of
tab), and then call git-format-patch. And do not care if the result
seems producing disaligned entries, this is not true.

There are also other comments by Igor that should be fixed,
independently from this alignment problem. Please fix them and resubmit.

> but after sending  whitespace characters are
> messed up again.
> I wasn't able to find a way to fix it yet.

As I said, you want to fix the result of git-format-patch, but it is
correct. Simply do not do it.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply

* Re: [lm-sensors] [PATCH 2/3] hwmon: (w83627ehf) Clean up probe
From: Guenter Roeck @ 2011-10-31 15:22 UTC (permalink / raw)
  To: lm-sensors
In-Reply-To: <20111031152004.28e9f7b8@endymion.delvare>

On Mon, 2011-10-31 at 10:20 -0400, Jean Delvare wrote:
> The probe function has grown pretty large, I think it's time for some
> cleanups, starting with these two simple ones:
> * Move temp3/in6 check for the W83667HG later in the function, where
>   it is done for all other chip types.
> * Move temperature register setting to a separate function, to avoid
>   code duplication.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>

Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>

Do you want to take this series, or should I take it ?

> ---
> Guenter, had you considered adding support for the NCT6775 and NCT6776
> to a separate driver? The code starts being seriously bloated :(
> 
No thoughts so far. Might be an option, but I am not sure if/when I
would have time to work on it. And I would have to get a board with
NCT6776 on it. If there are any with SandyBridge CPU, I might actually
get one ;).

>  drivers/hwmon/w83627ehf.c |   53 +++++++++++++++++++++++++++------------------
>  1 file changed, 32 insertions(+), 21 deletions(-)
> 
> --- linux-3.2-rc0.orig/drivers/hwmon/w83627ehf.c	2011-10-31 14:24:39.000000000 +0100
> +++ linux-3.2-rc0/drivers/hwmon/w83627ehf.c	2011-10-31 14:31:50.000000000 +0100
> @@ -1853,6 +1853,19 @@ static void w82627ehf_swap_tempreg(struc
>  }
>  
>  static void __devinit
> +w83627ehf_set_temp_reg_ehf(struct w83627ehf_data *data, int n_temp)
> +{
> +	int i;
> +
> +	for (i = 0; i < n_temp; i++) {
> +		data->reg_temp[i] = W83627EHF_REG_TEMP[i];
> +		data->reg_temp_over[i] = W83627EHF_REG_TEMP_OVER[i];
> +		data->reg_temp_hyst[i] = W83627EHF_REG_TEMP_HYST[i];
> +		data->reg_temp_config[i] = W83627EHF_REG_TEMP_CONFIG[i];
> +	}
> +}
> +
> +static void __devinit
>  w83627ehf_check_fan_inputs(const struct w83627ehf_sio_data *sio_data,
>  			   struct w83627ehf_data *data)
>  {
> @@ -1955,17 +1968,8 @@ static int __devinit w83627ehf_probe(str
>  			 || sio_data->kind = nct6775
>  			 || sio_data->kind = nct6776) ? 3 : 4;
>  
> +	/* Default to 3 temperature inputs, code below will adjust as needed */
>  	data->have_temp = 0x07;
> -	/* Check temp3 configuration bit for 667HG */
> -	if (sio_data->kind = w83667hg) {
> -		u8 reg;
> -
> -		reg = w83627ehf_read_value(data, W83627EHF_REG_TEMP_CONFIG[2]);
> -		if (reg & 0x01)
> -			data->have_temp &= ~(1 << 2);
> -		else
> -			data->in6_skip = 1;	/* either temp3 or in6 */
> -	}
>  
>  	/* Deal with temperature register setup first. */
>  	if (sio_data->kind = nct6775 || sio_data->kind = nct6776) {
> @@ -2042,16 +2046,12 @@ static int __devinit w83627ehf_probe(str
>  	} else if (sio_data->kind = w83667hg_b) {
>  		u8 reg;
>  
> +		w83627ehf_set_temp_reg_ehf(data, 4);
> +
>  		/*
>  		 * Temperature sources are selected with bank 0, registers 0x49
>  		 * and 0x4a.
>  		 */
> -		for (i = 0; i < ARRAY_SIZE(W83627EHF_REG_TEMP); i++) {
> -			data->reg_temp[i] = W83627EHF_REG_TEMP[i];
> -			data->reg_temp_over[i] = W83627EHF_REG_TEMP_OVER[i];
> -			data->reg_temp_hyst[i] = W83627EHF_REG_TEMP_HYST[i];
> -			data->reg_temp_config[i] = W83627EHF_REG_TEMP_CONFIG[i];
> -		}
>  		reg = w83627ehf_read_value(data, 0x4a);
>  		data->temp_src[0] = reg >> 5;
>  		reg = w83627ehf_read_value(data, 0x49);
> @@ -2086,12 +2086,23 @@ static int __devinit w83627ehf_probe(str
>  
>  		data->temp_label = w83667hg_b_temp_label;
>  	} else {
> +		w83627ehf_set_temp_reg_ehf(data, 3);
> +
>  		/* Temperature sources are fixed */
> -		for (i = 0; i < 3; i++) {
> -			data->reg_temp[i] = W83627EHF_REG_TEMP[i];
> -			data->reg_temp_over[i] = W83627EHF_REG_TEMP_OVER[i];
> -			data->reg_temp_hyst[i] = W83627EHF_REG_TEMP_HYST[i];
> -			data->reg_temp_config[i] = W83627EHF_REG_TEMP_CONFIG[i];
> +
> +		if (sio_data->kind = w83667hg) {
> +			u8 reg;
> +
> +			/*
> +			 * Chip supports either AUXTIN or VIN3. Try to find
> +			 * out which one.
> +			 */
> +			reg = w83627ehf_read_value(data,
> +						W83627EHF_REG_TEMP_CONFIG[2]);
> +			if (reg & 0x01)
> +				data->have_temp &= ~(1 << 2);
> +			else
> +				data->in6_skip = 1;
>  		}
>  	}
>  
> 
> 



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

^ permalink raw reply

* Virutal tty device settings problem.
From: dpc @ 2011-10-31 15:21 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm writing a virtual console driver for paravirtualized setup.

Use case: being able to access paravirtualized guest consoles from "domain 0".

It's similar to HVCS, as I've been analyzing how it works.


Basically in my driver there's a frontend and backend. Backend is used
by domain 0 exposing tty devices: each for every other guest. One can
attach cu/minicom to such device and access guest console.

The frontend is working on the other guest side and communicate via
shared memory/virtual IRQs with backend. It exposes on tty device for
system console / getty.


Little illustration:

|               GUEST 0               |                  |
 GUEST 1                 |
tty device <--> kernel backend driver <--> magic here <--> kernel
frontend driver <--> tty device
(minicom/cu)
                  (getty)


I have the communication working and my driver transmits bytes between
domain 0 and other systems. So the "magic here" can be considered a
bytestream. But I'm lost with all the modes, cr/nl etc. conversions.

I don't understand which part of the kernel is responsible for NL / CR
conversions, what modes should I use on each side of the driver and
stuff like this. At the moment, from what I understand it seems that
some of termios flags are handled above tty driver layer, and other
should be handled inside/below it. Can anyone point me to documents
explaining this things or explain how should I handle this so that the
scenario from the illustration is working seamlessly?

Any help will be much appreciated.
-- 
Dawid Ciężarkiewicz

^ permalink raw reply

* Re: [PATCH] nfs: Fix unused variable warning.
From: Trond Myklebust @ 2011-10-31 15:18 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: linux-kernel, linux-nfs, akpm
In-Reply-To: <1319798192.26450.1.camel@localhost.localdomain>

On Fri, 2011-10-28 at 16:36 +0600, Rakib Mullick wrote: 
> When CONFIG_NFS=y, but CONFIG_NFS_V3_{,V4}=n we get the following warning:
> 
> 	fs/nfs/write.c: In function ‘nfs_writeback_done’:
> 	fs/nfs/write.c:1246:21: warning: unused variable ‘server’
> 
>  This patch fixes it.
> 
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> ---
> 
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 2219c88..e528e5c 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1243,7 +1243,6 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
>  {
>  	struct nfs_writeargs	*argp = &data->args;
>  	struct nfs_writeres	*resp = &data->res;
> -	struct nfs_server	*server = NFS_SERVER(data->inode);
>  	int status;
>  
>  	dprintk("NFS: %5u nfs_writeback_done (status %d)\n",
> @@ -1272,6 +1271,8 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
>  		 *	 as a dprintk() in order to avoid filling syslog.
>  		 */
>  		static unsigned long    complain;
> +		struct nfs_server	*server;
> +		server = NFS_SERVER(data->inode);
>  
>  		/* Note this will print the MDS for a DS write */
>  		if (time_before(complain, jiffies)) {

This will still cause a warning if you compile without RPC_DEBUG (e.g.
if CONFIG_SYSCTL isn't defined).

Since there is only one user, it seems better to just open-code the
NFS_SERVER(data->inode) in the dprintk()...

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


^ permalink raw reply

* [Buildroot] [Bug 4429] buildroot 2011.08 does not build on Ubuntu 11.10
From: Michael S. Zick @ 2011-10-31 15:18 UTC (permalink / raw)
  To: buildroot
In-Reply-To: <201110310952.48797.minimod@morethan.org>

On Mon October 31 2011, Michael S. Zick wrote:
> On Mon October 31 2011, bugzilla at busybox.net wrote:
> > https://bugs.busybox.net/show_bug.cgi?id=4429
> > 
> > --- Comment #3 from Robert Berger <busybox@reliableembeddedsystems.com> 2011-10-31 14:05:30 UTC ---
> > When I'm __not__ running screen or byubo, but, just ssh to a machine:
> > 
> > echo $SHELL
> > /bin/bash
> > 
> > it compiles.
> > 
> > ---------------------------
> > 
> > When I'm running byubo (and bash)
> > 
> > echo $SHELL
> > /bin/bash
> > 
> > it breaks with the funny errors from above.
> > 
> 
> Check the environment(s) in each case, like:
> set | less
> and compare them.
> 
> Here, on various different installations, I can
> see a lot of differences.
> Each of ssh/screen/byobu modifies and 'filters'
> environment settings in their own way.
>

And then there are the folks at Ubuntu that want to
change the world:
ls -l /bin/sh

Mike 
> You might find something modified in the environment
> settings that is causing the problems.
> 
> Also take note about file ownership(s) not being what
> you might expect in some uses of byobu that is mentioned
> in their documentation.
> 
> Mike
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 
> 

^ permalink raw reply

* [PATCH 2/2] nfs41: handle BLK_LAYOUT CB_RECALL_ANY
From: Peng Tao @ 2011-10-31 15:15 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond.Myklebust, bhalevy, Peng Tao
In-Reply-To: <1320074136-3087-1-git-send-email-bergwolf@gmail.com>

For blocklayout, we need to issue layoutreturn to return layouts when
handling CB_RECALL_ANY.

Signed-off-by: Peng Tao <peng_tao@emc.com>
---
 fs/nfs/callback_proc.c |   55 +++++++++++++++++++++++++++++++++++++++++-------
 include/linux/nfs4.h   |    3 +-
 2 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 43926ad..11f79c2 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -160,7 +160,8 @@ static u32 initiate_file_draining(struct nfs_client *clp,
 }
 
 static u32 initiate_bulk_draining(struct nfs_client *clp,
-				  struct cb_layoutrecallargs *args)
+				  struct cb_layoutrecallargs *args,
+				  int sendreturn)
 {
 	struct nfs_server *server;
 	struct pnfs_layout_hdr *lo;
@@ -204,12 +205,47 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
 		list_del_init(&lo->plh_bulk_recall);
 		spin_unlock(&ino->i_lock);
 		pnfs_free_lseg_list(&free_me_list);
+		if (sendreturn && list_empty(&lo->plh_segs))
+			pnfs_return_layout(ino);
 		put_layout_hdr(lo);
 		iput(ino);
 	}
 	return rv;
 }
 
+struct recallany_data {
+	struct nfs_client *clp;
+	struct work_struct ra_work;
+};
+
+static void layout_recallany_draining(struct work_struct *work)
+{
+	struct recallany_data *ra;
+	struct cb_layoutrecallargs args;
+
+	memset(&args, 0, sizeof(args));
+	ra = container_of(work, struct recallany_data, ra_work);
+	/* Ignore draining error. Per RFC, if layoutreturns are not sent, it is up
+	 * to server to handle the situation (e.g., send specific layoutrecalls).
+	 */
+	initiate_bulk_draining(ra->clp, &args, 1);
+	kfree(ra);
+}
+
+static u32 init_recallany_draining(struct nfs_client *clp)
+{
+	struct recallany_data *ra;
+
+	ra = kmalloc(sizeof(*ra), GFP_NOFS);
+	if (ra) {
+		ra->clp = clp;
+		INIT_WORK(&ra->ra_work, layout_recallany_draining);
+		schedule_work(&ra->ra_work);
+		return NFS4_OK;
+	}
+	return NFS4ERR_DELAY;
+}
+
 static u32 do_callback_layoutrecall(struct nfs_client *clp,
 				    struct cb_layoutrecallargs *args)
 {
@@ -220,8 +256,10 @@ static u32 do_callback_layoutrecall(struct nfs_client *clp,
 		goto out;
 	if (args->cbl_recall_type == RETURN_FILE)
 		res = initiate_file_draining(clp, args);
+	if (args->cbl_recall_type == RETURN_ANY)
+		res = init_recallany_draining(clp);
 	else
-		res = initiate_bulk_draining(clp, args);
+		res = initiate_bulk_draining(clp, args, 0);
 	clear_bit(NFS4CLNT_LAYOUTRECALL, &clp->cl_state);
 out:
 	dprintk("%s returning %i\n", __func__, res);
@@ -245,15 +283,13 @@ __be32 nfs4_callback_layoutrecall(struct cb_layoutrecallargs *args,
 	return cpu_to_be32(res);
 }
 
-static void pnfs_recall_all_layouts(struct nfs_client *clp)
+static __be32 pnfs_recall_all_layouts(struct nfs_client *clp, uint32_t type)
 {
 	struct cb_layoutrecallargs args;
 
-	/* Pretend we got a CB_LAYOUTRECALL(ALL) */
 	memset(&args, 0, sizeof(args));
-	args.cbl_recall_type = RETURN_ALL;
-	/* FIXME we ignore errors, what should we do? */
-	do_callback_layoutrecall(clp, &args);
+	args.cbl_recall_type = type;
+	return cpu_to_be32(do_callback_layoutrecall(clp, &args));
 }
 
 __be32 nfs4_callback_devicenotify(struct cb_devicenotifyargs *args,
@@ -533,7 +569,10 @@ __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy,
 		flags |= FMODE_WRITE;
 	if (test_bit(RCA4_TYPE_MASK_FILE_LAYOUT, (const unsigned long *)
 		     &args->craa_type_mask))
-		pnfs_recall_all_layouts(cps->clp);
+		pnfs_recall_all_layouts(cps->clp, RETURN_ALL);
+	if (test_bit(RCA4_TYPE_MASK_BLK_LAYOUT, (const unsigned long *)
+		     &args->craa_type_mask))
+		status = pnfs_recall_all_layouts(cps->clp, RETURN_ANY);
 	if (flags)
 		nfs_expire_all_delegation_types(cps->clp, flags);
 out:
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 76f99e8..1f71a9e 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -597,7 +597,8 @@ enum pnfs_layouttype {
 enum pnfs_layoutreturn_type {
 	RETURN_FILE = 1,
 	RETURN_FSID = 2,
-	RETURN_ALL  = 3
+	RETURN_ALL  = 3,
+	RETURN_ANY  = 4
 };
 
 enum pnfs_iomode {
-- 
1.7.1.262.g5ef3d


^ permalink raw reply related

* [PATCH 6/6] v4l2-ctrls: Use v4l2_subscribed_event_ops
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart, Hans de Goede
In-Reply-To: <1320074209-23473-1-git-send-email-hdegoede@redhat.com>

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/video/ivtv/ivtv-ioctl.c |    3 +-
 drivers/media/video/pwc/pwc-v4l.c     |    2 +-
 drivers/media/video/v4l2-ctrls.c      |   56 +++++++++++++++++++++++++++------
 drivers/media/video/v4l2-event.c      |   39 -----------------------
 drivers/media/video/vivi.c            |    2 +-
 include/media/v4l2-ctrls.h            |    7 ++--
 6 files changed, 53 insertions(+), 56 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 9aec8a0..72fd74f 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1455,8 +1455,9 @@ static int ivtv_subscribe_event(struct v4l2_fh *fh, struct v4l2_event_subscripti
 	switch (sub->type) {
 	case V4L2_EVENT_VSYNC:
 	case V4L2_EVENT_EOS:
-	case V4L2_EVENT_CTRL:
 		return v4l2_event_subscribe(fh, sub, 0, NULL);
+	case V4L2_EVENT_CTRL:
+		return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops);
 	default:
 		return -EINVAL;
 	}
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index 7f159bf..afc5b15 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -1138,7 +1138,7 @@ static int pwc_subscribe_event(struct v4l2_fh *fh,
 {
 	switch (sub->type) {
 	case V4L2_EVENT_CTRL:
-		return v4l2_event_subscribe(fh, sub, 0, NULL);
+		return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops);
 	default:
 		return -EINVAL;
 	}
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index 69e24f4..c4dec20 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -2329,10 +2329,22 @@ int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val)
 }
 EXPORT_SYMBOL(v4l2_ctrl_s_ctrl);
 
-void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
-				struct v4l2_subscribed_event *sev)
+static int v4l2_ctrl_add_event(struct v4l2_subscribed_event *sev)
 {
-	v4l2_ctrl_lock(ctrl);
+	struct v4l2_ctrl_handler *hdl = sev->fh->ctrl_handler;
+	struct v4l2_ctrl_ref *ref;
+	struct v4l2_ctrl *ctrl;
+	int ret = 0;
+
+	mutex_lock(&hdl->lock);
+
+	ref = find_ref(hdl, sev->id);
+	if (!ref) {
+		ret = -EINVAL;
+		goto leave;
+	}
+	ctrl = ref->ctrl;
+
 	list_add_tail(&sev->node, &ctrl->ev_subs);
 	if (ctrl->type != V4L2_CTRL_TYPE_CTRL_CLASS &&
 	    (sev->flags & V4L2_EVENT_SUB_FL_SEND_INITIAL)) {
@@ -2344,15 +2356,39 @@ void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
 		fill_event(&ev, ctrl, changes);
 		v4l2_event_queue_fh(sev->fh, &ev);
 	}
-	v4l2_ctrl_unlock(ctrl);
+leave:
+	mutex_unlock(&hdl->lock);
+	return ret;
 }
-EXPORT_SYMBOL(v4l2_ctrl_add_event);
 
-void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
-				struct v4l2_subscribed_event *sev)
+static void v4l2_ctrl_del_event(struct v4l2_subscribed_event *sev)
 {
-	v4l2_ctrl_lock(ctrl);
+	struct v4l2_ctrl_handler *hdl = sev->fh->ctrl_handler;
+
+	mutex_lock(&hdl->lock);
 	list_del(&sev->node);
-	v4l2_ctrl_unlock(ctrl);
+	mutex_unlock(&hdl->lock);
 }
-EXPORT_SYMBOL(v4l2_ctrl_del_event);
+
+void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new)
+{
+	u32 old_changes = old->u.ctrl.changes;
+
+	old->u.ctrl = new->u.ctrl;
+	old->u.ctrl.changes |= old_changes;
+}
+EXPORT_SYMBOL(v4l2_ctrl_replace);
+
+void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new)
+{
+	new->u.ctrl.changes |= old->u.ctrl.changes;
+}
+EXPORT_SYMBOL(v4l2_ctrl_merge);
+
+const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops = {
+	.add = v4l2_ctrl_add_event,
+	.del = v4l2_ctrl_del_event,
+	.replace = v4l2_ctrl_replace,
+	.merge = v4l2_ctrl_merge,
+};
+EXPORT_SYMBOL(v4l2_ctrl_sub_ev_ops);
diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index c56dc35..2f5ee7b 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -25,7 +25,6 @@
 #include <media/v4l2-dev.h>
 #include <media/v4l2-fh.h>
 #include <media/v4l2-event.h>
-#include <media/v4l2-ctrls.h>
 
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -194,30 +193,11 @@ int v4l2_event_pending(struct v4l2_fh *fh)
 }
 EXPORT_SYMBOL_GPL(v4l2_event_pending);
 
-static void ctrls_replace(struct v4l2_event *old, const struct v4l2_event *new)
-{
-	u32 old_changes = old->u.ctrl.changes;
-
-	old->u.ctrl = new->u.ctrl;
-	old->u.ctrl.changes |= old_changes;
-}
-
-static void ctrls_merge(const struct v4l2_event *old, struct v4l2_event *new)
-{
-	new->u.ctrl.changes |= old->u.ctrl.changes;
-}
-
-static const struct v4l2_subscribed_event_ops ctrl_ops = {
-	.replace = ctrls_replace,
-	.merge = ctrls_merge,
-};
-
 int v4l2_event_subscribe(struct v4l2_fh *fh,
 			 struct v4l2_event_subscription *sub, unsigned elems,
 			 const struct v4l2_subscribed_event_ops *ops)
 {
 	struct v4l2_subscribed_event *sev, *found_ev;
-	struct v4l2_ctrl *ctrl = NULL;
 	unsigned long flags;
 	unsigned i;
 
@@ -226,11 +206,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 
 	if (elems < 1)
 		elems = 1;
-	if (sub->type == V4L2_EVENT_CTRL) {
-		ctrl = v4l2_ctrl_find(fh->ctrl_handler, sub->id);
-		if (ctrl == NULL)
-			return -EINVAL;
-	}
 
 	sev = kzalloc(sizeof(*sev) + sizeof(struct v4l2_kevent) * elems, GFP_KERNEL);
 	if (!sev)
@@ -243,9 +218,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 	sev->fh = fh;
 	sev->elems = elems;
 	sev->ops = ops;
-	if (ctrl) {
-		sev->ops = &ctrl_ops;
-	}
 
 	spin_lock_irqsave(&fh->vdev->fh_lock, flags);
 	found_ev = v4l2_event_subscribed(fh, sub->type, sub->id);
@@ -267,10 +239,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 		}
 	}
 
-	/* v4l2_ctrl_add_event uses a mutex, so do this outside the spin lock */
-	if (ctrl)
-		v4l2_ctrl_add_event(ctrl, sev);
-
 	return 0;
 }
 EXPORT_SYMBOL_GPL(v4l2_event_subscribe);
@@ -329,13 +297,6 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
 	if (sev && sev->ops && sev->ops->del)
 		sev->ops->del(sev);
 
-	if (sev && sev->type == V4L2_EVENT_CTRL) {
-		struct v4l2_ctrl *ctrl = v4l2_ctrl_find(fh->ctrl_handler, sev->id);
-
-		if (ctrl)
-			v4l2_ctrl_del_event(ctrl, sev);
-	}
-
 	kfree(sev);
 
 	return 0;
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 74ebbad..ce1783d 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1013,7 +1013,7 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
 {
 	switch (sub->type) {
 	case V4L2_EVENT_CTRL:
-		return v4l2_event_subscribe(fh, sub, 0, NULL);
+		return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops);
 	default:
 		return -EINVAL;
 	}
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index eeb3df6..fde17ff 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -487,10 +487,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
 int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
 
 /* Internal helper functions that deal with control events. */
-void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
-		struct v4l2_subscribed_event *sev);
-void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
-		struct v4l2_subscribed_event *sev);
+extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops;
+void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);
+void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new);
 
 /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */
 int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc);
-- 
1.7.7


^ permalink raw reply related

* [PATCH 5/6] v4l2-event: Add v4l2_subscribed_event_ops
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart, Hans de Goede
In-Reply-To: <1320074209-23473-1-git-send-email-hdegoede@redhat.com>

Just like with ctrl events, drivers may want to get called back on
listener add / remove for other event types too. Rather then special
casing all of this in subscribe / unsubscribe event it is better to
use ops for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 Documentation/video4linux/v4l2-framework.txt |   28 +++++++++++++----
 drivers/media/video/ivtv/ivtv-ioctl.c        |    2 +-
 drivers/media/video/omap3isp/ispccdc.c       |    2 +-
 drivers/media/video/omap3isp/ispstat.c       |    2 +-
 drivers/media/video/pwc/pwc-v4l.c            |    2 +-
 drivers/media/video/v4l2-event.c             |   42 +++++++++++++++++++------
 drivers/media/video/vivi.c                   |    2 +-
 include/media/v4l2-event.h                   |   24 ++++++++++----
 8 files changed, 75 insertions(+), 29 deletions(-)

diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index f8dcabf..16eb8af 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -930,21 +930,35 @@ fast.
 
 Useful functions:
 
-- v4l2_event_queue()
+void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)
 
   Queue events to video device. The driver's only responsibility is to fill
   in the type and the data fields. The other fields will be filled in by
   V4L2.
 
-- v4l2_event_subscribe()
+int v4l2_event_subscribe(struct v4l2_fh *fh,
+			 struct v4l2_event_subscription *sub, unsigned elems,
+			 const struct v4l2_subscribed_event_ops *ops)
 
   The video_device->ioctl_ops->vidioc_subscribe_event must check the driver
   is able to produce events with specified event id. Then it calls
-  v4l2_event_subscribe() to subscribe the event. The last argument is the
-  size of the event queue for this event. If it is 0, then the framework
-  will fill in a default value (this depends on the event type).
+  v4l2_event_subscribe() to subscribe the event.
 
-- v4l2_event_unsubscribe()
+  The elems argument is the size of the event queue for this event. If it is 0,
+  then the framework will fill in a default value (this depends on the event
+  type).
+
+  The ops argument allows the driver to specify a number of callbacks:
+  * add:     called when a new listener gets added (subscribing to the same
+             event twice will only cause this callback to get called once)
+  * del:     called when a listener stops listening
+  * replace: replace event 'old' with event 'new'.
+  * merge:   merge event 'old' into event 'new'.
+  All 4 callbacks are optional, if you don't want to specify any callbacks
+  the ops argument itself maybe NULL.
+
+int v4l2_event_unsubscribe(struct v4l2_fh *fh,
+			   struct v4l2_event_subscription *sub)
 
   vidioc_unsubscribe_event in struct v4l2_ioctl_ops. A driver may use
   v4l2_event_unsubscribe() directly unless it wants to be involved in
@@ -953,7 +967,7 @@ Useful functions:
   The special type V4L2_EVENT_ALL may be used to unsubscribe all events. The
   drivers may want to handle this in a special way.
 
-- v4l2_event_pending()
+int v4l2_event_pending(struct v4l2_fh *fh)
 
   Returns the number of pending events. Useful when implementing poll.
 
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index ecafa69..9aec8a0 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1456,7 +1456,7 @@ static int ivtv_subscribe_event(struct v4l2_fh *fh, struct v4l2_event_subscripti
 	case V4L2_EVENT_VSYNC:
 	case V4L2_EVENT_EOS:
 	case V4L2_EVENT_CTRL:
-		return v4l2_event_subscribe(fh, sub, 0);
+		return v4l2_event_subscribe(fh, sub, 0, NULL);
 	default:
 		return -EINVAL;
 	}
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 40b141c..b6da736 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -1700,7 +1700,7 @@ static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
 	if (sub->id != 0)
 		return -EINVAL;
 
-	return v4l2_event_subscribe(fh, sub, OMAP3ISP_CCDC_NEVENTS);
+	return v4l2_event_subscribe(fh, sub, OMAP3ISP_CCDC_NEVENTS, NULL);
 }
 
 static int ccdc_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
diff --git a/drivers/media/video/omap3isp/ispstat.c b/drivers/media/video/omap3isp/ispstat.c
index 8080659..4f337a2 100644
--- a/drivers/media/video/omap3isp/ispstat.c
+++ b/drivers/media/video/omap3isp/ispstat.c
@@ -1049,7 +1049,7 @@ int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
 	if (sub->type != stat->event_type)
 		return -EINVAL;
 
-	return v4l2_event_subscribe(fh, sub, STAT_NEVENTS);
+	return v4l2_event_subscribe(fh, sub, STAT_NEVENTS, NULL);
 }
 
 int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index 68e1323..7f159bf 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -1138,7 +1138,7 @@ static int pwc_subscribe_event(struct v4l2_fh *fh,
 {
 	switch (sub->type) {
 	case V4L2_EVENT_CTRL:
-		return v4l2_event_subscribe(fh, sub, 0);
+		return v4l2_event_subscribe(fh, sub, 0, NULL);
 	default:
 		return -EINVAL;
 	}
diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index 3d27300..c56dc35 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -131,14 +131,14 @@ static void __v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *e
 		sev->first = sev_pos(sev, 1);
 		fh->navailable--;
 		if (sev->elems == 1) {
-			if (sev->replace) {
-				sev->replace(&kev->event, ev);
+			if (sev->ops && sev->ops->replace) {
+				sev->ops->replace(&kev->event, ev);
 				copy_payload = false;
 			}
-		} else if (sev->merge) {
+		} else if (sev->ops && sev->ops->merge) {
 			struct v4l2_kevent *second_oldest =
 				sev->events + sev_pos(sev, 0);
-			sev->merge(&kev->event, &second_oldest->event);
+			sev->ops->merge(&kev->event, &second_oldest->event);
 		}
 	}
 
@@ -207,8 +207,14 @@ static void ctrls_merge(const struct v4l2_event *old, struct v4l2_event *new)
 	new->u.ctrl.changes |= old->u.ctrl.changes;
 }
 
+static const struct v4l2_subscribed_event_ops ctrl_ops = {
+	.replace = ctrls_replace,
+	.merge = ctrls_merge,
+};
+
 int v4l2_event_subscribe(struct v4l2_fh *fh,
-			 struct v4l2_event_subscription *sub, unsigned elems)
+			 struct v4l2_event_subscription *sub, unsigned elems,
+			 const struct v4l2_subscribed_event_ops *ops)
 {
 	struct v4l2_subscribed_event *sev, *found_ev;
 	struct v4l2_ctrl *ctrl = NULL;
@@ -236,9 +242,9 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 	sev->flags = sub->flags;
 	sev->fh = fh;
 	sev->elems = elems;
+	sev->ops = ops;
 	if (ctrl) {
-		sev->replace = ctrls_replace;
-		sev->merge = ctrls_merge;
+		sev->ops = &ctrl_ops;
 	}
 
 	spin_lock_irqsave(&fh->vdev->fh_lock, flags);
@@ -247,10 +253,22 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 		list_add(&sev->list, &fh->subscribed);
 	spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
 
-	/* v4l2_ctrl_add_event uses a mutex, so do this outside the spin lock */
-	if (found_ev)
+	if (found_ev) {
 		kfree(sev);
-	else if (ctrl)
+		return 0; /* Already listening */
+	}
+
+	if (sev->ops && sev->ops->add) {
+		int ret = sev->ops->add(sev);
+		if (ret) {
+			sev->ops = NULL;
+			v4l2_event_unsubscribe(fh, sub);
+			return ret;
+		}
+	}
+
+	/* v4l2_ctrl_add_event uses a mutex, so do this outside the spin lock */
+	if (ctrl)
 		v4l2_ctrl_add_event(ctrl, sev);
 
 	return 0;
@@ -307,6 +325,10 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
 	}
 
 	spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
+
+	if (sev && sev->ops && sev->ops->del)
+		sev->ops->del(sev);
+
 	if (sev && sev->type == V4L2_EVENT_CTRL) {
 		struct v4l2_ctrl *ctrl = v4l2_ctrl_find(fh->ctrl_handler, sev->id);
 
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index c25787d..74ebbad 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1013,7 +1013,7 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
 {
 	switch (sub->type) {
 	case V4L2_EVENT_CTRL:
-		return v4l2_event_subscribe(fh, sub, 0);
+		return v4l2_event_subscribe(fh, sub, 0, NULL);
 	default:
 		return -EINVAL;
 	}
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 5f14e88..88fa9a1 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -78,6 +78,19 @@ struct v4l2_kevent {
 	struct v4l2_event	event;
 };
 
+/** struct v4l2_subscribed_event_ops - Subscribed event operations.
+  * @add:	Optional callback, called when a new listener is added
+  * @del:	Optional callback, called when a listener stops listening
+  * @replace:	Optional callback that can replace event 'old' with event 'new'.
+  * @merge:	Optional callback that can merge event 'old' into event 'new'.
+  */
+struct v4l2_subscribed_event_ops {
+	int  (*add)(struct v4l2_subscribed_event *sev);
+	void (*del)(struct v4l2_subscribed_event *sev);
+	void (*replace)(struct v4l2_event *old, const struct v4l2_event *new);
+	void (*merge)(const struct v4l2_event *old, struct v4l2_event *new);
+};
+
 /** struct v4l2_subscribed_event - Internal struct representing a subscribed event.
   * @list:	List node for the v4l2_fh->subscribed list.
   * @type:	Event type.
@@ -85,8 +98,7 @@ struct v4l2_kevent {
   * @flags:	Copy of v4l2_event_subscription->flags.
   * @fh:	Filehandle that subscribed to this event.
   * @node:	List node that hooks into the object's event list (if there is one).
-  * @replace:	Optional callback that can replace event 'old' with event 'new'.
-  * @merge:	Optional callback that can merge event 'old' into event 'new'.
+  * @ops:	v4l2_subscribed_event_ops
   * @elems:	The number of elements in the events array.
   * @first:	The index of the events containing the oldest available event.
   * @in_use:	The number of queued events.
@@ -99,10 +111,7 @@ struct v4l2_subscribed_event {
 	u32			flags;
 	struct v4l2_fh		*fh;
 	struct list_head	node;
-	void			(*replace)(struct v4l2_event *old,
-					   const struct v4l2_event *new);
-	void			(*merge)(const struct v4l2_event *old,
-					 struct v4l2_event *new);
+	const struct v4l2_subscribed_event_ops *ops;
 	unsigned		elems;
 	unsigned		first;
 	unsigned		in_use;
@@ -115,7 +124,8 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev);
 void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev);
 int v4l2_event_pending(struct v4l2_fh *fh);
 int v4l2_event_subscribe(struct v4l2_fh *fh,
-			 struct v4l2_event_subscription *sub, unsigned elems);
+			 struct v4l2_event_subscription *sub, unsigned elems,
+			 const struct v4l2_subscribed_event_ops *ops);
 int v4l2_event_unsubscribe(struct v4l2_fh *fh,
 			   struct v4l2_event_subscription *sub);
 void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
-- 
1.7.7


^ permalink raw reply related

* [PATCH 1/2 RESEND] NFS4: fix cb_recallany decode error
From: Peng Tao @ 2011-10-31 15:15 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond.Myklebust, bhalevy, Peng Tao

craa_type_mask is bitmap4 according to RFC5661. We need to expect a length before
extracting its value.

Signed-off-by: Peng Tao <peng_tao@emc.com>
---
Resend this one as it is a dependency for "[PATCH 2/2] nfs41: handle BLK_LAYOUT CB_RECALL_ANY".

 fs/nfs/callback_xdr.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 918ad64..ee1a5b3 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -488,17 +488,18 @@ static __be32 decode_recallany_args(struct svc_rqst *rqstp,
 				      struct xdr_stream *xdr,
 				      struct cb_recallanyargs *args)
 {
-	__be32 *p;
+	uint32_t bitmap[2];
+	__be32 *p, status;
 
 	args->craa_addr = svc_addr(rqstp);
 	p = read_buf(xdr, 4);
 	if (unlikely(p == NULL))
 		return htonl(NFS4ERR_BADXDR);
 	args->craa_objs_to_keep = ntohl(*p++);
-	p = read_buf(xdr, 4);
-	if (unlikely(p == NULL))
-		return htonl(NFS4ERR_BADXDR);
-	args->craa_type_mask = ntohl(*p);
+	status = decode_bitmap(xdr, bitmap);
+	if (unlikely(status))
+		return status;
+	args->craa_type_mask = bitmap[0];
 
 	return 0;
 }
-- 
1.7.1.262.g5ef3d


^ permalink raw reply related

* [PATCH 4/6] v4l2-event: Don't set sev->fh to NULL on unsubcribe
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart, Hans de Goede
In-Reply-To: <1320074209-23473-1-git-send-email-hdegoede@redhat.com>

1: There is no reason for this after v4l2_event_unsubscribe releases the
spinlock nothing is holding a reference to the sev anymore except for the
local reference in the v4l2_event_unsubscribe function.

2: Setting sev->fh to NULL causes problems for the del op added in the next
patch of this series, since this op needs a way to get to its own data
structures, and typically this will be done by using container_of on an
embedded v4l2_fh struct.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/video/v4l2-event.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index 01cbb7f..3d27300 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -304,7 +304,6 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
 			}
 		}
 		list_del(&sev->list);
-		sev->fh = NULL;
 	}
 
 	spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
-- 
1.7.7


^ permalink raw reply related

* [PATCH 3/6] v4l2-event: Remove pending events from fh event queue when unsubscribing
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart, Hans de Goede
In-Reply-To: <1320074209-23473-1-git-send-email-hdegoede@redhat.com>

The kev pointers inside the pending events queue (the available queue) of the
fh point to data inside the sev, unsubscribing frees the sev, thus making these
pointers point to freed memory!

This patch fixes these dangling pointers in the available queue by removing
all matching pending events on unsubscription.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/video/v4l2-event.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index 9f56f18..01cbb7f 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -284,6 +284,7 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
 			   struct v4l2_event_subscription *sub)
 {
 	struct v4l2_subscribed_event *sev;
+	struct v4l2_kevent *kev, *next;
 	unsigned long flags;
 
 	if (sub->type == V4L2_EVENT_ALL) {
@@ -295,6 +296,13 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh,
 
 	sev = v4l2_event_subscribed(fh, sub->type, sub->id);
 	if (sev != NULL) {
+		/* Remove any pending events for this subscription */
+		list_for_each_entry_safe(kev, next, &fh->available, list) {
+			if (kev->sev == sev) {
+				list_del(&kev->list);
+				fh->navailable--;
+			}
+		}
 		list_del(&sev->list);
 		sev->fh = NULL;
 	}
-- 
1.7.7


^ permalink raw reply related

* [PATCH 2/6] v4l2-event: Deny subscribing with a type of V4L2_EVENT_ALL
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart, Hans de Goede
In-Reply-To: <1320074209-23473-1-git-send-email-hdegoede@redhat.com>

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/video/v4l2-event.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index 53b190c..9f56f18 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -215,6 +215,9 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
 	unsigned long flags;
 	unsigned i;
 
+	if (sub->type == V4L2_EVENT_ALL)
+		return -EINVAL;
+
 	if (elems < 1)
 		elems = 1;
 	if (sub->type == V4L2_EVENT_CTRL) {
-- 
1.7.7


^ permalink raw reply related

* [PATCH 1/6] v4l2-ctrl: Send change events to all fh for auto cluster slave controls
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart, Hans de Goede
In-Reply-To: <1320074209-23473-1-git-send-email-hdegoede@redhat.com>

Otherwise the fh changing the master control won't get the inactive state
change event for the slave controls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/video/v4l2-ctrls.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index fc8666a..69e24f4 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -945,6 +945,7 @@ static void new_to_cur(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl,
 			if (ctrl->cluster[0]->has_volatiles)
 				ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
 		}
+		fh = NULL;
 	}
 	if (changed || update_inactive) {
 		/* If a control was changed that was not one of the controls
-- 
1.7.7


^ permalink raw reply related

* Various ctrl and event frame work patches (version 2)
From: Hans de Goede @ 2011-10-31 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: hverkuil, Laurent Pinchart

Hi All,

This patch set obsoletes my previous "add v4l2_subscribed_event_ops" set,
while working on adding support for ctrl-events to the uvc driver I found
a few bugs in the event code, which this patchset fixes.

Changes since version 1:
-Added a documentation update (update v4l2-framework.txt) to:
 "v4l2-event: Add v4l2_subscribed_event_ops"

Regards,

Hans



^ permalink raw reply

* Nand support for i.MX233
From: David.Kiland @ 2011-10-31 15:16 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 113 bytes --]

Hi,
Is there anyone out there working on NAND support for the freescale 
i.MX233 processor?

Regards David Kiland

[-- Attachment #1.2: Type: text/html, Size: 238 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

^ permalink raw reply

* Re: [PATCH] drm/radeon/kms: remove useless radeon_ddc_dump()
From: Thomas Reim @ 2011-10-31 15:15 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, dri-devel, Thomas Reim
In-Reply-To: <CADnq5_N7f0tpFisprO_45yTKf5tRJFE-kP_ZYQWudiYEZgTgxw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 6693 bytes --]

Dear Alex, 

your reply confuses me:

> On Sat, Oct 29, 2011 at 8:55 AM, Thomas Reim <reimth@googlemail.com> wrote:
> > Dear Alex,
> >
> > but we use DDC probing e. g. to identify connectors with improperly
> > terminated i2c bus. Instead of flooding logs and terminals with EDID dumps,
> > we decided some months ago to use this function during module loading to
> > inform the user once (and only once!), which connector has a monitor
> > connected with valid EDID and which connector has not.
> 
> There's nothing in that function that actually prevents the printing
> of bad EDIDs.  

That's true. 

> All it does is call drm_get_edid() and report whether
> it found an EDID or not.  radeon_dvi_detect() already takes into
> account the requires_extended_probe flag. 

The extended probe flag will prevent the radeon driver from further
useless printing of bad EDIDs every ten seconds:

in radeon_connectors.c:
if (radeon_connector->ddc_bus)
                dret = radeon_ddc_probe(radeon_connector,
                                        radeon_connector->requires_extended_probe);
        if (dret) {
                if (radeon_connector->edid) {
                        kfree(radeon_connector->edid);
                        radeon_connector->edid = NULL;
                }
                radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);




But the now to be removed function radeon_ddc_dump() took care during
connector setup that at least one (!) dump was in the logs, accompagnied
by the info, that no monitor is connected, or there is a wrong/buggy
EDID. 

in radeon_display.c:
radeon_print_display_setup(dev);
                list_for_each_entry(drm_connector, &dev->mode_config.connector_list, head)
                        radeon_ddc_dump(drm_connector);


I cannot imagine why this should confuse users. Having retrieved and
configured connectors plus info plus EDID dump in case of problems
logged next to each other was perfect.

> The connectors are probed by
> the fb code for the console as well so it just adds to the module load
> time.  If we want to print what connectors are connected, it should be
> done from the fb code so we only have to do it once.
> 

I briefly checked the code, but couldn't find a promising connector
probing function in the fb code. Did you mean function
drm_fb_helper_probe_connector_modes?


> > Graphic solutions in general have several connectors integrated, and it's
> > sometimes really difficult to identify, which one of the does not work as
> > expected, based on the logs. From above log we see, that a monitor is
> > connected to DVI connector, nothing is connected to the VGA connector, and
> > we have a problem with the HDMI connector. Without this fuinction, nothing
> > helpful from radeon module would be in the logs.
> 
> We should print the connector name in the generic drm error code then
> if we want to print this info at boot time.

Is there a place that is not called every ten seconds?

> 
> >
> > Maybe we can keep this function, but call it only for connectors, for which
> > it works, i. e. not for DP, eDP and DP bridge connectors.
> 
> That's just as bad.  Users won't understand why only certain
> connectors are probed.
> 
> >
> > Best regards
> >
> > Thomas Reim
> >
> > Am Dienstag, den 25.10.2011, 19:24 -0400 schrieb alexdeucher@gmail.com:
> >
> > From: Alex Deucher <alexander.deucher@amd.com>
> >
> > The function didn't work with DP, eDP, or DP bridge
> > connectors and thus confused users as it lead them to
> > believe nothing was connected or the EDID was invalid
> > when in fact is was, just on the aux bus rather an i2c.
> >
> > It should also speed up module loading as it avoids a
> > bunch of extra DDC probing.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> >  drivers/gpu/drm/radeon/radeon_display.c |   33
> > -------------------------------
> >  1 files changed, 0 insertions(+), 33 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_display.c
> > b/drivers/gpu/drm/radeon/radeon_display.c
> > index 6adb3e5..4998736 100644
> > --- a/drivers/gpu/drm/radeon/radeon_display.c
> > +++ b/drivers/gpu/drm/radeon/radeon_display.c
> > @@ -33,8 +33,6 @@
> >  #include "drm_crtc_helper.h"
> >  #include "drm_edid.h"
> >
> > -static int radeon_ddc_dump(struct drm_connector *connector);
> > -
> >  static void avivo_crtc_load_lut(struct drm_crtc *crtc)
> >  {
> >  	struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
> > @@ -669,7 +667,6 @@ static void radeon_print_display_setup(struct drm_device
> > *dev)
> >  static bool radeon_setup_enc_conn(struct drm_device *dev)
> >  {
> >  	struct radeon_device *rdev = dev->dev_private;
> > -	struct drm_connector *drm_connector;
> >  	bool ret = false;
> >
> >  	if (rdev->bios) {
> > @@ -689,8 +686,6 @@ static bool radeon_setup_enc_conn(struct drm_device
> > *dev)
> >  	if (ret) {
> >  		radeon_setup_encoder_clones(dev);
> >  		radeon_print_display_setup(dev);
> > -		list_for_each_entry(drm_connector, &dev->mode_config.connector_list,
> > head)
> > -			radeon_ddc_dump(drm_connector);
> >  	}
> >
> >  	return ret;
> > @@ -743,34 +738,6 @@ int radeon_ddc_get_modes(struct radeon_connector
> > *radeon_connector)
> >  	return 0;
> >  }
> >
> > -static int radeon_ddc_dump(struct drm_connector *connector)
> > -{
> > -	struct edid *edid;
> > -	struct radeon_connector *radeon_connector =
> > to_radeon_connector(connector);
> > -	int ret = 0;
> > -
> > -	/* on hw with routers, select right port */
> > -	if (radeon_connector->router.ddc_valid)
> > -		radeon_router_select_ddc_port(radeon_connector);
> > -
> > -	if (!radeon_connector->ddc_bus)
> > -		return -1;
> > -	edid = drm_get_edid(connector, &radeon_connector->ddc_bus->adapter);
> > -	/* Log EDID retrieval status here. In particular with regard to
> > -	 * connectors with requires_extended_probe flag set, that will prevent
> > -	 * function radeon_dvi_detect() to fetch EDID on this connector,
> > -	 * as long as there is no valid EDID header found */
> > -	if (edid) {
> > -		DRM_INFO("Radeon display connector %s: Found valid EDID",
> > -				drm_get_connector_name(connector));
> > -		kfree(edid);
> > -	} else {
> > -		DRM_INFO("Radeon display connector %s: No monitor connected or invalid
> > EDID",
> > -				drm_get_connector_name(connector));
> > -	}
> > -	return ret;
> > -}
> > -
> >  /* avivo */
> >  static void avivo_get_fb_div(struct radeon_pll *pll,
> >  			     u32 target_clock,
> >
> >


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: [Qemu-devel] 1.0 Hard Freeze Logistics
From: Anthony Liguori @ 2011-10-31 15:07 UTC (permalink / raw)
  To: qemu-devel, kvm-devel
In-Reply-To: <4EAEA278.7000901@us.ibm.com>

On 10/31/2011 08:28 AM, Anthony Liguori wrote:
> Hi,
>
> Here are the logistics for the upcoming 1.0 hard freeze. All dates are reflected
> in the wiki[1].
>
> If you're a contributor and you've sent a series before the soft freeze
> deadline, you've already done everything you need to do so sit back and enjoy
> gorge yourself on Halloween candy.
>
> If you're a submaintainer, the deadline for PULL requests for 1.0 hard freeze
> will be EOD tomorrow (May 1st).

Er, November 1st.  I have no idea what was going through my mind.

Regards,

Anthony Liguori

>
> I encourage all submaintainers to spend today and tomorrow reviewing any
> outstanding patches on the mailing list. I will do the same.
>
> Once everything is processed, I'll update VERSION, and tag v1.0-rc0. I will not
> upload a -rc0 tarball since this is basically a git snapshot. Unlike previous
> releases, we will do this stable development in HEAD.
>
> Our first release candidate will be tagged and released on November 7th (next
> Tuesday). I'll do the release that Monday evening so that the -rc1 build is
> available for out Test Day[2].
>
> To make the Test Day more successful, please sign up to test a specific area on
> the Test[3] wiki page.
>
> We have a fairly long -rc cycle for this release so I expect submaintainers will
> continue to maintain patches in their tree. I also think it would be good to set
> up a -next staging tree but we can discuss that more in another thread.
>
> [1] http://wiki.qemu.org/Planning/1.0
> [2] http://mid.gmane.org/4EA94D53.3000707@redhat.com
> [3] http://wiki.qemu.org/Planning/1.0/Testing
>
> Regards,
>
> Anthony Liguori

^ permalink raw reply

* Re: [RFC][PATCH 0/2] PM / Sleep: Extended control of suspend/hibernate interfaces
From: Richard Hughes @ 2011-10-31 15:11 UTC (permalink / raw)
  To: linux-kernel
In-Reply-To: <20111017093401.21cd4461@notabene.brown>

NeilBrown <neilb <at> suse.de> writes:
> gnome-power-manager talks to upowerd over dbus to ask for a suspend.

Quite a few other desktops talk to upower, including XFCE, KDE and LXDE.
It's basically the only way on a modern desktop a user can put the
machine to sleep without becoming root.

> upowerd then runs /usr/sbin/pm-suspend.
> pm-suspend then runs all the script in /usr/lib/pm-utils/sleep.d/
> and the calls "do_suspend" which is defined in
> /usr/lib/pm-utils/pm-functions
> 
> Ugghh.. That is a very deep stack that is doing things the "wrong"
> way.
> i.e. it is structured about request to suspend rather than requests to
> stay awake.

Erm, that's what it was designed to do. UPower has never had any feature
requests to manage "stay-awake" functionality as upower is pretty much a
mechanism daemon, rather than a policy daemon. Certainly just writing to
/sys if /usr/lib/pm-utils/pm-functions isn't installed would be a very
sane patch to suggest, given that pm-suspend in Fedora 16 basically
doesn't do anything anymore.

UPower does have signals that tell userspace when a suspend is about to
happen, and when the computer has been resumed, and this is done using
DBus.

I think it would be a shame to have Yet Another Daemon and Yet Another
Protocol just for managing this stuff, when upower already has DBus and
tons of client support. I think adding a tiny DBus interface on upower
to manage the stay-awake functionality would make things much less
complicated and give us a common desktop / embedded story.

Richard.

(please cc me in any replies, not subscribed)



^ permalink raw reply

* [U-Boot] [PATCH v2] e1000: fix bugs from recent commits
From: Moffett, Kyle D @ 2011-10-31 15:14 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1319916784-13899-1-git-send-email-wd@denx.de>

On Oct 29, 2011, at 15:33, Wolfgang Denk wrote:
> Commit 114d7fc0 "e1000: Rewrite EEPROM checksum error to give more
> information" failed to initialize the checksum variable which should
> result in random results. Fix that.
> 
> Commit 2326a94d caused a ton of "unused variable 'x'" warnings.
> Fix these.  While we are at it, remove some bogus parens.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Kyle Moffett <Kyle.D.Moffett@boeing.com>

Tested-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>

Thanks for doing this; my apologies for missing these issues in the first place.

Cheers,
Kyle Moffett

^ permalink raw reply

* Re: 1.0 Hard Freeze Logistics
From: Anthony Liguori @ 2011-10-31 15:07 UTC (permalink / raw)
  To: qemu-devel, kvm-devel
In-Reply-To: <4EAEA278.7000901@us.ibm.com>

On 10/31/2011 08:28 AM, Anthony Liguori wrote:
> Hi,
>
> Here are the logistics for the upcoming 1.0 hard freeze. All dates are reflected
> in the wiki[1].
>
> If you're a contributor and you've sent a series before the soft freeze
> deadline, you've already done everything you need to do so sit back and enjoy
> gorge yourself on Halloween candy.
>
> If you're a submaintainer, the deadline for PULL requests for 1.0 hard freeze
> will be EOD tomorrow (May 1st).

Er, November 1st.  I have no idea what was going through my mind.

Regards,

Anthony Liguori

>
> I encourage all submaintainers to spend today and tomorrow reviewing any
> outstanding patches on the mailing list. I will do the same.
>
> Once everything is processed, I'll update VERSION, and tag v1.0-rc0. I will not
> upload a -rc0 tarball since this is basically a git snapshot. Unlike previous
> releases, we will do this stable development in HEAD.
>
> Our first release candidate will be tagged and released on November 7th (next
> Tuesday). I'll do the release that Monday evening so that the -rc1 build is
> available for out Test Day[2].
>
> To make the Test Day more successful, please sign up to test a specific area on
> the Test[3] wiki page.
>
> We have a fairly long -rc cycle for this release so I expect submaintainers will
> continue to maintain patches in their tree. I also think it would be good to set
> up a -next staging tree but we can discuss that more in another thread.
>
> [1] http://wiki.qemu.org/Planning/1.0
> [2] http://mid.gmane.org/4EA94D53.3000707@redhat.com
> [3] http://wiki.qemu.org/Planning/1.0/Testing
>
> Regards,
>
> Anthony Liguori


^ permalink raw reply

* [U-Boot] [PATCH] miiphy: Note that miiphy_* API is deprecated
From: Andy Fleming @ 2011-10-31 15:12 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <CAOZdJXWXxKfcuJ15bLS225kD8TVa7vwhpvZwAubC3wi2gLG5Nw@mail.gmail.com>


On Oct 31, 2011, at 10:08 AM, Tabi Timur-B04825 wrote:

> On Mon, Oct 31, 2011 at 9:46 AM, Andy Fleming <afleming@freescale.com> wrote:
>> We want to move everything to phylib, and we definitely don't want
>> new drivers using the miiphy infrastructure.
> 
> How about using gcc's deprecated function feature?  Or is that too aggressive?


I don't think we want every net driver prior to the last release to create a warning. We may switch to that after we get some momentum on switching drivers over. The first goal is just to provide information that a new driver-writer may see so that the old API doesn't expand.

Andy

^ permalink raw reply

* Re: any objection to adding a PREMIRRORS section to the QS guide?
From: Rifenbark, Scott M @ 2011-10-31 15:10 UTC (permalink / raw)
  To: Robert P. J. Day, Yocto discussion list
In-Reply-To: <alpine.DEB.2.02.1110301034330.32366@localhost6.localdomain6>

Robert, 

We do have a question addressed in the Yocto Project Reference Manual that talks about premirrors and how Poky finds stuff.  See the H.24 section of the manual http://www.yoctoproject.org/docs/current/poky-ref-manual/poky-ref-manual.html.  Maybe this information is a bit too buried to be useful.  I could specifically reference that FAQ entry from within the QS in the same area that I mention the other "useful" items to consider in the local.conf file, such as BB_NUMBER_THREADS, etc.

Scott



-----Original Message-----
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Robert P. J. Day
Sent: Sunday, October 30, 2011 7:40 AM
To: Yocto discussion list
Subject: [yocto] any objection to adding a PREMIRRORS section to the QS guide?


  perhaps outside the scope of QS, but might it be worth adding a
short section on appending something like this to one's local.conf
file before starting the download?

PREMIRRORS_prepend = "\
git://.*/.* file:///home/rpjday/dl/ \n \
svn://.*/.* file:///home/rpjday/dl/ \n \
cvs://.*/.* file:///home/rpjday/dl/ \n \
ftp://.*/.* file:///home/rpjday/dl/ \n \
http://.*/.* file:///home/rpjday/dl/ \n \
https://.*/.* file:///home/rpjday/dl/ \n"

  the rationale is that, like myself, a number of people could be
coming to yocto from OE and already have a sizable downloads directory
somewhere on their system that they want to take advantage of and,
with the above, if my downloads directory is up to date, i end up not
having to download a single tarball from the net.

  thoughts?  is the above relatively complete or is there anything
else i would want to add to that variable?  and, again, is it worth
adding a side reference to that for people who could take advantage
of it?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply

* Re: nfsd4_is_junction
From: Chuck Lever @ 2011-10-31 15:09 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: J. Bruce Fields, Christoph Hellwig, linux-nfs
In-Reply-To: <1319931380.11288.3.camel@lade.trondhjem.org>


On Oct 29, 2011, at 7:36 PM, Trond Myklebust wrote:

> On Sat, 2011-10-29 at 14:38 -0400, Chuck Lever wrote: 
>> On Oct 29, 2011, at 2:09 PM, J. Bruce Fields wrote:
>> 
>>> On Sat, Oct 29, 2011 at 01:58:02PM -0400, Chuck Lever wrote:
>>>> 
>>>> On Oct 29, 2011, at 1:55 PM, J. Bruce Fields wrote:
>>>> 
>>>>> On Sat, Oct 29, 2011 at 01:47:55PM -0400, Chuck Lever wrote:
>>>>>> 
>>>>>> On Oct 29, 2011, at 6:16 AM, Christoph Hellwig wrote:
>>>>>> 
>>>>>>> This function should probably grow a check for S_NOSEC instead of
>>>>>>> hitting the filesystems with an xattr read for every lookup.
>>>>>> 
>>>>>> It doesn't perform the xattr read on _every_ lookup, but only when the object has a special set of permission bits.
>>>>>> 
>>>>>> But actually, it probably doesn't need that 'type" attribute check at all.  It should delegate that check to mountd.  I assume many of those upcalls would hit in the export cache anyway?
>>>>> 
>>>>> You're suggesting doing an upcall on every path that passes the mode-bit
>>>>> checks?
>>>>> 
>>>>> You'd end up populating the export cache with every path that passes
>>>>> the mode-bit checks.  I don't think that's a good idea.
>>>> 
>>>> You just finished telling us that the mode bit checks would prevent doing an attribute read too often.  Again, how often do we think there will be directories with no execute bits set and the sticky bit set?  I think that's going to be exceptionally rare.
>>> 
>>> Yeah, probably so, but if there's a pathological case where we're wrong
>>> then I think excessive xattr reads will be less annoying than excessive
>>> upcalls and export cache entries.
>> 
>> If we find a pathological case, we should fix it.
>> 
>> Basically I'd like the kernel check to be as simple as possible not only because it should be fast, but also so that user space can implement junctions flexibly, especially in the early days when we are still unsure of how these need to work.  I think we are better off being flexible to start, and restricting only if we have to.
>> 
>> Or to put it another way, user space, and not the kernel, should arbitrate policy.  The semantics of junctions is a policy, at least for now.
>> 
>> And lastly, right now, I expect that nearly 100% of the time the mode bit test and the xattr test will either both succeed or both fail.  That suggests one of them is redundant.
> 
> They are almost redundant: If you do the xattr test, then you don't need
> to do the mode bit test. However if you do the mode bit test, then you
> still need to do the xattr test.
> 
> Basically, the mode bit test is supposed to be the speedup that avoids
> the need for another S_NOSEC-style bit...

OK, just to close this out:  I'm hearing that folks are not interested in getting rid of the "trusted.junction.type" extended attribute.  I don't agree, but I will accede and continue to support its use for junctions that NFSD has to pay attention to.

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





^ permalink raw reply

* [PATCH iptables] libxt_NFQUEUE: fix --queue-bypass ipt-save output
From: Florian Westphal @ 2011-10-31 15:10 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

else, this will print "--queue-num 0--queue-bypass ".

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 extensions/libxt_NFQUEUE.c |    2 +-
 tests/options-most.rules   |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/extensions/libxt_NFQUEUE.c b/extensions/libxt_NFQUEUE.c
index e47b586..8c2f699 100644
--- a/extensions/libxt_NFQUEUE.c
+++ b/extensions/libxt_NFQUEUE.c
@@ -152,7 +152,7 @@ static void NFQUEUE_save_v2(const void *ip, const struct xt_entry_target *target
 	NFQUEUE_save_v1(ip, target);
 
 	if (info->bypass)
-		printf("--queue-bypass ");
+		printf(" --queue-bypass");
 }
 
 static void NFQUEUE_init_v1(struct xt_entry_target *t)
diff --git a/tests/options-most.rules b/tests/options-most.rules
index ae28b82..7573361 100644
--- a/tests/options-most.rules
+++ b/tests/options-most.rules
@@ -178,6 +178,8 @@
 -A ntarg
 -A ntarg -j NFQUEUE --queue-balance 8:99
 -A ntarg
+-A ntarg -j NFQUEUE --queue-num 0 --queue-bypass
+-A ntarg
 -A ntarg -j RATEEST --rateest-name RE1 --rateest-interval 250.0ms --rateest-ewmalog 500.0ms
 -A ntarg
 -A ntarg -j RATEEST --rateest-name RE2 --rateest-interval 250.0ms --rateest-ewmalog 500.0ms
-- 
1.7.3.4


^ permalink raw reply related

* [U-Boot] Enabling cache on ARM
From: Stefano Babic @ 2011-10-31 15:09 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <CAOMZO5DeX51==Jr7U537qLp7CwFpdPCxx0DicF64+Tg0Po2ciQ@mail.gmail.com>

On 10/31/2011 03:36 PM, Fabio Estevam wrote:
> Hi Stefano and Albert,
> 
> I would like to enable cache on some i.MX boards (ARM9, ARM11 and Cortex-A8).
> 
> Are there any boards I could use as a reference on how to properly
> implement this?
> 
> I thought I should simply do:
> 
> #undef CONFIG_SYS_ICACHE_OFF
> #undef CONFIG_SYS_DCACHE_OFF

This is not enough, at least for systems where cache is not yet supported.

> 
> ,but still I get a 'WARNING: Caches not enabled' message when I do this.

The reason is that enable_caches is missing for i.MX targets. You can
try to add enable_caches inside your board file, and implement it
calling dcache_enable().

However, i.MX drivers are actually proofed to be faulty when the cache
is enabled. At least the FEC driver and the MMC driver must be changed
to make them working when cache is on.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply


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