mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Lars Christensen <larsch@cs.auc.dk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.17 agpgart process hang on crash
Date: Sat, 02 Feb 2002 15:32:02 -0800	[thread overview]
Message-ID: <3C5C76F2.78BA9A54@zip.com.au> (raw)
In-Reply-To: <3C5C68E2.32D11734@zip.com.au> <Pine.GSO.4.33.0202030009280.794-100000@peta.cs.auc.dk>

Lars Christensen wrote:
> 
> No luck. Still hangs (e.g. with ./testgart & pkill -ABRT testgart), with
> and without that patch and with and without 2.4.18-pre7. Does seem to
> happen when dumping core--it doesn't happen with core dumping disabled.
> 

This one, please:

--- linux-2.4.18-pre7/drivers/char/agp/agpgart_fe.c	Sun Aug 12 10:38:48 2001
+++ linux-akpm/drivers/char/agp/agpgart_fe.c	Sat Feb  2 15:29:49 2002
@@ -605,19 +605,18 @@ static int agp_mmap(struct file *file, s
 	agp_client *client;
 	agp_file_private *priv = (agp_file_private *) file->private_data;
 	agp_kern_info kerninfo;
+	int ret = -EPERM;
 
 	lock_kernel();
 	AGP_LOCK();
 
 	if (agp_fe.backend_acquired != TRUE) {
-		AGP_UNLOCK();
-		unlock_kernel();
-		return -EPERM;
+		ret = -EPERM;
+		goto out;
 	}
 	if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags))) {
-		AGP_UNLOCK();
-		unlock_kernel();
-		return -EPERM;
+		ret = -EPERM;
+		goto out;
 	}
 	agp_copy_info(&kerninfo);
 	size = vma->vm_end - vma->vm_start;
@@ -627,52 +626,46 @@ static int agp_mmap(struct file *file, s
 
 	if (test_bit(AGP_FF_IS_CLIENT, &priv->access_flags)) {
 		if ((size + offset) > current_size) {
-			AGP_UNLOCK();
-			unlock_kernel();
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		client = agp_find_client_by_pid(current->pid);
 
 		if (client == NULL) {
-			AGP_UNLOCK();
-			unlock_kernel();
-			return -EPERM;
+			ret = -EPERM;
+			goto out;
 		}
 		if (!agp_find_seg_in_client(client, offset,
 					    size, vma->vm_page_prot)) {
-			AGP_UNLOCK();
-			unlock_kernel();
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		if (remap_page_range(vma->vm_start,
 				     (kerninfo.aper_base + offset),
 				     size, vma->vm_page_prot)) {
-			AGP_UNLOCK();
-			unlock_kernel();
-			return -EAGAIN;
-		}
-		AGP_UNLOCK();
-		unlock_kernel();
-		return 0;
+			ret = -EAGAIN;
+			goto out;
+		}
+		ret = 0;
+		goto out;
 	}
 	if (test_bit(AGP_FF_IS_CONTROLLER, &priv->access_flags)) {
 		if (size != current_size) {
-			AGP_UNLOCK();
-			unlock_kernel();
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		if (remap_page_range(vma->vm_start, kerninfo.aper_base,
 				     size, vma->vm_page_prot)) {
-			AGP_UNLOCK();
-			unlock_kernel();
-			return -EAGAIN;
-		}
-		AGP_UNLOCK();
-		unlock_kernel();
-		return 0;
+			ret = -EAGAIN;
+			goto out;
+		}
+		ret = 0;
 	}
+out:
 	AGP_UNLOCK();
 	unlock_kernel();
+	if (ret == 0)
+		vma->vm_flags |= VM_IO;
 	return -EPERM;
 }

  reply	other threads:[~2002-02-02 23:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-02 21:55 Lars Christensen
2002-02-02 22:17 ` Alan Cox
2002-02-02 22:29   ` Lars Christensen
2002-02-02 22:32 ` Andrew Morton
2002-02-02 23:13   ` Lars Christensen
2002-02-02 23:32     ` Andrew Morton [this message]
2002-02-03  0:13       ` Lars Christensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C5C76F2.78BA9A54@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=larsch@cs.auc.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®