From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCD35C43215 for ; Fri, 15 Nov 2019 08:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF22420740 for ; Fri, 15 Nov 2019 08:11:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="bhvYGZ1l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727485AbfKOILr (ORCPT ); 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-Google-Smtp-Source: APXvYqx6iGcHvwJhuRwgIveFwGhIs3bltyGjSHCtX4coi17em4/eMuEjk9toc+eYfX3AS6UqL2gs4g== 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 197F3C432C3 for ; Fri, 15 Nov 2019 08:13:58 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE84620729 for ; Fri, 15 Nov 2019 08:13:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="bhvYGZ1l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE84620729 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47Drhz5CLNzF6sY for ; Fri, 15 Nov 2019 19:13:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=rasmusvillemoes.dk (client-ip=2a00:1450:4864:20::141; helo=mail-lf1-x141.google.com; envelope-from=linux@rasmusvillemoes.dk; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="bhvYGZ1l"; dkim-atps=neutral Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47DrfX5TgVzF3g2 for ; Fri, 15 Nov 2019 19:11:47 +1100 (AEDT) Received: by mail-lf1-x141.google.com with SMTP id v8so7288509lfa.12 for ; Fri, 15 Nov 2019 00:11:47 -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=j+4GdVFf3tX6VQaPJsGcTvCdHqwnIx8qbPg+54wUpDBugS0TXHML2sui8kLSOV0JAM 27sHthut/QwjyHDLjJJeu/xNeQfAjT2iEXPjkg712JM3XnnRB62s9uOAbyotNVOtfFY5 LKG05BiqjxF2jKXBJO3BBxa3CbeZk3ZPYMcTL2ITGbRcWyfJ1hf3SPvJ5plta0//+gls YAErRq9mMVlI/ZAntA2TyfAFDYMSU+zBUiXKA6JhiWRk9wz2ARDowC2N3PdkLfUPGKCi c9lkE9hz5xJWeRK3sksdoSR1XNRlU9nouAkOEIqlTF8jqYxptwXR0eQr6ZKfSOnDVgBx 7G3Q== X-Gm-Message-State: APjAAAUvKN8oRgZB2ySZalr1dadBGde+E4xpMY0qvI/+GnWY4ZSZCyYw 06zVl0wK058H96gstUJHb3TMgA== X-Google-Smtp-Source: APXvYqx6iGcHvwJhuRwgIveFwGhIs3bltyGjSHCtX4coi17em4/eMuEjk9toc+eYfX3AS6UqL2gs4g== 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lkml , Li Yang , Scott Wood , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel , Qiang Zhao Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62E87C432C3 for ; Fri, 15 Nov 2019 08:11:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D5232073B for ; Fri, 15 Nov 2019 08:11:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aImKr5tw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="bhvYGZ1l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D5232073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UXkZZdKHPLwmcmhESONrjYerHeFzqd+XzBXngn30e28=; b=aImKr5twYu3dbd o2mt0a5lNvkMLvX2tg1DhhYfQBYRIxeCKbF5NvfjM2qdgAUPLVbg6yptuF6M0i6TjBQ/5goNB9ASL XLx2vu6KJgKqddwwbiPo02Vpqfs1jB4RP3XhA+TXuEy08EHRHoUvOrQvBTPlyeQaKNnWygyUU6W5w KQZfGS9n0qtk/WiugKYM68gJiLl1coUqlVTjycrei4fR2XKEFyMMyAAKfomZuJQYqmVXK5ZTNd+Wu z0qLnB5wmsCji6FhvJ8OZfwydhzOtbCoAkSjzW8FiCY9XomC7yTUSs0c3U7t1qIxcKTWftR5vdxGN 6DQ54oS8Nm6bD7bvQQnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVWho-0003fq-9d; Fri, 15 Nov 2019 08:11:48 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVWhl-0003f2-EX for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 08:11:46 +0000 Received: by mail-lf1-x141.google.com with SMTP id v8so7288518lfa.12 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=bASvwNJj/VVkJOZ/qQgZz5ZBTMmvbP0bAP7aJeAX4sTKbnEY8XsZ2VV77KdmE87UwR ExXxsgd2fzyoDJAqmq7710cV6Wn/8iPqkjI8v3I29bhPRIPklRGp+A5+UpwMx7IPdX7w aWyIpRLkP8C5+c4ulzGg2X9OTCY7Qdc76JWpdQpcAsAgM808SLcM1AMZujiKvEY7XvQV nnwXgGfvSCZPBoyZgsYwt6wmKSHAf3vzI7qIuUmQk8yvQL5xeK3thB73p6hP/NUsEbYQ RM76bE7P3teLuCEzOSAqexlidy4Uw9c/hKnXQrRJMy1xpr5JorHtBv3xgwAADrpTRIqS 4lfg== X-Gm-Message-State: APjAAAVuBALhODY9+vxT6ZWE5rTKEbYoTLMBuSxuoL6Q3CHamfCA282i aJ9giCdUfCkheMAkXrV2Z2/omWIYRef88boH X-Google-Smtp-Source: APXvYqx6iGcHvwJhuRwgIveFwGhIs3bltyGjSHCtX4coi17em4/eMuEjk9toc+eYfX3AS6UqL2gs4g== 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_001145_491391_0FE37430 X-CRM114-Status: GOOD ( 14.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe Leroy , lkml , Li Yang , Scott Wood , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel , Qiang Zhao Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel