Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4740992pxv; Tue, 27 Jul 2021 15:24:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8+ozeYkvS55LK9NsYIup1KyMtjxiI+ODSVK+tYg1OEZ4QBxQS+VR6IGAMDlz096KQRxRJ X-Received: by 2002:a02:a999:: with SMTP id q25mr23737966jam.16.1627424697502; Tue, 27 Jul 2021 15:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627424697; cv=none; d=google.com; s=arc-20160816; b=S3f7z+ep2uM6EBcic+AqYkLruShFsN/ZyGLVid60RRM7guhT/vDAH+/iPs0u35ynVP Jo9PPh63uu/CsXOwTruORYzJhCnpAlkPeRSx+KYm6FRdBaiIY2LekSTCBwgvl95PWJ/Z A6bFY1IZxVNKsKy7hLj7QkLNzLIFvF4uia5zkYl0Tmt/F2JCi9M9J0EX8PDgomFlUM5/ hVY8jBDjkZEUu/t8qc5VjUSyjrRquyEcCp6KqFl2upir83nR6n6v6rb3ExFh4qNgscw/ PQ0NhX4CVEj3YOSTyB6zwsFtO6Ok1u8zmnot6XO5mnit1QZ2Y4dRCUSzkxqSlmzH39Nj 4Jng== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=9Z6gEMMxzEhhBe54qf2laJNdk3tgQ16jtT0j5cnLmjI=; b=OQQXEOCklNWDLD79tPUD9tr7p/Nw4sAfpZSu4dQkOM4OdpBHchHTZrq9uAST5Rlz6i AuNI5pZsfj6+hfiA9pkZuvDDVjLDfMsRVPTsM/UbOj3dbCDe4iyDkT2sYYOTCK3rnhQG CZewgtTf8DGAlx3mJcEH87tAdD5tqhstcXd53e3ODXMA7x6GrIY6qAvyYAanXAv5YQkF CkASq+XE1+kZAX7S5xu1k59ZKLUDFwnP+oYVp6Gy6vhAp6wGG1VczagvjiJpjWN2cekS ssIhIEfJRWYhLUwi5iLErNNX8em6ZnD6JXXcUOC8CxJYOXBMREPofy04N1wUAuaPmOyx GWcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VLEBUNuP; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si4737920jal.117.2021.07.27.15.24.45; Tue, 27 Jul 2021 15:24:57 -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=@kernel.org header.s=k20201202 header.b=VLEBUNuP; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232223AbhG0WW5 (ORCPT + 99 others); Tue, 27 Jul 2021 18:22:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:34612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231730AbhG0WW5 (ORCPT ); Tue, 27 Jul 2021 18:22:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 96CC660F6E; Tue, 27 Jul 2021 22:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627424576; bh=VIA7ByopduIbqMqMuEHkcD2asCYDJ/lb6j2Of7Nqwtg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=VLEBUNuPe1ipFChimXQ9oSy2CXbIQ3YluBFRdzR2ryk/iTzIi4g645v9NkNYHR8T0 LE/UQldu7zCmN1bxg7ZFpp/dHnsslb9lsbOzMOe0+6+UQXjwiir95DZB/J92FpE6Hq 85DfuKBwleT8U/M63Y8N5H7+nHOyJOnhmaGy4YuKoFjFkutWjDzUjmPkfPR6DW1qAd z0WWy+I45wQQsmMvgbckzeGMbz5XWqug+D2Ujpb3GyijYM04ncKEuVhPsBefuV3nAf XHF/KCw7yW/Fnm6LBe7j14JiOIGC6JI/EjJotP2ME9hyCPbI/J6vCXMoOHVyRDQ2/o QJvqTO2Qb/v9Q== Date: Tue, 27 Jul 2021 17:22:55 -0500 From: Bjorn Helgaas To: Amey Narkhede Cc: Bjorn Helgaas , 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: <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: <20210709123813.8700-9-ameynarkhede03@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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;