From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752624AbbJJT3c (ORCPT ); Sat, 10 Oct 2015 15:29:32 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56986 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbbJJT33 (ORCPT ); Sat, 10 Oct 2015 15:29:29 -0400 Subject: Re: [PATCH] nouveau: fix OpenFirmware support To: Ilia Mirkin References: <1444483668-5278-1-git-send-email-laurent@vivier.eu> Cc: "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Ben Skeggs , Dave Airlie From: Laurent Vivier X-Enigmail-Draft-Status: N1110 Message-ID: <5619670F.9080800@vivier.eu> Date: Sat, 10 Oct 2015 21:29:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:vtWxnjp24IbSXyTPA/0E+FL0JiLb2pF8PAUZ4xwz8S4opxIKFTv c02F1sVgzRskNIJhOCPwPCmTj/vw+Lei8LOwwsPrpwySHG8viqWoglFmWqg8xQ9S2hi3ddy 2QE8ujsb+TldG0zBs6j7bdSRxjWIgBXlk8CZZwsM1dR5qzYLgpQ6MZT313xbwi4fDfLgTui 3YfLFRHgib9W648AAUb6A== X-UI-Out-Filterresults: notjunk:1;V01:K0:5AbWI7jP9l8=:0Dgi8UDwg8zQ/+vW+lJCj7 WE7CoWNI5K8lVl/tJXE8CTUD6pDTl/HTWgLsS7pc39HM7kIRYDSZRnqZ+ivEHRY+/wO2d1RJ5 nAiNj3fPXgmeYPbDorUHicgDC3+ypL14QFyqvn9S0CLxvuBb1KcvXS+97bRMIt241ZC1xMtR0 pnedaXZJ2StiLjPKTfDJtq4JZfdtPSDRTgGdzqjlK25xCq1Yqs2Uq9mUhDTI3MKX+VR91dUkM i5ou5olskGSfCdzU7JKNlhRGRXnniTZdy7dbVC89c0H4wNotbMJqTnmcVBjjoREr/mswLZFGx aMYiooehqpeylX86S84NyGzUe4TJKXOLbYmdx63O+CpZvplTcPWA8fcx8lkunf77yUesDtupa Beaf09ugHEGrqv3B/YtC49nTexcCbAp7FlIYKCDwodHRUmO01OkXusm2/ahcxKONqWZtzMMck iTClsd8ecrhU6S8yAIz+KC4i3SUWA8wAch/MTyx1ebgKJgt82YQZC+XJ2BoAtg5Vm0BnNsl5s SroBZsObqL+HA6qa27hRjND5Khz4Qtf9V08DKndGH1s2p76KQZKOPN7kKaQKZgJSpjfc1ydYg jhChU0S3HkGadaEQ1KpoXCu+YUO4KGOBvwlkTQGO08XsnMNE3Y5dpKqs+aNLOxcs7EK4IbZ+z BoOfGXXQA02260iXEwH4GVdQ7AFWBD1/4u1VXSFUpmnXTu59YBESKEioAWAQ8S93V7UdmhHpp 2dG+d+vDsay7438y Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 10/10/2015 20:41, Ilia Mirkin a écrit : > Hi Laurent, > > On Sat, Oct 10, 2015 at 9:27 AM, Laurent Vivier wrote: >> On PowerMac G5 (and I think on all OpenFirmware platforms), nvbios_pcirTp() >> returns NULL. But in fact the OpenFirmware has given us the size >> we can store in image->size. >> >> This size is stored in bios->size by of_init() as there is no way >> to retrieve it otherwise. And as we know the size, copy all data >> to bios->data. >> >> Tested on PowerMac G5 with 64bit kernel and a NV43 card (GeForce 6600 LE). > > Can you give this patch a shot instead? > > http://cgit.freedesktop.org/~darktama/nouveau/commit/?id=794a63cc75eada9ad6b2a0275c1c8c4d3522864f Well, I think mine is also a good solution and it is much more simple. ;) ... because it is useless to add a size() function if we can directly copy the content/size of the bios in bios->data and bios->size. We can do that because we have the size of the property, which is not the case when we discover the BIOS directly from a PCI ROM or from ACPI (this is why we need a shadow, I think). For pcir part, I think we can just ignore the result and take the size from bios->size, as in the case of non openfirmware bios->size will be 4 (we have only shadowed the first word to read the id, 0xaa55) and then the checksum and others ID searches will fail. So I think the checksum should not be ignored. I've tried to restore behavior before commit: 7af4dec drm/nouveau/bios: use size/type from pci data structure and commit: ad4a362 drm/nouveau/bios: split out shadow methods Originally, openfirmware content was copied directly into bios->data: 77145f1 drm/nouveau: port remainder of drm code, and rip out compat layer > This resolved my issues on a PPC G5 + NV34. I think mine ran into a > few additional problems that you didn't see -- no PCIR header and > invalid checksum. I have no PCIR header too. Could you send me the content of the file "NVDA,BMP" you can find somewhere under /proc/device-tree/ ? Could you try my patch on your system, please ? Laurent