Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3695171ybv; Mon, 10 Feb 2020 04:52:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwvxtlaZ7klxW7WkP7Pyhmk6Mm/zPPGpDh+Wtkd2J6TJRZ2deh09tRXNs+JdeQEyHm5ir2p X-Received: by 2002:a05:6808:b29:: with SMTP id t9mr710675oij.69.1581339143468; Mon, 10 Feb 2020 04:52:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339143; cv=none; d=google.com; s=arc-20160816; b=bEA2myHT3ZCWLfTVfUP3UpOG/pU858L7NEq8o7Rq5Rj7BBlkSDnz0or0OuolhOH9KX koc0yDsjFtpLoNxBwWYLvzdeYyOwYi44CzogQiZ1nQs+eUwQ1I/43K4FJaUHT8CEAjjK YBXZLOsCYzFnfxXmKAUNz3o/xKUcNCp2YYOTpr6sSw0RZKi8p7S2DByeJTzMhmlWwy02 dWu9zL+QvIqcGXBnjvWeol74OysS4L/I7fIGJFC3Eq7LQDCAR1rsD0GjhJP5VUnkSe/M YBtR2m5U2mX5+qNn0ztd3PFP0VLsMXZB7Xer+efjdiA74pq3e4meyJSo3Izd+PWsaC25 vlDg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JqrZOJS5ZDxttfiaYJq8NLeR+pHnvuJB4+jLdwC5Hns=; b=Uj24CwojO+lXoT5MoPoGAEL+OSIcEtZbGZZJzXMgst53/CbPWGxHJMvGHUUFWRotu7 72j10E0B1UN2AxSd9JHcL0GTx7tatzKP/nLU6YECxqNwJ4j26bg7ZO3K7mawFdzS20PQ SxxmrAEDdXw/+2vnB9UHjqZDgw0H2RZFqXrr8LVz+K5i578TCZistexFsAbNfxLfiV/n 6fkg2wP/XTRAXupA4hzEcfhqSYDn/qemNxoiqN8MxYQq3kQpAvd96SsXNBz9M/h7eKe/ uXWB7ho7DR7iFTkLnf5x57OvCh/rZwFvR+Ar/tSOV0ePBjJVpLYoOxzMOs8PNDZiFjgP rkgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AMIslQJ4; 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 c196si128803oib.36.2020.02.10.04.52.11; Mon, 10 Feb 2020 04:52:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=AMIslQJ4; 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 S1730328AbgBJMmv (ORCPT + 99 others); Mon, 10 Feb 2020 07:42:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:37588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729437AbgBJMje (ORCPT ); Mon, 10 Feb 2020 07:39:34 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C51B2085B; Mon, 10 Feb 2020 12:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338373; bh=ShEiTjx4VjRs/g2AFrNdObXXPzjqLZd6BsDl4aY7RDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AMIslQJ4nFFEuARNMM4QSbaDO4Sr9xpU4qm9/aw/R46JG2a+0kgAS4NSHEsaOe2kF BcVTXHwT8yg4OPuTG40g5Sj90hA7F2sgDLqjlJaIMKupFfQBrPanMghLemJPfErefH INHE3rO3iuzRLbCDGhZVMgNekSDk7f3h7/N5nFUY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Jun , Heikki Krogerus , Guenter Roeck Subject: [PATCH 5.5 045/367] usb: typec: tcpci: mask event interrupts when remove driver Date: Mon, 10 Feb 2020 04:29:18 -0800 Message-Id: <20200210122428.195882853@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 From: Jun Li commit 3ba76256fc4e2a0d7fb26cc95459041ea0e88972 upstream. This is to prevent any possible events generated while unregister tpcm port. Fixes: 74e656d6b055 ("staging: typec: Type-C Port Controller Interface driver (tcpci)") Signed-off-by: Li Jun Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1579502333-4145-1-git-send-email-jun.li@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/tcpm/tcpci.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -591,6 +591,12 @@ static int tcpci_probe(struct i2c_client static int tcpci_remove(struct i2c_client *client) { struct tcpci_chip *chip = i2c_get_clientdata(client); + int err; + + /* Disable chip interrupts before unregistering port */ + err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, 0); + if (err < 0) + return err; tcpci_unregister_port(chip->tcpci);