From owner-freebsd-stable@freebsd.org Thu Dec 29 10:33:00 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6368BC95C85 for ; Thu, 29 Dec 2016 10:33:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E78D710BE for ; Thu, 29 Dec 2016 10:32:59 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id c85so27646911wmi.1 for ; Thu, 29 Dec 2016 02:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=X61WHjV7A4Gr+0BkOhNljfTkx+ZpE6r8TEEWzwBhqgQ=; b=TojAY//EJElO9d1ZTcIqa59/M5JpokUi3Z0kcpK0kLLw3Zmlp/xNZUjRHEig2he5rY TSUEP8yPSjc9c1SBqXmyT4S0H4h0EU2TUf7z2pGTgD1NnOUf1yJRrgJbyrhbssvAbEwh RqOyTbLJ51NmWixvhJ7rPA900lzKK4s/8ZyYxZG+f1wnBEUWumR2mT/01HQdA8vmaRc0 gT3pKmnaiICbWYIoBo8s5L2/7rSIg/099bIoO06p72J9Z1jTrmfJlwhj8WfPkdfITlvU u7AC3O9ai29Oqz/chcXuuZaWI3OEY3uAXcW/hQCS8pafOg9gVtgaZWiSBGyXwv0DfD2X rtHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=X61WHjV7A4Gr+0BkOhNljfTkx+ZpE6r8TEEWzwBhqgQ=; b=mC5bffIOkpN14EW0xRjKpvPBsFCa32teL+BkCUp5Ny0XKqYCnH+KS0q+yoGAdVvpGX Jpr71GeYnBRSY6+u2gawy5g2qWTkLzBaASB24fWZUDaBYPVTMPP117aSx+JeSVRwOd+x 5Y7AihqNXFFxAXUXM3GkTPxLCzhv8oCBrrlRu1ZggP/mMXI9Eld07Dvn5lq+HG6/Wg79 0aghk+SzQCvAEyagBe9EHWH69HQ45MXFpy0ccs8ADDgsZXUugG4iWiVQNFraGaWsSiUQ KNhFYX/VifipXRkyt5wWd3m/B3Mcr1cqvAcZlmjf3bxMJEYwG2YiltwQErBLUckOA6F3 mUmw== X-Gm-Message-State: AIkVDXJjyl+l0sa975WQT1Y36cxZ7aOV4e/MYhoyZDo8h+neLeQTUAjXq8yucTIcBrz/wQ== X-Received: by 10.28.22.193 with SMTP id 184mr36936504wmw.100.1483007578259; Thu, 29 Dec 2016 02:32:58 -0800 (PST) Received: from spectre.mavhome.dp.ua ([92.38.100.11]) by smtp.gmail.com with ESMTPSA id ua15sm68240243wjb.1.2016.12.29.02.32.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Dec 2016 02:32:57 -0800 (PST) Sender: Alexander Motin Subject: Re: ASM1062 AHCI timeouts, ppt(4) BAR aligning [Was: Re: svn commit: r309251 - head/sys/dev/ahci] To: Harry Schmalzbauer References: <201611281623.uASGNWoA056995@repo.freebsd.org> <5864CADD.6020805@omnilan.de> Cc: FreeBSD Stable From: Alexander Motin Message-ID: <8c37d73e-59dc-3ca2-cab0-941a525f4d44@FreeBSD.org> Date: Thu, 29 Dec 2016 12:32:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <5864CADD.6020805@omnilan.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2016 10:33:00 -0000 On 29.12.2016 10:35, Harry Schmalzbauer wrote: > I'd like to report that this doesn't fix timeouts for me (applied to > 11-stable). > > For example my REV120 works without problems on Intel-AHCI but not on > ASM1062-AHCI. > Even attaching gives different output. Both look fine at first: > # cd0 at ahcich0 bus 0 scbus5 target 0 lun 0 > # cd0: Removable CD-ROM SCSI device > # cd0: Serial Number 0C1E4D046E5DFF18 > # cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO > 8192bytes) > > When attached to the Intel-AHCI, it's followed by > + cd0: Attempt to query device size failed: NOT READY, Medium not present > while attaching to ASM1062 it reads (!?) > - cd0: 0MB (1 0 byte sectors) > > Then these timeouts occur: > ahcich7: Timeout on slot 11 port 0 > ahcich7: is 00000000 cs 00000c00 ss 00000000 rs 00000c00 tfd 6051 serr > 00000000 cmd 0004cb17 > ahcich7: Timeout on slot 24 port 0 > ahcich7: is 00000000 cs 01800000 ss 00000000 rs 01800000 tfd 2051 serr > 00000000 cmd 0004d817 > ahcich7: Timeout on slot 6 port 0 > ahcich7: is 00000000 cs 00000060 ss 00000000 rs 00000060 tfd 2051 serr > 00000000 cmd 0004c617 > ahcich7: Timeout on slot 20 port 0 > ahcich7: is 00000000 cs 00180000 ss 00000000 rs 00180000 tfd 2051 serr > 00000000 cmd 0004d417 > > Also IDENT (via camcontrol) "hangs" for 20 seconds, but finally succeeds. I think problem may be different in your case. The HBA still reports that command is not completed by the device. Unfortunately I don't have those fancy drives to try, but I'll try to reproduce it with regular CD drive when I get back home after short New Year holidays. > Btw: I already found out that extending ppt(4) to support unaligned base > address register wouldn't be too easy. > Initially I added that ASM1062 card to use it for byhve(8) passthrough. > Unfortunately that doesn't work: > bhyve: passthru device 6/0/0 BAR 5: base 0xc3e10000 or size 0x200 not > page aligned > That's the ASM1062: > ppt0@pci0:6:0:0: class=0x010601 card=0x10601b21 chip=0x06121b21 > rev=0x01 hdr=0x00 > bar [10] = type I/O Port, range 32, base 0x5050, size 8, enabled > bar [14] = type I/O Port, range 32, base 0x5040, size 4, enabled > bar [18] = type I/O Port, range 32, base 0x5030, size 8, enabled > bar [1c] = type I/O Port, range 32, base 0x5020, size 4, enabled > bar [20] = type I/O Port, range 32, base 0x5000, size 32, enabled > bar [24] = type Memory, range 32, base 0xc3e10000, size 512, enabled I believe it is bhyve bug, since these values are just what hardware reports. BAR size of 512 bytes indeed does not align to 4K, but that is not our problem. :) > Are there any recommendations for AHCI (SATA-PCIe) controller > cards/chips that do work (both, for byhve passthrough and also as plain > AHCI provider)? Please don't mix multiple unrelated questions in one email. There is very little reasonable external AHCI controllers on the market now. I am not sure anything other then Marvell and ASmedia were released at all in last years since 6Gbps SATA came out. Marvell and ASmedia probably worth each other, while later Marvell may be slightly better on functionality (number of ports and FBS PMP support), but they are both desktop products. If you need this in server environment -- think about about SAS adapter like LSI. Or just use on-board Intel AHCI, since they are probably the best om reliability you may get out of SATA. -- Alexander Motin