aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci
diff options
context:
space:
mode:
authorEdmund Nadolski <edmund.nadolski@intel.com>2011-05-19 08:00:22 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:50 -0400
commit8db02da52895285e99d7eb2fa825fd393e61d9c5 (patch)
tree8ef382b35fa4cdad9800a774ac4d3fcd3de69e85 /drivers/scsi/isci
parentfd18388bc5820b3e7807302ac18e8e7de83c9f4c (diff)
isci: remove isci_timer interface
Delete code which is no longer used. Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r--drivers/scsi/isci/Makefile2
-rw-r--r--drivers/scsi/isci/host.c13
-rw-r--r--drivers/scsi/isci/host.h1
-rw-r--r--drivers/scsi/isci/phy.c1
-rw-r--r--drivers/scsi/isci/port.c1
-rw-r--r--drivers/scsi/isci/port_config.c1
-rw-r--r--drivers/scsi/isci/task.c1
-rw-r--r--drivers/scsi/isci/timers.c245
-rw-r--r--drivers/scsi/isci/timers.h88
9 files changed, 1 insertions, 352 deletions
diff --git a/drivers/scsi/isci/Makefile b/drivers/scsi/isci/Makefile
index 86b0c88e91a6..ad58fe3acc72 100644
--- a/drivers/scsi/isci/Makefile
+++ b/drivers/scsi/isci/Makefile
@@ -1,6 +1,6 @@
1obj-$(CONFIG_SCSI_ISCI) += isci.o 1obj-$(CONFIG_SCSI_ISCI) += isci.o
2isci-objs := init.o phy.o request.o sata.o \ 2isci-objs := init.o phy.o request.o sata.o \
3 remote_device.o port.o timers.o \ 3 remote_device.o port.o \
4 host.o task.o probe_roms.o \ 4 host.o task.o probe_roms.o \
5 state_machine.o \ 5 state_machine.o \
6 remote_node_context.o \ 6 remote_node_context.o \
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index e79f35d510c7..8801955be213 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -67,7 +67,6 @@
67#include "scu_remote_node_context.h" 67#include "scu_remote_node_context.h"
68#include "scu_task_context.h" 68#include "scu_task_context.h"
69#include "scu_unsolicited_frame.h" 69#include "scu_unsolicited_frame.h"
70#include "timers.h"
71 70
72#define SCU_CONTEXT_RAM_INIT_STALL_TIME 200 71#define SCU_CONTEXT_RAM_INIT_STALL_TIME 200
73 72
@@ -111,14 +110,6 @@
111 ) 110 )
112 111
113 112
114#define SCIC_SDS_CONTROLLER_MIN_TIMER_COUNT 3
115#define SCIC_SDS_CONTROLLER_MAX_TIMER_COUNT 3
116
117/**
118 *
119 *
120 * The number of milliseconds to wait for a phy to start.
121 */
122#define SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT 100 113#define SCIC_SDS_CONTROLLER_PHY_START_TIMEOUT 100
123 114
124/** 115/**
@@ -1379,8 +1370,6 @@ void isci_host_deinit(struct isci_host *ihost)
1379 del_timer_sync(&ihost->sci.timer.timer); 1370 del_timer_sync(&ihost->sci.timer.timer);
1380 1371
1381 del_timer_sync(&ihost->sci.phy_timer.timer); 1372 del_timer_sync(&ihost->sci.phy_timer.timer);
1382
1383 isci_timer_list_destroy(ihost);
1384} 1373}
1385 1374
1386static void __iomem *scu_base(struct isci_host *isci_host) 1375static void __iomem *scu_base(struct isci_host *isci_host)
@@ -2517,8 +2506,6 @@ int isci_host_init(struct isci_host *isci_host)
2517 union scic_user_parameters scic_user_params; 2506 union scic_user_parameters scic_user_params;
2518 struct isci_pci_info *pci_info = to_pci_info(isci_host->pdev); 2507 struct isci_pci_info *pci_info = to_pci_info(isci_host->pdev);
2519 2508
2520 isci_timer_list_construct(isci_host);
2521
2522 spin_lock_init(&isci_host->state_lock); 2509 spin_lock_init(&isci_host->state_lock);
2523 spin_lock_init(&isci_host->scic_lock); 2510 spin_lock_init(&isci_host->scic_lock);
2524 spin_lock_init(&isci_host->queue_lock); 2511 spin_lock_init(&isci_host->queue_lock);
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h
index 9fd47b42da05..4ce39e1803ff 100644
--- a/drivers/scsi/isci/host.h
+++ b/drivers/scsi/isci/host.h
@@ -325,7 +325,6 @@ struct isci_host {
325 union scic_oem_parameters oem_parameters; 325 union scic_oem_parameters oem_parameters;
326 326
327 int id; /* unique within a given pci device */ 327 int id; /* unique within a given pci device */
328 struct list_head timers;
329 void *core_ctrl_memory; 328 void *core_ctrl_memory;
330 struct dma_pool *dma_pool; 329 struct dma_pool *dma_pool;
331 struct isci_phy phys[SCI_MAX_PHYS]; 330 struct isci_phy phys[SCI_MAX_PHYS];
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c
index b663bbdd4e59..fc196e389ffb 100644
--- a/drivers/scsi/isci/phy.c
+++ b/drivers/scsi/isci/phy.c
@@ -57,7 +57,6 @@
57#include "host.h" 57#include "host.h"
58#include "phy.h" 58#include "phy.h"
59#include "scu_event_codes.h" 59#include "scu_event_codes.h"
60#include "timers.h"
61#include "probe_roms.h" 60#include "probe_roms.h"
62 61
63/* Maximum arbitration wait time in micro-seconds */ 62/* Maximum arbitration wait time in micro-seconds */
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c
index 3da9048b45b7..8d88ca21a51c 100644
--- a/drivers/scsi/isci/port.c
+++ b/drivers/scsi/isci/port.c
@@ -56,7 +56,6 @@
56#include "isci.h" 56#include "isci.h"
57#include "port.h" 57#include "port.h"
58#include "request.h" 58#include "request.h"
59#include "timers.h"
60 59
61#define SCIC_SDS_PORT_HARD_RESET_TIMEOUT (1000) 60#define SCIC_SDS_PORT_HARD_RESET_TIMEOUT (1000)
62#define SCU_DUMMY_INDEX (0xFFFF) 61#define SCU_DUMMY_INDEX (0xFFFF)
diff --git a/drivers/scsi/isci/port_config.c b/drivers/scsi/isci/port_config.c
index 1cde7b9165f4..38401f644e18 100644
--- a/drivers/scsi/isci/port_config.c
+++ b/drivers/scsi/isci/port_config.c
@@ -54,7 +54,6 @@
54 */ 54 */
55 55
56#include "host.h" 56#include "host.h"
57#include "timers.h"
58 57
59#define SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT (10) 58#define SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT (10)
60#define SCIC_SDS_APC_RECONFIGURATION_TIMEOUT (10) 59#define SCIC_SDS_APC_RECONFIGURATION_TIMEOUT (10)
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index 60b687b77d56..93c75560a5c7 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -62,7 +62,6 @@
62#include "request.h" 62#include "request.h"
63#include "sata.h" 63#include "sata.h"
64#include "task.h" 64#include "task.h"
65#include "timers.h"
66 65
67/** 66/**
68* isci_task_refuse() - complete the request to the upper layer driver in 67* isci_task_refuse() - complete the request to the upper layer driver in
diff --git a/drivers/scsi/isci/timers.c b/drivers/scsi/isci/timers.c
deleted file mode 100644
index 007700e3eb6a..000000000000
--- a/drivers/scsi/isci/timers.c
+++ /dev/null
@@ -1,245 +0,0 @@
1/*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
4 *
5 * GPL LICENSE SUMMARY
6 *
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
23 *
24 * BSD LICENSE
25 *
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 *
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */
55
56#include "isci.h"
57#include "timers.h"
58#include "host.h"
59
60/**
61 * isci_timer_list_construct() - This method contrucst the SCI Timer List
62 * object used by the SCI Module class. The construction process involves
63 * creating isci_timer objects and adding them to the SCI Timer List
64 * object's list member. The number of isci_timer objects is determined by
65 * the timer_list_size parameter.
66 * @ihost: container of the timer list
67 *
68 * This method returns an error code indicating sucess or failure. The user
69 * should check for possible memory allocation error return otherwise, a zero
70 * indicates success.
71 */
72int isci_timer_list_construct(struct isci_host *ihost)
73{
74 struct isci_timer *itimer;
75 int i, err = 0;
76
77 INIT_LIST_HEAD(&ihost->timers);
78 for (i = 0; i < SCI_MAX_TIMER_COUNT; i++) {
79 itimer = devm_kzalloc(&ihost->pdev->dev, sizeof(*itimer), GFP_KERNEL);
80
81 if (!itimer) {
82 err = -ENOMEM;
83 break;
84 }
85 init_timer(&itimer->timer);
86 itimer->used = 0;
87 itimer->stopped = 1;
88 list_add(&itimer->node, &ihost->timers);
89 }
90
91 return err;
92}
93
94/**
95 * isci_timer_list_destroy() - This method destroys the SCI Timer List object
96 * used by the SCI Module class. The destruction process involves freeing
97 * memory allocated for isci_timer objects on the SCI Timer List object's
98 * timers list_head member. If any isci_timer objects are mark as "in use",
99 * they are not freed and the function returns an error code of -EBUSY.
100 * @ihost: container of the list to be destroyed
101 */
102void isci_timer_list_destroy(struct isci_host *ihost)
103{
104 struct isci_timer *timer;
105 LIST_HEAD(list);
106
107 spin_lock_irq(&ihost->scic_lock);
108 list_splice_init(&ihost->timers, &list);
109 spin_unlock_irq(&ihost->scic_lock);
110
111 list_for_each_entry(timer, &list, node)
112 del_timer_sync(&timer->timer);
113}
114
115/**
116 * This method pulls an isci_timer object off of the list for the SCI Timer
117 * List object specified, marks the isci_timer as "in use" and initializes
118 * it with user callback function and cookie data. The timer is not start at
119 * this time, just reserved for the user.
120 * @isci_timer_list: This parameter points to the SCI Timer List from which the
121 * timer is reserved.
122 * @cookie: This parameter specifies a piece of information that the user must
123 * retain. This cookie is to be supplied by the user anytime a timeout
124 * occurs for the created timer.
125 * @timer_callback: This parameter specifies the callback method to be invoked
126 * whenever the timer expires.
127 *
128 * This method returns a pointer to an isci_timer object reserved from the SCI
129 * Timer List. The pointer will be utilized for all further interactions
130 * relating to this timer.
131 */
132
133static void timer_function(unsigned long data)
134{
135
136 struct isci_timer *timer = (struct isci_timer *)data;
137 struct isci_host *isci_host = timer->isci_host;
138 unsigned long flags;
139
140 dev_dbg(&isci_host->pdev->dev,
141 "%s: isci_timer = %p\n", __func__, timer);
142
143 if (isci_stopped == isci_host_get_state(isci_host)) {
144 timer->stopped = 1;
145 return;
146 }
147
148 spin_lock_irqsave(&isci_host->scic_lock, flags);
149
150 if (!timer->stopped) {
151 timer->stopped = 1;
152 timer->timer_callback(timer->cb_param);
153 }
154
155 spin_unlock_irqrestore(&isci_host->scic_lock, flags);
156}
157
158
159struct isci_timer *isci_timer_create(struct isci_host *ihost, void *cb_param,
160 void (*timer_callback)(void *))
161{
162 struct timer_list *timer;
163 struct isci_timer *isci_timer;
164 struct list_head *list = &ihost->timers;
165
166 WARN_ONCE(!spin_is_locked(&ihost->scic_lock),
167 "%s: unlocked!\n", __func__);
168
169 if (WARN_ONCE(list_empty(list), "%s: timer pool empty\n", __func__))
170 return NULL;
171
172 isci_timer = list_entry(list->next, struct isci_timer, node);
173
174 isci_timer->used = 1;
175 isci_timer->stopped = 1;
176 /* FIXME: what!? we recycle the timer, rather than take it off
177 * the free list?
178 */
179 list_move_tail(&isci_timer->node, list);
180
181 timer = &isci_timer->timer;
182 timer->data = (unsigned long)isci_timer;
183 timer->function = timer_function;
184 isci_timer->cb_param = cb_param;
185 isci_timer->timer_callback = timer_callback;
186 isci_timer->isci_host = ihost;
187
188 dev_dbg(&ihost->pdev->dev,
189 "%s: isci_timer = %p\n", __func__, isci_timer);
190
191 return isci_timer;
192}
193
194/* isci_del_timer() - This method frees the isci_timer, marking it "free to
195 * use", then places its back at the head of the timers list for the SCI
196 * Timer List object specified.
197 */
198void isci_del_timer(struct isci_host *ihost, struct isci_timer *isci_timer)
199{
200 struct list_head *list = &ihost->timers;
201
202 WARN_ONCE(!spin_is_locked(&ihost->scic_lock),
203 "%s unlocked!\n", __func__);
204
205 dev_dbg(&isci_timer->isci_host->pdev->dev,
206 "%s: isci_timer = %p\n", __func__, isci_timer);
207
208 isci_timer->used = 0;
209 list_move(&isci_timer->node, list);
210 del_timer(&isci_timer->timer);
211 isci_timer->stopped = 1;
212}
213
214/**
215 * isci_timer_start() - This method starts the specified isci_timer, with the
216 * specified timeout value.
217 * @isci_timer: This parameter specifies the timer to be started.
218 * @timeout: This parameter specifies the timeout, in milliseconds, after which
219 * the associated callback function will be called.
220 *
221 */
222void isci_timer_start(struct isci_timer *isci_timer, unsigned long tmo)
223{
224 struct timer_list *timer = &isci_timer->timer;
225
226 dev_dbg(&isci_timer->isci_host->pdev->dev,
227 "%s: isci_timer = %p\n", __func__, isci_timer);
228
229 isci_timer->stopped = 0;
230 mod_timer(timer, jiffies + msecs_to_jiffies(tmo));
231}
232
233/**
234 * isci_timer_stop() - This method stops the supplied isci_timer.
235 * @isci_timer: This parameter specifies the isci_timer to be stopped.
236 *
237 */
238void isci_timer_stop(struct isci_timer *isci_timer)
239{
240 dev_dbg(&isci_timer->isci_host->pdev->dev,
241 "%s: isci_timer = %p\n", __func__, isci_timer);
242
243 isci_timer->stopped = 1;
244 del_timer(&isci_timer->timer);
245}
diff --git a/drivers/scsi/isci/timers.h b/drivers/scsi/isci/timers.h
deleted file mode 100644
index 8d8a892ad7f2..000000000000
--- a/drivers/scsi/isci/timers.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
4 *
5 * GPL LICENSE SUMMARY
6 *
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
23 *
24 * BSD LICENSE
25 *
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 *
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */
55
56#if !defined(_SCI_TIMER_H_)
57#define _SCI_TIMER_H_
58
59#include <linux/timer.h>
60#include <linux/types.h>
61
62#define SCI_MAX_TIMER_COUNT 25
63
64/**
65 * struct isci_timer - This class represents the timer object used by SCIC. It
66 * wraps the Linux timer_list object, and (TODO) should be removed in favor
67 * of a delayed-workqueue style interface with simpler locking
68 *
69 */
70struct isci_timer {
71 int used;
72 int stopped;
73 void *cb_param;
74 void (*timer_callback)(void *);
75 struct list_head node;
76 struct timer_list timer;
77 struct isci_host *isci_host;
78};
79
80int isci_timer_list_construct(struct isci_host *ihost);
81void isci_timer_list_destroy(struct isci_host *ihost);
82struct isci_timer *isci_timer_create(struct isci_host *ihost, void *cb_param,
83 void (*timer_callback)(void *));
84void isci_del_timer(struct isci_host *ihost, struct isci_timer *itimer);
85void isci_timer_start(struct isci_timer *isci_timer, unsigned long timeout);
86void isci_timer_stop(struct isci_timer *isci_timer);
87
88#endif /* !defined (_SCI_TIMER_H_) */