Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1114627pxu; Mon, 23 Nov 2020 12:01:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJya6AGLTYQ/bEeE13Lbi3Art6dypbb+qfX6EA/7BgoJYRst74Vq29S8ZZcPFJojiKz31BwR X-Received: by 2002:a17:906:1317:: with SMTP id w23mr1175862ejb.120.1606161712044; Mon, 23 Nov 2020 12:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606161712; cv=none; d=google.com; s=arc-20160816; b=kAnD9tdFuWOtiuzz4IcZcHszLcAWsfzLmwvR+5wO82bn0Y2ou8+VmdfPL9+z/Kesoz qkSZpdrC1wC7hA2mQ7vG9PvxNswz0AI0ql+jy8qiTK8wabFBk+4PLzQ243BPU8TzniaG uidB+cZwc+1LTGCZB3jHZ81oaZ2FvjY8HZX8OXENVZaIP+9BGceGdBJXmOybZ9P8eBp7 dWsmzJ5HXZjOcnYbi68q+6mark4khKslz9wn745yHnjMvbGbf20Vqllj775yRbAeSxhA 90JUJzbqOIjThWReHYEEmceQUwiQFh6m34qT4xg7ncRNU9IBy3FYrR98ODnTykY7qh4j O31g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=fcquqs2TmZiT1XhMLtFJFH5cvJUE1qDx/PZ+AJMqo+w=; b=pvYMiGvxDfHB1vop2yZA07rnOPsvE8M5XCLkvFMfQylP0TlfVO5N5u6U7atMOanNcz bdaTm9/znWjQbFRO/DExL40HEOiPVNFym38IAO4xufJW/0pnqzHeCvZkxbd5rwVtss5i C7v9wlcjOo6/sPWSV94H0lV3AG9fa5kv6BUmeSUg0q/FEFwi/HZE+Vwk+rP2IybHMkDq kSpBr+tf2cmiQiTXxg/PaPDhoGHlKF4OkxBfP8yFq/aC76iEeJg+ghUOmsbZOdenPqT8 2ytTjg/hfWhtFtcMJ8FZ7kukuUF/kSPHCSOT2vus5sm8d7moS+1firVqxdsZdyVN4TZV Ef0Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si7627112edv.126.2020.11.23.12.01.28; Mon, 23 Nov 2020 12:01:52 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730179AbgKWT64 (ORCPT + 99 others); Mon, 23 Nov 2020 14:58:56 -0500 Received: from mga07.intel.com ([134.134.136.100]:1054 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728938AbgKWT6y (ORCPT ); Mon, 23 Nov 2020 14:58:54 -0500 IronPort-SDR: 2WKvDm4FtfpiQTwoNuurLLsBiAuCaQ/5dsk1xIISNPv6imEV1AyjJ5Gjw1HJrWBF01FqooklsQ usyQfXniAyOw== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="235972270" X-IronPort-AV: E=Sophos;i="5.78,364,1599548400"; d="scan'208";a="235972270" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 11:58:35 -0800 IronPort-SDR: ++nptVpYh180R/rQXo3jhOKeIgoHc33C0uL9ziietbgdx2y7sgx72fYoKkN+Z3nNFRdN76QBaB GIYhJJS8CHtw== X-IronPort-AV: E=Sophos;i="5.78,364,1599548400"; d="scan'208";a="546541234" Received: from laloy-mobl1.amr.corp.intel.com (HELO intel.com) ([10.252.133.93]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 11:58:35 -0800 Date: Mon, 23 Nov 2020 11:58:33 -0800 From: Ben Widawsky To: Dan Williams Cc: Bjorn Helgaas , linux-cxl@vger.kernel.org, Linux Kernel Mailing List , Linux PCI , Linux ACPI , Ira Weiny , Vishal Verma , "Kelley, Sean V" , Bjorn Helgaas , "Rafael J . Wysocki" Subject: Re: [RFC PATCH 4/9] cxl/mem: Map memory device registers Message-ID: <20201123195833.zeyhja6no6dkd32c@intel.com> References: <20201117002321.GA1344659@bjorn-Precision-5520> <20201123192029.pmmy6ygts5fclz7b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20-11-23 11:32:33, Dan Williams wrote: > On Mon, Nov 23, 2020 at 11:20 AM Ben Widawsky wrote: > [..] > > > -ENXIO is fine with me. I just don't see it as often so I don't > > > really know what it is. > > > > > > Bjorn > > > > Dan, Bjorn, I did a fairly randomized look at various probe functions and ENODEV > > seems to be more common. My sort of historical use has been > > - ENODEV: General, couldn't establish device presence > > - ENXIO: Device was there but something is totally misconfigured > > - E*: A matching errno for exactly what went wrong > > > > My question though is, would it be useful to propagate the error up through > > probe? > > The error from probe becomes the modprobe exit code, or the write to > the 'bind' attribute errno. So, it's a choice between "No such device > or address", or "No such device". The "or address" mention makes a > small bit more sense to me since the device is obviously present as it > is visible in lspci, but either error code clearly indicates a driver > problem so ENODEV is fine. > > For the other error codes I think it would be confusing to return > something like EINVAL from probe as that would be mistaken as an > invalid argument to the modprobe without stracing to see that it came > from the result of a sysfs write Currently in this path there are 2 general reasons for failure: 1. Driver internal problem, ENOMEM or some such. 2. Device problem (the memory device capability isn't present). I think I'll return ENODEV for the former and ENXIO for the latter. If that sounds good to everyone else.