From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57120C43381 for ; Mon, 11 Jan 2021 14:39:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3594522795 for ; Mon, 11 Jan 2021 14:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732810AbhAKOiu (ORCPT ); Mon, 11 Jan 2021 09:38:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727984AbhAKOit (ORCPT ); Mon, 11 Jan 2021 09:38:49 -0500 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60DB1C061786; Mon, 11 Jan 2021 06:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ixsfk5NwQACytWv/iH7/K21zegLffRIyRkNvUq/GHSI=; b=FL+aKR9e5W+KUyeSOR3QP01kCJ 3Fzf4i0EE9fMDz5UmtBuPYNSIOpTj/9MXCNPOxA9nUJkMO8ZqjEwiEDpZhuYiXMwXBSl0hGUhH1LF Le2jdTJ13B+m3kltnOGiY2ocrtYUocHkeW/uMFfw00F+d5i20DX4cDRu/obuUFZpS/Ix3miQFsS0Z qOLP1LbDwmYG5gdqBa1nJrZQXj26a/+GXHndDlX0eyTKm39iQYoyTTrHo+qEydMWSMUuoOLSUzgPe e4ylBVbXaals04IRIN2nAcfm5vF5VmUmbuW6oPDBZpSSDUy5BqezxyDQsUK277wU2OiKxYHAIea3P 7WfS63yA==; Received: from dsl-hkibng22-54f986-236.dhcp.inet.fi ([84.249.134.236] helo=[192.168.1.10]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kyyKd-0005Qp-Ex; Mon, 11 Jan 2021 16:38:07 +0200 Subject: Re: [PATCH] i2c: tegra: Wait for config load atomically while in ISR To: David Laight , 'Mikko Perttunen' , "ldewangan@nvidia.com" , "digetx@gmail.com" , "thierry.reding@gmail.com" , "jonathanh@nvidia.com" , "wsa@kernel.org" Cc: "linux-i2c@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" References: <20210111135547.3613092-1-mperttunen@nvidia.com> From: Mikko Perttunen Message-ID: <9ba3d704-674b-94df-d10f-e3edb3c695d6@kapsi.fi> Date: Mon, 11 Jan 2021 16:38:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 84.249.134.236 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Agreed that this is possibly not optimal, but this patch simply returns the behavior to what it was before "i2c: tegra: Support atomic transfers", fixing the overt issue. Design fixes can be considered later, in a non-stable patch. Mikko On 1/11/21 4:31 PM, David Laight wrote: > From: Mikko Perttunen >> Sent: 11 January 2021 13:56 >> >> Upon a communication error, the interrupt handler can call >> tegra_i2c_disable_packet_mode. This causes a sleeping poll to happen >> unless the current transaction was marked atomic. Since >> tegra_i2c_disable_packet_mode is only called from the interrupt path, >> make it use atomic waiting always. > > Spin-waiting in an ISR for anything that it makes sense to do > a sleep-wait for at other times is badly broken design. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >