From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VFpgv-0007uu-6l for mharc-grub-devel@gnu.org; Sat, 31 Aug 2013 14:14:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFpgl-0007td-Lw for grub-devel@gnu.org; Sat, 31 Aug 2013 14:14:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFpgd-0004CJ-7f for grub-devel@gnu.org; Sat, 31 Aug 2013 14:14:23 -0400 Received: from smtp.volny.cz ([2001:4de8:71c:62::33]:57821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFpgc-0004CC-To for grub-devel@gnu.org; Sat, 31 Aug 2013 14:14:15 -0400 Received: from [192.168.6.11] (unknown [193.86.90.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: starous@volny.cz) by smtp.volny.cz (Postfix) with ESMTPSA id 22381260B0E for ; Sat, 31 Aug 2013 20:14:13 +0200 (CEST) Message-ID: <5222327B.7090103@volny.cz> Date: Sat, 31 Aug 2013 20:14:19 +0200 From: =?windows-1252?Q?Ale=9A_Nesrsta?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Thunderbird/17.0.8 MIME-Version: 1.0 To: The development of GNU GRUB Subject: [PATCH] Re: Missing USB devices. References: <20130807201137.08332daf@opensuse.site> <520534A0.4030009@volny.cz> <52056C1F.5070003@volny.cz> <521D0A45.5000407@volny.cz> <522231B0.8080106@volny.cz> In-Reply-To: <522231B0.8080106@volny.cz> Content-Type: multipart/mixed; boundary="------------030801020008030600030408" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4de8:71c:62::33 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2013 18:14:32 -0000 This is a multi-part message in MIME format. --------------030801020008030600030408 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sorry, I missed the patch... :-) There it is. > 28.8.2013 08:59, Melki Christian (consultant) wrote: >> I'm thinking of the EHCI hand-over. In the case of EHCI handover >> beeing successful within the timeout, you never clear the USBLEGCTLSTS >> register (SMI's). You do that in the other cases however. Why? I can >> not think of any case of a successful handover with SMI's still >> enabled. To what purpose? A buggy BIOS would maybe act upon such >> stuff? Maybe thats a case for lost devices etc? > Ok, I made a short look into Linux USB source code and I saw there is > USBLEGCTLSTS register reset in any case. > (What is maybe more interesting, Linux driver DOES NOT handover on some > (broken) devices, only reset SMI...) > > So I prepared simple "SMI" patch (attached). > > BR, > Ales --------------030801020008030600030408 Content-Type: text/x-patch; name="usb_patch_130831.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="usb_patch_130831.diff" diff -purB ./grub/grub-core/bus/usb/ehci.c ./grub_patched/grub-core/bus/usb/ehci.c --- ./grub/grub-core/bus/usb/ehci.c 2013-05-12 23:15:17.857567000 +0200 +++ ./grub_patched/grub-core/bus/usb/ehci.c 2013-08-31 20:00:54.846788313 +0200 @@ -716,7 +716,7 @@ grub_ehci_pci_iter (grub_pci_device_t de usblegsup = grub_pci_read (pciaddr_eecp); if (usblegsup & GRUB_EHCI_BIOS_OWNED) { - grub_boot_time ("Taking ownership of EHCI port"); + grub_boot_time ("Taking ownership of EHCI controller"); grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: EHCI owned by: BIOS\n"); /* Ownership change - set OS_OWNED bit */ @@ -737,13 +737,8 @@ grub_ehci_pci_iter (grub_pci_device_t de grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED); /* Ensure PCI register is written */ grub_pci_read (pciaddr_eecp); - /* Disable SMI. */ - pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4); - grub_pci_write (pciaddr_eecp, 0); - /* Ensure PCI register is written */ - grub_pci_read (pciaddr_eecp); } - grub_boot_time ("Ownership of EHCI port taken"); + grub_boot_time ("Ownership of EHCI controller taken"); } else if (usblegsup & GRUB_EHCI_OS_OWNED) /* XXX: What to do in this case - nothing ? Can it happen ? */ @@ -758,14 +753,15 @@ grub_ehci_pci_iter (grub_pci_device_t de grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED); /* Ensure PCI register is written */ grub_pci_read (pciaddr_eecp); - /* Disable SMI, just to be sure. */ - pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4); - grub_pci_write (pciaddr_eecp, 0); - /* Ensure PCI register is written */ - grub_pci_read (pciaddr_eecp); } } + /* Disable SMI, just to be sure. */ + pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4); + grub_pci_write (pciaddr_eecp, 0); + /* Ensure PCI register is written */ + grub_pci_read (pciaddr_eecp); + grub_dprintf ("ehci", "inithw: EHCI grub_ehci_pci_iter: ownership OK\n"); /* Now we can setup EHCI (maybe...) */ --------------030801020008030600030408--