Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp439977ybm; Fri, 29 May 2020 04:03:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdrAVTQSW5ZILWBepHYGaNLE46emzobhsHPgiMorUBo5NAnvSvPugr8TX9fO6+X1NRYWcS X-Received: by 2002:a17:906:4989:: with SMTP id p9mr7427987eju.417.1590750200465; Fri, 29 May 2020 04:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590750200; cv=none; d=google.com; s=arc-20160816; b=cNDEq/RQG2VdYszgnQ74hTnaPmT52Cnt/XCD0D9B7TK36BS6iF5A260Ek8/W8aXBb1 Li8VpmlZKMMCeMo3fiADcIiqjmBY8Af6I87rt2nWlB2Kj2VYDl3b2Lpq4Bw4g2jiB37C XDnM75l5wFL72TPC642QzYhce9MijRiX36aDZQ4bIbD+Ev0nk4KzRxhN7M2w/HOSW4RG EQNhCeJI7B0xq6aK39sDeL0yFY+6vewVF/7NOJ1GHPeRP4f9mPCupdBJ8Jty1jay9ygI E/biqXCHi8BGcENx+VvmtPdFzJsOAop9VX3yF/QvwlXWGSLGc211g4UT+g9+5v7sQSdu nmgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Bu73DFOHN7pSH640IkQk7ZtM4DkLZaRtq6n7WGEYe44=; b=PjubcAXaA7QRHix0ZSmrZ9boyKuElr0jLBFpFbwk91Sj2BzgXrVvyFfd4BJKMUsnNC m7JOuGewaWwzKeHvA+fqVmI84qqMjcV5ihJ8Mi1u64s+iSR06fINZq++CrJ6QjRv0wzz VdW8Xae86Py9HxARmSI8k7eXJULOGn4UgBtSxEqblgDG7p6z5/pQNR0xBTLfkYXda9Hk VoLicFZp0jaVg5QPgThyWPwKixv7tIXneD13u4rC76bCico29bcOKCVkDWXTErOfyOcQ 9DuTI7BYtznH0c2kdl3AmZmiq9+PWOb8mClwW80WW8xrVlQuWR/6KZY+OU0pSvpy/932 yljQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si5738192ejz.424.2020.05.29.04.02.56; Fri, 29 May 2020 04:03:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725836AbgE2LBF (ORCPT + 99 others); Fri, 29 May 2020 07:01:05 -0400 Received: from sauhun.de ([88.99.104.3]:49008 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbgE2LBE (ORCPT ); Fri, 29 May 2020 07:01:04 -0400 Received: from localhost (p54b33184.dip0.t-ipconnect.de [84.179.49.132]) by pokefinder.org (Postfix) with ESMTPSA id 8A1C02C2034; Fri, 29 May 2020 13:01:02 +0200 (CEST) Date: Fri, 29 May 2020 13:01:02 +0200 From: Wolfram Sang To: Chuhong Yuan , Jan Glauber Cc: David Daney , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: thunderx: Add missed pci_release_regions Message-ID: <20200529110102.GD3417@ninjato> References: <20191206075349.18297-1-hslester96@gmail.com> <20200322160040.GD1091@ninjato> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="T7mxYSe680VjQnyC" Content-Disposition: inline In-Reply-To: <20200322160040.GD1091@ninjato> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --T7mxYSe680VjQnyC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 22, 2020 at 05:00:40PM +0100, Wolfram Sang wrote: > On Fri, Dec 06, 2019 at 03:53:49PM +0800, Chuhong Yuan wrote: > > The driver forgets to call pci_release_regions() in probe failure > > and remove. > > Add the missed calls to fix it. > >=20 > > Signed-off-by: Chuhong Yuan >=20 > Jan, any comment to this patch? Jan, are you still there? >=20 > Chuhong Yang, please make sure you have a proper To-Header next time! >=20 > > --- > > drivers/i2c/busses/i2c-thunderx-pcidrv.c | 19 ++++++++++++------- > > 1 file changed, 12 insertions(+), 7 deletions(-) > >=20 > > diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/bus= ses/i2c-thunderx-pcidrv.c > > index 19f8eec38717..31f7e254e99f 100644 > > --- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c > > +++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c > > @@ -172,8 +172,10 @@ static int thunder_i2c_probe_pci(struct pci_dev *p= dev, > > return ret; > > =20 > > i2c->twsi_base =3D pcim_iomap(pdev, 0, pci_resource_len(pdev, 0)); > > - if (!i2c->twsi_base) > > - return -EINVAL; > > + if (!i2c->twsi_base) { > > + ret =3D -EINVAL; > > + goto error_release_regions; > > + } > > =20 > > thunder_i2c_clock_enable(dev, i2c); > > ret =3D device_property_read_u32(dev, "clock-frequency", &i2c->twsi_f= req); > > @@ -189,16 +191,16 @@ static int thunder_i2c_probe_pci(struct pci_dev *= pdev, > > =20 > > ret =3D pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX); > > if (ret < 0) > > - goto error; > > + goto error_disable_clock; > > =20 > > ret =3D devm_request_irq(dev, pci_irq_vector(pdev, 0), octeon_i2c_isr= , 0, > > DRV_NAME, i2c); > > if (ret) > > - goto error; > > + goto error_disable_clock; > > =20 > > ret =3D octeon_i2c_init_lowlevel(i2c); > > if (ret) > > - goto error; > > + goto error_disable_clock; > > =20 > > octeon_i2c_set_clock(i2c); > > =20 > > @@ -214,7 +216,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pd= ev, > > =20 > > ret =3D i2c_add_adapter(&i2c->adap); > > if (ret) > > - goto error; > > + goto error_disable_clock; > > =20 > > dev_info(i2c->dev, "Probed. Set system clock to %u\n", i2c->sys_freq); > > =20 > > @@ -224,8 +226,10 @@ static int thunder_i2c_probe_pci(struct pci_dev *p= dev, > > =20 > > return 0; > > =20 > > -error: > > +error_disable_clock: > > thunder_i2c_clock_disable(dev, i2c->clk); > > +error_release_regions: > > + pci_release_regions(pdev); > > return ret; > > } > > =20 > > @@ -236,6 +240,7 @@ static void thunder_i2c_remove_pci(struct pci_dev *= pdev) > > thunder_i2c_smbus_remove(i2c); > > thunder_i2c_clock_disable(&pdev->dev, i2c->clk); > > i2c_del_adapter(&i2c->adap); > > + pci_release_regions(pdev); > > } > > =20 > > static const struct pci_device_id thunder_i2c_pci_id_table[] =3D { > > --=20 > > 2.24.0 > >=20 --T7mxYSe680VjQnyC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl7Q624ACgkQFA3kzBSg Kbbtpg/+L5P/8PE6Xaw90HATOaTCtM0KtQzkWcF6bGPAN/r0LBstX+5TjhIPyBnw 3A3kWp+YlFbM3WAbHM1erjMWlIygCzTgKMqPA3KwFvImJ0Bhfo04pptvbOB6QTIM FuDBNIrM/QN5w59OzqkmhJ9OkXNNy64+KkVEUJSQcz4WnRinTgvyDPUdD0yHChtg 78rqAiq+1WZDUkQajoKLqnkEQjVVVOF+S5AxDwc0neS0H55TuvvFaPR2JTiVKp6T VyCVe+lfS1v8m/2cQL4uxBLpxMwy7pr5eiaa9IF8XNmm5Ww+9ht7YWVnMn1KuOTM LAVID31cxjmL3W+6IVuRkfOwu49/V6NeVezChD0+XO+Eue84R7j0mRJg2epwRWw3 xfMm6DKhwCNLOVpYCo9sCdkYB85Gg0ilaou6gYIpEiQmIzoXzjQ227BKh6kLwwj7 RBmVSPg17JRlYoXLrmoDGmjjBvNh5GKxR+RnfvtRdsf1kcBK3TdQtMWbhZrr5n/w e5y6M6IHGUJ+ImsXWiwx3kZvee92wLcBvB3Zg17RGJBXI4IfP7/cu/iFttp58+Cu h3+FBEwbyhkxq0OIqBSvk3jjDnSNh1Vyf9uP93bzVyuPCDH+4SqYR9psC8Fn4Wza BNriZnMPXqFCdHEwkr96V+lRrnYhw2OvMryxYd6fk6vxA3FTGiQ= =R2TX -----END PGP SIGNATURE----- --T7mxYSe680VjQnyC--