2005-04-17 06:20:36 +08:00
|
|
|
/* ------------------------------------------------------------
|
|
|
|
* rpa_vscsi.c
|
|
|
|
* (C) Copyright IBM Corporation 1994, 2003
|
|
|
|
* Authors: Colin DeVilbiss (devilbis@us.ibm.com)
|
|
|
|
* Santiago Leon (santil@us.ibm.com)
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA
|
|
|
|
*
|
|
|
|
* ------------------------------------------------------------
|
|
|
|
* RPA-specific functions of the SCSI host adapter for Virtual I/O devices
|
|
|
|
*
|
|
|
|
* This driver allows the Linux SCSI peripheral drivers to directly
|
|
|
|
* access devices in the hosting partition, either on an iSeries
|
|
|
|
* hypervisor system or a converged hypervisor system.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm/vio.h>
|
2005-08-17 14:41:44 +08:00
|
|
|
#include <asm/prom.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/iommu.h>
|
|
|
|
#include <asm/hvcall.h>
|
2010-06-18 02:56:00 +08:00
|
|
|
#include <linux/delay.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <linux/dma-mapping.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/gfp.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include "ibmvscsi.h"
|
2005-06-28 06:01:48 +08:00
|
|
|
|
|
|
|
static char partition_name[97] = "UNKNOWN";
|
|
|
|
static unsigned int partition_number = -1;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------
|
|
|
|
* Routines for managing the command/response queue
|
|
|
|
*/
|
|
|
|
/**
|
2007-09-22 06:29:36 +08:00
|
|
|
* rpavscsi_handle_event: - Interrupt handler for crq events
|
2005-04-17 06:20:36 +08:00
|
|
|
* @irq: number of irq to handle, not used
|
|
|
|
* @dev_instance: ibmvscsi_host_data of host that received interrupt
|
|
|
|
*
|
|
|
|
* Disables interrupts and schedules srp_task
|
|
|
|
* Always returns IRQ_HANDLED
|
|
|
|
*/
|
2007-09-22 06:29:36 +08:00
|
|
|
static irqreturn_t rpavscsi_handle_event(int irq, void *dev_instance)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
struct ibmvscsi_host_data *hostdata =
|
|
|
|
(struct ibmvscsi_host_data *)dev_instance;
|
|
|
|
vio_disable_interrupts(to_vio_dev(hostdata->dev));
|
|
|
|
tasklet_schedule(&hostdata->srp_task);
|
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* release_crq_queue: - Deallocates data and unregisters CRQ
|
|
|
|
* @queue: crq_queue to initialize and register
|
|
|
|
* @host_data: ibmvscsi_host_data of host
|
|
|
|
*
|
|
|
|
* Frees irq, deallocates a page for messages, unmaps dma, and unregisters
|
|
|
|
* the crq with the hypervisor.
|
|
|
|
*/
|
2007-09-22 06:29:36 +08:00
|
|
|
static void rpavscsi_release_crq_queue(struct crq_queue *queue,
|
|
|
|
struct ibmvscsi_host_data *hostdata,
|
|
|
|
int max_requests)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2010-06-18 02:56:00 +08:00
|
|
|
long rc = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct vio_dev *vdev = to_vio_dev(hostdata->dev);
|
|
|
|
free_irq(vdev->irq, (void *)hostdata);
|
|
|
|
tasklet_kill(&hostdata->srp_task);
|
|
|
|
do {
|
2010-06-18 02:56:00 +08:00
|
|
|
if (rc)
|
|
|
|
msleep(100);
|
2005-04-17 06:20:36 +08:00
|
|
|
rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
|
2006-03-30 20:49:40 +08:00
|
|
|
} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
|
2005-04-17 06:20:36 +08:00
|
|
|
dma_unmap_single(hostdata->dev,
|
|
|
|
queue->msg_token,
|
|
|
|
queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
|
|
|
|
free_page((unsigned long)queue->msgs);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* crq_queue_next_crq: - Returns the next entry in message queue
|
|
|
|
* @queue: crq_queue to use
|
|
|
|
*
|
|
|
|
* Returns pointer to next entry in queue, or NULL if there are no new
|
|
|
|
* entried in the CRQ.
|
|
|
|
*/
|
|
|
|
static struct viosrp_crq *crq_queue_next_crq(struct crq_queue *queue)
|
|
|
|
{
|
|
|
|
struct viosrp_crq *crq;
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
spin_lock_irqsave(&queue->lock, flags);
|
|
|
|
crq = &queue->msgs[queue->cur];
|
|
|
|
if (crq->valid & 0x80) {
|
|
|
|
if (++queue->cur == queue->size)
|
|
|
|
queue->cur = 0;
|
|
|
|
} else
|
|
|
|
crq = NULL;
|
|
|
|
spin_unlock_irqrestore(&queue->lock, flags);
|
|
|
|
|
|
|
|
return crq;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2007-09-22 06:29:36 +08:00
|
|
|
* rpavscsi_send_crq: - Send a CRQ
|
2005-04-17 06:20:36 +08:00
|
|
|
* @hostdata: the adapter
|
|
|
|
* @word1: the first 64 bits of the data
|
|
|
|
* @word2: the second 64 bits of the data
|
|
|
|
*/
|
2007-09-22 06:29:36 +08:00
|
|
|
static int rpavscsi_send_crq(struct ibmvscsi_host_data *hostdata,
|
|
|
|
u64 word1, u64 word2)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
struct vio_dev *vdev = to_vio_dev(hostdata->dev);
|
|
|
|
|
|
|
|
return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2007-09-22 06:29:36 +08:00
|
|
|
* rpavscsi_task: - Process srps asynchronously
|
2005-04-17 06:20:36 +08:00
|
|
|
* @data: ibmvscsi_host_data of host
|
|
|
|
*/
|
2007-09-22 06:29:36 +08:00
|
|
|
static void rpavscsi_task(void *data)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
struct ibmvscsi_host_data *hostdata = (struct ibmvscsi_host_data *)data;
|
|
|
|
struct vio_dev *vdev = to_vio_dev(hostdata->dev);
|
|
|
|
struct viosrp_crq *crq;
|
|
|
|
int done = 0;
|
|
|
|
|
|
|
|
while (!done) {
|
|
|
|
/* Pull all the valid messages off the CRQ */
|
|
|
|
while ((crq = crq_queue_next_crq(&hostdata->queue)) != NULL) {
|
|
|
|
ibmvscsi_handle_crq(crq, hostdata);
|
|
|
|
crq->valid = 0x00;
|
|
|
|
}
|
|
|
|
|
|
|
|
vio_enable_interrupts(vdev);
|
|
|
|
if ((crq = crq_queue_next_crq(&hostdata->queue)) != NULL) {
|
|
|
|
vio_disable_interrupts(vdev);
|
|
|
|
ibmvscsi_handle_crq(crq, hostdata);
|
|
|
|
crq->valid = 0x00;
|
|
|
|
} else {
|
|
|
|
done = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-28 06:01:48 +08:00
|
|
|
static void gather_partition_info(void)
|
|
|
|
{
|
|
|
|
struct device_node *rootdn;
|
|
|
|
|
2006-07-12 13:40:51 +08:00
|
|
|
const char *ppartition_name;
|
|
|
|
const unsigned int *p_number_ptr;
|
2005-06-28 06:01:48 +08:00
|
|
|
|
|
|
|
/* Retrieve information about this partition */
|
2007-04-24 11:50:55 +08:00
|
|
|
rootdn = of_find_node_by_path("/");
|
2005-06-28 06:01:48 +08:00
|
|
|
if (!rootdn) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-05-01 11:54:02 +08:00
|
|
|
ppartition_name = of_get_property(rootdn, "ibm,partition-name", NULL);
|
2005-06-28 06:01:48 +08:00
|
|
|
if (ppartition_name)
|
|
|
|
strncpy(partition_name, ppartition_name,
|
|
|
|
sizeof(partition_name));
|
2007-05-01 11:54:02 +08:00
|
|
|
p_number_ptr = of_get_property(rootdn, "ibm,partition-no", NULL);
|
2005-06-28 06:01:48 +08:00
|
|
|
if (p_number_ptr)
|
|
|
|
partition_number = *p_number_ptr;
|
2007-04-24 11:50:55 +08:00
|
|
|
of_node_put(rootdn);
|
2005-06-28 06:01:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
|
|
|
|
{
|
|
|
|
memset(&hostdata->madapter_info, 0x00,
|
|
|
|
sizeof(hostdata->madapter_info));
|
|
|
|
|
2007-06-14 06:12:19 +08:00
|
|
|
dev_info(hostdata->dev, "SRP_VERSION: %s\n", SRP_VERSION);
|
2005-06-28 06:01:48 +08:00
|
|
|
strcpy(hostdata->madapter_info.srp_version, SRP_VERSION);
|
|
|
|
|
|
|
|
strncpy(hostdata->madapter_info.partition_name, partition_name,
|
|
|
|
sizeof(hostdata->madapter_info.partition_name));
|
|
|
|
|
|
|
|
hostdata->madapter_info.partition_number = partition_number;
|
|
|
|
|
|
|
|
hostdata->madapter_info.mad_version = 1;
|
|
|
|
hostdata->madapter_info.os_type = 2;
|
|
|
|
}
|
|
|
|
|
2007-09-22 06:29:36 +08:00
|
|
|
/**
|
|
|
|
* reset_crq_queue: - resets a crq after a failure
|
|
|
|
* @queue: crq_queue to initialize and register
|
|
|
|
* @hostdata: ibmvscsi_host_data of host
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static int rpavscsi_reset_crq_queue(struct crq_queue *queue,
|
|
|
|
struct ibmvscsi_host_data *hostdata)
|
|
|
|
{
|
2010-06-18 02:56:00 +08:00
|
|
|
int rc = 0;
|
2007-09-22 06:29:36 +08:00
|
|
|
struct vio_dev *vdev = to_vio_dev(hostdata->dev);
|
|
|
|
|
|
|
|
/* Close the CRQ */
|
|
|
|
do {
|
2010-06-18 02:56:00 +08:00
|
|
|
if (rc)
|
|
|
|
msleep(100);
|
2007-09-22 06:29:36 +08:00
|
|
|
rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
|
|
|
|
} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
|
|
|
|
|
|
|
|
/* Clean out the queue */
|
|
|
|
memset(queue->msgs, 0x00, PAGE_SIZE);
|
|
|
|
queue->cur = 0;
|
|
|
|
|
|
|
|
set_adapter_info(hostdata);
|
|
|
|
|
|
|
|
/* And re-open it again */
|
|
|
|
rc = plpar_hcall_norets(H_REG_CRQ,
|
|
|
|
vdev->unit_address,
|
|
|
|
queue->msg_token, PAGE_SIZE);
|
|
|
|
if (rc == 2) {
|
|
|
|
/* Adapter is good, but other end is not ready */
|
|
|
|
dev_warn(hostdata->dev, "Partner adapter not ready\n");
|
|
|
|
} else if (rc != 0) {
|
|
|
|
dev_warn(hostdata->dev, "couldn't register crq--rc 0x%x\n", rc);
|
|
|
|
}
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/**
|
|
|
|
* initialize_crq_queue: - Initializes and registers CRQ with hypervisor
|
|
|
|
* @queue: crq_queue to initialize and register
|
|
|
|
* @hostdata: ibmvscsi_host_data of host
|
|
|
|
*
|
|
|
|
* Allocates a page for messages, maps it for dma, and registers
|
|
|
|
* the crq with the hypervisor.
|
|
|
|
* Returns zero on success.
|
|
|
|
*/
|
2007-09-22 06:29:36 +08:00
|
|
|
static int rpavscsi_init_crq_queue(struct crq_queue *queue,
|
|
|
|
struct ibmvscsi_host_data *hostdata,
|
|
|
|
int max_requests)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
int rc;
|
2006-06-13 10:22:51 +08:00
|
|
|
int retrc;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct vio_dev *vdev = to_vio_dev(hostdata->dev);
|
|
|
|
|
|
|
|
queue->msgs = (struct viosrp_crq *)get_zeroed_page(GFP_KERNEL);
|
|
|
|
|
|
|
|
if (!queue->msgs)
|
|
|
|
goto malloc_failed;
|
|
|
|
queue->size = PAGE_SIZE / sizeof(*queue->msgs);
|
|
|
|
|
|
|
|
queue->msg_token = dma_map_single(hostdata->dev, queue->msgs,
|
|
|
|
queue->size * sizeof(*queue->msgs),
|
|
|
|
DMA_BIDIRECTIONAL);
|
|
|
|
|
2008-07-26 10:44:49 +08:00
|
|
|
if (dma_mapping_error(hostdata->dev, queue->msg_token))
|
2005-04-17 06:20:36 +08:00
|
|
|
goto map_failed;
|
|
|
|
|
2005-06-28 06:01:48 +08:00
|
|
|
gather_partition_info();
|
|
|
|
set_adapter_info(hostdata);
|
|
|
|
|
2006-06-13 10:22:51 +08:00
|
|
|
retrc = rc = plpar_hcall_norets(H_REG_CRQ,
|
2005-04-17 06:20:36 +08:00
|
|
|
vdev->unit_address,
|
|
|
|
queue->msg_token, PAGE_SIZE);
|
2006-03-30 20:49:40 +08:00
|
|
|
if (rc == H_RESOURCE)
|
2005-11-15 23:53:00 +08:00
|
|
|
/* maybe kexecing and resource is busy. try a reset */
|
2007-09-22 06:29:36 +08:00
|
|
|
rc = rpavscsi_reset_crq_queue(queue,
|
2005-11-15 23:53:00 +08:00
|
|
|
hostdata);
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
if (rc == 2) {
|
|
|
|
/* Adapter is good, but other end is not ready */
|
2007-06-14 06:12:19 +08:00
|
|
|
dev_warn(hostdata->dev, "Partner adapter not ready\n");
|
2006-07-07 11:08:49 +08:00
|
|
|
retrc = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
} else if (rc != 0) {
|
2007-06-14 06:12:19 +08:00
|
|
|
dev_warn(hostdata->dev, "Error %d opening adapter\n", rc);
|
2005-04-17 06:20:36 +08:00
|
|
|
goto reg_crq_failed;
|
|
|
|
}
|
|
|
|
|
2010-07-13 12:59:29 +08:00
|
|
|
queue->cur = 0;
|
|
|
|
spin_lock_init(&queue->lock);
|
|
|
|
|
|
|
|
tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task,
|
|
|
|
(unsigned long)hostdata);
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
if (request_irq(vdev->irq,
|
2007-09-22 06:29:36 +08:00
|
|
|
rpavscsi_handle_event,
|
2005-04-17 06:20:36 +08:00
|
|
|
0, "ibmvscsi", (void *)hostdata) != 0) {
|
2007-06-14 06:12:19 +08:00
|
|
|
dev_err(hostdata->dev, "couldn't register irq 0x%x\n",
|
|
|
|
vdev->irq);
|
2005-04-17 06:20:36 +08:00
|
|
|
goto req_irq_failed;
|
|
|
|
}
|
|
|
|
|
|
|
|
rc = vio_enable_interrupts(vdev);
|
|
|
|
if (rc != 0) {
|
2007-06-14 06:12:19 +08:00
|
|
|
dev_err(hostdata->dev, "Error %d enabling interrupts!!!\n", rc);
|
2005-04-17 06:20:36 +08:00
|
|
|
goto req_irq_failed;
|
|
|
|
}
|
|
|
|
|
2006-06-13 10:22:51 +08:00
|
|
|
return retrc;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
req_irq_failed:
|
2010-07-13 12:59:29 +08:00
|
|
|
tasklet_kill(&hostdata->srp_task);
|
2010-06-18 02:56:00 +08:00
|
|
|
rc = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
do {
|
2010-06-18 02:56:00 +08:00
|
|
|
if (rc)
|
|
|
|
msleep(100);
|
2005-04-17 06:20:36 +08:00
|
|
|
rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
|
2006-03-30 20:49:40 +08:00
|
|
|
} while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
|
2005-04-17 06:20:36 +08:00
|
|
|
reg_crq_failed:
|
|
|
|
dma_unmap_single(hostdata->dev,
|
|
|
|
queue->msg_token,
|
|
|
|
queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
|
|
|
|
map_failed:
|
|
|
|
free_page((unsigned long)queue->msgs);
|
|
|
|
malloc_failed:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2006-01-20 03:34:44 +08:00
|
|
|
/**
|
|
|
|
* reenable_crq_queue: - reenables a crq after
|
|
|
|
* @queue: crq_queue to initialize and register
|
|
|
|
* @hostdata: ibmvscsi_host_data of host
|
|
|
|
*
|
|
|
|
*/
|
2007-09-22 06:29:36 +08:00
|
|
|
static int rpavscsi_reenable_crq_queue(struct crq_queue *queue,
|
|
|
|
struct ibmvscsi_host_data *hostdata)
|
2006-01-20 03:34:44 +08:00
|
|
|
{
|
2010-06-18 02:56:00 +08:00
|
|
|
int rc = 0;
|
2006-01-20 03:34:44 +08:00
|
|
|
struct vio_dev *vdev = to_vio_dev(hostdata->dev);
|
|
|
|
|
|
|
|
/* Re-enable the CRQ */
|
|
|
|
do {
|
2010-06-18 02:56:00 +08:00
|
|
|
if (rc)
|
|
|
|
msleep(100);
|
2006-01-20 03:34:44 +08:00
|
|
|
rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address);
|
2006-03-30 20:49:40 +08:00
|
|
|
} while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
|
2006-01-20 03:34:44 +08:00
|
|
|
|
|
|
|
if (rc)
|
2007-06-14 06:12:19 +08:00
|
|
|
dev_err(hostdata->dev, "Error %d enabling adapter\n", rc);
|
2006-01-20 03:34:44 +08:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2010-02-22 00:37:57 +08:00
|
|
|
/**
|
|
|
|
* rpavscsi_resume: - resume after suspend
|
|
|
|
* @hostdata: ibmvscsi_host_data of host
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static int rpavscsi_resume(struct ibmvscsi_host_data *hostdata)
|
|
|
|
{
|
|
|
|
vio_disable_interrupts(to_vio_dev(hostdata->dev));
|
|
|
|
tasklet_schedule(&hostdata->srp_task);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-09-22 06:29:36 +08:00
|
|
|
struct ibmvscsi_ops rpavscsi_ops = {
|
|
|
|
.init_crq_queue = rpavscsi_init_crq_queue,
|
|
|
|
.release_crq_queue = rpavscsi_release_crq_queue,
|
|
|
|
.reset_crq_queue = rpavscsi_reset_crq_queue,
|
|
|
|
.reenable_crq_queue = rpavscsi_reenable_crq_queue,
|
|
|
|
.send_crq = rpavscsi_send_crq,
|
2010-02-22 00:37:57 +08:00
|
|
|
.resume = rpavscsi_resume,
|
2007-09-22 06:29:36 +08:00
|
|
|
};
|