From patchwork Sun Sep 8 02:48:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 11136781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABF6C76 for ; Sun, 8 Sep 2019 02:48:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D0F4206A1 for ; Sun, 8 Sep 2019 02:48:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D0F4206A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ED2289C94; Sun, 8 Sep 2019 02:48:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 087C889C93; Sun, 8 Sep 2019 02:48:14 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id q21so6951002pfn.11; Sat, 07 Sep 2019 19:48:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PophNlEimsQW360UTE3HQyearMFRv+hM8VNUZL4CMeI=; b=ATq4MzjmjD/bG+JwKraxocED6xCMDqybHw5KfQH7a/Yb8xDfJzJYMDFKrpZ/Pipspx eEgEkKQatWxDoobXuQJ0+H3QxplMFA8ZgBzxJU79wDwK8rusBUDGAbOtyqLh/lRrDW0Q aWxWEUYs1b8BuaDqgf9j6a7o+OGJy2cYyjAik845uWlVdj54bdVDyoCUkF/OTa241q4J KysSw4y/Ghm9IdF3ael7SRgzTLKmfAADAtzOZ8IqpQpu5LAH+r4fHWb8yFHrRJTkKwFJ Czz3G2+mDV62T8nfp+OJJhx08gZtiGaE/aAX/LWfNglb8zwusGjlJa2k7U+IKFuqJdA3 VXwg== X-Gm-Message-State: APjAAAVE44bN8ObnYK49iI9PTnQfhP8wWPpaLVz9xWBLDqA3DDtlcwqM A5xsQ8W0WenqLO88o2p/KYw= X-Google-Smtp-Source: APXvYqwpjlSpKsw3qJDP3BhodT3Sfm86dXKHhTTDo6E1SqPbcCYLOndwf34ATa8oKEZuP0In7Ihi6g== X-Received: by 2002:a63:2a87:: with SMTP id q129mr15507096pgq.101.1567910893480; Sat, 07 Sep 2019 19:48:13 -0700 (PDT) Received: from anarsoul-thinkpad.lan (216-71-213-236.dyn.novuscom.net. [216.71.213.236]) by smtp.gmail.com with ESMTPSA id u9sm10193930pjb.4.2019.09.07.19.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 19:48:13 -0700 (PDT) From: Vasily Khoruzhick To: Qiang Yu , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org Subject: [PATCH] drm/lima: fix lima_gem_wait() return value Date: Sat, 7 Sep 2019 19:48:00 -0700 Message-Id: <20190908024800.23229-1-anarsoul@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PophNlEimsQW360UTE3HQyearMFRv+hM8VNUZL4CMeI=; b=ZThJ03WFI8SPKxX6XqzhzHk60Cs0xzV68F3dRgBtre5sIeoFQNjo1b83wI4DqPX85V AMTRguTZwHUCxw/czq6CmQKaoF2lTXMEkOGIWfCgaIVwGoRfZLQIqJTeotRAslB7yHDw Qj8QsO2o6iWEbddFYukiai9xvaZBy0JLPYG8hQgzRBTKqfowfQxw8EiXDF+aFTOaeuvo TfZR9OHPZ6Le4UfK8NDuex+qxNVwajDFkmyfChdvOnPipi3NFohEIeBM/3iknRPF8GKc /Iy/abiy4b86t4DpdgLT6HFidS71gCdkwwsGUUjhqRKcIF/bGNXLFGdYkV2Y3HVeQlq1 SCrg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick , stable@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME if it timeouts, but lima driver assumed that 0 is error. Cc: stable@vger.kernel.org Signed-off-by: Vasily Khoruzhick Reviewed-by: Qiang Yu --- drivers/gpu/drm/lima/lima_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 477c0f766663..b609dc030d6c 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns) timeout = drm_timeout_abs_to_jiffies(timeout_ns); ret = drm_gem_reservation_object_wait(file, handle, write, timeout); - if (ret == 0) + if (ret == -ETIME) ret = timeout ? -ETIMEDOUT : -EBUSY; return ret;