From: Jason Gunthorpe <jgg@nvidia.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: vkoul@kernel.org, Dan Williams <dan.j.williams@intel.com>,
dmaengine@vger.kernel.org, dan.carpenter@oracle.com
Subject: Re: [PATCH v8 0/8] idxd 'struct device' lifetime handling fixes
Date: Tue, 30 Mar 2021 14:45:46 -0300 [thread overview]
Message-ID: <20210330174546.GW2356281@nvidia.com> (raw)
In-Reply-To: <161668743322.2670112.2302120522403482843.stgit@djiang5-desk3.ch.intel.com>
On Thu, Mar 25, 2021 at 08:54:31AM -0700, Dave Jiang wrote:
> Vinod,
> The series fixes the various 'struct device' lifetime handling in the
> idxd driver. The devm managed lifetime is incompatible with 'struct device'
> objects that resides in the idxd context. Tested with
> CONFIG_DEBUG_KOBJECT_RELEASE and address all issues from that.
>
> Please consider for damengine/fixes for the 5.12-rc.
It seems like an improvement..
The flow around probe is still weird:
static int idxd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
idxd = idxd_alloc(pdev);
^^ but we don't device_initialize() this
rc = idxd_probe(idxd);
if (rc)
goto err;
err:
err_iomap:
idxd_free(idxd);
static int idxd_probe(struct idxd_device *idxd)
{
err_int:
idxd_free(idxd);
return rc;
So we call idxd_free twice on error unwinds, and that will
crash. Unify idxd_free() and idxd_conf_device_release() as
appropriate.
Confused why they are different, why are some of the kfrees missing
from the release function?
Call device_initialize in idxd_alloc() and make it so that the release
function works properly. Move all the error unwind put_device's to
idxd_pci_probe()
..
idxd->id = idr_alloc(&idxd_idrs[idxd->type], idxd, 0, 0, GFP_KERNEL);
Nothing ever reads the idxd_idr, so this should be an ida
Jason
next prev parent reply other threads:[~2021-03-30 17:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 15:54 [PATCH v8 0/8] idxd 'struct device' lifetime handling fixes Dave Jiang
2021-03-25 15:54 ` [PATCH v8 1/8] dmaengine: idxd: fix dma device lifetime Dave Jiang
2021-03-25 15:54 ` [PATCH v8 2/8] dmaengine: idxd: cleanup pci interrupt vector allocation management Dave Jiang
2021-03-25 15:54 ` [PATCH v8 3/8] dmaengine: idxd: removal of pcim managed mmio mapping Dave Jiang
2021-03-25 15:54 ` [PATCH v8 4/8] dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime Dave Jiang
2021-03-25 15:55 ` [PATCH v8 5/8] dmaengine: idxd: fix wq " Dave Jiang
2021-03-30 17:36 ` Jason Gunthorpe
2021-03-25 15:55 ` [PATCH v8 6/8] dmaengine: idxd: fix engine conf_dev lifetime Dave Jiang
2021-03-25 15:55 ` [PATCH v8 7/8] dmaengine: idxd: fix group " Dave Jiang
2021-03-25 15:55 ` [PATCH v8 8/8] dmaengine: idxd: fix cdev setup and free device lifetime issues Dave Jiang
2021-03-30 17:45 ` Jason Gunthorpe [this message]
2021-03-30 17:58 ` [PATCH v8 0/8] idxd 'struct device' lifetime handling fixes Dave Jiang
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=20210330174546.GW2356281@nvidia.com \
--to=jgg@nvidia.com \
--cc=dan.carpenter@oracle.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=vkoul@kernel.org \
/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.