hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/scsi/aacraid/src.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Adaptec AAC series RAID controller driver
34 * (c) Copyright 2001 Red Hat Inc.
....@@ -9,25 +10,10 @@
910 * 2010-2015 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
1011 * 2016-2017 Microsemi Corp. (aacraid@microsemi.com)
1112 *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License as published by
14
- * the Free Software Foundation; either version 2, or (at your option)
15
- * any later version.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; see the file COPYING. If not, write to
24
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25
- *
2613 * Module Name:
2714 * src.c
2815 *
2916 * Abstract: Hardware Device Interface for PMC SRC based controllers
30
- *
3117 */
3218
3319 #include <linux/kernel.h>
....@@ -106,7 +92,7 @@
10692 spin_lock_irqsave(&dev->sync_fib->event_lock, sflags);
10793 if (dev->sync_fib->flags & FIB_CONTEXT_FLAG_WAIT) {
10894 dev->management_fib_count--;
109
- up(&dev->sync_fib->event_wait);
95
+ complete(&dev->sync_fib->event_wait);
11096 }
11197 spin_unlock_irqrestore(&dev->sync_fib->event_lock,
11298 sflags);
....@@ -205,7 +191,16 @@
205191 * @dev: Adapter
206192 * @command: Command to execute
207193 * @p1: first parameter
208
- * @ret: adapter status
194
+ * @p2: second parameter
195
+ * @p3: third parameter
196
+ * @p4: forth parameter
197
+ * @p5: fifth parameter
198
+ * @p6: sixth parameter
199
+ * @status: adapter status
200
+ * @r1: first return value
201
+ * @r2: second return valu
202
+ * @r3: third return value
203
+ * @r4: forth return value
209204 *
210205 * This routine will send a synchronous command to the adapter and wait
211206 * for its completion.
....@@ -616,6 +611,7 @@
616611
617612 /**
618613 * aac_src_ioremap
614
+ * @dev: device ioremap
619615 * @size: mapping resize request
620616 *
621617 */
....@@ -646,6 +642,7 @@
646642
647643 /**
648644 * aac_srcv_ioremap
645
+ * @dev: device ioremap
649646 * @size: mapping resize request
650647 *
651648 */
....@@ -747,10 +744,20 @@
747744 return ctrl_up;
748745 }
749746
747
+static void aac_src_drop_io(struct aac_dev *dev)
748
+{
749
+ if (!dev->soft_reset_support)
750
+ return;
751
+
752
+ aac_adapter_sync_cmd(dev, DROP_IO,
753
+ 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL);
754
+}
755
+
750756 static void aac_notify_fw_of_iop_reset(struct aac_dev *dev)
751757 {
752758 aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, 0, 0, 0, 0, 0, 0, NULL,
753759 NULL, NULL, NULL, NULL);
760
+ aac_src_drop_io(dev);
754761 }
755762
756763 static void aac_send_iop_reset(struct aac_dev *dev)
....@@ -1157,7 +1164,7 @@
11571164 dev_err(&dev->pdev->dev, "%s: %s status = %d", __func__,
11581165 state_str[state], rc);
11591166
1160
-return rc;
1167
+ return rc;
11611168 }
11621169 /**
11631170 * aac_srcv_init - initialize an SRCv card