From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_DBL_ABUSE_MALW autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DEB3C2D0DB for ; Thu, 30 Jan 2020 13:28:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B74D2082E for ; Thu, 30 Jan 2020 13:28:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DZQrVydw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="jqtVhgCK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B74D2082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID:Date :Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: List-Owner; bh=RoSJ3rV0LSk23Dpsl0TdeQnbTqFzQEpIF2MQMmglnes=; b=DZQrVydwzSLSaN 2xMCuUp1UC+et/JF6kOmMKB9d4pkyg1WnyPtviJDHmtntziCSQO5zUcMLEt6JmciSSWAimv1+y4xM tT2kTV4r1skHClwDf+iBZ2Lb5pT17T2CF+m37LAOL+ILzVp1S9BV0QdjCD4HgRUNZPjI3+vvsN47j HYSoXcjiIa01PSeO1XjBTr1Y0NlBAJ3/JUt8mmQH+9FR9MRf9/fBliat5lU8ovysYOuAoHc+loV+u FulzkSRfG9D8AFy6KyQnQFqRU5uZMBjz4TfwLkZWQPzBmqhxr0ApYniqMbyh3mIBTgA/AS/AUynB/ tssleOjRPcmIj2JjCfVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ix9sN-0006oC-EH; Thu, 30 Jan 2020 13:28:55 +0000 Received: from mail-db8eur05on2077.outbound.protection.outlook.com ([40.107.20.77] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ix9qk-00050E-1o for linux-arm-kernel@lists.infradead.org; Thu, 30 Jan 2020 13:27:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbgLgHEUhNRL420Sfe5Fm4cQ1/y0f2IvQ5gyxmStkhH2sHxb0Yp+/vgTe619qgYE6PnkpS1U5cYS8a3uVnPBksmhpSHKYM/no8CVcTDsy5zcQKGP5cMl147UNPRYUZ8JzdVN8lWLTshbh0WLxJdzTGHdRkJPlx+A/SWCMcPXG7bm9knSDrsEIP/sX3YN8tptg8Ou296mx6o0AKg4VKRc8T6Go19Tk6Ay3pRw2+EjXXuHFc22ib0d06OYEqLm7ZdHpZwOCN31zwHR52M2uCCJYNAH8lPPl7sJUVeWDb7bpEy+rZrpk1hswsqXMr9dLveq7/ey5XSdG4rXpG2sDeMBPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TBPYUDEg/iavAjaH1nFSrUHB3rwLErtmqOpeJw+eIgY=; b=X3Ekle6qNCQk+ufj1DydosF1W4x0XenXA4CgbiIfwt7yJO5eNzF2qhC6rXx6KrqGS+U7g80Whlx+4w0c+8SU3KUKgUhCeY+CISibueKf0zkUHHHgjdK7Oz3a47Cwgt3Y5pMvmVK2npIvWnK46+SdgcBqjTP+mKVLqbiti0umf88govs83sqjFnZiwX7qZsLYtZNVDUqdaE9MfoeTRr57UST93QBKT6RCZtSiQXKtua/P4LS2cbepaKuey1bm+0SO9FlRSzd1GoB7bdxqbLhUtugQx5sk1CqvCQvK7q9Z6hiN7crgc/q+4434fQdHBYMC9ezwMY7UEYgTMixHkqP37w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TBPYUDEg/iavAjaH1nFSrUHB3rwLErtmqOpeJw+eIgY=; b=jqtVhgCK2//rpQw7JbFCOYc5fSliyAfFYBW1AHyok7IistSPVt3M2p9o7vPUfyxCazIKOBujnuRegXTnDLsMgDcgAjgTPbh9/MnASJg59Vwb8QSzI22TeuUGmT3+5IzmGGaSab/PyOKhmbYQ1MIENET2XPvNdB3xSCVqJf41ioM= Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com (52.134.3.153) by VI1PR0402MB3456.eurprd04.prod.outlook.com (52.134.3.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.24; Thu, 30 Jan 2020 13:27:09 +0000 Received: from VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::85e9:f844:f8b0:27d]) by VI1PR0402MB3485.eurprd04.prod.outlook.com ([fe80::85e9:f844:f8b0:27d%7]) with mapi id 15.20.2665.027; Thu, 30 Jan 2020 13:27:09 +0000 From: Horia Geanta To: Laurentiu Tudor , Andrei Botila , Stuart Yoder , Leo Li , Herbert Xu Subject: Re: [PATCH] bus: fsl-mc: add api to retrieve mc version Thread-Topic: [PATCH] bus: fsl-mc: add api to retrieve mc version Thread-Index: AQHV13D48TAVZl2sEk63BJbSjUOXCQ== Date: Thu, 30 Jan 2020 13:27:09 +0000 Message-ID: References: <1580123761-19536-1-git-send-email-andrei.botila@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; x-originating-ip: [212.146.100.6] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4b22e23b-29ec-49ee-6bca-08d7a5881bb9 x-ms-traffictypediagnostic: VI1PR0402MB3456:|VI1PR0402MB3456: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 02981BE340 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(199004)(189003)(55016002)(64756008)(66946007)(66446008)(2906002)(9686003)(66476007)(66556008)(316002)(54906003)(52536014)(186003)(5660300002)(26005)(6506007)(53546011)(4326008)(110136005)(7696005)(33656002)(44832011)(76116006)(91956017)(86362001)(966005)(81156014)(81166006)(8676002)(71200400001)(8936002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3456; H:VI1PR0402MB3485.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OuAzXg0DJCja9X6KID2Rcl6rx/U2etzyzfgtuvaeRXDDF8KbA79hA8xJJlpJi5YgpHLHA4ZsO64ou4Gsh57aZPAhHwQZSvorq5kvquxRyXjZZQqIoxFkTzBVYwrw/2ZqQmYHPq9vMrYZiNg1xzU0NX/v3d35kIWZ59KFm1OyqU62ITYyLyxlhPvbpmVTLFpnOaqD4YlivY0A2+2GFa7YOkMF4rurdPwWmYapOF8+HPJcd8dXI2LQGdK+I0aObwovSdTtTtBUnC5r0nDvnvCP8G8eSZwu3ZM3xwFIpXFWLE5gB0LBc/oqwoNBVV7L+e8kUV28FryN3yNnjYjZZHtet/nnMbxiDtlcYDBQdO/uOiHS9tmhW8fiOdd6Kv2v3yeG/AEcmDJ0ZLxdAX+zp8H9irxtzd918vHQ5MGjUYgOJX7d3S3SjUvCUGCPkO+0b2AK3LXBbqY2YM4itoQZ7n8mUppJnV4aLHKJF9XWyY5VdCfvznsNA0R/4PSiCi7BZJHERs64IQ6jFPYpR+76kz7X9A== x-ms-exchange-antispam-messagedata: HA6ZiRpGwQ/VoMsxh/rsi0HGC+ogPkNN9y2RuiCARwnro70ITIoTv3j3++PLNfAN99Sk7yqV43e1eUsJY82dkn3w5piRYS62xbScoz/Jpa3XZ2RhEBI6m5c6s/y1Uo7fFTY/CgwOTlalAvETTA6q3A== MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b22e23b-29ec-49ee-6bca-08d7a5881bb9 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2020 13:27:09.3545 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nIj/B9sgfpgSqchPB+THrob/zLmI1ZPXF2yU24dEync6K53oBKxx1eW60u8a17gvpDmL+xYDZV8r5TussJE+Mw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3456 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200130_052714_338614_9F643179 X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1/27/2020 1:49 PM, Laurentiu Tudor wrote: > = >> -----Original Message----- >> From: Andrei Botila >> Sent: Monday, January 27, 2020 1:16 PM >> >> Add a new api that returns Management Complex firmware version >> and make the required structure public. The api's first user will be >> the caam driver for setting prediction resistance bits. >> >> Signed-off-by: Andrei Botila > = > Acked-by: Laurentiu Tudor Reviewed-by: Horia Geant=E3 We'll need this patch in the crypto subsystem, such that the CAAM HWRNG patch series (currently v7) https://patchwork.kernel.org/project/linux-crypto/list/?series=3D233763&arc= hive=3Dboth&state=3D* is updated to work with existing (and future) FSL MC f/w versions. CAAM HWRNG series has been in review for quite some time and AFAICT is in pretty good shape. Unfortunately it missed v5.6 merge window. I would like it to go in v5.7, but for this we'll need current patch (a dependency) to go through (or be cherry-picked into) the crypto tree. >> --- >> drivers/bus/fsl-mc/fsl-mc-bus.c | 33 +++++++++++++++++---------------- >> include/linux/fsl/mc.h | 16 ++++++++++++++++ >> 2 files changed, 33 insertions(+), 16 deletions(-) >> >> diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc- >> bus.c >> index a07cc19becdb..330c76181604 100644 >> --- a/drivers/bus/fsl-mc/fsl-mc-bus.c >> +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c >> @@ -26,6 +26,8 @@ >> */ >> #define FSL_MC_DEFAULT_DMA_MASK (~0ULL) >> >> +static struct fsl_mc_version mc_version; >> + >> /** >> * struct fsl_mc - Private data of a "fsl,qoriq-mc" platform device >> * @root_mc_bus_dev: fsl-mc device representing the root DPRC >> @@ -54,20 +56,6 @@ struct fsl_mc_addr_translation_range { >> phys_addr_t start_phys_addr; >> }; >> >> -/** >> - * struct mc_version >> - * @major: Major version number: incremented on API compatibility chang= es >> - * @minor: Minor version number: incremented on API additions (that are >> - * backward compatible); reset when major version is incremented >> - * @revision: Internal revision number: incremented on implementation >> changes >> - * and/or bug fixes that have no impact on API >> - */ >> -struct mc_version { >> - u32 major; >> - u32 minor; >> - u32 revision; >> -}; >> - >> /** >> * fsl_mc_bus_match - device to driver matching callback >> * @dev: the fsl-mc device to match against >> @@ -338,7 +326,7 @@ EXPORT_SYMBOL_GPL(fsl_mc_driver_unregister); >> */ >> static int mc_get_version(struct fsl_mc_io *mc_io, >> u32 cmd_flags, >> - struct mc_version *mc_ver_info) >> + struct fsl_mc_version *mc_ver_info) >> { >> struct fsl_mc_command cmd =3D { 0 }; >> struct dpmng_rsp_get_version *rsp_params; >> @@ -363,6 +351,20 @@ static int mc_get_version(struct fsl_mc_io *mc_io, >> return 0; >> } >> >> +/** >> + * fsl_mc_get_version - function to retrieve the MC f/w version >> information >> + * >> + * Return: mc version when called after fsl-mc-bus probe; NULL otherwis= e. >> + */ >> +struct fsl_mc_version *fsl_mc_get_version(void) >> +{ >> + if (mc_version.major) >> + return &mc_version; >> + >> + return NULL; >> +} >> +EXPORT_SYMBOL_GPL(fsl_mc_get_version); >> + >> /** >> * fsl_mc_get_root_dprc - function to traverse to the root dprc >> */ >> @@ -862,7 +864,6 @@ static int fsl_mc_bus_probe(struct platform_device >> *pdev) >> int container_id; >> phys_addr_t mc_portal_phys_addr; >> u32 mc_portal_size; >> - struct mc_version mc_version; >> struct resource res; >> >> mc =3D devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); >> diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h >> index 54d9436600c7..2b5f8366dbe1 100644 >> --- a/include/linux/fsl/mc.h >> +++ b/include/linux/fsl/mc.h >> @@ -381,6 +381,22 @@ int __must_check __fsl_mc_driver_register(struct >> fsl_mc_driver *fsl_mc_driver, >> >> void fsl_mc_driver_unregister(struct fsl_mc_driver *driver); >> >> +/** >> + * struct fsl_mc_version >> + * @major: Major version number: incremented on API compatibility chang= es >> + * @minor: Minor version number: incremented on API additions (that are >> + * backward compatible); reset when major version is incremented >> + * @revision: Internal revision number: incremented on implementation >> changes >> + * and/or bug fixes that have no impact on API >> + */ >> +struct fsl_mc_version { >> + u32 major; >> + u32 minor; >> + u32 revision; >> +}; >> + >> +struct fsl_mc_version *fsl_mc_get_version(void); >> + >> int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, >> u16 mc_io_flags, >> struct fsl_mc_io **new_mc_io); >> -- >> 2.17.1 > = > = > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel