Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2017782ybl; Sat, 1 Feb 2020 11:28:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzRXB8CJ94/AZKB660QZA1GCeoTYvpwNT6YxGyit+JI40zHQwD9iP+UuojJpJFSvMjq4LPV X-Received: by 2002:a54:480c:: with SMTP id j12mr9897230oij.130.1580585303002; Sat, 01 Feb 2020 11:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580585302; cv=none; d=google.com; s=arc-20160816; b=KmBnRwKdengQEef6ott3uQeUo5z5RSkhTDSO+26i/d5oqfS38GP5WYMEDbtladsRIR MOy2g7GtRUcTiNvNEeeQiUyQKmY9sMwSNdvpf21CMfGzI6SdttxGXAxiR2w3UFXOn9rV 2C3cGkDcgsoHewCCJ5qalscg4dboZCn4JAw3sZvJVTCmSfNnyO2yYQmcGcVyjSxfM6ra aVKI0qXC2G4gmDk+zUxN+x6AXjXhV+DoK/fAb1xgT2lYWeOZxpv78ILaFsKhC06Ml3yo frHQBo9omezj/9/oEsXdIv+q4k87bjk2LwpAGPYO2kREMis7glyWi+isBVJR4UkmltgN bt2w== 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; bh=dJ/L5jrNYa1Eq6tJkU2my0pQiH+GAMtl3p/qrGs/tJQ=; b=cCfBSsumVs5Pd4z1fzQPR4je66E+MnNSSKJiaZMzlwe7sTXToQJTxa+QTA5zJ0fs9q RqnTwrz3ycOOgcWxqS/79f8onVqwHKfFU17VTUOAhcF/eZ2A2PSgjbwdh/Rgsfk65rwS u1AYYPwa+wMKlgYi9f+cdAMJ51bCZQ7X4cw04a6AHq2fvIsjJguY/wZfOLEQ+hPxuezg /yWZ4H5e22zaYwdrAUWz1WDwhOd6O1BiQx+3w1rcvIdLR3yvu2R5Amhow6mZNOAWzz91 WWwMuG35Re7bhPdq7DFhlYApVGL1v/2MRKeulUzCCBuIi2XR/elJM6oAAo7hDfiPsNtH d8Ew== ARC-Authentication-Results: i=1; mx.google.com; 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 v76si5701654oif.207.2020.02.01.11.28.10; Sat, 01 Feb 2020 11:28:22 -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; 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 S1726722AbgBAT1O (ORCPT + 99 others); Sat, 1 Feb 2020 14:27:14 -0500 Received: from foss.arm.com ([217.140.110.172]:43486 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgBAT1O (ORCPT ); Sat, 1 Feb 2020 14:27:14 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C2CCEFEC; Sat, 1 Feb 2020 11:27:13 -0800 (PST) Received: from [192.168.122.164] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D2B093F68E; Sat, 1 Feb 2020 11:27:12 -0800 (PST) Subject: Re: [PATCH 6/6] net: bcmgenet: reduce severity of missing clock warnings To: Stefan Wahren , netdev@vger.kernel.org Cc: opendmb@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, andrew@lunn.ch, hkallweit1@gmail.com, Nicolas Saenz Julienne References: <20200201074625.8698-1-jeremy.linton@arm.com> <20200201074625.8698-7-jeremy.linton@arm.com> <2dfd6cd2-1dd0-c8ff-8d83-aed3b4ea7a79@gmx.net> From: Jeremy Linton Message-ID: <34aba1d9-5cad-0fee-038d-c5f3bfc9ed30@arm.com> Date: Sat, 1 Feb 2020 13:27:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <2dfd6cd2-1dd0-c8ff-8d83-aed3b4ea7a79@gmx.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, First, thanks for looking at this! On 2/1/20 10:44 AM, Stefan Wahren wrote: > Hi Jeremy, > > [add Nicolas as BCM2835 maintainer] > > Am 01.02.20 um 08:46 schrieb Jeremy Linton: >> If one types "failed to get enet clock" or similar into google >> there are ~370k hits. The vast majority are people debugging >> problems unrelated to this adapter, or bragging about their >> rpi's. Given that its not a fatal situation with common DT based >> systems, lets reduce the severity so people aren't seeing failure >> messages in everyday operation. >> > i'm fine with your patch, since the clocks are optional according to the > binding. But instead of hiding of those warning, it would be better to > fix the root cause (missing clocks). Unfortunately i don't have the > necessary documentation, just some answers from the RPi guys. The DT case just added to my ammunition here :) But really, I'm fixing an ACPI problem because the ACPI power management methods are also responsible for managing the clocks. Which means if I don't lower the severity (or otherwise tweak the code path) these errors are going to happen on every ACPI boot. > > This is what i got so far: BTW: For DT, is part of the problem here that the videocore mailbox has a clock management method? For ACPI one of the paths of investigation is to write AML which just interfaces to that mailbox interface for clock control here. (there is also SCMII to be considered). > > diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi > index 961bed8..d4ff370 100644 > --- a/arch/arm/boot/dts/bcm2711.dtsi > +++ b/arch/arm/boot/dts/bcm2711.dtsi > @@ -338,6 +338,8 @@ >                         reg = <0x0 0x7d580000 0x10000>; >                         #address-cells = <0x1>; >                         #size-cells = <0x1>; > +                       clocks = <&clocks BCM2711_CLOCK_GENET250>; > +                       clock-names = "enet"; >                         interrupts = , >                                      ; >                         status = "disabled"; > diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c > index ded13cc..627f1b1 100644 > --- a/drivers/clk/bcm/clk-bcm2835.c > +++ b/drivers/clk/bcm/clk-bcm2835.c > @@ -116,6 +116,10 @@ >  #define CM_EMMCDIV             0x1c4 >  #define CM_EMMC2CTL            0x1d0 >  #define CM_EMMC2DIV            0x1d4 > +#define CM_GENET250CTL         0x1e8 > +#define CM_GENET250DIV         0x1ec > +#define CM_GENET125CTL         0x210 > +#define CM_GENET125DIV         0x214 > >  /* General bits for the CM_*CTL regs */ >  # define CM_ENABLE                     BIT(4) > @@ -2021,6 +2025,25 @@ static const struct bcm2835_clk_desc > clk_desc_array[] = { >                 .frac_bits = 8, >                 .tcnt_mux = 42), > > +       /* GENET clocks (only available for BCM2711) */ > +       [BCM2711_CLOCK_GENET250]        = REGISTER_PER_CLK( > +               SOC_BCM2711, > +               .name = "genet250", > +               .ctl_reg = CM_GENET250CTL, > +               .div_reg = CM_GENET250DIV, > +               .int_bits = 4, > +               .frac_bits = 8, > +               .tcnt_mux = 45), > + > +       [BCM2711_CLOCK_GENET125]        = REGISTER_PER_CLK( > +               SOC_BCM2711, > +               .name = "genet125", > +               .ctl_reg = CM_GENET125CTL, > +               .div_reg = CM_GENET125DIV, > +               .int_bits = 4, > +               .frac_bits = 8, > +               .tcnt_mux = 50), > + >         /* General purpose (GPIO) clocks */ >         [BCM2835_CLOCK_GP0]     = REGISTER_PER_CLK( >                 SOC_ALL, > diff --git a/include/dt-bindings/clock/bcm2835.h > b/include/dt-bindings/clock/bcm2835.h > index b60c0343..fca65ab 100644 > --- a/include/dt-bindings/clock/bcm2835.h > +++ b/include/dt-bindings/clock/bcm2835.h > @@ -60,3 +60,5 @@ >  #define BCM2835_CLOCK_DSI1P            50 > >  #define BCM2711_CLOCK_EMMC2            51 > +#define BCM2711_CLOCK_GENET250         52 > +#define BCM2711_CLOCK_GENET125         53 > >