From: Bjorn Helgaas <helgaas@kernel.org>
To: WangYuli <wangyuli@uniontech.com>
Cc: bhelgaas@google.com, siyuli@glenfly.com,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
guanwentao@uniontech.com, linux@horizon.com, pat-lkml@erley.org,
alex.williamson@redhat.com
Subject: Re: [PATCH] PCI: Add function 0 DMA alias quirk for Glenfly arise chip
Date: Thu, 22 Aug 2024 13:56:17 -0500 [thread overview]
Message-ID: <20240822185617.GA344785@bhelgaas> (raw)
In-Reply-To: <DB918DA5CBA08DE8+20240802161109.240191-1-wangyuli@uniontech.com>
On Sat, Aug 03, 2024 at 12:11:09AM +0800, WangYuli wrote:
> Add DMA support for audio function of Glenfly arise chip,
> which uses request id of function 0.
>
> Signed-off-by: SiyuLi <siyuli@glenfly.com>
> Signed-off-by: WangYuli <wangyuli@uniontech.com>
> ---
> drivers/pci/quirks.c | 6 ++++++
> include/linux/pci_ids.h | 4 ++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index a2ce4e08edf5..a6cb8b314fae 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4246,6 +4246,12 @@ static void quirk_dma_func0_alias(struct pci_dev *dev)
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe832, quirk_dma_func0_alias);
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe476, quirk_dma_func0_alias);
>
> +/*
> + * Some Glenfly chips use function 0 as the PCIe requester ID for DMA too.
> + */
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_GLENFLY, PCI_DEVICE_ID_GLENFLY_ARISE10C0_AUDIO, quirk_dma_func0_alias);
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_GLENFLY, PCI_DEVICE_ID_GLENFLY_ARISE1020_AUDIO, quirk_dma_func0_alias);
> +
> static void quirk_dma_func1_alias(struct pci_dev *dev)
> {
> if (PCI_FUNC(dev->devfn) != 1)
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index e388c8b1cbc2..35d2314cc433 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -1654,6 +1654,10 @@
> #define PCI_DEVICE_ID_RICOH_R5C832 0x0832
> #define PCI_DEVICE_ID_RICOH_R5C843 0x0843
>
> +#define PCI_VENDOR_ID_GLENFLY 0x6766
From include/linux/pci_ids.h:
* Please keep sorted by numeric Vendor ID and Device ID.
*
* Do not add new entries to this file unless the definitions
* are shared between multiple drivers.
The Vendor ID definition is OK, but needs to be moved so the file
stays sorted.
> +#define PCI_DEVICE_ID_GLENFLY_ARISE10C0_AUDIO 0x3D40
> +#define PCI_DEVICE_ID_GLENFLY_ARISE1020_AUDIO 0x3D41
Use the bare hex values in the quirk instead.
If/when there are more uses for them, we can add #defines here.
I see this in sound/pci/hda/hda_intel.c:
/* GLENFLY */
{ PCI_DEVICE(0x6766, PCI_ANY_ID),
.class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
.class_mask = 0xffffff,
.driver_data = AZX_DRIVER_GFHDMI | AZX_DCAPS_POSFIX_LPIB |
AZX_DCAPS_NO_MSI | AZX_DCAPS_NO_64BIT },
Since you're adding PCI_VENDOR_ID_GLENFLY here, it would be nice to
update hda_intel.c to use the definition.
> #define PCI_VENDOR_ID_DLINK 0x1186
> #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
>
> --
> 2.43.4
>
prev parent reply other threads:[~2024-08-22 18:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 16:11 [PATCH] PCI: Add function 0 DMA alias quirk for Glenfly arise chip WangYuli
2024-08-22 18:56 ` Bjorn Helgaas [this message]
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=20240822185617.GA344785@bhelgaas \
--to=helgaas@kernel.org \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=guanwentao@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@horizon.com \
--cc=pat-lkml@erley.org \
--cc=siyuli@glenfly.com \
--cc=wangyuli@uniontech.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