Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3150994imj; Mon, 18 Feb 2019 21:15:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IZaKhj/x5aSeaJsXfixOjM4pBUJSxA+iJxdutpaLNfZI512na7wnD4ttEQvQuG38ONMWZZR X-Received: by 2002:aa7:9289:: with SMTP id j9mr18924495pfa.130.1550553305290; Mon, 18 Feb 2019 21:15:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550553305; cv=none; d=google.com; s=arc-20160816; b=sHXF/b9xUie4qP7UWANsL8M5bFy3spvU760r7ksdVqoBWILr8i5czURvT6PWWDLFEf MaaXLQKLaOlSCxhdr6oR+ZaZIggV4DdvQGzDbd5S3HdIXt3nmCSUt1nNHyghfXHmq1p3 O2xulHfIBXExS0VDaXv2XQs/6CGRSyjJLrDFOxRS9pja6/sQjgeY7e5CdG7bVLku5ftw IhPJAH4/g7xGf5mJc7eMIIWa+PDFsrBnXnn7lxlOJ0JKGu2nQ8pEROMmCMdf27p1w25Y ktb2nIHfFirrnFbORiRsz8YF7xzYNwTczCdFj3mgmuubmqm2eLhzvA8LTEtl8GAm5e4T wKow== 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:dmarc-filter :dkim-signature:dkim-signature; bh=5E6EI9p88vTyNYlt4o6E2310Qy7sxjRurbALlCJPDDk=; b=hxDtbeCCmK7gRaD1fbfiGDqRqbmCLGIWW+eaQF44lfSnMWFLKAJwhnqVrz1hkE4OZ/ oY7+NMXFVVKF85C5FZRntRqCWKeQidkcSfDmEm+jF7Ag32b9dq8wZIEZ4eekDwC8FLka +ET5pw64KJcwftxonKOMV8g8ndlmmy8H6IXXUn/wCWo280HDdBGEU/k1BhMK02ZW0q3K /MTiXcRjkuV/oaJfAF9BTpHHFoGZsFDOTyGVwRDpPqB92Rq4LpFvgj2hmUoVJPOmfQQs rkauQWuZMpZAGC4V8UdCnvgZoiRiOOmIhdug5uXJjOzG8qGMFPoGXM6bfJO+W0GWjwdQ POmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dVGlHpWR; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZgLyAntn; 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 f14si17790918pln.221.2019.02.18.21.14.50; Mon, 18 Feb 2019 21:15:05 -0800 (PST) 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=pass header.i=@codeaurora.org header.s=default header.b=dVGlHpWR; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZgLyAntn; 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 S1726352AbfBSFMQ (ORCPT + 99 others); Tue, 19 Feb 2019 00:12:16 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:55826 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbfBSFMP (ORCPT ); Tue, 19 Feb 2019 00:12:15 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 94EA1601EA; Tue, 19 Feb 2019 05:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550553134; bh=UceMNJY89LMvSt0KG3sLmvSflj73++pbpAjRA3dwbhE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dVGlHpWRERoT56c8KrMG++dwN1PUk+46ntfbKu47kTLOj5o1otlcvKIxiG++L7z4e T+dpEaeNU5lWqeBRoxdMDM6Io4etWa6GABsJLZiWEodfQYy0Gbjm5dMKYxgoE8rYYX XGzdSx9ETaY0qa0LgFbyobjjYkqif5PHtdk7Chgk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.40.96] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 73679608CD; Tue, 19 Feb 2019 05:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550553133; bh=UceMNJY89LMvSt0KG3sLmvSflj73++pbpAjRA3dwbhE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ZgLyAntn529KBayr9+3bK2s2SlBzAyLgA1CbK0+05B/o5/loJr4/8FoXIW5rgZVt+ 4tQDmPhByhlsnyFDlYW+4f5l51uayWohEJvcM7SmKxf05NZdpi17P/o8zD7TO1KDb1 RSbtAMq0w68GWGjaVPcULXI7WM9xE+l9qNCn6Sy4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 73679608CD Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org Subject: Re: [PATCH v4] PM / devfreq: Restart previous governor if new governor fails to start To: myungjoo.ham@samsung.com, Kyungmin Park Cc: Chanwoo Choi , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-msm-owner@vger.kernel.org" , "skannan@codeaurora.org" References: <20181212135313.30268-1-sibis@codeaurora.org> <20181214014527epcms1p6c783b4cd1602bbcbcb6e725f840db479@epcms1p6> From: Sibi Sankar Message-ID: <39d3a906-b734-9bb8-c60a-48948bb21338@codeaurora.org> Date: Tue, 19 Feb 2019 10:42:01 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20181214014527epcms1p6c783b4cd1602bbcbcb6e725f840db479@epcms1p6> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey MyungJoo, On 12/14/18 7:15 AM, MyungJoo Ham wrote: >> From: Saravana Kannan >> >> If the new governor fails to start, switch back to old governor so that the >> devfreq state is not left in some weird limbo. >> >> Signed-off-by: Sibi Sankar >> Signed-off-by: Saravana Kannan >> Reviewed-by: Chanwoo Choi > > Hello, > > In overall, the idea and the implementation looks good. > > However, I have a question: > > What if the following line fails? > > + df->governor->event_handler(df, DEVFREQ_GOV_START, > + NULL); > > Don't we still need something to handle for such events? The original discussion went as follows: governor_store is expected to be used only on cases where devfreq_add_device() succeeded i.e prev->governor is expected to be present and DEVFREQ_GOV_START is expected to succeed. Hence falling back to the previous governor seems like a sensible idea. This would also prevent DEVFREQ_GOV_STOP from being called on a governor were DEVFREQ_GOV_START had failed which is ideal. That being said DEVFREQ_GOV_START can still fail for the prev-governor due to some change in state of the system. Do you want to handle this case by clearing the state of governor rather than switching to previous governor? > > Cheers, > MyungJoo > > -- Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc, is a member of Code Aurora Forum, a Linux Foundation Collaborative Project