All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: Fiona Trahe <fiona.trahe@intel.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Marco Chiappero <marco.chiappero@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	qat-linux@intel.com, Bjorn Helgaas <helgaas@kernel.org>,
	linux-crypto@vger.kernel.org, kernel@pengutronix.de,
	linux-pci@vger.kernel.org, Jack Xu <jack.xu@intel.com>,
	Wojciech Ziemba <wojciech.ziemba@intel.com>,
	Tomaszx Kowalik <tomaszx.kowalik@intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v3 6/8] crypto: qat - simplify adf_enable_aer()
Date: Wed, 11 Aug 2021 23:34:05 +0200	[thread overview]
Message-ID: <20210811213405.avihazo33irdjxic@pengutronix.de> (raw)
In-Reply-To: <YRO69xL+F/6Paj+I@silpixa00400314>

[-- Attachment #1: Type: text/plain, Size: 4183 bytes --]

On Wed, Aug 11, 2021 at 12:56:39PM +0100, Giovanni Cabiddu wrote:
> On Wed, Aug 11, 2021 at 10:06:35AM +0200, Uwe Kleine-König wrote:
> > A struct pci_driver is supposed to be constant and assigning .err_handler
> > once per bound device isn't really sensible. Also as the function returns
> > zero unconditionally let it return no value instead and simplify the
> > callers accordingly.
> > 
> > As a side effect this removes one user of struct pci_dev::driver. This
> > member is planned to be removed.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Thanks Uwe for the rework.
> 
> > ---
> >  drivers/crypto/qat/qat_4xxx/adf_drv.c          |  7 ++-----
> >  drivers/crypto/qat/qat_c3xxx/adf_drv.c         |  7 ++-----
> >  drivers/crypto/qat/qat_c62x/adf_drv.c          |  7 ++-----
> >  drivers/crypto/qat/qat_common/adf_aer.c        | 10 +++-------
> >  drivers/crypto/qat/qat_common/adf_common_drv.h |  2 +-
> >  drivers/crypto/qat/qat_dh895xcc/adf_drv.c      |  7 ++-----
> >  6 files changed, 12 insertions(+), 28 deletions(-)
> > 
> > diff --git a/drivers/crypto/qat/qat_4xxx/adf_drv.c b/drivers/crypto/qat/qat_4xxx/adf_drv.c
> > index a8805c815d16..1620281a9ed8 100644
> > --- a/drivers/crypto/qat/qat_4xxx/adf_drv.c
> > +++ b/drivers/crypto/qat/qat_4xxx/adf_drv.c
> > @@ -253,11 +253,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> >  
> >  	pci_set_master(pdev);
> >  
> > -	if (adf_enable_aer(accel_dev)) {
> > -		dev_err(&pdev->dev, "Failed to enable aer.\n");
> > -		ret = -EFAULT;
> > -		goto out_err;
> > -	}
> > +	adf_enable_aer(accel_dev);
> After seeing your patch, I'm thinking to get rid of both adf_enable_aer()
> (and adf_disable_aer()) and call directly pci_enable_pcie_error_reporting()
> here.
> 
> There is another patch around this area that I reworked (but not sent
> yet - https://patchwork.kernel.org/project/linux-crypto/patch/a19132d07a65dbef5e818f84b2bc971f26cc3805.1625983602.git.christophe.jaillet@wanadoo.fr/).
> Would you mind if your patch goes through Herbert's tree?
> If you want I can also send a reworked version.

As patch #8 of my series depends on this one I think the best option is
to create a tag and pull that into both, the pci and the crypto tree?!

@Bjorn: Would you agree to this procedure? There has to be a v4, if it
helps I can provide a signed tag for pulling?! Just tell me what would
be helpful here.

> >  	if (pci_save_state(pdev)) {
> >  		dev_err(&pdev->dev, "Failed to save pci state.\n");
> > @@ -310,6 +306,7 @@ static struct pci_driver adf_driver = {
> >  	.probe = adf_probe,
> >  	.remove = adf_remove,
> >  	.sriov_configure = adf_sriov_configure,
> > +	.err_handler = adf_err_handler,
> Compilation fails here:
>     drivers/crypto/qat/qat_4xxx/adf_drv.c:309:24: error: ‘adf_err_handler’ undeclared here (not in a function)
>       309 |         .err_handler = adf_err_handler,
>           |                        ^~~~~~~~~~~~~~~
> 
> Were you thinking to change it this way?
> 
> 	--- a/drivers/crypto/qat/qat_common/adf_common_drv.h
> 	+++ b/drivers/crypto/qat/qat_common/adf_common_drv.h
> 	@@ -95,8 +95,11 @@ void adf_ae_fw_release(struct adf_accel_dev *accel_dev);
> 	 int adf_ae_start(struct adf_accel_dev *accel_dev);
> 	 int adf_ae_stop(struct adf_accel_dev *accel_dev);
> 
> 	+extern const struct pci_error_handlers adf_err_handler;
> 
> 	--- a/drivers/crypto/qat/qat_4xxx/adf_drv.c
> 	+++ b/drivers/crypto/qat/qat_4xxx/adf_drv.c
> 	@@ -306,7 +306,7 @@ static struct pci_driver adf_driver = {
> 		.probe = adf_probe,
> 		.remove = adf_remove,
> 		.sriov_configure = adf_sriov_configure,
> 	-       .err_handler = adf_err_handler,
> 	+       .err_handler = &adf_err_handler,
> 	 };

Yeah, the other three drivers need an adaption, too. I will send a v4 in
the next few days. The current state is available at

	https://git.pengutronix.de/git/ukl/linux pci-dedup

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-08-11 21:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11  8:06 [PATCH v3 0/8] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-08-11  8:06 ` Uwe Kleine-König
2021-08-11  8:06 ` [PATCH v3 1/8] PCI: Simplify pci_device_remove() Uwe Kleine-König
2021-08-12  6:44   ` Christoph Hellwig
2021-08-11  8:06 ` [PATCH v3 2/8] PCI: Drop useless check from pci_device_probe() Uwe Kleine-König
2021-08-12  6:46   ` Christoph Hellwig
2021-08-11  8:06 ` [PATCH v3 3/8] xen/pci: Drop some checks that are always true Uwe Kleine-König
2021-08-11  9:51   ` Uwe Kleine-König
2021-08-12  6:50   ` Christoph Hellwig
2021-08-11  8:06 ` [PATCH v3 4/8] PCI: replace pci_dev::driver usage that gets the driver name Uwe Kleine-König
2021-08-11  8:06   ` Uwe Kleine-König
2021-08-12  7:07   ` Christoph Hellwig
2021-08-12  7:07     ` Christoph Hellwig
2021-08-12  8:14     ` Uwe Kleine-König
2021-08-12  8:14       ` Uwe Kleine-König
2021-08-14  8:38       ` Christoph Hellwig
2021-08-14  8:38         ` Christoph Hellwig
2021-08-11  8:06 ` [PATCH v3 5/8] scsi: message: fusion: Remove unused parameter of mpt_pci driver's probe() Uwe Kleine-König
2021-08-12  2:51   ` Martin K. Petersen
2021-08-12  7:10   ` Christoph Hellwig
2021-08-11  8:06 ` [PATCH v3 6/8] crypto: qat - simplify adf_enable_aer() Uwe Kleine-König
2021-08-11 11:56   ` Giovanni Cabiddu
2021-08-11 21:34     ` Uwe Kleine-König [this message]
2021-08-12 14:43       ` Giovanni Cabiddu
2021-08-13  8:15         ` Uwe Kleine-König
2021-08-11  8:06 ` [PATCH v3 7/8] PCI: Replace pci_dev::driver usage by pci_dev::dev.driver Uwe Kleine-König
2021-08-11  8:06   ` Uwe Kleine-König
2021-08-11 14:07   ` Boris Ostrovsky
2021-08-11 14:07     ` Boris Ostrovsky
2021-08-11  8:06 ` [PATCH v3 8/8] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210811213405.avihazo33irdjxic@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=fiona.trahe@intel.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jack.xu@intel.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=marco.chiappero@intel.com \
    --cc=qat-linux@intel.com \
    --cc=tomaszx.kowalik@intel.com \
    --cc=wojciech.ziemba@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.