All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes
Date: Tue, 21 Aug 2018 06:30:50 +0200	[thread overview]
Message-ID: <8c47a8b1-13ea-d0b1-cca2-a4d51bc566a4@gmail.com> (raw)
In-Reply-To: <CAEUhbmUUhO9vQ-1B9X0WhiZRHXuPkHawT3dWjkwf_pSjeJ_tcA@mail.gmail.com>

On 08/21/2018 06:15 AM, Bin Meng wrote:
[...]

>>>>>> From what I understand, Marek and Bin are discussing whether a
>>>>>> compatible string is needed to bind a driver.
>>>>>>
>>>>>> Generally it is. But with PCI and USB we have a search mechanism which
>>>>>> can be used instead.
>>>>>>
>>>>>> The patch Marek submitted does not seems at all desirable to me.
>>>>>
>>>>> Can you explain why ?
>>>>
>>>> We already have a compatible string as the standard way to attach
>>>> drivers to devices.
>>>>
>>>> For PCI, we already have PCI_DEVICE() and friends for when we can
>>>> attach a driver for a PCI device without using a compatible string.
>>>>
>>>> Both of these are defined in the DT specification.
>>>>
>>>> The patch seems to be a rework of PCI_DEVICE() and I cannot why it is necessary.
>>>>
>>>>>
>>>>>> I would like to see what Bin proposes.
>>>>>
>>>>> Me too, so far I only see "not Marek's patch" and no real alternative.
>>>>
>>>> Bin, do you have a patch you can share?
>>>
>>> No, I don't have any patch series for now, although I offered to work
>>> on a series to implement my proposal. I haven't started it as I wanted
>>> to hear your thoughts. The proposal I made is to satisfy the
>>> requirement that Marek insisted on. Basically Marek thought current DM
>>> PCI implementation is wrong to ask for a "compatible" string of a PCI
>>> device in the device tree, because he thought adding "compatible" to
>>> DT is invalid and Linux does not do that either. While I disagree we
>>> have to 100% follow Linux's implementation, I am still open for any
>>> possible design changes, if that's the preferable practice in U-Boot
>>> (but we have to make it clear and document this officially somewhere).
>>>
>>> The proposal I made is:
>>>
>>> * Keep pci-uclass driver's post_bind() and child_post_bind() only for
>>> Sandbox configuration
>>> * Keep the call to pci_bus_find_devfn() in pci_bind_bus_devices() only
>>> for Sandbox configuration
>>> * Sandbox is special. We should limit the mechanism of matching PCI
>>> emulation device via "compatible" to sandbox only
>>
>> The above three points can be done separately and I don't care about
>> this too much.
>>
> 
> That's my concern. Only doing this created confusing and incomplete
> design.

Incomplete how ?

> Yes, you probably don't care about this. But I care about this
> as it impacts some other things like PCI uart driver which is used by
> some x86 boards.

Sandbox changes impact PCI UART driver and x86 boards how ?

>>> * Assign the DT node to the bound device in pci_find_and_bind_driver()
>>> if there is a valid PCI "reg" encoding for a specific PCI device in
>>> the device tree
>>
>> This is what this patch does. And in fact, I have real hardware which
>> needs this patch to be useful and on which I can test if this works.
>>
> 
> You can do this in your own fork. Nothing prevents you from doing that.

I am at loss for words, really.

>>> * Create DM PCI test case against the DT node assignment
>>> * Remove all compatible string in U-Boot's PCI device drivers: eg:
>>> ehci_pci_ids[], xhci_pci_ids[], etc. IOW, all PCI device drivers
>>> should only use U_BOOT_PCI_DEVICE(), aka the original U-Boot option 2
>>> * Fork a "pci-ns16550" driver to support U_BOOT_PCI_DEVICE(), as
>>> currently PCI ns16550 device driver uses "compatible" string to do the
>>> matching, and update crownbay.dts and galileo.dts (so far I only know
>>> two boards are using PCI ns16550 serial port)
>>> * Make sure all DM PCI test cases are not broken
>>> * Document all of the above changes in doc/driver-model/pci-info.txt
>>
>> I think you're just adding completely orthogonal stuff to this 5-liner
>> patch into the list and overly complicate the situation. Sure, if you
>> want to do all this, go ahead, but I don't see how this prevents this
>> particular patch from being applied , except maybe for the documentation
>> tweak.
> 
> Please, think from the maintainer perspective. It's nothing related to
> number of LOCs. It's that we need create a clean design. You probably
> don't want someone just submits a single patch that changed current
> USB design without a full consideration on all possible impacts.

