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 94AD0C282C2 for ; Thu, 7 Feb 2019 21:55:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55FC42175B for ; Thu, 7 Feb 2019 21:55:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ui8VhnnV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbfBGVzB (ORCPT ); Thu, 7 Feb 2019 16:55:01 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46558 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbfBGVzB (ORCPT ); Thu, 7 Feb 2019 16:55:01 -0500 Received: by mail-wr1-f67.google.com with SMTP id l9so1444941wrt.13 for ; Thu, 07 Feb 2019 13:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Gq+f0i76ZNftIsxCwkRYzRn74Cf+woXeNLwxaGh20ss=; b=Ui8VhnnVHDPyY7GVYPYaHTZtak2UmY0096EdN5DVohPeV60d2byJ0Ak+Y+gQDYdi+f RrjcdDI/oOsQ5SgjeijLBtQTbteC2blobPab3slj7A/ZQoXTdQKJxNA6ddgopMAV5Q1V GK5EEjOI4vAxVyJZ53qw48FlOy/8GGD23ia2hsbh2JrquHscY+9a82oU9fZZqYb1UOtD bAyJSoFjwAqxe3EJA4G7uGqQU8w3CIDAobRZzleMvwxK8kMNVbtKUtGmbQ6tP/8AjAmZ /nebNn+kUh125KHzUqSzutBXg9K1Hy0ohqxhXB7+qHikoQetVgZJs1g4idrol5aEsyPp 12Ng== 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=Gq+f0i76ZNftIsxCwkRYzRn74Cf+woXeNLwxaGh20ss=; b=j3mygLF2tcMNmYkAazaHV9pvu2dYSN0HYxYLk1pBMom4ZnWZ0V6jFuwRi4n1D3y2xt obZaxGp1+GOhl/Bij37Mf1fsxE/1oScwBzadclru+Si7VFpL61Z1bTHM1nAcF7Fw2tMu wBY70K83OXeMLsYLJAXzPt34M5C3eaV/mSUacIWJ0hxU0ctUiq5/QsGjzcCB5wSujORC //Qlap6nMB8KSUB2jXhNSznLWTNUu3wDS8S6dJQJnNKN0azR26xw7cFEm4GKN4LJfu0I LPgJEZC/oJ/uupKtqQak4s0gU7F5SD+jiv9bKMTuZwjcDWueSmwD2cOwpMLY4p5+Y3yo DUJw== X-Gm-Message-State: AHQUAuah8qUko58i7M1RWto6M0TfeCqCs2hXSDjI4nr8yRGjRwQnWguA nhnWBdSOUfP/1V/8FTz2q1snwkb1 X-Google-Smtp-Source: AHgI3IZJ20M+pulftQOdlVU9UeNYs8PI14J6dSUOlsQPXuVA6jibCws/N4DZ1anYrJ1NZLryub3eYA== X-Received: by 2002:adf:fcc8:: with SMTP id f8mr13113434wrs.192.1549576499263; Thu, 07 Feb 2019 13:54:59 -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 h133sm1098714wmd.8.2019.02.07.13.54.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 13:54:58 -0800 (PST) Subject: Re: [PATCH net-next] net: phy: let genphy_c45_read_link manage the devices to check 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> From: Heiner Kallweit Message-ID: <974f6bca-c938-aac9-28b4-291cca0734db@gmail.com> Date: Thu, 7 Feb 2019 22:54:51 +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: <20190207205054.GA5223@lunn.ch> 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 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. 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