On Tuesday, October 16, 2012 5:24:44 am Harald Schmalzbauer wrote:
>  Hello,
> 
> I have 9.1-RC2 running in an ESXi 5.1 guest.
> I use 'lsisas' as virtual SCSI-Controller and mpt attaches and finds 1068E.
> 
> Everything is working fine until the first 'shutdown -r now':
> The second boot pauses for ~2 minutes after probing disks and continues
> with this error:
> mpt0: Timedout requests already complete. Interrupts may not be functioning.

To be clear, you only see this at the end of reboot, and the hardware is fine
once the machine is back up?

> This problem was also obeserved with real 1068 hardware:
> http://lists.freebsd.org/pipermail/freebsd-stable/2011-September/063937.html
> 
> When I power off the virtual machine instead of rebooting, the problem
> doesn't occur.
> 
> Accidentally I found a workarround ;-) :
> If I set 'verbose_boot' in loader.conf, the problem vanisehs!?!?!?
> 
> Any idea how „verbose_boot“ affects the operation of the mpt driver?

Extra printfs affect the timing most likely.

Are you using any RAID volumes?  The only shutdown handler in mpt that looks
like it might want interrupts to work is mpt_raid_shutdown().  It needs to use
polled I/O instead of disabling interrupts I think.  Try this:

Index: mpt_raid.c
===================================================================
--- mpt_raid.c  (revision 241641)
+++ mpt_raid.c  (working copy)
@@ -115,7 +115,7 @@ static timeout_t mpt_raid_timer;
 static void mpt_enable_vol(struct mpt_softc *mpt,
                           struct mpt_raid_volume *mpt_vol, int enable);
 #endif
-static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *);
+static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *, int);
 static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume 
*,
     struct cam_path *);
 #if __FreeBSD_version < 500000
@@ -135,7 +135,7 @@ static void mpt_disk_prt(struct mpt_softc *mpt, st
 static int mpt_issue_raid_req(struct mpt_softc *mpt,
     struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req,
     u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len,
-    int write, int wait);
+    int write, int wait, int sleep_ok);
 
 static int mpt_refresh_raid_data(struct mpt_softc *mpt);
 static void mpt_schedule_raid_refresh(struct mpt_softc *mpt);
@@ -517,7 +517,7 @@ mpt_raid_shutdown(struct mpt_softc *mpt)
 
        mpt->raid_mwce_setting = MPT_RAID_MWCE_OFF;
        RAID_VOL_FOREACH(mpt, mpt_vol) {
-               mpt_verify_mwce(mpt, mpt_vol);
+               mpt_verify_mwce(mpt, mpt_vol, FALSE);
        }
 }
 
@@ -592,7 +592,7 @@ static int
 mpt_issue_raid_req(struct mpt_softc *mpt, struct mpt_raid_volume *vol,
                   struct mpt_raid_disk *disk, request_t *req, u_int Action,
                   uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len,
-                  int write, int wait)
+                  int write, int wait, int sleep_ok)
 {
        MSG_RAID_ACTION_REQUEST *rap;
        SGE_SIMPLE32 *se;
@@ -623,7 +623,7 @@ mpt_issue_raid_req(struct mpt_softc *mpt, struct m
 
        if (wait) {
                return (mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE,
-                                    /*sleep_ok*/FALSE, /*time_ms*/2000));
+                                    sleep_ok, /*time_ms*/2000));
        } else {
                return (0);
        }
@@ -763,7 +763,7 @@ mpt_raid_quiesce_disk(struct mpt_softc *mpt, struc
                                        MPI_RAID_ACTION_QUIESCE_PHYS_IO,
                                        /*ActionData*/0, /*addr*/0,
                                        /*len*/0, /*write*/FALSE,
-                                       /*wait*/FALSE);
+                                       /*wait*/FALSE, /*sleep_ok*/FALSE);
                if (rv != 0)
                        return (CAM_REQ_CMP_ERR);
 
