All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] some uio patches
@ 2013-04-26 10:02 Uwe Kleine-König
  2013-04-26 10:02 ` [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-04-26 10:02 UTC (permalink / raw)
  To: Hans J. Koch, Greg Kroah-Hartman; +Cc: linux-kernel, kernel

Hello,

these two patches are not really related, I only sent them in a series because
they touch the same file and fail to apply in reversed order.

Patch 1 is useful for debugging with gdb, patch 2 is a cleanup. Note that patch
2 is only compile-tested because I don't have an uio driver that uses a
non-physical map.

Best regards
Uwe

Uwe Kleine-König (2):
  uio: provide vm access to UIO_MEM_PHYS maps
  uio: drop unused vma_count member in uio_device struct

 drivers/uio/uio.c | 38 ++++++++++++++------------------------
 1 file changed, 14 insertions(+), 24 deletions(-)

-- 
1.8.2.rc2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps
  2013-04-26 10:02 [PATCH 0/2] some uio patches Uwe Kleine-König
@ 2013-04-26 10:02 ` Uwe Kleine-König
  2013-04-26 10:02 ` [PATCH 2/2] uio: drop unused vma_count member in uio_device struct Uwe Kleine-König
  2013-06-26 10:00 ` [PATCH 0/2] some uio patches Uwe Kleine-König
  2 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-04-26 10:02 UTC (permalink / raw)
  To: Hans J. Koch, Greg Kroah-Hartman; +Cc: linux-kernel, kernel

This makes it possible to let gdb access mappings of the process that is
being debugged.

uio_mmap_logical was moved and uio_vm_ops renamed to group related code
and differentiate to new stuff.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/uio/uio.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index c8b9262..f9c905a 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -629,12 +629,24 @@ static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return 0;
 }
 
