Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752436AbdIFJeh (ORCPT ); Wed, 6 Sep 2017 05:34:37 -0400 Received: from mail-db5eur01on0056.outbound.protection.outlook.com ([104.47.2.56]:2304 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752226AbdIFJee (ORCPT ); Wed, 6 Sep 2017 05:34:34 -0400 From: Laurentiu Tudor To: Michael Ellerman , Gregory Fong , "linuxppc-dev@lists.ozlabs.org" CC: "linux-kernel@vger.kernel.org" Subject: Re: mpic IRQ_TYPE_BOTH handling Thread-Topic: mpic IRQ_TYPE_BOTH handling Thread-Index: AQHSZWLuf4xSgt84oE6lcuiw7fSy9aKe+oCAgAohZwA= Date: Wed, 6 Sep 2017 09:34:31 +0000 Message-ID: <59AFC126.30909@nxp.com> References: <87efrs8y8q.fsf@concordia.ellerman.id.au> In-Reply-To: <87efrs8y8q.fsf@concordia.ellerman.id.au> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.88.146.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2496;6:v4HZYZtiMhdfirRjq8SRGKuB2BD1M/FZOBeJjVQSpKmYHCcvavW4/9hm7jK6tFEA4zJ7zXkJ50dolN1B7cJNThsgYeGDl5diQuvkH2NVxkzTc4V9KVJCLxSlUE1AKpxizSDxnVdiplvNhfsyi5Y7BGkdyjJfl1pYY4r9LlHDhCBfTSSDF5cfBfX8I4o+lOytCGktdWRTwSMQRUZ1PCb5ZOBA+XtyY2Bc2dTNo+Dev/HswbapP3JaELqeBd+GiKXAmVjWQoekUClL7Zqc1VWWL5OlIfq9ojHiTAsd/Z/30nofTJ0ZzewHiWOGxojj2wcsi+pPC9eOhLn/hpTSrr9YNg==;5:3+IAbWv+vEya976qqDnOwysBWu4pEpwnBjUt7j25tdKz9rwoDNH2/VPUcVv8QlsR963aR5mNYqcUWT9SnLwJ7xXghIAWc3C1Wu5cWY3F2l5QjDOEPJHCF8iAzdXwpUMBVSPIKraZ/7fx0Zufc/KbKw==;24:x6O5A/xlPwAfmgn82wie+v+Vv0MiFedGhGgEzDAReBogOiZMTa2X0UdGR2/aOJrKefp+LZ4PVAEov05eEhV1j5DSfJSdX0WLyvL67gFUc1w=;7:4kBO82SQ8fl6tJzvugnHda5tTpoNHJ8PU6Mk9jqL/bBI1L++vPyf2N9IYeZXBBZB540WBuG6KfcMTbz64PCDYRuTUulUc8fICIy9l/1ljAytXyoEzdRqKMjut6V4Wljaan/4MY8+6mdUpslKnp8U2EYY9mQiBuNOygNuN73u3DcvjOaLsCczZh9EqFOodLDHcpjko9TzkHR0G6OAIJp3NVp3vCTdzm2YATgPyM3FnsQ= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: f717ac86-6d64-4523-f854-08d4f50a7a4f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0401MB2496; x-ms-traffictypediagnostic: VI1PR0401MB2496: authentication-results: spf=none (sender IP is ) smtp.mailfrom=laurentiu.tudor@nxp.com; x-exchange-antispam-report-test: UriScan:(8454915177855); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0401MB2496;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0401MB2496; x-forefront-prvs: 0422860ED4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(6009001)(39860400002)(189002)(53754006)(24454002)(199003)(377454003)(3660700001)(81166006)(101416001)(65816999)(7116003)(53546010)(6512007)(53936002)(33656002)(2900100001)(5660300001)(99286003)(189998001)(5250100002)(97736004)(66066001)(2501003)(39060400002)(3280700002)(14454004)(68736007)(4326008)(86362001)(6246003)(6116002)(3846002)(106356001)(566704002)(105586002)(102836003)(6436002)(8676002)(7736002)(478600001)(36756003)(6486002)(81156014)(305945005)(6506006)(2906002)(229853002)(76176999)(25786009)(2950100002)(8936002)(50986999)(54356999)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2496;H:VI1PR0401MB1856.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="Windows-1252" Content-ID: <138B46BE7B34AF4F9F282F4C92EE6040@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2017 09:34:31.5684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2496 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 v869YloO016093 Content-Length: 1838 Lines: 48 On 08/31/2017 01:52 AM, Michael Ellerman wrote: > Hi Gregory, > > Gregory Fong writes: >> Hi all, >> >> In arch/powerpc/sysdev/mpic.c , it looks like IRQ_TYPE_EDGE_BOTH is >> handled the same way as IRQ_TYPE_EDGE_FALLING: >> >> static unsigned int mpic_type_to_vecpri(struct mpic *mpic, unsigned int type) >> { >> /* Now convert sense value */ >> switch(type & IRQ_TYPE_SENSE_MASK) { >> case IRQ_TYPE_EDGE_RISING: >> return MPIC_INFO(VECPRI_SENSE_EDGE) | >> MPIC_INFO(VECPRI_POLARITY_POSITIVE); >> case IRQ_TYPE_EDGE_FALLING: >> case IRQ_TYPE_EDGE_BOTH: >> return MPIC_INFO(VECPRI_SENSE_EDGE) | >> MPIC_INFO(VECPRI_POLARITY_NEGATIVE); >> case IRQ_TYPE_LEVEL_HIGH: >> return MPIC_INFO(VECPRI_SENSE_LEVEL) | >> MPIC_INFO(VECPRI_POLARITY_POSITIVE); >> case IRQ_TYPE_LEVEL_LOW: >> default: >> return MPIC_INFO(VECPRI_SENSE_LEVEL) | >> MPIC_INFO(VECPRI_POLARITY_NEGATIVE); >> } >> } >> >> If IRQ_TYPE_EDGE_BOTH is unsupported, shouldn't we be returning an >> error, instead of silently setting to use IRQ_TYPE_EDGE_FALLING? >> Something like the following (sorry if the diff wraps weirdly, on >> webmail at the moment): > > I don't know this code so I asked Ben and he said something like > "PowerMacs never use BOTH, so it hasn't mattered, but Freescale machines > might". IIRC, the mpic in freescale MPICs the interrupts are either low or high, so not both. There's a bit which controls the interrupt polarity which selects if the interrupt triggers on high-to-low or low-to-high. So i guess it doesn't matter on freescale machines too. --- Best Regards, Laurentiu