]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
827760d4f9896d4b19e2e879a1df21aa55651d36
[thirdparty/kernel/stable-queue.git] /
1 From 9ff97fa8db94caeab59a3c5401e975df468b4d8e Mon Sep 17 00:00:00 2001
2 From: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
3 Date: Wed, 14 Feb 2018 00:10:52 -0800
4 Subject: scsi: megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers
5
6 From: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
7
8 commit 9ff97fa8db94caeab59a3c5401e975df468b4d8e upstream.
9
10 Problem Statement: Sending I/O through 32 bit descriptors to Ventura series of
11 controller results in IO timeout on certain conditions.
12
13 This error only occurs on systems with high I/O activity on Ventura series
14 controllers.
15
16 Changes in this patch will prevent driver from using 32 bit descriptor and use
17 64 bit Descriptors.
18
19 Cc: <stable@vger.kernel.org>
20 Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
21 Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
22 Reviewed-by: Hannes Reinecke <hare@suse.com>
23 Reviewed-by: Tomas Henzl <thenzl@redhat.com>
24 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26
27 ---
28 drivers/scsi/megaraid/megaraid_sas_fusion.c | 42 +++++++++-------------------
29 1 file changed, 14 insertions(+), 28 deletions(-)
30
31 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
32 +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
33 @@ -190,36 +190,30 @@ inline void megasas_return_cmd_fusion(st
34 /**
35 * megasas_fire_cmd_fusion - Sends command to the FW
36 * @instance: Adapter soft state
37 - * @req_desc: 32bit or 64bit Request descriptor
38 + * @req_desc: 64bit Request descriptor
39 *
40 - * Perform PCI Write. Ventura supports 32 bit Descriptor.
41 - * Prior to Ventura (12G) MR controller supports 64 bit Descriptor.
42 + * Perform PCI Write.
43 */
44
45 static void
46 megasas_fire_cmd_fusion(struct megasas_instance *instance,
47 union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc)
48 {
49 - if (instance->is_ventura)
50 - writel(le32_to_cpu(req_desc->u.low),
51 - &instance->reg_set->inbound_single_queue_port);
52 - else {
53 #if defined(writeq) && defined(CONFIG_64BIT)
54 - u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
55 - le32_to_cpu(req_desc->u.low));
56 + u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
57 + le32_to_cpu(req_desc->u.low));
58
59 - writeq(req_data, &instance->reg_set->inbound_low_queue_port);
60 + writeq(req_data, &instance->reg_set->inbound_low_queue_port);
61 #else
62 - unsigned long flags;
63 - spin_lock_irqsave(&instance->hba_lock, flags);
64 - writel(le32_to_cpu(req_desc->u.low),
65 - &instance->reg_set->inbound_low_queue_port);
66 - writel(le32_to_cpu(req_desc->u.high),
67 - &instance->reg_set->inbound_high_queue_port);
68 - mmiowb();
69 - spin_unlock_irqrestore(&instance->hba_lock, flags);
70 + unsigned long flags;
71 + spin_lock_irqsave(&instance->hba_lock, flags);
72 + writel(le32_to_cpu(req_desc->u.low),
73 + &instance->reg_set->inbound_low_queue_port);
74 + writel(le32_to_cpu(req_desc->u.high),
75 + &instance->reg_set->inbound_high_queue_port);
76 + mmiowb();
77 + spin_unlock_irqrestore(&instance->hba_lock, flags);
78 #endif
79 - }
80 }
81
82 /**
83 @@ -772,7 +766,6 @@ megasas_ioc_init_fusion(struct megasas_i
84 const char *sys_info;
85 MFI_CAPABILITIES *drv_ops;
86 u32 scratch_pad_2;
87 - unsigned long flags;
88
89 fusion = instance->ctrl_context;
90
91 @@ -900,14 +893,7 @@ megasas_ioc_init_fusion(struct megasas_i
92 break;
93 }
94
95 - /* For Ventura also IOC INIT required 64 bit Descriptor write. */
96 - spin_lock_irqsave(&instance->hba_lock, flags);
97 - writel(le32_to_cpu(req_desc.u.low),
98 - &instance->reg_set->inbound_low_queue_port);
99 - writel(le32_to_cpu(req_desc.u.high),
100 - &instance->reg_set->inbound_high_queue_port);
101 - mmiowb();
102 - spin_unlock_irqrestore(&instance->hba_lock, flags);
103 + megasas_fire_cmd_fusion(instance, &req_desc);
104
105 wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS);
106