-static const struct vm_operations_struct uio_vm_ops = {
+static const struct vm_operations_struct uio_logical_vm_ops = {
 	.open = uio_vma_open,
 	.close = uio_vma_close,
 	.fault = uio_vma_fault,
 };
 
+static int uio_mmap_logical(struct vm_area_struct *vma)
+{
+	vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+	vma->vm_ops = &uio_vm_ops;
+	uio_vma_open(vma);
+	return 0;
+}
+
+static const struct vm_operations_struct uio_physical_vm_ops = {
+	.access = generic_access_phys,
+};
+
 static int uio_mmap_physical(struct vm_area_struct *vma)
 {
 	struct uio_device *idev = vma->vm_private_data;
@@ -642,6 +654,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
 	if (mi < 0)
 		return -EINVAL;
 
+	vma->vm_ops = &uio_physical_vm_ops;
+
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
 	return remap_pfn_range(vma,
@@ -651,14 +665,6 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
 			       vma->vm_page_prot);
 }
 
-static int uio_mmap_logical(struct vm_area_struct *vma)
-{
-	vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
-	vma->vm_ops = &uio_vm_ops;
-	uio_vma_open(vma);
-	return 0;
-}
-
 static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
 {
 	struct uio_listener *listener = filep->private_data;
-- 
1.8.2.rc2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] uio: drop unused vma_count member in uio_device struct
  2013-04-26 10:02 [PATCH 0/2] some uio patches Uwe Kleine-König
  2013-04-26 10:02 ` [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps Uwe Kleine-König
@ 2013-04-26 10:02 ` Uwe Kleine-König
  2013-06-26 10:00 ` [PATCH 0/2] some uio patches Uwe Kleine-König
  2 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-04-26 10:02 UTC (permalink / raw)
  To: Hans J. Koch, Greg Kroah-Hartman; +Cc: linux-kernel, kernel

vma_count is used write-only and so fails to be useful. So remove it.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/uio/uio.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index f9c905a..9591691 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -35,7 +35,6 @@ struct uio_device {
 	atomic_t		event;
 	struct fasync_struct	*async_queue;
 	wait_queue_head_t	wait;
-	int			vma_count;
 	struct uio_info		*info;
 	struct kobject		*map_dir;
 	struct kobject		*portio_dir;
@@ -592,18 +591,6 @@ static int uio_find_mem_index(struct vm_area_struct *vma)
 	return -1;
 }
 
-static void uio_vma_open(struct vm_area_struct *vma)
-{
-	struct uio_device *idev = vma->vm_private_data;
-	idev->vma_count++;
-}
-
-static void uio_vma_close(struct vm_area_struct *vma)
-{
-	struct uio_device *idev = vma->vm_private_data;
-	idev->vma_count--;
-}
-
 static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct uio_device *idev = vma->vm_private_data;
@@ -630,8 +617,6 @@ static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 }
 
 static const struct vm_operations_struct uio_logical_vm_ops = {
-	.open = uio_vma_open,
-	.close = uio_vma_close,
 	.fault = uio_vma_fault,
 };
 
@@ -639,7 +624,6 @@ static int uio_mmap_logical(struct vm_area_struct *vma)
 {
 	vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
 	vma->vm_ops = &uio_vm_ops;
-	uio_vma_open(vma);
 	return 0;
 }
 
-- 
1.8.2.rc2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] some uio patches
  2013-04-26 10:02 [PATCH 0/2] some uio patches Uwe Kleine-König
  2013-04-26 10:02 ` [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps Uwe Kleine-König
  2013-04-26 10:02 ` [PATCH 2/2] uio: drop unused vma_count member in uio_device struct Uwe Kleine-König
@ 2013-06-26 10:00 ` Uwe Kleine-König
  2013-06-26 14:38   ` Greg Kroah-Hartman
  2 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2013-06-26 10:00 UTC (permalink / raw)
  To: Hans J. Koch, Greg Kroah-Hartman; +Cc: linux-kernel, kernel

Hello,

On Fri, Apr 26, 2013 at 12:02:27PM +0200, Uwe Kleine-König wrote:
> these two patches are not really related, I only sent them in a series because
> they touch the same file and fail to apply in reversed order.
> 
> Patch 1 is useful for debugging with gdb, patch 2 is a cleanup. Note that patch
> 2 is only compile-tested because I don't have an uio driver that uses a
> non-physical map.
ping

Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] some uio patches
  2013-06-26 10:00 ` [PATCH 0/2] some uio patches Uwe Kleine-König
@ 2013-06-26 14:38   ` Greg Kroah-Hartman
  2013-06-26 14:43     ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2013-06-26 14:38 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Hans J. Koch, linux-kernel, kernel

On Wed, Jun 26, 2013 at 12:00:38PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Fri, Apr 26, 2013 at 12:02:27PM +0200, Uwe Kleine-König wrote:
> > these two patches are not really related, I only sent them in a series because
> > they touch the same file and fail to apply in reversed order.
> > 
> > Patch 1 is useful for debugging with gdb, patch 2 is a cleanup. Note that patch
> > 2 is only compile-tested because I don't have an uio driver that uses a
> > non-physical map.
> ping

ping on what?  I don't have your patches in my to-review queue anymore,
you need to resend them please, like I recently asked for all UIO
patches to be resent.

But my trees are now closed for 3.11, so please wait until after
3.11-rc1 is out before sending them as I can't do anything with them
until then.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] some uio patches
  2013-06-26 14:38   ` Greg Kroah-Hartman
@ 2013-06-26 14:43     ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-06-26 14:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Hans J. Koch, linux-kernel, kernel

On Wed, Jun 26, 2013 at 07:38:57AM -0700, Greg Kroah-Hartman wrote:
> On Wed, Jun 26, 2013 at 12:00:38PM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > On Fri, Apr 26, 2013 at 12:02:27PM +0200, Uwe Kleine-König wrote:
> > > these two patches are not really related, I only sent them in a series because
> > > they touch the same file and fail to apply in reversed order.
> > > 
> > > Patch 1 is useful for debugging with gdb, patch 2 is a cleanup. Note that patch
> > > 2 is only compile-tested because I don't have an uio driver that uses a
> > > non-physical map.
> > ping
> 
> ping on what?  I don't have your patches in my to-review queue anymore,
> you need to resend them please, like I recently asked for all UIO
> patches to be resent.
> But my trees are now closed for 3.11, so please wait until after
> 3.11-rc1 is out before sending them as I can't do anything with them
> until then.
It seems I did miss the request do resend all UIO stuff. So ok, will
come back to you when the merge window is over.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-26 14:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 10:02 [PATCH 0/2] some uio patches Uwe Kleine-König
2013-04-26 10:02 ` [PATCH 1/2] uio: provide vm access to UIO_MEM_PHYS maps Uwe Kleine-König
2013-04-26 10:02 ` [PATCH 2/2] uio: drop unused vma_count member in uio_device struct Uwe Kleine-König
2013-06-26 10:00 ` [PATCH 0/2] some uio patches Uwe Kleine-König
2013-06-26 14:38   ` Greg Kroah-Hartman
2013-06-26 14:43     ` Uwe Kleine-König

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.