Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdIRT6N (ORCPT ); Mon, 18 Sep 2017 15:58:13 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:35430 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdIRT6L (ORCPT ); Mon, 18 Sep 2017 15:58:11 -0400 Subject: Re: [PATCH v3 2/2] memory: ti-emif-sram: introduce relocatable suspend/resume handlers To: Russell King - ARM Linux References: <20170724212454.27574-1-d-gerlach@ti.com> <20170724212454.27574-3-d-gerlach@ti.com> <20170831140332.GD23750@n2100.armlinux.org.uk> CC: Rob Herring , Tony Lindgren , Santosh Shilimkar , , , , , Keerthy J , Johan Hovold From: Dave Gerlach Message-ID: Date: Mon, 18 Sep 2017 14:57:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170831140332.GD23750@n2100.armlinux.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.59.203] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1693 Lines: 46 Russell, On 08/31/2017 09:03 AM, Russell King - ARM Linux wrote: > On Mon, Jul 24, 2017 at 04:24:54PM -0500, Dave Gerlach wrote: >> diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c >> index 608008229c7d..46a7a6c41db7 100644 >> --- a/arch/arm/kernel/asm-offsets.c >> +++ b/arch/arm/kernel/asm-offsets.c >> @@ -28,6 +28,7 @@ >> #include >> #include >> #include >> +#include >> >> /* >> * Make sure that the compiler and target are compatible. >> @@ -183,5 +184,8 @@ int main(void) >> #ifdef CONFIG_VDSO >> DEFINE(VDSO_DATA_SIZE, sizeof(union vdso_data_store)); >> #endif >> + BLANK(); >> + ti_emif_offsets(); >> + >> return 0; >> } > > This doesn't make me happy - I've been thinking about this for some time, > and I think it's completely wrong for drivers to hook into asm-offsets. > > Looking at the top-level Kbuild file, it looks like it would be easy > for emif to auto-generate its own offsets.h header - it looks like it's > a matter of using linux/kbuild.h to get the definitions, compiling to > assembly (using $(call if_changed_dep,cc_s_c)) and then converting the > assembly to the header file format ( using > $(call filechk,offsets,__ASM_OFFSETS_H__), replacing __ASM_OFFSETS_H__ > with a more appropriate symbol.) > > Could you please check whether this is possible, so we don't end up > needing to hook lots of driver-specific assembly offsets stuff into > the arch files? > I was able to try this out and was successful, I will send an updated version that generates a local emif-asm-offsets.h. Thanks for the suggestion. Regards, Dave