@@ -882,7 +882,7 @@ mpt_enable_vol(struct mpt_softc *mpt, struct mpt_r
                                enable ? MPI_RAID_ACTION_ENABLE_VOLUME
                                       : MPI_RAID_ACTION_DISABLE_VOLUME,
                                /*data*/0, /*addr*/0, /*len*/0,
-                               /*write*/FALSE, /*wait*/TRUE);
+                               /*write*/FALSE, /*wait*/TRUE, /*sleep_ok*/TRUE);
        if (rv == ETIMEDOUT) {
                mpt_vol_prt(mpt, mpt_vol, "mpt_enable_vol: "
                            "%s Volume Timed-out\n",
@@ -903,7 +903,8 @@ mpt_enable_vol(struct mpt_softc *mpt, struct mpt_r
 #endif
 
 static void
-mpt_verify_mwce(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol)
+mpt_verify_mwce(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol,
+    int sleep_ok)
 {
        request_t *req;
        struct mpt_raid_action_result *ar;
@@ -950,7 +951,7 @@ static void
                return;
        }
 
-       req = mpt_get_request(mpt, /*sleep_ok*/TRUE);
+       req = mpt_get_request(mpt, sleep_ok);
        if (req == NULL) {
                mpt_vol_prt(mpt, mpt_vol,
                            "mpt_verify_mwce: Get request failed!\n");
@@ -965,7 +966,7 @@ static void
        rv = mpt_issue_raid_req(mpt, mpt_vol, /*disk*/NULL, req,
                                MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS,
                                data, /*addr*/0, /*len*/0,
-                               /*write*/FALSE, /*wait*/TRUE);
+                               /*write*/FALSE, /*wait*/TRUE, sleep_ok);
        if (rv == ETIMEDOUT) {
                mpt_vol_prt(mpt, mpt_vol, "mpt_verify_mwce: "
                            "Write Cache Enable Timed-out\n");
@@ -1018,7 +1019,8 @@ mpt_verify_resync_rate(struct mpt_softc *mpt, stru
                rv = mpt_issue_raid_req(mpt, mpt_vol, /*disk*/NULL, req,
                                        MPI_RAID_ACTION_SET_RESYNC_RATE,
                                        mpt->raid_resync_rate, /*addr*/0,
-                                       /*len*/0, /*write*/FALSE, /*wait*/TRUE);
+                                       /*len*/0, /*write*/FALSE, /*wait*/TRUE,
+                                       /*sleep_ok*/TRUE);
                if (rv == ETIMEDOUT) {
                        mpt_vol_prt(mpt, mpt_vol, "mpt_refresh_raid_data: "
                                    "Resync Rate Setting Timed-out\n");
@@ -1054,7 +1056,8 @@ mpt_verify_resync_rate(struct mpt_softc *mpt, stru
                rv = mpt_issue_raid_req(mpt, mpt_vol, /*disk*/NULL, req,
                                        MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS,
                                        data, /*addr*/0, /*len*/0,
-                                       /*write*/FALSE, /*wait*/TRUE);
+                                       /*write*/FALSE, /*wait*/TRUE,
+                                       /*sleep_ok*/TRUE);
                if (rv == ETIMEDOUT) {
                        mpt_vol_prt(mpt, mpt_vol, "mpt_refresh_raid_data: "
                                    "Resync Rate Setting Timed-out\n");
@@ -1314,7 +1317,7 @@ mpt_refresh_raid_vol(struct mpt_softc *mpt, struct
                return;
        }
        rv = mpt_issue_raid_req(mpt, mpt_vol, NULL, req,
-           MPI_RAID_ACTION_INDICATOR_STRUCT, 0, 0, 0, FALSE, TRUE);
+           MPI_RAID_ACTION_INDICATOR_STRUCT, 0, 0, 0, FALSE, TRUE, TRUE);
        if (rv == ETIMEDOUT) {
                mpt_vol_prt(mpt, mpt_vol,
                    "mpt_refresh_raid_vol: Progress Indicator fetch timeout\n");
@@ -1474,7 +1477,7 @@ mpt_refresh_raid_data(struct mpt_softc *mpt)
                mpt_vol->flags |= MPT_RVF_UP2DATE;
                mpt_vol_prt(mpt, mpt_vol, "%s - %s\n",
                    mpt_vol_type(mpt_vol), mpt_vol_state(mpt_vol));
-               mpt_verify_mwce(mpt, mpt_vol);
+               mpt_verify_mwce(mpt, mpt_vol, TRUE);
 
                if (vol_pg->VolumeStatus.Flags == 0) {
                        continue;
@@ -1752,7 +1755,7 @@ mpt_raid_set_vol_mwce(struct mpt_softc *mpt, mpt_r
                        mpt_vol_prt(mpt, mpt_vol, "WARNING - Unsafe shutdown "
                                    "detected.  Suggest full resync.\n");
                }
-               mpt_verify_mwce(mpt, mpt_vol);
+               mpt_verify_mwce(mpt, mpt_vol, TRUE);
        }
        mpt->raid_mwce_set = 1;
        MPT_UNLOCK(mpt);


-- 
John Baldwin
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to