From patchwork Thu Oct 10 22:53:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 3019451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B68DB9F1E1 for ; Thu, 10 Oct 2013 22:59:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4079202BE for ; Thu, 10 Oct 2013 22:59:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3BFA202AE for ; Thu, 10 Oct 2013 22:59:18 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUPCJ-0005Yd-VB; Thu, 10 Oct 2013 22:59:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUPCH-0007Cc-8D; Thu, 10 Oct 2013 22:59:09 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUPCD-0007BF-7K for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2013 22:59:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=OG4it8M843i0xrBKFhbYCUH6XlU2RM+4Tl42BfF/xNA=; b=oZODtioG/xFrDIO0i2Kv1M0No2AVw0/M0MWiiJgRu65lFphR/xBO7NgQ5KWrzFByrqpP/2LLKykspx0J3GUC+DyWzjnJUllcjSq4gINfrFYfkJ3ILMrhjI6ue8pS3isHSKuSeh6S3Jwr9AE/VQsHyPDQQLqe/C+JTihfdbs/48I=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:59213) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1VUP6r-0006NR-RA; Thu, 10 Oct 2013 23:53:34 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1VUP6q-0008B6-7Z; Thu, 10 Oct 2013 23:53:32 +0100 Date: Thu, 10 Oct 2013 23:53:31 +0100 From: Russell King - ARM Linux To: Rob Clark Subject: Re: [PATCH 2/5] DRM: Armada: Add Armada DRM driver Message-ID: <20131010225331.GT25034@n2100.arm.linux.org.uk> References: <20131006220728.GG12758@n2100.arm.linux.org.uk> <20131010215951.GS25034@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131010_185906_519503_B438622D X-CRM114-Status: GOOD ( 24.80 ) X-Spam-Score: -1.2 (-) Cc: Jason Cooper , David Airlie , "dri-devel@lists.freedesktop.org" , Daniel Vetter , "linux-arm-kernel@lists.infradead.org" , Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Oct 10, 2013 at 06:23:26PM -0400, Rob Clark wrote: > On Thu, Oct 10, 2013 at 5:59 PM, Russell King - ARM Linux > wrote: > > On Thu, Oct 10, 2013 at 05:25:15PM -0400, Rob Clark wrote: > >> probably this thread is applicable here too? > >> > >> https://lkml.org/lkml/2013/9/12/417 > >> > >> (although.. we have at least a few slightly differet variants on the > >> same errno -> VM_FAULT_x switch in different drivers.. maybe we should > >> do something better) > > > > Hmm. It seems today's vm_insert_pfn() has the following error return > > values: > > > > -EFAULT - virtual address outside vma > > -EINVAL - track_pfn_insert() failure > > -ENOMEM - failed to get locked pte > > -EBUSY - entry already exists in pte > > > > So it seems my handling -EIO, -EAGAIN, -ERESTARTSYS and -EINTR are all > > redundant and can be removed. I'm not sure if it makes sense for this > > to be generic - it looks like it's only Intel, gma500 and me who use > > this, and Intel handles more error codes (due to it calling other > > functions.) > > I just noticed msm and omapdrm are missing the -EBUSY case (have some > patches I need to send), which was why I mentioned this. They do have > other error cases from other fxns, so maybe something generic/common > doesn't make sense.. but I realized i915 fixed the same issue a while > back, so somewhere common has the advantage of somehow not forgetting > to fix other drivers ;-) Here's the promised delta: drivers/gpu/drm/armada/armada_gem.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) Reviewed-by: Rob Clark diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index 02de7a4..1e74f70 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -25,12 +25,7 @@ static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ret = vm_insert_pfn(vma, addr, pfn); switch (ret) { - case -EIO: - case -EAGAIN: - set_need_resched(); case 0: - case -ERESTARTSYS: - case -EINTR: case -EBUSY: return VM_FAULT_NOPAGE; case -ENOMEM: