Messages in this thread | | | Date | Sun, 14 May 2017 10:38:19 +0200 | From | Anatolij Gustschin <> | Subject | Re: [PATCH v4] fpga manager: Add Altera CvP driver |
| |
On Wed, 3 May 2017 18:01:19 +0300 Andy Shevchenko andy.shevchenko@gmail.com wrote: ... >> when 12 LSBs are zero, the bytes value has been decremented by >> 4k, meaning that a new 4k data block has been written. Only >> then the error checking is performed. > >If the size is less than 4k...?
then the final check below will catch it. And I doubt that config images can be so small. The lowest size I've ever seen is more than 1MiB.
... >>>> pci config space access works without enabling the pci device, >>>> writing commands to config space enables the device first. It is done >>>> some lines below which you deleted when commenting (please see original >>>> patch). >>> >>>Your comment didn't clarify what's going on along these lines. >>> >>>I checked original patch, I didn't find any type of >>>pci_enable_device() call. >> > >> I mean this part (instead of pci_enable_device()): > >> + /* Enable memory BAR access */ >> + pci_read_config_word(pdev, PCI_COMMAND, &cmd); >> + if (!(cmd & PCI_COMMAND_MEMORY)) { >> + cmd |= PCI_COMMAND_MEMORY; >> + pci_write_config_word(pdev, PCI_COMMAND, cmd); >> + } > >I see this code is used somewhere else (several places I suppose, >drivers/video/fbdev/aty/atyfb_base.c is one of them).
other places set or clean additional pci command flags, use different pci config accessors or contain debug code. And I reuse pre-initialized cmd in the error path, so the usage pattern here is not the same as in the atyfb_base driver.
-- Anatolij
| |