Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18447
b: refs/heads/master
c: eeb846c
h: refs/heads/master
i:
  18445: 1b342fa
  18443: dd22e43
  18439: ef10748
  18431: 6570ea6
v: v3
  • Loading branch information
Christoph Hellwig authored and James Bottomley committed Jan 14, 2006
1 parent efbe0c4 commit a9c200f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a28f49adbe4955af8a1306fd36ddae15136dde7
refs/heads/master: eeb846cefdd842af479393a7d0fd399a29e42532
4 changes: 2 additions & 2 deletions trunk/drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,15 @@ typedef struct _MPT_IOCTL {
u8 status; /* current command status */
u8 reset; /* 1 if bus reset allowed */
u8 target; /* target for reset */
struct semaphore sem_ioc;
struct mutex ioctl_mutex;
} MPT_IOCTL;

#define MPT_SAS_MGMT_STATUS_RF_VALID 0x02 /* The Reply Frame is VALID */
#define MPT_SAS_MGMT_STATUS_COMMAND_GOOD 0x10 /* Command Status GOOD */
#define MPT_SAS_MGMT_STATUS_TM_FAILED 0x40 /* User TM request failed */

typedef struct _MPT_SAS_MGMT {
struct semaphore mutex;
struct mutex mutex;
struct completion done;
u8 reply[MPT_DEFAULT_FRAME_SIZE]; /* reply frame data */
u8 status; /* current command status */
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/message/fusion/mptctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock)
dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock));

if (nonblock) {
if (down_trylock(&ioc->ioctl->sem_ioc))
if (!mutex_trylock(&ioc->ioctl->ioctl_mutex))
rc = -EAGAIN;
} else {
if (down_interruptible(&ioc->ioctl->sem_ioc))
if (mutex_lock_interruptible(&ioc->ioctl->ioctl_mutex))
rc = -ERESTARTSYS;
}
dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc));
Expand Down Expand Up @@ -557,7 +557,7 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
else
ret = -EINVAL;

up(&iocp->ioctl->sem_ioc);
mutex_unlock(&iocp->ioctl->ioctl_mutex);

return ret;
}
Expand Down Expand Up @@ -2619,7 +2619,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd,

ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);

up(&iocp->ioctl->sem_ioc);
mutex_unlock(&iocp->ioctl->ioctl_mutex);

return ret;
}
Expand Down Expand Up @@ -2673,7 +2673,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd,
*/
ret = mptctl_do_mpt_command (karg, &uarg->MF);

up(&iocp->ioctl->sem_ioc);
mutex_unlock(&iocp->ioctl->ioctl_mutex);

return ret;
}
Expand Down Expand Up @@ -2743,7 +2743,7 @@ mptctl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
memset(mem, 0, sz);
ioc->ioctl = (MPT_IOCTL *) mem;
ioc->ioctl->ioc = ioc;
sema_init(&ioc->ioctl->sem_ioc, 1);
mutex_init(&ioc->ioctl->ioctl_mutex);
return 0;

out_fail:
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset)
if (phy->identify.target_port_protocols & SAS_PROTOCOL_SMP)
return -ENXIO;

if (down_interruptible(&ioc->sas_mgmt.mutex))
if (mutex_lock_interruptible(&ioc->sas_mgmt.mutex))
goto out;

mf = mpt_get_msg_frame(mptsasMgmtCtx, ioc);
Expand Down Expand Up @@ -508,7 +508,7 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset)
error = 0;

out_unlock:
up(&ioc->sas_mgmt.mutex);
mutex_unlock(&ioc->sas_mgmt.mutex);
out:
return error;
}
Expand Down Expand Up @@ -1477,7 +1477,7 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
INIT_LIST_HEAD(&ioc->sas_topology);
mutex_init(&ioc->sas_topology_mutex);

init_MUTEX(&ioc->sas_mgmt.mutex);
mutex_init(&ioc->sas_mgmt.mutex);
init_completion(&ioc->sas_mgmt.done);

/* Verify that we won't exceed the maximum
Expand Down

0 comments on commit a9c200f

Please sign in to comment.