From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933361AbcBPX3Z (ORCPT ); Tue, 16 Feb 2016 18:29:25 -0500 Received: from mail-bl2on0093.outbound.protection.outlook.com ([65.55.169.93]:60918 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933053AbcBPX3Y (ORCPT ); Tue, 16 Feb 2016 18:29:24 -0500 Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=caviumnetworks.com; Subject: Re: [PATCH V2] AHCI: Workaround for ThunderX Errata#22536 To: Robert Richter References: <1455319230-30201-1-git-send-email-tchalamarla@caviumnetworks.com> <20160214170152.GC3965@htj.duckdns.org> <56C147B2.9010303@caviumnetworks.com> <20160215183041.GH3965@htj.duckdns.org> <20160216144250.GD31343@rric.localdomain> <56C37524.5090000@caviumnetworks.com> <56C37AD3.4030407@caviumnetworks.com> <56C37D94.8080403@caviumnetworks.com> <20160216211410.GI25086@rric.localdomain> CC: David Daney , Tejun Heo , , , , From: Tirumalesh Chalamarla Message-ID: <56C3AD1C.2000003@caviumnetworks.com> Date: Tue, 16 Feb 2016 15:13:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160216211410.GI25086@rric.localdomain> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BY2PR04CA059.namprd04.prod.outlook.com (10.141.249.177) To BLUPR0701MB1778.namprd07.prod.outlook.com (25.162.87.148) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1778;2:+bn7YI8c/Bs5+QAmUKcdRJAH6rDKHIOXJbtEFEDDz4lkTqclkEBzz/NUv4ZDhIqVjaC2fa+/rbJZhVrifJcx0qf5A8s0WQA9Fu9W5AO1M9RubW6yI7UF7T01TAjYkx6ercOek+OndAR2aND+Xi6AZg==;3:PSIf81eTN2+qfPE4X1BGjhIv/cJs50LHKHf7PyectMjBaKONQunePiHiGT//Uj79/RxRefZTthtcynjRc3m/AFqb8F4A/g3lTMQxUGR6jcXUNvlzaQ3nqHiLhXtdpVH0;25:BvZT8fQj5zR+G6Un2rurSn6Y4QQnuNOnN8nMD4sdb10ivz2TbkIVfNqer2icoz1VIVPRo6txbqbM1cQA1qJSg7WXCEePiOPU+xulYobYGrBzL+EKU8ra8L5dLduWSjwccrSl5pCoXLflevuT405uirqZN7HVCsrSgZY/gQJG19NVk6wtb2itekx1mD5kBmsX0B19C4EY+eh1dsXesUwz+CRif3nzN6In6B0Bn7RoEfA1tL5VBUvN3dhxHcj5yVST0RTRqDa1dhicsQ4MaabzK1TLzuF9nSA/xrxr3WKDK2icnp9jQyIcKmkxUUFrlGr3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1778; X-MS-Office365-Filtering-Correlation-Id: 184cf4e8-952a-493a-9cb6-08d33726cd08 X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1778;20:DVas4/W6+PnA2HEiwPlcdh4If0csM+DWEeFCh/i5ZPiS9hIGSj8ZmexgL4nlRi6GgM0BrMBq2OqJr9OitWbTMOXbvDWpoaBl2VDw3dul5255C4ce34hz+6vRpYc7DUlgaXdmuySdv2h+wtiEc4s04gMyd7rCrimlOIKpw60+EvHaBpkAOz3lft3LDZpewoWQTibRPQCp4qqLVqR5scK43t4OdiQRrVRIkOUdmvC6qEUTcWdmF1hG0AxnRtX9L7Z8ISUgG2P0XTnm9T20HgQj7LJ5PY+Pg8XP4AiAhS2eflDKDkR9K9Dn9siVGOHcYUnCdPia2/PhVOom753C6lToaAel1dam01CfX6iM0ADbJLS52LxMMJwLhqVP3V/vWhSVOCVm/grxHVOQxWLgO3FmP3fvEUnPqMnuQIyt7k7mCZMCplThHwaBNOJ0SMvb9q7T6NGzlQQDuBaFqErfjSL9Qh0smBRaw17jofMqcBwoEQ4bLfQ/8FzM8Upnhc6CW1nQcF8B/uqWI3DpvJhOieVNbBY8KY8ygLZqtFPq0NjjURALSPZhl67CRou5zwYeoxh4oX/BBI/rtlzvH2Zg46SCO3RKPSKCCi/T2IASioDpQ90= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:BLUPR0701MB1778;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1778; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1778;4:fpvWpyzRV0pC1DdA8vzYVO6kNaf/jsWr2NKdAx38ObABB3CATnGIRxcexW4CDix89sUFkwtGhbsAw1hgoR9vRF5roIRqKibgPPNgg9rNTNjC2ZR7BivPxr0onhSZhXsM9W69asiiXoshElH2dfoNMN515A3Tz9u1/kjwI03Nk9ikehe8gIqMBjjpKdDMqMvd4rg/xfXkRl2MTYfpye/F1kXl/TdpeUfIbdlRKLCh+bNRvho+Tk8hWAEPHFMl0KdEG9YOtCe3NzW866X3L+hhJjHGRqTgqovD3JOzIClq7xMSYv2x6KhP2lFlGj0ccBZ+Voi0aJopSSMkAN4lNDdaSYgY7/fzaT6kEXMVto4rAkIWwZYNMJGyRhBHvkKsBl4s X-Forefront-PRVS: 0854128AF0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(377454003)(479174004)(24454002)(189998001)(77096005)(4326007)(65956001)(87976001)(33656002)(66066001)(5001960100002)(50466002)(5004730100002)(4001350100001)(80316001)(110136002)(65806001)(54356999)(76176999)(87266999)(65816999)(122386002)(2906002)(36756003)(47776003)(50986999)(40100003)(83506001)(3846002)(6116002)(586003)(42186005)(230700001)(92566002)(1096002)(59896002)(5008740100001)(93886004)(2950100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1778;H:[10.18.104.43];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BLUPR0701MB1778;23:s9tde2SgLaNnEsZ9Djwzu5DR0VrS4dRBPmL?= =?Windows-1252?Q?qyUR1ZfOCXew0ZsC476aa20Uw/onUiOrpJHo3j4EYVEC12BPo6/iul7L?= =?Windows-1252?Q?kZ05moJJsnNpgfIx4eJZGq3PJdrQSPkTwZPZGC6bytwqZ8sEvwGHWr+p?= =?Windows-1252?Q?He26zX7zLTiNYgQM1GowVmgT6h7SS4VdiilReEbi+CNLOq+sNCN/sH66?= =?Windows-1252?Q?vw6PSVvKheNhaKpABuKZ7abkYoUa5lJfYitlr0wvjsMzR1kDOetS/7kw?= =?Windows-1252?Q?I7hF1ddBNtDxhqT8yq1ERw7C2K4M4QJqT+fQe2J5J8lvabbKBmbSWspK?= =?Windows-1252?Q?pwE/MlaFdwwcl6zp/gIKT9V5vJZZxABg+vnzDPfkGIbL10cgLIWJ4Itg?= =?Windows-1252?Q?lQG99oMblETM9RHikbytoc1dSE3ca980ExqTkmBUllkMLVB93xszg7Ay?= =?Windows-1252?Q?PBrwoFNnNKC0lESx5Vo4m7Sb7Cu6Nb05X6oK+A9lY1l9w6X1rKVurWJD?= =?Windows-1252?Q?oMnPGBE0VPNS5JHr2r88RufnxscAmAvKuRIU5SoFyqZyyCcgSf61f6Z7?= =?Windows-1252?Q?DVb9aitkaq9jl6IARNTXil0QEzN7c8lIvosbFCpunJQZBLX9PpRAfjL7?= =?Windows-1252?Q?4prGoT3DLHKxm0FS0KBPAcYiWY/MrUXNH8F2tbAJqOs+BRe0c5EpcPku?= =?Windows-1252?Q?1H045yw/lK8CXfDKGmJWHX4ZCfVepbnOTGuEGMNUaO8WQ0uA7p5jAxY7?= =?Windows-1252?Q?a1gdBqJ7ENn9ti1g7/wcjBigdNzEEgD+n4Vi6kv6h50siv5QuEyrz2Ho?= =?Windows-1252?Q?GDwWSeyML4pI5wYpLei3e11gvsvnhaVryz9qSPlN1jzBL1vofPLIY2EE?= =?Windows-1252?Q?pb9Ny4mC/ddTxMcv+087Zbi0YNdh33SsUw0IqJg+yFJwBLMrzQ7LUONl?= =?Windows-1252?Q?uagj3XO3rl9rk3iPS8n0VHfylnLplbp+MKNXSW9oHHtG9LZ7I24gVuDf?= =?Windows-1252?Q?JD6NC62Fy4TJ02gk/8vPRRT4uPImPWc43qFhCfvaVlCUZK62OAVLB+wG?= =?Windows-1252?Q?N2QHlSM0XFaZZm8dZxo36oObycpa3rtMmCjV+rUG8LrESt0gQLLkavy+?= =?Windows-1252?Q?DqJmoYvczSgw/1DY1oWCVtYc/aqjbwaVyLKs64wbOttwPYry70TKkarX?= =?Windows-1252?Q?2uOwluRJyRUivF4g2PwRS8Q0jSDJxuXw=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1778;5:5JRFURVbEs8UJ72tSuNxF6yvbFoJ45BjReWlcSENpR5SHRIctg3lVYI0VlppyGwqExhguvFD66/21sJRNB5Ap9G8Dzu88BRq6XLnpucSqJx7qhWy//XR9AtcW0VucqThYYU9R2pid0Mkrmt8cqHbUQ==;24:YNZK77m6NSrAAQcltljucJSB6eSNc+uvS0/80i5OZbvilvbl21kccQp3gk4Cqax4d+Eqxjwoq39GVLM/bPsn2+UUz2dM0S1RWNbUdeetlOA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2016 23:13:37.1456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1778 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/16/2016 01:14 PM, Robert Richter wrote: > On 16.02.16 11:50:44, Tirumalesh Chalamarla wrote: >> >> >> On 02/16/2016 11:38 AM, David Daney wrote: >>> On 02/16/2016 11:14 AM, Tirumalesh Chalamarla wrote: >>>> >>>> >>>> On 02/16/2016 06:42 AM, Robert Richter wrote: >>>>> On 15.02.16 13:30:41, Tejun Heo wrote: >>>>>> On Sun, Feb 14, 2016 at 07:36:18PM -0800, Tirumalesh Chalamarla wrote: >>>>>>> There is no need for special Driver, AHCI is sufficient for >>>>>>> ThunderX, the >>>>>>> file only contains this interrupt handler, >>>>>>> is it preferable if this interrupt handler in libahci.c with others, >>>>>>> instead >>>>>>> of separate file? >>>>>> >>>>>> Yeap, just fold it in ahci.c with surrounding #ifdef guard. >>>>> >>>>> Yes, please use #ifdef CONFIG_CAVIUM_ERRATUM_22536 ... and add a >>>>> kconfig entry for this to arch/arm64/Kconfig. >>>>> >>>> Are you sure, this is not a workaround that is based on alternative >>>> framework rather on pci device and vendor >>>> >>>> do you think CONFIG_ARCH_THUNDER a good alternative? >>> >>> No. CONFIG_ARCH_THUNDER should be removed all together. >>> >>> Grouping a bunch of unrelated features under a single config variable >>> creates a very brittle system. What are you going to do when a new >>> hardware revision is released? Create CONFIG_ARCH_THUNDER2? Which one >>> of these two would you select if building a kernel? It is a choice that >>> we don't want to force users (kernel builders) to have to waste mental >>> energy on. >>> >>> Instead, let's try to make things work out of the box without having to >>> set a bunch of random config variables. >>> >>> If a generic arm64 kernel won't get too bloated, I would suggest just >>> enabling the compilation of the code unconditionally (at least for >>> arm64). The use of the code would still be gated by the PCI version >>> probe that is part of the patch. >>> >> >> exactly, that is my initial choice with v1, and only depends on vendor and >> device id. >> >> but it seems a config is needed. how about ARCH_ARM64 then? > > CONFIG_CAVIUM_ERRATUM_22536 is exactly that you need. It is not only > used for core interrupts, e.g. also for gicv3 devices (and now also > for ahci). Non-core errata (e.g. CONFIG_CAVIUM_ERRATUM_23144) are not > enabled in the arm64 cpu errata framework (not handled in > arch/arm64/kernel/cpu_errata.c). > > Thus, > > #ifdef CONFIG_CAVIUM_ERRATUM_22536 > if (pdev->vendor == 0x177d && pdev->device == 0xa01c) > ahci_thunderx_init(&pdev->dev, hpriv); > #endif > > is the correct enablement of the workaround by device id. > > And, CAVIUM_ERRATUM_* is very easy to handle, enable and document. > The code will only run for Thunder and AHCI, becuase its PCI. > -Robert >