Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1595117pxa; Sun, 2 Aug 2020 13:19:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOuN000HABsFtjbWfkzcke1X1m8XzQ8cobi8aXKii2zhxGMS+eA5gZiQc7JKQ3JgVXTfi4 X-Received: by 2002:a17:906:6bc9:: with SMTP id t9mr13255005ejs.372.1596399590213; Sun, 02 Aug 2020 13:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596399590; cv=none; d=google.com; s=arc-20160816; b=xmeVPeDXwDOpbDkRDiw74E9g4y8WJs2A91CcxFpJrTDEOhy101Z4Fgvm/vPNK+BInf CmROioU8KZ72FnEyX6VenHS4bb7AjEBLj9m21yJttNIPZ5twXTz6sBNbldAOyuc7sTXQ YYAgAf/p/n241Shm+3GQu+yQSPL+O4CBIczfWP3hTWmfSyOR+v5iuwP7c5VBqi5oPpeI F5bZPpK4FQH6TSLd78jAUt8BYCLwVVO5v2L7b/N52tHrq7yYytJffdqnhmPVnlhuo75g ZQsyKGr8vNZvGe+NnGdeSlNumxySGQCLY59NgfoisRv2XYmjIcuuWfat/jKT67HOpIPg rAbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=z0K+vlWV9j7wfXLQcUnvdJhwiVrF38RAZueHzdmaci0=; b=a30JUlIwXf8mwqFa0yyfIXNfZDrw5NzJlaQxDAne1dbGAgl3ZAhjvadnBHduJP0s3/ APxEJRufEoXWt+nky8TLcdlWKT9vkaLF1N3k5NU3goyvmzJgVgz2MQEUlHl+f2X1CPIw n9DkMJAYOdgSAfrXUQyalVYtJTnOrvPbqtzwT4YE4lwY1t8siTqYmrOkxC6pBKPVbGlN hJ8xyL0tVSpJLN7HBGLVJb0yEiBxMEIKoKJlA00KKwXx62ZdqebLVpZ++YZRrcfAXoe3 7h3LNSCRP0xUnl23RUM1UsUFSJzlLD0567WkQpJOZBQmflV005Zk9RhybR1yi3EXPFZf USgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=IpVr02DQ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y97si9737910ede.234.2020.08.02.13.19.16; Sun, 02 Aug 2020 13:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@alien8.de header.s=dkim header.b=IpVr02DQ; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727796AbgHBUSo (ORCPT + 99 others); Sun, 2 Aug 2020 16:18:44 -0400 Received: from mail.skyhub.de ([5.9.137.197]:58748 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbgHBUSo (ORCPT ); Sun, 2 Aug 2020 16:18:44 -0400 Received: from nazgul.tnic (unknown [78.130.214.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 4D2291EC02A8; Sun, 2 Aug 2020 22:18:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1596399520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=z0K+vlWV9j7wfXLQcUnvdJhwiVrF38RAZueHzdmaci0=; b=IpVr02DQwE3yYwTGqHzkePquczoIuB3CSh4JRazV28rb0yxVyTjgJHeFSYXLscJQCgocj+ YjGRmfK2vuZ4xdnOu8V6Bj4srNoX1QpTQVYAD0HdeQama4rhKTHzaxEhs3BC4FYYx+fxXN dZeZiogCz7IvNzoJKsyyZMEOy76rM2w= Date: Sun, 2 Aug 2020 22:18:06 +0200 From: Borislav Petkov To: Bjorn Helgaas Cc: Saheed Bolarinwa , trix@redhat.com, Kalle Valo , "David S. Miller" , Jakub Kicinski , Wolfgang Grandegger , Marc Kleine-Budde , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joerg Roedel , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-mtd@lists.infradead.org, iommu@lists.linux-foundation.org, linux-rdma@vger.kernel.org, linux-ide@vger.kernel.org, linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-gpio@vger.kernel.org, linux-fpga@vger.kernel.org, linux-edac@vger.kernel.org, dmaengine@vger.kernel.org, linux-crypto@vger.kernel.org, linux-atm-general@lists.sourceforge.net Subject: Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value Message-ID: <20200802201806.GA24437@nazgul.tnic> References: <20200802184648.GA23190@nazgul.tnic> <20200802191406.GA248232@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200802191406.GA248232@bjorn-Precision-5520> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, Aug 02, 2020 at 02:14:06PM -0500, Bjorn Helgaas wrote: > Wait, I'm not convinced yet. I know that if a PCI read fails, you > normally get ~0 data because the host bridge fabricates it to complete > the CPU load. > > But what guarantees that a PCI config register cannot contain ~0? Well, I don't think you can differentiate that case, right? I guess this is where the driver knowledge comes into play: if the read returns ~0, the pci_read_config* should probably return in that case something like: PCIBIOS_READ_MAYBE_FAILED to denote it is all 1s and then the caller should be able to determine, based on any of domain:bus:slot.func and whatever else the driver knows about its hardware, whether the 1s are a valid value or an error. Hopefully. Or something better of which I cannot think of right now... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette