Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp634258ybz; Fri, 24 Apr 2020 06:47:02 -0700 (PDT) X-Google-Smtp-Source: APiQypK5xpoDI4g0Eos+qKTDBXEIXsdYSSdbhjlURjK5QI67s+QvAcdy7xlr1e2HvNx4N73nsR0x X-Received: by 2002:a17:906:d291:: with SMTP id ay17mr7274506ejb.183.1587736022248; Fri, 24 Apr 2020 06:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587736022; cv=none; d=google.com; s=arc-20160816; b=KY3SMSw9g43ocPxIsp1z5TZRwlCnsJ19MgXIF+4yleGg98DgtKj895plvIHHorA0nC XD1u7bKwlPO/hYMuxmiQbOXnoYTgx4TzpQJ4D442sGeAkJoGEFsrh74j2to27EYk2p6Y fO9xrua+UXxOPQKkGRAehYDG0LWjMhsP1nBzj0Fur5qN3RnH7jve9z2zt51rbuF3WYhU avZrIhMsqFfhshqb3u3Nx3SL6GsBoX8wGJC69VRMe/wM3WJbXa5w+fHpapZr6FYSk5DU UiAzf86Fy4knFYvuFioCe2BXyzGVLkPGRddD0uRZPPvjIIC2tBr1+B4mL8LuPtd20Nmp NP9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=zB2XHUVQgXrDnS+NVDNEx6KLtNc4645mhptHHMLj6Ms=; b=FCerMrbSq9SdQ8khnhxrp7SntMimNo6toQ37DTPhTvBHIjBIRJTrBgTyZF8eM+EMt4 tgkloYE3o92/53jElP2wfzEOMM/6xbdBFxa8kwcuRMuvXwOtKuQr8+pHaWNZee9eE1pa SIlktvq/D7IAvYuRiX5MdDc7N29rPhLyRqqWi9X4RDY0hdHE5iU40FnL5HweokfqE52E FscSK6O7ZQNPbN5VBDWiE29WIYf33UMEC+W5nwIALI+3xN7AFlqqHUCgJQzVCq+4sg7y Ds7SUfnK9V1LkbkiM2keOnMN2KzwrYhN+b9DdzDP2e5LGRWUoPSBnTyfMjhJmYyfKcaw tYig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="CcR/fbO+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si3035291ejc.57.2020.04.24.06.46.38; Fri, 24 Apr 2020 06:47:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="CcR/fbO+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727980AbgDXNpF (ORCPT + 99 others); Fri, 24 Apr 2020 09:45:05 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:45434 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbgDXNpE (ORCPT ); Fri, 24 Apr 2020 09:45:04 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 16AFF404B8; Fri, 24 Apr 2020 13:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1587735904; bh=ydPoZRUelRe6CU9Hp1tIyZfCVvTrM8j0ovTLVduK/no=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=CcR/fbO+1ynLZ+XgLl9RKEwMBPx3k2p+IozSw0SuIipGu7/WSWhsSetuXK4B/J3Px 6PMVkh0O6dlv+7IDAwcl0pw03IytWG4dvGybSv/8zvMuaEWtM1w+f/8sc+q/7Z6Vdf flJMUOqywAlxpBX2WThzcKVQS0Pfa7oRB86eI/6ocA8mj+u6Lr2NKw891yQS6JO6AI lqmItRU/XhIboGanh2n3/gowCnldmkn7UuUXm1LcIMLuZyZDvru2Ozhnt88a3DrfAD 1VRN5yNJaK6ErApH4tQwgvxrIljPZexHJMJgJ3qNHVRP7y1XKEzc3PM5YrVA8B9HrJ Ha3ZtWrPrIf7w== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id D1994A006C; Fri, 24 Apr 2020 13:45:02 +0000 (UTC) From: Jose Abreu To: linux-scsi@vger.kernel.org Cc: Joao Pinto , Jose Abreu , "Winkler, Tomas" , Joao Lima , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] scsi: ufs: tc-dwc-pci: Allow for MSI interrupt type Date: Fri, 24 Apr 2020 15:44:48 +0200 Message-Id: <05ba98b7a98520e3ac3884037ee481da460d0dcc.1587735561.git.Jose.Abreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Newer Test Chips boards have MSI support. It does no harm to try to request it as the function will fallback to legacy interrupts if MSI is not supported. Signed-off-by: Jose Abreu --- Changes from v1: - Do not try to request MSIX vectors (Tomas) - Add missing call to pci_free_irq_vectors() (Tomas) Cc: "Winkler, Tomas" Cc: Joao Lima Cc: Jose Abreu Cc: Alim Akhtar Cc: Avri Altman Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/scsi/ufs/tc-dwc-pci.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/tc-dwc-pci.c b/drivers/scsi/ufs/tc-dwc-pci.c index 74a2d80d32bd..78dc6c484e84 100644 --- a/drivers/scsi/ufs/tc-dwc-pci.c +++ b/drivers/scsi/ufs/tc-dwc-pci.c @@ -88,6 +88,7 @@ static void tc_dwc_pci_remove(struct pci_dev *pdev) pm_runtime_forbid(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); ufshcd_remove(hba); + pci_free_irq_vectors(pdev); } /** @@ -136,11 +137,18 @@ tc_dwc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) return -ENOENT; } + err = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY | PCI_IRQ_MSI); + if (err < 0) { + dev_err(&pdev->dev, "Allocation failed\n"); + return err; + } + hba->vops = &data->ops; - err = ufshcd_init(hba, mmio_base, pdev->irq); + err = ufshcd_init(hba, mmio_base, pci_irq_vector(pdev, 0)); if (err) { dev_err(&pdev->dev, "Initialization failed\n"); + pci_free_irq_vectors(pdev); return err; } -- 2.7.4