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

Commit 3425fbfe authored by Moger, Babu's avatar Moger, Babu Committed by James Bottomley
Browse files

[SCSI] scsi_dh_rdac : decide whether to send mode select based on operating mode



Based on the operating modes, handler decides whether to send mode
select or not. Purpose here is to reduce io-shipping as much as
possible whenever there is an option.

Signed-off-by: default avatarBabu Moger <babu.moger@lsi.com>
Reviewed-by: default avatarYanling Qi <yanling.qi@lsi.com>
Reviewed-by: default avatarSudhir Dachepalli <Sudhir.Dachepalli@lis.com>
Reviewed-by: default avatarSomasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Reviewed-by: default avatarBob Stankey <Robert.Stankey@lsi.com>
Reviewed-by: default avatarVijay Chauhan <Vijay.Chauhan@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 1c3afc42
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -670,12 +670,27 @@ static int rdac_activate(struct scsi_device *sdev,
{
	struct rdac_dh_data *h = get_rdac_data(sdev);
	int err = SCSI_DH_OK;
	int act = 0;

	err = check_ownership(sdev, h);
	if (err != SCSI_DH_OK)
		goto done;

	if (h->lun_state == RDAC_LUN_UNOWNED) {
	switch (h->mode) {
	case RDAC_MODE:
		if (h->lun_state == RDAC_LUN_UNOWNED)
			act = 1;
		break;
	case RDAC_MODE_IOSHIP:
		if ((h->lun_state == RDAC_LUN_UNOWNED) &&
		    (h->preferred == RDAC_PREFERRED))
			act = 1;
		break;
	default:
		break;
	}

	if (act) {
		err = queue_mode_select(sdev, fn, data);
		if (err == SCSI_DH_OK)
			return 0;