]> err.no Git - linux-2.6/commitdiff
[PATCH] ipmi: more dell fixes
authorCorey Minyard <minyard@acm.org>
Mon, 7 Nov 2005 08:59:58 +0000 (00:59 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 7 Nov 2005 15:53:44 +0000 (07:53 -0800)
Make SMIC driver ignore EVT_AVAIL and SMS_ATN bits in flags register, as
they're used by systems management interrupts, not the host OS.

Make the OEM0 Data Available handler work for pre-IPMI 1.5 systems from Dell
too.

Without these two fixes, PowerEdge 2650 and other similar systems with SMIC
may hang a process (modprobe or anything using /dev/ipmi0).

Signed-off-by: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_smic_sm.c

index 204e2e987e9024d1c15b49ece0cdcc30ae5dfec3..df7dbbff57aee8dff9eaa53be35025493556fcaa 100644 (file)
@@ -2052,6 +2052,9 @@ static int oem_data_avail_to_receive_msg_avail(struct smi_info *smi_info)
  * IPMI Version = 0x51             IPMI 1.5
  * Manufacturer ID = A2 02 00      Dell IANA
  *
+ * Additionally, PowerEdge systems with IPMI < 1.5 may also assert
+ * OEM0_DATA_AVAIL and needs to be treated as RECEIVE_MSG_AVAIL.
+ *
  */
 #define DELL_POWEREDGE_8G_BMC_DEVICE_ID  0x20
 #define DELL_POWEREDGE_8G_BMC_DEVICE_REV 0x80
@@ -2061,13 +2064,19 @@ static void setup_dell_poweredge_oem_data_handler(struct smi_info *smi_info)
 {
        struct ipmi_device_id *id = &smi_info->device_id;
        const char mfr[3]=DELL_IANA_MFR_ID;
-       if (! memcmp(mfr, id->manufacturer_id, sizeof(mfr))
-           && (id->device_id       == DELL_POWEREDGE_8G_BMC_DEVICE_ID)
-           && (id->device_revision == DELL_POWEREDGE_8G_BMC_DEVICE_REV)
-           && (id->ipmi_version    == DELL_POWEREDGE_8G_BMC_IPMI_VERSION))
-       {
-               smi_info->oem_data_avail_handler =
-                       oem_data_avail_to_receive_msg_avail;
+       if (! memcmp(mfr, id->manufacturer_id, sizeof(mfr))) {
+               if (id->device_id       == DELL_POWEREDGE_8G_BMC_DEVICE_ID  &&
+                   id->device_revision == DELL_POWEREDGE_8G_BMC_DEVICE_REV &&
+                   id->ipmi_version    == DELL_POWEREDGE_8G_BMC_IPMI_VERSION) {
+                       smi_info->oem_data_avail_handler =
+                               oem_data_avail_to_receive_msg_avail;
+               }
+               else if (ipmi_version_major(id) < 1 ||
+                        (ipmi_version_major(id) == 1 &&
+                         ipmi_version_minor(id) < 5)) {
+                       smi_info->oem_data_avail_handler =
+                               oem_data_avail_to_receive_msg_avail;
+               }
        }
 }
 
index f17043da9dd5e2ab4c52ffbe4feb41bf80849409..39d7e5ef1a2ba82ff6d9b3526f397b0e2184a550 100644 (file)
@@ -85,6 +85,12 @@ enum smic_states {
 /* SMIC Flags Register Bits */
 #define SMIC_RX_DATA_READY     0x80
 #define SMIC_TX_DATA_READY     0x40
+/*
+ * SMIC_SMI and SMIC_EVM_DATA_AVAIL are only used by
+ * a few systems, and then only by Systems Management
+ * Interrupts, not by the OS.  Always ignore these bits.
+ *
+ */
 #define SMIC_SMI               0x10
 #define SMIC_EVM_DATA_AVAIL    0x08
 #define SMIC_SMS_DATA_AVAIL    0x04
@@ -368,8 +374,7 @@ static enum si_sm_result smic_event (struct si_sm_data *smic, long time)
        switch (smic->state) {
        case SMIC_IDLE:
                /* in IDLE we check for available messages */
-               if (flags & (SMIC_SMI |
-                            SMIC_EVM_DATA_AVAIL | SMIC_SMS_DATA_AVAIL))
+               if (flags & SMIC_SMS_DATA_AVAIL)
                {
                        return SI_SM_ATTN;
                }