Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbbF0GIN (ORCPT ); Sat, 27 Jun 2015 02:08:13 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:33521 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbbF0GIG (ORCPT ); Sat, 27 Jun 2015 02:08:06 -0400 Message-ID: <558E3DBE.2020401@linaro.org> Date: Sat, 27 Jun 2015 14:07:58 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Lorenzo Pieralisi CC: Marc Zyngier , Jason Cooper , Will Deacon , Catalin Marinas , "Rafael J. Wysocki" , Thomas Gleixner , Jiang Liu , Arnd Bergmann , Tomasz Nowicki , "grant.likely@linaro.org" , Olof Johansson , Wei Huang , "linux-arm-kernel@lists.infradead.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linaro-acpi@lists.linaro.org" Subject: Re: [PATCH v2 3/9] irqchip / GIC: Add GIC version support in ACPI MADT References: <1434703572-26221-1-git-send-email-hanjun.guo@linaro.org> <1434703572-26221-4-git-send-email-hanjun.guo@linaro.org> <20150622164520.GA26129@red-moon> In-Reply-To: <20150622164520.GA26129@red-moon> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1772 Lines: 53 On 06/23/2015 12:45 AM, Lorenzo Pieralisi wrote: > On Fri, Jun 19, 2015 at 09:46:06AM +0100, Hanjun Guo wrote: > > [...] > >> + >> +static int __init >> +match_gic_redist(struct acpi_subtable_header *header, const unsigned long end) >> +{ >> + return 0; >> +} >> +static bool __init acpi_gic_redist_is_present(void) >> +{ >> + int count; >> + >> + /* scan MADT table to find if we have redistributor entries */ >> + count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR, >> + match_gic_redist, 0); >> + >> + /* has at least one GIC redistributor entry */ >> + if (count > 0) >> + return true; >> + else >> + return false; >> +} > > return count > 0; > > What about systems where the redistributor data is in the GICC subtable ? Do > you treat them as GIC V2 :) ? > > On a side note, having to define an empty function like match_gic_redist is > horrible. > > I wonder whether it is not better to refactor map_madt_entry(), create > a MADT subtable iterator out of it and make that code generic, instead > of being forced to add these useless MADT handlers just to count > entries, it is not the first I noticed. After digging into the code, it seems that we need more discussion for this comment, you suggested that refactor map_madt_entry() and create a MADT subtable iterator out of it, but we still need a handler to handle each subtable entry, right? then it will become another version of acpi_parse_entries() in drivers/acpi/table.c, and no improvement to code, did I miss something? Thanks Hanjun -- 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/