From: "Arnd Bergmann" <arnd@arndb.de>
To: "Pawel Laszczak" <pawell@cadence.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Daisy.Barrera@siriusxm.com, Cliff.Holden@siriusxm.com,
"Tony Lindgren" <tony@atomide.com>,
"Jean Delvare" <jdelvare@suse.de>,
neal_liu@aspeedtech.com,
"Linus Walleij" <linus.walleij@linaro.org>,
egtvedt@samfundet.no, "Biju Das" <biju.das.jz@bp.renesas.com>,
herve.codina@bootlin.com
Subject: Re: [PATCH v2 2/4] usb: cdns2: Add main part of Cadence USBHS driver
Date: Thu, 20 Apr 2023 11:43:36 +0200 [thread overview]
Message-ID: <7e54e105-574a-4104-8781-2f15c0c4b329@app.fastmail.com> (raw)
In-Reply-To: <20230420090101.80812-3-pawell@cadence.com>
On Thu, Apr 20, 2023, at 11:00, Pawel Laszczak wrote:
> This patch introduces the main part of Cadence USBHS driver
> to Linux kernel.
Not sure why I was on Cc, but I gave it a quick look anyway, looking
for common issues. I only found a few very minor things that can be
improved, no real problems:
> +++ b/drivers/usb/gadget/udc/cdns2/Kconfig
> @@ -0,0 +1,11 @@
> +config USB_CDNS2_UDC
> + tristate "Cadence USBHS Device Controller"
> + depends on USB_PCI && ACPI && HAS_DMA
Why the ACPI dependency?
> + response_pkt = (__le16 *)pdev->ep0_preq.request.buf;
> + *response_pkt = cpu_to_le16(status);
You can simplify this using put_unaligned_le16()
> +
> + preq->num_of_trb = num_trbs;
> +
> + /*
> + * Memory barrier - cycle bit must be set as the last operation.
> + */
> + wmb();
This can probably be the cheaper dma_wmb() if you only serialize
between accesses to a DMA buffer.
> +static int __maybe_unused cdns2_pci_suspend(struct device *dev)
> +{
> + struct cdns2_device *priv_dev = dev_get_drvdata(dev);
> +
> + return cdns2_gadget_suspend(priv_dev);
> +}
> +
> +static int __maybe_unused cdns2_pci_resume(struct device *dev)
> +{
> + struct cdns2_device *priv_dev = dev_get_drvdata(dev);
> +
> + return cdns2_gadget_resume(priv_dev, 1);
> +}
> +
> +static const struct dev_pm_ops cdns2_pci_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(cdns2_pci_suspend, cdns2_pci_resume)
> +};
You can use SYSTEM_SLEEP_PM_OPS() instead of SET_SYSTEM_SLEEP_PM_OPS()
and then remove the __maybe_unused.
Arnd
next prev parent reply other threads:[~2023-04-20 9:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 9:00 [PATCH v2 0/4] Introduced new Cadence USBHS Driver Pawel Laszczak
2023-04-20 9:00 ` [PATCH v2 1/4] usb: cdns2: Device side header file for CDNS2 driver Pawel Laszczak
2023-04-20 9:17 ` Arnd Bergmann
2023-04-20 9:50 ` Pawel Laszczak
2023-04-20 9:00 ` [PATCH v2 2/4] usb: cdns2: Add main part of Cadence USBHS driver Pawel Laszczak
2023-04-20 9:43 ` Arnd Bergmann [this message]
2023-04-20 10:03 ` Pawel Laszczak
2023-04-20 9:01 ` [PATCH v2 3/4] usb: cdns2: Add tracepoints for CDNS2 driver Pawel Laszczak
2023-04-20 9:01 ` [PATCH v2 4/4] MAINTAINERS: add Cadence USBHS driver entry Pawel Laszczak
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=7e54e105-574a-4104-8781-2f15c0c4b329@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Cliff.Holden@siriusxm.com \
--cc=Daisy.Barrera@siriusxm.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=egtvedt@samfundet.no \
--cc=gregkh@linuxfoundation.org \
--cc=herve.codina@bootlin.com \
--cc=jdelvare@suse.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=neal_liu@aspeedtech.com \
--cc=pawell@cadence.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
all inboxes | Powered by JetHome®