From nobody Sat Dec 21 16:15:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1662006619788928.8571059890678; Wed, 31 Aug 2022 21:30:19 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 7461120FEA; Thu, 1 Sep 2022 04:30:13 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 85D15202F0 for ; Thu, 1 Sep 2022 04:29:55 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) for ; Wed, 31 Aug 2022 21:29:55 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.gmail.com with ESMTPSA id j24-20020aa7c0d8000000b0043cab10f702sm604387edp.90.2022.08.31.21.29.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 21:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=5gdb6Uix7pRN5UboCCVljem1X8ZtDe2gUN4xcSXYQgE=; b=CKH+I6z0PnmW/s+VuO7PZrMAk1LNnIQ+dxmtvS09n4sgKrzKPfp6Ft9TAWsEGoQBi1 k8+p29lVPfbzQt0xFnoMJDujBNGffHzR0DluuWgb8fJpf/A7+qo3eoLrEYVSMTgtybPY WSXhdLzrgixhMzXrIuSz8bT5YbppKo91wso6wOfZkUEtOfKXqavj9gVVyIYpNBfljtnK h4IlwMgOvWo/exD9QljUl1ZFuH4Z7zsV/uhMtuJ5Wd9s0UEXOdIzkDs5qK4Q+0hpNecx dj/22wQle+wilHucqBzhvaDB4NuISbRv9URmhgPOYEtC4BFY0Mrg6LzlwSzFbvFlKmjP jlpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=5gdb6Uix7pRN5UboCCVljem1X8ZtDe2gUN4xcSXYQgE=; b=ElFo5GEWgV+S2fQmjCGa+u9wItvb6Wn5IXiNWjdCiMPxTWlcHfsV/bZUcVNDIo3PSV 2eALFLarcYOWUuIKsnd+KHB8rMDHXcHr/RFxcwQwKrbseoVeWJQ+X+aMcqHXTTE/Upx0 FfYur580Hhw7GOEeBEUiIBa1LSWTH0USVuSyjZ7jmCrGDz/UGlZ4Jz124S5KqLYUDSND zSxAzC50zQ/r1SAD3JpoY3TrrIEudxoM4FzAmWoG3tj1IfAb+YihzQCBNRPqmmR2hFyV xHDC3oHKktchWN2Wgjf7SsytwIS55AhAmOT2oBD9H7aPbi/yvI/adyWWrri+VTwoXVz6 0ihw== X-Gm-Message-State: ACgBeo1C2NYy4aFJyEHlGwVWgGBc+T9GmZV4TPb0cAm7EYXQ9YnZSE5U eReZgAkqwI8OMuhDNMrj/C84ti0Bv98= X-Google-Smtp-Source: AA6agR56VkTArjfkGeAWedfby9LWYmMRXPVZ2F9HbvgST0FXyiTTc7omzx4sTxSJglaq9osqRKCRiw== X-Received: by 2002:a17:907:c15:b0:741:a052:452b with SMTP id ga21-20020a1709070c1500b00741a052452bmr10976818ejc.723.1662006595006; Wed, 31 Aug 2022 21:29:55 -0700 (PDT) Message-ID: <09bd0f27-fcbf-db75-3ca8-eb791944d352@gmail.com> Date: Thu, 1 Sep 2022 06:28:41 +0200 MIME-Version: 1.0 Content-Language: en-US From: Petr Cvek To: seabios@seabios.org References: <9c33fd7b-ce4b-19a4-b76e-25937d66436f@gmail.com> In-Reply-To: <9c33fd7b-ce4b-19a4-b76e-25937d66436f@gmail.com> Message-ID-Hash: 5FQYQ3ZVUGXTVTREW57QCYD27AR4WANY X-Message-ID-Hash: 5FQYQ3ZVUGXTVTREW57QCYD27AR4WANY X-MailFrom: petrcvekcz@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] Re: [BUG] Could not read from CDROM (code 0003) List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1662006620990100001 Content-Type: text/plain; charset="utf-8" OK a fix has been found. It seems ahci_command() doesn't correctly handle the situation, where buffe= r =3D=3D NULL.=20 It sets one cmd->prdt[0] entry and the AHCI hardware will probably either t= ry to access NULL pointer or will just wait indefinitely on data. NULL pointer is used i= n ATAPI command cdb_test_unit_ready() and any subsequent command will get stuck. Not setting any prd entry seems to fix the problem. Patch looks like that (= but I don't know=20 how much clean solution is it).=20 diff --git a/src/hw/ahci.c b/src/hw/ahci.c index d45b430..fbe1cec 100644 --- a/src/hw/ahci.c +++ b/src/hw/ahci.c @@ -117,7 +117,7 @@ static int ahci_command(struct ahci_port_s *port_gf, in= t iswrite, int isatapi, cmd->prdt[0].baseu =3D 0; cmd->prdt[0].flags =3D bsize-1; - flags =3D ((1 << 16) | /* one prd entry */ + flags =3D (((buffer?1:0) << 16) | /* one prd entry */ (iswrite ? (1 << 6) : 0) | (isatapi ? (1 << 5) : 0) | (5 << 0)); /* fis length (dwords) */ If this code is OK I will send the patch in a new thread. There may be similar problem for PATA/IDE controller, but I didn't test it = yet. Petr Dne 14. 07. 22 v 6:36 Petr Cvek napsal(a): > Hello, >=20 > I've tried to boot a coreboot supported machine (Kontron 986lcd-m) from C= D and it hangs. >=20 > The drive is correctly identified (AHCI ATAPI). >=20 > Petr >=20 > Log follows: >=20 > Booting from DVD/CD... > scsi_is_ready (drive=3D0x000f5820) > disk_op d=3D0x000f5820 lba=3D0 buf=3D0x00000000 count=3D0 cmd=3D32 > AHCI/2: send cmd ... > AHCI/2: ... intbits 0x1, status 0x50 ... > AHCI/2: ... finished, status 0x50, OK > disk_op d=3D0x000f5820 lba=3D17 buf=3D0x000067a8 count=3D1 cmd=3D2 > AHCI/2: send cmd ... > handle_08 > handle_hwpic1 irq=3D1 >=20 > ... repeats ... >=20 > handle_08 > handle_hwpic1 irq=3D1 > WARNING - Timeout at ahci_command:153! > Boot failed: Could nothandle_08 > handle_hwpic1 irq=3D1 > read from CDROM (code 0003) > enter handle_18: > NULL > Booting from Hard Disk... > enter handle_13: > a=3D00000201 b=3D00000000 c=3D00000001 d=3D00000080 ds=3D0000 es=3D= 07c0 ss=3D9000 > si=3D00000000 di=3D00000000 bp=3D00000000 sp=3D0000ffd6 cs=3Df000 ip=3D= ca99 f=3D0202 > disk_op d=3D0x000f5870 lba=3D0 buf=3D0x00007c00 count=3D1 cmd=3D2 > AHCI/1: send cmd ... > AHCI/1: ... intbits 0x1, status 0x50 ... > AHCI/1: ... finished, status 0x50, OK > ahci disk read, lba 0, count 1, buf 0x00007c00, rc 0 > Booting from 0000:7c00 >=20 > ... continues with sata hdd ... _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org