Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751779AbbKIVSt (ORCPT ); Mon, 9 Nov 2015 16:18:49 -0500 Received: from mail-bl2on0111.outbound.protection.outlook.com ([65.55.169.111]:35757 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750885AbbKIVSr convert rfc822-to-8bit (ORCPT ); Mon, 9 Nov 2015 16:18:47 -0500 From: Jose Rivera To: Marc Zyngier , "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" CC: Stuart Yoder , Katz Itai , Lijun Pan , Li Leo , Scott Wood , "agraf@suse.de" , Hamciuc Bogdan , Marginean Alexandru , Sharma Bhupesh , "Erez Nir" , Richard Schmitt , "dan.carpenter@oracle.com" , "jiang.liu@linux.intel.com" Subject: RE: [PATCH v2 03/11] staging: fsl-mc: Added generic MSI support for FSL-MC devices Thread-Topic: [PATCH v2 03/11] staging: fsl-mc: Added generic MSI support for FSL-MC devices Thread-Index: AQHRE01zz38hZKye70Cn4id08aSw9p6PUL6AgABMp6CAA/OjgIAAsIQw Date: Mon, 9 Nov 2015 21:18:45 +0000 Message-ID: References: <1446234217-25512-1-git-send-email-German.Rivera@freescale.com> <1446234217-25512-4-git-send-email-German.Rivera@freescale.com> <563CE87B.9040107@arm.com> <56407967.1030506@arm.com> In-Reply-To: <56407967.1030506@arm.com> 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=German.Rivera@freescale.com; x-originating-ip: [192.88.168.49] x-microsoft-exchange-diagnostics: 1;DM2PR0301MB1310;5:gz7Gx9O1gNT/m8rhDCXEff8eMwfZoJg1CMmeVp8cF+WvOtvf0LwlshdvdCs5fJV3p1yLV94zG3BpkYDifDvup6Aj5jIPhGhO0MfcZfscpAAlb5NckNvnxHmuOM5PTUGntf2PdkPyX14kR0zlKCfw4A==;24:ED5MHxpLLM6O4Wp5ltRFXNup5qrFncrKPtm8MNYXK0NXErWwkngQTaDqzQCaZJPNE0aqeZ5tzhgxEBzUPd4HSSrNvGR6yZ9kDQ35MKnMDzk=;20:KoU8AtHqfxlJaBnXftjaZfwQSDOa4LBt2PVuJWazFsPoezzBOac/PqKwxERANOdq+9W1O7oi0S9v/Z6FMEvkUA== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1310; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(146099531331640)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001);SRVR:DM2PR0301MB1310;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1310; x-forefront-prvs: 0755F54DD9 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(164054003)(24454002)(377454003)(199003)(479174004)(189002)(101416001)(81156007)(93886004)(5001770100001)(19580395003)(66066001)(97736004)(2201001)(50986999)(40100003)(54356999)(76176999)(87936001)(10400500002)(33656002)(122556002)(92566002)(19580405001)(106116001)(5003600100002)(105586002)(106356001)(74316001)(5001960100002)(86362001)(2900100001)(2950100001)(11100500001)(76576001)(5007970100001)(5008740100001)(5004730100002)(5002640100001)(189998001)(77096005)(102836002)(2501003)(99286002)(41533002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1310;H:DM2PR0301MB1309.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2015 21:18:45.3938 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1310 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3707 Lines: 94 > -----Original Message----- > From: Marc Zyngier [mailto:marc.zyngier@arm.com] > Sent: Monday, November 09, 2015 4:46 AM > To: Rivera Jose-B46482; gregkh@linuxfoundation.org; arnd@arndb.de; > devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org > Cc: Yoder Stuart-B08248; katz Itai-RM05202; Pan Lijun-B44306; Li Yang- > Leo-R58472; Wood Scott-B07421; agraf@suse.de; Hamciuc Bogdan-BHAMCIU1; > Marginean Alexandru-R89243; Sharma Bhupesh-B45370; Erez Nir-RM30794; > Schmitt Richard-B43082; dan.carpenter@oracle.com; > jiang.liu@linux.intel.com > Subject: Re: [PATCH v2 03/11] staging: fsl-mc: Added generic MSI support > for FSL-MC devices > > On 06/11/15 23:20, Jose Rivera wrote: > > [...] > > >>> +static void __fsl_mc_msi_write_msg(struct fsl_mc_device *mc_bus_dev, > >>> + struct fsl_mc_device_irq *mc_dev_irq) { > >>> + int error; > >>> + struct fsl_mc_device *owner_mc_dev = mc_dev_irq->mc_dev; > >>> + struct msi_desc *msi_desc = mc_dev_irq->msi_desc; > >>> + struct dprc_irq_cfg irq_cfg; > > [...] > > >>> + /* > >>> + * DPRCs and other objects use different commands to set up IRQs, > >>> + * so we have to differentiate them here. > >>> + */ > >>> + if (owner_mc_dev == mc_bus_dev) { > >>> + /* > >>> + * IRQ is for the mc_bus_dev's DPRC itself > >>> + */ > >>> + error = dprc_set_irq(mc_bus_dev->mc_io, > >>> + MC_CMD_FLAG_INTR_DIS | MC_CMD_FLAG_PRI, > >>> + mc_bus_dev->mc_handle, > >>> + mc_dev_irq->dev_irq_index, > >>> + &irq_cfg); > >>> + if (error < 0) { > >>> + dev_err(&owner_mc_dev->dev, > >>> + "dprc_set_irq() failed: %d\n", error); > >>> + } > >>> + } else { > >>> + error = dprc_set_obj_irq(mc_bus_dev->mc_io, > >>> + MC_CMD_FLAG_INTR_DIS | MC_CMD_FLAG_PRI, > >>> + mc_bus_dev->mc_handle, > >>> + owner_mc_dev->obj_desc.type, > >>> + owner_mc_dev->obj_desc.id, > >>> + mc_dev_irq->dev_irq_index, > >>> + &irq_cfg); > >>> + if (error < 0) { > >>> + dev_err(&owner_mc_dev->dev, > >>> + "dprc_obj_set_irq() failed: %d\n", error); > >>> + } > >>> + } > >> > >> It feels a bit odd that you have all of this under a single MSI > >> umbrella, and yet have to differentiate between them. Do they have a > >> different programming interface? Or is that because these > >> dprc_set_*_irq functions do some other stuff behind the scene (I'm too > lazy to check...)? > >> > > Due to MC firmware API limitations, dprc_set_obj_irq can only be used > > to set IRQs for the DPRC's children not for the DPRC itself. > > Right. So this makes me wonder whether or not you have the right approach > here. The logic behind the bus type was that devices with a common > programming interface would share a bus type (the odd duck being platform > which is used to implement anything else). > > Your description seems to suggest that only devices behind the DPRC share > that programming interface, and that the DPRC itself is the local weirdo. > Should it be using the platform-msi subsystem instead? Or is it just a > matter of firmware oddity? > It's really a MC API oddity-- both the DPRC and the devices behind it share the same MSI context (same ITT in the ITS) but they just require different APIs to set the MSI addr/data. > This is probably not a big deal, but it is worth keeping it in mind, > specially if that has visible consequences (in your device tree, for > example). > > Thanks, > > M. > -- > Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/