Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Baolin Wang <baolin.wang@linaro.org>,
	Chaotian Jing <chaotian.jing@mediatek.com>,
	Peng Hao <richard.peng@oppo.com>
Subject: Re: [PATCH] mmc: block: Prevent new req entering queue while freeing up the queue
Date: Wed, 11 Nov 2020 21:52:35 +0530	[thread overview]
Message-ID: <4f27eecd-3d10-796c-6b6c-594770502037@codeaurora.org> (raw)
In-Reply-To: <CAPDyKFq0zikjeps36=Mq-Y9MuyiOHZyGVELV+Eh56evu8b8D2A@mail.gmail.com>


On 11/3/2020 8:55 PM, Ulf Hansson wrote:
> On Wed, 28 Oct 2020 at 12:20, Veerabhadrarao Badiganti
> <vbadigan@codeaurora.org> wrote:
>> The commit bbdc74dc19e0 ("mmc: block: Prevent new req entering queue
>> after its cleanup") has introduced this change but it got moved after
>> del_gendisk() with commit 57678e5a3d51 ("mmc: block: Delete gendisk
>> before cleaning up the request queue").
> This isn't the first time we have spotted errors in this path. Seems
> like a difficult path to get correct. :-)
>
>> It is blocking reboot with below Call stack().
>>
>> INFO: task reboot:3086 blocked for more than 122 seconds.
>>       __schedule
>>       schedule
>>       schedule_timeout
>>       io_schedule_timeout
>>       do_wait_for_common
>>       wait_for_completion_io
>>       submit_bio_wait
>>       blkdev_issue_flush
>>       ext4_sync_fs
>>       __sync_filesystem
>>       sync_filesystem
>>       fsync_bdev
>>       invalidate_partition
>>       del_gendisk
>>       mmc_blk_remove_req
>>       mmc_blk_remove
>>       mmc_bus_remove
>>       device_release_driver_internal
>>       device_release_driver
>>       bus_remove_device
>>       device_del
>>       mmc_remove_card
>>       mmc_remove
>>       mmc_stop_host
>>       mmc_remove_host
>>       sdhci_remove_host
>>       sdhci_msm_remove
> Why do you call sdhci_msm_remove() from the shutdown callback? What
> specific operations do you need to run in the shutdown path for sdhci
> msm?
I was suggested to add shutdown callback by memory team to gracefully 
de-register with smmu driver
during reboot/shutdown. So tried adding it. Since SMMU team.

I just need to ensure that controller is not active anymore and not 
accessing memory related to any
requests and de-register with smmu driver during shutdown.
>
> The important part should be to do a graceful shutdown of the card
> (and the block device) - is there anything else?
>
> Or you are just using the shutdown callback as a simple way to trigger
> this problem? Could unbinding the driver trigger the same issue?
>
>>       sdhci_msm_shutdown
>>       platform_drv_shutdown
>>       device_shutdown
>>       kernel_restart_prepare
>>       kernel_restart
>>
>> So bringing this change back.
>>
>> Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
>> ---
>>
>> I'm observing this issue 100% of the time with shutdown callback added to sdhci-msm driver.
>> I'm trying on 5.4 kernel with ChromeOS.
>>
>> Please let me know if this can be fixed in a better way.
> I don't know yet, but I will have a closer look. Let's also see if
> Adrian has some thoughts.
>
> Kind regards
> Uffe
>
>> ---
>>
>>   drivers/mmc/core/block.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
>> index 8d3df0be0355..76dbb2b8a13b 100644
>> --- a/drivers/mmc/core/block.c
>> +++ b/drivers/mmc/core/block.c
>> @@ -2627,6 +2627,7 @@ static void mmc_blk_remove_req(struct mmc_blk_data *md)
>>                   * from being accepted.
>>                   */
>>                  card = md->queue.card;
>> +               blk_set_queue_dying(md->queue.queue);
>>                  if (md->disk->flags & GENHD_FL_UP) {
>>                          device_remove_file(disk_to_dev(md->disk), &md->force_ro);
>>                          if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) &&
>> --
>> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
>>

      parent reply	other threads:[~2020-11-11 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 11:19 [PATCH] mmc: block: Prevent new req entering queue while freeing up the queue Veerabhadrarao Badiganti
2020-11-03  6:41 ` Veerabhadrarao Badiganti
2020-11-03 15:25 ` Ulf Hansson
2020-11-05  7:24   ` Adrian Hunter
2020-11-11 16:22   ` Veerabhadrarao Badiganti [this message]

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=4f27eecd-3d10-796c-6b6c-594770502037@codeaurora.org \
    --to=vbadigan@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang@linaro.org \
    --cc=chaotian.jing@mediatek.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=richard.peng@oppo.com \
    --cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox