Received: by 10.192.165.148 with SMTP id m20csp2537119imm; Sun, 22 Apr 2018 09:05:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+KHes4BeibH96H3gLvjqJ363zWIPcC+IJ1Bjd2fnNZCYd59vh4ekp0Fb1E1w8QYe8LEoZ3 X-Received: by 10.98.70.155 with SMTP id o27mr16924004pfi.124.1524413137546; Sun, 22 Apr 2018 09:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413137; cv=none; d=google.com; s=arc-20160816; b=lBIdZ445grEzci3ecSXd4sSkUXGK/MizosICNOFpYyVl1QGP2ng2BpvbhxXqnhPVvQ LkBmIk5QPfWXxmaQPVXo0FjkcvmFyoGh6AKR8Mzzs+ncmxbnHtBjk9lYHHdWl+xxoYk1 IKOOnSv5N/Yw3DZH6otQDqtak7NJvPTUbQzGxJK0ZZqoCeogcwYWxAuDAR8rtsesbNhY J2iHqBBK79numnuCzvHEID5gpBaylwvQ8QSFu+HtyKrwuSoXuQgAsCwuMr827pMq/M/9 f1+2LM2yyt430u0u0Ul30x4DxjlG5lg5afFc++oT3x2xwsAz0/b9i2aIkLJ8LNTuIFRL bTFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=t/6oF9ZmS1T5Osqox1sOc0sVcon1epQbt7ayWDZgJQ8=; b=Oz6bzhJ7s38ZKYeLIuaSYnVrLG4Fj5xvI3JYM6hgs8iV1IFUGRDicPEUxVG0DPitO6 74vOGzNXQ0GwubbiD2yEgLzC2i6y/EHKxWOB2OrIQfO3POE79sqNF5cfk/K1RU9FXXEM 1v2qXG5Nrzsvad1UuJlM3mtY5id+SjgBgIKRlNMPh8bn3MVNFGMhJYjdIwZEj8bZLAr+ ONQ8dIH2Y30X+DWqJYNxR0qNW/Ri0Gjzrr6bKlrGfuqTtEr+ZCIm9GnKr63473no8Wyw rdVsyPt6vhOGW3REz8nWCVMmWg5VGRQff0B9wcCG/cX41wibUk+Pn3z0A1gYctbjTjMw P6ZA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si9437566pfh.249.2018.04.22.09.05.23; Sun, 22 Apr 2018 09:05:37 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754133AbeDVQEY (ORCPT + 99 others); Sun, 22 Apr 2018 12:04:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45900 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbeDVN5o (ORCPT ); Sun, 22 Apr 2018 09:57:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1C8C6CCB; Sun, 22 Apr 2018 13:57:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mika Westerberg , Andy Shevchenko Subject: [PATCH 4.16 075/196] thunderbolt: Wait a bit longer for ICM to authenticate the active NVM Date: Sun, 22 Apr 2018 15:51:35 +0200 Message-Id: <20180422135108.112426632@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mika Westerberg commit e4be8c9b6a512e274cb6bbac4ac869d73880a8b3 upstream. Sometimes during cold boot ICM has not yet authenticated the active NVM image leading to timeout and failing the driver probe. Allow ICM to take some more time and increase the timeout to 3 seconds before we give up. While there fix icm_firmware_init() to return the real error code without overwriting it with -ENODEV. Fixes: f67cf491175a ("thunderbolt: Add support for Internal Connection Manager (ICM)") Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/thunderbolt/icm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -728,14 +728,14 @@ static bool icm_ar_is_supported(struct t static int icm_ar_get_mode(struct tb *tb) { struct tb_nhi *nhi = tb->nhi; - int retries = 5; + int retries = 60; u32 val; do { val = ioread32(nhi->iobase + REG_FW_STS); if (val & REG_FW_STS_NVM_AUTH_DONE) break; - msleep(30); + msleep(50); } while (--retries); if (!retries) { @@ -1054,6 +1054,9 @@ static int icm_firmware_init(struct tb * break; default: + if (ret < 0) + return ret; + tb_err(tb, "ICM firmware is in wrong mode: %u\n", ret); return -ENODEV; }