From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 DB8A31531C1; Fri, 25 Oct 2024 16:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729873784; cv=none; b=TFoxkDXK3NaPgW3t9fhfGDAuXUTnFmPxrm6xjnccLXlAbJ6eGFIb4+U2JkaRFy+6gd8NedVUxHW9TADSB9AhHfjIsqOD1gz2vyV6mkLBfCb5vi0ja+Qi6TPUq/vb75PE+x3nj1k0NJqpJedEiB5s/EEwzVk8RrPh1bPs+gId6X0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729873784; c=relaxed/simple; bh=smbRo0dTxi8SCxwEPoPtcgpQrjs8XbGMk6SZqHL9U3k=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=m6u/Ov6Gw/0zkrdn9YeHQ1jMqTK+LU3f1zOtWKmRHHlagVYh9Aq3epgR0l6b44SmagQ7gztzv2MuSG+HHat1mjjHrifpr2opUUS+Tyggg2WZ9Gh6nJnwwacN7+x5CLCp3VSoyILHI6JygaVcYkVAkOG2tTChicOG0cfOimNQB0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Dt1lABpu; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Dt1lABpu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729873782; x=1761409782; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=smbRo0dTxi8SCxwEPoPtcgpQrjs8XbGMk6SZqHL9U3k=; b=Dt1lABpug491it3/ewFBRaiv6dZD+MwQOcajaCFc+yEMo578l7WWfFyd RSl51epi+BVj2kvzYRHgBVVDWk1XiS+KJLaQGCsOxpN/gdcJqIu2qz79C 7/YRCBvYYsw+838X4OXJbcS6KrOV/b1eAN3zNdf+ZuFwiXyH3nRjYNjKM CteI4WrDnxZdUvegYLHKHzA1KcAbb04RuPYMJEnDagD5Thwnej8kxztSw ++qrBn87PaJ4hf4nzIkvYqF+u9PW6C2l2NONJq1e17bU6ZCD95lgs3pDB x1zKBrzEkGxhwE2XTH3qjEl+oHZZBCfdx4jOodPouj9OELCxIJ5Q1y+Tq w==; X-CSE-ConnectionGUID: utL0KPd5SwG0plw2hbkwTA== X-CSE-MsgGUID: OK1jiG6gQSijnFTpR1AucA== X-IronPort-AV: E=McAfee;i="6700,10204,11236"; a="29657727" X-IronPort-AV: E=Sophos;i="6.11,232,1725346800"; d="scan'208";a="29657727" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2024 09:29:41 -0700 X-CSE-ConnectionGUID: 1qRScS1RQ0+H+CcJJK+QMw== X-CSE-MsgGUID: +IA6zuqJQvihiK3yPko5gw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,232,1725346800"; d="scan'208";a="85505472" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.225]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2024 09:29:26 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Fri, 25 Oct 2024 19:29:22 +0300 (EEST) To: Philipp Stanner 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 , =?ISO-8859-15?Q?Uwe_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 Subject: Re: [PATCH 06/10] wifi: iwlwifi: replace deprecated PCI functions In-Reply-To: <18fa3bec44aaee473f9d0955891fc63300400de7.camel@redhat.com> Message-ID: References: <20241025145959.185373-1-pstanner@redhat.com> <20241025145959.185373-7-pstanner@redhat.com> <415402ba495b402b67ae9ece0ca96ab3ea5ee823.camel@redhat.com> <18fa3bec44aaee473f9d0955891fc63300400de7.camel@redhat.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-818714952-1729873762=:946" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-818714952-1729873762=:946 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 25 Oct 2024, Philipp Stanner wrote: > 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=09struct iwl_trans_pcie *trans_pcie, **priv; > > > > > =C2=A0=09struct iwl_trans *trans; > > > > > =C2=A0=09int ret, addr_size; > > > > > -=09void __iomem * const *table; > > > > > =C2=A0=09u32 bar0; > > > > > =C2=A0 > > > > > =C2=A0=09/* 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=09=09} > > > > > =C2=A0=09} > > > > > =C2=A0 > > > > > -=09ret =3D pcim_iomap_regions_request_all(pdev, BIT(0), > > > > > DRV_NAME); > > > > > +=09ret =3D pcim_request_all_regions(pdev, DRV_NAME); > > > > > =C2=A0=09if (ret) { > > > > > -=09=09dev_err(&pdev->dev, > > > > > "pcim_iomap_regions_request_all failed\n"); > > > > > +=09=09dev_err(&pdev->dev, "pcim_request_all_regions > > > > > failed\n"); > > > > > =C2=A0=09=09goto out_no_pci; > > > > > =C2=A0=09} > > > > > =C2=A0 > > > > > -=09table =3D pcim_iomap_table(pdev); > > > > > -=09if (!table) { > > > > > -=09=09dev_err(&pdev->dev, "pcim_iomap_table > > > > > failed\n"); > > > > > -=09=09ret =3D -ENOMEM; > > > > > -=09=09goto out_no_pci; > > > > > -=09} > > > > > - > > > > > -=09trans_pcie->hw_base =3D table[0]; > > > > > +=09trans_pcie->hw_base =3D pcim_iomap(pdev, 0, 0); > > > > > =C2=A0=09if (!trans_pcie->hw_base) { > > > > > -=09=09dev_err(&pdev->dev, "couldn't find IO mem in > > > > > first > > > > > BAR\n"); > > > > > +=09=09dev_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.) >=20 > Feel free to make a suggestion for a better error message. >=20 > sth like "could not ioremap PCI BAR 0.\n" could satisfy your criteria. Yes. --=20 i. > (I just now noticed that so far it called BAR 0 the "first bar", which > is also not gold standard) --8323328-818714952-1729873762=:946--