linux-next: manual merge of the mmc tree with the block tree
From: Stephen Rothwell
Date: Mon Feb 19 2024 - 20:01:35 EST
Hi all,
Today's linux-next merge of the mmc tree got a conflict in:
drivers/mmc/core/queue.c
between commit:
616f87661792 ("mmc: pass queue_limits to blk_mq_alloc_disk")
from the block tree and commit:
069279d6fef5 ("mmc: core Drop BLK_BOUNCE_HIGH")
from the mmc tree.
I fixed it up (I think - see below) and can carry the fix as necessary.
This is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/mmc/core/queue.c
index 2ae60d208cdf,316415588a77..000000000000
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@@ -343,50 -341,10 +343,47 @@@ static const struct blk_mq_ops mmc_mq_o
.timeout = mmc_mq_timed_out,
};
-static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
+static struct gendisk *mmc_alloc_disk(struct mmc_queue *mq,
+ struct mmc_card *card)
{
struct mmc_host *host = card->host;
- unsigned block_size = 512;
+ struct queue_limits lim = { };
+ struct gendisk *disk;
+
+ if (mmc_can_erase(card))
+ mmc_queue_setup_discard(card, &lim);
+
- if (!mmc_dev(host)->dma_mask || !*mmc_dev(host)->dma_mask)
- lim.bounce = BLK_BOUNCE_HIGH;
-
+ lim.max_hw_sectors = min(host->max_blk_count, host->max_req_size / 512);
+
+ if (mmc_card_mmc(card) && card->ext_csd.data_sector_size)
+ lim.logical_block_size = card->ext_csd.data_sector_size;
+ else
+ lim.logical_block_size = 512;
+
+ WARN_ON_ONCE(lim.logical_block_size != 512 &&
+ lim.logical_block_size != 4096);
+
+ /*
+ * Setting a virt_boundary implicity sets a max_segment_size, so try
+ * to set the hardware one here.
+ */
+ if (host->can_dma_map_merge) {
+ lim.virt_boundary_mask = dma_get_merge_boundary(mmc_dev(host));
+ lim.max_segments = MMC_DMA_MAP_MERGE_SEGMENTS;
+ } else {
+ lim.max_segment_size =
+ round_down(host->max_seg_size, lim.logical_block_size);
+ lim.max_segments = host->max_segs;
+ }
+
+ disk = blk_mq_alloc_disk(&mq->tag_set, &lim, mq);
+ if (IS_ERR(disk))
+ return disk;
+ mq->queue = disk->queue;
+
+ if (mmc_host_is_spi(host) && host->use_spi_crc)
+ blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, mq->queue);
+ blk_queue_rq_timeout(mq->queue, 60 * HZ);
blk_queue_flag_set(QUEUE_FLAG_NONROT, mq->queue);
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, mq->queue);
Attachment:
pgp3iaB2k92Id.pgp
Description: OpenPGP digital signature