From owner-svn-src-all@FreeBSD.ORG Tue Apr 23 02:36:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 13145DFA for ; Tue, 23 Apr 2013 02:36:02 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm1.bullet.mail.bf1.yahoo.com (nm1.bullet.mail.bf1.yahoo.com [98.139.212.160]) by mx1.freebsd.org (Postfix) with SMTP id B03311339 for ; Tue, 23 Apr 2013 02:36:01 +0000 (UTC) Received: from [98.139.212.151] by nm1.bullet.mail.bf1.yahoo.com with NNFMP; 23 Apr 2013 02:36:00 -0000 Received: from [98.139.213.7] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 23 Apr 2013 02:36:00 -0000 Received: from [127.0.0.1] by smtp107.mail.bf1.yahoo.com with NNFMP; 23 Apr 2013 02:36:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1366684559; bh=nIwBmLXl+F90tSSpq9/vqWAH4ns+j9YBki6DOrHIywM=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=L0/dhrdxlOcPWH9bHgTyDnoPqbHbXQ6sSND3gE5NDvyrWk1lq64rvbG73Jlhq3X896AMvFX7MByI4o8mjdMc0B64L7O6IQtFvzFDNBB95YuSkshEzF6gw3iMBHqmhwwC88GJLGTN/5ltUySgWEyPkNofVEgQUcDQhaTRyibgqNg= X-Yahoo-Newman-Id: 896183.72541.bm@smtp107.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: sKgMqYwVM1nMnuVjetmxSKl4KeS1G7i49IY8hI3HDFJl7I5 FSeYLtWM96UyzJFsLU8PhiXQWSYvdBsABv76ZZnTiqCBWHtvEg1y8_0OcHCw PG_bMp7eD.xJrf6MMYr4EqULRSJ_LkbiW.iy4.hl8flbCPV2cf7dNTXM3Sxw hXxfZtaKBroy0MVw3X1E6nyC4rBydnEnAOadh6dcbPBKyqA61WWfF_dp3Ad9 mGa2Eg0eJptESRqifHXyxx0xlcb31HeTzueo4XIn0KK74_Uif9K47g0MmYxW s5Oa8gRpYthT1Vk_diJo0x6PsOY3u5IERN35nzx1fwgZVgvJHsT7f3VUlUB0 yTHElBaqZG2G9VXkBobPbyXWr5jhiogczazpYpAOKQQ.OgrFvyBMBPmXIy1x iS7C8ptKoFa1uo0rKMri0ZRcR5UsPQ1PZW4Gqu5dOZm29hQn8fGABfoJp0GW KvaXVbzuYdaJj6DOnWY7cimo- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from [192.168.254.206] (scott4long@168.103.85.57 with ) by smtp107.mail.bf1.yahoo.com with SMTP; 22 Apr 2013 19:35:59 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r249611 - in stable/9/sys/cam: ata scsi From: Scott Long In-Reply-To: <201304180944.r3I9i05t093967@svn.freebsd.org> Date: Mon, 22 Apr 2013 20:35:57 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201304180944.r3I9i05t093967@svn.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.1503) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 02:36:02 -0000 What problem does this solve, other than to unintentionally break the = MPT driver? This needs to be backed out of HEAD and stable/9 until a = better analysis is done. Scott On Apr 18, 2013, at 3:44 AM, Alexander Motin wrote: > Author: mav > Date: Thu Apr 18 09:44:00 2013 > New Revision: 249611 > URL: http://svnweb.freebsd.org/changeset/base/249611 >=20 > Log: > MFC r248872, r249048: > Make pre-shutdown flush and spindown routines to not use = xpt_polled_action(), > but execute the commands in regular way. There is no any reason to = cook CPU > while the system is still fully operational. After this change = polling in > CAM is used only for kernel dumping. >=20 > Modified: > stable/9/sys/cam/ata/ata_da.c > stable/9/sys/cam/scsi/scsi_da.c > Directory Properties: > stable/9/sys/ (props changed) >=20 > Modified: stable/9/sys/cam/ata/ata_da.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:40:34 2013 = (r249610) > +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:44:00 2013 = (r249611) > @@ -1825,11 +1825,10 @@ adaflush(void) > { > struct cam_periph *periph; > struct ada_softc *softc; > + union ccb *ccb; > int error; >=20 > CAM_PERIPH_FOREACH(periph, &adadriver) { > - union ccb ccb; > - > /* If we paniced with lock held - not recurse here. */ > if (cam_periph_owned(periph)) > continue; > @@ -1845,10 +1844,8 @@ adaflush(void) > continue; > } >=20 > - xpt_setup_ccb(&ccb.ccb_h, periph->path, = CAM_PRIORITY_NORMAL); > - > - ccb.ccb_h.ccb_state =3D ADA_CCB_DUMP; > - cam_fill_ataio(&ccb.ataio, > + ccb =3D cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > + cam_fill_ataio(&ccb->ataio, > 0, > adadone, > CAM_DIR_NONE, > @@ -1856,20 +1853,17 @@ adaflush(void) > NULL, > 0, > ada_default_timeout*1000); > - > if (softc->flags & ADA_FLAG_CAN_48BIT) > - ata_48bit_cmd(&ccb.ataio, ATA_FLUSHCACHE48, 0, = 0, 0); > + ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, = 0, 0); > else > - ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, = 0); > - xpt_polled_action(&ccb); > + ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, = 0); >=20 > - error =3D cam_periph_error(&ccb, > - 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); > - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) !=3D 0) > - cam_release_devq(ccb.ccb_h.path, = /*relsim_flags*/0, > - /*reduction*/0, /*timeout*/0, = /*getcount_only*/0); > + error =3D cam_periph_runccb(ccb, adaerror, = /*cam_flags*/0, > + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, > + softc->disk->d_devstat); > if (error !=3D 0) > xpt_print(periph->path, "Synchronize cache = failed\n"); > + xpt_release_ccb(ccb); > cam_periph_unlock(periph); > } > } > @@ -1879,11 +1873,10 @@ adaspindown(uint8_t cmd, int flags) > { > struct cam_periph *periph; > struct ada_softc *softc; > + union ccb *ccb; > int error; >=20 > CAM_PERIPH_FOREACH(periph, &adadriver) { > - union ccb ccb; > - > /* If we paniced with lock held - not recurse here. */ > if (cam_periph_owned(periph)) > continue; > @@ -1900,10 +1893,8 @@ adaspindown(uint8_t cmd, int flags) > if (bootverbose) > xpt_print(periph->path, "spin-down\n"); >=20 > - xpt_setup_ccb(&ccb.ccb_h, periph->path, = CAM_PRIORITY_NORMAL); > - > - ccb.ccb_h.ccb_state =3D ADA_CCB_DUMP; > - cam_fill_ataio(&ccb.ataio, > + ccb =3D cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > + cam_fill_ataio(&ccb->ataio, > 0, > adadone, > CAM_DIR_NONE | flags, > @@ -1911,17 +1902,14 @@ adaspindown(uint8_t cmd, int flags) > NULL, > 0, > ada_default_timeout*1000); > + ata_28bit_cmd(&ccb->ataio, cmd, 0, 0, 0); >=20 > - ata_28bit_cmd(&ccb.ataio, cmd, 0, 0, 0); > - xpt_polled_action(&ccb); > - > - error =3D cam_periph_error(&ccb, > - 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); > - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) !=3D 0) > - cam_release_devq(ccb.ccb_h.path, = /*relsim_flags*/0, > - /*reduction*/0, /*timeout*/0, = /*getcount_only*/0); > + error =3D cam_periph_runccb(ccb, adaerror, = /*cam_flags*/0, > + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, > + softc->disk->d_devstat); > if (error !=3D 0) > xpt_print(periph->path, "Spin-down disk = failed\n"); > + xpt_release_ccb(ccb); > cam_periph_unlock(periph); > } > } >=20 > Modified: stable/9/sys/cam/scsi/scsi_da.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:40:34 2013 = (r249610) > +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:44:00 2013 = (r249611) > @@ -2834,11 +2834,10 @@ dashutdown(void * arg, int howto) > { > struct cam_periph *periph; > struct da_softc *softc; > + union ccb *ccb; > int error; >=20 > CAM_PERIPH_FOREACH(periph, &dadriver) { > - union ccb ccb; > - > cam_periph_lock(periph); > softc =3D (struct da_softc *)periph->softc; >=20 > @@ -2852,10 +2851,8 @@ dashutdown(void * arg, int howto) > continue; > } >=20 > - xpt_setup_ccb(&ccb.ccb_h, periph->path, = CAM_PRIORITY_NORMAL); > - > - ccb.ccb_h.ccb_state =3D DA_CCB_DUMP; > - scsi_synchronize_cache(&ccb.csio, > + ccb =3D cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); > + scsi_synchronize_cache(&ccb->csio, > /*retries*/0, > /*cbfcnp*/dadone, > MSG_SIMPLE_Q_TAG, > @@ -2864,15 +2861,12 @@ dashutdown(void * arg, int howto) > SSD_FULL_SIZE, > 60 * 60 * 1000); >=20 > - xpt_polled_action(&ccb); > - > - error =3D cam_periph_error(&ccb, > - 0, SF_NO_RECOVERY | SF_NO_RETRY | SF_QUIET_IR, = NULL); > - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) !=3D 0) > - cam_release_devq(ccb.ccb_h.path, = /*relsim_flags*/0, > - /*reduction*/0, /*timeout*/0, = /*getcount_only*/0); > + error =3D cam_periph_runccb(ccb, daerror, = /*cam_flags*/0, > + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY | = SF_QUIET_IR, > + softc->disk->d_devstat); > if (error !=3D 0) > xpt_print(periph->path, "Synchronize cache = failed\n"); > + xpt_release_ccb(ccb); > cam_periph_unlock(periph); > } > }