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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 E0EA1C282C2 for ; Thu, 7 Feb 2019 22:06:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5E3A21721 for ; Thu, 7 Feb 2019 22:06:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bpqRZ+gz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbfBGWGl (ORCPT ); Thu, 7 Feb 2019 17:06:41 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52738 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfBGWGk (ORCPT ); Thu, 7 Feb 2019 17:06:40 -0500 Received: by mail-wm1-f65.google.com with SMTP id m1so1493159wml.2 for ; Thu, 07 Feb 2019 14:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1X03/8DrMxqyX0ShAZ6jI6ygSDGYuE3cjdT/jFfZfTU=; b=bpqRZ+gzFcSdLWVhl1umzVGItJ8qLDftaFrttocvKjw8Opslk6ay4K65wUpv26r38g QpTddgvCESLPAZJGuT7qoG0z2BJz+Jc7Eosgd4jb0iinE68MpBfg0OgujTCe1gbiPlSA 1k78Z+rQDE144J24SRtegAe4T+aExhMpDw3peD+KXryiP8UyLNqd+8PZIT28wM2ju8QV kTFoJQ+XSBBB0nyOAKKqgR1koISoWmrDgNTWKudoA4RDe7wDjM6tQFHeS2QlzBaDpexT TUClaTp3udDNlyjMDe0PPRGJjDssdane+X+8RzJQXqRpOB2D70LX16LH9sp1ekCFh+4Q IahQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1X03/8DrMxqyX0ShAZ6jI6ygSDGYuE3cjdT/jFfZfTU=; b=tY4KNDGpMAZ/Qqd5szyaao9RO64dH/39J0yfwsF2q2OdrrjmaTNzpE9qH7l3ouyygS IymMXG0ZS1WxxaOMyjqqoQJqYt7erT938uxRRKbxtU5/pQdrYLqYVqmojJ0bhGHqYYyk OByCoUuKq9Sl9S0SN+SKhxQjabO0HuEfN6HYPbB36jBhNMemX8oK8ijtQP526brWvEB8 QB6ug94wHszBLDr4kc/C+U4i8oXANr1xsi9GsZT062S+RtMOsbW6zNAZ/7nX0SEZ0/pt TD+/JCKIHsCErx4cV2Sir0x+ik4TyYuvySUndN6BNk7vS/Yv85gUtrlauyBe5k9MMcD/ Tt5g== X-Gm-Message-State: AHQUAubvT+31U4vfKVIQ2uii2DQA1J+mj0pNYbB4Cdv0g08YfqFZG9D4 xth4s3aXckpBtJ5+1Ivgi34+SWrL X-Google-Smtp-Source: AHgI3IZjzlECX4HI5xSRhfmBVCyI2ZYWyES7ix4A9Vsss8u3k6yjbrFVTICa2rmoy4Q5IKFZtzxpaw== X-Received: by 2002:a7b:c04f:: with SMTP id u15mr8685865wmc.49.1549577198369; Thu, 07 Feb 2019 14:06:38 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:a906:e81:1a0f:97bd? (p200300EA8BF1E200A9060E811A0F97BD.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:a906:e81:1a0f:97bd]) by smtp.googlemail.com with ESMTPSA id x10sm150474wrn.29.2019.02.07.14.06.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 14:06:37 -0800 (PST) Subject: Re: [PATCH net-next] net: phy: let genphy_c45_read_link manage the devices to check From: Heiner Kallweit To: Andrew Lunn Cc: Florian Fainelli , David Miller , Russell King , "netdev@vger.kernel.org" References: <20190207195720.GP32483@lunn.ch> <25962cfd-f759-10ab-e7a5-9816852412c1@gmail.com> <20190207205054.GA5223@lunn.ch> <974f6bca-c938-aac9-28b4-291cca0734db@gmail.com> Message-ID: <1f87a59e-91a3-4986-4543-dc88082e8a91@gmail.com> Date: Thu, 7 Feb 2019 23:06:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <974f6bca-c938-aac9-28b4-291cca0734db@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 07.02.2019 22:54, Heiner Kallweit wrote: > On 07.02.2019 21:50, Andrew Lunn wrote: >>> Thanks, Andrew. Right, the Aquantia PHY doesn't seem to have the C22EXT >>> MMD. Because the Aquantia PHY has no device 29 in its package the code >>> should work. >> >> It lists device 29 in its devices in package. So the current code does >> look there. >> > I just looked for a description of a device 29. Strange that the device > list states it's there and then it's not there. > > When checking that I was scratching my head because of the following code > in genphy_c45_read_link: > > devad = __ffs(mmd_mask); > mmd_mask &= ~BIT(devad); > > AFAIK __ffs() returns the posix bit number, means it returns 1 for bit 0. > Then this code piece seems to be wrong because I think the intention is > to clear the bit we just found. Instead we clear the next bit. > Nope, it doesn't seem to be the posix version .. Just checked the code of __ffs(). > And device 0 isn't really a device but a flag "Clause 22 registers present". > So far we may have been lucky because to supported 10G PHY has this flag set. > But if this flag is set and we try to access a register 0.1 then we may be > in trouble again. Therefore I think we need to exclude also device 0. > Or do I miss something? > >>> So it seems we have to exclude device C22EXT in general. I'll add that >>> and submit a v2. >> >> Yes. >> >> Andrew >> > Heiner >