NetBSD Problem Report #49448

From kilbi@kilbi.de  Thu Dec  4 19:02:26 2014
Return-Path: <kilbi@kilbi.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9CB66A5B2E
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  4 Dec 2014 19:02:26 +0000 (UTC)
Message-Id: <20141204190218.9643464B6E@mail2.kilbi.de>
Date: Thu,  4 Dec 2014 20:02:18 +0100 (MET)
From: Markus Kilbinger <mk@kilbi.de>
Reply-To: mk@kilbi.de
To: gnats-bugs@NetBSD.org
Subject: sata disk no longer works on cubietruck under src/sys/dev/ic/ahcisata_core.c,v 1.52
X-Send-Pr-Version: 3.95

>Number:         49448
>Category:       port-evbarm
>Synopsis:       sata disk no longer work on cubietruck under src/sys/dev/ic/ahcisata_core.c,v 1.52
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-evbarm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 04 19:05:00 +0000 2014
>Closed-Date:    Thu Jan 21 11:57:08 +0000 2021
>Last-Modified:  Thu Jan 21 11:57:08 +0000 2021
>Originator:     mk@kilbi.de
>Release:        NetBSD 7.99.2
>Organization:
>Environment:


System: NetBSD ct 7.99.2 NetBSD 7.99.2 (CUBIETRUCK) #0: Thu Dec 4 17:40:51 MET 2014 root@q:/usr/NetBSD/HEAD/src/sys/arch/evbarm/compile/CUBIETRUCK evbarm
Architecture: earmv7hf
Machine: evbarm
>Description:
	Since src/sys/dev/ic/ahcisata_core.c,v 1.52

	  http://mail-index.netbsd.org/source-changes/2014/11/23/msg060829.html

	the sata disk on my cubietruck is no longer working / detected:

	  ahcisata0 at awinio0: AHCI SATA controller
	  ahcisata0: interrupting on irq 88
	  ahcisata0: AHCI revision 1.10, 1 port, 32 slots, CAP 0x6724ff80<CCCS,PSC,SSC,PMD,SAM,ISS=0x2=Gen2,SCLO,SAL,SALP,SSNTF,SNCQ>
	  atabus0 at ahcisata0 channel 0
	  [...]
	  ahcisata0 port 0: device present, speed: 3.0Gb/s
	  [...]
	  ahcisata0 channel 0: clearing WDCTL_RST failed for drive 0
	  boot device: <unknown>
	  unknown device major 0xffffffffffffffff

	Before / with v 1.51:

	  [...]
	  wd0 at atabus0 drive 0
	  wd0: <WDC WD10JFCX-68N6GN0>
	  wd0: drive supports 16-sector PIO transfers, LBA48 addressing
	  wd0: 931 GB, 1938021 cyl, 16 head, 63 sec, 512 bytes/sect x 1953525168 sectors
	  wd0: GPT GUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
	  dk0 at wd0: biosboot
	  [...]

>How-To-Repeat:
	Boot a -current / HEAD kernel (with ahcisata_core.c, 1.52) on
	a cubietruck which has a sata disk attached, and see how it
	fails to detect it.
>Fix:
	Unknown.
	Workaround: Revert to ahcisata_core.c,v 1.51

>Release-Note:

>Audit-Trail:
From: "Joerg Sonnenberger" <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49448 CVS commit: src/sys/dev/ic
Date: Thu, 4 Dec 2014 21:50:29 +0000

 Module Name:	src
 Committed By:	joerg
 Date:		Thu Dec  4 21:50:29 UTC 2014

 Modified Files:
 	src/sys/dev/ic: ahcisata_core.c

 Log Message:
 Increase reset delay in polling mode to 10ms per loop. It seems like
 AHCI on the Cubietruck doesn't like the tigther loop.

 PR 49448.


 To generate a diff of this commit:
 cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/ahcisata_core.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under src/sys/dev/ic/ahcisata_core.c,v 1.52
Date: Fri, 5 Dec 2014 09:13:14 +0100

 On Thu, Dec 04, 2014 at 07:05:00PM +0000, Markus Kilbinger wrote:
 > >How-To-Repeat:
 > 	Boot a -current / HEAD kernel (with ahcisata_core.c, 1.52) on
 > 	a cubietruck which has a sata disk attached, and see how it
 > 	fails to detect it.

 It works for me:

 ~] martin@space-truckin > ident /netbsd |fgrep ahcisata_core
      $NetBSD: ahcisata_core.c,v 1.52 2014/11/23 01:38:49 joerg Exp $
 ...
 ahcisata0 port 0: device present, speed: 3.0Gb/s
 ld0 at sdmmc0: <0x03:0x5344:SD04G:0x30:0x018bd22c:0x0d5>
 ld0: 3796 MB, 1928 cyl, 64 head, 63 sec, 512 bytes/sect x 7774208 sectors
 ld0: 4-bit width, bus clock 50.000 MHz
 wd0 at atabus0 drive 0
 wd0: <WDC WD3200KS-00PFB0>
 wd0: drive supports 16-sector PIO transfers, LBA48 addressing
 wd0: 298 GB, 620181 cyl, 16 head, 63 sec, 512 bytes/sect x 625142448 sectors
 wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
 wd0(ahcisata0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) (using DMA)
 boot device: <unknown>
 root device: wd0a

 But I see joerg already changed things again, so this seems to be disk
 specific.

 Martin

From: Markus Kilbinger <mk@kilbi.de>
To: gnats-bugs@netbsd.org
Cc: port-evbarm-maintainer@netbsd.org, gnats-admin@netbsd.org, 
	netbsd-bugs@netbsd.org, Markus Kilbinger <mk@kilbi.de>
Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under
 src/sys/dev/ic/ahcisata_core.c,v 1.52
Date: Fri, 5 Dec 2014 11:55:43 +0100

 2014-12-05 9:15 GMT+01:00 Martin Husemann <martin@duskware.de>:
 > The following reply was made to PR port-evbarm/49448; it has been noted by GNATS.
 >
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@NetBSD.org
 >
 >  It works for me:
 >
 >  wd0 at atabus0 drive 0
 >  wd0: <WDC WD3200KS-00PFB0>
 >  wd0: drive supports 16-sector PIO transfers, LBA48 addressing
 >  wd0: 298 GB, 620181 cyl, 16 head, 63 sec, 512 bytes/sect x 625142448 sectors
 > [...]
 >  But I see joerg already changed things again, so this seems to be disk
 >  specific.

 Interesting! Even joergs recent change (ahcisata_core .c v1.53) did
 _not_ help in my situation / with my sata disk which still is not
 correctly detected (get the same error as before).

 Any hint what to change to narrow down the problem?

 Markus.

From: Soren Jacobsen <snj@blef.org>
To: gnats-bugs@NetBSD.org
Cc: mk@kilbi.de
Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under
 src/sys/dev/ic/ahcisata_core.c,v 1.52
Date: Fri, 5 Dec 2014 11:11:56 -0800

 Have you tried using a dedicated power source for the drive?

 Soren

From: Markus Kilbinger <mk@kilbi.de>
To: gnats-bugs@netbsd.org
Cc: port-evbarm-maintainer@netbsd.org, gnats-admin@netbsd.org, 
	netbsd-bugs@netbsd.org, Markus Kilbinger <mk@kilbi.de>
Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under
 src/sys/dev/ic/ahcisata_core.c,v 1.52
Date: Sat, 6 Dec 2014 09:25:03 +0100

 2014-12-05 20:15 GMT+01:00 Soren Jacobsen <snj@blef.org>:
 > Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under
 >  src/sys/dev/ic/ahcisata_core.c,v 1.52
 > Date: Fri, 5 Dec 2014 11:11:56 -0800
 >
 >  Have you tried using a dedicated power source for the drive?

 Hmm, good point probably ... no, I haven't tried it (, yet).

 ATM ct and 2.5" sata disk are connected / supplied together from one
 single 5V/ 2.5A PSU. Maybe it's not sufficient (all the time).

 I wonder how to accomplish the separate power supply for the disk (I
 have no other 5V PSU available / at home).
 Would be a more powerful PSU (5V / 4A) replacement sufficient?

 Or would you recommend a complete separate PSU for the disk?

 Regards, Markus.

From: Takahiro HAYASHI <t.hash425@gmail.com>
To: mk@kilbi.de, gnats-bugs@netbsd.org
Cc: port-evbarm-maintainer@netbsd.org, gnats-admin@netbsd.org, 
 netbsd-bugs@netbsd.org
Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under
 src/sys/dev/ic/ahcisata_core.c,v 1.52
Date: Sat, 06 Dec 2014 17:44:01 +0900

 On 12/05/14 19:55, Markus Kilbinger wrote:
 > 2014-12-05 9:15 GMT+01:00 Martin Husemann <martin@duskware.de>:
 >> The following reply was made to PR port-evbarm/49448; it has been noted by GNATS.
 >>
 >> From: Martin Husemann <martin@duskware.de>
 >> To: gnats-bugs@NetBSD.org
 >>
 >>   It works for me:
 >>
 >>   wd0 at atabus0 drive 0
 >>   wd0: <WDC WD3200KS-00PFB0>
 >>   wd0: drive supports 16-sector PIO transfers, LBA48 addressing
 >>   wd0: 298 GB, 620181 cyl, 16 head, 63 sec, 512 bytes/sect x 625142448 sectors
 >> [...]
 >>   But I see joerg already changed things again, so this seems to be disk
 >>   specific.
 >
 > Interesting! Even joergs recent change (ahcisata_core .c v1.53) did
 > _not_ help in my situation / with my sata disk which still is not
 > correctly detected (get the same error as before).
 >
 > Any hint what to change to narrow down the problem?

 FYI.
 My Cubieboard2 with any revisions of ahcisata_core.c does not recognize
 my ST9500325AS 2.5inch hard drive (powerd from cb2 board) at boot, but
 it does by "drvctl -r -a ata_hl atabus0" after boot.
 I tried to increase 2nd arg of ahci_exit_fis() around WDCTL_RST
 from 100 to 3000, then my cb2 recognizes my ST9500325AS at boot.
 When this harddrive is powerd from external power supply, not from cb2,
 it is recognized at boot without modifying ahcisata_core.c.

 I changed power supply for my cb2 from 5V 3000mA to 5V 4A but
 same result.


 -- 
 t-hash

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-evbarm/49448: sata disk no longer works on cubietruck under
 src/sys/dev/ic/ahcisata_core.c,v 1.52
Date: Sat, 6 Dec 2014 10:45:29 +0100

 On Fri, Dec 05, 2014 at 11:00:01AM +0000, Markus Kilbinger wrote:
 >  Interesting! Even joergs recent change (ahcisata_core .c v1.53) did
 >  _not_ help in my situation / with my sata disk which still is not
 >  correctly detected (get the same error as before).

 It is a bit flacky with either version for me, so this seems to be a
 general problem with the AHCI chip.

 Joerg

State-Changed-From-To: open->feedback
State-Changed-By: jmcneill@NetBSD.org
State-Changed-When: Mon, 28 Dec 2020 14:10:35 +0000
State-Changed-Why:
I've made some more fixes in this area recently. Can you try a -current kernel?


State-Changed-From-To: feedback->closed
State-Changed-By: jmcneill@NetBSD.org
State-Changed-When: Thu, 21 Jan 2021 11:57:08 +0000
State-Changed-Why:
Feedback timeout; others have confirmed this issue is fixed in -current.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.