Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2bf0661 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: fix task abort due to req timeout on UFS card after removal"

parents 59da9310 ad5bf168
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -8903,6 +8903,7 @@ static void ufshcd_remove_device(struct ufs_hba *hba)
	int sdev_count = 0, i;
	unsigned long flags;

	hba->card_removal_in_progress = 1;
	ufshcd_hold_all(hba);
	/* Reset the host controller */
	spin_lock_irqsave(hba->host->host_lock, flags);
@@ -8933,6 +8934,7 @@ static void ufshcd_remove_device(struct ufs_hba *hba)
	spin_unlock_irqrestore(hba->host->host_lock, flags);

	ufshcd_release_all(hba);
	hba->card_removal_in_progress = 0;
}

static void ufshcd_card_detect_handler(struct work_struct *work)
@@ -8958,9 +8960,11 @@ static int ufshcd_card_detect_notifier(struct notifier_block *nb,
{
	struct ufs_hba *hba = container_of(nb, struct ufs_hba, card_detect_nb);

	if (event)
	if (event) {
		if (hba->card_removal_in_progress)
			goto out;
		ufshcd_set_card_online(hba);
	else
	} else
		ufshcd_set_card_offline(hba);

	if (ufshcd_is_card_offline(hba) && !hba->sdev_ufs_device)
+2 −0
Original line number Diff line number Diff line
@@ -768,6 +768,7 @@ enum ufshcd_card_state {
 * @card_detect_nb: card detector notifier registered with @extcon
 * @card_detect_work: work to exectute the card detect function
 * @card_state: card state event, enum ufshcd_card_state defines possible states
 * @card_removal_in_progress: to track card removal progress
 * @vreg_info: UFS device voltage regulator information
 * @clk_list_head: UFS host controller clocks list node head
 * @pwr_info: holds current power mode
@@ -1005,6 +1006,7 @@ struct ufs_hba {
	struct notifier_block card_detect_nb;
	struct work_struct card_detect_work;
	atomic_t card_state;
	int card_removal_in_progress;

	struct ufs_pa_layer_attr pwr_info;
	struct ufs_pwr_mode_info max_pwr_info;