Received: by 10.213.65.68 with SMTP id h4csp1848464imn; Mon, 19 Mar 2018 15:07:25 -0700 (PDT) X-Google-Smtp-Source: AG47ELuKJOPIAVGEcVwNjszavYx5ILtnOPYkm3tGBFZXSg+qHMNcNYQ8GXOyEg7ayqzPTPRHUI8/ X-Received: by 10.101.97.139 with SMTP id c11mr10268598pgv.443.1521497245799; Mon, 19 Mar 2018 15:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521497245; cv=none; d=google.com; s=arc-20160816; b=k0GSM9CG2s7mDXVMujepKqkRswayVt8p/cG0wJyICW7wgJcgJSHKbid3NGDJchGDmG s79KW9hB1oOHZgUgTX3kwEzR+2ihvzx1Rtg3KSyWyXhyX3Lnix9SCcPgt/F+mWCLI93O td9bsv7a9xMNmQOu9U9WTFX22shClOo+MQngj8s6Ait1fdBPvNGdADYiOlft2j9/2Z3x O3jZqfxK1YLs7LUTmxAArZX/6Pl+k3q3T7zF43kLB25059IrGPmjttN3yQj8JXJbrzsA oCXH+4yxNkiLHLIAVwjo+csfqT4DgoszdQH/A7sIVGsBKVmPztnAoa/nc2Bea3TIfRjv yndg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=vJ2TonIRoJT3L4KNpRSn/1QIDsbLxVquiaVXym+5+9k=; b=nK+sOnt3lgc4BMGnJKIUo8zWIP7MXATcsHrlae8siareBjMcbPETIycuCMbPZWuH2c Gdsb6+enPU384Xx6XfH3Zb3Fbdua6Vo2lURAtrFmPSXDJLFrEFPaKzj/FttTR1YOH/uX 8jYyIrkOJN4e7uOWRtV8OqiThZ34uRqAASdyAkptLbTDfqTVHcUkWTTjT/hs2gwjEvnW FLNzn1cGotWC0vxenT5Jbsb/V1KLkcwNiHhO2uMQDJ664YxyX4GDfPG77fZUjEortXk6 Ku6PuqJPlFwLKi+/+Pb9UpWfY3jgNPWBl5o4woRx+RLIVOWZPJovurZOo7hVqKlaBKwl Jijg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=xH5xwFlx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si190233plo.461.2018.03.19.15.07.12; Mon, 19 Mar 2018 15:07:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=xH5xwFlx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934400AbeCSPzs (ORCPT + 99 others); Mon, 19 Mar 2018 11:55:48 -0400 Received: from vern.gendns.com ([206.190.152.46]:39298 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934117AbeCSPzP (ORCPT ); Mon, 19 Mar 2018 11:55:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; 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=vJ2TonIRoJT3L4KNpRSn/1QIDsbLxVquiaVXym+5+9k=; b=xH5xwFlxvDodF6QYErnqqFiF8F 5HuEwwcFaTvg6drZ66XOPCWHDqc7Zj+wRpsSHrx5jG2Ngq1VtmfT+/1bL8oX/LhMqjfvX/vEDQ9BC NdkJyFZInoIaC8DQ7oQ29oSzAY5FGOZaWJeN/IkqRKCpiB9liC7mrK8yWxQt5tiZmeldipbrtmHx4 VyYOXR6PTNvM2aTcDF7Ia3lGJPUHf+BGb3dOoAFIBN6vZEzDoXJTA/k+qqD14T8UcTFTExBRiLDa5 fPdZoWpwqoZBm88Gr2neni5FOLWE6GOLE7rZGupNyo5kauUPJ+yktbXTvSHk7NwaXATJRQviGEtbq hN7vbkKg==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:38126 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1exx5w-002j9F-Fa; Mon, 19 Mar 2018 11:53:08 -0400 Subject: Re: [PATCH AUTOSEL for 4.15 104/124] clk: fix reentrancy of clk_enable() on UP systems To: Sasha Levin , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Cc: Stephen Boyd References: <20180319154645.11350-1-alexander.levin@microsoft.com> <20180319154645.11350-104-alexander.levin@microsoft.com> From: David Lechner Message-ID: <6a944b80-c86c-ca23-5ada-f088d84c9a80@lechnology.com> Date: Mon, 19 Mar 2018 10:55:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180319154645.11350-104-alexander.levin@microsoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/19/2018 10:48 AM, Sasha Levin wrote: > From: David Lechner > > [ Upstream commit a12aa8a68dfef5de181f2e555aa950a0ab05411f ] > > Reentrant calls to clk_enable() are not working on UP systems. This is > caused by the fact spin_trylock_irqsave() always returns true when > CONFIG_SMP=n (and CONFIG_DEBUG_SPINLOCK=n) which causes the reference > counting to not work correctly when clk_enable_lock() is called twice > before clk_enable_unlock() is called (this happens when clk_enable() > is called from within another clk_enable()). > > This fixes the problem by skipping the call to spin_trylock_irqsave() on UP > systems and relying solely on reference counting. We also make sure to set > flags in this case so that we are not returning an uninitialized value. > > Suggested-by: Stephen Boyd > Signed-off-by: David Lechner > Signed-off-by: Stephen Boyd > Signed-off-by: Sasha Levin > --- I don't know of any existing bugs in v4.15 that this fixes, so I don't think this really fits the criteria for stable.