From owner-freebsd-stable@FreeBSD.ORG Sat May 26 06:21:18 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4A2B1065672 for ; Sat, 26 May 2012 06:21:18 +0000 (UTC) (envelope-from annona2@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7E9428FC0A for ; Sat, 26 May 2012 06:21:18 +0000 (UTC) Received: by dadv36 with SMTP id v36so2197313dad.13 for ; Fri, 25 May 2012 23:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=16bTNajBayYf0953M+ePQ//oGJZCKqukCH0eRT/Z2xs=; b=O4Z6w5NCDj24sFR3ExNh7KEPpLwb1QVGnahMbXLIvnx/7hMwWOTFnxMlaDj3+qNduu pmQiSO60bSjRmCVFFVLyzEWasEStBru0TTRZO/tZqQKMLXpnPYH+Xg2cetjGaKpuqnJ/ F6zZCRF470WXtZnRhGBMxNZAVsalY4jFA0As/CjWJaIrjz6qc41/v3tpLS1hnEkYV9nP bmqvvBCd5H3RUBlwgBTTQvLYB0uqrIjTdLpwH+LamlzkZFh3u3jOmKDxbi3aFSkXAJlI GkC4swJi/Ng67Tj+cVQgdDQJJZtnxq0DhF5y0nnT5BMRvLbvJQyW7K5GNn4DKXXuS/M9 6GnA== Received: by 10.68.221.74 with SMTP id qc10mr4678674pbc.31.1338013277947; Fri, 25 May 2012 23:21:17 -0700 (PDT) Received: from localhost (52.241.197.113.dy.bbexcite.jp. [113.197.241.52]) by mx.google.com with ESMTPS id kh10sm11530396pbc.67.2012.05.25.23.21.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 May 2012 23:21:16 -0700 (PDT) Received: from r10 (localhost [127.0.0.1]) by localhost (8.14.5/8.14.5) with SMTP id q4Q6LCM0005244 for ; Sat, 26 May 2012 15:21:12 +0900 (JST) (envelope-from annona2@gmail.com) Date: Sat, 26 May 2012 15:21:12 +0900 From: "Gen O." To: freebsd-stable@freebsd.org Message-Id: <20120526152112.42b20e45.annona2@gmail.com> In-Reply-To: <4FBFE624.1020208@FreeBSD.org> References: <1337319129.2915.4.camel@powernoodle-l7> <4FB6765A.2050307@FreeBSD.org> <1337710214.2916.8.camel@powernoodle-l7.corp.yahoo.com> <20120525163653.b61a08e2.lists@yamagi.org> <4FBFA9A9.7020806@FreeBSD.org> <4FBFBD39.7000105@FreeBSD.org> <4FBFDFFB.9020501@FreeBSD.org> <4FBFE624.1020208@FreeBSD.org> X-Mailer: Sylpheed 3.1.4 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [stable 9] broken hwpstate calls X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 06:21:18 -0000 Hi, I suprised that followings , cited from AMD BKDG(42301 Rev 3.06 - January 25, 2012) > 2.5.2.1.4 > Core P-state Visibility > (snip) > If a compute unit is in a boosted P-state, MSRC001_0063[CurPstate] > reads back as 0. ^^^^^^^^^^^^^ if in a boosted P-state, MSRC001_0063 "reads back as 0". so here is ugly patch ;-) --- hwpstate.c.orig 2012-05-26 15:06:06.000000000 +0900 +++ hwpstate.c 2012-05-26 15:07:50.000000000 +0900 @@ -196,7 +196,7 @@ msr = rdmsr(MSR_AMD_10H_11H_STATUS); HWPSTATE_DEBUG(dev, "result P%d-state on cpu%d\n", (int)msr, PCPU_GET(cpuid)); - if (msr != id) { + if (msr != id && msr != 0) { HWPSTATE_DEBUG(dev, "error: loop is not enough.\n"); error = ENXIO; } but this doesn't reflect that the cpu frequency is equal to sysctl value. So, disabling the boost and setting the p-state is an answer. And when setting the max freq from sysctl, enable the boost is also. -- Gen O.