Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp588844rwl; Fri, 7 Apr 2023 02:07:32 -0700 (PDT) X-Google-Smtp-Source: AKy350bCf8uoFu5Fnw0U/RViscQfL61imPqROYTmJITRVEW41Im4EY/yBsv1KUIIL5q48sqSsQc2 X-Received: by 2002:a62:5211:0:b0:626:2cc8:311e with SMTP id g17-20020a625211000000b006262cc8311emr1495054pfb.12.1680858451981; Fri, 07 Apr 2023 02:07:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680858451; cv=pass; d=google.com; s=arc-20160816; b=rKRaFs3mpeRnrRc9WZfNC5Yp/rOIv8VPuRC77ATuQqjpFHleAnC1tJUrIV5eMC56bj UaGO59TJNkwP5tUeVdtk7k8jHUQDQLEA6Ibp+LNbe3Kk0O02y53qjKGCbAlsKGKvTNG0 fLdAgnU//YoLGNH6dkKHcqX3Zuq8vnpfqaTtuECXmyeHXIAPdO53zqN0jlWd+akT0FPL Uz54MXX+ZyOBuFuZVhVm/17iUEbt6QbYLErMA8qhzwBNx02sC5K/gu9PgR3dRB+34IpS kyQwiG/oHB5qwlnEBTS/GDOCMWlU8yDLBv4mB3jG42S4AAqWihNpLhatztLVwKFGIA98 Fvew== 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=JGzzygMuCBZygdJ367nYSEKi7+DZ/K9TR09ZIZOIanQ=; b=vrnqpSNb3Ue/ulsoFcZnyttK4ePt/j/bYyg7DKa3BCu8dhuiOhEyA8tEEyjgq383bo zu5lXE0ARqmIQmSvBH+BRhnrmzshOiIJC0I289yxvCC7V02piXdxrm51sEEVBh3jyYry 1rKHmyRQxB8YvnR4GnbJUjndO6rmOt0tEQP42Fj2dNwFBuwP6+4cri0NoqHR5YA77FW7 sw1axVKFfCEmiu3U+rdajwBrwxowxku/lTlN+sk/mJr8nDiyuIZAe1B/+GkU85CgC8db aP6/Qi6xofSUtUOc+sTaw4wkcm4bqljr9BdYVqIkbRQZ/I6JCQSy8AM3Xm47o7zJx5bi 1V0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=ivbPuHjo; 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 w5-20020a634745000000b004fbd79d66c9si3096557pgk.23.2023.04.07.02.07.20; Fri, 07 Apr 2023 02:07:31 -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=ivbPuHjo; 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 S240427AbjDGJBa (ORCPT + 99 others); Fri, 7 Apr 2023 05:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238453AbjDGJB2 (ORCPT ); Fri, 7 Apr 2023 05:01:28 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2107.outbound.protection.outlook.com [40.107.244.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 201F793D9; Fri, 7 Apr 2023 02:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oHAyRTCKkH5rKqGvkj4t3okOD35qANOKnmOAELqbKgKKKDXF+aMmosRcqwfxLtpU0BmZovb0FYuPFw8mjBzVECtmoXCjcNRnMqDf93Qhyfwaw85RVBIAOk4NXYk0YKpiZNjs75T6SR3dlRlVOs7zF3IguL9NRoirAudWUSWmOxSxosyd1Lbpat93WvuUyW2Lqix/IRKMsgT5NoDETQkbTXmjEM7BoFwazIQtwOYSNlawDM2aiLkktKpxu3j5iuglZ6AVA/+UwsVLSV6O5JUCLXaD2xvwzRL5feM80tYFuyOIkwrDmWMfwxTY78NXBRfNabq3kmPWrAKqbyr3Adnysg== 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=JGzzygMuCBZygdJ367nYSEKi7+DZ/K9TR09ZIZOIanQ=; b=M3UMGiUkn2K2423+W9riYEnmfe8FBbLhWIcFGTVyTFv1mymp/I8SayEfWz1JeRr7tMKC1NTTtaDdpxf345u41vT/uLR4e65s2O9mZ1vhwsJ3dYcN5LTCqAUkgWKfl5TGJ8jUPE+SKUy9aQtCNcsojqccWbSuNg4zeos3yksMPrU4EUrNVkFgy8IQG854jd+4Z5q67G3cF2HtKxo92hWyY2/ilSASyJlyOA/hU05qEvpHlG9Fx5Smu5FqXSIi5FjK0vGdd8Zdz5hDfAkJl0HKG0tfxGIpl4tWxOswlf1OUt+Ga3pMq253Y79uksgvJiaCm9ASH45DXkIPMrUq2tYYMg== 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=JGzzygMuCBZygdJ367nYSEKi7+DZ/K9TR09ZIZOIanQ=; b=ivbPuHjo2EyIttSSgscBaQ0Izy0sYEgoukvVKDtfEjugXRYZ7Mpo5rVMv6gwiMfEMz45rTGvrg9Jh43lrBKR6D/Y1xGtHjh9RdL4SrdedUbmpAnicwbPC+++8SSN2HMib4LahGbhGYp7IwCwF3SdqnNBBXVhz6Tu/Ckz8ryx9yo= 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 MW3PR13MB3995.namprd13.prod.outlook.com (2603:10b6:303:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.34; Fri, 7 Apr 2023 09:01:21 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::89d1:63f2:2ed4:9169]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::89d1:63f2:2ed4:9169%5]) with mapi id 15.20.6277.034; Fri, 7 Apr 2023 09:01:21 +0000 Date: Fri, 7 Apr 2023 11:01:14 +0200 From: Simon Horman To: Denis Plotnikov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, anirban.chakraborty@qlogic.com, sony.chacko@qlogic.com, GR-Linux-NIC-Dev@marvell.com, helgaas@kernel.org, manishc@marvell.com, shshaikh@marvell.com Subject: Re: [PATCH net-next v2] qlcnic: check pci_reset_function result Message-ID: References: <20230407071849.309516-1-den-plotnikov@yandex-team.ru> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230407071849.309516-1-den-plotnikov@yandex-team.ru> X-ClientProxiedBy: AM0PR04CA0117.eurprd04.prod.outlook.com (2603:10a6:208:55::22) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|MW3PR13MB3995:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a536aa8-abee-4b07-a21d-08db3746a810 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YFa3eTEXUVtY7SS6rBOsZS0QaZW+ZoGiNjFHktTgvzokWWeTOM/XQklVDxKiMdQ7Ld/GKf924fpCLc8IbEcAikNN2hyTbmse522iDDlys4pHr4SoZXwzddaoJKYMNbNg69cqDkXDwXDiewSHWoz+LzQqze6cuZuktWoDLdpzvo+ejGMAeANZhiRznKZNwLsopxdT36UxWKnkZ9fo4Z/1rLCEDV2zgO1Xf2/YNJWHmGqbm8ticD4NfQ7Y41jxRlwUu5vT8wRXvGheTv6oLtyPO0fH/uRopyUV9DC4GAFKZegyuscCDjIS3sNRHO6gjMZtUwhvY+lLWSVMG0B26cpcwxIPWY0exPeYGFFcg/oyru0WhYrsXjEJllRk6BQk4XJ1Cd0dS4alI6G66FWhXJzm8xi7wc/Qj5YDNVoC/SjaRqgCy4tvoNYswGgEfNtI3ofmaaeTjp0f020raHc1OSYFEUQv42PfyTH6RbcZ+D1GU4J3PbWDzumNdTH9qKSKjg3qtrYUj73kvxtsiIA8cnmIyUV3tYyb4GZjCWQfSKAon9ZzijA6sQ+xgL/l3gxBznglNhonmLlar2mp/HE5wbnOmS69atB33DRaLK3F4hOQU/I= 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)(136003)(396003)(346002)(39840400004)(376002)(451199021)(38100700002)(2616005)(316002)(83380400001)(478600001)(186003)(86362001)(66946007)(66556008)(66476007)(4326008)(8676002)(6916009)(2906002)(6506007)(6512007)(6666004)(44832011)(36756003)(5660300002)(6486002)(966005)(8936002)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?mB/MZOKvmSZ8QHAiSVOb7bzHAve2nhCEllxSsxH4jUZ8WMKZAKT+HaYrVLOh?= =?us-ascii?Q?axiS3RnLWFwd0Sk5MfsEwoz7cNEupF1ARCHYkD+R93V6hJTefFUI1VmruiBE?= =?us-ascii?Q?flmDH93ulJUUl+vXoueRzHPd4zldgPVZuDSsQ/Li89R7lh+Bvhh8j1UYNh5y?= =?us-ascii?Q?7cVSjslb1+YOIFrA7LR/G6uxI3VBoJfgBeStgvH91fQPm2KlxiaaunBEd02t?= =?us-ascii?Q?+g6dCMC0BpkgoC6wRKmo5oDO4fue0lnWt+Ba4O37Owk4oIqfugQE6eXznQwO?= =?us-ascii?Q?RCpwQ2LvJoToq9+8SwiCioGnddnXRxgl4fKItOrgtkt+8C3fiG7rAXYH+n7f?= =?us-ascii?Q?+lDIh/tSh6NtWEPTWWlIvixmbQ5KZxJ/pZXuOyEj13F8EPv8c4cMc2ikpbFS?= =?us-ascii?Q?T44rl/pLG27sTlZGebmE4gile/pwWX1jmT3JMXJresFTfwTZeFiAdgLlMOaq?= =?us-ascii?Q?9NTYt6DNMo9zjM0rAI6nt2oPxHPmeh7Q86yCW8kdc63wEDVYCf1BZvnvgGrh?= =?us-ascii?Q?oOKccHSvHYCPf2KY3/StJE0DRKexYSsz+xvBVhJvjxxK1Dbyh1ajHuarjkxG?= =?us-ascii?Q?/npFcaQxUk/LTNexl21svCMzsFFn+y9wshbl3X2CYCTk29/QAZQJ2o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OgewFSINSXED5112h53cLvUJNLXuYFr/?= =?us-ascii?Q?ekRxOyFsRV1YDy4a0vCa2v121WvNYs5kPoD5zpa94Gd/Ujiz5873opGODt6A?= =?us-ascii?Q?jV+OrfWFziqIXZPjzHMrtl318fjpCk8XILRd7Q+jZ5u5zNvZDtBK13R7hZCx?= =?us-ascii?Q?At/oxw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a536aa8-abee-4b07-a21d-08db3746a810 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 09:01:21.1784 (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: U53b4pSGVIzOSRydpcQfoBhI9oN+Bi7O8Q8nf9dvG/IODHkOTZcLbwcD9vek+tMgAsoCDpMnkvlkrSgLVhJuXSI039eXGaS98HrGATzni8w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB3995 X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Fri, Apr 07, 2023 at 10:18:49AM +0300, Denis Plotnikov wrote: > Static code analyzer complains to unchecked return value. > The result of pci_reset_function() is unchecked. > Despite, the issue is on the FLR supported code path and in that > case reset can be done with pcie_flr(), the patch uses less invasive > approach by adding the result check of pci_reset_function(). > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 7e2cf4feba05 ("qlcnic: change driver hardware interface mechanism") > Signed-off-by: Denis Plotnikov Thanks Denis, With reference to, Link: https://lore.kernel.org/all/20230405193708.GA3632282@bhelgaas/ I think this is the best approach in lieu of feedback from those with knowledge of the hardware / testing on the hardware. Reviewed-by: Simon Horman > --- > drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c > index 87f76bac2e463..eb827b86ecae8 100644 > --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c > +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c > @@ -628,7 +628,13 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev) > int i, err, ring; > > if (dev->flags & QLCNIC_NEED_FLR) { > - pci_reset_function(dev->pdev); > + err = pci_reset_function(dev->pdev); > + if (err) { > + dev_err(&dev->pdev->dev, > + "Adapter reset failed (%d). Please reboot\n", > + err); > + return err; > + } > dev->flags &= ~QLCNIC_NEED_FLR; > } > > -- > 2.25.1 >