Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754677AbdLGNzn (ORCPT ); Thu, 7 Dec 2017 08:55:43 -0500 Received: from mail-ve1eur01on0054.outbound.protection.outlook.com ([104.47.1.54]:35072 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753536AbdLGNzk (ORCPT ); Thu, 7 Dec 2017 08:55:40 -0500 From: Laurentiu Tudor To: Nipun Gupta , "stuyoder@gmail.com" , Bharat Bhushan , "gregkh@linuxfoundation.org" , "cakturk@gmail.com" , "bretth256@gmail.com" , "arnd@arndb.de" CC: "linux-kernel@vger.kernel.org" , "devel@driverdev.osuosl.org" Subject: Re: [PATCH 1/2] staging: fsl-mc: Allocate IRQ's before scanning DPRC objects Thread-Topic: [PATCH 1/2] staging: fsl-mc: Allocate IRQ's before scanning DPRC objects Thread-Index: AQHTbnlt2BNJ65h210adI9tnCdVqlqM2T7oAgAGPKACAAAoMAA== Date: Thu, 7 Dec 2017 13:55:36 +0000 Message-ID: <5A294826.9030805@nxp.com> References: <1512577087-5345-1-git-send-email-nipun.gupta@nxp.com> <5A27F0E2.6010403@nxp.com> In-Reply-To: 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=laurentiu.tudor@nxp.com; x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2432;6:p8zMT4NKVh62r1mi5ABjrtjb0H+9TS0Xt4BxHMnhqF2ltSzSiZjrkWNqS6QasqnbdAhaQAW2W/04zazvq0oVt5k3xX4kvQdXiCnApm81L/6rbSB9k9OqbJ+149kYEo4NWpqdgAb6FO86QDGEXJNBUMp0APg95EJHykxy0abI5QwmNjjF3hwFlqdhwGUBHOouTrcSp3iyPCh3cS7ABHoRbzGirwFvSTq7FRcJv+NPReHgLf+4g50jpOmM1RPkT4QuAPt13XmROiLAPcMon6flX/cyx6J0g3bPVEGLhwa5vRvDnx1ZO+LAMjjIYfqQMMxxlctZ8OFaujV+dfo21ZR3eDZYt1fnuMQKgnsYe9HeTeY=;5:1+mAt2mSathi1hoKuNPwxCN0HZXoMtzWGCFb3A8U/G67r9X9xKBms/Eo9dt6nwwJBHijJcu7BQR1VIsGDeyv8EOz1B0cpvPkR+KeI+pMg72Z3rEw3baZl/s3q3+lO4ZvmYCGCfrVDX5pfYU5L3ceWD18EC+sxHoasJT+pRTbP1o=;24:EKR27kSVTeo6OiYL9ARmaRAkpP6RvXKAwrpdwqqtjU7I4LahohXG1CGAdxI/4cWL2EfJWuEq/saT8p1KiGghRl06jD2Knpqt1rp24OoDj6g=;7:oJzK3O9LdRSogLW8wRv3dwiJxmHajV7Zt01RT93uEenJtgXAGKCIhR1tj/TCmlSP7BvBJIS7QfRt3UUc0xHJwo+10bKAg4R4JxPLw1MDEBkSWBMkwpFVCTl/GtPFmEaYEh/K2WgSG/npFLkQT45rz69LtisrXSo81c1w1yoDaTc39epliCg6QxzNAhYtWNknezqzI/DgepFrhFsM/a0UNg/CUG6nMLGOW9GNlho+ezdg3dLk5B8oMR8JtKqi7Pi2 x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(376002)(366004)(346002)(39860400002)(51914003)(199004)(189003)(13464003)(24454002)(2201001)(305945005)(81156014)(8676002)(81166006)(80316001)(7736002)(2950100002)(53546010)(87266011)(76176011)(65816011)(2900100001)(2906002)(3660700001)(229853002)(110136005)(316002)(54906003)(5660300001)(36756003)(3280700002)(97736004)(101416001)(6512007)(6436002)(68736007)(106356001)(478600001)(105586002)(66066001)(59896002)(6486002)(8936002)(6506006)(33656002)(99286004)(6116002)(102836003)(3846002)(86362001)(14454004)(39060400002)(6246003)(2501003)(5250100002)(25786009)(4326008)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2432;H:VI1PR0401MB1856.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 8b6382ae-4611-4c9e-f3f6-08d53d7a318e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286);SRVR:VI1PR0401MB2432; x-ms-traffictypediagnostic: VI1PR0401MB2432: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231022)(6055026)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011);SRVR:VI1PR0401MB2432;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:VI1PR0401MB2432; x-forefront-prvs: 05143A8241 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: <961C5A5CDEC6A94BAF54D8DB3774143B@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b6382ae-4611-4c9e-f3f6-08d53d7a318e X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2017 13:55:36.7987 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2432 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 vB7DtkL6016575 Content-Length: 3599 Lines: 94 On 12/07/2017 03:18 PM, Nipun Gupta wrote: > > >> -----Original Message----- >> From: Laurentiu Tudor >> Sent: Wednesday, December 06, 2017 19:00 >> To: Nipun Gupta ; stuyoder@gmail.com; Bharat >> Bhushan ; gregkh@linuxfoundation.org; >> cakturk@gmail.com; bretth256@gmail.com; arnd@arndb.de >> Cc: linux-kernel@vger.kernel.org; devel@driverdev.osuosl.org >> Subject: Re: [PATCH 1/2] staging: fsl-mc: Allocate IRQ's before scanning DPRC >> objects >> >> Hi Nipun, >> >> Can you polish a bit this commit message? It doesn't seem to explain why >> this is needed. > > Sure. Ill update the message. > >> >> On 12/06/2017 06:18 PM, Nipun Gupta wrote: >>> When DPRC probing is deferred (such as where IOMMU is not probed >>> before the fsl-mc bus), all the devices in the DPRC containers gets >>> initialized one after another. >> >> Are you referring to dprc probing being deferred (do we ever do that?) >> or devices inside the dprc deferring the probe? > > Yes.. Currently following is the scenario when the devices are probed > (please correct me if I am wrong): > > FSL_MC Bus probe ---> dprc probe ---> dprc devices scan ---> > probe of devices in DPRC container ---> allocate IRQ's. > > In case the devices being probed in the DPRC container need the IRQ's; > probing of that device will fail. > In the current scenario DPIO device while getting probed for the first time > gets deferred because the DPIO driver is not yet registered. > So there is no impact seen in the current code. > > In case the DPRC probing gets deferred, does in case IOMMU is enabled > (though it is not enabled till now for fsl-mc bus but we plan to add the > support as soon as mc bus is out from staging); the DPIO gets probed > before IRQ's being allocated. This causes DPIO probe to fail. > > So I think it makes sense that IRQ's are allocated before any devices > In the DPRC container are probed. Thanks for the details. It would be great if you could update the commit message with these execution flow details. >> >>> As IRQ's were allocated only once the >>> DPRC scanning is completed, the devices like DPIO which uses these >>> IRQ's at initalization fails. This patch allocates the IRQ resources >> >> s/initalization/initialization >> >>> before scanning all the objects in the DPRC container. >>> >>> Signed-off-by: Nipun Gupta >>> --- >>> drivers/staging/fsl-mc/bus/dprc-driver.c | 49 ++++++++++++++++++------------ >> -- >>> 1 file changed, 27 insertions(+), 22 deletions(-) >>> >>> diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl- >> mc/bus/dprc-driver.c >>> index 06df528..7265431 100644 >>> --- a/drivers/staging/fsl-mc/bus/dprc-driver.c >>> +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c >>> @@ -206,7 +206,8 @@ static void dprc_add_new_devices(struct >> fsl_mc_device *mc_bus_dev, >>> * dprc_scan_objects - Discover objects in a DPRC >>> * >>> * @mc_bus_dev: pointer to the fsl-mc device that represents a DPRC object >>> - * @total_irq_count: total number of IRQs needed by objects in the DPRC. >>> + * @total_irq_count: If argument is provided the function populates the >>> + * total number of IRQs created by objects in the DPRC. >> >> As a side node, after a cursory look i noticed that this total_irq_count >> parameter is used only for some sanity checks. I'm thinking of dropping >> it in a follow-up cleanup patch. > > Do you plan to send it very recently. > In that case I can rebase my patch on top of it. It's not on my short term TODO. --- Best Regards, Laurentiu