Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2081794rwr; Fri, 21 Apr 2023 04:10:41 -0700 (PDT) X-Google-Smtp-Source: AKy350aqy56XlkAEvzIAzl+/HkoYUcUmVr+lx+C3+55B1LP9RDoClgojowT4zvEDSfhiRbXmzWbf X-Received: by 2002:a17:903:1d1:b0:1a6:93cc:924b with SMTP id e17-20020a17090301d100b001a693cc924bmr6005856plh.3.1682075441254; Fri, 21 Apr 2023 04:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682075441; cv=none; d=google.com; s=arc-20160816; b=tmgl9i3SK8EmpFGlKlfL32s+FnekZMaAqf2cxE1wcKFsNYzn2UgwqX0WOF7LK6RQzp Cn8rL1RlsSoKupb7vErsd6sprTMxURmRL2mIJ76bNNMa1he6See1KfcwbtKJbFqYul8e bzrUuXNBbsuN+OJLR1t3CrONbbLn/MTIawrY/lu1WCQapNrTaBs7whzs/LNlBrdINKce x7Rjxw7ae2wDIPETnqfWsh4wjgIN7n5VbGdsROV9fVbhsS4OFoLljYz0nqBO7Wl7Tfh8 WS/6jnMHQ3nPr1nS4xlCKF2LiQSpyrM3yZo2brsmkPlAbrV8YH3EJW5GvFv48dq88w7E BU5w== 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:dkim-signature; bh=6HtewIW6aa/ogVe6OML/TzZNVaocm2wMiGS7Mpi0Lac=; b=KukXAZDgzvwW0BBoZRUPpPRrWGRfHQkoo0PGCQZrmoYhIcIx7HA46j/yLlhYo1oMXa fNaXzA5AyNB2epe5BjdCDK6SbXa1Jh6K+5SSruBOzYN1a6QBTU+vtuSpBI99SM8Dx0E2 xZiM8JS06XimmWTaVb6sEZGBjvQTzI31Gpmwf7x21dOcKxjTNPGGfFvL/y9ACBUgP7s9 wxBm59BRnMx4HrQAsX3oQfPUF2M1ZtLcg2K4HoehrTAX0ZRCwPqJs/JY0mQLFleJfLC7 +5d7W+twKGhJz0Y8XaoNQKRrIystaWYTNr6OWeEi/unwoTzIsyT9fyZKWNUv1eXPojD1 aa5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RIK6k8Kr; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3-20020a1709027fc300b001a67b6db120si3881429plb.409.2023.04.21.04.10.25; Fri, 21 Apr 2023 04:10:41 -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=@intel.com header.s=Intel header.b=RIK6k8Kr; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbjDULJK (ORCPT + 99 others); Fri, 21 Apr 2023 07:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbjDULJJ (ORCPT ); Fri, 21 Apr 2023 07:09:09 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 511369EC9; Fri, 21 Apr 2023 04:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682075347; x=1713611347; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rZwTsejC2mJApJ3bCH/FR+Q5/YQX630MzFVYcEDFrCY=; b=RIK6k8KrRp+QdMQlH0CPByFdlHp5QQm368vfg4vE2trhQXUjIx8RQP+H wguY1pnzboHDbB+gvt4jWwCMV2CJ7/Aqar7GZxSKej8TqmXbjr7bXb4UO fnVrrpgTPJPA0qGvWvDsngZAUmuJgQZaKmDfzd43bbVEH2xYO9E3+IdZd eZ63oyABVWj5fUPT2UqULGCS3RV3fzrcvg9+pWo9JNz8HyBd4+KBHb50i cxH0ygvAhpEA7GLJNdO43I5GNG4+fI2epT6azDXj1yoXWCWEw/Lg2rl/z Tr9n6VX6yO/nm/n6esD4WOwvTCuWPMGjsoSMv6GJhzdmcMEugP7rSP6mC w==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="347870256" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="347870256" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 04:09:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="836146196" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="836146196" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 21 Apr 2023 04:09:02 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 21 Apr 2023 14:09:01 +0300 Date: Fri, 21 Apr 2023 14:09:01 +0300 From: Heikki Krogerus To: Roger Quadros Cc: gregkh@linuxfoundation.org, srk@ti.com, r-gunasekaran@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: tps6598x: Fix fault at module removal Message-ID: References: <20230421101720.34318-1-rogerq@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421101720.34318-1-rogerq@kernel.org> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, Apr 21, 2023 at 01:17:20PM +0300, Roger Quadros wrote: > 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); > -- > 2.34.1 -- heikki