Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631650

Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform
Date 2017-04-26 20:30 +0200
Message-ID <tAzRo-5Yn-29@gated-at.bofh.it> (permalink)
References (5 earlier) <tA5gB-2XU-3@gated-at.bofh.it> <tA5zX-3kk-7@gated-at.bofh.it> <tA5zX-3kk-5@gated-at.bofh.it> <tA78J-4b3-7@gated-at.bofh.it> <tA7BM-4B0-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 25, 2017 at 3:15 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> On 2017-04-25 13:42, Andy Shevchenko wrote:
>> On Tue, Apr 25, 2017 at 1:09 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>> On 2017-04-25 12:07, Jan Kiszka wrote:
>>>> On 2017-04-25 11:46, Andy Shevchenko wrote:
>>>>> On Tue, Apr 25, 2017 at 12:00 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:

>>>>>        {
>>>>>                .name = "SIMATIC IOT2000",
>>>>>                .func = 6,
>>>>>                .phy_addr = 1,
>>>>>        },
>>>>>        {
>>>>>                .name = "SIMATIC IOT2000",
>>>>>                .func = 7,
>>>>>                .phy_addr = 1,
>>>>>        },
>>>>>
>>>>> That's all what you need.
>>>>
>>>> Nope. Again: the asset tag is the way to tell both apart AND to ensure
>>>> that we do not match on future devices.
>>
>>> To be more verbose: your version (which is our old one) would even
>>> enable the second, not connected port on the IOT2020. Incorrectly.
>>
>> So, name has 2000 for 2020 device? It's clear bug in DMI table you have. :-(
>>

>> What else do you have in DMI which can be used to distinguish those devices?

So, except asset tag is there anything else to use?

Whatever you choose would be nice to split this long conditional:

if (!strcmp(dmi->name, name) && dmi->func == func) {
    /* ASSET_TAG is optional */
    if (dmi->asset_tag && strcmp(dmi->asset_tag, asset_tag))
        continue;
    return dmi->phy_addr;
}

> Andy, there are devices out there in the field, if we as engineers like
> it or not, that are all called "IOT2000" although they are sightly
> different inside. This patch accounts for that. And it does that even
> without adding "platform_data" hacks like in other patches of mine. ;)

Yes, which is good.

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-24 23:30 +0200
  Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Jan Kiszka <jan.kiszka@siemens.com> - 2017-04-25 07:50 +0200
    Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-25 09:40 +0200
      Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Jan Kiszka <jan.kiszka@siemens.com> - 2017-04-25 11:10 +0200
        Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-25 11:50 +0200
          Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Jan Kiszka <jan.kiszka@siemens.com> - 2017-04-25 12:10 +0200
            Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-25 13:50 +0200
              Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Jan Kiszka <jan.kiszka@siemens.com> - 2017-04-25 14:20 +0200
                Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-26 20:30 +0200
          Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Jan Kiszka <jan.kiszka@siemens.com> - 2017-04-25 12:10 +0200
            Re: [PATCH] stmmac: Add support for SIMATIC IOT2000 platform Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-25 13:50 +0200

csiph-web