Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751269AbdFANKt (ORCPT ); Thu, 1 Jun 2017 09:10:49 -0400 Received: from esa2.dell-outbound.iphmx.com ([68.232.149.220]:38705 "EHLO esa2.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdFANKs (ORCPT ); Thu, 1 Jun 2017 09:10:48 -0400 X-Greylist: delayed 576 seconds by postgrey-1.27 at vger.kernel.org; Thu, 01 Jun 2017 09:10:48 EDT X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd05.lss.emc.com v51D125H007975 From: "Allen Hubbe" To: "'Jia-Ju Bai'" , , Cc: , "'LKML'" References: <592FDBC4.9000406@163.com> In-Reply-To: <592FDBC4.9000406@163.com> Subject: RE: [BUG] ntb: Sleep in interrupt handling Date: Thu, 1 Jun 2017 09:00:32 -0400 Message-ID: <000001d2dad7$0e4eba30$2aec2e90$@dell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHS2repzb14n3O06EObqPQ99RRu1KIP903w Content-Language: en-us X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd05.lss.emc.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 767 Lines: 18 From: Jia-Ju Bai > According to ntb_transport.c, the driver may sleep in interrupt handling. > The function call path is: > ntb_transport_rxc_db (tasklet_init indicates it handles interrupt) > ntb_process_rxc > ntb_async_rx > ntb_async_rx_submit > schedule_timeout --> may sleep > > This bug is found by my static analysis tool and my code review. > I hope to fix it, but I do not have a good solution. Thanks! There is a recovery path if ntb_async_tx_submit fails. It will do the transmission with memcpy instead of dma. So, rather than retry in ntb_async_tx_submit, just fail to the recovery path. Basically, replace the whole for(retries) loop with just txd = prep(); Would you like to work on the patch? > > Thanks, > Jia-Ju Bai