Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75A51C43217 for ; Mon, 15 Nov 2021 09:24:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59A6861B95 for ; Mon, 15 Nov 2021 09:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237630AbhKOJ1m (ORCPT ); Mon, 15 Nov 2021 04:27:42 -0500 Received: from mga01.intel.com ([192.55.52.88]:64451 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237574AbhKOJ0Y (ORCPT ); Mon, 15 Nov 2021 04:26:24 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10168"; a="257156736" X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="257156736" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 01:21:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,236,1631602800"; d="scan'208";a="644783363" Received: from kuha.fi.intel.com ([10.237.72.166]) by fmsmga001.fm.intel.com with SMTP; 15 Nov 2021 01:21:32 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 15 Nov 2021 11:21:31 +0200 Date: Mon, 15 Nov 2021 11:21:31 +0200 From: Heikki Krogerus To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Guenter Roeck , Greg Kroah-Hartman , Badhri Jagan Sridharan , Hans de Goede , "open list:USB TYPEC PORT CONTROLLER DRIVERS" , open list Subject: Re: [PATCH v2] usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts Message-ID: References: <20211108102833.2793803-1-megous@megous.com> <20211115085532.xoufihjxkxzhxehv@core> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211115085532.xoufihjxkxzhxehv@core> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 15, 2021 at 09:55:32AM +0100, Ondřej Jirman wrote: > On Mon, Nov 15, 2021 at 09:11:42AM +0200, Heikki Krogerus wrote: > > On Mon, Nov 08, 2021 at 11:28:32AM +0100, Ondrej Jirman wrote: > > > The code that enables either BC_LVL or COMP_CHNG interrupt in tcpm_set_cc > > > wrongly assumes that the interrupt is unmasked by writing 1 to the apropriate > > > bit in the mask register. In fact, interrupts are enabled when the mask > > > is 0, so the tcpm_set_cc enables interrupt for COMP_CHNG when it expects > > > BC_LVL interrupt to be enabled. > > > > > > This causes inability of the driver to recognize cable unplug events > > > in host mode (unplug is recognized only via a COMP_CHNG interrupt). > > > > > > In device mode this bug was masked by simultaneous triggering of the VBUS > > > change interrupt, because of loss of VBUS when the port peer is providing > > > power. > > > > > > Fixes: 48242e30532b ("usb: typec: fusb302: Revert "Resolve fixed power role contract setup"") > > > Signed-off-by: Ondrej Jirman > > > Cc: Hans de Goede > > > > Should this go to stable? > > Without this patch, VBUS is not turned off when I disconnect a hub from the > Type-C port (because fusb302 will not notice the disconnect), and it stays on > until next plugin of some device, say a normal non PD charger. > > So I guess for a brief period you can have both sides provide VBUS (until > fusb302/tcpm processes the next plugin). It may be a problem if VBUS was more > than 5V (not very likely for devices running this driver, I guess). OK. So this should find it's way to the stable kernel releases as well, and it should have the appropriate "Cc: stable@vger.kernel.org" tag: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#select-the-recipients-for-your-patch thanks, -- heikki