Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1615954pxj; Sat, 12 Jun 2021 14:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4OlJSFUoIMmtMSjKZx/1tqgxtpHA4zH6YHtG69uUkBVOKf8G5Q5CnuV5yfPJwHos7Lszd X-Received: by 2002:aa7:ca1a:: with SMTP id y26mr9952434eds.314.1623533490795; Sat, 12 Jun 2021 14:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623533490; cv=none; d=google.com; s=arc-20160816; b=H3B9joft+6zZeSwEoViHnCZiN4ikXOw65sumyUkuEa4BHthPETU9ufQnibe41AuOkU 308qwKvsiNgRpEGAn5EvvJqIM5hwutX1Vrc/Gf03M27MNwZjf3yuETieTNX8uoLcrpqT OQRKj3V2LI0I7+tsjAv/0lBn9Jtc2T0nWy8o0iobZXBaYg2F2uyM1oVAVqHow+W7GIWG ODKUNx915+/9lCPqE5xJ2TK6pS8eSO0inJc9DmIxC/6ucT98g63Ps/sQs/UIExfssYPR 5bEnnIqLTshlH6xIVMJzY9iZO82e1tVuOg7Qzg8NU99wEbYX37WtQqRTSd031Jt92Q47 ydmA== 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=c9ib10t36R/EO1N7Re3lDE2MnwjGOz25v+dbyCiOWAI=; b=v3qQuJcmjmgwiQl+xsKCWlRNKb6lJBxv8khbkuvTAvykASu/rQ4IKjBTzeyW/YreuR 87t9u7TiMdE+hHK5eah7nhratcddEcM0vjQVFmHWHl2djogQuTSDq/8axMGQ42pXip32 aYCLjEQQmYDKFgwjDmUW0hU2QR5nIa52f0Yxij25thwzebG+N7s34bY0VVmZPEeHbbSg shd2xOAXsR/vJ+W65zVaEHgdy+X4H5wRgXLpPoknMJgvim0u0S+2vbgjGDZGsPsGLj/L lX5HJP5aDNg+uo80gMUdOg33dYLaMhT30R9Hvv//hgPzWtlQRQ2cw31ZUDWZa9wu/Pz+ +00w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Pvds2+eV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os28si9579758ejb.695.2021.06.12.14.30.58; Sat, 12 Jun 2021 14:31:30 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=Pvds2+eV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbhFLV0U (ORCPT + 99 others); Sat, 12 Jun 2021 17:26:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbhFLV0P (ORCPT ); Sat, 12 Jun 2021 17:26:15 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0992C061574; Sat, 12 Jun 2021 14:24:14 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id x73so7430236pfc.8; Sat, 12 Jun 2021 14:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c9ib10t36R/EO1N7Re3lDE2MnwjGOz25v+dbyCiOWAI=; b=Pvds2+eVgeiCLXPwrEsoZdchsy3q/vkm/NRXLwkg7m0x614cSDxMJciWOV4UtST6h8 9MS22TsxqWEgaHyX+Ob8arEFgfYJtMPl1JxdVxRfCPat2L5s0Wu6TV+wxWWhsnKKbUlp pDWxFg+Wzctv3BnfZKg4Y1IqLu1v4a3ENihzDttnwu2gIOf/GUHF0IzatZCApFNzTa6H SrQj3T5S37II5dvpzFdpw+Nw2PjD2ekHBL05EBOP4GqZB0/bEV64LCClPiEsVUXCZ4m8 a7rhGlU39VN3imPD0NwRVpcWngajhYJHdQMbTb/NilzZE7gy8IfJF35XtEhw96w3Znlv iy4g== 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=c9ib10t36R/EO1N7Re3lDE2MnwjGOz25v+dbyCiOWAI=; b=E+M9LKdNJGE8Y0IZLikXC4vKTgL61RRjYvRa7eZ+SoQzbD77acUrSzv9/rVWJCwsmk 7rOoWWtAk/oFHH39plyDPmQN2K45kZXpeSiXRQnYJkdHFKJMWQTy0l4qB5N0tBPcHSjt BUm1LGfgtYmD1QwBCfh9BrGRmnLBJudtr2d16KxKZfjhMGhVgimSvyycDH7raprd9RJ2 12z3um0fLaVy1fraCYxu32H1HwH0RxIqWtHmAmhQoUmVLlQuv034eyhmxOCcuDSa/x3O bBfEh9g3+fO2IE4DZD8zxMHXPJOjADv5aloH+BgZU6FDLXR89S6a03hB5swLHqgMbxO+ gjgA== X-Gm-Message-State: AOAM530WnUHGIIScvIwfOkBJ3aYdpWDopV9dcSV/bgGthzh5ZBa5QuwT uJiUrkOOB4umhniJVRK8D1xLxXlGkHKfNJYjRgs= X-Received: by 2002:a05:6a00:139c:b029:2f7:102c:5393 with SMTP id t28-20020a056a00139cb02902f7102c5393mr7900451pfg.40.1623533050891; Sat, 12 Jun 2021 14:24:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Shevchenko Date: Sun, 13 Jun 2021 00:23:54 +0300 Message-ID: Subject: Re: [PATCH v5 1/8] regmap: Support atomic forced uncached reads To: Sander Vanheule Cc: Pavel Machek , Rob Herring , Lee Jones , Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Michael Walle , Linus Walleij , Bartosz Golaszewski , Linux LED Subsystem , devicetree , "open list:GPIO SUBSYSTEM" , Andrew Lunn , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 13, 2021 at 12:13 AM Sander Vanheule wrote: > > When a user wants to read a single uncached register, cache bypassing > can be enabled. However, this is not atomic unless an external lock is > used for the regmap. When using regcache_cache_bypass, the original > bypass state also cannot be restored. > > Add support to atomically read a single uncached value, bypassing any > regmap cache. > +int regmap_read_bypassed(struct regmap *map, unsigned int reg, unsigned int *val) If this is acceptable in general, I will rather name the function like regmap_nocache_read() to be aligned with the other API naming pattern (see below). > int regmap_raw_write_async(struct regmap *map, unsigned int reg, > const void *val, size_t val_len); > int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val); > +int regmap_read_bypassed(struct regmap *map, unsigned int reg, unsigned int *val); > int regmap_raw_read(struct regmap *map, unsigned int reg, > void *val, size_t val_len); > int regmap_noinc_read(struct regmap *map, unsigned int reg, -- With Best Regards, Andy Shevchenko