Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5553548rwd; Mon, 12 Jun 2023 06:45:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7H5yCasZwxXrb9i3S6JQHuEwqbLmoQBGsKrx0g1iV/JMEUFfFOoaWC4bl6PAQrXZgl3S74 X-Received: by 2002:a05:6a00:3987:b0:663:8c28:61d7 with SMTP id fi7-20020a056a00398700b006638c2861d7mr11023606pfb.32.1686577539652; Mon, 12 Jun 2023 06:45:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686577539; cv=pass; d=google.com; s=arc-20160816; b=1KI4WVoZiKz8LmBPPczboU524ufz50fiAvzXDekI3bhRlX7M5bXp5Eyh5gviHLJjMi EqjoIcoKYETxEmiOw5QPuzBoes6KCTNNaf6Qv94JjP7Q5kngXCI8dMsSpWyR5O8BH7Kq WwZUJY+IGABjD3EAiz/PyQFnwtQJjCjxe5KmtzxOd1iFW6bbVORTYDkFqaMHynniWa4S oewiKg3keBgJyok6g7+6EePR7+IZmujmkpGChfVV0+SlLyOMu84CoVoQTrMwNbOgAgwu KIwNEDNuDucy1WgP5sMRfqDrgfZaCb9UWs+VlnYl3NjSsq/OCFDCamkp39JRrLDo9RC0 dOPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ooYyLpwWLycGPSdqC0zY252x62xf4jCZ/HRBQITXWF0=; b=mEIVppOu4/2XVGGdYOLpb1UmMWPpgL8NxZJydelJUhDFVSJ2xWytHacxn/YkzVdaV6 YkAibURS1+qWcKlcg8Cpy84NG/PFmriiVj2wKKQVSSYn7zJnT2a7uDxgExdeG98UEqBg Lh0ntMaz1m8JN+tV21oxOAA2K6EfVbl58q4LyiMudcHHG23/BYxtGK/Tx8Xr2zCnLNh3 VL78jfrXUfHQ8AiSSvvwqcBh2OX9xvQeC4ZrVR6Jo7tu8KLuO+S44G/33Z7TNJqfxQZn di9h+T/ApSqDKflq7sOYJhJZwvw/3TswTY7vazcBnWoJR7xvmKCjTF3Lv/ixzOoHZ4IR aIGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=WA6+mMl0; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a056a001a8f00b0064f50a4a515si7092484pfv.37.2023.06.12.06.45.26; Mon, 12 Jun 2023 06:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=WA6+mMl0; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232462AbjFLNQf (ORCPT + 99 others); Mon, 12 Jun 2023 09:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbjFLNQd (ORCPT ); Mon, 12 Jun 2023 09:16:33 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2102.outbound.protection.outlook.com [40.107.92.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B48CAB8; Mon, 12 Jun 2023 06:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KUcX/Ln2lmoeMnW7CAlCxsVNTyyQ9pvqRZqXStt/I4BdsclE37DCgKIxnqZBV1eLCejpQD8lKiaSiJ8CqxK76Ele9knM2aGL7NmhFudgYzkBqqwF5hJK+o1LEEsLGO2LdPI1+rJekOob0hKvYfJ+TjfqD+ZnHiTOlbOKrwpO4dgZGZmxv43/DLUEYLzQoN4/KMPeFarhtoGcQ0hAnDnsczX5lguyEoEkIMerPeSdEGwgmQxrQm7qBftrJEKVeN+fEYy01JwVRxIhE15RnDGbg48TMQVka1q3UFaGNiFwzHVx5RNX2tG/cQETVPKYmg/ORUT2ZcTpTKFHrcdjsMJaNg== 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=ooYyLpwWLycGPSdqC0zY252x62xf4jCZ/HRBQITXWF0=; b=UTaidXoBSCHfXxdav3lmGhNCRKziQD2CPOC/fN7kb3KJt3th6NS0hyvMB96inCTbtq+Rl44Ds+E9JzVtNbQQJol5Us9dd2Z/6LiC7ZDXURmGuomR0nNvrUZlh4BTii7dOlFx6mIlCqKRuS/vMliqRdttXBMxr8yKjUEmyWeYgBOONTpBU20yoiE7amo3yCRudXibqq4M9JRC5cAmsiQRp/5Ctnoxaod3rm7TQ8b0IqUpufAzynvicAlu39IarffsoTRUSgeshsxFZhwJ+FBPL0f9pqfGUmfZqDmhTGJC0qm1Yfus1g2vGrMsh4dBidg+a2AKTePmezTTJ1EGMKZ70A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ooYyLpwWLycGPSdqC0zY252x62xf4jCZ/HRBQITXWF0=; b=WA6+mMl0sHAjAq8NQL0DPokze17MP8xSlehCxzthC7L5n5T4l5vfKr7/+wmFg+ArrHbx92TON+RfW/UcmclyDIFDfQnpc1OaNBLBDLy+sO88toy5zAFIsOCoHcy7fRJvmCXlVq/owFwpq5KD0qkXoOVwl/9rHUBcxuVK8sxiRLY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by BY3PR13MB4945.namprd13.prod.outlook.com (2603:10b6:a03:36f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.38; Mon, 12 Jun 2023 13:16:27 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::eb8f:e482:76e0:fe6e%4]) with mapi id 15.20.6477.028; Mon, 12 Jun 2023 13:16:26 +0000 Date: Mon, 12 Jun 2023 15:16:19 +0200 From: Simon Horman To: Sarath Babu Naidu Gaddam Cc: richardcochran@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vincent.cheng.xh@renesas.com, harini.katakam@amd.com, git@amd.com Subject: Re: [PATCH] ptp: clockmatrix: Add Defer probe if firmware load fails Message-ID: References: <20230612100044.979281-1-sarath.babu.naidu.gaddam@amd.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230612100044.979281-1-sarath.babu.naidu.gaddam@amd.com> X-ClientProxiedBy: AM4PR05CA0003.eurprd05.prod.outlook.com (2603:10a6:205::16) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|BY3PR13MB4945:EE_ X-MS-Office365-Filtering-Correlation-Id: acf65b4a-3c9e-4c0a-c901-08db6b473a17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5xTgrtz+opQD+0H2YLumPxar1P9QIrpaS6oUAAy3KGO63Z8Ojof6hCvBaLPG+F3EB+MNsI5BJ+oj3w08ihkD0RxrKtFJWJt3Xqx2QbaDetz/Mup+9tMnqJ3wZUOqFdV2b/OUPawW7G+DDzT9a0WUWVouEHtvXnVgTGBUqrLO1A71q/xaNXapXfSvjkvFO3VWs/Y5gCfajOP1+GCGG0LhEGg4w1+LLqa0u7GqvPf1AYwB6JF+iVBSq4kKevHF5cNrIjY5fdKLLKPGMM90+gaSjxoqIt+OX8TemY+u7kxSLx0d03GDph5dMSi3h+hqpa72JSYYQBOd/CyBoLQ6+CPCqn+Jnv6b9GFf3w9zf3XZzmhS0tJox1CcLBw7CpCdt5OOfWQstqcMYM7j2YD9Oi11It900D8xZ/J/s6Jfb95GLRhI5EG6VfT7pci6gZoRiVgexi13Gvc43hoUy5+iEQFI0k+1RHBZG7E1rDskFq01j3JdhqThNg0OtmOC6eaewRR4DhrJDDZnJYqI7m6bvmeTnfQLcqHkLBSansHzht0ADJ+nQSlAqys6Li1mfABqJ8I4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39840400004)(346002)(376002)(396003)(136003)(451199021)(2906002)(6486002)(316002)(41300700001)(83380400001)(86362001)(6512007)(186003)(6506007)(44832011)(2616005)(38100700002)(5660300002)(36756003)(8936002)(66476007)(66556008)(66946007)(478600001)(8676002)(6666004)(4326008)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?kUYFndJjDNObmpHKeERmla02ISzn2mPP3IQgVH/tQzDyQKIggVjAF6OmW5RA?= =?us-ascii?Q?hu1zbEmALn/8x92+s/sEFI38vCqFC4qz0bjKXU09hQrkjwIO4xlksbuYcxO8?= =?us-ascii?Q?NY0j0BoWyHtQMQ1o5QNy+FqpYHtgbWBlIk7yohNP+QPbuyOcw8C2Y1gkINb1?= =?us-ascii?Q?3odvTaHBp4gmtjgJpVau++tPvxGGzVd8Ujh0kaJDFd5kPPiAXuCohbiPm5zI?= =?us-ascii?Q?eKXKWO5bS1AqJyi3/gMto0f/SQZxcv8Cu0s/qo7dXKcWBmaQnQ5ObS9sE+hf?= =?us-ascii?Q?0m62jc/abMSwd2lgL0ZLw/pR0n6gtzELzXgMetbVvkSdQg9DZGsX3wsnxr1I?= =?us-ascii?Q?8OT3Hs/em0cLpKNomouGBniksIwxthN5P+es/9aneIZpJXsutxRb9fgcM2Dy?= =?us-ascii?Q?NOTFSkrDv3N89JAg5lmqneE/IwnznXCI0teTitmZNETOVI6RKhaUm6HRH+ph?= =?us-ascii?Q?qgnYJSsU9irD6t/wd/YQ8Zs57GhQaSEhQEsljeo6PCdOl1JYIw/nXCTILS7m?= =?us-ascii?Q?ynL8Yvq9mCdzl5ctS8fXpYv1tXvu7ovUvCPzj/fZGGMqduGjKGz0ovcZnuR9?= =?us-ascii?Q?QkOpLIDqxnFsbDKlO7MOksVvGgoEoij2nleXYn2Ecwyi2FBmxikfAvyZnngI?= =?us-ascii?Q?oFKT+rseSfCzkl1B5Z4f/nv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?Q?QH7i25lyB4qIJcpMIWvlwo0CtM/XdlHJj6iRklzlikWb5TKxzs0Cagd7Mn1h?= =?us-ascii?Q?ISZY9AwncO0Adt4yDrRUC1aFTFVgOfWG0Ph50W6b0BAFOJmV+L9HzSQZuLfd?= =?us-ascii?Q?OxNCOA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: acf65b4a-3c9e-4c0a-c901-08db6b473a17 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 13:16:26.6698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: p5/Ejz1CEPsxS2O7qUjYBzFX0LWJsSUX1/d7NRTO7kv1Kal4ZEOPHpqT8wYGrroWT7FlcuufM6ST1OEJUduFvh/eDb4Opu3UVD2juun52Rg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4945 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 12, 2023 at 03:30:44PM +0530, Sarath Babu Naidu Gaddam wrote: > Clock matrix driver can be probed before the rootfs containing > firmware/initialization .bin is available. The current driver > throws a warning and proceeds to execute probe even when firmware > is not ready. Instead, defer probe and wait for the .bin file to > be available. > > Signed-off-by: Sarath Babu Naidu Gaddam > --- > drivers/ptp/ptp_clockmatrix.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c > index c9d451bf89e2..96328dfb7e55 100644 > --- a/drivers/ptp/ptp_clockmatrix.c > +++ b/drivers/ptp/ptp_clockmatrix.c > @@ -2424,9 +2424,13 @@ static int idtcm_probe(struct platform_device *pdev) > > err = idtcm_load_firmware(idtcm, &pdev->dev); > > - if (err) > + if (err) { > dev_warn(idtcm->dev, "loading firmware failed with %d", err); > > + if (err == -ENOENT) > + return -EPROBE_DEFER; Hi Sarath, Smatch reports that idtcm->lock is leaked here. > + } > + > wait_for_chip_ready(idtcm); > > if (idtcm->tod_mask) { > -- > 2.25.1 > >