From owner-freebsd-stable@FreeBSD.ORG Mon Nov 26 19:27:24 2012 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5F032DC for ; Mon, 26 Nov 2012 19:27:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8EA948FC12 for ; Mon, 26 Nov 2012 19:27:24 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo13so15701388vcb.13 for ; Mon, 26 Nov 2012 11:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=EsOnUg147JqkyiboRgTmrxUNU4uUhGvQ2qQnxEmtbU0=; b=q1grs50xSq1/DFoovsQhQiutaR6F/JpJikujvdC74XemJ4CMuAdR6Iy0NXsfcgwxrF jIu1tT8r8bpMLhOpKgWXnZx6C0sqU1wYVLnvfsQU+aH5jvuG8NiWBHRyLj1F5chyxoS/ dLmI24XL5RPC9VPf4oR6WpHzJtsw0wuaY7vrOWKK6Sj4IonjstGA1JEt2CXHpnx0K08T 3QBvQqBysQj+JTpjLE4P5bpcuFzinGAUUC5UsMeLUvhj9+AT3oJrOitdat263UcT5+5Y MOwRonz7CF+WByvpwcz2H7s5BUIBiu+xya1e30KjhDp1i3wQuCnwaAi43YAqDzGw57L/ +KgQ== Received: by 10.220.107.74 with SMTP id a10mr20659023vcp.20.1353958043629; Mon, 26 Nov 2012 11:27:23 -0800 (PST) Received: from mavbook.mavhome.dp.ua (cpe-67-244-107-195.nyc.res.rr.com. [67.244.107.195]) by mx.google.com with ESMTPS id t12sm8726244vdi.18.2012.11.26.11.27.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 11:27:23 -0800 (PST) Sender: Alexander Motin Message-ID: <50B3C299.1040809@FreeBSD.org> Date: Mon, 26 Nov 2012 21:27:21 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Adam McDougall Subject: Re: Samsung SSD 840 PRO fails to probe References: <50B3BA46.7030000@egr.msu.edu> In-Reply-To: <50B3BA46.7030000@egr.msu.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2012 19:27:25 -0000 Hi. On 26.11.2012 20:51, Adam McDougall wrote: > My co-worker ordered a Samsung 840 PRO series SSD for his desktop but we > found 9.0-rel would not probe it and 9.1-rc3 shows some errors. I got > past the problem with a workaround of disabling AHCI mode in the BIOS > which drops it to IDE mode and it detects fine, although runs a little > slower. Is there something I can try to make it probe properly in AHCI > mode? We also tried moving it to the SATA data and power cables from > the working SATA HD so I don't think it is the port or controller > driver. The same model motherboard from another computer did the same > thing. Thanks. > > dmesg line when it is working: > ada0: ATA-9 SATA 3.x device > > dmesg lines when it is not working: (hand transcribed from a picture) > (aprobe0:ahcich0:0:0): SETFEATURES ENABLE SATA FEATURE. ACB: ef 10 00 00 > 00 40 00 00 00 00 05 00 > (aprobe0:ahcich0:0:0): CAM status: ATA Status Error > (aprobe0:ahcich0:0:0): ATA status: 51 (DRDY SERV ERR), error: 04 (ABRT ) > (aprobe0:ahcich0:0:0): RES: 51 04 00 00 00 40 00 00 00 00 00 > (aprobe0:ahcich0:0:0): Retrying command > (aprobe0:ahcich0:0:0): SETFEATURES ENABLE SATA FEATURE. ACB: ef 10 00 00 > 00 40 00 00 00 00 05 00 > (aprobe0:ahcich0:0:0): CAM status: ATA Status Error > (aprobe0:ahcich0:0:0): ATA status: 51 (DRDY SERV ERR), error: 04 (ABRT ) > (aprobe0:ahcich0:0:0): RES: 51 04 00 00 00 40 00 00 00 00 00 > (aprobe0:ahcich0:0:0): Error 5, Retries exhausted I believe that is SSD's firmware bug. Probably it declares support for SATA Asynchronous Notifications in its IDENTIFY data, but returns error on attempt to enable it. Switching controller to legacy mode disables that functionality and so works as workaround. Patch below should workaround the problem from the OS side: --- ata_xpt.c (revision 243561) +++ ata_xpt.c (working copy) @@ -745,6 +745,14 @@ probedone(struct cam_periph *periph, union ccb *do goto noerror; /* + * Some Samsung SSDs report supported Asynchronous Notification, + * but return ABORT on attempt to enable it. + */ + } else if (softc->action == PROBE_SETAN && + status == CAM_ATA_STATUS_ERROR) { + goto noerror; + + /* * SES and SAF-TE SEPs have different IDENTIFY commands, * but SATA specification doesn't tell how to identify them. * Until better way found, just try another if first fail. -- Alexander Motin