Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp1617775lkv; Wed, 19 May 2021 14:10:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1TpCT6zXEup30HmVWWpXk8mQ1Ds3bgL/97RxE3iEVae8gdjhx2YE58BJYL3uuDSqkCDH2 X-Received: by 2002:a02:7354:: with SMTP id a20mr1410236jae.94.1621458639117; Wed, 19 May 2021 14:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621458639; cv=none; d=google.com; s=arc-20160816; b=QSiNr+Sayh3eUxEMf2a68Y8XvNscq2cUk+iriv3XpeI6fRelKEVzJovuo3b4nRZnZh iuYxPzVORX9aOHMjZFH7LtcNONdsO3XTqbR7+81m2SO3X6nmHGHJdDEVT6KtJVD5Qq8R dzonIfpZQgmFGS1+ykxr0HHYeGqS2hrpXnjQu4MUH4/b/1qnfNJ1aNf5VC/Nn2k0wkPB Qx9k22Jw/G6nZDj/nDLXRWUHw6vRey/28YLbHILIBTyAElG0XYCA6OFaaNz9bJkUojcw WV6VoTA/k8Ud4hyUBMSSBc9MkD4hhfUnDTaQTs777Bc823Aiwz9Guk3EQGJ4T8ctl5lr zV5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=4ZEcOidemp/N2UR9LRj2C9paWor0Q0+nuz9pFPtZxKE=; b=g5a4Oh00/NvHm0rqvOzSA1IczGAXYiRPHP8vAJVM5gr9STJpuclLU3Q+VRRi13WSJI dDoBhMjsbGmRA2pQT4qpn3vMl4iLgFfDXmVHlv8HZfr18xBQJ24QJXVhOqczjRUsJhEe h18dcuMf3NPe8zq0fVlRN5hKHu6BvNO/VFPVeOeEyABIpiVKq51g730G/gzuetgLtOC0 fqibvG9vpZ7dXZJa+TlvbEZh/LGiADSwBpMFxvqM3AUJMkV18EqMCCjEU5rFUJBAIMTE t3PHOg6CSpI2Hw7GH1+gNrlpdkWN2Yec40FRQ6sFCbGTwEWRyH2wLNLjIjYJ7RQJnq/F kR+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q15si493184jaj.2.2021.05.19.14.10.26; Wed, 19 May 2021 14:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245486AbhESLfP (ORCPT + 99 others); Wed, 19 May 2021 07:35:15 -0400 Received: from mga11.intel.com ([192.55.52.93]:22027 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbhESLfO (ORCPT ); Wed, 19 May 2021 07:35:14 -0400 IronPort-SDR: Lpw5zyZt6/WodeMDEJpZeGtq48dI7/jRc8MLK8VtRuFJfO3tMg/vTQDqxWY4BeGns/A30Aj0q9 15a1diuf1X0g== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="197862775" X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="197862775" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 04:33:55 -0700 IronPort-SDR: fcQ6N0d5zcMYSZig/l2twvSPHWM2ptsG3Dx/LwZnmb/nyLafED1WPZUTTrghP7o04hctpbvAVW jUICdWmSzjmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="542515866" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 19 May 2021 04:33:52 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 19 May 2021 14:33:52 +0300 Date: Wed, 19 May 2021 14:33:52 +0300 From: Heikki Krogerus To: Benjamin Berg Cc: Bjorn Andersson , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: ucsi: Clear pending after acking connector change Message-ID: References: <20210516040953.622409-1-bjorn.andersson@linaro.org> <7c09a6bf2ee0a644863f1ec8b333c871cf83d5b8.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c09a6bf2ee0a644863f1ec8b333c871cf83d5b8.camel@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 08:04:14PM +0200, Benjamin Berg wrote: > On Tue, 2021-05-18 at 16:29 +0300, Heikki Krogerus wrote: > > On Mon, May 17, 2021 at 02:57:28PM +0200, Benjamin Berg wrote: > > > > > > [SNIP] > > > Unfortunately, I don't feel it'll work. The problem that I was > > > seeing > > > looked like a race condition in the PPM itself, where the window is > > > the > > > time between the UCSI_GET_CONNECTOR_STATUS command and the > > > subsequent > > > ACK. > > > For such a firmware level bug in the PPM, we need a way to detect > > > the > > > race condition when it happens (or get a fix for the firmware). > > > > OK. Let me know does the patch bring the issue back for you. > > So, I just tried the patch, and I can occasionally reproduce the issue > where "online" for the ucsi power adapter is stuck at "1" after > unplugging with the patch applied. Thanks for testing it. I'm still not sure that the PPM is the culprit here. I have a feeling that the problem you are seeing is caused by the workaround (bad workaround) that we have for the issue where the EC firmware does not return with the BUSY bit set in the CCI when it should in many cases. The UCSI ACPI driver has one minute timeout value for command completion because of that, which is way too long. So if the EC firmware decides to take its time before acknowledging command, the driver is stuck, and we start loosing the events... Well, I guess technically the PPM would be the culprit in the end in any case, but I'm just not sure that there is any race like you suspected. But this is off topic. I'll send you an RFC proposal what I think we could do about that. thanks, -- heikki