Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3359819ybb; Sun, 22 Mar 2020 22:40:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvOP0txIuINXTtaze5vNCodAC/ZwHXRUaqj2Z62hK4ZZ+OlX3bRn42uOTB35tkOjYV3xUYT X-Received: by 2002:a9d:554a:: with SMTP id h10mr15869592oti.344.1584942000751; Sun, 22 Mar 2020 22:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584942000; cv=none; d=google.com; s=arc-20160816; b=dssVt8iWSJEle11eEgZmdKbyBPBvJLhi5GioaoOD6F0a49/nwc57qhDYGM/ClKMrJ1 oIvZA3Q9XnYaE1MzayEFIGvcBgs0JaNS6GUoxKJVni2NmTPpQiX6u1wO81ntHuLpEDI/ F/AOV3G51+F2Ql7hfHwpPr4NWwAt8egv60iau9mIjHA99Np+ZL0IMsjfP7BB9VqT0jVA ThzXaGgTREJ1zvTVk7q2CpY1TZQywH3JgwpV/bel2BdL0/qva9m2k5i/iMFENiQxTa+L VJuxJK5ZrdOQMcfXEwI48h0ArxRHAJn0Qz+zIKKqBzYa/ExX7cRCmoIYjUwhHKx9ZORt kO0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=/2+Rh2oJaS+Prgl54+/LOuGVTC2yfq8dsF5aT+p4fuw=; b=jrYAUWpOY+ZBNQd6lTIq4YN4MbN0PtSRMfxUaQ4+Ryd+ojeyd8vd42LhF/DqKENd+r B98rzgNpFUBg328i+kYQQBjAt2IV9voIfkhKWvM/dT6J+IFAUPzXMuJOD+DleRaf/HDI 9KOD5bMy2sK698PlXgQ9aJ/BWxfQ9FZf9tqxcRRZnOehoyjC00JS5urP6ngdGlA/L8Uw 9h6/hVHAEdNJ3ULeP2l1ZzoUWIxWeVXjdoR18FxIqn5cxx42Hjs17koXrdgaOZ0lU0rR HfclsBnaPKxM2ZYmio0P6KWiT2sb2BHaNUTv5Dd8lJWbmerv5dsobm4h/uEa5P0Z7wT1 pKLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si98400ots.139.2020.03.22.22.39.48; Sun, 22 Mar 2020 22:40:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727154AbgCWFiR convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Mar 2020 01:38:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:43636 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgCWFiQ (ORCPT ); Mon, 23 Mar 2020 01:38:16 -0400 Received: from mail-pj1-f72.google.com ([209.85.216.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jGFmw-0006F3-2t for linux-kernel@vger.kernel.org; Mon, 23 Mar 2020 05:38:14 +0000 Received: by mail-pj1-f72.google.com with SMTP id r42so9703541pjb.8 for ; Sun, 22 Mar 2020 22:38: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:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=EDzKju/OPsqw3AjvZmw+YrycxupmTQRJ//NFxktKcVs=; b=Z9I4xCuLXZiW/0w0xTeskLiK/eMiQTxC4Scjye74hkcZkoHrm2tCf6f01ZUxIkQ5AS VpckRz8bkTrnNcJD22RO7p2G5RUqvWnKX3yuShylEqE7gkfr3n/OfClSwbeazbxhc/va mWFCzC/Hbhez9+LFILgI/nCDlLxXwjf+VNuZZR1r+yl9/FHyTmCCcdNZo++GiPrDdua4 y8EBPBYgGGMPl7wBqGJo1WxEIH6yWg6qUvcQXrfGABWWZIP96+L8+15BtMIanb2vfVSr PmQ9yTQdWcUYCCX0TpWiKevHbCd+Pvb14yn/TCjhQPKO3GL5w3/EaW9f8z6aLBSYOmlY eJLw== X-Gm-Message-State: ANhLgQ2LhIuIy2iAW4wuZSzCnlgeVEZOfcNPs+0pHV/yMDAQQFohBdcl kNGk75W+AaO5ofzAA1bK5X7Q7tDBk1TJOg72QADoKyWYVWV45GhwqtubMKiGQ53Z9QRvVtLnqAL bOjRFGU70o6TmOj9uWwOBkxGxGCwZywcak/YEoig/bA== X-Received: by 2002:a63:1e57:: with SMTP id p23mr20953108pgm.316.1584941892498; Sun, 22 Mar 2020 22:38:12 -0700 (PDT) X-Received: by 2002:a63:1e57:: with SMTP id p23mr20953093pgm.316.1584941892154; Sun, 22 Mar 2020 22:38:12 -0700 (PDT) Received: from [192.168.1.208] (220-133-187-190.HINET-IP.hinet.net. [220.133.187.190]) by smtp.gmail.com with ESMTPSA id y9sm10976793pjj.17.2020.03.22.22.38.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2020 22:38:11 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH] i2c: nvidia-gpu: Handle timeout correctly in gpu_i2c_check_status() From: Kai-Heng Feng In-Reply-To: <20200311165806.12365-1-kai.heng.feng@canonical.com> Date: Mon, 23 Mar 2020 13:38:09 +0800 Cc: Wolfram Sang , Andy Shevchenko , "open list:I2C CONTROLLER DRIVER FOR NVIDIA GPU" , open list Content-Transfer-Encoding: 8BIT Message-Id: References: <20200311165806.12365-1-kai.heng.feng@canonical.com> To: ajayg@nvidia.com X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 12, 2020, at 00:58, Kai-Heng Feng wrote: > > Nvidia card may come with a "phantom" UCSI device, and its driver gets > stuck in probe routine, prevents any system PM operations like suspend. > > Let's handle the unaccounted case that the target time equals to jiffies > in gpu_i2c_check_status(), so the UCSI driver can let the probe fail as > it should. > > Fixes: c71bcdcb42a7 ("i2c: add i2c bus driver for NVIDIA GPU") > Signed-off-by: Kai-Heng Feng A gentle ping... > --- > drivers/i2c/busses/i2c-nvidia-gpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c > index 62e18b4db0ed..1988e93c7925 100644 > --- a/drivers/i2c/busses/i2c-nvidia-gpu.c > +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c > @@ -88,7 +88,7 @@ static int gpu_i2c_check_status(struct gpu_i2c_dev *i2cd) > usleep_range(500, 600); > } while (time_is_after_jiffies(target)); > > - if (time_is_before_jiffies(target)) { > + if (time_is_before_eq_jiffies(target)) { > dev_err(i2cd->dev, "i2c timeout error %x\n", val); > return -ETIMEDOUT; > } > -- > 2.17.1 >