From: Reinette Chatre <reinette.chatre@intel.com>
To: "Yu, Fenghua" <fenghua.yu@intel.com>,
"Jiang, Dave" <dave.jiang@intel.com>,
"vkoul@kernel.org" <vkoul@kernel.org>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] dmaengine: idxd: Do not call DMX TX callbacks during workqueue disable
Date: Fri, 2 Dec 2022 13:51:11 -0800 [thread overview]
Message-ID: <d9a6e626-96fb-0593-3410-3bed6c3fb3d0@intel.com> (raw)
In-Reply-To: <IA1PR11MB6097E887BBCE14CE2D47CDDB9B179@IA1PR11MB6097.namprd11.prod.outlook.com>
Hi Fenghua,
On 12/2/2022 1:12 PM, Yu, Fenghua wrote:
...
>> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index
>> b4d7bb923a40..2ac71a34fa34 100644
>> --- a/drivers/dma/idxd/device.c
>> +++ b/drivers/dma/idxd/device.c
>> @@ -1156,6 +1156,7 @@ int idxd_device_load_config(struct idxd_device *idxd)
>>
>> static void idxd_flush_pending_descs(struct idxd_irq_entry *ie) {
>> + struct dma_async_tx_descriptor *tx;
>
> Nitpicking. It's better to move this line to below:
>
>> struct idxd_desc *desc, *itr;
>> struct llist_node *head;
>> LIST_HEAD(flist);
>> @@ -1175,6 +1176,15 @@ static void idxd_flush_pending_descs(struct
>> idxd_irq_entry *ie)
>> list_for_each_entry_safe(desc, itr, &flist, list) {
>
> here?
> + struct dma_async_tx_descriptor *tx;
>
Will do.
>> list_del(&desc->list);
>> ctype = desc->completion->status ?
>> IDXD_COMPLETE_NORMAL : IDXD_COMPLETE_ABORT;
>> + /*
>> + * wq is being disabled. Any remaining descriptors are
>> + * likely to be stuck and can be dropped. callback could
>> + * point to code that is no longer accessible, for example
>> + * if dmatest module has been unloaded.
>> + */
>> + tx = &desc->txd;
>> + tx->callback = NULL;
>> + tx->callback_result = NULL;
>> idxd_dma_complete_txd(desc, ctype, true);
>> }
>> }
>> --
>> 2.34.1
>
> Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Thank you very much.
Reinette
next prev parent reply other threads:[~2022-12-02 21:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 18:25 [PATCH 0/3] dmaengine: idxd: Error path fixes Reinette Chatre
2022-12-02 18:25 ` [PATCH 1/3] dmaengine: idxd: Let probe fail when workqueue cannot be enabled Reinette Chatre
2022-12-02 18:44 ` Dave Jiang
2022-12-02 18:52 ` Yu, Fenghua
2022-12-02 18:25 ` [PATCH 2/3] dmaengine: idxd: Prevent use after free on completion memory Reinette Chatre
2022-12-02 18:44 ` Dave Jiang
2022-12-02 19:45 ` Yu, Fenghua
2022-12-02 18:25 ` [PATCH 3/3] dmaengine: idxd: Do not call DMX TX callbacks during workqueue disable Reinette Chatre
2022-12-02 18:45 ` Dave Jiang
2022-12-02 21:12 ` Yu, Fenghua
2022-12-02 21:51 ` Reinette Chatre [this message]
2022-12-02 21:32 ` [PATCH 0/3] dmaengine: idxd: Error path fixes Yu, Fenghua
2022-12-02 21:53 ` Reinette Chatre
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=d9a6e626-96fb-0593-3410-3bed6c3fb3d0@intel.com \
--to=reinette.chatre@intel.com \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@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 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®