From patchwork Thu Nov 26 00:03:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 7703711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A23289FCAA for ; Thu, 26 Nov 2015 00:04:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C727D208CD for ; Thu, 26 Nov 2015 00:04:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5B12E208D0 for ; Thu, 26 Nov 2015 00:04:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9457F6E0F1; Wed, 25 Nov 2015 16:04:13 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F9776E091; Wed, 25 Nov 2015 16:04:10 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 25 Nov 2015 16:04:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,344,1444719600"; d="scan'208";a="859509028" Received: from rdvivi-dublin.jf.intel.com ([10.7.196.164]) by orsmga002.jf.intel.com with ESMTP; 25 Nov 2015 16:04:10 -0800 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/9] drm/nouveau: Use EAGAIN instead EBUSY for aux retry. Date: Wed, 25 Nov 2015 16:03:59 -0800 Message-Id: <1448496245-1495-4-git-send-email-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1448496245-1495-1-git-send-email-rodrigo.vivi@intel.com> References: <1448496245-1495-1-git-send-email-rodrigo.vivi@intel.com> Cc: dri-devel@lists.freedesktop.org, Rodrigo Vivi X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Current EBUSY meaning is immediately retry, but this is about to change. DRM aux transfer is about to change and make EAGAIN the immediately retry and use EBUSY to wait a bit for aux channels to recover for any error or wake up. This has no functional change if the EAGAIN support is in place already for drm aux transfer. Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c | 4 ++-- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm204.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c index 954f5b7..a6cd729 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c @@ -52,7 +52,7 @@ g94_i2c_aux_init(struct g94_i2c_aux *aux) udelay(1); if (!timeout--) { AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl); - return -EBUSY; + return -EAGAIN; } } while (ctrl & 0x03010000); @@ -65,7 +65,7 @@ g94_i2c_aux_init(struct g94_i2c_aux *aux) if (!timeout--) { AUX_ERR(&aux->base, "magic wait %08x", ctrl); g94_i2c_aux_fini(aux); - return -EBUSY; + return -EAGAIN; } } while ((ctrl & 0x03000000) != urep); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm204.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm204.c index bed231b..6814e5b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm204.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm204.c @@ -52,7 +52,7 @@ gm204_i2c_aux_init(struct gm204_i2c_aux *aux) udelay(1); if (!timeout--) { AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl); - return -EBUSY; + return -EAGAIN; } } while (ctrl & 0x03010000); @@ -65,7 +65,7 @@ gm204_i2c_aux_init(struct gm204_i2c_aux *aux) if (!timeout--) { AUX_ERR(&aux->base, "magic wait %08x", ctrl); gm204_i2c_aux_fini(aux); - return -EBUSY; + return -EAGAIN; } } while ((ctrl & 0x03000000) != urep);