From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751601AbcDDDxm (ORCPT ); Sun, 3 Apr 2016 23:53:42 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:49466 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbcDDDxk (ORCPT ); Sun, 3 Apr 2016 23:53:40 -0400 Subject: Re: 4.6-rc1 regression in SPI core -- deadlock To: Rich Felker , "linux-spi@vger.kernel.org" References: <20160404012013.GA5735@brightrain.aerifal.cx> CC: "linux-kernel@vger.kernel.org" , Jon Hunter , Mark Brown From: Vignesh R Message-ID: <5701E53B.5040407@ti.com> Date: Mon, 4 Apr 2016 09:23:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160404012013.GA5735@brightrain.aerifal.cx> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04/2016 06:50 AM, Rich Felker wrote: > I've spent several days trying to debug a deadlock using our local > (not yet ready for upstream) driver for the J-Core SPI device and it > seems to be a new deadlock in the SPI core caused by commit > 556351f14e74 and unrelated to the particular driver. Commit > 49023d2e4ead tried to solve a related deadlock problem, but there > still seems to be a lock order issue and it's affecting SPI use even > without the spi_flash_read optimization. The deadlock I'm observing > has a kworker thread stuck in wait_for_completion called from > spi_sync_locked (ultimately from mmc_rescan) and the completion is > never finishing because this kworker thread has the bus locked while > the spi master task has already started processing the queue but can't > proceed because the bus lock is taken. > > Anyone else seen this? Ideas for a proper fix? Could you try 24c8cd1b081286("spi: fix possible deadlock between internal bus locks and bus_lock_flag") from linux-next? -- Regards Vignesh