Message ID | 1617889760-17733-1-git-send-email-liulongfang@huawei.com |
---|---|
Headers | show |
Series | USB:ehci:fix the no SRBN register problem | expand |
On Thu, Apr 08, 2021 at 09:49:19PM +0800, Longfang Liu wrote: > Some types of EHCI controllers do not have SBRN registers. > By comparing the white list, the operation of reading the SBRN > registers is skipped. > > Subsequent EHCI controller types without SBRN registers can be > directly added to the white list. > > The current patch does not affect the drive function. > > Signed-off-by: Longfang Liu <liulongfang@huawei.com> > --- > drivers/usb/host/ehci-pci.c | 28 ++++++++++++++++++++++++---- > 1 file changed, 24 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c > index 3c3820a..534e906 100644 > --- a/drivers/usb/host/ehci-pci.c > +++ b/drivers/usb/host/ehci-pci.c > @@ -47,6 +47,29 @@ static inline bool is_bypassed_id(struct pci_dev *pdev) > return !!pci_match_id(bypass_pci_id_table, pdev); > } > > +static const struct usb_nosbrn_whitelist_entry { Again, please do not use the term "whitelist", it is vague and you can pick a better term for this. How about: struct ehci_nosbrn; thanks, greg k-h
On 2021/4/8 22:53, Alan Stern wrote: > On Thu, Apr 08, 2021 at 09:49:18PM +0800, Longfang Liu wrote: >> (1) Add a whitelist for EHCI devices without SBRN registers. >> (2) Add Kunpeng920's EHCI device to the whitelist. >> >> Changes in v2: >> - Fix some code style issues. >> - Update function name. >> >> Longfang Liu (2): >> USB:ehci:Add a whitelist for EHCI controllers >> USB:ehci:fix Kunpeng920 ehci hardware problem >> >> drivers/usb/host/ehci-pci.c | 30 ++++++++++++++++++++++++++---- >> 1 file changed, 26 insertions(+), 4 deletions(-) > > I don't think we need a whole list, along with an associated lookup > routine, when there are only two entries. The total amount of code will > be smaller if you just add a check for the Kunpeng920 controller to > the existing check for the STMICRO controller. > > Alan Stern > . > Now there are two EHCI controllers that do not have SBRN registers, and there may be more in the future. This list is added for subsequent compatibility if there are such controllers, instead of a series of if-else. Thanks. Longfang.
On Fri, Apr 09, 2021 at 10:42:35AM +0800, liulongfang wrote: > On 2021/4/8 22:53, Alan Stern wrote: > > On Thu, Apr 08, 2021 at 09:49:18PM +0800, Longfang Liu wrote: > >> (1) Add a whitelist for EHCI devices without SBRN registers. > >> (2) Add Kunpeng920's EHCI device to the whitelist. > >> > >> Changes in v2: > >> - Fix some code style issues. > >> - Update function name. > >> > >> Longfang Liu (2): > >> USB:ehci:Add a whitelist for EHCI controllers > >> USB:ehci:fix Kunpeng920 ehci hardware problem > >> > >> drivers/usb/host/ehci-pci.c | 30 ++++++++++++++++++++++++++---- > >> 1 file changed, 26 insertions(+), 4 deletions(-) > > > > I don't think we need a whole list, along with an associated lookup > > routine, when there are only two entries. The total amount of code will > > be smaller if you just add a check for the Kunpeng920 controller to > > the existing check for the STMICRO controller. > > > > Alan Stern > > . > > > Now there are two EHCI controllers that do not have SBRN registers, > and there may be more in the future. This list is added for subsequent > compatibility if there are such controllers, instead of a series of if-else. Why would more people create new EHCI controllers these days with the cheapness of USB 3 cores? Anyway, let us worry about that if this list gets "too long", a simple if statement is fine for now. thanks, greg k-h