Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4033630pxb; Tue, 10 Nov 2020 06:26:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/HM4grpt6qXee9JhDfSCY4uW177TnrMv7OYugvz9k6baVlfon2tEPKW3VCa98XhbIrbqD X-Received: by 2002:a17:906:f98d:: with SMTP id li13mr20046529ejb.307.1605018415777; Tue, 10 Nov 2020 06:26:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605018415; cv=none; d=google.com; s=arc-20160816; b=VdGPoK58XXdsknt3lGC0bQXc1FTQq4uMTLUhqn6BH16oE8eqmffFyR8nN3dVyFgCfv otnzFh8b22bXsrCCifWoKlk1G708r45k5GolSLxwrjslZlWJ+SXzMqJt8wqdRxjGKDM8 DoZF7onF0OVGfjG4flJtE1sbppvrlsCtKcIPfleaMEk6buB8tFnNawNLkbYnFzYHRYfs CJaw8isgp3SmWNeYRuO5Y7FgBqsIJqrr7SR7nPq+VCjpHl+R3TbTiHjxMcE6aKOKFznA eny/O7XI2Li7qcXdt2F2cY+mfPghfc/Ok197YpFuNCKsgt1y9pqHvcSTU3Petq8fhnC6 GmJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=u6GB7ypk83KMaLnug0kEhxxuhg0irI7q+WnuAwKUDz4=; b=RzHvsTtay0pHLMafXJZFSS4jnGB1O8NFa7bxy5maCLDeW2G2vtKK2CyFlgetIIwFdn AwDDwtbNEdp+LjUi53crxx/O/DLX3uzI6ciJfQIpmKJKXy3jUFXx4W7OobALK2EzO3BN FRcBf9iEHj0ouRM4eYBdfv4K9ovj9s2v7lfdoqlpHIpSylOgMdB9mAmq1dSPtoWlqIbN jw8U0KI8HLPBXi8MK6RTqWTJgIRtUUTlo7WhH6LPzsMwGvi12NC78eBKoP90x4Ehvo5H ZEpopuv9ed+TvyERc4mr0yV6ffEhhIDouv/CVG0w3PZQUN/e7Hu3xKqVel9qzqj2a/jD W73g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=z6lVbF7h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si9134682ejx.103.2020.11.10.06.26.31; Tue, 10 Nov 2020 06:26:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=z6lVbF7h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730994AbgKJOYR (ORCPT + 99 others); Tue, 10 Nov 2020 09:24:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730059AbgKJOYQ (ORCPT ); Tue, 10 Nov 2020 09:24:16 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F992C0613D3 for ; Tue, 10 Nov 2020 06:24:14 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id dk16so17779967ejb.12 for ; Tue, 10 Nov 2020 06:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u6GB7ypk83KMaLnug0kEhxxuhg0irI7q+WnuAwKUDz4=; b=z6lVbF7hbH9X2l93H3Ds7VcmaP1i40C685zORXYPM+UvzOmOd/uv5rOpNySsFWY6Td M5RNFY9fjeUW+oluZfzRSnHIfxf8Y6/fDjzy3WOQnEfBXb/jSjh1R8iAc3vl4zkQSgY1 Np5QndhNUKpNZKb3obtpsedD0LLbao0Fx+EY9IJc8UW52Tuotb4cnULPkeOoSlzjnp2k BX6TiJ+1CXf1fLpG4IYBgdyqso1xQ8i7viqm8NY1XtfL2ot1tMjNF3YFXMxlJoKQXYxU u+wFNOMyQIOvB2t/n9Knfs8akKf3F0iLwR+gbffDnSC2UN6PUEpFCS499P98tuSciXHw zFoA== 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=u6GB7ypk83KMaLnug0kEhxxuhg0irI7q+WnuAwKUDz4=; b=WBlj5SQEejxzepHA6cbcIgzn4jUi5D2QUk7MrsDKVHWrD9/RUtRVZyN5YbbZG0ngqK nfm296NH6z5TDTRfP90sM7eXzCQ9Cl64rDuhJKSlf5WsUbaEPgg/FIoL/OJB/tZP3R1D PUUNcuRF6+MZdkJdOwKxo6VBCiNLOmM2vjqH+cySPc8fT1KTFRYWyHlkytNbvkSwzwDl 1oON9OYa0SE9SI1eKAR0rf60VMswkfTACGYpDXmkxpljy4Dj3UUUR4h4Zx390Juqz5or AN6OSZKcyL7iTP/NN2w0/PXt48I4hDv4tlxEcDiu8+s/RdFhcpOq4+Qy6mznGnXtQ1k7 3ZHA== X-Gm-Message-State: AOAM53023K2cambR7ozH7amEikXSKxYqsDfVBVV3qBHmMvE5YPaHB47B JZ6tcRabH/1X4I6zSuqyjtJHbWFT9gHoGSlIBx/exQ== X-Received: by 2002:a17:906:1c84:: with SMTP id g4mr21453325ejh.155.1605018252919; Tue, 10 Nov 2020 06:24:12 -0800 (PST) MIME-Version: 1.0 References: <20201110123406.3261-1-brgl@bgdev.pl> <20201110123406.3261-7-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Tue, 10 Nov 2020 15:24:02 +0100 Message-ID: Subject: Re: [PATCH v3 6/7] gpio: exar: switch to using regmap To: Andy Shevchenko Cc: Bartosz Golaszewski , Linus Walleij , Andy Shevchenko , Jan Kiszka , David Laight , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 3:11 PM Andy Shevchenko wrote: > > On Tue, Nov 10, 2020 at 2:35 PM Bartosz Golaszewski wrote: > > ... > > > struct exar_gpio_chip { > > struct gpio_chip gpio_chip; > > - struct mutex lock; > > > + struct regmap *regs; > > Leaving the same name is a call for potential troubles. > > > int index; > > - void __iomem *regs; > > char name[20]; > > unsigned int first_pin; > > }; > > ... > > > +static const struct regmap_config exar_regmap_config = { > > + .name = "exar-gpio", > > + .reg_bits = 8, > > + .val_bits = 8, > > +}; > > Looking at the crash, are you sure this is a comprehensive description? > Maybe it requires something like stride or so? > This is what I'm looking at ATM. Looking at the datasheet[1], there are no breaks in the registers so the default stride of 1 should be fine as is the value bits width of 8. I think that I got the address width wrong though. Should be 16 bits probably. Jan: could you change reg_bits to 16 and try again? Bartosz [1] https://www.maxlinear.com/ds/xr17v352.pdf