Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2928123ioo; Tue, 24 May 2022 09:02:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBBW3Uf8f/O25wGuhobYNzMzSQWfhwsaM35ZFWGp4i/11TxM2BX68x5q121ZxeFeixH48C X-Received: by 2002:a05:6402:3593:b0:42b:550e:ddb with SMTP id y19-20020a056402359300b0042b550e0ddbmr15404155edc.403.1653408128804; Tue, 24 May 2022 09:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653408128; cv=none; d=google.com; s=arc-20160816; b=LKRHSbSU21nraHcJJ+nYHPi9cBcbxWVX/UYz0xWcjomaqCxUkBObSANBDo9LlTxFKi ZVJjNcc3Cx6rHcPihL7do7Jxe6MtGQWNwKIT2Bef/Xo1VS1pmdyL6N/xbcY/g3/pR8+F pby5TVjX4SBP3cSrlWjfRBvQqrDAzcfsxTu+8G2kJW/aKf38ao9tq4oIeypSc9lebSpi Ktv9z4N/5YBKe90d0acjI3aqOz2sUdacEQG6rxe4MRVB3qL3pIylzQCe4vmQltyEO1zy ehD7prEls/NeUpgBsNVWv4DfD71NOBVplyNLZmclr/HZ0hWIderSXGbptroqpP0CIQ8i fMxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=4rimyPCe+kmIX+HsvQTFXXmOqiphRQoFRiKgF00VYBw=; b=KM6KuYl6XjTGNkuKXJdvITnxvJVbotD4qZjVmEDgg68SPJ6sO3VC9vWqKf0tIwBFYq nILj/yqA+q5weMwgte+H1jXcMuMl9pkMzoHG4WMoENcT0C/lBZHAlrMpe6BX/qK3Cfde PeVRpWfL8daj/nLyQN6Q3MSOOhoRC1SiTe16Jwcqa32rcTuxjwAkWIELCdNZ4y06J520 Rv0grfT13uUmFCej2q720YBlYedWgrMM3mazGWs3i2760rkoiko04ApYUUx1KRPBN2FG M9xRwmJ89KP31DH++YuserEkXL74jfmHuyaV5P8ANxaTWCSeKXyAGbp+W0UfIAUzSdV1 UbTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a05640235c400b0042ab4e83dd0si23352865edc.269.2022.05.24.09.01.40; Tue, 24 May 2022 09:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238224AbiEXOct (ORCPT + 99 others); Tue, 24 May 2022 10:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235943AbiEXOcj (ORCPT ); Tue, 24 May 2022 10:32:39 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2134606FA for ; Tue, 24 May 2022 07:32:37 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4L6xVn01kZzDqKp; Tue, 24 May 2022 22:32:32 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 24 May 2022 22:32:35 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 24 May 2022 22:32:35 +0800 Message-ID: <4c848b48-6ddf-664a-6296-d85ab49a694d@huawei.com> Date: Tue, 24 May 2022 22:32:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v3 4/6] mm: ioremap: Add arch_ioremap/iounmap() Content-Language: en-US To: Arnd Bergmann CC: Catalin Marinas , Will Deacon , Andrew Morton , Linux ARM , Linux Kernel Mailing List , Linux-MM , "Christoph Hellwig" , Anshuman Khandual References: <20220519082552.117736-1-wangkefeng.wang@huawei.com> <20220519082552.117736-5-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/5/24 20:37, Arnd Bergmann wrote: > On Thu, May 19, 2022 at 10:25 AM Kefeng Wang wrote: >> Add special hook for architecture to verify or setup addr, size >> or prot when ioremap() or iounmap(), which will make the generic >> ioremap more useful. >> >> arch_ioremap() return a pointer, >> - IS_ERR means return an error >> - NULL means continue to remap >> - a non-NULL, non-IS_ERR pointer is directly returned >> arch_iounmap() return a int value, >> - 0 means continue to vunmap >> - error code means skip vunmap and return directly >> >> Signed-off-by: Kefeng Wang > I don't really like interfaces that mix error pointers and NULL pointer > returns. > > Would it be possible to have a special error code other than NULL > for the fallback case? I don't find a good error code, maybe  ENOTSUPP, any better suggestion? > > arnd > > .