From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AD77C433DB for ; Thu, 7 Jan 2021 10:48:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C17CD23142 for ; Thu, 7 Jan 2021 10:48:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbhAGKsd (ORCPT ); Thu, 7 Jan 2021 05:48:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727747AbhAGKsd (ORCPT ); Thu, 7 Jan 2021 05:48:33 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 696B4C0612F8 for ; Thu, 7 Jan 2021 02:47:52 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id x20so13435541lfe.12 for ; Thu, 07 Jan 2021 02:47:52 -0800 (PST) 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=+7XwE28X4fXF/VAPlQ9ICdN19xfQZPvJYAHkAqrSpbM=; b=lZSeQmpL44ia1pxaaf6q3laKKhGvowIDIG9HkRAHBV3ZDOLeR0Gi8uWdFgBgtPIZ1p uxWYCdLflXcDvDTswe+DBBMCG4hyuFqJpuumDkr7gZjHa9ZSu+K9UjSk7yAvAVdIS97G PwMrvlNExOFvHkohUeVLEcIdAP+UxOh85kmbJRDfw1wWj3tZb+gmHFC4V1Jbscq4Kmxh Fy25hhIwyGM/8uHOoakNj9j1TkBJ47wOEjrWf4oiI10woEUyyNHDAKTU7j+skCLlbBDJ U3j8T70ktJamS+D9xt+2MAcMsljHvCkAALeQ2zHv/fdXw0pC9iHgjoHv8vqF60fhkkI7 eaMw== 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=+7XwE28X4fXF/VAPlQ9ICdN19xfQZPvJYAHkAqrSpbM=; b=Q/qyYx+X7qRvTs4w05owm37PnlFUvQvoVl67iaEZbTFeFNbOKVv90hEvgFcdJIApiR yeLzYQJ8e2gDZA7VNKzPH/5Xrs6NzwvZVmNRxT0HiG+uTjYOrTtnVo1PTNOgsKu8Omzl Uf1ZDvbb0qiMo+0lHgfHAFHpPYd/rxGS/RKNzDsLC1emhMzeClTRm/tX+0+tk3tNo01p fu/AFaZXs5ZikjYHFWO43eSHQR+aZ0xzFeKtgqeAJA2lBK++LdExOqwrUSaXwGmVdag4 iKcl4PANFDy1nf1ffQRta4PiarsI6925GGMfsIYde+E8/N9V2la01HvNoAZiaovZxDVU +qwQ== X-Gm-Message-State: AOAM533CRztsA44OCPyOi8DUviu7Eosi//mEwySIzxd1/HbIREuzRO50 qoNQmwAw/NaqMovvOwH1yitGr3yvvZrcsoA1BO4WrYnHXrc= X-Google-Smtp-Source: ABdhPJxUieCSbIeBaJQUgG3zhIyqXLFGB/W2a2xGjPAXZm0gHVgK+7oNhmF9Hh2mmwfC7T2of+obTb8MJqj7NhsyZWc= X-Received: by 2002:a2e:b047:: with SMTP id d7mr3689418ljl.467.1610016470964; Thu, 07 Jan 2021 02:47:50 -0800 (PST) MIME-Version: 1.0 References: <1609936000-28378-1-git-send-email-srinivas.neeli@xilinx.com> <1609936000-28378-6-git-send-email-srinivas.neeli@xilinx.com> <11abb0f7-407a-3509-ad50-cc7698147ee5@xilinx.com> In-Reply-To: <11abb0f7-407a-3509-ad50-cc7698147ee5@xilinx.com> From: Linus Walleij Date: Thu, 7 Jan 2021 11:47:40 +0100 Message-ID: Subject: Re: [PATCH V4 5/5] gpio: gpio-xilinx: Add check if width exceeds 32 To: Michal Simek Cc: Srinivas Neeli , Bartosz Golaszewski , Shubhrajyoti Datta , sgoud@xilinx.com, Robert Hancock , William Breathitt Gray , Syed Nayyar Waris , "open list:GPIO SUBSYSTEM" , Linux ARM , "linux-kernel@vger.kernel.org" , git@xilinx.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Thu, Jan 7, 2021 at 11:29 AM Michal Simek wrote: > On 07. 01. 21 11:17, Linus Walleij wrote: > > On Wed, Jan 6, 2021 at 1:27 PM Srinivas Neeli wrote: > >> @@ -591,6 +591,9 @@ static int xgpio_probe(struct platform_device *pdev) > >> if (of_property_read_u32(np, "xlnx,gpio-width", &chip->gpio_width[0])) > >> chip->gpio_width[0] = 32; > > > > This xlnx,gpio-width seems very much like the standard ngpios property > > from Documentation/devicetree/bindings/gpio/gpio.txt > > but I guess not much to do about that now. :/ > > > > Do you think you can add support for both? > > support for both is definitely possible but we need to handle also gpio > width for second channel referenced by xlnx,gpio2-widht now. > > It means we could end up in situation which can be misleading for users > where ngpios will be 10 and xlnx,gpio2-width another 10 and in total we > have 20 gpios. OK that is confusing. Let's not do that then. > I think that it is better not to start to mess with ngpios property not > to confuse people which are coming from other SOCs because ngpios can > suggest all gpios assigned to this controller. OK I agree. > >> + if (chip->gpio_width[0] > 32) > >> + return -EINVAL; > > > > This looks OK. > > Does it mean ack for this patch? Yeah after explanations this patch is fine: Acked-by: Linus Walleij It's just that this hardware with paired controllers is a bit weird so it will lead to discussions all the time because it's hard to understand. Yours, Linus Walleij From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C2CDC433DB for ; Thu, 7 Jan 2021 10:49:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2E002312F for ; Thu, 7 Jan 2021 10:49:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E002312F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TXU91pum1xInoCdG/Yj3eWgho9RIFxRiT9IYeXt81Ow=; b=Yp9c2tX8YVNDUxTe7jL94HfE6 xr/skmaFGEK6ete+69JuQOkzkE1YN4qNHK4P5vxaLeo+V0FhXHQbsS5sebKbzAVu3xiqDbMuWLtqJ FpMYe1dPkEIKiQZJ0bzX7rpGkGSQRDteEcBpQvzObd1zt14M6dKgZwxHJUKCodcGdhrS8BSdwaPxu Rap5QC0U3oJjgVP+tle+EIeLCflacgvGjQxm8fv67bQl/DZbIJb0lsCWYb8T8qkdwTx0p6uddYk8u sMBJ9rNdAWsog0ElrnNNsOlq0rO4grmwj7pldISKgH1owAYzCzYWVtwrM1sxVDgHiiI8FZId6HidS WnfOfh20A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxSpf-0005AZ-Ix; Thu, 07 Jan 2021 10:47:55 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxSpc-00059t-MO for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2021 10:47:53 +0000 Received: by mail-lf1-x136.google.com with SMTP id o17so13561045lfg.4 for ; Thu, 07 Jan 2021 02:47:52 -0800 (PST) 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=+7XwE28X4fXF/VAPlQ9ICdN19xfQZPvJYAHkAqrSpbM=; b=lZSeQmpL44ia1pxaaf6q3laKKhGvowIDIG9HkRAHBV3ZDOLeR0Gi8uWdFgBgtPIZ1p uxWYCdLflXcDvDTswe+DBBMCG4hyuFqJpuumDkr7gZjHa9ZSu+K9UjSk7yAvAVdIS97G PwMrvlNExOFvHkohUeVLEcIdAP+UxOh85kmbJRDfw1wWj3tZb+gmHFC4V1Jbscq4Kmxh Fy25hhIwyGM/8uHOoakNj9j1TkBJ47wOEjrWf4oiI10woEUyyNHDAKTU7j+skCLlbBDJ U3j8T70ktJamS+D9xt+2MAcMsljHvCkAALeQ2zHv/fdXw0pC9iHgjoHv8vqF60fhkkI7 eaMw== 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=+7XwE28X4fXF/VAPlQ9ICdN19xfQZPvJYAHkAqrSpbM=; b=fF4hYqkE6Zu5xWiv/rJ7Zdtlf1ezQDqzaodBJ4WN8wkL/Fxn2eRc/jRZB2KoliCi2J DdpbDmHzmAeBB5VinqQu0eSeC0zFh7uQNo3JIHYh7kjlxnhtUer+Y8Lu/C3R8RrqtmjQ pSKqOVgg61IhYOqOHnqnrEUypmUIv0IccQsePsUKiLg90lQ8j2BcL+Me94fGAyw4yuCs oI2Oywo8t3w/oyM/58s8E89Hfw7nAxUCrWqLDJPJ7YyWM7v0rb5O31S06uA+gZwN8pKt Qbm/9CicYzY8c4NgDP8dgWJIg/gYPiMs69VUVUUdFFJHPH755tUZ44jq/R2W9oGZD0K3 XjSg== X-Gm-Message-State: AOAM533kXk0/MOFfUb8J+6YqZDwAqU+qSG3DQME7I0v0S7Gr9D4LNik+ XKJOzmfkY8yaz6anTWGjVCEeDAQwEjYegahURexUTQ== X-Google-Smtp-Source: ABdhPJxUieCSbIeBaJQUgG3zhIyqXLFGB/W2a2xGjPAXZm0gHVgK+7oNhmF9Hh2mmwfC7T2of+obTb8MJqj7NhsyZWc= X-Received: by 2002:a2e:b047:: with SMTP id d7mr3689418ljl.467.1610016470964; Thu, 07 Jan 2021 02:47:50 -0800 (PST) MIME-Version: 1.0 References: <1609936000-28378-1-git-send-email-srinivas.neeli@xilinx.com> <1609936000-28378-6-git-send-email-srinivas.neeli@xilinx.com> <11abb0f7-407a-3509-ad50-cc7698147ee5@xilinx.com> In-Reply-To: <11abb0f7-407a-3509-ad50-cc7698147ee5@xilinx.com> From: Linus Walleij Date: Thu, 7 Jan 2021 11:47:40 +0100 Message-ID: Subject: Re: [PATCH V4 5/5] gpio: gpio-xilinx: Add check if width exceeds 32 To: Michal Simek X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_054752_764759_A27CD59F X-CRM114-Status: GOOD ( 20.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Srinivas Neeli , "open list:GPIO SUBSYSTEM" , sgoud@xilinx.com, Shubhrajyoti Datta , William Breathitt Gray , "linux-kernel@vger.kernel.org" , Robert Hancock , Bartosz Golaszewski , git@xilinx.com, Syed Nayyar Waris , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 7, 2021 at 11:29 AM Michal Simek wrote: > On 07. 01. 21 11:17, Linus Walleij wrote: > > On Wed, Jan 6, 2021 at 1:27 PM Srinivas Neeli wrote: > >> @@ -591,6 +591,9 @@ static int xgpio_probe(struct platform_device *pdev) > >> if (of_property_read_u32(np, "xlnx,gpio-width", &chip->gpio_width[0])) > >> chip->gpio_width[0] = 32; > > > > This xlnx,gpio-width seems very much like the standard ngpios property > > from Documentation/devicetree/bindings/gpio/gpio.txt > > but I guess not much to do about that now. :/ > > > > Do you think you can add support for both? > > support for both is definitely possible but we need to handle also gpio > width for second channel referenced by xlnx,gpio2-widht now. > > It means we could end up in situation which can be misleading for users > where ngpios will be 10 and xlnx,gpio2-width another 10 and in total we > have 20 gpios. OK that is confusing. Let's not do that then. > I think that it is better not to start to mess with ngpios property not > to confuse people which are coming from other SOCs because ngpios can > suggest all gpios assigned to this controller. OK I agree. > >> + if (chip->gpio_width[0] > 32) > >> + return -EINVAL; > > > > This looks OK. > > Does it mean ack for this patch? Yeah after explanations this patch is fine: Acked-by: Linus Walleij It's just that this hardware with paired controllers is a bit weird so it will lead to discussions all the time because it's hard to understand. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel