All of lore.kernel.org
 help / color / mirror / Atom feed
From: cang@codeaurora.org
To: Bart Van Assche <bvanassche@acm.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 <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	Pedro Sousa <pedrom.sousa@synopsys.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Bean Huo <beanhuo@micron.com>,
	Venkat Gopalakrishnan <venkatg@codeaurora.org>,
	Tomas Winkler <tomas.winkler@intel.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] scsi: ufs: Put SCSI host after remove it
Date: Tue, 17 Dec 2019 09:31:08 +0800	[thread overview]
Message-ID: <d9d18f050ec2d2c86943fa76f73719a1@codeaurora.org> (raw)
In-Reply-To: <ecef25b7-44c0-6b94-c429-6ee5f9508caf@acm.org>

On 2019-12-17 09:15, Bart Van Assche wrote:
> On 12/16/19 4:46 PM, cang@codeaurora.org wrote:
>> On 2019-12-17 01:39, Bart Van Assche wrote:
>>> Apparently some UFS drivers call ufshcd_remove() only and others
>>> (PCIe) call both ufshcd_remove() and ufshcd_dealloc_host(). I think
>>> that the above change will cause trouble for the PCIe driver unless
>>> the ufshcd_dealloc_host() call is removed from ufshcd_pci_remove().
>> 
>> You may get me wrong. I mean we should do like what ufshcd-pci.c does.
>> As driver probe routine allocates SCSI host, then driver remove() 
>> should
>> de-allocate it. Meaning ufs_qcom_remove() should call both 
>> ufshcd_remove()
>> and ufshcd_dealloc_host().
>> 
>> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
>> index 3d4582e..ea45756 100644
>> --- a/drivers/scsi/ufs/ufs-qcom.c
>> +++ b/drivers/scsi/ufs/ufs-qcom.c
>> @@ -3239,6 +3239,7 @@ static int ufs_qcom_remove(struct 
>> platform_device *pdev)
>> 
>>            pm_runtime_get_sync(&(pdev)->dev);
>>            ufshcd_remove(hba);
>>   +       ufshcd_dealloc_host(hba);
>>            return 0;
>>     }
> 
> Hi Can,
> 
> If it is possible to move the ufshcd_dealloc_host() into
> ufshcd_remove() then I would prefer to do that. If all UFS transport
> drivers need that call then I think that call should happen from the
> UFS core instead of from the transport drivers.
> 
> Thanks,
> 
> Bart.

Yeah, that is an once for all solution, but I not sure if PCI folks are
OK if I remove the ufshcd_dealloc_host() call from their driver.
In next version, I will try to make such change and see.

Thanks,
Can Guo.

  reply	other threads:[~2019-12-17  1:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 13:03 [PATCH v3 0/2] Modularize ufs-bsg Can Guo
2019-12-14 13:03 ` [PATCH 1/2] scsi: ufs: Put SCSI host after remove it Can Guo
2019-12-14 18:32   ` Bart Van Assche
2019-12-14 22:24     ` cang
2019-12-15 21:55       ` Bart Van Assche
2019-12-16  1:34         ` cang
2019-12-16  2:39           ` Bart Van Assche
2019-12-16  3:12             ` cang
2019-12-16  5:46               ` cang
2019-12-16 17:44               ` Bart Van Assche
2019-12-16 14:31     ` cang
2019-12-16 17:39       ` Bart Van Assche
2019-12-17  0:46         ` cang
2019-12-17  1:15           ` Bart Van Assche
2019-12-17  1:31             ` cang [this message]
2019-12-16 18:05       ` Greg KH
2019-12-17  0:50         ` cang
2019-12-14 13:03 ` [PATCH 2/2] scsi: ufs: Modularize ufs-bsg Can Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9d18f050ec2d2c86943fa76f73719a1@codeaurora.org \
    --to=cang@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nguyenb@codeaurora.org \
    --cc=pedrom.sousa@synopsys.com \
    --cc=rnayak@codeaurora.org \
    --cc=salyzyn@google.com \
    --cc=saravanak@google.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tomas.winkler@intel.com \
    --cc=venkatg@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.