From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FB6818991C for ; Fri, 25 Oct 2024 16:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729873534; cv=none; b=hpSt107p7foLy7O/9cV8pO0pMzgJyEcURtvsjP2qgXyJJwf+APbgR0doC7ELAxHRuaHVGpWTeGgOGMh4HoPv/P5Us8Y+uSgI1yZGmuMcrvhxiB84dKaKwBT/HvTE1DxW+ycHTMeUCx8JE1b0shvEbvqDr/kvJpH/CspmDPpyfnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729873534; c=relaxed/simple; bh=GoCr76xnRLzwQicFvt18Ge2EG7K2EG1pjibQU3pXtS8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ehiZFJO0bb2kcXQDyA6Myz2LXp04cNmku9CXvMG0bm4VRrVtSA88uVFKbqYKsaT3W6oK+YhPN3segCT7wOQ5XiK7EK9m+wQ1Iqagbs0b69xcKG7WXMGXgHZ2CxcuBMDFFmSloczGChrNiySiUWjYPEgyNbewsbfRFEfqs6JW1Fk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=R13VPP6H; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R13VPP6H" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729873530; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FXKBVRfqpqNYlcZq3IctC1VfdYCiTtVmRZFO4m6wOiI=; b=R13VPP6H5N19hA0D7TZZgqMfRhdTbeyq/Qf3zLvRaFKO8BZbdg8AXKIexJPyYAvAnfQ9bw KJz8fPJyN24+f9lUkyYfxyURkMGwm70bB170cjMusWQuRiIBcyQV4FK99xR7Z/K+abNiP8 cdSmZLOlrmyk8y2WDf340D56a1wDkQ4= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-bMLavQabO6KrW7GCLLxXWQ-1; Fri, 25 Oct 2024 12:25:28 -0400 X-MC-Unique: bMLavQabO6KrW7GCLLxXWQ-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-539f49f23ddso1533595e87.1 for ; Fri, 25 Oct 2024 09:25:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729873527; x=1730478327; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FXKBVRfqpqNYlcZq3IctC1VfdYCiTtVmRZFO4m6wOiI=; b=ZtVBD/2vcBBFIWlohcn/Y+twGbXa4r3k3gwJF2jt9MAnINNTrY3FZeHBhWSBF2beuh xGq4BNhrOGY8g5pVVIGxAyVkyrbkyuC1tbnYww7XDiBaBD1SC3T98uVevfpj6JMl+1W+ wg0fcrbdsd7R2USUd/ZGrSUR6iJ3parmfsi0/hZICvYgX9hviP79FfmFg8yQnoOT79hr LccHba5ECrQQY30DobD8E5ZJMkr/Ruaj8iXnCU90tG27gie1gVM468Uo5gd6CuqCep3r 6WxfReVELpqn13xXAnJSo7O20lELc5utXbzzrh10pqwbHbU+5IyLs6jz/MCiuvvDmSBo ROSg== X-Forwarded-Encrypted: i=1; AJvYcCUaUSHicqLdvZQozFo8++EQGkDbxFaA2an7LopusYSiBPzTBW179liN6kVaQS9+II/GCwonNq0GSnsAMa8=@vger.kernel.org X-Gm-Message-State: AOJu0YwquM9bAKd3x+6FQyqODGRE+mFjY4CNBI2gXrlRzAAMFKojehJz p0uVt7JypjVuxp5Hlg7D3QYmy+vp8Zndo79bvtg9vKnZ4z62jLGD3Y4WM/KXXrtYBO4d7nevbww 0sGOcGprIKoLIE8ror1xazKeRhpu75UyLClvcLYvg6CzjwcXUUEqEipsFits8Cw== X-Received: by 2002:a05:6512:ad5:b0:539:e2cc:d380 with SMTP id 2adb3069b0e04-53b1a341cb6mr5563347e87.27.1729873527040; Fri, 25 Oct 2024 09:25:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvcz2ftuWzZl9pExVs36p45/rF+DcGN9KaPbit+tdC2ctJlDRbjLwxBhAN9fei+TzzB/5ozg== X-Received: by 2002:a05:6512:ad5:b0:539:e2cc:d380 with SMTP id 2adb3069b0e04-53b1a341cb6mr5563310e87.27.1729873526521; Fri, 25 Oct 2024 09:25:26 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82de5ba00738ac8dadaac7543.dip.versatel-1u1.de. [2001:16b8:2de5:ba00:738a:c8da:daac:7543]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b3a08b478sm86191966b.223.2024.10.25.09.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 09:25:26 -0700 (PDT) Message-ID: <18fa3bec44aaee473f9d0955891fc63300400de7.camel@redhat.com> Subject: Re: [PATCH 06/10] wifi: iwlwifi: replace deprecated PCI functions From: Philipp Stanner To: Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: Jonathan Corbet , Damien Le Moal , Niklas Cassel , Giovanni Cabiddu , Herbert Xu , "David S. Miller" , Boris Brezillon , Arnaud Ebalard , Srujana Challa , Alexander Shishkin , Miri Korenblit , Kalle Valo , Serge Semin , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Kevin Cernekee , Greg Kroah-Hartman , Jiri Slaby , Jaroslav Kysela , Takashi Iwai , Mark Brown , David Lechner , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Jie Wang , Tero Kristo , Adam Guerin , Shashank Gupta , Przemek Kitszel , Bharat Bhushan , Nithin Dabilpuram , Johannes Berg , Emmanuel Grumbach , Gregory Greenman , Benjamin Berg , Yedidya Benshimol , Breno Leitao , Florian Fainelli , linux-doc@vger.kernel.org, LKML , linux-ide@vger.kernel.org, qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, linux-serial , linux-sound@vger.kernel.org Date: Fri, 25 Oct 2024 18:25:24 +0200 In-Reply-To: References: <20241025145959.185373-1-pstanner@redhat.com> <20241025145959.185373-7-pstanner@redhat.com> <415402ba495b402b67ae9ece0ca96ab3ea5ee823.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2024-10-25 at 19:11 +0300, Ilpo J=C3=A4rvinen wrote: > On Fri, 25 Oct 2024, Philipp Stanner wrote: >=20 > > On Fri, 2024-10-25 at 18:31 +0300, Ilpo J=C3=A4rvinen wrote: > > > On Fri, 25 Oct 2024, Philipp Stanner wrote: > > >=20 > > > > pcim_iomap_table() and pcim_iomap_regions_request_all() have > > > > been > > > > deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: > > > > Deprecate > > > > pcim_iomap_table(), pcim_iomap_regions_request_all()"). > > > >=20 > > > > Replace these functions with their successors, pcim_iomap() and > > > > pcim_request_all_regions(). > > > >=20 > > > > Signed-off-by: Philipp Stanner > > > > Acked-by: Kalle Valo > > > > --- > > > > =C2=A0drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 16 ++++----= - > > > > ---- > > > > --- > > > > =C2=A01 file changed, 4 insertions(+), 12 deletions(-) > > > >=20 > > > > diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > > > > b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > > > > index 3b9943eb6934..4b41613ad89d 100644 > > > > --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > > > > +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c > > > > @@ -3533,7 +3533,6 @@ struct iwl_trans > > > > *iwl_trans_pcie_alloc(struct > > > > pci_dev *pdev, > > > > =C2=A0 struct iwl_trans_pcie *trans_pcie, **priv; > > > > =C2=A0 struct iwl_trans *trans; > > > > =C2=A0 int ret, addr_size; > > > > - void __iomem * const *table; > > > > =C2=A0 u32 bar0; > > > > =C2=A0 > > > > =C2=A0 /* reassign our BAR 0 if invalid due to possible > > > > runtime > > > > PM races */ > > > > @@ -3659,22 +3658,15 @@ struct iwl_trans > > > > *iwl_trans_pcie_alloc(struct pci_dev *pdev, > > > > =C2=A0 } > > > > =C2=A0 } > > > > =C2=A0 > > > > - ret =3D pcim_iomap_regions_request_all(pdev, BIT(0), > > > > DRV_NAME); > > > > + ret =3D pcim_request_all_regions(pdev, DRV_NAME); > > > > =C2=A0 if (ret) { > > > > - dev_err(&pdev->dev, > > > > "pcim_iomap_regions_request_all failed\n"); > > > > + dev_err(&pdev->dev, "pcim_request_all_regions > > > > failed\n"); > > > > =C2=A0 goto out_no_pci; > > > > =C2=A0 } > > > > =C2=A0 > > > > - table =3D pcim_iomap_table(pdev); > > > > - if (!table) { > > > > - dev_err(&pdev->dev, "pcim_iomap_table > > > > failed\n"); > > > > - ret =3D -ENOMEM; > > > > - goto out_no_pci; > > > > - } > > > > - > > > > - trans_pcie->hw_base =3D table[0]; > > > > + trans_pcie->hw_base =3D pcim_iomap(pdev, 0, 0); > > > > =C2=A0 if (!trans_pcie->hw_base) { > > > > - dev_err(&pdev->dev, "couldn't find IO mem in > > > > first > > > > BAR\n"); > > > > + dev_err(&pdev->dev, "pcim_iomap failed\n"); > > >=20 > > > This seems a step backwards as a human readable English error > > > message > > > was=20 > > > replaced with a reference to a function name. > >=20 > > I think it's still an improvement because "couldn't find IO mem in > > first BAR" is a nonsensical statement. What the author probably > > meant > > was: "Couldn't find first BAR's IO mem in magic pci_iomap_table" ;) >=20 > Well, that's just spelling things on a too low level too. It's > irrelevant > detail to the _user_ that kernel used some "magic table". Similarly, > it's=20 > irrelevant to the user that function called pcim_iomap failed. >=20 > > The reason I just wrote "pcim_iomap failed\n" is that this seems to > > be > > this driver's style for those messages. See the dev_err() above, > > there > > they also just state that this or that function failed. >=20 > The problem in using function names is they have obvious meaning for=20 > developers/coders but dev_err() is presented to user with varying > level > of knowledge about kernel internals/code. >=20 > While users might be able to derive some information from the > function=20 > name, it would be simply better to explain on higher level what > failed=20 > which is what I think the original message tried to do even if it was > a bit clumsy. There is zero need to know about kernel internals to=20 > interpret that message (arguably one needs to know some PCI to > understand=20 > BAR, though). >=20 > (Developers can find the internals by looking up the error message > from > the code so it doesn't take away something from developers.) Feel free to make a suggestion for a better error message. sth like "could not ioremap PCI BAR 0.\n" could satisfy your criteria. (I just now noticed that so far it called BAR 0 the "first bar", which is also not gold standard) P. >=20