Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3388199rwb; Fri, 30 Sep 2022 02:53:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qSCX5kM0JJ4MRyIz0yjrVZXGi7hEqYcqUm9AD6N8s/mvfsCBjupy47h5jOaDfx0lB8vNp X-Received: by 2002:a17:90a:2ac4:b0:205:edd0:9f49 with SMTP id i4-20020a17090a2ac400b00205edd09f49mr14489292pjg.228.1664531603365; Fri, 30 Sep 2022 02:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664531603; cv=none; d=google.com; s=arc-20160816; b=CHgiYmQ/V1s836gW0D4KRMVlTmOlfC5SBli+V1+/eRHVGJ8NUr8w2a5HNmXUTR7KDh /cnj4NywGZfY6kgeJL86zadcjTR9rOZTMxK/XaqxKJ7AEtoKvAjPqwPncQ8252K2gecp ifY+6dWFxrgRahHSywzDp6DzVo3b5vVC55Pri7oX6UR36ve0k+fmDAeHjpCWUoMseO2J +8ypriiNJkHBWqd3GNebFu3UbV2avDIQBvHo2UvkeC9RfmOPqYqBIGhFTw9lw7ky4Cg8 HbJo3Vx0dIQiKxBkzibAx4u9LVBjw9ZCSx0yZ9uCI2wyfGXnuZZpUzqfBnwoAZRZKU5a K4rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=L4qqFOCpaCQVZ7/RWnNGM12gMeTU7gAvoltBB1el1vs=; b=DvulNros5/PIw/P7/kAX5UYjePkGhEj/xa9Xat9WOaK9LYLPMhrUOboh5x6ljrSxkK MMRMpdymASFRTNSP2QJ5ef2O7OtX16MLNvF5eqnN7085TDImoGWutdNCHPr99HMxJUYU cMkSmn7/vPOP+LP0BxtUI9j+D1bZy6TZ8vwz0VWZm6YL65DheiyAriGp66A4ms9XJxdw hQOgoC1lnVBtffM830YMukwrXL9/vJMwI4OHNTAnytq/QA87Cd06WqSnb3wJAwGI49TM h/IunrRwODQ1ddTOA+Npa4HEb9fMMOOakCGEQHBkIcoql8pwFCcpgJb7DIy5YoWeWLhQ X+wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=Qnpt1LZs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a634003000000b00439c9310023si2627979pga.740.2022.09.30.02.53.12; Fri, 30 Sep 2022 02:53:23 -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; dkim=pass header.i=@ionos.com header.s=google header.b=Qnpt1LZs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231191AbiI3JQP (ORCPT + 99 others); Fri, 30 Sep 2022 05:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231331AbiI3JQK (ORCPT ); Fri, 30 Sep 2022 05:16:10 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F175C14BA for ; Fri, 30 Sep 2022 02:16:08 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id z4so5954960lft.2 for ; Fri, 30 Sep 2022 02:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=L4qqFOCpaCQVZ7/RWnNGM12gMeTU7gAvoltBB1el1vs=; b=Qnpt1LZsarX4zeglmcRefK8Kw6kDNgNJcv83vbfpaO3pwqS5Z8TLk1SCJjPmwaRhdR ZzG/FeQodQ9auTPtEv8y4CDC9MlNQ7E6kyrI+FKK5q8ir74CZnLkmRVID3i+DitG3Ddc +9NWUD6+snMJQa3Me1vw4LlD+Y47zfBooctBqaLwYU7Tm1A53sFImwtlfvz0nIY2nZG4 oPldrbvupt4+kZD1JZbWMSyZsoLlOLgoTJY5z94lSt+9UexX1Y4n5oyLZPW4QUmRrbXZ FkV+Pv9CZyx6gwvDUAy2dTdg/bAbJeXnW9SsZgQqHV/Snt6eQCVKpY66/Qv6pxsJFo6+ 03LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=L4qqFOCpaCQVZ7/RWnNGM12gMeTU7gAvoltBB1el1vs=; b=t7MZMSaumiwfIN1DyZNbFcpCx3pz6j0Hv3MKHoRN4RdGnVLPG0ZRGilncuvgNrIe+X ZvRRBhYGD9OglMdTqGIm5CY4fI7VkcRUM3XzpvhB+Vfe9cAF6tZNvn1zSoe4fAMp9beg 5S5diFSUnLumT/HsVC3s5jCjx3wG400CptwL7Sdcu3jxODFqjEFMy/QXDT2f6rOZtY5B Tk8k3z58419Kh23SMEHntE23Am1PuEKcNtiOZGgLO48TfufXUh5NitEuXhoZcYetDkUD GRxUFmv7Rcrn6idJnZCsq17lSFatQsq7O7vqbv6t4Z+NVJbKEUQwnRxMI0ZK/SP3F9Yb J5Mw== X-Gm-Message-State: ACrzQf2I+za5DoTb+YqhV1Kg+T0mmAmwHyw/VzW8FG3VKcX5X42+tqyD jp52BNgP+Vrtu8fkiN+NcognR32ompNg6oybjWbvYQ== X-Received: by 2002:a05:6512:2345:b0:49e:359f:5579 with SMTP id p5-20020a056512234500b0049e359f5579mr3251818lfu.478.1664529365857; Fri, 30 Sep 2022 02:16:05 -0700 (PDT) MIME-Version: 1.0 References: <1664528184-162714-1-git-send-email-john.garry@huawei.com> <1664528184-162714-4-git-send-email-john.garry@huawei.com> In-Reply-To: <1664528184-162714-4-git-send-email-john.garry@huawei.com> From: Jinpu Wang Date: Fri, 30 Sep 2022 11:15:54 +0200 Message-ID: Subject: Re: [PATCH v2 3/6] scsi: pm8001: Remove pm8001_tag_init() To: John Garry Cc: jejb@linux.ibm.com, martin.petersen@oracle.com, jinpu.wang@ionos.com, damien.lemoal@wdc.com, hare@suse.de, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, ipylypiv@google.com, changyuanl@google.com, hch@lst.de, yanaijie@huawei.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE 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 On Fri, Sep 30, 2022 at 11:03 AM John Garry wrote: > > From: Igor Pylypiv > > In commit 5a141315ed7c ("scsi: pm80xx: Increase the number of outstanding > I/O supported to 1024") the pm8001_ha->tags allocation was moved into > pm8001_init_ccb_tag(). This changed the execution order of allocation. > pm8001_tag_init() used to be called after the pm8001_ha->tags allocation > and now it is called before the allocation. > > Before: > > pm8001_pci_probe() > `--> pm8001_pci_alloc() > `--> pm8001_alloc() > `--> pm8001_ha->tags = kzalloc(...) > `--> pm8001_tag_init(pm8001_ha); // OK: tags are allocated > > After: > > pm8001_pci_probe() > `--> pm8001_pci_alloc() > | `--> pm8001_alloc() > | `--> pm8001_tag_init(pm8001_ha); // NOK: tags are not allocated > | > `--> pm8001_init_ccb_tag() > `--> pm8001_ha->tags = kzalloc(...) // today it is bitmap_zalloc() > > Since pm8001_ha->tags_num is zero when pm8001_tag_init() is called it does > nothing. Tags memory is allocated with bitmap_zalloc() so there is no need > to manually clear each bit with pm8001_tag_free(). > > Reviewed-by: Changyuan Lyu > Signed-off-by: Igor Pylypiv > Signed-off-by: John Garry > Reviewed-by: Damien Le Moal Reviewed-by: Jack Wang > --- > drivers/scsi/pm8001/pm8001_init.c | 2 -- > drivers/scsi/pm8001/pm8001_sas.c | 7 ------- > drivers/scsi/pm8001/pm8001_sas.h | 1 - > 3 files changed, 10 deletions(-) > > diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c > index a0028e130a7e..0edc9857a8bd 100644 > --- a/drivers/scsi/pm8001/pm8001_init.c > +++ b/drivers/scsi/pm8001/pm8001_init.c > @@ -436,8 +436,6 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha, > atomic_set(&pm8001_ha->devices[i].running_req, 0); > } > pm8001_ha->flags = PM8001F_INIT_TIME; > - /* Initialize tags */ > - pm8001_tag_init(pm8001_ha); > return 0; > > err_out_nodev: > diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c > index d5ec29f69be3..066dfa9f4683 100644 > --- a/drivers/scsi/pm8001/pm8001_sas.c > +++ b/drivers/scsi/pm8001/pm8001_sas.c > @@ -96,13 +96,6 @@ int pm8001_tag_alloc(struct pm8001_hba_info *pm8001_ha, u32 *tag_out) > return 0; > } > > -void pm8001_tag_init(struct pm8001_hba_info *pm8001_ha) > -{ > - int i; > - for (i = 0; i < pm8001_ha->tags_num; ++i) > - pm8001_tag_free(pm8001_ha, i); > -} > - > /** > * pm8001_mem_alloc - allocate memory for pm8001. > * @pdev: pci device. > diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h > index 8ab0654327f9..9acaadf02150 100644 > --- a/drivers/scsi/pm8001/pm8001_sas.h > +++ b/drivers/scsi/pm8001/pm8001_sas.h > @@ -632,7 +632,6 @@ extern struct workqueue_struct *pm8001_wq; > > /******************** function prototype *********************/ > int pm8001_tag_alloc(struct pm8001_hba_info *pm8001_ha, u32 *tag_out); > -void pm8001_tag_init(struct pm8001_hba_info *pm8001_ha); > u32 pm8001_get_ncq_tag(struct sas_task *task, u32 *tag); > void pm8001_ccb_task_free(struct pm8001_hba_info *pm8001_ha, > struct pm8001_ccb_info *ccb); > -- > 2.35.3 >