From owner-svn-src-all@FreeBSD.ORG Sat Sep 14 09:05:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A0F99E1; Sat, 14 Sep 2013 09:05:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 074CC2AC4; Sat, 14 Sep 2013 09:05:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8E95361092622; Sat, 14 Sep 2013 09:05:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8E953vv092621; Sat, 14 Sep 2013 09:05:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201309140905.r8E953vv092621@svn.freebsd.org> From: Alexander Motin Date: Sat, 14 Sep 2013 09:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255546 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sat, 14 Sep 2013 09:05:04 -0000 Author: mav Date: Sat Sep 14 09:05:03 2013 New Revision: 255546 URL: http://svnweb.freebsd.org/changeset/base/255546 Log: MFC r253721, r253722: Detect unsupported PREVENT ALLOW MEDIUM REMOVAL and SYNCHRONIZE CACHE(10) to not spam devices with useless commands and logs with errors. Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Sat Sep 14 09:03:21 2013 (r255545) +++ stable/9/sys/cam/scsi/scsi_da.c Sat Sep 14 09:05:03 2013 (r255546) @@ -2797,6 +2797,28 @@ cmd6workaround(union ccb *ccb) return (0); } + /* Detect unsupported PREVENT ALLOW MEDIUM REMOVAL. */ + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 && + (*cdb == PREVENT_ALLOW) && + (softc->quirks & DA_Q_NO_PREVENT) == 0) { + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "PREVENT ALLOW MEDIUM REMOVAL not supported.\n"); + softc->quirks |= DA_Q_NO_PREVENT; + return (0); + } + + /* Detect unsupported SYNCHRONIZE CACHE(10). */ + if ((ccb->ccb_h.flags & CAM_CDB_POINTER) == 0 && + (*cdb == SYNCHRONIZE_CACHE) && + (softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) { + if (bootverbose) + xpt_print(ccb->ccb_h.path, + "SYNCHRONIZE CACHE(10) not supported.\n"); + softc->quirks |= DA_Q_NO_SYNC_CACHE; + return (0); + } + /* Translation only possible if CDB is an array and cmd is R/W6 */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 || (*cdb != READ_6 && *cdb != WRITE_6))