lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUM6HfDYX0Twe67+@lunn.ch>
Date:   Thu, 16 Sep 2021 14:35:41 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Stefan Wahren <stefan.wahren@...e.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Michael Heimpold <michael.heimpold@...tech.com>,
        jimmy.shen@...texcom.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH RFC 3/3] net: vertexcom: Add MSE102x SPI support

> >> +	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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