Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4079980imm; Mon, 6 Aug 2018 16:31:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfeoysGSi/lQOQRMKeVCWiKSk6pkVE6R9MrFBbWpk2uYhfqAs8x/G6D6YTpxNxmXfyrOgu5 X-Received: by 2002:a17:902:6909:: with SMTP id j9-v6mr13515580plk.196.1533598267927; Mon, 06 Aug 2018 16:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533598267; cv=none; d=google.com; s=arc-20160816; b=c3V4fCEUjc6AZBYz5ycG56hSImo32mfy+WsWVAtq4NBa5p1ORp/Nu5Rm6BticMOOt8 Ye8T10HYvSYceRwYz3hnDCun3Y4gW13g5hcTLzU9SRV8uN9KiHuWWFHdJaoNV0fhCIiH fdSr4HKe4di2NWDPLaVTKCtaOOeDR5yjymWHWZvQlKQwYSSvvPCVDvtZePlNxhPbbjfP ash5IM2xyFd2EKPcxR2hZAXwa1esS4tY08Vxg7Bkal5+ST4Clel5SOi3g48GOB1pqBu7 UYfVYmCiuXoe/T78BRPYCKEcOWUIXNQqbDiohUcJgWTrgAB5U2zYkS7nJMVlFnBStPeI rM+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=6QSii7YSnx8NPOsJMR5ybdW/HjUJ46dLVnPRZOr+9T0=; b=AM3XwLIY1qfOg+hLg+/9sZ215YxqRThPjc0czX4rLL0SjPrLeH78+umEo4zQE0SNsE axQ/qDVvS3zzFHG78irpVXjpFXk4pQUvd0UjW5d4MCPoB1JfpcgDm9KFoB+Aqueq5uAR 5k5kwONcCAXE0YxJnw4zjAl2Picsq/wUYQ894tyUuqGkBM/hpzVQOtkCsateMaRbYF3o JFbmFprB4DERSJz9RQlM6P9562m1KIp6Chlb5MESoIk8jHAlNgs4PgwQFxxXosgZad9x rqMHFnlPVTYBaP4K9Q1UTX21lJ0Vrm6kkRAeUIRXTlbtUh0LrGvoVpUc1HpdUMDvZCTx tAeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c6rmcwB0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n137-v6si7368598pfd.177.2018.08.06.16.30.52; Mon, 06 Aug 2018 16:31:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c6rmcwB0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733138AbeHGBlW (ORCPT + 99 others); Mon, 6 Aug 2018 21:41:22 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:35784 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731982AbeHGBlV (ORCPT ); Mon, 6 Aug 2018 21:41:21 -0400 Received: by mail-it0-f66.google.com with SMTP id 139-v6so13759377itf.0 for ; Mon, 06 Aug 2018 16:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6QSii7YSnx8NPOsJMR5ybdW/HjUJ46dLVnPRZOr+9T0=; b=c6rmcwB0f7fzQ1kCSjxQ+xhAqv+nu8uyasX2xk6eFrb2nbE8nyxOXSEKQUP4IplZo4 /+snH+4hTB0KkSxA+1zOW0dLWL2Y1JEwb6/Pzl/BmF/vBoiFZuFH1Aulduyi6H4sbgIZ ZexdIiPDAWnn3mOobsUjMyt6r6AhkXWZKzPfU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6QSii7YSnx8NPOsJMR5ybdW/HjUJ46dLVnPRZOr+9T0=; b=Zd4xgf7hoBEyTFgCQyN064MiuamCQILon4ye3buSDuWuPDiYiwzcKcF2Gt1kkszB9i R452gRx9cpa/wVxxsUlPDxUO/09ZfaFO28UfhEKRNPTwUxNHhfoygHn4S8L7sDul8AYF u3Jh6a+2nheBeWo4yrTHtC02+CYNfg1nvKF9l/uR99OvGJiLOMey6AIK7Gr3bo2fOWPz cSQJW2EjQTZ+Tt2sWSs/XQYjMcTCFACwYk8qBDTv1kNeZc4rE3HVnhf1BNnrMpTgUhYk v1DSjZomCkJVN+bl0k+KE9wgYvDNkavm517ILsNI6/GizbmjZJjtOIWR1YCCOd8A/a+g I/5g== X-Gm-Message-State: AOUpUlEPilK4TvjciW4JyiadJnozmXXsWhCdWxgn44A6AUeEKLsSqeRK +DyKawWIVx39nC2pC1cU5qqhmShR/S6f3TOTSvSBFA== X-Received: by 2002:a02:5916:: with SMTP id p22-v6mr3596365jab.113.1533598196155; Mon, 06 Aug 2018 16:29:56 -0700 (PDT) MIME-Version: 1.0 References: <20180718235710.18242-1-jmkrzyszt@gmail.com> <20180806222918.12644-1-jmkrzyszt@gmail.com> <20180806222918.12644-10-jmkrzyszt@gmail.com> In-Reply-To: <20180806222918.12644-10-jmkrzyszt@gmail.com> From: Linus Walleij Date: Tue, 7 Aug 2018 01:29:43 +0200 Message-ID: Subject: Re: [RFC PATCH v2 09/12] gpiolib: Identify GPIO descriptor arrays with direct mapping To: Janusz Krzysztofik Cc: Boris Brezillon , Jonathan Corbet , =?UTF-8?Q?Miqu=C3=A8l_Raynal?= , Richard Weinberger , David Woodhouse , Brian Norris , Mark Vasut , ext Tony Lindgren , Aaro Koskinen , Linux ARM , Linux-OMAP , linux-mtd@lists.infradead.org, linux-doc@vger.kernel.org, "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Janusz! On Tue, Aug 7, 2018 at 12:29 AM Janusz Krzysztofik wrote: > Certain GPIO array lookup results may map directly to GPIO pins of a > single GPIO chip in hardware order. If that condition is recognized > and handled efficiently, significant performance gain of get/set array > functions may be possible. > > While processing a request for an array of GPIO descriptors, verify if > the descriptors just collected represent consecutive pins of a single > GPIO chip. Pass that information with the array to the caller so it > can benefit from enhanced performance as soon as bitmap based get/set > array functions which can make efficient use of that are available. > > Signed-off-by: Janusz Krzysztofik (...) > This function returns a struct gpio_descs which contains an array of > -descriptors:: > +descriptors. It may also contain a valid descriptor of a single GPIO chip in > +case the array strictly matches pin hardware layout of the chip:: > > struct gpio_descs { > unsigned int ndescs; > struct gpio_desc *desc[]; > + struct gpio_chip *chip; This must be motivated: if the only purpose is to indicate to the consumer that all GPIOs are on the same chip, why not just have a bool all_on_same_chip; That you set to true if these are all on the same chip? Yours, Linus Walleij