From patchwork Wed Sep 15 09:07:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 512190 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2339112jao; Wed, 15 Sep 2021 02:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlpkCYbwoxkVquz9wWmb1pg/dG1J9npn6xQEXc1rtme+UJhBIblRMjRGrETkX16G+sIcBt X-Received: by 2002:a5d:9c53:: with SMTP id 19mr16657314iof.192.1631697142441; Wed, 15 Sep 2021 02:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631697142; cv=none; d=google.com; s=arc-20160816; b=xTITno9lfbcyp4VlKGlOpTaCUc6udhhWjyf+GjWf3DkNiNnGDIKicnTAZSff01LiLY ToOQaa2WYGaEWXdF6T9MzecEzwn1bXe7XttbqgoXXS2xc9CCjxvg2KmJRAHSLMuwYQEp cqS2V2WZ3Uqp+DkEHgUNddEj1aYi5iRKrFtluOAJ0UO8GzSzfMIjzynkkf3SpPxhnDKa /SBvnIzEZfvGzWBsS/y4+VIjFJ8x2ZreGFLw6kH+2EnJOcaqU6ymGcThQXj4y4QLPgS/ G2vfzX02YZhmfVp/PwEO3QMKqTNIYXj52srXyJoO8PDsvG6bb8DD5tfnkwI/cqgT2KvN Fa9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=wxp8LgEeFp8s51UBPlETORfRirDcGxR7//hfasQYa/A=; b=nQxJUmvtBzA0f4FFYlYQwffnXjGKnrLLp0A69UIkUOVxzpc1U0sg0SLlEEj7ujqoE6 BpPdUp0Hgn+0Oah4sDa8KgqEVb/bxMhaHQBN0vUhfGN4V4jRnvG7oVmConnJYf6WseG0 cY4Ws7tlKcq1apnEEDeO46qYoDQT0E8WUdxes+ArV5Iahqshu4kw5HZ3D1fQ3m5Oqaur S7JMQ/LeoAD0AFEcKKwYQKP3Wa5HmQVW/rOKTZoSV5rA4rbbSLgU56O2uTDDD0DMFc0p BxeI9LaEh38EpCzf/Q/WFNneO+3pjRzacRbp5UiHygg3T/jMAvmicl95Ys75ZozR+b+l xsvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si12835460ilc.151.2021.09.15.02.12.22 for ; Wed, 15 Sep 2021 02:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237336AbhIOJNj (ORCPT ); Wed, 15 Sep 2021 05:13:39 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3811 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237090AbhIOJNe (ORCPT ); Wed, 15 Sep 2021 05:13:34 -0400 Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4H8ZDW6GNpz685Bk; Wed, 15 Sep 2021 17:10:03 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 15 Sep 2021 11:12:14 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 15 Sep 2021 10:12:12 +0100 From: John Garry To: , , , CC: , , , John Garry Subject: [PATCH v2 1/3] fas216: kill scmd->tag Date: Wed, 15 Sep 2021 17:07:13 +0800 Message-ID: <1631696835-136198-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1631696835-136198-1-git-send-email-john.garry@huawei.com> References: <1631696835-136198-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke The driver is attempting to allocated a tag internally, which is is no-go with blk-mq. Switch the driver to use the request tag and kill usage of scmd->tag and scmd->device->current_tag. Signed-off-by: Hannes Reinecke jpg: Change to use scsi_cmd_to_rq() Signed-off-by: John Garry --- drivers/scsi/arm/fas216.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index 9c4458a99025..cf71ef488e36 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -77,7 +77,6 @@ * I was thinking that this was a good chip until I found this restriction ;( */ #define SCSI2_SYNC -#undef SCSI2_TAG #undef DEBUG_CONNECT #undef DEBUG_MESSAGES @@ -990,7 +989,7 @@ fas216_reselected_intr(FAS216_Info *info) info->scsi.disconnectable = 0; if (info->SCpnt->device->id == target && info->SCpnt->device->lun == lun && - info->SCpnt->tag == tag) { + scsi_cmd_to_rq(info->SCpnt)->tag == tag) { fas216_log(info, LOG_CONNECT, "reconnected previously executing command"); } else { queue_add_cmd_tail(&info->queues.disconnected, info->SCpnt); @@ -1791,8 +1790,9 @@ static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) /* * add tag message if required */ - if (SCpnt->tag) - msgqueue_addmsg(&info->scsi.msgs, 2, SIMPLE_QUEUE_TAG, SCpnt->tag); + if (SCpnt->device->simple_tags) + msgqueue_addmsg(&info->scsi.msgs, 2, SIMPLE_QUEUE_TAG, + scsi_cmd_to_rq(SCpnt)->tag); do { #ifdef SCSI2_SYNC @@ -1815,20 +1815,8 @@ static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt) static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt) { -#ifdef SCSI2_TAG - /* - * tagged queuing - allocate a new tag to this command - */ - if (SCpnt->device->simple_tags && SCpnt->cmnd[0] != REQUEST_SENSE && - SCpnt->cmnd[0] != INQUIRY) { - SCpnt->device->current_tag += 1; - if (SCpnt->device->current_tag == 0) - SCpnt->device->current_tag = 1; - SCpnt->tag = SCpnt->device->current_tag; - } else -#endif - set_bit(SCpnt->device->id * 8 + - (u8)(SCpnt->device->lun & 0x7), info->busyluns); + set_bit(SCpnt->device->id * 8 + + (u8)(SCpnt->device->lun & 0x7), info->busyluns); info->stats.removes += 1; switch (SCpnt->cmnd[0]) { @@ -2117,7 +2105,6 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) init_SCp(SCpnt); SCpnt->SCp.Message = 0; SCpnt->SCp.Status = 0; - SCpnt->tag = 0; SCpnt->host_scribble = (void *)fas216_rq_sns_done; /* @@ -2223,7 +2210,6 @@ static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, init_SCp(SCpnt); info->stats.queues += 1; - SCpnt->tag = 0; spin_lock(&info->host_lock); @@ -3003,9 +2989,8 @@ void fas216_print_devices(FAS216_Info *info, struct seq_file *m) dev = &info->device[scd->id]; seq_printf(m, " %d/%llu ", scd->id, scd->lun); if (scd->tagged_supported) - seq_printf(m, "%3sabled(%3d) ", - scd->simple_tags ? "en" : "dis", - scd->current_tag); + seq_printf(m, "%3sabled ", + scd->simple_tags ? "en" : "dis"); else seq_puts(m, "unsupported ");