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


Groups > linux.kernel > #1647380

Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset is read as 0

From Andreas Noever <andreas.noever@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset is read as 0
Date 2017-05-22 23:00 +0200
Message-ID <tK2AO-1ZI-13@gated-at.bofh.it> (permalink)
References (1 earlier) <tIuUy-44c-15@gated-at.bofh.it> <tJzp8-8qN-3@gated-at.bofh.it> <tJRcm-3bn-21@gated-at.bofh.it> <tK0z0-NW-27@gated-at.bofh.it> <tK2r8-1WA-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, May 22, 2017 at 10:38 PM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Mon, May 22, 2017 at 08:41:22PM +0200, Andreas Noever wrote:
>> Yes there is a check for the root switch, but also one that checks the
>> return code of tb_drom_read_uid_only :)
>>
>> err = tb_drom_read_uid_only(sw, &uid);
>> if (err) {
>>     tb_sw_warn(sw, "uid read failed\n");
>>     return err;
>> }
>> if (sw != sw->tb->root_switch && sw->uid != uid) {
>>
>>
>> The reason it works on the Mac is because drom_offset is not 0, so the
>> new branch in tb_drom_read_uid_only is not taken. Probably this is the
>> case for all Cactus Ridge models and Alpine Ridge doesn't go there
>> since it uses the ICM?
>
> Yes in case of ICM we don't call the function at all.
>
>> Still it wouldn't hurt to only read the uid if
>> sw != root_switch, the value is not used if sw == root_switch.
>
> I agree. I'll update the code so that it will only read and check UID
> when we are not dealing with the root switch.
Thanks,
Andreas

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


Thread

[PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset is read as 0 Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-18 16:50 +0200
  Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset  is read as 0 Andreas Noever <andreas.noever@gmail.com> - 2017-05-21 15:50 +0200
    Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset  is read as 0 Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-22 10:50 +0200
      Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset  is read as 0 Andreas Noever <andreas.noever@gmail.com> - 2017-05-22 20:50 +0200
        Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset  is read as 0 Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-22 22:50 +0200
          Re: [PATCH 02/24] thunderbolt: Do not try to read UID if DROM offset  is read as 0 Andreas Noever <andreas.noever@gmail.com> - 2017-05-22 23:00 +0200

csiph-web