From patchwork Fri Apr 21 10:17:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 86230 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp960244vqo; Fri, 21 Apr 2023 03:20:26 -0700 (PDT) X-Google-Smtp-Source: AKy350bpQj6hiOjAox0DjNeFd8u/lLokvwd49TivOxYL9bzFuqjWYpVMRqHKc/FwOUObQa2ghesE X-Received: by 2002:a05:6a00:892:b0:63b:6774:8f1d with SMTP id q18-20020a056a00089200b0063b67748f1dmr5137684pfj.31.1682072425699; Fri, 21 Apr 2023 03:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682072425; cv=none; d=google.com; s=arc-20160816; b=RUI7H6fmIGGgdKZBw8IXOhiHwUqreTBmcjZSt/ZxopwG3+xyB6bneMLJ1XsD56TZUF kmd3lOFlfWBsshUIeZ4U/gyQysByd1+JSO3PyjgnNY1s7nmYoUc/Ixdaqfo6WBFNhVsi jyfEH3SNnKIwhYyUQMqj1SJwp/PRfDrlYHM5IRxZJgbLTcY9ysmup5jJJZYPRcxMpqGl 3xWn34oqls80iuIsN/xOkCwtKkEiMtejGh2oJi2DAGf2C2hNsfO/hh7XpvLo2q9bNh6f cyvsHlFHIgQr68kSzYgzMtb86cYbJwnWdenTAbfEp/iQeZWRhD1BXUnQeHD/vVH4A+Hs lGYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rm5eo+vWaUmA/Cnw17WnkpZbVc+oSK2GTwx4EteMbxE=; b=IEqCz8a4gC4PwB2s3+ATgWe7UjsoqTO++VtS7G6Dts0TJ781StrgrZ29Q3hxGC9Mta B7bHlZ14EI/lGqRyEN+Lx1QUelv79Y2e/PcyvN8ZNyG6gYceaJAXOrGPmYbQ3zU/rI4S yeywubnL6jM064oxSgf7C7nrIxd5ck1QWFndBvsjlt/cdT2ZOkp8Ob65j3hAYkIqsiUa YL1AVMOnXxZrkcXjtuA0NkBVVru7uz2wlA6Fhy5tFkLJj9rSYTQvXsecmnjDOiMu6QZ4 ph3kcJngtdHfT4sFlAHxAl3UTApradQp8czJFMpNiXNC4HZL+RNlv7egS1XBwqCZcVIf aykw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJDQlYcl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020aa7990f000000b0063b21db5973si3929534pff.358.2023.04.21.03.20.13; Fri, 21 Apr 2023 03:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJDQlYcl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbjDUKRf (ORCPT + 99 others); Fri, 21 Apr 2023 06:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbjDUKRd (ORCPT ); Fri, 21 Apr 2023 06:17:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B5551FD0; Fri, 21 Apr 2023 03:17:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9655D6191C; Fri, 21 Apr 2023 10:17:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E9EEC433EF; Fri, 21 Apr 2023 10:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682072246; bh=KWXhoL7+mywikhhUa07/SMiyCk/wDffyd4ObOGkp5xI=; h=From:To:Cc:Subject:Date:From; b=kJDQlYclMvrAmIaJ4qp4L9+quYvLrXFKr9XoVUHXhDGjJZMN7y1PqnCNPrCO37POr aEvKhjwWw3Zj2CdtjgBBWQfnJZtjfG+vjIu3R0CbHQDqFvIcYYVnyQv6MbJ5BQ+kI7 EIZk7MztCtybDGw7UnM8nMQIbsV7m0QtmAUWUPTbSN759/KlFungWtxBGlFpCnygRp hFUdNqLu5hyj5Ui84buQ794JFMxtYXZY7TEp5voi4/GyBfAq1TJLZz8H4gY2t6Bfew N9utJ8F2z3WHWPJZRmxmIoTy+SrdaeBdZJa405eF3Jt2xzLbKY4t6sFhLPjlTqUnKP 8TpumCQU0MSlw== From: Roger Quadros To: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: srk@ti.com, r-gunasekaran@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: [PATCH] usb: typec: tps6598x: Fix fault at module removal Date: Fri, 21 Apr 2023 13:17:20 +0300 Message-Id: <20230421101720.34318-1-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763780775798578303?= X-GMAIL-MSGID: =?utf-8?q?1763780775798578303?= We need to cancel the delayed workqueue if it is being used else it will cause paging request fault during module removal. Fixes: 0d6a119cecd7 ("usb: typec: tps6598x: Add support for polling interrupts status") Signed-off-by: Roger Quadros Reviewed-by: Heikki Krogerus --- drivers/usb/typec/tipd/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 8b075ca82ef6..438cc40660a1 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -886,6 +886,9 @@ static void tps6598x_remove(struct i2c_client *client) { struct tps6598x *tps = i2c_get_clientdata(client); + if (!client->irq) + cancel_delayed_work_sync(&tps->wq_poll); + tps6598x_disconnect(tps, 0); typec_unregister_port(tps->port); usb_role_switch_put(tps->role_sw);