Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752214AbdHCKJ7 (ORCPT ); Thu, 3 Aug 2017 06:09:59 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:35702 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbdHCKJ4 (ORCPT ); Thu, 3 Aug 2017 06:09:56 -0400 MIME-Version: 1.0 In-Reply-To: <5fb13656-0f40-fdc4-8612-ec1bf04cf696@suse.de> References: <1500038560-11231-1-git-send-email-suganath-prabu.subramani@broadcom.com> <1500038560-11231-3-git-send-email-suganath-prabu.subramani@broadcom.com> <5fb13656-0f40-fdc4-8612-ec1bf04cf696@suse.de> From: Sreekanth Reddy Date: Thu, 3 Aug 2017 15:39:53 +0530 Message-ID: Subject: Re: [PATCH v2 02/13] mpt3sas: Add nvme device support in slave alloc, target alloc and probe To: Hannes Reinecke Cc: Suganath Prabu S , "jejb@kernel.org" , Christoph Hellwig , "Martin K. Petersen" , "linux-scsi@vger.kernel.org" , Sathya Prakash , Kashyap Desai , "linux-kernel@vger.kernel.org" , Chaitra Basappa , linux-nvme@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v73AA4w4003215 Content-Length: 2576 Lines: 58 On Thu, Aug 3, 2017 at 11:57 AM, Hannes Reinecke wrote: > On 07/14/2017 03:22 PM, Suganath Prabu S wrote: >> 1) Added support for probing pcie device and adding NVMe drives to >> SML and driver's internal list pcie_device_list. >> >> 2) Added support for determing NVMe as boot device. >> >> 3) Added nvme device support for call back functions scan_finished >> target_alloc,slave_alloc,target destroy and slave destroy. >> >> a) During scan, pcie devices are probed and added to SML to drivers >> internal list. >> >> b) target_alloc & slave alloc API's allocates resources for >> (MPT3SAS_TARGET & MPT3SAS_DEVICE) private datas and holds >> information like handle, target_id etc. >> >> c) slave_destroy & target_destroy are called when driver unregisters >> or removes device. Also frees allocated resources and info. >> >> Signed-off-by: Chaitra P B >> Signed-off-by: Suganath Prabu S >> --- >> drivers/scsi/mpt3sas/mpt3sas_base.h | 110 ++++++++- >> drivers/scsi/mpt3sas/mpt3sas_scsih.c | 431 +++++++++++++++++++++++++++++++--- >> 2 files changed, 507 insertions(+), 34 deletions(-) >> > Have you considered using 'scan_start()/scan_finished()' SCSI midlayer > callbacks here? > Seeing that you are enumerating the devices internally already that > should give you better control about the scanning process. Yes mpt3sas driver has defined scan_start() & scan_finished() callbacks function. In the scan_start() callback function driver will issue Port Enable request to the HBA Firmware to enable the HBA ports, so the driver can start receiving drives (SAS/SATA/NVMe) discovery events from firmware and add the discovered drives to the respective drive type list. (e.g. SAS & SATA drives are added sas_device_list and NVMe drives are added to pcie_device_list) . Once the driver receives the Port Enable completion reply message from firmware then in the scan_finished() callback function driver will register the SAS & SATA devices added in the sas_device_list to SCSI Transport Layer by using sas_rphy_add() API and NVMe devices added in the pcie_device_list are directly added to SML by using scsi_add_device() API with channel number set to two. Thanks, Sreekanth > > Cheers, > > Hannes > -- > Dr. Hannes Reinecke Teamlead Storage & Networking > hare@suse.de +49 911 74053 688 > SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg > GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton > HRB 21284 (AG Nürnberg)