Re: [PATCH v2 1/3] usb: dwc3: dwc3-octeon: Convert to glue driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 13, 2023, Ladislav Michl wrote:
> On Wed, Jul 05, 2023 at 11:25:46PM +0000, Thinh Nguyen wrote:
> > On Sun, Jul 02, 2023, Ladislav Michl wrote:
> > > From: Ladislav Michl <ladis@xxxxxxxxxxxxxx>
> > > 
> > > Move Octeon DWC3 glue code from arch/mips and use it
> > > instead of dwc3-of-simple.
> > 
> > Please provide more context and the reason to why the move here.
> > 
> > > 
> > > Signed-off-by: Ladislav Michl <ladis@xxxxxxxxxxxxxx>
> > > Acked-by: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
> > > ---
> > >  CHANGES:
> > >  - v2: squashed move and glue conversion patch, fixed sparse warning
> > >        and formatting issue. Set private data at the end of probe.
> > >        Clear drvdata on remove. Added host mode only notice.
> > >        Collected ack for move from arch/mips.
> > > 
> > >  arch/mips/cavium-octeon/Makefile              |   1 -
> > >  arch/mips/cavium-octeon/octeon-platform.c     |   1 -
> > >  drivers/usb/dwc3/Kconfig                      |  10 ++
> > >  drivers/usb/dwc3/Makefile                     |   1 +
> > >  .../usb/dwc3/dwc3-octeon.c                    | 108 ++++++++++--------
> > >  drivers/usb/dwc3/dwc3-of-simple.c             |   1 -
> > >  6 files changed, 69 insertions(+), 53 deletions(-)
> > >  rename arch/mips/cavium-octeon/octeon-usb.c => drivers/usb/dwc3/dwc3-octeon.c (91%)
> > > 
> > > diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
> > > index 7c02e542959a..2a5926578841 100644
> > > --- a/arch/mips/cavium-octeon/Makefile
> > > +++ b/arch/mips/cavium-octeon/Makefile
> > > @@ -18,4 +18,3 @@ obj-y += crypto/
> > >  obj-$(CONFIG_MTD)		      += flash_setup.o
> > >  obj-$(CONFIG_SMP)		      += smp.o
> > >  obj-$(CONFIG_OCTEON_ILM)	      += oct_ilm.o
> > > -obj-$(CONFIG_USB)		      += octeon-usb.o
> > > diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
> > > index ce05c0dd3acd..235c77ce7b18 100644
> > > --- a/arch/mips/cavium-octeon/octeon-platform.c
> > > +++ b/arch/mips/cavium-octeon/octeon-platform.c
> > > @@ -450,7 +450,6 @@ static const struct of_device_id octeon_ids[] __initconst = {
> > >  	{ .compatible = "cavium,octeon-3860-bootbus", },
> > >  	{ .compatible = "cavium,mdio-mux", },
> > >  	{ .compatible = "gpio-leds", },
> > > -	{ .compatible = "cavium,octeon-7130-usb-uctl", },
> > >  	{},
> > >  };
> > >  
> > > diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> > > index be954a9abbe0..98efcbb76c88 100644
> > > --- a/drivers/usb/dwc3/Kconfig
> > > +++ b/drivers/usb/dwc3/Kconfig
> > > @@ -168,4 +168,14 @@ config USB_DWC3_AM62
> > >  	  The Designware Core USB3 IP is programmed to operate in
> > >  	  in USB 2.0 mode only.
> > >  	  Say 'Y' or 'M' here if you have one such device
> > > +
> > > +config USB_DWC3_OCTEON
> > > +	tristate "Cavium Octeon Platforms"
> > > +	depends on CAVIUM_OCTEON_SOC || COMPILE_TEST
> > > +	default USB_DWC3
> > > +	help
> > > +	  Support Cavium Octeon platforms with DesignWare Core USB3 IP.
> > > +	  Only the host mode is currently supported.
> > > +	  Say 'Y' or 'M' here if you have one such device.
> > > +
> > >  endif
> > > diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> > > index 9f66bd82b639..fe1493d4bbe5 100644
> > > --- a/drivers/usb/dwc3/Makefile
> > > +++ b/drivers/usb/dwc3/Makefile
> > > @@ -54,3 +54,4 @@ obj-$(CONFIG_USB_DWC3_ST)		+= dwc3-st.o
> > >  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom.o
> > >  obj-$(CONFIG_USB_DWC3_IMX8MP)		+= dwc3-imx8mp.o
> > >  obj-$(CONFIG_USB_DWC3_XILINX)		+= dwc3-xilinx.o
> > > +obj-$(CONFIG_USB_DWC3_OCTEON)		+= dwc3-octeon.o
> > > diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/drivers/usb/dwc3/dwc3-octeon.c
> > > similarity index 91%
> > > rename from arch/mips/cavium-octeon/octeon-usb.c
> > > rename to drivers/usb/dwc3/dwc3-octeon.c
> > > index 2add435ad038..8d5facd881c1 100644
> > > --- a/arch/mips/cavium-octeon/octeon-usb.c
> > > +++ b/drivers/usb/dwc3/dwc3-octeon.c
> > > @@ -187,7 +187,10 @@
> > >  #define USBDRD_UCTL_ECC				0xf0
> > >  #define USBDRD_UCTL_SPARE1			0xf8
> > >  
> > > -static DEFINE_MUTEX(dwc3_octeon_clocks_mutex);
> > > +struct dwc3_data {
> > > +	struct device *dev;
> > > +	void __iomem *base;
> > > +};
> > >  
> > >  #ifdef CONFIG_CAVIUM_OCTEON_SOC
> > >  #include <asm/octeon/octeon.h>
> > > @@ -233,6 +236,11 @@ static inline uint64_t dwc3_octeon_readq(void __iomem *addr)
> > >  static inline void dwc3_octeon_writeq(void __iomem *base, uint64_t val) { }
> > >  
> > >  static inline void dwc3_octeon_config_gpio(int index, int gpio) { }
> > > +
> > > +static uint64_t octeon_get_io_clock_rate(void)
> > > +{
> > > +	return 150000000;
> > > +}
> > >  #endif
> > >  
> > >  static int dwc3_octeon_get_divider(void)
> > > @@ -271,7 +279,7 @@ static int dwc3_octeon_config_power(struct device *dev, void __iomem *base)
> > >  			dev_err(dev, "invalid power configuration\n");
> > >  			return -EINVAL;
> > >  		}
> > > -		dwc3_octeon_config_gpio(((u64)base >> 24) & 1, gpio);
> > > +		dwc3_octeon_config_gpio(((__force u64)base >> 24) & 1, gpio);
> > 
> > You're doing more than just moving the code here. Please separate the
> > change to a different patch if there are additional functional change
> > and provide the reason for it.
> 
> Is it okay to move file with sparse warning or am I supposed to fix it
> in the arch code first?
> 

Yes. Keep the change to only what is described in the change log. Any
other change should be in a separate commit.

Thanks,
Thinh




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux