Received: by 10.223.185.116 with SMTP id b49csp865212wrg; Wed, 21 Feb 2018 08:09:26 -0800 (PST) X-Google-Smtp-Source: AH8x22536Y4a9jR/oz0X25iO3YvWQwMNZ8UuygDi0diljaWdStGCSM05rG8smvjE3HZ9IS4kWdod X-Received: by 10.99.189.82 with SMTP id d18mr3143930pgp.172.1519229366022; Wed, 21 Feb 2018 08:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519229365; cv=none; d=google.com; s=arc-20160816; b=ImihARG9346Y28+/PpyZD4c7mZivj3nkcvr2WiIBmbfrKRIcI44DAv80grzG9H302Q C+BVogcEu9Goy1Ejz08tfmjB8qkJ75k+f+acufGCvoMkaUaFPDIKaqfEGqmHgXKoAPMp 7vqrsng1CAFtQACJxNEjhSToAIBjJsVTZZ2sgjyVM6UxZr+ADK9No3JaK0YACTUnyxxJ QbapTpDXpFFtdlTOPvBqcT2cOHdUEldSNMOAcT3VSOvL1gWoxowkICEuWTapCBHN9LYe WXteKsal1CjOne+ZPE6fiKqfyXUpQxeenmGdKv1XjlL5Xz7xyV6Uvu2mpBPQ3K+H4lip Z8ag== 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:dkim-signature:arc-authentication-results; bh=se042VUhnAiFc7x3TbLBmyVfVGFswkGMyue22SHwjK4=; b=SzTXTEKjvrr5C7JwLZiKRT2RIED9Hhm8C0kmqQu7Iq4FHKOLUOe7JLb/rYDTWd2mOe ArZivyApqRHUS7IQIdfv5/bRnBqkeDVXMpRtvfCUYpi2WDnXbwnfyEY99txTUqNFff/X EguRL/D9FqD02W9h8d3TT7M2M4VenE/7QhJj7/dmwtYE3PTJ39hgWxX2EQkxn7pMPc80 j74iuRjyL8eDQGiywiupE1HO4ZiZPbF+yK+lNev5F3Y5AH7RkdkoCtPsHLQGL0qo0DIy j4TMFbVr5DfvzrYKWs18WUTO6TmYoFh4WkWX5YbCmmeQzWWPLSm3OYiEGW9YYx05rvsB XyBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jviaq6rw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l62si2722533pgd.777.2018.02.21.08.09.11; Wed, 21 Feb 2018 08:09:25 -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=@linaro.org header.s=google header.b=jviaq6rw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932687AbeBUKCP (ORCPT + 99 others); Wed, 21 Feb 2018 05:02:15 -0500 Received: from mail-pg0-f49.google.com ([74.125.83.49]:35738 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932631AbeBUKCO (ORCPT ); Wed, 21 Feb 2018 05:02:14 -0500 Received: by mail-pg0-f49.google.com with SMTP id l131so456806pga.2 for ; Wed, 21 Feb 2018 02:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=se042VUhnAiFc7x3TbLBmyVfVGFswkGMyue22SHwjK4=; b=jviaq6rw6qIFiorWSY2KiN7akbrLYstW6N9JuoY2F1Um/qJmTehGLyU6vOddto0rgc IPwZxx1bjwwpIBX3O9miaXNXTWZVwAlqZHnhzvzsvOxbGNJVDFt3w/oVO7WQzyDLww3E igsvTRpTsB42f5D0zopcwWxevE9NgDATV9oFQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=se042VUhnAiFc7x3TbLBmyVfVGFswkGMyue22SHwjK4=; b=f/qP4SewiQjUULRHaOjt1g6jHZjNbxAmqMdZ+jBwXIjaBqRcRCpbjO5ckA/rW5hwIt ZfQ7j6I7QmUUKo98kaHOHrt0JURc8/dMNnKbkM3A0hUp26FWA9CksFuG+rBDwuTgKbhO 1ePhHbnQKrXhVJtEOucNKpYe2KRhbszWTALn2xCLF1SLddBp8G6V6hAOwJQQBCfZEhbF S+Kslt/4EcrwuxGT1ofMp+EaI5Z8iVgqpD/+8ub2dwiqbv1lN6wTVxNRMTu0UgnkfQlV xi50zXOtdDsCO4iPNqURmc5jngT6qaqUGW05bhepiBGzQst51FFfp+JNFKMRKTYoMMQq FlcQ== X-Gm-Message-State: APf1xPDFCwYZIKJziBFIHQtFCz92iMnOlsHtivYyAJZVk69bVJnwgJGu SQvma/rwELWNijedW0RuCY02VZviry4= X-Received: by 10.98.210.70 with SMTP id c67mr2766855pfg.164.1519207333555; Wed, 21 Feb 2018 02:02:13 -0800 (PST) Received: from localhost ([122.167.232.138]) by smtp.gmail.com with ESMTPSA id u13sm68270126pfd.169.2018.02.21.02.02.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 02:02:12 -0800 (PST) Date: Wed, 21 Feb 2018 15:32:09 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Michael Ellerman , Shilpasri G Bhat , "Rafael J. Wysocki" , Linux PM , Linux Kernel Mailing List , linuxppc-dev Subject: Re: [PATCH] cpufreq: powernv: Check negative value returned by cpufreq_table_find_index_dl() Message-ID: <20180221100209.GP28462@vireshk-i7> References: <1518430876-24464-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> <20180212102900.GU28462@vireshk-i7> <874lmasxxx.fsf@concordia.ellerman.id.au> <20180221055450.GO28462@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-02-18, 10:27, Rafael J. Wysocki wrote: > To be precise, ->init() should fail as that's where the table is > created. The registration fails as a result then. > > But what if the bug is that ->init() doesn't fail when it should? > > I guess the core could double check the frequency table after ->init() > if ->target_index is not NULL. > > The overall point here is that if you get a negative index in > ->fast_switch(), that's way too late anyway and we should be able to > catch that error much earlier. I don't want to end up doing double checking as some of it is already done at init, but let me check on what can be done. -- viresh