Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1501895ybt; Sat, 20 Jun 2020 12:15:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx82us43S5P8P3/NhiTcjVbUy3/iJiW/qYr1K9/b7YTOoRgdt1AOR6g4YESPW3FUM2F+kFc X-Received: by 2002:a17:906:9257:: with SMTP id c23mr8872269ejx.86.1592680545974; Sat, 20 Jun 2020 12:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592680545; cv=none; d=google.com; s=arc-20160816; b=ra7wdJ0nmbJvSrHkE2KLrtyZRXDxGF8yR1QmA9MeVdhLuDkVYSQOjdPQ3aH6/wXLku GixayHaDgAJ82wi8DemynXc9Gz4I2sn/uAzo1t5NZ4QdjaEKFV0l8jYW/OEamgcvvDoU fi2kMVjjKOQgE8VHMSSKGee4Sx6IOMXMY9s/5yhM7cPV6D6G447+U0+W/QWz3dYeoyFt sxerglVZr6crLG3d5WKWRF26V1eeokgwjblkG37TLS7TzLW8Q/tr0VtPuRUUnFCL6T5T cQYexfC+OCJNo3ZoCoWk/S1xE79uNaUPSJjvGQx1+RcsTskgyCFKZxUh4S0kInOgFU6W Vr2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mL+LzrTaTpMmAtb52y22j4i7VVpV+VPptaPnFUzVNyE=; b=Q4Pgc+hbU9AZFxyTkLSbpwxiTRblTMeoZwK83JKgjZxI2H3lfWOh/erEQ+rUCwqxLB EnPPJRMDcTFNK9+QKFPz/pBNt5dJLf4a715ttWEJlePreBW2eONLiScKSm3St1M/Wltl 7bMd6cMSvEQQVQhlFnYzdPngbULdxTbLh2LES4swi9y2MYCva0y24TIIHVsdLMu6ebh5 W4HTeJT7oja8jJ+mhFtkYJSUGtD61MswzYp7XjKlIgZ5V7THuRlOjyfofRxvysWMtdWb OlQ8FFaFl7Ezw6I74ITqHD6v170W1ChuVlicScDCD90+Jv72eALfMfe8SPm9tjjGDaDF XL7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org ([23.128.96.18]) by mx.google.com with ESMTP id n25si6070460edv.294.2020.06.20.12.15.22; Sat, 20 Jun 2020 12:15:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728574AbgFTTLD (ORCPT + 99 others); Sat, 20 Jun 2020 15:11:03 -0400 Received: from mail.rc.ru ([151.236.222.147]:39546 "EHLO mail.rc.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728424AbgFTTLD (ORCPT ); Sat, 20 Jun 2020 15:11:03 -0400 Received: from mail.rc.ru ([2a01:7e00:e000:1bf::1]:57848) by mail.rc.ru with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmitD-0005jw-Fs; Sat, 20 Jun 2020 20:10:55 +0100 Date: Sat, 20 Jun 2020 20:10:52 +0100 From: Ivan Kokshaysky To: Andrew Lunn Cc: Gregory Clement , Jason Cooper , Sebastian Hesselbarth , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: dt: fix oops on armada37xx Message-ID: <20200620191052.GA21708@mail.rc.ru> References: <20200620164449.GA19776@mail.rc.ru> <20200620175438.GS304147@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200620175438.GS304147@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 20, 2020 at 07:54:38PM +0200, Andrew Lunn wrote: > On Sat, Jun 20, 2020 at 05:44:49PM +0100, Ivan Kokshaysky wrote: > > Commit 0c868627e617e43a295d8 (cpufreq: dt: Allow platform specific > > intermediate callbacks) added two function pointers to the > > struct cpufreq_dt_platform_data. However, armada37xx_cpufreq_driver_init() > > has this struct (pdata) located on the stack and uses only "suspend" > > and "resume" fields. So these newly added "get_intermediate" and > > "target_intermediate" pointers are uninitialized and contain arbitrary > > non-null values, causing all kinds of trouble. > > > > For instance, here is an oops on espressobin after an attempt to change > > the cpefreq governor: > > > > [ 29.174554] Unable to handle kernel execute from non-executable memory at virtual address ffff00003f87bdc0 > > ... > > [ 29.269373] pc : 0xffff00003f87bdc0 > > [ 29.272957] lr : __cpufreq_driver_target+0x138/0x580 > > ... > > > > Fixed by zeroing out pdata before use. > > > > Signed-off-by: Ivan Kokshaysky > > Hi Ivan > > A Fixes: tag would be good. Hi Andrew, I'm not sure that "Fixes:" would be appropriate here - commit 0c868627e617 is fine by itself, it just revealed a bug in older code. Thanks for reviewing, Ivan. > Reviewed-by: Andrew Lunn > > Andrew