From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944865AbcJaQ6D (ORCPT ); Mon, 31 Oct 2016 12:58:03 -0400 Received: from mail-eopbgr30067.outbound.protection.outlook.com ([40.107.3.67]:46048 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S944677AbcJaQ6A (ORCPT ); Mon, 31 Oct 2016 12:58:00 -0400 X-Greylist: delayed 10745 seconds by postgrey-1.27 at vger.kernel.org; Mon, 31 Oct 2016 12:57:59 EDT From: Noam Camus To: Daniel Lezcano CC: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "tglx@linutronix.de" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2 1/3] soc: Support for NPS HW scheduling Thread-Topic: [PATCH v2 1/3] soc: Support for NPS HW scheduling Thread-Index: AQHSLSbctgkUbbhfEEqcXUI4evn6GqDCaFGAgAAHOqA= Date: Mon, 31 Oct 2016 12:26:56 +0000 Message-ID: References: <1477224748-25223-1-git-send-email-noamca@mellanox.com> <1477224748-25223-2-git-send-email-noamca@mellanox.com> <20161031102659.GA1506@mai> In-Reply-To: <20161031102659.GA1506@mai> 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=noamca@mellanox.com; x-originating-ip: [212.179.42.66] x-ms-office365-filtering-correlation-id: c575c647-5dcb-46f3-41db-08d401893424 x-microsoft-exchange-diagnostics: 1;DB6PR0501MB2519;7:JtTgGDa2xnp7pTbwEIwRFB+8+OydtBvquXo8yTNdP3r1BCMfcv3Zcm4K9aFRMK563VDERWs72IfPAdzZgyDKfqbHuSDUY5SYRCTPw7blOzHTd/LgPdsrAoVKK0SCRJBIBW5EFm7+upqCSHLq55Kzb7+uZ7k9pEgTjRaPjqfusbHOHVf7lcrVzpPq3Xszdj7hTyMvPDFtwtMasuoVt3vn79uH8PKkjVCegH0s1lyjn7PB9CSPQbOAFNPOEj+mZjrUjimiEuN+PyhFXfrmBn8MaUjUzlaZdeJ8u7F1H00L53DqmMFYUUTuWKrkagNKtnqcTqaEGKm155DAtPyMQWMGJRAysWClPzTnt2aZzWkUaGU= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0501MB2519; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:DB6PR0501MB2519;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0501MB2519; x-forefront-prvs: 01128BA907 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(377454003)(199003)(189002)(86362001)(122556002)(189998001)(66066001)(3660700001)(110136003)(92566002)(305945005)(11100500001)(6916009)(7696004)(2950100002)(7846002)(81156014)(5660300001)(8676002)(7736002)(81166006)(19580405001)(97736004)(19580395003)(3280700002)(68736007)(105586002)(4326007)(76576001)(50986999)(106116001)(106356001)(10400500002)(74316002)(8936002)(33656002)(101416001)(9686002)(2900100001)(5002640100001)(87936001)(3846002)(586003)(2906002)(77096005)(6116002)(102836003)(54356999)(76176999);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0501MB2519;H:DB6PR0501MB2518.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Oct 2016 12:26:56.0499 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2519 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 mail.home.local id u9VGw8UQ030105 > From: Daniel Lezcano [mailto:daniel.lezcano@linaro.org] > Sent: Monday, October 31, 2016 12:27 PM >> >> This new header file is for NPS400 SoC (part of ARC architecture). >> The header file includes macros for save/restore of HW scheduling. >> The control of HW scheduling is acheived by writing core registers. >s/acheived/achieved/ Thanks will update in V4 of this patch set ... >> +#ifndef SOC_NPS_MTM_H >> +#define SOC_NPS_MTM_H >> + >> +#define CTOP_INST_HWSCHD_OFF_R3 0x3B6F00BF >> +#define CTOP_INST_HWSCHD_RESTORE_R3 0x3E6F70C3 >> + >> +static inline void hw_schd_save(unsigned int *flags) { >> + __asm__ __volatile__( >> + " .word %1\n" >> + " st r3,[%0]\n" >> + : >> + : "r"(flags), "i"(CTOP_INST_HWSCHD_OFF_R3) >> + : "r3", "memory"); >> +} >> + >Wouldn't make sense to change the macro name to CTOP_INST_HWSCHD_SAVE_R3 ? The save of state into register (R3) by this dedicated instruction is only part of action which main purpose Is to turn off the HW scheduler within this core (we call CTOP). We use it (Off/On) at places we wish to keep consistency of data where more than one HW thread can access. So I believe this way macro name reflects properly the functionality of this instruction and the API functions schd_save()/schd_restore() provide similar format like with IRQs. > +static inline void hw_schd_restore(unsigned int flags) { > + __asm__ __volatile__( > + " mov r3, %0\n" > + " .word %1\n" > + : > + : "r"(flags), "i"(CTOP_INST_HWSCHD_RESTORE_R3) > + : "r3"); > +} > + > +#endif /* SOC_NPS_MTM_H */ > -- > 1.7.1 >