Re: [PATCH v10 0/6] Introduced new Cadence USBSS DRD Driver.

From: Pavel Machek
Date: Mon Jul 22 2019 - 17:00:26 EST


On Mon 2019-07-22 13:56:44, Pavel Machek wrote:
> Hi!
>
> > > >> This patch introduce new Cadence USBSS DRD driver to linux kernel.
> > > >>
> > > >> The Cadence USBSS DRD Controller is a highly configurable IP Core which
> > > >> can be instantiated as Dual-Role Device (DRD), Peripheral Only and
> > > >> Host Only (XHCI)configurations.
> > > >
> > > >I see you are using debugfs to select between DRD, peripheral-onlyh and XHCI...
> > > >
> > > >Is that good idea?
> > >
> > > Yes driver allows selecting dr_mode by debugfs. Controller also support such functionality
> > > so I don't understand why would it not be a good idea.
> > >
> > > I personally use this for testing but it can be used to limit controller functionality without
> > > recompiling kernel.
> >
> > debugfs is ONLY for debugging, never rely on it being enabled, or
> > mounted, on a system in order to have any normal operation happen.
> >
> > So for testing, yes, this is fine. If this is going to be the normal
> > api/interface for how to control this driver, no, that is not acceptable
> > at all.
>
> It makes a lot of sense for end-user to toggle this... for example
> when he is lacking right cable for proper otg detection. As it is
> third driver offering this functionality, I believe we should stop
> treating it as debugging.

At least renesas usb controller seems to have variables in sysfs:
drivers/phy/renesas/phy-rcar-gen3-usb2.c : functions role_show and
role_store. See also
Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2 .

I believe this driver should do same.

Thanks and best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: Digital signature