Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4202771ybc; Fri, 15 Nov 2019 00:14:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxtL9ibDQ4nEm9AkVulTwP3asIHvaHiENz3ZlPw2+S9335gteMRTatGBOfzJD/aLBjqfTJU X-Received: by 2002:a17:906:1c59:: with SMTP id l25mr11928389ejg.98.1573805683865; Fri, 15 Nov 2019 00:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573805683; cv=none; d=google.com; s=arc-20160816; b=P5SQ+56jwED5gNkZMLU1grUUatSrHLo1sHvThsTc9ID1DX1PJpoOWAzA1ycS313qJC 6Ez/z4D8qYqKDTCOPCiZtF3WQ7xSdQpGrYIdNDBhxTwwo25hO2UNyEwr9QEIqSgw2mZx VRKAdHXajjPu1E/S+9MxphIFNxJfmUFoC23ihwo+oU5Aeywl62zl/jvQkdDvZ5I7LVP7 g4PXQr8DYiOxfD2ZGjwgM7LgYVIm4xEU7Qc2uJyLHGbc+8jmfju3JtvGrZxg78rLhueG kMBXblWxy7jnV5/+oGsbyHkOxyhYfExab0oGgIymOix7WxJomskKZ2VFO325paI7B7Ff fcOQ== 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:dkim-signature; bh=cSkg4y8vQ0fWUekpUvYTG37APlVQNKH+BU4UyQZbeZs=; b=tw4jGLJYF2THJwN1bB5uqLrHo+IwGS/yKTXxtvVUWJtSsgSKRRKgpTwpskTPWUS5vF EOqSN3t0doTkxgmKV2Mcl0L6T6KVXSAZ3l/PPCfC52OwqhjQE8fvXwjJbagAo3owXKQc 1omd5evNyNWfKUX50HPd5fAVPymY/bNs45Y99ZMBBHUlFK3E+aUHhmY+JXLS4aNJpGQA 1C4TXSvHS5o4sYpSx0HYe1AqHFSjJaRCDeIfE7jtrZrdRl/quB/Vr+GL4Dviil90L1oc abK5i2+ij5WB6Qp4z6+PPxD/R6NIqHO1qf0K7ZwuO43t/fNkaEjK1CO9g8tIR+QZIOyU D6aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=bhvYGZ1l; 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 l42si6240251edc.309.2019.11.15.00.14.19; Fri, 15 Nov 2019 00:14:43 -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=@rasmusvillemoes.dk header.s=google header.b=bhvYGZ1l; 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 S1727474AbfKOILr (ORCPT + 99 others); Fri, 15 Nov 2019 03:11:47 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:35310 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfKOILp (ORCPT ); Fri, 15 Nov 2019 03:11:45 -0500 Received: by mail-lf1-f67.google.com with SMTP id i26so7351146lfl.2 for ; Fri, 15 Nov 2019 00:11:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cSkg4y8vQ0fWUekpUvYTG37APlVQNKH+BU4UyQZbeZs=; b=bhvYGZ1lTQHiSLEBGy316WOg8uJmr19WMwnbnCNIAe+g9dECIpGAveiykIv51Zsp5H q5H02EIco+WEDC56pAH5UpavswZnVJ6/TzgN01/XvbZ3WOk6dfiSFEIqLOP91nIopmjO i5sekMVyCaqS+WJFufl8nVmciwx4GpUp4vHh4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cSkg4y8vQ0fWUekpUvYTG37APlVQNKH+BU4UyQZbeZs=; b=r2cd7sG/S1dxYXIgmAGLx/SeAoNiGupwu13CmaDz8REU2qDacvBfmfCYOiUHy1RSRT uDfC4FUdWUR5A4GiMbgAMtU0O0OKslpPvNYisMj/LbErypNbApAgEXap+8WBddt6bNpZ b3v5tR2K8WiG6bH9YhH6Z2YGX9PckSJe7/vt/FUnJryK7sohwbxPvM4jedKOspwAMGvM xcrDh8N8TlVSE4xRE9GKnQwiBcdsnck6h3YR6uZJLGEQAlYwC8wjFU4K5+WrYXfgc49d nb+inl689p3Evme83j3/kXIiNHnv6QssYlxXRvoSFJgZqLREPjCMz2zphDE07eN72IyP YiOw== X-Gm-Message-State: APjAAAXFGXq9lL8Ohs1bmq+d3wrx8aII/FlBwyReJAVkr7XlzZ46hMKW cNnEwIkhM20KnpiVcWVV1kcX11lVPPdw8WiN X-Received: by 2002:a19:8104:: with SMTP id c4mr317478lfd.165.1573805503320; Fri, 15 Nov 2019 00:11:43 -0800 (PST) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id m8sm3414243ljj.80.2019.11.15.00.11.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2019 00:11:42 -0800 (PST) Subject: Re: [PATCH v4 07/47] soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32 To: Timur Tabi Cc: Qiang Zhao , Li Yang , Christophe Leroy , Scott Wood , linuxppc-dev@lists.ozlabs.org, lkml , linux-arm-kernel References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> <20191108130123.6839-8-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: <027c2b7a-a235-cecf-9f08-f71736f2ea55@rasmusvillemoes.dk> Date: Fri, 15 Nov 2019 09:11:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 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 On 15/11/2019 05.50, Timur Tabi wrote: > On Fri, Nov 8, 2019 at 7:04 AM Rasmus Villemoes > wrote: >> >> +static bool qe_general4_errata(void) >> +{ >> +#ifdef CONFIG_PPC32 >> + return pvr_version_is(PVR_VER_836x) || pvr_version_is(PVR_VER_832x); >> +#endif >> + return false; >> +} >> + >> /* Program the BRG to the given sampling rate and multiplier >> * >> * @brg: the BRG, QE_BRG1 - QE_BRG16 >> @@ -223,7 +231,7 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier) >> /* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says >> that the BRG divisor must be even if you're not using divide-by-16 >> mode. */ > > Can you also move this comment (and fix the comment formatting so that > it's a proper function comment) to qe_general4_errata()? > I actually thought of doing that, but decided against it because the comment not only mentions the SOCs affected, but also explains the following math/logic. I mean, without that comment nearby, the code is if (qe_general4_errata()) if (some weird condition) divisor++; In contrast, I think the qe_general4_errata() is pretty self-explanatory - is this a SOC affected by that errata (whatever that errata may be about and what the software workaround is). Rasmus