Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752971AbbHTPXW (ORCPT ); Thu, 20 Aug 2015 11:23:22 -0400 Received: from mail-bn1bon0076.outbound.protection.outlook.com ([157.56.111.76]:53346 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751512AbbHTPXU (ORCPT ); Thu, 20 Aug 2015 11:23:20 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@caviumnetworks.com; Subject: Re: [PATCH 2/5] gic-its: Allow pci_requester_id to be overridden. To: Pavel Fedin , "'David Daney'" , , "'Catalin Marinas'" , "'Will Deacon'" , "'Bjorn Helgaas'" , , "'Thomas Gleixner'" , "'Jason Cooper'" References: <1436979285-8177-1-git-send-email-ddaney.cavm@gmail.com> <1436979285-8177-3-git-send-email-ddaney.cavm@gmail.com> <01a101d0db52$2d23b360$876b1a20$@samsung.com> CC: , "'Robert Richter'" , "'David Daney'" From: David Daney Message-ID: <55D5F0E1.30702@caviumnetworks.com> Date: Thu, 20 Aug 2015 08:23:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <01a101d0db52$2d23b360$876b1a20$@samsung.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN1PR07CA0016.namprd07.prod.outlook.com (25.162.170.154) To CY1PR0701MB1728.namprd07.prod.outlook.com (25.163.21.142) X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1728;2:Rkdk7Mg9GeR2vi+0GdePGx7tm9gyH1WC+lJK4LhaZEED/byRRBNn9CHyfankivRpiwQBMY5HdNotQmCrABVmfpo73GuEOYi86sATYHrYp2hBNpxE+aMvm+dM9mnxpU1Xa759kjXvkNlW5O2ToqnjF7xTqN5jpUukAiAXsoQgSrA=;3:jhoyIl/m9hDpcaKvs9oAdYS3lkSvUYjf0f/TAndbmGbOLLAnn87J1nuW95RKUygAAsaQVLSFCRK+j7A/N9KQaS6NA2OadTRbmACNMH8tayMKz3k781z89Mi1/oL9SmKGDsK0NcgKMCLeH8YCXuJEBA==;25:QZosO0Y+OmI8xRCOhwq1Cvue/M50J2W79lgN+pBoVHCi3kTtyBfZkcaT1XhD0dw7DA/HF32B3a1Oo2h9309TYGqkwzcFxUnCgeG0BaujY9UTEbALv/J/i9PX33bopc1yhwv2nwnYfznZrEihOMaUhL+CHhYfDOmo7abRQPSkyV+Vj/oqTD9egOgIOvlu57hTkv87NMMzcCMXNZWUxmkKbL+w6jJB6nzxSC8TurKum2BmZhNupevXN5UPj5eFrCnM X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1728;20:RHOTOo1eEN8Wdg/GIPDw8QO13dPMg7TPuVV2rTz6zvR90kwwharG5PRthXqU0kuwD2OE+W7h88sCfe8fqd57ZZ1c8LMXb9HzPGXV5U5k2v5CJo6Oe3zirJzYorXTTdxZQgVT1UQDCo87n0DppOt4c2S1Pqy17zopTIEBVhPW5/864S4h4CFKe0b/hWur+h1uMPsXSO7WetU6ntMvIRcwYwVJcXf273fxDq+P6bILDPS3DTbN+NyZY6D/ZU0Qjgnytx66PaQGiFAx7zRM6/rwIMxuLeT6x7yshWMZ7ByDvvD3DSaDFpvew1WenuxFr2m27YM4/flkU5oo8xZ6VMYh7KWdVorIU/SlNn0uh216Rx6fOzCitFBhouv9ljT7prdB+rLyfxLlEhs3maWoq8fWlzTeIzmelMmbjbJqQPvwPRBkFqIakRII38qS7T9RpPdUFZzo1HcvMkDRWcF9norMkf0ga2r5dBSu6VhV+m24u6Ja1z8ZZOYCTtrESVATWt0n7PgCcQzjpGTlXsJWjKOGSsEjCisVq7lR6sntGy6DgdpYra10SskQr5Hp8RO9dqBNncGMelIbFlUOUzXmJrbiCwDEmGrCwJlb3SxAXjo5m2A=;4:amYye8jWf/Pcx80dgnRWvTSyVDjPqIq+Ym8LKVAPQ8BclTDRGrNZqkOOK4G0So74GcXOXz/9CpDc0s8qQIbPW1mmlLd0rG1gmJO1DjiKQ4T4msPagXgFjDQjnLJ3ajaOxK0l1klgLcD5S9SEWWgv+hVxiUetBg3u6pAJKV6lH13BcDWDRwejMfr2l43IQYXFc9nVoul2CFMKZM2sXGybcZP1cNhVHeWz+GmBPJ68zOnMuh7D9QGKKSFrV7FqhwzFzmZMIOeOt7Qari5LWaVOsyWH8wCIEqLcQx3c4MHyJ+NCrP7hHcxjDV8/wtmO7ylT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(8121501046)(3002001);SRVR:CY1PR0701MB1728;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1728; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(13464003)(377454003)(189002)(71364002)(479174004)(24454002)(199003)(36756003)(64706001)(42186005)(122386002)(5001960100002)(33656002)(62966003)(5001860100001)(81156007)(4001350100001)(50466002)(5007970100001)(97736004)(47776003)(53416004)(23746002)(66066001)(65956001)(5001770100001)(69596002)(46102003)(83506001)(4001540100001)(77096005)(105586002)(76176999)(2950100001)(87976001)(65806001)(5001830100001)(77156002)(54356999)(19580395003)(64126003)(68736005)(101416001)(92566002)(65816999)(106356001)(189998001)(19580405001)(76506005)(40100003)(50986999);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1728;H:localhost.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY1PR0701MB1728;23:Jpwfjdc8RW9ggnRkNzXJYEiT9v4ZMaeF0ub?= =?Windows-1252?Q?lHdtbl2l/8jeirG8gtTzTgODWU4zuEseh1QJ1a650Ac1G9nazc3OkzMh?= =?Windows-1252?Q?zx0B8mm8IiF1VCkf+PvcqQhP1bYeiS5SfICuln3FWqVjHd3qp38KllJI?= =?Windows-1252?Q?WLZCmjskEi4Q8J6pMRRlAqK6H9GYn67SGDRN5EbIY/IY88NodArXhLT5?= =?Windows-1252?Q?7D8ihlDxrG6u0WPJ8eywC39qaxr9FIEvaiDM2gq21OmDBHd/gRf2Ba6l?= =?Windows-1252?Q?54wPfIG6jEcnSLpRFLR+1cTX9vUg0vuzfoj8M91aOzPLxGvmENuwG5eQ?= =?Windows-1252?Q?xfYSVmZd3jocVZZGKqzpwl/QJrZkir5j1jvZZmndK/V3ztPglwU66kJl?= =?Windows-1252?Q?vnUtg/phunqkxsIEkNvjfqRwAXigWavvOJtFq7TKakJr/wnnsIwOMVeZ?= =?Windows-1252?Q?u2gL4MsWprN+OjLdjA/OCEnUeI6ZOfcaqD6RzDlcDxri+Wv5atRd4Jlx?= =?Windows-1252?Q?y/OAw+rj3xjKiaVC4KzlUcv2IIemw5uY3thXe537epaM9yMy/YHZyHoG?= =?Windows-1252?Q?wsaXGnxGzw9r5GvBv7DcAoncDXplIejjW8wcbArRfX0Qle6BFvYCHCKa?= =?Windows-1252?Q?hQ4BaqlK5O7t2oUVYaTld2k5OYZlb2mqPE4oqUU4BWxwfUWBIi/kAc57?= =?Windows-1252?Q?qhkkHURAUckp2s0iro5bf+/i0mCp24KAUfDU0ftAP50kBevaxTcJmL/q?= =?Windows-1252?Q?kg7ZoHZ8z1aBTi3cbn8niH7to5Obyh5yUuY4Mc3/N8yfUSKIeHq7gmqt?= =?Windows-1252?Q?lnjSdZzo1TfCz2KUYRhM5zkMLFCIXKLDBLd0c8/FyyR4QfGK6Vtm9lWS?= =?Windows-1252?Q?1RYWh5qbXpoxxssZeBxmPoTUQC6Hja37PduIltzIzPthBKXv/CAYIIfo?= =?Windows-1252?Q?3egRyVRKNRWiG3a9mtFb/wgJhuEiU0+iYhhzHZ5YVf+/lCvPQpu5Q/6B?= =?Windows-1252?Q?+lTdDgINFCrynvEItB+iCDXiI7u0xy08n3amojc+DSIpAA9ByA7V1mhy?= =?Windows-1252?Q?j2nVo1h/12srM5gok00GKpvvEdWxT0CqAaKKUGck5Knyv3nVK+bEUA1p?= =?Windows-1252?Q?VvgkFrDZtROlKEPt3o/6OMfX7wH1mCurpRK77ToKKbOv1osBQkkYLy20?= =?Windows-1252?Q?R3k29ZAMFRSm8eFwUYXfH2w1QdJ5AHoRMJk1DlfOWwXUEKBkzdDOnLNs?= =?Windows-1252?Q?Mw9055ZRrmM6xj6YzZkPa2wLMB67IVhw1MgQzBEmJSMBp3RysMMU2HrN?= =?Windows-1252?Q?Jqg8UDwFkp5lgDg7tHs/xo/dd8ewrfPsQTE0ewZZRrVmChQgLtFvo8Wg?= =?Windows-1252?Q?ZcO6ogr5gqqe5il04dsgCLzdUFagMtuPRQ6uo3quX/Zkj7F865jdTn1H?= =?Windows-1252?Q?Y7Zl7eJVL8E1gnvxLmnmNdwA8Gmr/7WZbfMzBmiXK69I4ZmphlpIlLnI?= =?Windows-1252?Q?8LSzPbMP4UOnxD5+kqF13cnmCuof5?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1728;5:7zWPM3SS/m++HEhaKAo4zV89s7kIy9J6hxn9DZZkRPSNH6nU4jxbB1QTnYrXXdupNPbkvT6frN38uN5mV64BJybkydOyOzmci245Qk0CXmtWjS7QX1txQne4wkeFqP5B6zZLfmYzqlMmPkGu1OYVeA==;24:l9q0NvySbWKvcktzob8TXYO+UsGIkbZ0frLadfN/sdG3C1Mriunuw7jZ+BmBe6ICoiLtbll7B9cUZLee/Hdw5YMRzPj4zQjYOuq4wV/N9FY=;20:X+tmX2dvB18Mcdib+eIcCztvYLr+sWO+L38N1K0ItWbwRevtgaG1lcC27Dq1MDrDbcRoBveYrmKYxDqQfcWy7w== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2015 15:23:16.7189 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1728 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3384 Lines: 100 On 08/20/2015 07:11 AM, Pavel Fedin wrote: > > Hello! > >> -----Original Message----- >> From: linux-pci-owner@vger.kernel.org [mailto:linux-pci-owner@vger.kernel.org] On Behalf Of David >> Daney >> Sent: Wednesday, July 15, 2015 7:55 PM >> To: linux-arm-kernel@lists.infradead.org; Catalin Marinas; Will Deacon; Bjorn Helgaas; linux- >> pci@vger.kernel.org; Thomas Gleixner; Jason Cooper >> Cc: linux-kernel@vger.kernel.org; Robert Richter; David Daney >> Subject: [PATCH 2/5] gic-its: Allow pci_requester_id to be overridden. >> >> From: David Daney >> >> Signed-off-by: David Daney >> --- >> drivers/irqchip/irq-gic-v3-its.c | 14 +++++++++++++- >> include/linux/irqchip/arm-gic-v3.h | 2 ++ >> 2 files changed, 15 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c >> index 1b7e155..4580970 100644 >> --- a/drivers/irqchip/irq-gic-v3-its.c >> +++ b/drivers/irqchip/irq-gic-v3-its.c >> @@ -1189,11 +1189,23 @@ static int its_pci_msi_vec_count(struct pci_dev *pdev) >> return max(msi, msix); >> } >> >> +static u32 its_dflt_pci_requester_id(struct pci_dev *pdev, u16 alias) >> +{ >> + return alias; >> +} >> + >> +static its_pci_requester_id_t its_pci_requester_id = its_dflt_pci_requester_id; >> +void set_its_pci_requester_id(its_pci_requester_id_t fn) >> +{ >> + its_pci_requester_id = fn; >> +} >> +EXPORT_SYMBOL(set_its_pci_requester_id); > > IMHO having a globally defined function is a horrible approach. What if some HW has two different > PCI host controllers, each of them wants to provide different form of IDs? I know, this is just > imaginary, but still... It is not imaginary, such systems exist. > What if instead of this function we simply add a field to a struct pci_bus ? Then bus driver would > fill in HW-specific ID bits for every bus. > I can send a patch if interested. There is a lot of work being done in the upstream to extract the proper information from the device tree. We are going to piggyback on that for the next versions of the patch. ACPI will have to be made to work as well. David Daney > >> + >> static int its_get_pci_alias(struct pci_dev *pdev, u16 alias, void *data) >> { >> struct its_pci_alias *dev_alias = data; >> >> - dev_alias->dev_id = alias; >> + dev_alias->dev_id = its_pci_requester_id(pdev, alias); >> if (pdev != dev_alias->pdev) >> dev_alias->count += its_pci_msi_vec_count(dev_alias->pdev); >> >> diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h >> index ffbc034..18e3757 100644 >> --- a/include/linux/irqchip/arm-gic-v3.h >> +++ b/include/linux/irqchip/arm-gic-v3.h >> @@ -389,6 +389,8 @@ int its_cpu_init(void); >> int its_init(struct device_node *node, struct rdists *rdists, >> struct irq_domain *domain); >> >> +typedef u32 (*its_pci_requester_id_t)(struct pci_dev *, u16); >> +void set_its_pci_requester_id(its_pci_requester_id_t fn); >> #endif >> >> #endif >> -- > > Kind regards, > Pavel Fedin > Expert Engineer > Samsung Electronics Research center Russia > > > -- 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/