fas216.c (696fec18e17cb63d480e29aafc39d273bd9b776d) fas216.c (0feb3429d735b3e79de80ced7a480278a31e66a1)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/drivers/acorn/scsi/fas216.c
4 *
5 * Copyright (C) 1997-2003 Russell King
6 *
7 * Based on information in qlogicfas.c by Tom Zerucha, Michael Griffith, and
8 * other sources, including:

--- 2170 unchanged lines hidden (view full) ---

2179 return;
2180
2181no_command:
2182 panic("scsi%d.H: null command in fas216_done",
2183 info->host->host_no);
2184}
2185
2186/**
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/drivers/acorn/scsi/fas216.c
4 *
5 * Copyright (C) 1997-2003 Russell King
6 *
7 * Based on information in qlogicfas.c by Tom Zerucha, Michael Griffith, and
8 * other sources, including:

--- 2170 unchanged lines hidden (view full) ---

2179 return;
2180
2181no_command:
2182 panic("scsi%d.H: null command in fas216_done",
2183 info->host->host_no);
2184}
2185
2186/**
2187 * fas216_queue_command - queue a command for adapter to process.
2187 * fas216_queue_command_internal - queue a command for the adapter to process
2188 * @SCpnt: Command to queue
2189 * @done: done function to call once command is complete
2190 *
2191 * Queue a command for adapter to process.
2192 * Returns: 0 on success, else error.
2193 * Notes: io_request_lock is held, interrupts are disabled.
2194 */
2188 * @SCpnt: Command to queue
2189 * @done: done function to call once command is complete
2190 *
2191 * Queue a command for adapter to process.
2192 * Returns: 0 on success, else error.
2193 * Notes: io_request_lock is held, interrupts are disabled.
2194 */
2195static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt,
2196 void (*done)(struct scsi_cmnd *))
2195static int fas216_queue_command_internal(struct scsi_cmnd *SCpnt,
2196 void (*done)(struct scsi_cmnd *))
2197{
2198 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2199 int result;
2200
2201 fas216_checkmagic(info);
2202
2203 fas216_log_command(info, LOG_CONNECT, SCpnt,
2204 "received command (%p)", SCpnt);

--- 23 unchanged lines hidden (view full) ---

2228 spin_unlock(&info->host_lock);
2229
2230 fas216_log_target(info, LOG_CONNECT, -1, "queue %s",
2231 result ? "failure" : "success");
2232
2233 return result;
2234}
2235
2197{
2198 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2199 int result;
2200
2201 fas216_checkmagic(info);
2202
2203 fas216_log_command(info, LOG_CONNECT, SCpnt,
2204 "received command (%p)", SCpnt);

--- 23 unchanged lines hidden (view full) ---

2228 spin_unlock(&info->host_lock);
2229
2230 fas216_log_target(info, LOG_CONNECT, -1, "queue %s",
2231 result ? "failure" : "success");
2232
2233 return result;
2234}
2235
2236static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt,
2237 void (*done)(struct scsi_cmnd *))
2238{
2239 return fas216_queue_command_internal(SCpnt, done);
2240}
2241
2236DEF_SCSI_QCMD(fas216_queue_command)
2237
2238/**
2239 * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command
2240 * @SCpnt: Command to wake
2241 *
2242 * Trigger restart of a waiting thread in fas216_command
2243 */

--- 23 unchanged lines hidden (view full) ---

2267
2268 /*
2269 * We should only be using this if we don't have an interrupt.
2270 * Provide some "incentive" to use the queueing code.
2271 */
2272 BUG_ON(info->scsi.irq);
2273
2274 info->internal_done = 0;
2242DEF_SCSI_QCMD(fas216_queue_command)
2243
2244/**
2245 * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command
2246 * @SCpnt: Command to wake
2247 *
2248 * Trigger restart of a waiting thread in fas216_command
2249 */

--- 23 unchanged lines hidden (view full) ---

2273
2274 /*
2275 * We should only be using this if we don't have an interrupt.
2276 * Provide some "incentive" to use the queueing code.
2277 */
2278 BUG_ON(info->scsi.irq);
2279
2280 info->internal_done = 0;
2275 fas216_queue_command_lck(SCpnt, fas216_internal_done);
2281 fas216_queue_command_internal(SCpnt, fas216_internal_done);
2276
2277 /*
2278 * This wastes time, since we can't return until the command is
2279 * complete. We can't sleep either since we may get re-entered!
2280 * However, we must re-enable interrupts, or else we'll be
2281 * waiting forever.
2282 */
2283 spin_unlock_irq(info->host->host_lock);

--- 741 unchanged lines hidden ---
2282
2283 /*
2284 * This wastes time, since we can't return until the command is
2285 * complete. We can't sleep either since we may get re-entered!
2286 * However, we must re-enable interrupts, or else we'll be
2287 * waiting forever.
2288 */
2289 spin_unlock_irq(info->host->host_lock);

--- 741 unchanged lines hidden ---