linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: block: Prevent new req entering queue while freeing up the queue
@ 2020-10-28 11:19 Veerabhadrarao Badiganti
  2020-11-03  6:41 ` Veerabhadrarao Badiganti
  2020-11-03 15:25 ` Ulf Hansson
  0 siblings, 2 replies; 5+ messages in thread
From: Veerabhadrarao Badiganti @ 2020-10-28 11:19 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson
  Cc: linux-mmc, linux-kernel, linux-arm-msm, Veerabhadrarao Badiganti,
	Jens Axboe, Baolin Wang, Chaotian Jing, Peng Hao

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").

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
     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.
---

 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-11 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).