From patchwork Thu Nov 19 08:17:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Choi X-Patchwork-Id: 7655761 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 706559F2EC for ; Thu, 19 Nov 2015 08:19:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6C6F20602 for ; Thu, 19 Nov 2015 08:19:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C75F02052A for ; Thu, 19 Nov 2015 08:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757087AbbKSITK (ORCPT ); Thu, 19 Nov 2015 03:19:10 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:51455 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933424AbbKSIR7 (ORCPT ); Thu, 19 Nov 2015 03:17:59 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NY100QFNZ1WYT30@mailout1.samsung.com>; Thu, 19 Nov 2015 17:17:56 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.113]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 24.8A.17463.4B58D465; Thu, 19 Nov 2015 17:17:56 +0900 (KST) X-AuditID: cbfee68e-f79f56d000004437-fa-564d85b4eba2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 6B.0E.24993.3B58D465; Thu, 19 Nov 2015 17:17:55 +0900 (KST) Received: from chan.10.32.193.11 ([10.252.81.195]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NY1003GGZ1VYC80@mmp1.samsung.com>; Thu, 19 Nov 2015 17:17:55 +0900 (KST) From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Chanwoo Choi Subject: [PATCH 6/6] PM / devfreq: Set the min_freq and max_freq of devfreq device Date: Thu, 19 Nov 2015 17:17:50 +0900 Message-id: <1447921070-6045-7-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1447921070-6045-1-git-send-email-cw00.choi@samsung.com> References: <1447921070-6045-1-git-send-email-cw00.choi@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsWyRsSkUHdLq2+YweRPzBbXvzxntTjb9Ibd 4vKuOWwWn3uPMFrcblzB5sDq0bdlFaPH501yAUxRXDYpqTmZZalF+nYJXBk3HnexFTxnq+jb U9vA+IC1i5GTQ0LAROLq3e9sELaYxIV764FsLg4hgRWMEiv6TsEVnXt4iR0isZRRonHde2YI 5wujxOFT18Cq2AS0JPa/uAE2SkTAXGLX0p9gNrNAksT5tU1ANRwcwgIhEpN74kDCLAKqEm/2 XWICsXkFXCSaJ+yEukJO4sOeR+wgNqeAq8Tx9acYQWwhoJpb3U/AjpAQ+M4mMf/MRUaIQQIS 3yYfYgGZLyEgK7HpADPEHEmJgytusExgFF7AyLCKUTS1ILmgOCm9yEivODG3uDQvXS85P3cT IzBkT/971reD8eYB60OMAhyMSjy8G075hAmxJpYVV+YeYjQF2jCRWUo0OR8YGXkl8YbGZkYW piamxkbmlmZK4rwJUj+DhQTSE0tSs1NTC1KL4otKc1KLDzEycXBKNTA6Bc2zfMng7jxz8kGJ 8ntzRZjWPmcJt46T4Db+N/egTfaF50EG2z4HdomI3Yhn3HCl9Tq/WEHtl6tqXt6Pl6wUMVha f3ly/IHN1cxmzbfrZ+Z17X9180xrxa9HG+794OL7YtK+Zf1543lnN+dZVjtk+WcKzIt26VZ0 8f/+Ipvj307bCR13z99WYinOSDTUYi4qTgQAxLTyo1QCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42I5/e+xgO7mVt8wgzVfbSyuf3nOanG26Q27 xeVdc9gsPvceYbS43biCzYHVo2/LKkaPz5vkApiiGhhtMlITU1KLFFLzkvNTMvPSbZW8g+Od 403NDAx1DS0tzJUU8hJzU22VXHwCdN0yc4DWKSmUJeaUAoUCEouLlfTtME0IDXHTtYBpjND1 DQmC6zEyQAMJaxgzbjzuYit4zlbRt6e2gfEBaxcjJ4eEgInEuYeX2CFsMYkL99azdTFycQgJ LGWUaFz3nhnC+cIocfjUNbAONgEtif0vbrCB2CIC5hK7lv4Es5kFkiTOr20CquHgEBYIkZjc EwcSZhFQlXiz7xITiM0r4CLRPGEnG8QyOYkPex6BLeYUcJU4vv4UI4gtBFRzq/sJ+wRG3gWM DKsYJVILkguKk9JzDfNSy/WKE3OLS/PS9ZLzczcxguPimdQOxoO73A8xCnAwKvHwbjjlEybE mlhWXJl7iFGCg1lJhPdBmW+YEG9KYmVValF+fFFpTmrxIUZToMMmMkuJJucDYzavJN7Q2MTM yNLI3NDCyNhcSZxX39MoTEggPbEkNTs1tSC1CKaPiYNTqoGxo2Rb1toH1+x8/guYS9c5LI8v 6qnMWfxw/yGmyOsvsvimdoj+j9vsLHr9QdTrq9tvyLuKP/o7b3JEP+OkV/tXusYqvYhze3A7 IbxJ0DXt8t7wCax3XU/uWdH69LuoclXoxZs+R3XiZm++/H39gpT/Fw3CtrhmXwpRev4/MVlS 0yRyg9fxtdnvlViKMxINtZiLihMByhPIsqECAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After probing the devfreq device driver, the value of both min_freq and max_freq are zero(0). So, this patch initializes the 'min_freq' and 'max_freq' field of devfreq device by using the freq_table array. Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index c292ceb7ff19..0b24ae7b7a48 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -121,6 +121,11 @@ static void devfreq_set_freq_table(struct devfreq *devfreq) profile->freq_table[i] = freq; } rcu_read_unlock(); + + mutex_lock(&devfreq->lock); + devfreq->min_freq = profile->freq_table[0]; + devfreq->max_freq = profile->freq_table[profile->max_state - 1]; + mutex_unlock(&devfreq->lock); } /**