Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp998588ybk; Wed, 20 May 2020 18:12:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjEy1p97fi7NqE8GV52ISR/EoEJAgOkusRjlCUlalme2JrMEGFDH9PY7LNB1kpdBWS/iTS X-Received: by 2002:a17:907:6f7:: with SMTP id yh23mr1428132ejb.517.1590023563286; Wed, 20 May 2020 18:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590023563; cv=none; d=google.com; s=arc-20160816; b=ruJk6VraOWHcjD2ktFrslVEdCaIiadHuCXe/Fwv38I5U+3CwruAEuhc1QAtqH5wbi0 A7HofEzNY2fbZSMFdggzWyBsVFP4tafX96JIx/8rCjoCRsnlmppVqUnmvNGRwZ2qARbs SgwXlx53pcZFKxeGxMKKfjFIL/jv2GgGz8A1e/H6qwd3F/N8loWQVZDWBwT/eCEBrZ4p 4ohDXuBYPNxAwmk5G2CTxxdbZVGAii7MNDM2moUJsNqvsN5dnkkIalRmJ6UzxEsgsmSK JEvcHgun1CM1NzSbStM8h4zUGsS4OjYf07ER76A/EcZ8AVh5DGShJwoycKON7jibeZXm D6Bg== 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=uZ66C6YC6AB6BWsi5/n0Je4iQWMmi9GR4QVJ8dDpORA=; b=P/D7OjOkf6ctPAHlQ++hfRapctGwW74tfbe0R0kQZXCYTirV+EAhBMVIy8C33/PwMn uOzJlnpwNiguz48Y/0IKzD48rjObojPU8lLjDeWZzOXGwzTbnCjF92Pc+UERICEA0K/S eFQyc2yames4GXzc7CkJNubxWd4Ryv8t9K64CfyzK9FJqaoHyWw5/YMiV5cotnnT7Soy rd+cyfV2Maf7cgqHF2dCPsLiRM9fc0oK1TEBJLkF/dvcd3Bbbmx4/bK8JekiJ+NieYU/ 1yPXvBvE298PaemzmlKO0EgGZdKZ2XTjFVUJ2PSHve5Eg+IbEkyEL+M0C2nyJD/e0k1V mg4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="DGQg/1fS"; 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 f19si2379599eje.519.2020.05.20.18.12.20; Wed, 20 May 2020 18:12:43 -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="DGQg/1fS"; 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 S1727068AbgEUBIu (ORCPT + 99 others); Wed, 20 May 2020 21:08:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbgEUBIu (ORCPT ); Wed, 20 May 2020 21:08:50 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C621BC061A0E for ; Wed, 20 May 2020 18:08:49 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id z18so6139132lji.12 for ; Wed, 20 May 2020 18:08:49 -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=uZ66C6YC6AB6BWsi5/n0Je4iQWMmi9GR4QVJ8dDpORA=; b=DGQg/1fSkhcfou1t+eGlXoSBIGSPP4X2yBvMqO8XYYfzhmdXJbxc1HqPK8sNTcj3yS fqtrojpPj3E7x/xcOMwbhkanZqE5LZuZy5FsJzWe1Ita+cpd14N7L92eITkYnR7A06WN Dq8Kkltan7iFT63Z51Qx3BI2MJNfv4v5lE3LXzq9rLrwZOnCsVBTtEsLASiKEW0CZzPr OAgj4e2nW35eOAAgWOfA1lIyi5Eu6ZnSbBYqroTlTuaHwqw6OXZppuOosnYA1MZ+yiI3 5RxkecHPd/YDqxiDYIAlQI2v1NllUpO50ZtMNmxWZoRvgxXQrlzA79LUxQKpZG+NcJY6 OvFA== 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=uZ66C6YC6AB6BWsi5/n0Je4iQWMmi9GR4QVJ8dDpORA=; b=uNSaeIPeIJeF3zRna6+aFQ9bpQansNdQRNqhhce/Kqv8w4wdN/We/Nu+hh0aFfujHR 03izAOMk4EOypt+Z2N5pqQz7UoqNnH7dsT+g+wgFkInkYA7r34HzahqjQ8/CYcygsM7P uCQQekCOMeh9rlhJiH8v+l029O0sMUs7HW0NSHXkh4p/72tMYPdZ6g6BtWrgvBQ8bs7o 5Ilh2cqMvQ1PFniE0/tVGD7lvBB2xPZ4/z4dInw/vr953SK4dqSVPg7/3UHr7dVTWVjp uwKjTXDKG6a5NosuFmRrSfenijhxNYPHwQ9zVa4wJ9XjkwYnxn+PmfzEDIFn2A7na5C2 vt0Q== X-Gm-Message-State: AOAM5323IB4hPc9fLK9Fg4WAu6z9EjczzYvJw1TDoj2YW5p5mIs1UT9I q/3XObGIdIA64S31l4YXal2UJQNDzSPnpoo1CoQ= X-Received: by 2002:a2e:7610:: with SMTP id r16mr3871473ljc.88.1590023327675; Wed, 20 May 2020 18:08:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Orson Zhai Date: Thu, 21 May 2020 09:08:35 +0800 Message-ID: Subject: Re: [PATCH v4 1/2] mfd: syscon: Support physical regmap bus To: Arnd Bergmann Cc: Baolin Wang , Lee Jones , Mark Brown , Lyra Zhang , "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, May 19, 2020 at 9:19 PM Arnd Bergmann wrote: > > On Sat, May 16, 2020 at 12:13 PM Baolin Wang wrote: > > > > Some platforms such as Spreadtrum platform, define a special method to > > update bits of the registers instead of reading and writing, which means > > we should use a physical regmap bus to define the reg_update_bits() > > operation instead of the MMIO regmap bus. > > > > Thus add a a __weak function for the syscon driver to allow to register > > a physical regmap bus to support this new requirement. > > > > }; > > > > +struct regmap * __weak syscon_regmap_init(struct device_node *np, > > + void __iomem *base, > > + struct regmap_config *syscon_config) > > +{ > > + return regmap_init_mmio(NULL, base, syscon_config); > > +} > > + > > Sorry, I don't think the __weak function is going to help here. I'm not > sure whether it actually does what you want when both syscon and > sprd_syscon are loadable modules (I would guess not), but it clearly > won't work when syscon is built-in and sprd_syscon is a module, and > even if the module loader knows how to resolve __weak symbols, I happened to see module.c last week. It seems there's some code to handle weak symbols by checking about STB_WEAK. But it is not in this case. When syscon.c is built-in and sprd_syscon is module, this would not work because the __weak one has been built into kernel already. Maybe live patch feature may work it out. But it seems over expensive to do things like this. > I would not want to rely on module load ordering to make it behave > the right way. Agree. All other sprd modules would must be loaded behind sprd_syscon and this will not be handled by modprobe. Thanks to pointing out this. Best, Orson > > Arnd