Received: by 10.192.165.148 with SMTP id m20csp1862658imm; Thu, 3 May 2018 06:40:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGk3K+ojqJHws7oyguhkeiAr4e+rq4Mqow1ViqCufem//UVs/lKR/MlPXqcA3uuY6qWNZK X-Received: by 2002:a17:902:b184:: with SMTP id s4-v6mr16366445plr.359.1525354827014; Thu, 03 May 2018 06:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525354826; cv=none; d=google.com; s=arc-20160816; b=cRIfGbXbwa1xebdQRbKoBP9sLfy0F+XQTevDEmKchjClgxN0qyZ5LKEx7q/eAo3lCL w/mmvmWxr2oLJhy9dQsZWBUk6Jch3CLL/mdGkcGi35Ct0lVRuF+qKopWwWjPN9J57F7W OdlLlJt2BDChQSrAqSTV4Q7IsJa5CXXNafPnLMNuB99CNg9ccO6XVCOg8aDqC8Et7QwX PaInfXyOHo2vIgqLR4H27s2gzN+NMORVCqAJtz2syvo3vWS2vUDVe+yNQRauprfUybMg H/8kAsH9pHgRhGgcNvmU6aSNAWnMztkI/6XIdFPYCIxmWPA8XDo8k7mJn6B2wqsbUv7n AJ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=VqweUXJOoFjghQp/iGhn6eAHdtZh5A8kFTBWtFGa5XA=; b=vVjdVmAXBI8B+/Ad/IUtyKZ2Wi4q6eih/A7HwImPW6vtPWR0TRtvczfacIGozMRdy2 SD0yOdUA2PbKkj4YSBOS0Yjk/+Mn0X2ZD9AcvAPqrCEcFaqim8iHemtrvyokqFlHjvID YWE+yppZgcDoBNTI6Uk2L9jF7DeMYNm6VjN3COTm/0fRS+R72BdEBqjcVoLAfPut91O6 iIebLmSH+dNz2JewVx4Ph2R+FvQexEXjDgiLn4kdNvgvL3NBX1Lj2QwtFSuIbW8rqJEF FeKe1jabUHcXJ/fB0o1xeGJvnVh1dpC2rUnmsGu6+kDFmhpmNJkgf7bVaMeICzyG3xtk lTtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=J7uOjU/B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si7746512pgr.549.2018.05.03.06.39.42; Thu, 03 May 2018 06:40:26 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=J7uOjU/B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751277AbeECNjT (ORCPT + 99 others); Thu, 3 May 2018 09:39:19 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:42916 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599AbeECNjO (ORCPT ); Thu, 3 May 2018 09:39:14 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w43DZtep184889; Thu, 3 May 2018 13:39:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2017-10-26; bh=VqweUXJOoFjghQp/iGhn6eAHdtZh5A8kFTBWtFGa5XA=; b=J7uOjU/BPRRNU2f++mCImofUbSTw6wqcBrimrPtIHIyhSmL071Q9P99MKc8FDgvsNpWF k9TPW9dcLR45t1O5diylceJg/FDYexA1h9Xze6fU09WDK8+N0gq/GGmx9fLskmQWevuA eyNJUA4qKFxB8I1nAcQi5Vx0FqNPRGNhpHMkXpsZAMnq1A2cGvekXOlKpHUgdklfOvRp lZV1iN0jGNCHRv+HLJeXUDinwJXrY2Bqnrsff2BCqqYPbdM0qSLmD9ndJMnra3+N8b+B fzynk0VGy8j+oHTnFTfnuVCmg7DbetWs2o6NqodQz5w5B3WpNj+EVYFdxwLupWPMQTWi ng== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2hmgdjstjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 03 May 2018 13:39:13 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w43DdBCL012197 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 May 2018 13:39:12 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w43DdBXs031848; Thu, 3 May 2018 13:39:11 GMT Received: from mail-ot0-f181.google.com (/74.125.82.181) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 03 May 2018 06:39:11 -0700 Received: by mail-ot0-f181.google.com with SMTP id 15-v6so5805438otn.12; Thu, 03 May 2018 06:39:11 -0700 (PDT) X-Gm-Message-State: ALQs6tAUw9BuC92E+HhfJ7V6LcLJB0ZvRL7IEl7PhnBO4bk7VdL6/Llh 6eoKhBWY2ZrQid3ir0xM58xpNwOCVVWI8k23hT0= X-Received: by 2002:a9d:3694:: with SMTP id h20-v6mr1311800otc.176.1525354751027; Thu, 03 May 2018 06:39:11 -0700 (PDT) MIME-Version: 1.0 References: <20180503035931.22439-1-pasha.tatashin@oracle.com> <20180503035931.22439-3-pasha.tatashin@oracle.com> <20180503055407.GN3791@eros> In-Reply-To: <20180503055407.GN3791@eros> From: Pavel Tatashin Date: Thu, 03 May 2018 13:38:35 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] drivers core: multi-threading device shutdown To: tobin@apporbit.com Cc: Steven Sistare , Daniel Jordan , LKML , jeffrey.t.kirsher@intel.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, gregkh@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8881 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=992 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805030121 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 3, 2018 at 1:54 AM Tobin C. Harding wrote: > This code was a pleasure to read, super clean. Hi Tobin, Thank you very much for your review, I will address all of your comments in the next revision. BTW, I found a lock ordering issue in my work that that I will need to fix: In device_shutdown() device_lock() must be taken before devices_kset->list_lock. Instead I will use device_trylock(), and if that fails, will drop devices_kset->list_lock and acquiring the device lock outside, and check that the device is still in the list after taking the list lock again. Pavel