Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp313084pxb; Fri, 3 Sep 2021 02:43:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqbkdh/pZPvRfV3kcQQHfJdqiqr3TTHudTXE37oxeu65/i4nHy9tHZTIPpuAFKOMLpFam9 X-Received: by 2002:a17:907:7f29:: with SMTP id qf41mr3102516ejc.211.1630662184692; Fri, 03 Sep 2021 02:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630662184; cv=none; d=google.com; s=arc-20160816; b=hx35WW96gI4RsulZ4Qt/tHGR+IJ4OeAOEJqA44D9ClgjKej5klSwiOJNLkNQpAJxr/ 7lSTveaAeCQ2EzhEBmJuIE0kdphVqqmhgszQyAGOUDfg/HOHbte6xKujjQXRTFMqYrhW yQ6jO1/NKlRMqkz3k2tz5a3ynKfbFCVS/qPcom6zCQlEhe73Cd+6s+lRcSkKyKG2EGTB 9crYU9VsBs8vkePV8fPn3U7ywhKHp0Rh4nXRXkj1rQ1n07vnwG4kOAcVVW7FNYgS2Qrl gS0NImHBPhY+V2run7ICcXYedHbzuQGMcXkp5YhR9h/JedrEmaDfqlKnIdotH2yPSsbn voig== 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=oVRR6yLxrUrJRA6yVOkPhGLutDZ6djkYgNKCcl1CTEk=; b=xx8+UYAZg/0JuTjevjWDBwkPd/Wbahi+IOB1qrqTGnaAq7Xtvy2n0a+X/vgKozMuJd z5bLBefPg4zOzibNljsr7lFJ7mz5fI0+Znbs5UNb1ukeaIRUi+2swp8palxIyECZZDYw 2YnwHwVCTAuSW/rVs4oyvJLcXw7YQ8EzFTks7y5sypHdtlfoqm2fWp8eQfDGOvTyAsIj TY+dWMqMSyAdQ8zjDzUTSC0IoI9pYMHcnVUky+WZcL2+mfA4pP7bj9ZrdNYXaBidw1MS T7AiNZ6zO3+7wgQ4fO/rhCqBZAjvFJy5U42m1B8JJdCBQAPCUvPiY2vpZdvc94Ck0CtS iZEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RYZw9S6z; 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 e2si4287532ejs.346.2021.09.03.02.42.39; Fri, 03 Sep 2021 02:43:04 -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=20210112 header.b=RYZw9S6z; 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 S1348903AbhICJl5 (ORCPT + 99 others); Fri, 3 Sep 2021 05:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244602AbhICJlv (ORCPT ); Fri, 3 Sep 2021 05:41:51 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB13C061575; Fri, 3 Sep 2021 02:40:51 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id c8-20020a7bc008000000b002e6e462e95fso3355732wmb.2; Fri, 03 Sep 2021 02:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oVRR6yLxrUrJRA6yVOkPhGLutDZ6djkYgNKCcl1CTEk=; b=RYZw9S6z8xsWRI2MZbcwvD2T8FhHCjffWUIfmwfEPR7zfycGVKUxdyKP9fhMW4Uq4J BbnYgjd/N2RxF2POyuzcUm0vaikpN7ZlM5SLnKii/DBcr7iK/xtHvlrP88xiCNwF0h3B IeKe/meddkFLh5RZse8CQmzXI4mb8w6Ew8gs9mOTGCIJPlwyV/0NeyMHPZI11lJDTtqV 51aKcNkR/OThTnQbI6mwunEhISUgMB2AXCdIQlBIixN+Guc3BLqaZwZDGzWCec3+5KA4 qTENu5Se5nFf5HnhKTLzyU7Ewml2wz+OaJ3s4oJo/Xg/kK/IMsgh2SBZVjm8sAQMgkwr QnPw== 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=oVRR6yLxrUrJRA6yVOkPhGLutDZ6djkYgNKCcl1CTEk=; b=mLkSRpW6zxYbW2rIdRUCS/BDODuAShAXHVCP0yzJP3zMK06IJgwqTvb5zAXjNQVWqV u5p+838KZAr893OYDHntsd4y7VeSgoGEpspS7q4qGuS/Aa4DZX21UQ/KTgV1HV3DUkja +ha2WxdW81efUYMHRM6Y2uj0Tydr2iBJ/RzFe9uCyq2VJzPltIQ93A4YuuN7uDe7kG9d Hb9FSuRHB1BqmcMThH25wRs/QmW86y+DVZxEclmlCkNAanC4Bvv5t3eQns0MTPm53jPx J3ThqG4eBg3sF2iWLNOospyN7Hdr+8k/+D4phAottiIM2U5lhOhzIzS0/Ln6pbOT7ibk hrTQ== X-Gm-Message-State: AOAM533Bn9S9fT1kCArqBxKjsZCPw+4cviEC1JI0aRu4zILpNORoILgg QeSe2+AoH0C1UotlTAA74p1sMaKhBV72iS4Vu5w= X-Received: by 2002:a05:600c:3ba3:: with SMTP id n35mr2380829wms.166.1630662050191; Fri, 03 Sep 2021 02:40:50 -0700 (PDT) MIME-Version: 1.0 References: <20210903075641.2807623-1-zhang.lyra@gmail.com> <20210903080316.2808017-1-zhang.lyra@gmail.com> In-Reply-To: From: Chunyan Zhang Date: Fri, 3 Sep 2021 17:40:13 +0800 Message-ID: Subject: Re: [PATCH] s390/io: Fix ioremap and iounmap undefinded issue for s390 To: Niklas Schnelle Cc: Vasily Gorbik , Heiko Carstens , Christian Borntraeger , linux-s390@vger.kernel.org, kernel test robot , Thomas Gleixner , Chunyan Zhang , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Sept 2021 at 16:24, Niklas Schnelle wrote: > > On Fri, 2021-09-03 at 16:03 +0800, Chunyan Zhang wrote: > > From: Chunyan Zhang > > > > There would not be ioremap and iounmap implementations if CONFIG_PCI is > > not set for s390, so add default declarations of these two functions > > for the case to avoid 'undefined reference' issue. > > > > Fixes: 71ba41c9b1d9 ("s390/pci: provide support for MIO instructions") > > Reported-by: kernel test robot > > Signed-off-by: Chunyan Zhang > > --- > > The issue was reported from https://lkml.org/lkml/2021/8/1/18 > > Thanks for the patch but I'm a little skeptical about adding > ioremap()/iounmap() stubs that don't do anything useful and on top ofn > that would do so silently. > > In the above discussion you said that TIMER_OF should depend on > HAS_IOMEM. In arch/s390/Kconfig HAS_IOMEM is set if and only if > CONFIG_PCI is set so that sounds to me like it would prevent the > undefined reference without the risk of someone trying to use io*map() > without CONFIG_PCI. Humm... you can ignore my reply on that time, I later found that's not correct :) TIMER_OF would be selected by other configs and it seems not able to depends on HAS_IOMEM, unless all configs which select TIMER_OF depend on HAS_IOMEM, that would be a big change. Actually HAS_IOMEM is set as default on other architectures, but not for s390 which redefined it. > > At the very least I think the functions should do a WARN_ONCE() but > then we have the same situation as discussed below with Linus making it > pretty clear that he prefers these cases to be compile time checked: Ok, if I understand correctly, if io*map is not implemented for some case, there should be a *compile-time* error rather than adding a stub function to make this kind of errors disappeared. Please correct me if I missed something. Thanks, Chunyan > > https://lkml.org/lkml/2021/7/2/511 > > > > --- > > arch/s390/include/asm/io.h | 15 ++++++++++++--- > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h > > index e3882b012bfa..9438370c6445 100644 > > --- a/arch/s390/include/asm/io.h > > +++ b/arch/s390/include/asm/io.h > > @@ -23,11 +23,8 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr); > > #define IO_SPACE_LIMIT 0 > > > > > .. snip .. >