Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754064AbcDKRKy (ORCPT ); Mon, 11 Apr 2016 13:10:54 -0400 Received: from mail-bn1on0079.outbound.protection.outlook.com ([157.56.110.79]:3794 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753802AbcDKRKw (ORCPT ); Mon, 11 Apr 2016 13:10:52 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; From: Stuart Yoder To: , CC: , , , , , Itai Katz , Stuart Yoder Subject: [PATCH 12/14] staging: fsl-mc: add dpmcp version check Date: Mon, 11 Apr 2016 11:56:11 -0500 Message-ID: <1460393772-16464-1-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.7.9.5 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131048673735925111;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(106466001)(586003)(104016004)(47776003)(19580405001)(105606002)(50466002)(19580395003)(33646002)(81166005)(50986999)(77096005)(87936001)(48376002)(5008740100001)(36756003)(2906002)(189998001)(6806005)(92566002)(86362001)(1096002)(4326007)(1220700001)(5001770100001)(11100500001)(50226001)(7059030)(4720700001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0719;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD035;1:Rc7n55MmpiicAdKLsU/3ZDxuiGw1aJ8PABHqSr2dgjbnjq3ieowDotvP9Q78yKgoBzGAgMCcrvi9YFVF+U6D+UJklcJptZJlSuHDbjZH9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zOoq9xuYrHNpRUyhKxGZ4eDrV1lQvWLYwHfcDLIsPzQyEFHklAnSu08iOdllHdwvosDwDV25CaOQZhEqE=;25:atizNvQMI9P+0US0amY+g0GxiqfN+P4J+OcaphY90cAx4J+2m7TSbIoVHoBDjslsv1MB7x55uq6yKXKLiHfKlrj2Bphv/uI8OIDKGnpS5GCPEOFHDe9FiB4KUJahV8jWP9cBe7UoieUWJ2epTiqSA7vHbsg3oy5YWw1mLUkPY0kC3M5DIRgaYzbBiZJDm9LwAEZiLqTsriDC0AzWJllKtHGNbTWhZmUyfDF4hK1fHtwojK/87nCbTTFVAdVXlSE5NHDH4qwXUauI/S2tkv86KX2mNYY7ygziOhQSp7UhZRxk9xLLmqIoXjgAH8iV6nN63Pfxa4zllCtun67+T2B0xQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0719; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(13024025)(13018025)(5005006)(13017025)(13023025)(13015025)(3002001)(10201501046)(6055026);SRVR:DM2PR0301MB0719;BCL:0;PCL:0;RULEID:(400006);SRVR:DM2PR0301MB0719; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0719;4:QbU+mxzGe/fmaQIXWgWu2X+qil7G7g5Egf7Y/SGwSa1yuvH+xXVRCKUrqbuCC9y85GXwSy0tcjgSKmIpxywNz9LHAnVOcEkfCILmLp+Urd/srsj08gF3tqW+T6Okeqq2EKFb0I7YqHEgiXP0gwOc5EJcRjk1LTUSSRaJKRKie+Dc6nvH0cU+x+qmZXYnbr5Rvq+hjzPSf5sFup+FKMDZjdD0BXSZTibTgIqQoyKmp7SmZfAqCnZPpDCFbdTmOKj0+xzzBPiPv+y9/BH4boRBsl4cvWhTOeA709GHy3oAJ/27BuWXxutaSL7hbTYnm2KCC+rTSOMdtN/zOXRfjBxLbA6wiZDzFlzUCmiOJ2ip1DLvMnWyhqvNmCy/qzYiNsgKBS5SuV7iHSy2F4WmCUCID3z1SnDmq8fmGJ89wMYsux8IACV6+rbTe8srygcXa9ZdxUnIAQoJ8RjFJAQS6yHqa7iCZe4acQEMjreCqnJu+5Y= X-Forefront-PRVS: 09090B6B69 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0719;23:Q1r3GU038xr9kOmC/Ww7b6GpQ4OCCGAwY79bZLa?= =?us-ascii?Q?qP7VBKlUeXKiBomvThVetAgYPVOHHxK84nD+gbRY/jcB3SA8U8wRHcSwqNXZ?= =?us-ascii?Q?YWmIHq7Fpva0eRy/rzrQkBPSvIKWOm6q2roloBjNmjJ5aEJHebaKXY9u0dVI?= =?us-ascii?Q?SCMJggXD0mcX6ejx5QXuWXQY3pMP7SmvO5/gLj50e93gJOYP5oyMtJDudWPi?= =?us-ascii?Q?g0NmpTWghcymeIKfXft20LOlTWVl3EHrNTgefbYRhOaeRJMfbRQMUKvbVgz4?= =?us-ascii?Q?DqPnmOvS05ndZ1tS/4XfGVttUckbqRODgnCuiUx4W699ZRLZKgTczSDjrfRW?= =?us-ascii?Q?4ooqbh7lhmmt5c6VPwM5a0hQ2oKr6QEmdJTRDaQpHvUzjeixItsrkELN9sFF?= =?us-ascii?Q?+XBroqtYeoACG7XYrkQLMMKfcHxgSbOQ4uOv6cPxIrtxoazGqDHUhamLSMYi?= =?us-ascii?Q?DhiatM4Sjb5qB+DdiQZxeawMeV3orrcaDo3EiWl4rV8ZPEmp44bRuljBEBHU?= =?us-ascii?Q?aEFuGP8dgALe+t4wxndLLeDAkKQDB+nI6SUStfzQeVOViN+t9eLI47bAePpd?= =?us-ascii?Q?U4v3jIl0r227Kkaa2tzbk3KzjwHCEaajbWN8ZZy9kMN5fEYt/nRLsCJ+Ob1S?= =?us-ascii?Q?qSpO/7C6Wzi939GuLyneYqamnNSNzW/tr8NlB3yZxry5vOYrkbY28H8E2glT?= =?us-ascii?Q?pIQz9wACj0uHkTIC2ZAaR1Qq6I5kfS5QadNPJkwIW1/tFGN9Q+2BOeV+o3Yf?= =?us-ascii?Q?yLuzrZ/BN48l5gDseVEO4FG8w6LcPgawUctQg5wMrdiyzLCU5erpB6qMUVCc?= =?us-ascii?Q?XGTj82cS8yeNXNYqkID/nOIenYCBsyQzs7DNQ60Det/WHjejUug7tXKNMVrW?= =?us-ascii?Q?U5r5HHZFsrq4WJOyo8CvjEbf928ScjLy/71VJtuT9HEhgASCKe5HxfxKcLcA?= =?us-ascii?Q?3tk+TA37pJxbXL6BBoXV1rJyRuetjkmw0D/Chg9UN/g=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0719;5:1MebPS1MRPZOmt5kcEfxHqaeJQmVOM1Wkg/27Z0lMI2qx/3FCNTnPKMaHG9i9834jKoEMPQlxEgGXVQ79BAeCFqBB5q8obWcdapozw9g+699i7cx9pRudpm3ZTG/d9we7PraTuW1fF47RvKnGVdo5VCJYXSJOGKjL6Vd46qFS4w=;24:5xMH/mvaseCR8kcQ3OoaDUBzkGshaP8T6ddw7j22Z9jAiuTSoH2Rj9EVBjgoNDaNwtMfQ7fMILzdTatrI2JbgZbh1pIFSNZ2j9ix1KKqAJI= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2016 16:56:13.3897 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0719 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1818 Lines: 53 From: Itai Katz The dpmcp driver supports dpmcp version 3.0 and above. This patch adds the code to check the version. Signed-off-by: Itai Katz Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 6 +++--- drivers/staging/fsl-mc/bus/mc-allocator.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h index c6f4ec0..c9b52dd 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h +++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h @@ -32,9 +32,9 @@ #ifndef _FSL_DPMCP_CMD_H #define _FSL_DPMCP_CMD_H -/* DPMCP Version */ -#define DPMCP_VER_MAJOR 3 -#define DPMCP_VER_MINOR 0 +/* Minimal supported DPMCP Version */ +#define DPMCP_MIN_VER_MAJOR 3 +#define DPMCP_MIN_VER_MINOR 0 /* Command IDs */ #define DPMCP_CMDID_CLOSE 0x800 diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c index 52b16f7..4676ba1 100644 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c @@ -310,6 +310,17 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, if (WARN_ON(!dpmcp_dev)) goto error_cleanup_resource; + if (dpmcp_dev->obj_desc.ver_major < DPMCP_MIN_VER_MAJOR || + (dpmcp_dev->obj_desc.ver_major == DPMCP_MIN_VER_MAJOR && + dpmcp_dev->obj_desc.ver_minor < DPMCP_MIN_VER_MINOR)) { + dev_err(&dpmcp_dev->dev, + "ERROR: Version %d.%d of DPMCP not supported.\n", + dpmcp_dev->obj_desc.ver_major, + dpmcp_dev->obj_desc.ver_minor); + error = -ENOTSUPP; + goto error_cleanup_resource; + } + if (WARN_ON(dpmcp_dev->obj_desc.region_count == 0)) goto error_cleanup_resource; -- 1.7.9.5