Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2881514pxp; Tue, 22 Mar 2022 07:48:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKFA11a078udswGKK3gbFvMo7zgoDMpmAnRkoI7hzMhWerwPv7Fd5wVxVUB3bJrRo/UWls X-Received: by 2002:a50:a41a:0:b0:419:d2b:8391 with SMTP id u26-20020a50a41a000000b004190d2b8391mr22284031edb.390.1647960530925; Tue, 22 Mar 2022 07:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647960530; cv=none; d=google.com; s=arc-20160816; b=seNMgO+UVusah/h/6r3iIbn+A46JXjEyd9go3CNzRYMORZKFeex8PWfu55WYal5uDv SQ+DyHL5D1DzxsUd6rlvloFz0bEyq52qShPzOV9H0bf/jTbtLCJdfoF9hnMNbDYQxoEo iAZCQRml6/pgsdceXnngwNrtz+LkV1y8/ANsUBJF2WqEWL10Q3bjBx7uKHPuoRas0+Hx pw13ImdgrsrteeKt8YZXZVrjynSuA/wncQjcxmlrYdArR6nQYktXZikKM8vSIe3wY18W MprZO7UEoJuFtsVkp7zuLgHiF2kGbFNnhNVh4oNw0M6AipRhEZ/0RMoFBiYn39nwk7aJ 4a7Q== 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=bG8r57/bSibavGF2MiqsOFV22nMGsrgAltn/Fv7rSxM=; b=ywu0XAuUGBlrFNbhNS+ngYtagwi+7FXs8VqiwxIJGxMlXc/Yv00w/Ob66ZjSV3jc92 NXYq/RJAIujhEAfT72/fDJMLWdjkd7ypSL/tgR4iCTIWQr7rt9K24EcTSdvMmWMMtE2X o6fugIXmseU0XZfi5nRV/sZvn0qXPI8BXGpIuRixbILYFQ50nyfRrE0EE4BjUa6pZ/yQ QGs31CrTGU3LnAFVyGV0XxxacaT0h1dVCgN2I4TEnjrxG9ahZiGeSvIJVo1o6OuP+B6q rUnMGgP8FT+xD5SYSXK1KNet6KCZvoBLnfq4kVxlzOtK6p26ipYxHTxBUXGzbOru+AU8 ALpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a50f08e000000b00418e692aa7dsi12402921edl.526.2022.03.22.07.48.16; Tue, 22 Mar 2022 07:48:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233639AbiCVKsx (ORCPT + 99 others); Tue, 22 Mar 2022 06:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233799AbiCVKsI (ORCPT ); Tue, 22 Mar 2022 06:48:08 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F68283009; Tue, 22 Mar 2022 03:46:24 -0700 (PDT) Received: from fraeml738-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KN7QM4npFz67l7t; Tue, 22 Mar 2022 18:44:11 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml738-chm.china.huawei.com (10.206.15.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 22 Mar 2022 11:46:22 +0100 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.21; Tue, 22 Mar 2022 10:46:18 +0000 From: John Garry To: , , , , , , , CC: , , , , , , , John Garry Subject: [PATCH 11/11] scsi: hisi_sas: Remove private tag management Date: Tue, 22 Mar 2022 18:39:45 +0800 Message-ID: <1647945585-197349-12-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1647945585-197349-1-git-send-email-john.garry@huawei.com> References: <1647945585-197349-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now every sas_task which the driver sees has a SCSI command and also request associated, so drop the internal tag management. No reserved tags have been set aside in the tagset yet, but this is simple to do. For v2 HW we need to continue to allocate the tag internally as the HW is so broken and we need to use special rules for tag allocation, see slot_index_alloc_quirk_v2_hw() Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 37 +-------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index b3e03c229cb5..19c9ed169c91 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -169,41 +169,6 @@ static void hisi_sas_slot_index_free(struct hisi_hba *hisi_hba, int slot_idx) } } -static void hisi_sas_slot_index_set(struct hisi_hba *hisi_hba, int slot_idx) -{ - void *bitmap = hisi_hba->slot_index_tags; - - __set_bit(slot_idx, bitmap); -} - -static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba, - struct sas_task *task) -{ - int index; - void *bitmap = hisi_hba->slot_index_tags; - - if (task) - return sas_task_to_unique_tag(task); - - spin_lock(&hisi_hba->lock); - index = find_next_zero_bit(bitmap, hisi_hba->slot_index_count, - hisi_hba->last_slot_index + 1); - if (index >= hisi_hba->slot_index_count) { - index = find_next_zero_bit(bitmap, - hisi_hba->slot_index_count, - HISI_SAS_UNRESERVED_IPTT); - if (index >= hisi_hba->slot_index_count) { - spin_unlock(&hisi_hba->lock); - return -SAS_QUEUE_FULL; - } - } - hisi_sas_slot_index_set(hisi_hba, index); - hisi_hba->last_slot_index = index; - spin_unlock(&hisi_hba->lock); - - return index; -} - void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task, struct hisi_sas_slot *slot) { @@ -556,7 +521,7 @@ static int hisi_sas_queue_command(struct sas_task *task, gfp_t gfp_flags) if (!internal_abort && hisi_hba->hw->slot_index_alloc) rc = hisi_hba->hw->slot_index_alloc(hisi_hba, device); else - rc = hisi_sas_slot_index_alloc(hisi_hba, task); + rc = sas_task_to_unique_tag(task); if (rc < 0) goto err_out_dif_dma_unmap; -- 2.26.2