From patchwork Sun Jul 29 13:33:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 10548255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D1C8FA753 for ; Sun, 29 Jul 2018 13:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15E72A4F9 for ; Sun, 29 Jul 2018 13:35:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B47172A4FD; Sun, 29 Jul 2018 13:35:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 476FB2A4F9 for ; Sun, 29 Jul 2018 13:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbeG2PFt (ORCPT ); Sun, 29 Jul 2018 11:05:49 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:46967 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbeG2PFt (ORCPT ); Sun, 29 Jul 2018 11:05:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sandisk.com; i=@sandisk.com; q=dns/txt; s=dkim.sandisk.com; t=1532871320; x=1564407320; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=HlBZSg1Ho1g642lfUKwy6VA0T1WUVCxgEMNyHE6kVAw=; b=ZJZqliNfX3La0YWS85sCLRsRm+2AZehiY23ymMxnPL2kdMS0LHyiEvAH E9UAd9GKsq4/7KpPVtaLOH+vzgEQX48lU2dDrt/58eXn8p/KQaJoNroKP cdnDWirnYNRXYoNRlpKGlbuQn4g68Uefyc28+Tz0jXV1G4P4XK3KzT2xi 58soVo3FgiAoIgvJ47Sq0l5UBxsjBBPC8sVrpXSTjgZ8RGTJpkCGY8x7u EK86HTG8Y1ZUCirAYE6W9+88jToI5/UtXFTiS8jAJ4yF/zWnzQCZDw+PU mWN+hyTn5pP1O8dBcHnYNxYTxPwDdxgD/HnxEUOQZgrLY4ccJOvgH16Be Q==; X-IronPort-AV: E=Sophos;i="5.51,418,1526313600"; d="scan'208";a="189069448" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 29 Jul 2018 21:35:19 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 29 Jul 2018 06:23:17 -0700 Received: from kfae422988.sdcorp.global.sandisk.com ([10.0.231.37]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jul 2018 06:35:17 -0700 From: Avri Altman To: Christoph Hellwig , Johannes Thumshirn , Hannes Reinecke , Bart Van Assche , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Cc: Stanislav Nijnikov , Avi Shchislowski , Alex Lemberg , Subhash Jadavani , Vinayak Holikatti , Avri Altman Subject: [RFC 3/6] scsi: ufs: Instantiate a ufs transport if its available Date: Sun, 29 Jul 2018 16:33:23 +0300 Message-Id: <1532871206-6311-4-git-send-email-avri.altman@sandisk.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532871206-6311-1-git-send-email-avri.altman@sandisk.com> References: <1532871206-6311-1-git-send-email-avri.altman@sandisk.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Call the Attach/Probe/Remove APIs. Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3560185..c2ae406 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -46,6 +46,7 @@ #include "ufs_quirks.h" #include "unipro.h" #include "ufs-sysfs.h" +#include "ufs_bsg.h" #define CREATE_TRACE_POINTS #include @@ -6651,6 +6652,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) hba->clk_scaling.is_allowed = true; } + if (hba->host->transportt) + ufs_bsg_probe(hba); + scsi_scan_host(hba->host); pm_runtime_put_sync(hba->dev); } @@ -7874,6 +7878,7 @@ int ufshcd_shutdown(struct ufs_hba *hba) */ void ufshcd_remove(struct ufs_hba *hba) { + ufs_bsg_remove(hba->host); ufs_sysfs_remove_nodes(hba->dev); scsi_remove_host(hba->host); /* disable interrupts */ @@ -8067,6 +8072,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) hba->is_irq_enabled = true; } + ufs_bsg_attach_transport(hba); + err = scsi_add_host(host, hba->dev); if (err) { dev_err(hba->dev, "scsi_add_host failed\n");