From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52E91C433FE for ; Tue, 4 Oct 2022 18:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h5OHpsBHbCVpk4UdA8C0XoCEFerxXXxmMzg4hU2Xnek=; b=Iaj5H1/URH8WBe0Npu4RXV/29u O/xphDeD2lKgEGl81h/4QFPRG30Zvo/cDCITAsOm7Eaz8QhifQK/iriD2VQTnNlTgoR5uTLV4eClS n5lDdXUFba2OfP4KwqZWHef0JTqDRHUfF1lPqyx3ttl3tFyt6XpodxvFYMzoMn75Yg5gG9pLilNKc CsQHRrvJla1ypN2/toSMuVuN6pCvisHZ/FB5Y4RmwaMd53TaMxSptK1IzTIk7Vg9V//rF2ptLIDvo EaDtP0yfK+dAgFlZS7s/ysaxQ6KOUaLrh+is+b/l/0bYnCXMCNgTrH/UHyF9GHQMlbYUy+rQ3aXkY 1S66VLKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofn1s-00AiCD-9W; Tue, 04 Oct 2022 18:52:32 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofn1o-00Ai8V-Gv; Tue, 04 Oct 2022 18:52:30 +0000 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 294F8Tef026458; Tue, 4 Oct 2022 18:52:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=zzbBuykHboidDhljzKC9UhaXjiSeCNufM3SCTwx7jYo=; b=Rh0IVUe/vCAPMaEzssEuy6lxbfgr2OJgefuUF+i+IDFhikPdXOdXZQmRy8wra8zsqxC6 KWF65NCiXu6tfRayFz61rAsWJN9Uyg58g6jKtsYQyhjtcy8F4nCOlD9uGk2tBaqjKjWn sOt6etq9pXvp3Wjtz6Uav2s/pJTJMdxltMd6Uf3+iM9HZ1HEu3uxntVx/HErQfKkuewX bd7INt+LM4CTReTJeJUIQtOYGQXa6919/u1GBiCc49berR35yrx8fxWi6hgnIfa3MukR wp40QxcXULePIPZ8HPKQJKZSNqqWKbLtYwM0HocID7oKhOomND+c7x2H7xxJbwPh7+dk iQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3k0escskkx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Oct 2022 18:52:01 +0000 Received: from nasanex01a.na.qualcomm.com (corens_vlan604_snip.qualcomm.com [10.53.140.1]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 294Iq0De002119 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 4 Oct 2022 18:52:00 GMT Received: from asutoshd-linux1.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 4 Oct 2022 11:52:00 -0700 Date: Tue, 4 Oct 2022 11:51:59 -0700 From: Asutosh Das To: Bart Van Assche CC: , , , , , , , , , , , , , Alim Akhtar , "James E.J. Bottomley" , Matthias Brugger , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH v1 03/16] ufs: core: Defer adding host to scsi if mcq is supported Message-ID: <20221004185159.GB25671@asutoshd-linux1.qualcomm.com> References: <197a8bcca288f9c36586099aa07606ed3f067c9b.1663894792.git.quic_asutoshd@quicinc.com> <4767355d-e7b0-d38b-88f3-c070ed0b5e5b@acm.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4767355d-e7b0-d38b-88f3-c070ed0b5e5b@acm.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: cWhwDJ6lki4eghnjMnQjS6I_7wh4dhvX X-Proofpoint-ORIG-GUID: cWhwDJ6lki4eghnjMnQjS6I_7wh4dhvX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-04_08,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210040122 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_115228_590064_BC872B03 X-CRM114-Status: GOOD ( 15.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 30 2022 at 11:32 -0700, Bart Van Assche wrote: >On 9/22/22 18:05, Asutosh Das wrote: >>@@ -8218,6 +8219,14 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params) >> ret = ufshcd_device_params_init(hba); >> if (ret) >> goto out; >>+ >>+ if (is_mcq_supported(hba)) { >>+ ret = scsi_add_host(host, hba->dev); >>+ if (ret) { >>+ dev_err(hba->dev, "scsi_add_host failed\n"); >>+ goto out; >>+ } >>+ } >> } > >Calling scsi_add_host() from ufshcd_probe_hba() seems wrong to me >since that function is not only called when probing a host controller >but also when resetting a host controller. See also >ufshcd_host_reset_and_restore(). > The scsi_add_host() is only invoked from ufshcd_probe_hba() if init_dev_params is true. That flag is false when ufshcd_probe_hba() is invoked from ufshcd_host_reset_and_restore(). So scsi_add_host() won't be invoked from ufshcd_host_reset_and_restore(). Even ufshcd_device_params_init() is invoked the same way now. >> ufshcd_tune_unipro_params(hba); >>@@ -9764,10 +9773,12 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) >> hba->is_irq_enabled = true; >> } >>- err = scsi_add_host(host, hba->dev); >>- if (err) { >>- dev_err(hba->dev, "scsi_add_host failed\n"); >>- goto out_disable; >>+ if (!is_mcq_supported(hba)) { >>+ err = scsi_add_host(host, hba->dev); >>+ if (err) { >>+ dev_err(hba->dev, "scsi_add_host failed\n"); >>+ goto out_disable; >>+ } >> } >> hba->tmf_tag_set = (struct blk_mq_tag_set) { > >Please make sure there is only a single scsi_add_host() call in the >UFS host controller driver. > One way would be to move the scsi_add_host() to ufshcd_probe_hba(). PLMK if you think this is not OK. >Thanks, > >Bart. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel