Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1143416ybf; Fri, 28 Feb 2020 15:14:33 -0800 (PST) X-Google-Smtp-Source: APXvYqz6Pw7AvoPAyBrfSDtihQdhi3JEo7QthpIV3R529g7vAy5JZXUQGBwg+q5tn+n4OUro87qI X-Received: by 2002:aca:514e:: with SMTP id f75mr4967906oib.103.1582931673749; Fri, 28 Feb 2020 15:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582931673; cv=none; d=google.com; s=arc-20160816; b=K+dPqqCRGwzJJkcv3Si0f0ukriHJWrVLKbUqBRgBD/vkpZ1XQmQCHSf/dE7NmmQzF6 n5bnujlIc3wAu7GEU9uIqPxQrL9nn37ivYRZbmjb2wibzJDO3BtOiXJDrQjTLcW7Gz8d gDtz3B0+kLmf4C8iTjtpZLggvlh81q51wjOKRw/rISjqVfeIwBS8bXYx8Ei4qpe8IOMZ hWDnYL4YvlgbrfFCi+50NC9hJ23yvivzEA7rv5PVexQMMM19YLj06PunAEZsy2LjTmnq c5bGO3BnCsosvTKqvYEHEeLHerp0zY0Ymvyq5zTDoj1Qi7YIx/4XvyFqwd5nSS5nZIN0 JwpQ== 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; bh=RCFPQwGCfT36oBbvj50m2uhGBMYQU9mYzXWYujIs4Hg=; b=SDVeXaMDNiCcF2LvTyKzVzclB5Z/MHd1o4OGV51jryje11fD6Mfg33uiN6sBYcLuqV hwqODAGyrvDMoavLCBGHAcwst0323n+2I3/R2RfQkRP2gf3xmjxq89VIXNUMzvzpBLUF +4Tx4whvp93xLqyj3glj28nNP4Ch6tb0WraqVA1TFLjh6u4XVP7Iy5bDSU3AjldvFP+i 9xFyHmn5M+++PgGWD+u3+iIv58TLslBjkDOEzRrArbUs16D0Y+ZYens+5R+MPOSzRZO3 uSYRo5kV2X8C1XEiyC//pU3RWopeNkv3/21YyBNSSkZZiUolxG9ZYLJik/Nj6o70l+Jz qhIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kh0IHMIo; 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 b2si2628331ots.284.2020.02.28.15.14.20; Fri, 28 Feb 2020 15:14:33 -0800 (PST) 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=kh0IHMIo; 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 S1726673AbgB1XOO (ORCPT + 99 others); Fri, 28 Feb 2020 18:14:14 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40898 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbgB1XON (ORCPT ); Fri, 28 Feb 2020 18:14:13 -0500 Received: by mail-lj1-f193.google.com with SMTP id 143so5151364ljj.7 for ; Fri, 28 Feb 2020 15:14:12 -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=RCFPQwGCfT36oBbvj50m2uhGBMYQU9mYzXWYujIs4Hg=; b=kh0IHMIo5od/nculv7hDPQMJFWDqd7L2ggdxa28vc2GbDL11KjY3AP7gBaaHvdYvgU ItJO0bOTaDyfOHKp6uuqoFuFDP+l83ZahPqIzY5/M6W8PgfmRtSng2UPsbV3zPSlusy7 B2toKtW0M3bWb46BQIFEaYRuUSXStlOcIhjKByteCrDb4nRKYoAx2jYbOv5sLn3rHso7 hLP7/bXCPT5nQTRx2MH+kHumisUwTDrS0qlR11C9lg+SvO6Vrk9FD26ExX3LlTrs0sHA w2EaYNYlEJr+G4zOl/vhjPaQ0qolNI0xoE5Ur5X5P37dbUdZcQh1aMo2P0k8A/3veynn jpoQ== 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=RCFPQwGCfT36oBbvj50m2uhGBMYQU9mYzXWYujIs4Hg=; b=Btq9mnWGAyZBTYcGxE+mfHfct4DvKbJYypq4FLDTnEUSW4VDUKu2wQz2Ui331q407O yvD5ZuMU6s0p91DdgvJaioEtdCjBBAQmSwmZ3gH+xZyozbVrH2L1CYqqsdmjDp2BRSMU uHaIX5P3mWPUraeR70h/JpxHb5LwL5G6HzSZObCbSSmCc892oPpfAP1/lY+GQrxwzSW/ BDUc6Qa+uWttmremOpccwI9a00HiMOTL6tIuDmyEcrt57Tdev9QrpFW3diZ2GcpOex2x bzzjjUW3RfObfHc4SG9a8YoElFBqtDKC1U5SHxbC2TfPdkgtMh6dtdhDo2CQpMp68Slu In3w== X-Gm-Message-State: ANhLgQ2ZGDkqLX+XbgIlddwuN0VNHd2m3OTQ8rY+J+TLa9iwKbDkUl1Y wRQL+oTjn+FSaCh3WvCapthU7I5rA9vg3iDq3d/NaQ== X-Received: by 2002:a05:651c:2c7:: with SMTP id f7mr4222255ljo.125.1582931651687; Fri, 28 Feb 2020 15:14:11 -0800 (PST) MIME-Version: 1.0 References: <7ef84476a00e8771cf1edf5745c378273b760f5d.1582647809.git.Asmaa@mellanox.com> In-Reply-To: From: Linus Walleij Date: Sat, 29 Feb 2020 00:14:00 +0100 Message-ID: Subject: Re: [PATCH v2 1/1] gpio: add driver for Mellanox BlueField 2 GPIO controller To: Asmaa Mnebhi Cc: "bgolaszewski@baylibre.com" , "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 On Tue, Feb 25, 2020 at 5:42 PM Asmaa Mnebhi wrote: > I have addressed your comments and tested the code. Please note > that the YU_ARM_GPIO_LOCK is a shared resource between the 3 > gpio blocks instances. > So now that we have split up the gpio_chip into 3 instances, we need to share > that LOCK resource accordingly. I have created a global variable for that purpose. Fair enough, all looks so much nicer now :) This: + /* + * Although the arm_gpio_lock was set in the probe function, + * check again it is still enabled to be able to write to the + * ModeX registers. + */ + spin_lock(&gs->gc.bgpio_lock); + ret = mlxbf2_gpio_lock_acquire(); + if (ret < 0) { + spin_unlock(&gs->gc.bgpio_lock); + return ret; + } Is open-coded in two places, please create a helper function for this or just merge it into mlbx2_gpio_lock_acquire() since it is done all the time when that is called. > Also note, that although it is not supported in this driver at the moment, some > gpio interrupt registers will be similar to that LOCK i.e. they are shared among > the 3 gpio block instances. It's a good start like this. The robot complains about devm_ioremap_nocache which is now deleted, use devm_ioremap() simply, they are all write-through. Yours, Linus Walleij