Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2324819ybt; Sun, 28 Jun 2020 15:54:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhJsnjMQttHlURs7lLf5Az3k9nBHAZvPT7l3K3xGaP8h0JVpW3lCJrVYB8CLLCBu4l8ByB X-Received: by 2002:a50:c44b:: with SMTP id w11mr15279994edf.317.1593384882665; Sun, 28 Jun 2020 15:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593384882; cv=none; d=google.com; s=arc-20160816; b=DvRPuWOCrcBk28IzOIZUmnwhMIjjlEubKK6hE4czg0RkAuVFAMORyVLL1ugcd2QsXh 2x1OC/jT1Rc7A3cwLeuiO7oH97UpPCsULbfNLms02m5Cvc8NJNkImUnjzhVfkLjWyCCi lRkJkclaxkuaUSzI4+vOYha2DrE4EvVhsU/82+I53itjcbw1arEmZiksoN6nT4/8Rr9K 1/sHm27CDsVsOlOIfBTMwINXGi98OpU3T1zIy52kMaFj1esvwO7SjFvDCrPGN3Qgn+tB 8ql0qvJmc44qkGP3HOuw4/E9UxQnqdEsYNhWbLCmeK276o6EuF2NOVHRBj3YrkVYERYQ 8KXw== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=Pa+hUyR2V9P9hUVMyNxN8wh2Db793N2VURJtw4LyZCg=; b=Wt6/cBvNUVT+R4EhapPuZgZdaTN/cID8dS1nCJzbK/AI5bMd/zQPjFNbwnbT1EqiLz wkHn8u6KIvWWaX8bAtDB27nOsRVEsIr4EG3z55uEYv2hplOKxD4y/KtN4upZRuryU4qz N3Xw65gaH9PQhXAoC7mdBDvXgteCimLp8h37PH4RbwU6o0LnIFid6AGhit1fkERKSYuf 42ylkkLvYdJGbG/rNQA0i4dWjYfdqmDxgvr+VbLCl+v5FACpncd+0YoZF9Nt3tqGVspg wVGgIRv8C1LGG+YygZmt7qMvqEurnVT8M/qmvPO9pFkvjtP0St437QUxDxuCetu3iz8V 7uLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id z14si5195064edl.500.2020.06.28.15.54.07; Sun, 28 Jun 2020 15:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726296AbgF1WyE (ORCPT + 99 others); Sun, 28 Jun 2020 18:54:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:61998 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgF1WyE (ORCPT ); Sun, 28 Jun 2020 18:54:04 -0400 IronPort-SDR: h9yEsLnJoezpJpSOcc/WdBM4iliYfSXUX/1Kczq5Aq/SrFWNvBedAKzjgy7qUN+Q9vw2MRQHDw TY9uh3sPfxbQ== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="143356238" X-IronPort-AV: E=Sophos;i="5.75,293,1589266800"; d="scan'208";a="143356238" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2020 15:54:04 -0700 IronPort-SDR: mS6V3u7YQ1AQpjZlma7PckKh208vE9P5+mPv354T5UwOiDcnwb27KqwNUIUBj0RZ1Xfpo/AXrA LrelELEawheA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,293,1589266800"; d="scan'208";a="314635248" Received: from twinkler-lnx.jer.intel.com ([10.12.91.138]) by orsmga007.jf.intel.com with ESMTP; 28 Jun 2020 15:54:01 -0700 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Andy Whitcroft , Tomas Winkler Subject: [char-misc-next] mei: bus: don't clean driver pointer Date: Mon, 29 Jun 2020 01:53:59 +0300 Message-Id: <20200628225359.2185929-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Usyskin It's not needed to set driver to NULL in mei_cl_device_remove() which is bus_type remove() handler as this is done anyway in __device_release_driver(). Actually this is causing an endless loop in driver_detach() on ubuntu patched kernel, while removing (rmmod) the mei_hdcp module. The reason list_empty(&drv->p->klist_devices.k_list) is always not-empty. as the check is always true in __device_release_driver() if (dev->driver != drv) return; The non upstream patch is causing this behavior, titled: 'vfio -- release device lock before userspace requests' Nevertheless the fix is correct also for the upstream. Link: https://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20180912085046.3401-2-apw@canonical.com/ Cc: Cc: Andy Whitcroft Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 8d468e0a950a..f476dbc7252b 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -745,9 +745,8 @@ static int mei_cl_device_remove(struct device *dev) mei_cl_bus_module_put(cldev); module_put(THIS_MODULE); - dev->driver = NULL; - return ret; + return ret; } static ssize_t name_show(struct device *dev, struct device_attribute *a, -- 2.25.4