From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Daehwan Jung <dh10.jung@samsung.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Mathias Nyman <mathias.nyman@intel.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Tony Lindgren <tony@atomide.com>, Juergen Gross <jgross@suse.com>,
Arnd Bergmann <arnd@arndb.de>,
Matthias Kaehlcke <mka@chromium.org>
Cc: open list <linux-kernel@vger.kernel.org>,
"open list:DESIGNWARE USB3 DRD IP DRIVER"
<linux-usb@vger.kernel.org>,
"moderated list:ARM/SAMSUNG S3C,
S5P AND EXYNOS ARM ARCHITECTURES"
<linux-arm-kernel@lists.infradead.org>,
"open list:ARM/SAMSUNG S3C,
S5P AND EXYNOS ARM ARCHITECTURES"
<linux-samsung-soc@vger.kernel.org>,
sc.suh@samsung.com, taehyun.cho@samsung.com,
jh0801.jung@samsung.com, eomji.oh@samsung.com
Subject: Re: [PATCH RFC v5 5/6] usb: host: add xhci-exynos driver
Date: Fri, 6 May 2022 08:58:12 +0200 [thread overview]
Message-ID: <921b8df5-bd01-1ca5-cbe9-4a4e48acdab8@linaro.org> (raw)
In-Reply-To: <1651818679-10594-6-git-send-email-dh10.jung@samsung.com>
On 06/05/2022 08:31, Daehwan Jung wrote:
> This driver is for Samsung Exynos xHCI host conroller. It works based on
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95
> xhci platform driver and extends functions by xhci hooks and overrides.
> Vendor ops(xhci hooks) should be mapped before probing driver.
> It overrides functions of hc driver on vendor init.
>
> It supports USB Audio offload with Co-processor. It only cares DCBAA,
> Device Context, Transfer Ring, Event Ring, and ERST. They are allocated
> on specific address with xhci hooks. Co-processor could use them directly
> without xhci driver after then.
>
> Signed-off-by: Daehwan Jung <dh10.jung@samsung.com>
> ---
> drivers/usb/host/Kconfig | 8 +
> drivers/usb/host/Makefile | 1 +
> drivers/usb/host/xhci-exynos.c | 775 +++++++++++++++++++++++++++++++++
This is your fifth version and *it still does not compile*. Can you
compile your changes before sending them? It saves reviewer's time.
/usr/bin/aarch64-linux-gnu-ld: drivers/usb/dwc3/dwc3-exynos.o: in
function `dwc3_exynos_probe':
dwc3-exynos.c:(.text+0x470): undefined reference to
`xhci_exynos_register_vendor_ops'
> 3 files changed, 784 insertions(+)
> create mode 100644 drivers/usb/host/xhci-exynos.c
>
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 682b3d2da623..ccafcd9b4212 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -104,6 +104,14 @@ config USB_XHCI_TEGRA
> Say 'Y' to enable the support for the xHCI host controller
> found in NVIDIA Tegra124 and later SoCs.
>
> +config USB_XHCI_EXYNOS
> + tristate "xHCI support for Samsung Exynos SoC Series"
XHCI was supported before, wasn't it? If yes, this title does not make
really sense.
You need to provide proper title explaining this option.
> + depends on USB_XHCI_PLATFORM
> + depends on ARCH_EXYNOS || COMPILE_TEST
> + help
> + Say 'Y' to enable the support for the xHCI host controller
> + found in Samsung Exynos SoCs.
The same.
> +
> endif # USB_XHCI_HCD
>
> config USB_EHCI_BRCMSTB
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index 2948983618fb..300f22b6eb1b 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -86,3 +86,4 @@ obj-$(CONFIG_USB_HCD_SSB) += ssb-hcd.o
> obj-$(CONFIG_USB_FOTG210_HCD) += fotg210-hcd.o
> obj-$(CONFIG_USB_MAX3421_HCD) += max3421-hcd.o
> obj-$(CONFIG_USB_XEN_HCD) += xen-hcd.o
> +obj-$(CONFIG_USB_XHCI_EXYNOS) += xhci-exynos.o
> diff --git a/drivers/usb/host/xhci-exynos.c b/drivers/usb/host/xhci-exynos.c
> new file mode 100644
> index 000000000000..5318a51ac5ee
> --- /dev/null
> +++ b/drivers/usb/host/xhci-exynos.c
> @@ -0,0 +1,775 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * xhci-exynos.c - xHCI host controller driver platform Bus Glue for Exynos.
> + *
> + * Copyright (C) 2022 Samsung Electronics Incorporated - http://www.samsung.com
> + * Author: Daehwan Jung <dh10.jung@samsung.com>
> + *
> + * A lot of code borrowed from the Linux xHCI driver.
Then please keep original copyrights, as a derivative work.
> + */
> +#include <linux/pci.h>
> +#include <linux/platform_device.h>
> +
> +#include "xhci.h"
> +#include "xhci-plat.h"
> +
> +/* EXYNOS uram memory map */
> +#define EXYNOS_URAM_ABOX_EVT_RING_ADDR 0x02a00000
Are these SoC memory map addresses? If yes, they should not be
hard-coded in the driver.
> +#define EXYNOS_URAM_ISOC_OUT_RING_ADDR 0x02a01000
> +#define EXYNOS_URAM_ISOC_IN_RING_ADDR 0x02a02000
> +#define EXYNOS_URAM_DEVICE_CTX_ADDR 0x02a03000
> +#define EXYNOS_URAM_DCBAA_ADDR 0x02a03880
> +#define EXYNOS_URAM_ABOX_ERST_SEG_ADDR 0x02a03C80
> +#define EXYNOS_URAM_CTX_SIZE 2112
> +
> +int xhci_exynos_register_vendor_ops(void);
> +
> +struct xhci_hcd_exynos {
> + struct xhci_intr_reg __iomem *ir_set_audio;
> +
> + struct xhci_ring *event_ring_audio;
> + struct xhci_erst erst_audio;
Why "xHCI support for Samsung Exynos SoC Series" comes specific to
audio? Isn't XHCI related to USB, so a Universal use? Cannot XHCI driver
support mass storage?
> +
> + struct device *dev;
> + struct usb_hcd *hcd;
> + struct usb_hcd *shared_hcd;
> +
> + struct wakeup_source *main_wakelock; /* Wakelock for HS HCD */
> + struct wakeup_source *shared_wakelock; /* Wakelock for SS HCD */
None of other USB drivers use wakeloks so why is this one special?
> +
> + u32 in_ep;
> + u32 out_ep;
> + u32 in_deq;
> + u32 out_deq;
> +
> + /* This flag is used to check first allocation for URAM */
> + bool exynos_uram_ctx_alloc;
> + bool exynos_uram_isoc_out_alloc;
> + bool exynos_uram_isoc_in_alloc;
This indentation is really troubling me - just few lines above, you
don't indent variables. Here you indent. You need to clean up your
driver before submitting. Run checkpatch --strict and fix all the
issues. Add const to all static variables and most of pointed memory.
Remove any inconsistencies. Remove double blank lines. Fix indentation.
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-05-06 6:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220506063316epcas2p197ed75070ed4f4ba29439f5c0def90b4@epcas2p1.samsung.com>
2022-05-06 6:31 ` [PATCH v5 0/6] Add xhci-exynos for Exynos SOC Daehwan Jung
2022-05-06 6:31 ` [PATCH v5 1/6] usb: host: export symbols for xhci-exynos to use xhci hooks Daehwan Jung
2022-05-06 6:31 ` [PATCH v5 2/6] usb: host: add xhci hooks for xhci-exynos Daehwan Jung
2022-05-06 6:31 ` [PATCH v5 3/6] usb: host: xhci-plat: support override of hc driver Daehwan Jung
2022-05-06 6:31 ` [PATCH v5 4/6] usb: host: add some to xhci overrides for xhci-exynos Daehwan Jung
2022-05-06 6:31 ` [PATCH RFC v5 5/6] usb: host: add xhci-exynos driver Daehwan Jung
2022-05-06 6:58 ` Krzysztof Kozlowski [this message]
2022-05-06 6:31 ` [PATCH RFC v5 6/6] usb: dwc3: dwc3-exynos: add host init Daehwan Jung
2022-05-06 6:45 ` Krzysztof Kozlowski
2022-05-09 11:30 ` Christoph Hellwig
2022-05-06 7:51 ` Arnd Bergmann
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=921b8df5-bd01-1ca5-cbe9-4a4e48acdab8@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=arnd@arndb.de \
--cc=balbi@kernel.org \
--cc=dh10.jung@samsung.com \
--cc=eomji.oh@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgross@suse.com \
--cc=jh0801.jung@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=mathias.nyman@intel.com \
--cc=mka@chromium.org \
--cc=sc.suh@samsung.com \
--cc=taehyun.cho@samsung.com \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox