Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3611971ybl; Sun, 15 Dec 2019 13:56:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwNouRFDsrhHhPaHMK/JHQqZp02SkmnXrdJhPhioQmi04uMgToTvfvDj/A/jogV4Hn4PqOw X-Received: by 2002:a05:6830:158:: with SMTP id j24mr8327449otp.316.1576446998966; Sun, 15 Dec 2019 13:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576446998; cv=none; d=google.com; s=arc-20160816; b=jc843RZU5ZXAVpujyusrmmLzAqpD6HP1mRwHQhnWlN1PSQiY5/Y6/xd9iRYuk83qPY MAd+OpqPporRPtnlHj3qsyRD3rP7Q8eeg6yfm9oNlLkegut8l40IQV4suCkir4FyMbE4 N9vUbPvKhMTyIBAdjgnSC+Z2DNWHJeqYeW5N2ihbSvwCNso6bXQa3vissgQ6z9omUqMJ s2bYxDNtpOl7rHCBCZsnnvp0ByUlJBDPw176a4d+nva4mX1vUNwkfdZ2Xw8x1roObsl/ bop7i0Zx+BA6i8yMoKSr9eckd2iDoOKiwzgJAzZXYVllahScJ4uH/zz8JxvOe9qj/Flt rZMg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=W0zPH2/BqhFasq2P2pWi0vzcKpg+nZm2Y/FTYzm0w8k=; b=YqaBiJCju93UrqQ2Iw9aqrFV6sWYvRKcIHEqhAidKlJbCaSxanqWQ/e/PpIaqx6BYc zeVu5dZoWUu7y022QSa1KGDUOvE4vfUjndoDlzL83e92sw/QRhzuq80wXjltiEvCWLip umZNRfv99pNylChE+DX99TFn0nhANWPNGzNksz6MEN60wfMOHWyLR0d+nCr2ubtfTJhO pYlixaPyYDZDK6Fp5+Ayv9/jKPo3uHJ/wJLjOtWJD4+bfeInwD/6sHbz44UgeWaWl7bW pVQeLcW4jlWAf3UuCeT8KV283C/241PbuEG3CJH5ZTRHcKKSij7vQ8Vpng7O5H9nt5yo 2C3Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a93si9674104otc.24.2019.12.15.13.56.25; Sun, 15 Dec 2019 13:56:38 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726373AbfLOVzp (ORCPT + 99 others); Sun, 15 Dec 2019 16:55:45 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34590 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726146AbfLOVzo (ORCPT ); Sun, 15 Dec 2019 16:55:44 -0500 Received: by mail-pf1-f193.google.com with SMTP id l127so2716845pfl.1; Sun, 15 Dec 2019 13:55:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=W0zPH2/BqhFasq2P2pWi0vzcKpg+nZm2Y/FTYzm0w8k=; b=Eguhfrapgw1EZX4syAkpmFWN20OZU25uxVQynwTR9fnRZKUR511EurYzdr4ZCsDZLf tPA7kwze7YheOAmIVCcSm8kl+m7Dc6Fp0bhw0BgS6o7R+nKhZXRr0mEqzwPewnUdZLGG tQ6zZS9hazvIlnl7AP2g03K01N7lXikbWC/6mFXiDof5RrB/0hZ4Sph1IG46ds+OjJ3K C8+pbm7qV7XVON9ztL63vaZldlGz5kCT85Rom7YHjz4re/TAe+5swCFf5kmXYvD1ABCn doNZVPb9MNEJwdFuZ1l/yKa7RRbQT0dbslJUHv+xf3/14yQkr7Y6x3fFfumY3SbVdXWx UqLQ== X-Gm-Message-State: APjAAAW+FrrHwp0Q0zhE86GFbWxsN883/w4A1fsjPcIlRIvziWKyD2kv R/gU+olIyvZP1/2Tp9wvBVo0XBhGTO8= X-Received: by 2002:a65:5a4d:: with SMTP id z13mr14231624pgs.21.1576446943533; Sun, 15 Dec 2019 13:55:43 -0800 (PST) Received: from ?IPv6:2601:647:4000:110a:d014:2a0a:ea98:f50e? ([2601:647:4000:110a:d014:2a0a:ea98:f50e]) by smtp.gmail.com with ESMTPSA id x33sm18752908pga.86.2019.12.15.13.55.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Dec 2019 13:55:42 -0800 (PST) Subject: Re: [PATCH 1/2] scsi: ufs: Put SCSI host after remove it To: cang@codeaurora.org Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Alim Akhtar , Avri Altman , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Venkat Gopalakrishnan , Tomas Winkler , open list References: <1576328616-30404-1-git-send-email-cang@codeaurora.org> <1576328616-30404-2-git-send-email-cang@codeaurora.org> <85475247-efd5-732e-ae74-6d9a11e1bdf2@acm.org> <5aa3a266e3db3403e663b36ddfdc4d60@codeaurora.org> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVUvkkvRmmwTwIjIJvZOu6wNm+dz5AF4z0FHW2KNZL3oheO3P8UZWr LQOrCfRcK8e/s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++w1mLeRUvda3i4/U8wDT3SWuHcB3DWlcppECLkAEQEAAYkBHwQYAQIACQUCVI67igIbDAAK CRBxXD01xc4QCZ4dB/0QrnEasxjM0PGeXK5hcZMT9Eo998alUfn5XU0RQDYdwp6/kMEXMdmT oH0F0xB3SQ8WVSXA9rrc4EBvZruWQ+5/zjVrhhfUAx12CzL4oQ9Ro2k45daYaonKTANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <2956b9c7-b019-e2b3-7a1b-7b796b724add@acm.org> Date: Sun, 15 Dec 2019 13:55:41 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <5aa3a266e3db3403e663b36ddfdc4d60@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-12-14 14:24, cang@codeaurora.org wrote: > How do you think if I replace my patch with below one? > In this way, you can also move blk_cleanup_queue() behind > cancel_work_sync(eh_work). > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index b5966fa..bd4ae75 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -8251,15 +8251,17 @@ void ufshcd_remove(struct ufs_hba *hba) >         ufs_bsg_remove(hba); >         ufs_sysfs_remove_nodes(hba->dev); >         scsi_remove_host(hba->host); > -       /* disable interrupts */ > -       ufshcd_disable_intr(hba, hba->intr_mask); > -       ufshcd_hba_stop(hba, true); > - >         ufshcd_exit_clk_scaling(hba); >         ufshcd_exit_clk_gating(hba); >         if (ufshcd_is_clkscaling_supported(hba)) >                 device_remove_file(hba->dev, > &hba->clk_scaling.enable_attr); > +       cancel_work_sync(&hba->eeh_work); > +       cancel_work_sync(&hba->eh_work); > +       /* disable interrupts */ > +       ufshcd_disable_intr(hba, hba->intr_mask); > +       ufshcd_hba_stop(hba, true); >         ufshcd_hba_exit(hba); > +       ufshcd_dealloc_host(hba); >  } >  EXPORT_SYMBOL_GPL(ufshcd_remove); Hi Can, To which kernel tree does the above patch apply? I'm asking this because I don't see the recently added blk_cleanup_queue() calls in the above patch. Please start from Martin's latest scsi-queue branch when preparing SCSI patches. Additionally, is it on purpose that there is no scsi_host_put() call in the above code? I'd like to keep that call because without that call a memory leak will occur when unloading the ufshcd-core kernel driver. Thanks, Bart.