Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*


4548         }
4549 
4550         con_log(CL_ANN1, (CE_CONT, inquiry_buf));
4551 }
4552 
4553 static int
4554 read_fw_status_reg_xscale(struct megasas_instance *instance)
4555 {
4556         return ((int)RD_OB_MSG_0(instance));
4557 }
4558 
4559 static int
4560 read_fw_status_reg_ppc(struct megasas_instance *instance)
4561 {
4562         return ((int)RD_OB_SCRATCH_PAD_0(instance));
4563 }
4564 
4565 static void
4566 issue_cmd_xscale(struct megasas_cmd *cmd, struct megasas_instance *instance)
4567 {
4568         atomic_add_16(&instance->fw_outstanding, 1);
4569 
4570         /* Issue the command to the FW */
4571         WR_IB_QPORT((host_to_le32(cmd->frame_phys_addr) >> 3) |
4572             (cmd->frame_count - 1), instance);
4573 }
4574 
4575 static void
4576 issue_cmd_ppc(struct megasas_cmd *cmd, struct megasas_instance *instance)
4577 {
4578         atomic_add_16(&instance->fw_outstanding, 1);
4579 
4580         /* Issue the command to the FW */
4581         WR_IB_QPORT((host_to_le32(cmd->frame_phys_addr)) |
4582             (((cmd->frame_count - 1) << 1) | 1), instance);
4583 }
4584 
4585 /*
4586  * issue_cmd_in_sync_mode
4587  */
4588 static int
4589 issue_cmd_in_sync_mode_xscale(struct megasas_instance *instance,
4590     struct megasas_cmd *cmd)
4591 {
4592         int             i;
4593         uint32_t        msecs = MFI_POLL_TIMEOUT_SECS * (10 * MILLISEC);
4594 
4595         cmd->cmd_status      = ENODATA;
4596 
4597         WR_IB_QPORT((host_to_le32(cmd->frame_phys_addr) >> 3) |
4598             (cmd->frame_count - 1), instance);




4548         }
4549 
4550         con_log(CL_ANN1, (CE_CONT, inquiry_buf));
4551 }
4552 
4553 static int
4554 read_fw_status_reg_xscale(struct megasas_instance *instance)
4555 {
4556         return ((int)RD_OB_MSG_0(instance));
4557 }
4558 
4559 static int
4560 read_fw_status_reg_ppc(struct megasas_instance *instance)
4561 {
4562         return ((int)RD_OB_SCRATCH_PAD_0(instance));
4563 }
4564 
4565 static void
4566 issue_cmd_xscale(struct megasas_cmd *cmd, struct megasas_instance *instance)
4567 {
4568         atomic_inc_16(&instance->fw_outstanding);
4569 
4570         /* Issue the command to the FW */
4571         WR_IB_QPORT((host_to_le32(cmd->frame_phys_addr) >> 3) |
4572             (cmd->frame_count - 1), instance);
4573 }
4574 
4575 static void
4576 issue_cmd_ppc(struct megasas_cmd *cmd, struct megasas_instance *instance)
4577 {
4578         atomic_inc_16(&instance->fw_outstanding);
4579 
4580         /* Issue the command to the FW */
4581         WR_IB_QPORT((host_to_le32(cmd->frame_phys_addr)) |
4582             (((cmd->frame_count - 1) << 1) | 1), instance);
4583 }
4584 
4585 /*
4586  * issue_cmd_in_sync_mode
4587  */
4588 static int
4589 issue_cmd_in_sync_mode_xscale(struct megasas_instance *instance,
4590     struct megasas_cmd *cmd)
4591 {
4592         int             i;
4593         uint32_t        msecs = MFI_POLL_TIMEOUT_SECS * (10 * MILLISEC);
4594 
4595         cmd->cmd_status      = ENODATA;
4596 
4597         WR_IB_QPORT((host_to_le32(cmd->frame_phys_addr) >> 3) |
4598             (cmd->frame_count - 1), instance);