Message ID | 20220620163650.18756-2-stefan.herbrechtsmeier-oss@weidmueller.com |
---|---|
State | Accepted |
Commit | f851be15f44af23ebd1e6623fdc3b6eb46d90ae4 |
Delegated to: | Michal Simek |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=weidmueller.onmicrosoft.com header.i=@weidmueller.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-weidmueller-onmicrosoft-com header.b=SWkRKeNT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LRb0l1dpJz9sFx for <incoming@patchwork.ozlabs.org>; Tue, 21 Jun 2022 02:37:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 944FA820E2; Mon, 20 Jun 2022 18:37:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=weidmueller.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=weidmueller.onmicrosoft.com header.i=@weidmueller.onmicrosoft.com header.b="SWkRKeNT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B2FC88210A; Mon, 20 Jun 2022 18:37:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::60e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9BD7581F8B for <u-boot@lists.denx.de>; Mon, 20 Jun 2022 18:37:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=weidmueller.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=stefan.herbrechtsmeier-oss@weidmueller.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HZetEfqMClkqTUZ2NiwiGEGu7RE4YTJkoArDaa2m9BBr1E3K5dwz2WtvE/Cz3oh1UpNkThR+RHbEKHQfj0A8+XSR5Pz9BcmkESHnrpPZQMSZJoUsbH+bUgl/6ufphDFkFSH1axLahxbqaizG3FHOhpJHpbwdRCyCHelFt0GBPEsHZgTRc9iVEaMPKpvkDq4QW6NeyW1tYM/gNg+bCe01jTnyqKbtjaI3THWwFM3flbNfMvgnGF7rc0JS9tnYxkoS6VuEheSaEKX2m7BUx3lvXJ4v5Cc+oWX5er6tISJw09fG9A7GsFasElcqWpIIV0t8LTOj7IoiZIFE+pkolE1Cug== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WQ69gKUUSRIGHXMSGATBOP8nJMpq4zxb+e8owCuII90=; b=GEHUR+ZrJPgFCpacHJc+mQJ88X3bt7EE/11WeP6uZA1X0sHRtLanFRYCNwo/HmxSgkSnyjjefv3oOfiF0jnHTaFvP0s9WtJ4NhJWjaN074LedDLD5vFzY2grlvtcxh9nb8eITYDspdxKBMUWq+0xtu1rsPx199JLzaga67r/h8CMjnlkX3bPXWFzFeWXVXDRwD1ch6L1MOu0jQAJqELC8GE2N6holupfOXES6x8ZzCTbvjJXhsf+uhQs3rrJJ3cJOCRGndmL1bGgR4loJlG27JTRBGVRrTRy4OWv0/VxjuGcoRKJdzVY2bkaiQajoexXb2GLrFWwT1LuBkkIUmnKEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.onmicrosoft.com; s=selector1-weidmueller-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WQ69gKUUSRIGHXMSGATBOP8nJMpq4zxb+e8owCuII90=; b=SWkRKeNTmp9HhNAeM55+b3yeuAcWG7W0nsm0sfXxR+n2i6/QyteJc5ey5XnIqBCEhivBSm/a8VQ3xNYzlVKlLH0a6BGNx5KszaIqRGhDymbRPm0Pnj6xBeP7MbhhZXikxU2SFjnpZ00T7nCYPm8ZblMxGSLd9+XYCQaQSFYCknM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by DU0PR08MB8114.eurprd08.prod.outlook.com (2603:10a6:10:3ea::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Mon, 20 Jun 2022 16:37:14 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::49a6:e5ff:7f94:8787]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::49a6:e5ff:7f94:8787%7]) with mapi id 15.20.5353.022; Mon, 20 Jun 2022 16:37:14 +0000 From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com> To: u-boot@lists.denx.de, Michal Simek <michal.simek@amd.com> Cc: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>, Adrian Fiergolski <adrian.fiergolski@fastree3d.com>, Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>, Jaehoon Chung <jh80.chung@samsung.com>, T Karthik Reddy <t.karthik.reddy@xilinx.com> Subject: [PATCH v2 02/15] firmware: zynqmp: Probe driver before use Date: Mon, 20 Jun 2022 18:36:37 +0200 Message-Id: <20220620163650.18756-2-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220620163650.18756-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20220620163650.18756-1-stefan.herbrechtsmeier-oss@weidmueller.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AS9PR06CA0560.eurprd06.prod.outlook.com (2603:10a6:20b:485::10) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 844118a9-4e01-420e-53cb-08da52db219c X-MS-TrafficTypeDiagnostic: DU0PR08MB8114:EE_ X-Microsoft-Antispam-PRVS: <DU0PR08MB8114C037F604177027FDF14DD7B09@DU0PR08MB8114.eurprd08.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3G9C+4AARhR4+CsdpCH8YI21v/BQzmNNKaQY7KVy78vFQURkCgrIULp6gtHU4nyYGFwmaY+Lj6rIQwYEYOjRzTYBJPVmYctm2wpXYcT4MuimoIA06KpCnzFs3sOoc2r4YRuXQn5zhBe35fobW1iAQBqmrX4TQqtatd86viiaJXsaOIMd/740sKSJ6YHAu7BarJbjHODa5ZOLtldJCplsqIu/i3dUcBZBlQQDAjVQ+o7jM6znqFY9HP1FiSBSnrHQMIFf66AAb/rb1nB/QHar117jzVlRHax/NI/B8iAH3fnXLkzbOXVa4CR6rvdw8b8yVQ5WWt/hK5xSlIMDUnRUwctQR8u5nX+ti+fbzYHw9DCnK+5akkCb/U4umZS0COHgBys+hOryqHuNcp3L2Mm1rhPm6kZyNRbhMkAxV+2vgAdDWWhOkWUzYsoyB3M8pxDPqaEmaeKlkdIuy5ous4sG6hTzL8ot573M6/k2djuxIdlvMA9FPkd3Mbu74YVF5v+sA7yhHWO6Obk0b4hLqs9chREPNIedETSfXwSP2rALWnrqNwBwrBdiyMJP5GgLXw7TThj6exn0DekF42QjIbZMsmjyN3asJFSzGpTkhX7top3/UT5vpH1s8W28pIqheXuvo42N6W2omqvL/wvldqXGT3Uvo8gRjhzr+7Uy/kVcoih4SBP94o6hjcHSLHvx7zvCDeNQweY85HE4tqno9Nnx5A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR08MB6969.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(396003)(366004)(346002)(376002)(39860400002)(136003)(6486002)(316002)(5660300002)(8936002)(2616005)(26005)(86362001)(38100700002)(38350700002)(6512007)(478600001)(8676002)(6506007)(6666004)(1076003)(66476007)(66946007)(41300700001)(186003)(4326008)(66556008)(83380400001)(54906003)(52116002)(36756003)(2906002)(6916009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z82QISCPvQDOVyr9LwWFHp96Gg5LdJNlbQ4tSCd1v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ZAQeOmEZ4PVNbgHRjUpkE7t+FqxIDR+Dnvuwc18p6dBaN4Ty3BfzDfNvOEJfK0e7g+SSiOFcE/OkPy7lDicUoecoYFuwDLDljsfZBAR1+cHHdx9oYQw6UDSQUs/XACIPyFx4DakaITJvQm0vYTrtqlPvT+pSOHxo0u+OuQwfRa3pbkdQ8Dnl0LuZV0vLXLXQbLkdcFCrRfXOKMawEsxm9TOiGPKbK+B5TjZjbGy1jTHhnHjUIq/ZKTvuz397OBulR7cc6QzAd1atvLhROFTJlZGuL0z+RjYSaVYiDJd5v2y6I3DtejL+7SIhw2NoDcc34MVKHllI0FeUdkSdvtygvhh8r8jMYdZ8LmjWwukRmJaZb4U1nS4k8WdWP1c1q0qCP5JBbRJi86EzGNVU1ERzzzIWHKN+JdIPIBKTM6scwZK94xYNK3JhKKydhUQg6E6Eb827R+56yNM+eY0WMqpvwPi9w3h8EYBrLgfsft6SaXrId4lXBo6y6HdIvgHzYFxEHR8Uvm4zwUhw8FrIc8W4qhzaZGB3pMPF6y7OpMvGio8j0xbqawUptSYYj7hkFKgV8e8Hb7oA6te6DwAKwx5bk3XLAuYwbl6wl/Ggh6J9rJGh2m6Ayd2mzMG1bOmgtbq+PUApOryetpf3Tc= X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 844118a9-4e01-420e-53cb-08da52db219c X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2022 16:37:14.5004 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f1G+QPyAe0DU5CWs+dcmLxiKfWdvg35xxtRR7AboslKPb0DTit4lXeX+fd3tAaCVOWIEJZ8I3wGdfry2oGYKVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8114 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean |
Series |
[v2,01/15] firmware: zynqmp: Check if rx channel dev pointer is valid
|
expand
|
diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 341d7cf135..b0cd647aa5 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -26,7 +26,7 @@ struct zynqmp_power { struct mbox_chan tx_chan; struct mbox_chan rx_chan; -} zynqmp_power; +} zynqmp_power = {}; #define NODE_ID_LOCATION 5 @@ -79,6 +79,20 @@ int zynqmp_pmufw_node(u32 id) return 0; } +static int do_pm_probe(void) +{ + struct udevice *dev; + int ret; + + ret = uclass_get_device_by_driver(UCLASS_FIRMWARE, + DM_DRIVER_GET(zynqmp_power), + &dev); + if (ret) + debug("%s: Probing device failed: %d\n", __func__, ret); + + return ret; +} + static int ipi_req(const u32 *req, size_t req_len, u32 *res, size_t res_maxlen) { struct zynqmp_ipi_msg msg; @@ -92,8 +106,11 @@ static int ipi_req(const u32 *req, size_t req_len, u32 *res, size_t res_maxlen) res_maxlen > PMUFW_PAYLOAD_ARG_CNT) return -EINVAL; - if (!(zynqmp_power.tx_chan.dev) || !(zynqmp_power.rx_chan.dev)) - return -EINVAL; + if (!(zynqmp_power.tx_chan.dev) || !(zynqmp_power.rx_chan.dev)) { + ret = do_pm_probe(); + if (ret) + return ret; + } debug("%s, Sending IPI message with ID: 0x%0x\n", __func__, req[0]); msg.buf = (u32 *)req;