public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Lianbo Jiang <lijiang@redhat.com>,
	Don Brace <don.brace@microsemi.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 28/31] scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask
Date: Sat,  8 Jun 2019 07:46:39 -0400	[thread overview]
Message-ID: <20190608114646.9415-28-sashal@kernel.org> (raw)
In-Reply-To: <20190608114646.9415-1-sashal@kernel.org>

From: Lianbo Jiang <lijiang@redhat.com>

[ 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 <lijiang@redhat.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Tested-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 5ec2898d21cd..d34351c6b9af 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -6392,7 +6392,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


  parent reply	other threads:[~2019-06-08 11:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-08 11:46 [PATCH AUTOSEL 4.14 01/31] Staging: vc04_services: Fix a couple error codes Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 02/31] perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 03/31] netfilter: nf_queue: fix reinject verdict handling Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 04/31] ipvs: Fix use-after-free in ip_vs_in Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 05/31] selftests: netfilter: missing error check when setting up veth interface Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 06/31] clk: ti: clkctrl: Fix clkdm_clk handling Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 07/31] powerpc/powernv: Return for invalid IMC domain Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 08/31] mISDN: make sure device name is NUL terminated Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 09/31] x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 10/31] perf/ring_buffer: Fix exposing a temporarily decreased data_head Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 11/31] perf/ring_buffer: Add ordering to rb->nest increment Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 12/31] perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 13/31] gpio: fix gpio-adp5588 build errors Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 14/31] net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE() Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 15/31] PCI: PM: Avoid possible suspend-to-idle issue Sasha Levin
2019-06-11 15:25   ` Rafael J. Wysocki
2019-06-19 21:01     ` Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 16/31] net: aquantia: fix LRO with FCS error Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 17/31] i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 18/31] ALSA: hda - Force polling mode on CNL for fixing codec communication Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 19/31] configfs: Fix use-after-free when accessing sd->s_dentry Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 20/31] perf data: Fix 'strncat may truncate' build failure with recent gcc Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 21/31] perf record: Fix s390 missing module symbol and warning for non-root users Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 22/31] ia64: fix build errors by exporting paddr_to_nid() Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 23/31] KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 24/31] KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 25/31] net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 26/31] net: phy: dp83867: Set up RGMII TX delay Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 27/31] scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route() Sasha Levin
2019-06-08 11:46 ` Sasha Levin [this message]
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 29/31] scsi: scsi_dh_alua: Fix possible null-ptr-deref Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 30/31] scsi: libsas: delete sas port if expander discover failed Sasha Levin
2019-06-08 11:46 ` [PATCH AUTOSEL 4.14 31/31] mlxsw: spectrum: Prevent force of 56G Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190608114646.9415-28-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=don.brace@microsemi.com \
    --cc=esc.storagedev@microsemi.com \
    --cc=lijiang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox