Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp989716ybn; Wed, 2 Oct 2019 09:12:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfnpO/lvnxAKYENWre1YxXfD+4c13YWx7Y3XhOPvds7eYxI570qCR/qct5QO6LH7SNggR+ X-Received: by 2002:a17:906:5c07:: with SMTP id e7mr3771014ejq.127.1570032734291; Wed, 02 Oct 2019 09:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570032734; cv=none; d=google.com; s=arc-20160816; b=vyCyI/Qoxj/QXVZOcH23/vdvWDQx7+KFgUDacYeCUgIDx6XWVG+HoS2hbQCBQq8Q0C Qlb9mgPeDMysp2j19T/rYepl/OrsuFiAeOZtRHKcnwqMibOz1lDGIAdpcNGy/9n/NjfD iphztlicEucHkCOjEO56nHYzXIvRw9MAoYz+LE0gjff06YNTLLhlRI2gCPGmtv67B97w /uRNzmGhe2GVjeOpOjWF8f+Vi0srIj/u6tLTS/F8Zel9dlgvU9e6w/6ud2hRpFKhicWq sLf3C8tzBeyb+406B8mJ1yM4patP6K47hJKuoVQXg1qy9PQtxu3cngF8XFqpayJtRK5T wZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ECk1ds4yK/usm2oIeYQjQGNy286MUJFaO7tGfpvFD48=; b=BRUM4DB2Ye4FxsPnKGIcSWJYp1O96LEmXFFnX+dHrkTL+GmmKNgr1ux9NWj3GlH/XS MXOYiuDa4RhfOaRDf2GGScJyeJwkVS2F5g+0SLGtfDxZd4X3qc+aC4d7sVB8OQfYL2dj I+SJQ+dK57J2VfTJRhzEUVesRZ8WGVoNHVBGPQzeDAW7s5pHxeOSkHVbocCNFnZ3eNfd wMEbuwpy/COz430DgtC7E7Jr4Iw9ntIRpbKHoxRqK/ARhom/gA1+5aRR3C4mgyTxIgU8 3hdq1YDD+KKR3yr2STbIxlLjBUraBOlhpqqHDvLSjB1o8AfexgUZWb8Thx+XtW5H7bRv Ts/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CoQ1KrSa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si12748415edc.347.2019.10.02.09.11.41; Wed, 02 Oct 2019 09:12:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CoQ1KrSa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbfJBPhH (ORCPT + 99 others); Wed, 2 Oct 2019 11:37:07 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:35504 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfJBPhH (ORCPT ); Wed, 2 Oct 2019 11:37:07 -0400 Received: by mail-lf1-f66.google.com with SMTP id w6so13094237lfl.2; Wed, 02 Oct 2019 08:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ECk1ds4yK/usm2oIeYQjQGNy286MUJFaO7tGfpvFD48=; b=CoQ1KrSaEemORYxjU84eBuww9g+jHyC1zvOrDjol+mHTXwQgcut1PrbZ70siVxxIws fqLYMg3nXcClqhgn3q0o5oI11PE70rV4m3+B5ZSgNme6zhiCaGEAlfvGMXXtDqXXFfKZ CK+6VadXiz4ZHpkEyCoR9ClJRs2Te7NYLIEpHHoN/bHRnscraSiHcu9ccIaBKPIApItj iib+H5wCYqiFGcjGzPucHGd7s2WUtA9BPCLp0uiJGU/ImTV1FQdNMwCZGSVp/yUt0lLi cAsjgkxcQ7MWA2PPgYP3KWAw/WVqI1Pr27b8YE6yHUgzTVRwAXLdRn6RmxsXqki83Rab bBEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ECk1ds4yK/usm2oIeYQjQGNy286MUJFaO7tGfpvFD48=; b=dc+3fg8dCIK9X4PpruizXPw7hAluHt7xTadHtasbplqviHo9b33eqsaOukPtp6tQSn ctv/F17aRNQDgiJFoJjI9conNdKZ4rZvRxs8LVFd/lIeGWzwip/FJX8A3YnJIaKlR/A5 0KNlO08xWuth+qB5KiqGTbpxTv3xejZ5o4Is/kKRGcnptVVLKIz3c00C9xqF3+r1WCAf ePExAPKs+2Pd0smsNUx8umDSE8PTdDF9cZBpDDr2d6JOFxOHp+QSlyzvfRTKImOtix5a urjVJGoJZ6+Yf19UtDTmkbG7A7WZwwyF0wi30foG2xXfLROOf5Iphpt1PTX3BStOM+2s 7qDg== X-Gm-Message-State: APjAAAUzVkSG/ti0jWMu6P/9+HAzNiD2Yu1YdjUqvOno2Mhw8aWA42vk NkOp0n+LtbBMEKp8scF0zwQe4Kurg+vA9F/qRvvEuBI/S8z1vg== X-Received: by 2002:a19:ec16:: with SMTP id b22mr2796735lfa.189.1570030625007; Wed, 02 Oct 2019 08:37:05 -0700 (PDT) MIME-Version: 1.0 References: <20191001113830.13028-1-mika.westerberg@linux.intel.com> <20191001113830.13028-18-mika.westerberg@linux.intel.com> <184c95fc476146939b240557e54ee2c9@AUSX13MPC105.AMER.DELL.COM> <5357cb96013445d79f5c2016df8a194e@AUSX13MPC105.AMER.DELL.COM> <20191002083913.GG2714@lahna.fi.intel.com> <767f2f97059e4e9f861080672aaa18d3@AUSX13MPC105.AMER.DELL.COM> In-Reply-To: <767f2f97059e4e9f861080672aaa18d3@AUSX13MPC105.AMER.DELL.COM> From: Yehezkel Bernat Date: Wed, 2 Oct 2019 18:36:48 +0300 Message-ID: Subject: Re: [RFC PATCH 17/22] thunderbolt: Add initial support for USB4 To: Mario Limonciello Cc: Mika Westerberg , linux-usb@vger.kernel.org, Andreas Noever , Michael Jamet , Rajmohan Mani , nicholas.johnson-opensource@outlook.com.au, Lukas Wunner , gregkh@linuxfoundation.org, stern@rowland.harvard.edu, Anthony Wong , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 2, 2019 at 6:09 PM wrote: > > > -----Original Message----- > > From: Mika Westerberg > > Sent: Wednesday, October 2, 2019 3:39 AM > > To: Limonciello, Mario > > Cc: linux-usb@vger.kernel.org; andreas.noever@gmail.com; > > michael.jamet@intel.com; YehezkelShB@gmail.com; rajmohan.mani@intel.com; > > nicholas.johnson-opensource@outlook.com.au; lukas@wunner.de; > > gregkh@linuxfoundation.org; stern@rowland.harvard.edu; > > anthony.wong@canonical.com; linux-kernel@vger.kernel.org > > Subject: Re: [RFC PATCH 17/22] thunderbolt: Add initial support for USB4 > > > > > > [EXTERNAL EMAIL] > > > > On Tue, Oct 01, 2019 at 06:14:23PM +0000, Mario.Limonciello@dell.com wrote: > > > One more thought; would you consider exporting to sysfs sw- > > >config.vendor_id? > > > Maybe an attribute that is switch_vendor? > > > > > > Userland fwupd also does validation on the NVM and will need to follow this. > > > The same check will go into fwupd to match the vendor and lack of > > nvm_non_active0 > > > to mark the device as not updatable. When the checks in the kernel get > > relaxed, > > > some NVM parsing will have to make it over to fwupd too to relax the check at > > that point. > > > > The original idea was that the kernel does the basic validation and > > userspace then does more complex checks. Currently you can compare the > > two NVM images (active one and the new) and find that information there. > > I think fwupd is doing just that already. Is that not enough? > > I guess for fwupd we can do this without the extra attribute: > > 1) If no NVM files or nvm_version: means unsupported vendor -show that messaging somewhere. > This means kernel doesn't know the vendor. > > 2) If NVM file and nvm_version: means kernel knows it > *fwupd checks the vendor offset for intel. > -> intel: good, proceed > ->something else: fwupd needs to learn the format for the new vendor, show messaging > > There is the unlikely case that kernel knows new vendor format and vendor NVM happened to have > same value as Intel vendor ID in same location of Intel NVM but another meaning. > Hopefully that doesn't happen :) It's not even "same location - another meaning", the vendor ID comes from the DROM section, so it takes a few internal jumps inside the NVM to find the location. One of the "pointers" or section headers will be broken for sure. And after this, we need to find the NVM in LVFS and it has to pass validation in a few other locations. The chances are so low that I'd think it isn't worth worrying about it.