--- zzzz-none-000/linux-5.15.111/drivers/mmc/core/queue.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-arm-6670-761/linux-5.15.111/drivers/mmc/core/queue.c 2024-02-07 09:27:48.000000000 +0000 @@ -3,6 +3,11 @@ * Copyright (C) 2003 Russell King, All Rights Reserved. * Copyright 2006-2007 Pierre Ossman */ +/****************************************************************** + + Includes Intel Corporation's changes/modifications dated: 07/2011. + Changed/modified portions - Copyright(c) 2011-2014, Intel Corporation. +******************************************************************/ #include #include #include @@ -14,6 +19,9 @@ #include #include +#ifdef CONFIG_ARCH_GEN3 +#include +#endif #include "queue.h" #include "block.h" #include "core.h" @@ -461,8 +469,24 @@ blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, mq->queue); blk_queue_rq_timeout(mq->queue, 60 * HZ); +#ifdef CONFIG_ARCH_GEN3 + mq->bp_sg = mmc_alloc_sg(host->max_segs, GFP_KERNEL); + if (!mq->bp_sg) { + ret = -ENOMEM; + goto free_tag_set; + } +#endif + mmc_setup_queue(mq, card); return disk; + +free_tag_set: +#ifdef CONFIG_ARCH_GEN3 + kfree(mq->bp_sg); + mq->bp_sg = NULL; +#endif + blk_mq_free_tag_set(&mq->tag_set); + return ERR_PTR(ret); } void mmc_queue_suspend(struct mmc_queue *mq) @@ -496,6 +520,10 @@ blk_cleanup_queue(q); blk_mq_free_tag_set(&mq->tag_set); +#ifdef CONFIG_ARCH_GEN3 + kfree(mq->bp_sg); + mq->bp_sg = NULL; +#endif /* * A request can be completed before the next request, potentially * leaving a complete_work with nothing to do. Such a work item might