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


6717                 }
6718         }
6719         con_log(CL_ANN, (CE_NOTE, "mrsas: "
6720             "schedule next timeout check: "
6721             "do timeout \n"));
6722         instance->timeout_id =
6723             timeout(io_timeout_checker, (void *)instance,
6724             drv_usectohz(MRSAS_1_SECOND));
6725 }
6726 
6727 static uint32_t
6728 read_fw_status_reg_ppc(struct mrsas_instance *instance)
6729 {
6730         return ((uint32_t)RD_OB_SCRATCH_PAD_0(instance));
6731 }
6732 
6733 static void
6734 issue_cmd_ppc(struct mrsas_cmd *cmd, struct mrsas_instance *instance)
6735 {
6736         struct scsi_pkt *pkt;
6737         atomic_add_16(&instance->fw_outstanding, 1);
6738 
6739         pkt = cmd->pkt;
6740         if (pkt) {
6741                 con_log(CL_DLEVEL1, (CE_NOTE, "%llx : issue_cmd_ppc:"
6742                     "ISSUED CMD TO FW : called : cmd:"
6743                     ": %p instance : %p pkt : %p pkt_time : %x\n",
6744                     gethrtime(), (void *)cmd, (void *)instance,
6745                     (void *)pkt, cmd->drv_pkt_time));
6746                 if (instance->adapterresetinprogress) {
6747                         cmd->drv_pkt_time = (uint16_t)debug_timeout_g;
6748                         con_log(CL_ANN1, (CE_NOTE, "Reset the scsi_pkt timer"));
6749                 } else {
6750                         push_pending_mfi_pkt(instance, cmd);
6751                 }
6752 
6753         } else {
6754                 con_log(CL_DLEVEL1, (CE_NOTE, "%llx : issue_cmd_ppc:"
6755                     "ISSUED CMD TO FW : called : cmd : %p, instance: %p"
6756                     "(NO PKT)\n", gethrtime(), (void *)cmd, (void *)instance));
6757         }




6717                 }
6718         }
6719         con_log(CL_ANN, (CE_NOTE, "mrsas: "
6720             "schedule next timeout check: "
6721             "do timeout \n"));
6722         instance->timeout_id =
6723             timeout(io_timeout_checker, (void *)instance,
6724             drv_usectohz(MRSAS_1_SECOND));
6725 }
6726 
6727 static uint32_t
6728 read_fw_status_reg_ppc(struct mrsas_instance *instance)
6729 {
6730         return ((uint32_t)RD_OB_SCRATCH_PAD_0(instance));
6731 }
6732 
6733 static void
6734 issue_cmd_ppc(struct mrsas_cmd *cmd, struct mrsas_instance *instance)
6735 {
6736         struct scsi_pkt *pkt;
6737         atomic_inc_16(&instance->fw_outstanding);
6738 
6739         pkt = cmd->pkt;
6740         if (pkt) {
6741                 con_log(CL_DLEVEL1, (CE_NOTE, "%llx : issue_cmd_ppc:"
6742                     "ISSUED CMD TO FW : called : cmd:"
6743                     ": %p instance : %p pkt : %p pkt_time : %x\n",
6744                     gethrtime(), (void *)cmd, (void *)instance,
6745                     (void *)pkt, cmd->drv_pkt_time));
6746                 if (instance->adapterresetinprogress) {
6747                         cmd->drv_pkt_time = (uint16_t)debug_timeout_g;
6748                         con_log(CL_ANN1, (CE_NOTE, "Reset the scsi_pkt timer"));
6749                 } else {
6750                         push_pending_mfi_pkt(instance, cmd);
6751                 }
6752 
6753         } else {
6754                 con_log(CL_DLEVEL1, (CE_NOTE, "%llx : issue_cmd_ppc:"
6755                     "ISSUED CMD TO FW : called : cmd : %p, instance: %p"
6756                     "(NO PKT)\n", gethrtime(), (void *)cmd, (void *)instance));
6757         }