Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp458966imm; Fri, 14 Sep 2018 00:53:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYTK8VUbFft6s+rJwCd2TeHGuu+MWLqLe+IvqAi6iJejnu9ivwmwMBkb9tsp0aAhh4OfCNR X-Received: by 2002:a65:5304:: with SMTP id m4-v6mr10663435pgq.250.1536911602238; Fri, 14 Sep 2018 00:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536911602; cv=none; d=google.com; s=arc-20160816; b=0JfIvYeORK+ZCKQa5aSTfoMymtANSQSiJ9BF5rjfj9CCymwq/+WUb0UAipsgPsi6xo UnHOAin1sLe9zxOav2RepfFd4ImRT369CaB9ixVCIovAbeObP9kzLSdjeYdF3/X/9qPg mekOoaFL7RzR466RKdtuZbrSDVnQDna1dk9IvSRIDY0V9ZRXm4U1eugk+eAQ0jvK01xJ S73fzY5jhXJ2rqIRNyIlMCW6/b1OZvyP+LUmBlyBlw1K2w0I8na9konCxteUzkIhWr74 4yBYUfzQxcF5ga5ifEFbY34yPOh8T/B0B+lP2J3w06nVydjRy0nb8ftjc9Dw7tXhbqOL HswA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mKqNHSPaJeVfABU5qTaQcraZspZDJIEPupTN72bviBE=; b=funSPuMF0sD5KitdY+2eP4iHHz87823cG5Qgik36robhAcw1eCCC+pNhKeFJtpIpkR 9sWQPIzKqBiCcwwJKPdpqigo2JDAS6jGIo/r5e4FMhi30pkI57h1/OR8KLaCdh5vX4bI O7JI+9eWL0AlbGlqZjWcajH6E5YiIMce1gUQfG+FrcM8o4YP7y3JFOSnoYPi2IFPcdBP 7SdbDSVLoRvSxJ2DQBG0RYbaTdXPDfethr0y4kn2swl7cKIGIOc6zJ5sk8Iihw87RcjH uSD+hUTs11VUFIuVEKNfeDEW13GklAE89PpTV4ZGcPeawHrv1wz8BvPkWD7YzVN7aFpi cW4g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2-v6si6169788plq.287.2018.09.14.00.52.37; Fri, 14 Sep 2018 00:53:22 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728034AbeINNF3 (ORCPT + 99 others); Fri, 14 Sep 2018 09:05:29 -0400 Received: from mga07.intel.com ([134.134.136.100]:45570 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbeINNF3 (ORCPT ); Fri, 14 Sep 2018 09:05:29 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2018 00:52:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,372,1531810800"; d="scan'208";a="70782153" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga008.fm.intel.com with SMTP; 14 Sep 2018 00:52:11 -0700 Received: by lahna (sSMTP sendmail emulation); Fri, 14 Sep 2018 10:52:11 +0300 Date: Fri, 14 Sep 2018 10:52:11 +0300 From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , Lukas Wunner , Lu Baolu Subject: Re: [PATCH 1/2] thunderbolt: Do not handle ICM events after domain is stopped Message-ID: <20180914075211.GP14465@lahna.fi.intel.com> References: <20180903132012.23531-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180903132012.23531-1-mika.westerberg@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 03, 2018 at 04:20:11PM +0300, Mika Westerberg wrote: > If there is a long chain of devices connected when the driver is loaded > ICM sends device connected event for each and those are put to tb->wq > for later processing. Now if the driver gets unloaded in the middle, so > that the work queue is not yet empty it gets flushed by tb_domain_stop(). > However, by that time the root switch is already removed so the driver > crashes when it tries to dereference it in ICM event handling callbacks. > > Fix this by checking whether the root switch is already removed. If it > is we know that the domain is stopped and we should merely skip handling > the event. > > Signed-off-by: Mika Westerberg Applied to thunderbolt.git/fixes.