OK, after reading all this, what I gather from the discussion is that
this patch somehow breaks the design or the other platforms, which is
why you fight against it so much. Does it, yes or no? And if so, you
still failed to explain how, so, how ?

Improving sandbox and x86 PCI handling is orthogonal to this change, so
are ns16550 driver improvements and if you want to work on them, nothing
prevents you from doing so.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-08-21  4:30 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 13:03 [U-Boot] [PATCH] pci: Support parsing PCI controller DT subnodes Marek Vasut
2018-08-08 13:14 ` Bin Meng
2018-08-08 13:24   ` Marek Vasut
2018-08-08 13:39     ` Bin Meng
2018-08-08 14:33       ` Marek Vasut
2018-08-08 15:32         ` Bin Meng
2018-08-08 19:37           ` Marek Vasut
2018-08-08 23:24             ` Bin Meng
2018-08-09  0:36               ` Marek Vasut
2018-08-09  2:37                 ` Bin Meng
2018-08-09  7:54                   ` Marek Vasut
2018-08-09  9:41                     ` Bin Meng
2018-08-09 10:25                       ` Marek Vasut
2018-08-10  3:42                         ` Bin Meng
2018-08-10 10:32                           ` Marek Vasut
2018-08-13  2:07                             ` Bin Meng
2018-08-13 13:39                               ` Tom Rini
2018-08-13 16:07                                 ` Marek Vasut
2018-08-13 17:16                                   ` Tom Rini
2018-08-14  2:34                                     ` Bin Meng
2018-08-14  8:54                                       ` Marek Vasut
2018-08-14  9:35                                         ` Bin Meng
2018-08-15  9:20                                           ` Marek Vasut
2018-08-14 19:39                                       ` Tom Rini
2018-08-13 13:43                               ` Marek Vasut
2018-08-10 12:01             ` Tom Rini
2018-08-10 12:38               ` Marek Vasut
2018-08-13  2:24                 ` Bin Meng
2018-08-13 13:46                   ` Marek Vasut
2018-08-14  1:46                     ` Bin Meng
2018-08-14  8:55                       ` Marek Vasut
2018-08-14  9:40                         ` Bin Meng
2018-08-15  9:22                           ` Marek Vasut
2018-08-15 10:19                             ` Bin Meng
2018-08-15 10:27                               ` Marek Vasut
2018-08-15 11:25                               ` Tom Rini
2018-08-16 11:47                                 ` Marek Vasut
2018-08-17  1:51                                   ` Bin Meng
2018-08-17 10:27                                     ` Marek Vasut
2018-08-20  7:18                                       ` Bin Meng
2018-08-20  8:09                                         ` Marek Vasut
2018-08-20 16:57                                     ` Simon Glass
2018-08-20 18:42                                       ` Marek Vasut
2018-08-20 19:29                                         ` Simon Glass
2018-08-20 20:15                                           ` Marek Vasut
2018-08-22 18:08                                             ` Simon Glass
2018-08-22 20:19                                               ` Marek Vasut
2018-08-23 10:45                                                 ` Simon Glass
2018-08-23 12:58                                                   ` Marek Vasut
2018-08-30  0:29                                                     ` Simon Glass
2018-08-30  9:25                                                       ` Marek Vasut
2018-09-01 21:45                                                         ` Simon Glass
2018-09-01 22:43                                                           ` Marek Vasut
2018-09-02  1:07                                                             ` Simon Glass
2018-09-02 18:24                                                               ` Marek Vasut
2018-09-02 23:35                                                                 ` Simon Glass
2018-09-03  0:53                                                                   ` Marek Vasut
2018-08-21  3:46                                           ` Bin Meng
2018-08-21  4:02                                             ` Marek Vasut
2018-08-21  4:15                                               ` Bin Meng
2018-08-21  4:30                                                 ` Marek Vasut [this message]
2018-08-21  4:56                                                   ` Bin Meng
2018-08-21  5:43                                                     ` Marek Vasut
2018-08-21  7:16                                                       ` Bin Meng
2018-08-21 10:28                                                         ` Marek Vasut
2018-08-22  2:14                                                           ` Bin Meng
2018-08-22  9:57                                                             ` Marek Vasut
2018-08-23  2:11                                                               ` Bin Meng
2018-08-23  7:42                                                                 ` Marek Vasut
2018-08-21 17:32                                             ` Simon Glass
2018-08-21 18:26                                               ` Marek Vasut
2018-08-21 18:29                                                 ` Simon Glass
2018-08-21 18:56                                                   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c47a8b1-13ea-d0b1-cca2-a4d51bc566a4@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.