Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2232887ybi; Thu, 20 Jun 2019 11:18:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/46wqO+E/KQTWh3+kUm5nhOhfJBTRkhm0m2SJEMzXFwKZSs76Whq665TH/Q5XDOSbEu85 X-Received: by 2002:a17:90a:be0a:: with SMTP id a10mr941651pjs.112.1561054681744; Thu, 20 Jun 2019 11:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054681; cv=none; d=google.com; s=arc-20160816; b=itH6CZXi+exUhxJOyhN/fzCQPwNxtzUtxoizX6qutdTlsda3qncdZjhFG1So8s7gSu KJ/aCmDqc6RjtS0nkP2p6kteDkN0HN4LL7I8eZRLNckxjjSuUFan8IkkJVGvlLozpiHo Li6lJDrovrIg1EcG1vYrdYceomooObYIHFArB714YanK47ZdYI/lh0L2X4TyMga0i1Fi xN2sOEogAKNQxwR1UKSg9nYAzEa36XFNKE6kqCEz5EculQynIlP1kxDFBhuPlrXzETQT TV3JnwcUs5t2DbuaJPPN9ywg1HL1idhwVMJzhGPf3AiupAQMpkzCFj1qVez/peTG96XH IHyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9S54sNmkeJPvPVnczaCqjhHKVWPy1dCN0CiSYzubJrs=; b=VvcTMELjUBY41lxmObZ2chUGecxojEO1cNHOMBqwkYwftR1GWqB/PnYKwBedf3R4/b pE5yrI8J5AlCnnRdtUQ3/HGDSNGLLOYK/yvtZYo5OXxJrLbOpVyXDh+Wb8KAvqub9v54 jklWaIiyHBrNAuIu0y5WFo7Ak+uzgxnpxno/mzY9HrVtgqBHq1H7HMJuNfucIK5W85zO rThbP06R3Q+ZHvszCYqC8LUjci5Lbi0ZavzEAHoNu/kkvzBgsnsErR8hzeX6HaVYvzNU RnmFvgaj3EJxIa9o2O56NyQR9Fgbwp6NtIXTVVqCEkDa2ujm0+Ab9fIDfgQba8PSMOAt rBkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aRX8NMzG; 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 e9si164341pgc.321.2019.06.20.11.17.45; Thu, 20 Jun 2019 11:18:01 -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; dkim=pass header.i=@kernel.org header.s=default header.b=aRX8NMzG; 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 S1729425AbfFTSQy (ORCPT + 99 others); Thu, 20 Jun 2019 14:16:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:46086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbfFTSQw (ORCPT ); Thu, 20 Jun 2019 14:16:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38389205F4; Thu, 20 Jun 2019 18:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054611; bh=32PFTKSoe3NbnKVPAYwFxRueF/nroXZyR+6C592GsJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aRX8NMzGqLCjiG40X5pyGtMeRbKYR/kKy6w9hVYuw02iwqCyzCYHk7o9ybxN0Go/j +tr268Z/tZEq5rG1uSXnB1YIAuP86W2ycSv+RZDeJlAYj8ELMxhZLRfmo1o/UpRtlz 3QPWObwC8ra/MPrIzTBIPoMTuMm5S5ROdvm1h2ko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lianbo Jiang , Don Brace , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.1 89/98] scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask Date: Thu, 20 Jun 2019 19:57:56 +0200 Message-Id: <20190620174353.834978324@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 1d94f06e7f5df4064ef336b7b710f50143b64a53 ] When SME is enabled, the smartpqi driver won't work on the HP DL385 G10 machine, which causes the failure of kernel boot because it fails to allocate pqi error buffer. Please refer to the kernel log: .... [ 9.431749] usbcore: registered new interface driver uas [ 9.441524] Microsemi PQI Driver (v1.1.4-130) [ 9.442956] i40e 0000:04:00.0: fw 6.70.48768 api 1.7 nvm 10.2.5 [ 9.447237] smartpqi 0000:23:00.0: Microsemi Smart Family Controller found Starting dracut initqueue hook... [ OK ] Started Show Plymouth Boot Scre[ 9.471654] Broadcom NetXtreme-C/E driver bnxt_en v1.9.1 en. [ OK ] Started Forward Password Requests to Plymouth Directory Watch. [[0;[ 9.487108] smartpqi 0000:23:00.0: failed to allocate PQI error buffer .... [ 139.050544] dracut-initqueue[949]: Warning: dracut-initqueue timeout - starting timeout scripts [ 139.589779] dracut-initqueue[949]: Warning: dracut-initqueue timeout - starting timeout scripts Basically, the fact that the coherent DMA mask value wasn't set caused the driver to fall back to SWIOTLB when SME is active. For correct operation, lets call the dma_set_mask_and_coherent() to properly set the mask for both streaming and coherent, in order to inform the kernel about the devices DMA addressing capabilities. Signed-off-by: Lianbo Jiang Acked-by: Don Brace Tested-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/smartpqi/smartpqi_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 75ec43aa8df3..531824afba5f 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -7285,7 +7285,7 @@ static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info) else mask = DMA_BIT_MASK(32); - rc = dma_set_mask(&ctrl_info->pci_dev->dev, mask); + rc = dma_set_mask_and_coherent(&ctrl_info->pci_dev->dev, mask); if (rc) { dev_err(&ctrl_info->pci_dev->dev, "failed to set DMA mask\n"); goto disable_device; -- 2.20.1