From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753014AbdJLJLJ (ORCPT ); Thu, 12 Oct 2017 05:11:09 -0400 Received: from mail-eopbgr00082.outbound.protection.outlook.com ([40.107.0.82]:26048 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751853AbdJLJLG (ORCPT ); Thu, 12 Oct 2017 05:11:06 -0400 From: Madalin-cristian Bucur To: David Miller CC: "netdev@vger.kernel.org" , "f.fainelli@gmail.com" , "andrew@lunn.ch" , "vivien.didelot@savoirfairelinux.com" , "junote@outlook.com" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 3/4] dpaa_eth: change device used Thread-Topic: [PATCH 3/4] dpaa_eth: change device used Thread-Index: AQHTQdG5AF6GrcltxEiO7VKOl62X06LfJLyAgADLVsA= Date: Thu, 12 Oct 2017 09:11:02 +0000 Message-ID: References: <1507644618-32006-1-git-send-email-madalin.bucur@nxp.com> <1507644618-32006-4-git-send-email-madalin.bucur@nxp.com> <20171011.140203.578840078366210432.davem@davemloft.net> In-Reply-To: <20171011.140203.578840078366210432.davem@davemloft.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=madalin.bucur@nxp.com; x-originating-ip: [192.88.146.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB3PR0402MB3850;6:mvA1AUIoMDUIT1eFVkAbeBYrVei2DxC6xZTwfQhBTs9hOqJao0GbZEm3nLaE9j24IJBMBuk0eW/GYi4kWLT+GlWVxlvendZ/WuSNtg9f6XQ6lP0/YAnmyEeIL9rIIiQtMmqZhwPC8uMhignChDGom1c4OeDDQSyh7GGcdWFmOeGq+Au9SE18TVnLkXVTvJd9XUpKXyi2JSdS+Qti1RtjnjD2dvEagtuzjJmK0mBCMNrKdhy2DrQg0u1/9eL5aBigc6Bnd1KJ2IWDGYUvbu7Hulb3G91RU0ZLfbodY0R5GzOrh6S8jsUb/Q9OV9boRCoNWOQ5PT/nkR8yhyk5sd2EMg==;5:2Dn4VGDeevqj+K8zoyKlmP/gXWgpxWnGDUQjOITnLi+h3rortk+wp5wYkYgsFhGOGt17gK0WH9PrUMGF+LP9W+aAqAziLVgvWb8IsLDy+9N3tkV46ZNGAZadaO9hlA5PCCkEkkgxwpXVvdQvRsaH63EhSfas47cuiN+pF3HBy+8=;24:Cp5wPMci5cPyAXwAsXeDKQCEyu+IpJnq5BIZOBhwfkh+RopBd5MQnIdCwD0KKyRAfAIQ1tqrtnSk0A/T9F/Cxvg58/eYQmNT6etD21R4bNs=;7:blr40IiIsEUwzZTY09O7ilp7kjz8Eg39JFbfFnJ8Plq6RZMHa8OwGSBdwlZ/RvnrVPm1cw/Ps/+m0nX771MeJz+wJDPA26CuO6Xn041iSPWL4/HCWrE6SAsvAL0ASvQ3awQ1sMuPwwXEzLRpVDnbsYwY3KXTYjbAlvROILJobVSFCSHxrTKuQnY1SvLPeo79FVh6YnPkz6L7Dt8h+/a+/q7XVgz7JxU9BxTIwNVHdPA= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 21d72e3e-6305-491c-564c-08d511512977 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:DB3PR0402MB3850; x-ms-traffictypediagnostic: DB3PR0402MB3850: x-exchange-antispam-report-test: UriScan:(185117386973197); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DB3PR0402MB3850;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DB3PR0402MB3850; x-forefront-prvs: 04583CED1A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(39860400002)(376002)(13464003)(377454003)(189002)(31014005)(199003)(86362001)(5250100002)(6916009)(189998001)(74316002)(3280700002)(68736007)(6506006)(2950100002)(3660700001)(229853002)(478600001)(53546010)(39060400002)(6116002)(102836003)(3846002)(6246003)(6436002)(8676002)(50986999)(25786009)(7696004)(55016002)(76176999)(54356999)(14454004)(316002)(99286003)(2900100001)(9686003)(7736002)(305945005)(33656002)(106356001)(53936002)(8936002)(97736004)(54906003)(81156014)(105586002)(66066001)(81166006)(5660300001)(101416001)(4326008)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3850;H:DB3PR0402MB3849.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2017 09:11:02.7253 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3850 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v9C9BEgD024350 > -----Original Message----- > From: David Miller [mailto:davem@davemloft.net] > Sent: Thursday, October 12, 2017 12:02 AM > To: Madalin-cristian Bucur > Subject: Re: [PATCH 3/4] dpaa_eth: change device used > > From: Madalin Bucur > Date: Tue, 10 Oct 2017 17:10:17 +0300 > > > @@ -2696,7 +2681,13 @@ static int dpaa_eth_probe(struct platform_device > *pdev) > > int err = 0, i, channel; > > struct device *dev; > > > > - dev = &pdev->dev; > > + /* device used for DMA mapping */ > > + dev = pdev->dev.parent; > > + err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40)); > > + if (err) { > > + dev_err(dev, "dma_coerce_mask_and_coherent() failed\n"); > > + goto dev_mask_failed; > > + } > > > > /* Allocate this early, so we can store relevant information in > > * the private area > > Since you are moving this code up before the netdev allocation, you must > adjust the failure path goto label used. > > Your change as-is will cause an OOPS because we'll pass a NULL pointer > to free_netdev(). Thank you, besides this new issue I was introducing I see there other problems, I'll include a cleanup of these error paths in v2. Madalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: Madalin-cristian Bucur Subject: RE: [PATCH 3/4] dpaa_eth: change device used Date: Thu, 12 Oct 2017 09:11:02 +0000 Message-ID: References: <1507644618-32006-1-git-send-email-madalin.bucur@nxp.com> <1507644618-32006-4-git-send-email-madalin.bucur@nxp.com> <20171011.140203.578840078366210432.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "netdev@vger.kernel.org" , "f.fainelli@gmail.com" , "andrew@lunn.ch" , "vivien.didelot@savoirfairelinux.com" , "junote@outlook.com" , "linux-kernel@vger.kernel.org" To: David Miller Return-path: In-Reply-To: <20171011.140203.578840078366210432.davem@davemloft.net> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org > -----Original Message----- > From: David Miller [mailto:davem@davemloft.net] > Sent: Thursday, October 12, 2017 12:02 AM > To: Madalin-cristian Bucur > Subject: Re: [PATCH 3/4] dpaa_eth: change device used >=20 > From: Madalin Bucur > Date: Tue, 10 Oct 2017 17:10:17 +0300 >=20 > > @@ -2696,7 +2681,13 @@ static int dpaa_eth_probe(struct platform_device > *pdev) > > int err =3D 0, i, channel; > > struct device *dev; > > > > - dev =3D &pdev->dev; > > + /* device used for DMA mapping */ > > + dev =3D pdev->dev.parent; > > + err =3D dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40)); > > + if (err) { > > + dev_err(dev, "dma_coerce_mask_and_coherent() failed\n"); > > + goto dev_mask_failed; > > + } > > > > /* Allocate this early, so we can store relevant information in > > * the private area >=20 > Since you are moving this code up before the netdev allocation, you must > adjust the failure path goto label used. >=20 > Your change as-is will cause an OOPS because we'll pass a NULL pointer > to free_netdev(). Thank you, besides this new issue I was introducing I see there other probl= ems, I'll include a cleanup of these error paths in v2. Madalin