All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bingbu Cao <bingbu.cao@linux.intel.com>
To: phasta@kernel.org, bingbu.cao@intel.com,
	linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
	hdegoede@redhat.com
Cc: hans@hansg.org, stanislaw.gruszka@linux.intel.com,
	jerry.w.hu@intel.com, tian.shu.qiu@intel.com,
	daxing.li@intel.com, hao.yao@intel.com
Subject: Re: [RFC PATCH 2/7] media: ipu7: add Intel IPU7 PCI device driver
Date: Thu, 27 Feb 2025 11:47:29 +0800	[thread overview]
Message-ID: <f608a81d-a957-5b49-8840-df9021f065b8@linux.intel.com> (raw)
In-Reply-To: <5d9f9a8a877bc86e6780f3357c01e1e92150d19d.camel@mailbox.org>



On 2/26/25 6:00 PM, Philipp Stanner wrote:
> On Fri, 2025-02-21 at 15:52 +0800, bingbu.cao@intel.com wrote:
>> +
> 
> [SNIP]
> 
>> +static int ipu7_pci_probe(struct pci_dev *pdev, const struct
>> pci_device_id *id)
>> +{
>> +	struct ipu_buttress_ctrl *isys_ctrl = NULL, *psys_ctrl =
>> NULL;
>> +	struct fwnode_handle *fwnode = dev_fwnode(&pdev->dev);
>> +	const struct ipu_buttress_ctrl *isys_buttress_ctrl;
>> +	const struct ipu_buttress_ctrl *psys_buttress_ctrl;
>> +	struct ipu_isys_internal_pdata *isys_ipdata;
>> +	struct ipu_psys_internal_pdata *psys_ipdata;
>> +	unsigned int dma_mask = IPU_DMA_MASK;
>> +	struct device *dev = &pdev->dev;
>> +	void __iomem *isys_base = NULL;
>> +	void __iomem *psys_base = NULL;
>> +	void __iomem *const *iomap;
>> +	phys_addr_t phys, pb_phys;
>> +	struct ipu7_device *isp;
>> +	u32 is_es;
>> +	int ret;
>> +
>> +	if (!fwnode || fwnode_property_read_u32(fwnode, "is_es",
>> &is_es))
>> +		is_es = 0;
>> +
>> +	isp = devm_kzalloc(dev, sizeof(*isp), GFP_KERNEL);
>> +	if (!isp)
>> +		return -ENOMEM;
>> +
>> +	dev_set_name(dev, "intel-ipu7");
>> +	isp->pdev = pdev;
>> +	INIT_LIST_HEAD(&isp->devices);
>> +
>> +	ret = pcim_enable_device(pdev);
>> +	if (ret)
>> +		return dev_err_probe(dev, ret, "Enable PCI device
>> failed\n");
>> +
>> +	dev_info(dev, "Device 0x%x (rev: 0x%x)\n",
>> +		 pdev->device, pdev->revision);
>> +
>> +	phys = pci_resource_start(pdev, IPU_PCI_BAR);
>> +	pb_phys = pci_resource_start(pdev, IPU_PCI_PBBAR);
>> +	dev_info(dev, "IPU7 PCI BAR0 base %llx BAR2 base %llx\n",
>> +		 phys, pb_phys);
>> +
>> +	ret = pcim_iomap_regions(pdev, BIT(IPU_PCI_BAR) |
>> BIT(IPU_PCI_PBBAR),
>> +				 pci_name(pdev));
> 
> Oh and btw, since I just recognized this:
> PCI request functions must always get the *driver's* name as their last
> parameter.
> 
> This string will be printed if there is a collision, i.e., when another
> driver tries to request the same resource. The output is only useful
> when the print contains the name of the party who actually stole your
> PCI region. Saying on which PCI device the region is won't be helpful.
> 
> 
> btw, did you watch my Fosdem talk before or after I answered to this
> RFC? ;)

After. ;)

> 
> 
> Thx
> P.
> 
>> +	if (ret)
>> +		return dev_err_probe(dev, ret,
>> +				     "Failed to I/O memory remapping
>> (%d)\n",
>> +				     ret);
>> +
>> +	iomap = pcim_iomap_table(pdev);
>> +	if (!iomap)
>> +		return dev_err_probe(dev, -ENODEV, "Failed to iomap
>> table\n");
>> +
> 
> 

-- 
Best regards,
Bingbu Cao

  reply	other threads:[~2025-02-27  3:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21  7:52 [RFC PATCH 0/7] Intel IPU7 PCI and input system device drivers bingbu.cao
2025-02-21  7:52 ` [RFC PATCH 1/7] media: Rename the IPU PCI device table header and add IPU7 PCI IDs bingbu.cao
2025-02-21  7:52 ` [RFC PATCH 2/7] media: ipu7: add Intel IPU7 PCI device driver bingbu.cao
2025-02-24 14:38   ` Philipp Stanner
2025-02-25  9:39     ` Bingbu Cao
2025-02-27  4:06     ` Bingbu Cao
2025-03-03 15:01       ` Philipp Stanner
2025-03-03 15:18         ` Philipp Stanner
2025-02-26 10:00   ` Philipp Stanner
2025-02-27  3:47     ` Bingbu Cao [this message]
2025-02-21  7:52 ` [RFC PATCH 3/7] media: ipu7: add IPU7 DMA APIs and MMU mapping bingbu.cao
2025-03-03 16:13   ` Bjorn Helgaas
2025-02-21  7:52 ` [RFC PATCH 4/7] media: ipu7: add firmware parse, syscom interface and boot sequence bingbu.cao
2025-02-21  7:52 ` [RFC PATCH 5/7] media: ipu7: add IPU7 firmware ABI headers bingbu.cao
2025-02-21  7:52 ` [RFC PATCH 6/7] media: ipu7: add IPU7 input system device driver bingbu.cao
2025-02-21  7:52 ` [RFC PATCH 7/7] media: ipu7: add Makefile and Kconfig for IPU7 bingbu.cao
2025-02-25  5:55   ` Bingbu Cao
2025-02-21 12:55 ` [RFC PATCH 0/7] Intel IPU7 PCI and input system device drivers Sakari Ailus
2025-04-09 20:23   ` Laurent Pinchart
2025-03-03 16:23 ` Bjorn Helgaas

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=f608a81d-a957-5b49-8840-df9021f065b8@linux.intel.com \
    --to=bingbu.cao@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=daxing.li@intel.com \
    --cc=hans@hansg.org \
    --cc=hao.yao@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=jerry.w.hu@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=phasta@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stanislaw.gruszka@linux.intel.com \
    --cc=tian.shu.qiu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.