Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3476687rwe; Mon, 29 Aug 2022 12:34:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LLAdNlCSJ5woVDYXbQV572MhvIkIXLaMVmKwN9OZoXNjorBsCq51e/KbkbQSLV8dI38s4 X-Received: by 2002:a05:6402:4407:b0:447:1026:7537 with SMTP id y7-20020a056402440700b0044710267537mr17277536eda.312.1661801642919; Mon, 29 Aug 2022 12:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661801642; cv=none; d=google.com; s=arc-20160816; b=jAHnoLJdhpv5uvFjwB2+1Qgb/pfsj148oX7E6FbwOQZ31uht/76hRGCtD/bqqHaSLZ pUGUxY4lM505GlrGrMOqHrQ0CA/TNgHd5aD+r90ijXs6telKlFqri1A3otVMiT3GtUpI kN6mQc5lLjNhtlU28ANBVHZMi9GE94mAb6rzpLELM9UXCpSREDEDax2Ydlbvmlk2tbEP FCDsJzxw8w7jToH0wswHsHK9dFoWZbRytIvrYGOEH0GwrqwabWO1sYVlpG7EwDReF4tr HkfdrVtRoETF7lVS7NU5y/CeAbX7O1d7N6yJsmwqeJdY9QuLrMS6sTgGs97WZuQ/tdHR T7Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pc0wLZlozQihEHAnbmXgpg/tgBsnYovxYc8EA7xIwkY=; b=Q4NuVmJnRVsQxCre0E9x0t7BQUJ06YLdWIXUwZjgiImNRUHEttxY4uynYVT3UrW9u7 cThS8O3TucBqxaKd+USeMJYO8dfUons3OWKgoB9p0TPWm2sGuMA3RXgpw5mrYpxfeE25 F3nap7ZxN9eVKMj4pao/Io6zC+6X60sVOglddBBoe772BuNh5VQySibK3zb9jcktfKtL INA3iEGnip1lNPTcouF1fEU4cNqgVSPWQAkK6E/ihp/U+wkNSWEolxAFR/dIbzm97hf+ Mbain5KnT8u9E6QS8aKNQmvoS4UC3KK3oLPC+D+oVTBRndiwLRi+Zl1Bh8vjFiBWUDmC mGlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="Dbys/SM9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk11-20020a1709077f8b00b007120a60b38asi7414952ejc.1001.2022.08.29.12.33.37; Mon, 29 Aug 2022 12:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="Dbys/SM9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbiH2TUq (ORCPT + 99 others); Mon, 29 Aug 2022 15:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiH2TUo (ORCPT ); Mon, 29 Aug 2022 15:20:44 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D2156E2CA; Mon, 29 Aug 2022 12:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=pc0wLZlozQihEHAnbmXgpg/tgBsnYovxYc8EA7xIwkY=; b=Dbys/SM9U3H1kdLBaiRbBxOZpN /yxlUeV67c+OSKGxd4fXR9kByDvWq5gzTu+oKKS1HinnxiEFCvh87kr0wamnbsh2SIDA9FMy4KKPD iBWB69vytO3qlfyMVhGN9ec+JAxA1XJGeuM+TND0Px/jvqJsk+Ua1wbqEjOlCTA/uD8w=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oSkJB-00EzsU-Sl; Mon, 29 Aug 2022 21:20:29 +0200 Date: Mon, 29 Aug 2022 21:20:29 +0200 From: Andrew Lunn To: Jerry Ray Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH 2/2] net: dsa: LAN9303: Add basic support for LAN9354 Message-ID: References: <20220829180037.31078-1-jerry.ray@microchip.com> <20220829180037.31078-2-jerry.ray@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220829180037.31078-2-jerry.ray@microchip.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - if ((reg >> 16) != LAN9303_CHIP_ID) { > - dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n", > + if (((reg >> 16) != LAN9303_CHIP_ID) && > + ((reg >> 16) != LAN9354_CHIP_ID)) { > + dev_err(chip->dev, "unexpected device found: LAN%4.4X\n", > reg >> 16); > return -ENODEV; > } > @@ -884,7 +889,7 @@ static int lan9303_check_device(struct lan9303 *chip) > if (ret) > dev_warn(chip->dev, "failed to disable switching %d\n", ret); > > - dev_info(chip->dev, "Found LAN9303 rev. %u\n", reg & 0xffff); > + dev_info(chip->dev, "Found LAN%4.4X rev. %u\n", (reg >> 16), reg & 0xffff); > > ret = lan9303_detect_phy_setup(chip); > if (ret) { > diff --git a/drivers/net/dsa/lan9303_mdio.c b/drivers/net/dsa/lan9303_mdio.c > index bbb7032409ba..d12c55fdc811 100644 > --- a/drivers/net/dsa/lan9303_mdio.c > +++ b/drivers/net/dsa/lan9303_mdio.c > @@ -158,6 +158,7 @@ static void lan9303_mdio_shutdown(struct mdio_device *mdiodev) > > static const struct of_device_id lan9303_mdio_of_match[] = { > { .compatible = "smsc,lan9303-mdio" }, > + { .compatible = "microchip,lan9354-mdio" }, Please validate that what you find on the board actually is what the compatible says it should be. If you don't validate it, there will be some DT blobs that have the wrong value, but probe fine. But then you cannot actually make use of the compatible string in the driver to do something different between the 9303 and the 9354 because some boards have the wrong compatible.... Andrew