Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5435280pxv; Wed, 28 Jul 2021 10:37:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaYDnnmSnpCJLxMDQlMQ6lh1XugYGuytDT4wu53ERXY0BBIPnFxG05T5idK/lI22g88PGP X-Received: by 2002:a92:c64a:: with SMTP id 10mr611788ill.159.1627493859834; Wed, 28 Jul 2021 10:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627493859; cv=none; d=google.com; s=arc-20160816; b=wVFLXRSkgRyMHYzWk0QM4OY4IPJfvGT0daEtcsrC9dKJR+ykIANit7wiPA6071eNKD j5An29uHHTC7UuBYQSgeLJgbyL3vURLWoXk6eS+KXUmK4WY7HljvYb1lhoNLd371zQZv ympqPFgMIuFg3NkcTo4LlDLpCj0eaZbsaEEtN4RJKIJlCDycYegclHZRBT3mJa0GEtlS LkLx5tHhwoASIv3+w63omP5ETNiGeYLXX0tCi1R8KwU/yGijuYKf5CMWzXwqyHaxsRBt 36fgk4DLapDG3hNIk6kZWNdonWYWjstFXtIpPDV55NUUsYAqIy2d5MN5ZP75HYkQoJ+Q CA+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3PzlsUS0qKWXyNmKIehGk56GXadOKQkGPpY5nA01M/I=; b=VwUOJ12U5mOZ6PrN+tp2QM0ZhJe2mSevOI6kxiJ+c2msb+ArWVztPGAn1+G6IZPppq qQY+Hftz+ZfINag7fgB9iTjyhFkuniHiJLyGJiLGOzhr2eUiZvKVLuH7DXBMtUyBx0GY iMXL7ndv2ub2WupM3bYFjrIw1j29GtJy1cdQviy6z+RcDZcOrKQxYap4iz8bnVERjLPS BlaLz4B3FSldvdtVki2U2oN2gS3AyPr26jU9DyHgJwQJmi7XF/x0WaGIrBn2Uok8Tsep tvVKNnzrjrckPKl/cU8K2aiQE8/GrD3EqVDCQr/DUA9cOp6ANHrOAR06IjmR13l6/Rhl qOjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UwXvtSjR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si457682iog.21.2021.07.28.10.37.25; Wed, 28 Jul 2021 10:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UwXvtSjR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbhG1RfX (ORCPT + 99 others); Wed, 28 Jul 2021 13:35:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbhG1RfW (ORCPT ); Wed, 28 Jul 2021 13:35:22 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08C44C061757; Wed, 28 Jul 2021 10:35:19 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id ca5so6214428pjb.5; Wed, 28 Jul 2021 10:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=3PzlsUS0qKWXyNmKIehGk56GXadOKQkGPpY5nA01M/I=; b=UwXvtSjRMoZIbi3eoNKm/tPsmFZ+JpRfMx5b+4rKRH4Ia2lLUf8wHGodjcMziHB+3g lEnzwX4Ndn0Ywzg4RVBd1PuH0fc0VQ3gLXt1UfYdRt1JV0YkVziGRS5/cS3AYrTX6Cls 3Gdda5h+6rsdjMwnuytW3VCJMKNC4vnMnbS9ChrB7qfbuRf73PX6HNcDSfVc7E5c1zQF 9uhIcHwBvfCEwDSj676Gl0Xoujvaq1UTNNXtl993bViGjYpP8rkcdqxhh/C7j2JsBdmv 4fTLMp9U9eNTdiS6hqDjhgeevGdWeEnORPP4s1qZ7DMErEg8htSOW94RcFTpco8MITu+ Rjyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=3PzlsUS0qKWXyNmKIehGk56GXadOKQkGPpY5nA01M/I=; b=RffxUnVdLPmtv5MV1xrC+ofqvbeX834hzNuHUbllYhL18zseZGLc3vPUYGqFfWH4AI Oa/wzVLAOb1rwZ/4SMGbygZVXhkHWS8Y4TueMfKk5jx6W6h7A3TjeFTWK0ywn3EhQp/t MxTKkPJWzpiICMiT/fDhNHW+iEc7DZ4dgq2oMzBh9lxDJ6Eskr1WlI9XtDSDgvhnzZeQ jrrzRnBHpwj8TbkJXisLJrRdhvC6N7Hu/2JBTHHopr1AH8kXJGfTiGj8O+mNIOfK3I2v 7u4VgVuKnwi22INwtng1Q8952HT/UL+dm8dIfmQopt6PE1DLk31yg2PygSr3vZZvASjl x30Q== X-Gm-Message-State: AOAM530oQ3dBcCmEMhQug9G5+zEClGs+nIWNLRPZtHQjHD73yM02zLCV Ec+PwWjEfo0YelZcc5OppjI= X-Received: by 2002:a17:90b:1896:: with SMTP id mn22mr840485pjb.148.1627493718316; Wed, 28 Jul 2021 10:35:18 -0700 (PDT) Received: from localhost ([49.32.196.184]) by smtp.gmail.com with ESMTPSA id p17sm6649958pjz.16.2021.07.28.10.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 10:35:17 -0700 (PDT) Date: Wed, 28 Jul 2021 23:05:14 +0530 From: Amey Narkhede To: Bjorn Helgaas Cc: alex.williamson@redhat.com, Raphael Norwitz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kw@linux.com, Shanker Donthineni , Sinan Kaya , Len Brown , "Rafael J . Wysocki" Subject: Re: [PATCH v10 8/8] PCI: Change the type of probe argument in reset functions Message-ID: <20210728173514.77yiv2vjvjpf6ao5@archlinux> References: <20210709123813.8700-9-ameynarkhede03@gmail.com> <20210727222255.GA751984@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210727222255.GA751984@bjorn-Precision-5520> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/07/27 05:22PM, Bjorn Helgaas wrote: > On Fri, Jul 09, 2021 at 06:08:13PM +0530, Amey Narkhede wrote: > > Introduce a new enum pci_reset_mode_t to make the context of probe argument > > in reset functions clear and the code easier to read. Change the type of > > probe argument in functions which implement reset methods from int to > > pci_reset_mode_t to make the intent clear. > > Not sure adding an enum and a PCI_RESET_MODE_MAX seems worth it to me. > It's really a boolean parameter, and I'd be happy to change it to a > bool. But I don't think it's worth checking against > PCI_RESET_MODE_MAX unless we need more than two options. > Is it okay to use PCI_RESET_PROBE and PCI_RESET_DO_RESET as bool. That would be less confusing than directly using true/false. Thanks, Amey > > Add a new line in return statement of pci_reset_bus_function(). > > Drop this line, since I don't think it's correct and there's no need > to describe whitespace changes anyway. > > > Suggested-by: Alex Williamson > > Suggested-by: Krzysztof WilczyƄski > > Signed-off-by: Amey Narkhede > > > @@ -306,7 +306,7 @@ static int nitrox_device_flr(struct pci_dev *pdev) > > return -ENOMEM; > > } > > > > - pcie_reset_flr(pdev, 0); > > + pcie_reset_flr(pdev, PCI_RESET_DO_RESET); > > > > pci_restore_state(pdev); > > > > > @@ -526,7 +526,7 @@ static void octeon_destroy_resources(struct octeon_device *oct) > > oct->irq_name_storage = NULL; > > } > > /* Soft reset the octeon device before exiting */ > > - if (!pcie_reset_flr(oct->pci_dev, 1)) > > + if (!pcie_reset_flr(oct->pci_dev, PCI_RESET_PROBE)) > > octeon_pci_flr(oct); > > else > > cn23xx_vf_ask_pf_to_do_flr(oct); > > > +typedef enum pci_reset_mode { > > + PCI_RESET_DO_RESET, > > + PCI_RESET_PROBE, > > + PCI_RESET_MODE_MAX, > > +} pci_reset_mode_t;