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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 E55E3C4332F for ; Thu, 16 Sep 2021 12:35:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9A9260231 for ; Thu, 16 Sep 2021 12:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239583AbhIPMhO (ORCPT ); Thu, 16 Sep 2021 08:37:14 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:44024 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230299AbhIPMhN (ORCPT ); Thu, 16 Sep 2021 08:37:13 -0400 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=V6UiYMHUcx5TF7n24nYkSm/8/ySg85wDtoqkAeaY5B0=; b=E0k1SVPE/SRI7xHGQptd3ceuNZ rxG+qoikEDd0dYbi/Cf8ht8yF2RT8mky4ZZg6iHhNCuWQLZTVLwFMWNDtHwrwnRemT5PmOyk32UOg Ht+AU4rQjzqki9vXM2E/SmDIBdehqOATkI8jbMNrr9ikOtCMzZjQnE3N5BBZnVzH1ePI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mQqc9-006u8h-KC; Thu, 16 Sep 2021 14:35:41 +0200 Date: Thu, 16 Sep 2021 14:35:41 +0200 From: Andrew Lunn To: Stefan Wahren Cc: "David S. Miller" , Jakub Kicinski , Rob Herring , Michael Heimpold , jimmy.shen@vertexcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH RFC 3/3] net: vertexcom: Add MSE102x SPI support Message-ID: References: <20210914151717.12232-1-stefan.wahren@i2se.com> <20210914151717.12232-4-stefan.wahren@i2se.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > >> + netif_carrier_off(mse->ndev); > >> + ndev->if_port = IF_PORT_10BASET; > > That is not correct. Maybe you should add a IF_PORT_HOMEPLUG ? > There is already a driver (qca_spi, qcauart) for a similiar Homeplug > device (QCA7000), which also uses IF_PORT_10BASET. Should i change this > too or leave it because of resulting changes to userspace? Technically, it would be an ABI change. But ifmap seems pretty loosely defined. See man 7 netdevice: SIOCGIFMAP, SIOCSIFMAP Get or set the interface's hardware parameters using ifr_map. Setting the parameters is a privileged operation. struct ifmap { unsigned long mem_start; unsigned long mem_end; unsigned short base_addr; unsigned char irq; unsigned char dma; unsigned char port; }; The interpretation of the ifmap structure depends on the device driver and the architecture. The if_port value ends up in port. And i've no idea where it is actually available in user space. iproute2 does not use it, nor ethtool. So, i would say, submit a separate patch for the other drivers, and we will see if anybody notices. > >> +static const struct of_device_id mse102x_match_table[] = { > >> + { .compatible = "vertexcom,mse1021" }, > >> + { .compatible = "vertexcom,mse1022" }, > > Is there an ID register you can read to determine what device you > > actually have? If so, i suggest you verify the correct compatible is > > used. > > AFAIK the device doesn't have any kind of ID register. Then i would suggest changing the compatible to "vertexcom,mse102x". If you cannot verify it, and it makes no actual difference, then 50% of the boards will use the wrong one. Which means you can then later not actually make use of it to enable features specific to a compatible string. Andrew