Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6512099ybf; Thu, 5 Mar 2020 22:41:04 -0800 (PST) X-Google-Smtp-Source: ADFU+vtH1DhkrUUsbHV+5XrO4kaIU/gS8XFMZlFlGG4wq5KhbUzhCRQplgj9xDAjnROG1U78YHbA X-Received: by 2002:aca:aa53:: with SMTP id t80mr1556270oie.161.1583476864136; Thu, 05 Mar 2020 22:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583476864; cv=none; d=google.com; s=arc-20160816; b=RJgdRTIOavOibIiod48n15Jbbtn/bRmLUQ406ZX7EH+/kQNTIbdQl8E3tx52O+OUxo 3ISGTjhqvfL0VGdWyt/0EleHdX5DLgYT/GPnnD7jeCXZCwkeRaSpHh19uuKszdFkXaqs thrN3HFMQ14GIKMNT45bMnM+fadyerFtK9VE4np0ZWQa+KNHkqq8AIjVayx+N5seJwG8 pzVd2i33ALspbLSS8axbuRbIVDOF80sR8vOkWSIg6u9I0UQYFBWPy5JEi1EckInkjWRi 92t85uohTE8wODY5KBUlZHVuqIkcK78E0JdErr4tzjGJ+n6xa0qU2kjbWkJUvgOrsAct G2jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=vT45mwSFC6cXzoN/4OdifWk9g3mpOiXU45Cu+K7Dww8=; b=oTcqjdQdjeDvdxRvaMoXZjGtYnKedHwDTODdttJKRxIqoXIA9DUDYPb9UdhUFYwIo2 b5mP6rDXLaUfVpkjZ8mxpZK8TFiTsWonsr5Z6UyAmtxkjpsBv0u9fci2fic7i7oo/QE3 LJ3vYxad5wzV8cJDvmUpJPM3hNnR1S2tP6HzvEcbVyHq+DXhUzo/4L+2Ih7oO2RbHAAA 2RndRNOhQN5+NGSji4Gis4QjfZ0osSUO6McWQ6nH0AhDaqTQIVTq65rW2e14+pC2wvW6 +XAbJLyF8nW17V9/cr+2fj0N5l34i32gkQ9Bd2QS+MtR4DIErjtdIm5rSNqWMEF6B8ka Lc5A== 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 j134si801327oib.52.2020.03.05.22.40.51; Thu, 05 Mar 2020 22:41:04 -0800 (PST) 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 S1726010AbgCFGkR convert rfc822-to-8bit (ORCPT + 99 others); Fri, 6 Mar 2020 01:40:17 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:44405 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbgCFGkR (ORCPT ); Fri, 6 Mar 2020 01:40:17 -0500 Received: from mail-wm1-f69.google.com ([209.85.128.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jA6ec-0007AZ-Qs for linux-kernel@vger.kernel.org; Fri, 06 Mar 2020 06:40:14 +0000 Received: by mail-wm1-f69.google.com with SMTP id p186so264215wmp.0 for ; Thu, 05 Mar 2020 22:40:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EpKnowuU59lPtoZuyG1qUEH+kEQ22uKgOl7ZuBWQsiA=; b=Ze7N2OJW5nFl9aawkrlCpywu98zCH+Y1coN3Gs7m8l4aWEvpo4P1KbEtxf2/T/KKvk GS+F1+kUjcRciWgvilbjc9yjbBMcCc5B5Vsgz+8zzcmIoW983joA8gfIsumcdyXbfYPl hy7y7Op2cBU3uWtNSi6aoAXFZ+xCy/u2RZDStjgWUHubFb06WeFMqdlsxCOI4CfFH2MK SbH/MvVFEj1vOgdoRQQiXKs4mqnZDAP0YgVnIQdQiXKzWt8rVn0y2BdI5nQblz/w8glj zDFSz/BfqpPV0ZJNcfeadx5Ztljx4xfaLNo459+VFHStNVq7P63sMxIESKdHv9W1VObB vGUw== X-Gm-Message-State: ANhLgQ3bJG0y7vchifmCyDIVfYBqyqOXAYB8IujY5rbHfjphB9NHDdQC jdmP9oZjvzZcv1e9bbT5nTSf13XbM6gbPBP/m+9FsScTFPlYPVr7p+5MW43By8So1y++8lejCTI HDxViOiqujjWN/ppA8K2VIop9f05qYI4/wTKdzF5HvuXz5g2q8FwoJp9q/g== X-Received: by 2002:a5d:4c52:: with SMTP id n18mr2392147wrt.403.1583476814527; Thu, 05 Mar 2020 22:40:14 -0800 (PST) X-Received: by 2002:a5d:4c52:: with SMTP id n18mr2392114wrt.403.1583476814289; Thu, 05 Mar 2020 22:40:14 -0800 (PST) MIME-Version: 1.0 References: <20200305064423.16196-1-acelan.kao@canonical.com> <20200306041642.GD217608@dtor-ws> In-Reply-To: <20200306041642.GD217608@dtor-ws> From: AceLan Kao Date: Fri, 6 Mar 2020 14:40:03 +0800 Message-ID: Subject: Re: [PATCH] Input: i8042 - Fix the selftest retry logic To: Dmitry Torokhov Cc: "Rafael J. Wysocki" , Thomas Gleixner , Allison Randal , Enrico Weigelt , Stephen Boyd , linux-input@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, We have a Dell desktop with ps2 addon card, after S3, the ps2 keyboard lost function and got below errors Jan 15 07:10:08 Rh-MT kernel: [ 346.575353] i8042: i8042 controller selftest timeout Jan 15 07:10:08 Rh-MT kernel: [ 346.575358] PM: Device i8042 failed to resume: error -19 Adding this patch, I found the selftest passes at the second retry and the keyboard continue working fine. Best regards, AceLan Kao. Dmitry Torokhov 於 2020年3月6日 週五 下午12:16寫道: > > Hi AceLan, > > On Thu, Mar 05, 2020 at 02:44:23PM +0800, AceLan Kao wrote: > > It returns -NODEV at the first selftest timeout, so the retry logic > > doesn't work. Move the return outside of the while loop to make it real > > retry 5 times before returns -ENODEV. > > The retry logic here was for the controller not returning the expected > selftest value, not the controller refusing to communicate at all. > > Could you pease tell me what device requires this change? > > Thanks. > > -- > Dmitry