From patchwork Thu Aug 27 03:25:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiYuan Huang X-Patchwork-Id: 11739883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D043A138A for ; Thu, 27 Aug 2020 03:27:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8B702078A for ; Thu, 27 Aug 2020 03:27:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="grusyYRt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="juyCGc0D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8B702078A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ekoRXqHdk8TibMctjLfJiJoVeSDSzy5tFEnDJjoeTsM=; b=grusyYRtGyhclLZLNaLYDEfFvN SwYp+7DNJ4C9S3Ri/K3K/LTN24jL8RUjEPR+VgRZJcrX6XTci+VQODCpIlCYQRfDshIHTzVUCoJpr 8UKzgbpyq99b9XGvochfwG2Dh1pGbCw51yCfU6zl08RXMAt7kNnHj1h0GAByNp5xN6Q3wp7NNE6KP Yp8Irzi6CaBPxZuinWU1lLkLiA5dQfD+67EgjsX/d4y30h2XCgVsfNH50mzkP35i7+QIp+LOre7jx 04C8k8lhJVpiteGBga+1ddM/OlNZYC2M/FNC9NzWS1XhrIlDuJIjMCobDwQCrmyFxTfXqUwYBunOL fqqdqEUQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kB8YP-0003C1-8W; Thu, 27 Aug 2020 03:26:21 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kB8YN-0003AR-5v; Thu, 27 Aug 2020 03:26:19 +0000 Received: by mail-pg1-x542.google.com with SMTP id g29so1320260pgl.2; Wed, 26 Aug 2020 20:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rN37qI20ECUBatR6H4A3g3beWRHeq6Mi+Lp9BztZsHQ=; b=juyCGc0DIHQSjOjHsrh+qOzPev0piOd8Bz8V5NomMrKpRtgz1hEkev8rk95Rfosf++ lnk73HOq4CZaRbiG0/oPUOppYKjNDDv+GrKz5yob2Q+JLlv/uQhRgO5ugFKMGUCEMAJO HQoMI3sVkJ+892Dgoc35biNla/wrHNjbvXHmSuHdtOgUlE6ARLsD4FsGP0TfpePwMpoS iinEOqJzEcZh3fQje53unSjcBpdNpYqMREd+jzPdufjB4ixU9P6StstghAsr9tlHzPMi ZDvtBdi9SR1ibwo1pQDX8rWLe4aSnHgcfYebs+L6FpQM1Vj5hvbYYY1mQ9Zx6ayBfHA4 yl+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rN37qI20ECUBatR6H4A3g3beWRHeq6Mi+Lp9BztZsHQ=; b=INMhgRdtsmG41UfmhxueI5YeEkHzg4tmbUaCdZwgEDAwbMJTG+GXrn7zMsPybkFNi7 M/cYgbEuFN23wH+MYLUiGKcG4aunppU1iLCKpp6KUz97omPCWmOQykw4FFmStU0YfUA8 kiKd+c0PfQEBuxHeJ/9SRX+3J81pe8n9uH7MR3lFGNidm065CVTJnkRwLWbvUZw2Ftum dz4oJCWVxBNxWwJ0GEnfu105J/hcgEmFN6l2gxxzzk5sDveBLk1+OMKE6DzZUAQGeGf8 eu0kFt0Ie5DxIOKKLVmFz2a+QRoLFmmEwdGkfcLRuebLByEd9qv4S84PjSPJp/YtpEDf rbcQ== X-Gm-Message-State: AOAM531qwUw7V4fjYzA/An+S7D+7EluoWge92xcssKDTmRy2q+Zd6u5w n/lkTiCyR5PQvDQv0aOs1LA= X-Google-Smtp-Source: ABdhPJxs3SdM7Lc3+cmlB678u24GpPwR5yvBajty/DF5b6W58gTKmaqbA8z69x1z9NNVbSOoHjIFhQ== X-Received: by 2002:a17:902:b589:: with SMTP id a9mr14117797pls.98.1598498776792; Wed, 26 Aug 2020 20:26:16 -0700 (PDT) Received: from localhost.localdomain ([2402:7500:57b:156e:1129:dc1b:b8d8:6430]) by smtp.gmail.com with ESMTPSA id 70sm676982pfu.107.2020.08.26.20.26.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2020 20:26:16 -0700 (PDT) From: cy_huang To: gregkh@linuxfoundation.org, robh+dt@kernel.org, matthias.bgg@gmail.com, linux@roeck-us.net, heikki.krogerus@linux.intel.com Subject: [PATCH v2 3/3] usb typec: mt6360: Prevent the race condition during module remove Date: Thu, 27 Aug 2020 11:25:32 +0800 Message-Id: <1598498732-25194-3-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598498732-25194-1-git-send-email-u0084500@gmail.com> References: <1598498732-25194-1-git-send-email-u0084500@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200826_232619_247019_4D711DCE X-CRM114-Status: GOOD ( 13.21 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [u0084500[at]gmail.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [u0084500[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gene_chen@richtek.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, cy_huang@richtek.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: ChiYuan Huang Prevent the race condition from interrupt and tcpci port unregister during module remove. Signed-off-by: ChiYuan Huang --- drivers/usb/typec/tcpm/tcpci_mt6360.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c index 6a28193..a381b5d 100644 --- a/drivers/usb/typec/tcpm/tcpci_mt6360.c +++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c @@ -164,6 +164,7 @@ static int mt6360_tcpc_remove(struct platform_device *pdev) { struct mt6360_tcpc_info *mti = platform_get_drvdata(pdev); + disable_irq(mti->irq); tcpci_unregister_port(mti->tcpci); return 0; }