Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp859262ybh; Tue, 10 Mar 2020 09:33:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vswq5AiW6dCFUsFyCkF6n/gwEf+WVAqJfmIBwwm5+PeAtd1hqmh+UX2ovdZouvrW4mCL5Qb X-Received: by 2002:a9d:740d:: with SMTP id n13mr18036057otk.140.1583858032321; Tue, 10 Mar 2020 09:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583858032; cv=none; d=google.com; s=arc-20160816; b=UIkI159PDGgedyExXvDqRmO8LI32ihBj/5f8SDaF/PiyBa7t5Cfm6ybJi5ojYqqXsn g6l4ZdDLs0rdwREc3nabgR/5Jsu3R+5Q7XfrjDn6sUBrGvznCxZRqdw/3H4E2sad4IZh ZzRxAi3hkLdPcWT7oQj491jWwDHsxID3ZdrZWWCAFSkTTLg+8s79x90lVPoTTxblZNrc iVpU2eG5xq09que0TcAQjbGugajwfo8xI26yBb+9Y+RxyH8TdzFjhdQDsVG1GQ7nX1Wq 5xRHOKno1XNH9ZOKqTsiNh8mCtrMxlXI9NZfZGxmKX7zQrepZBoekO/9rggD+sLPzkpK mgCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=gSoCPrqqgOuPkFXjyZTiago9IpMyNuO3kYBwIWsZH0s=; b=yKUzC1hXtn8lJhXC61+8Ba5yv6qQr6CqCXBDViboRFtTea2qlRHyehVF/cPYgcKTlu xms+bvqpnmj83ppLAAqT15gQCjoxIvDaJQTYy5FDTcJkaXPrCECBIBzB12MTvCEeJyvz Y7rg27yaJqf+nxb1r1it0pObqTI5qZV/R7PBnyIjZjQsP5vlrDWSDM4aG9ysUp3KD01O 0k1Hoojxx76D0t3npa2eT6oqR7mEXZnZhAb4o9R+hd78sPzRX7SjblqwQNqjLaZHg/7D wJLTgp+OIbMOmMv4yufbC69GSaPLQ4aIqhzeMQzHDABHU+I4wAYVeJCtQrxCOXMUxh4S qfzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si2592989oii.195.2020.03.10.09.33.40; Tue, 10 Mar 2020 09:33:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727639AbgCJQb5 (ORCPT + 99 others); Tue, 10 Mar 2020 12:31:57 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:11208 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726703AbgCJQao (ORCPT ); Tue, 10 Mar 2020 12:30:44 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 723D63DE2991F21402A8; Wed, 11 Mar 2020 00:30:38 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 11 Mar 2020 00:30:29 +0800 From: John Garry To: , , , , , , CC: , , , , , , Hannes Reinecke Subject: [PATCH RFC v2 17/24] aacraid: move scsi_add_host() Date: Wed, 11 Mar 2020 00:25:43 +0800 Message-ID: <1583857550-12049-18-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1583857550-12049-1-git-send-email-john.garry@huawei.com> References: <1583857550-12049-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke Move the call to scsi_add_host() so that the Scsi_Host structure is initialized before any I/O is sent. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index ee6bc2f9b80a..0e084b09615d 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1676,6 +1676,9 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) shost->unique_id = unique_id; shost->max_cmd_len = 16; shost->use_cmd_list = 1; + shost->max_id = MAXIMUM_NUM_CONTAINERS; + shost->max_lun = AAC_MAX_LUN; + shost->sg_tablesize = HBA_MAX_SG_SEPARATE; if (aac_cfg_major == AAC_CHARDEV_NEEDS_REINIT) aac_init_char(); @@ -1740,6 +1743,10 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out_deinit; } + error = scsi_add_host(shost, &pdev->dev); + if (error) + goto out_deinit; + aac->maximum_num_channels = aac_drivers[index].channels; error = aac_get_adapter_info(aac); if (error < 0) @@ -1798,18 +1805,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) if (!aac->sa_firmware && aac_drivers[index].quirks & AAC_QUIRK_SRC) aac_intr_normal(aac, 0, 2, 0, NULL); - /* - * dmb - we may need to move the setting of these parms somewhere else once - * we get a fib that can report the actual numbers - */ - shost->max_lun = AAC_MAX_LUN; - pci_set_drvdata(pdev, shost); - error = scsi_add_host(shost, &pdev->dev); - if (error) - goto out_deinit; - aac_scan_host(aac); pci_enable_pcie_error_reporting(pdev); -- 2.17.1