Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1809308pxb; Mon, 13 Sep 2021 06:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBOPtzX9CWrvQdvsqEJ4tgspkjuGX8CBZ0IVcV7c1K6DI8wxiC3oZZ+tMQSi9LTuMDiDAU X-Received: by 2002:a05:651c:3c8:: with SMTP id f8mr10683629ljp.213.1631538395386; Mon, 13 Sep 2021 06:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631538395; cv=none; d=google.com; s=arc-20160816; b=qkTAZmtyTC1GqiLXuDayxWgJrurFI77qvjOtu46FxztjJPAzye5h6BFYlg+VPINQG5 70rBYUfuoV/9CgaBfPujH8GDDQ+Hyq+BTBah0ziGEH9/5vPdvXrRPWHVXTmpbnvzlpwE l3fD/sxRMSg812Qyq3j1k7FB1LIGUfYr3A5WYgxqnX+jZk5vC9jcDqlUqIziFcXWjmmp hYFHPsLRM97tGk6LmWt+2juH18BrX4k9+h7wR+YolUt2q2hV98AuVOTc57hidjgUPfUH 0TMuuj1hBjIkr9AnStL/tZVTuxOrjY51mjJKRK1cBMRI40fVLj2e9AOKjmDbWr1mdDhE gG0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=33qyjUymJuTRSIG7q/aN8mBAjVw26SqZuT1dehv1B5Y=; b=B/X8Mo68ClnbrNfKFxaJVXucGeKcD68F9TlIEl3cK/iaNHaPCW0euNXNp6ijsLkRjY 9bbjrM2WmlqDVvMvZtpmP0FqRi6XOnHxKPAdzhbedU+kvEyuRVutkro4udShOTrTWv69 U2lCSJ4BDM31j9X9Z25YN4ad9V/Vp1KFJYhvBLkmp6cDiuvCc/SsorEQ+cFx7rH19Fck A5EwZWFwAcdzkxe/oSuniqPs1U56akwmIZnVdC70QbRgjxTEW1Hmw8AnxHhDBOW9Yafp +CJbv+Vg1ldxXDA3l+wkeofHxeinqL0/wb0ow8xNhuf/0AWsyNd+eRdckLJdDDxTYBEW g7JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=BYmQ7J7I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si7228392edc.628.2021.09.13.06.06.01; Mon, 13 Sep 2021 06:06:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=BYmQ7J7I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236882AbhIMND3 (ORCPT + 99 others); Mon, 13 Sep 2021 09:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236893AbhIMND2 (ORCPT ); Mon, 13 Sep 2021 09:03:28 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD9FC061574 for ; Mon, 13 Sep 2021 06:02:13 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id 22so10324651qkg.2 for ; Mon, 13 Sep 2021 06:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=33qyjUymJuTRSIG7q/aN8mBAjVw26SqZuT1dehv1B5Y=; b=BYmQ7J7Ic9+xt0gqwsI8P3BtMa4w+XkkJjwnUm8dISc0SWByFvwp8l59bf/+wXTp8c Wgr4qd5tk9j2aVn02+tPhuR4q5e8J75FaNV/0Va/hvboutS7+cFDepEByr1FYrio2dVW O9UkthF5FH3nOsB+cTrghpRMlbrDDqPMaYqai/AfgqGo5ZNNgmrR5uS2tnkERckKtHJl 2n5rGeZ2hRv4HE5DBNhNb9Bpw6do43AqfNXr3YgHvzyHaGtI/c+gUOSZzSKGO8k+K/Ln sZ+VYO/PvCyWfSKz26ZPpHn+u+Luaob9uKozdRXMUob/Dyd7X/7gyjg7dJV1CFPsYzYu rY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=33qyjUymJuTRSIG7q/aN8mBAjVw26SqZuT1dehv1B5Y=; b=u3TLm3U6lbeVw0y2cU77UnRGBfrEtGqlZsyuG9W6uJqKtO9JF4VBlxdlgrm4494exr PxsSgHhI5eW8x0gmfq+1YwQKUATUG8bG5U8Bct4rkAfjLy2vpGDqUtQJ7QQVkm9gOxGo cVNKwf19+MIRKiSRQ/m3QdGnzzfSJ9mmq59uI1OKuj47Xgz+RPjctMoD1xmnOoh1x+mu SQGdLhhLERcOZd85JuRs4XGO0XeBF9GiiGKPIEFHfnpdXMYsZlMTAqiJNDbjP1MCGpa9 zeBUjoutIOvEnwUdGDNj0GnIKVx3ZlZ4h192ReozJO5T1SBYuDiy47MAlmoX2YlEfCsJ tW8g== X-Gm-Message-State: AOAM533ge8Il3jFilqlli5Mv3LWBIPF6BLnJwUDuJ5/ijXCW05rFZiA3 +fSHDeqZTY8INePcqMQVineJYdVjoYdA2w== X-Received: by 2002:a05:620a:1307:: with SMTP id o7mr9644574qkj.437.1631538131520; Mon, 13 Sep 2021 06:02:11 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id p14sm4083952qtq.43.2021.09.13.06.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 06:02:10 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mPlb8-00GSNe-81; Mon, 13 Sep 2021 10:02:10 -0300 Date: Mon, 13 Sep 2021 10:02:10 -0300 From: Jason Gunthorpe To: Florian Eckert Cc: peterhuewe@gmx.de, jarkko@kernel.org, Eckert.Florian@googlemail.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] tpm/tpm_i2c_infineon: Fix init endian vendor check Message-ID: <20210913130210.GD3544071@ziepe.ca> References: <20210913120521.18572-1-fe@dev.tdt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913120521.18572-1-fe@dev.tdt.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 02:05:21PM +0200, Florian Eckert wrote: > On my embedded system I use this tpm infineon chip via i2c bus. > The system is a MIPS architecture and therefore works in big endian mode. > > The problem is, that the chip type is not correctly recognized, > because the vendor ID is wrongly aligned in the memory. > > By declaring the vendor ID variable as a `__le32` type, the TPM chip is > then correctly recognized by the driver and feels then responsible. > > The device works than as expected. > > Signed-off-by: Florian Eckert > --- > v2: > * use variable type instead of le32_to_cpus function call > drivers/char/tpm/tpm_i2c_infineon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) And if you do this it need to be made sparse clean/etc Jason