Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754846AbdDDQu6 (ORCPT ); Tue, 4 Apr 2017 12:50:58 -0400 Received: from imap0.codethink.co.uk ([185.43.218.159]:49791 "EHLO imap0.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbdDDQu4 (ORCPT ); Tue, 4 Apr 2017 12:50:56 -0400 Message-ID: <1491324650.10415.3.camel@codethink.co.uk> Subject: Re: [PATCH 4.4 42/76] mmc: sdhci: Do not disable interrupts while waiting for clock From: Ben Hutchings To: Ulf Hansson Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Adrian Hunter , Ludovic Desroches , Greg Kroah-Hartman Date: Tue, 04 Apr 2017 17:50:50 +0100 In-Reply-To: <20170328122601.653745040@linuxfoundation.org> References: <20170328122559.966310440@linuxfoundation.org> <20170328122601.653745040@linuxfoundation.org> Organization: Codethink Ltd. Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1039 Lines: 30 On Tue, 2017-03-28 at 14:30 +0200, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Adrian Hunter > > commit e2ebfb2142acefecc2496e71360f50d25726040b upstream. > > Disabling interrupts for even a millisecond can cause problems for some > devices. That can happen when sdhci changes clock frequency because it > waits for the clock to become stable under a spin lock. > > The spin lock is not necessary here. Anything that is racing with changes > to the I/O state is already broken. The mmc core already provides > synchronization via "claiming" the host. [...] In mainline, drivers/mmc/host/sdhci-of-at91.c has a slightly different version of this code that seems to have the same issue. In 4.4 there's another (conditional) mdelay(1) further up this function that seems to be related to that hardware, and probably ought to have an unlock/lock around it. Ben. -- Ben Hutchings Software Developer, Codethink Ltd.