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.129.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 A0B6417C204 for ; Tue, 20 Aug 2024 07:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724139619; cv=none; b=EsJhy8vajNxTpNDOJFQGj8btflNLd2Qx7HKmlkjWpKu6JpRCPNdnAayV4bh+4DCDf9dbjSWN9shBPNH23hElpY/qFUbRWaZFN+svK9sYHXme5xsiiKxuzLNVYvOk37qkJJzO33XJTf476VZoN2WLLRVkMW5finj2KFf/8z0FPek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724139619; c=relaxed/simple; bh=aYkN9CyGqEIYAw2LdxUgvvFJ/GqgBaxXltVMI7LxkmY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Uo/94Lnz0wwws1yhxb0J2Vcbv8LTwIUUtEJqPVBtuXyOMf28CFLdI0VSPmsXvtWCcYBgGbQHR1JY41NgFpnQHNnnZCf0XjyiDVIZcgvGy8qEqojoRKcTuLBqDQC3BcuS4kRMpNhx3REAbj/Y8m+WpgVF21pQQgEAhDW3KseFRhc= 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=UuQ9Iv9/; arc=none smtp.client-ip=170.10.129.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="UuQ9Iv9/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724139615; 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=LI6kfa5oLV045Jmdu7a0CojUb3GQJzHs7H4OiymNEbE=; b=UuQ9Iv9/pqlemqjxVDZRGDX6y5QGbNAUr3N1iCZYRyEDJFlI915pUCwzLtwrA4rZOaPR3G 1cdKhU5YzKmvsjMW7Cj0XiACYEg6AceERvZaMyPEvK8j3bkTEUv78QgHZCGtJCT87arwlW lmOWK8/r+4KXUB/mzyxXFAZ2AtL93ho= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-245-ehCpoeIeMtKCBkT25pwqIw-1; Tue, 20 Aug 2024 03:40:14 -0400 X-MC-Unique: ehCpoeIeMtKCBkT25pwqIw-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2f01b609ac9so4173711fa.1 for ; Tue, 20 Aug 2024 00:40:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724139612; x=1724744412; 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=LI6kfa5oLV045Jmdu7a0CojUb3GQJzHs7H4OiymNEbE=; b=viogAQmBOk5JJA+X9V5YC5k9TMWMJE0176M9ENcfCxJubNcaNoOrHX7D02tIweoQ+A YJniEx6I0TIrLcRm8K2U+d+dle+xQFdJ3wn+Tmxpox9/v8qZcxUyt+RClPuYF+sh//BQ nXkqTQh3R9qYR7ivqcGrpXR/daG3y+aCeWS+dygimyOnWs9yijQtLuPEXfD223SiStuG +wkOsh0RajRo0Kj/4slqLfEbtx5Pa6JFfCgTn3XjhaYHXtdpW37gs00ljIJiKGsUvDmA qDWV2XyyzJJkD5A/p5AmGxbBjptlMa9ecBcS3uHAOELX3MN/hN/VFif69S56FANMuNid 1PMg== X-Forwarded-Encrypted: i=1; AJvYcCVYiE/JZ7QqofrOWDkx6kwmh1p9lm9xPMsXGumpMe88QicybvlVlnv7uIzvBVKv+dO+8UuX0HPhX0/A@vger.kernel.org X-Gm-Message-State: AOJu0Yxe3BtKRaKf72ev0gO9QcQZCOzuwb1Il0BWgrSxQWEW+QxpUkHZ e/P1zV7XHCmPo8Ii5u8s+/lINbr5OSPhv6zPyLuFMzkM3jnHB2IhsmHOUsui6c4ifL7RCsrnHNX +wL0nkbaFvdDsfe58cr8EVF+O0DH2cep7TgTXROYeVzFfQuyVT0s2yDjcZ6E= X-Received: by 2002:a05:6512:3d04:b0:52f:c0dd:d168 with SMTP id 2adb3069b0e04-5331c6e53bfmr4778904e87.7.1724139612398; Tue, 20 Aug 2024 00:40:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuY9Bjt5iBWcm2YKpDyt42mNkBOnX16tyh4gc9tacJQihXtDb0AW33sxGPjl0kWgtMyZPzMQ== X-Received: by 2002:a05:6512:3d04:b0:52f:c0dd:d168 with SMTP id 2adb3069b0e04-5331c6e53bfmr4778883e87.7.1724139611750; Tue, 20 Aug 2024 00:40:11 -0700 (PDT) Received: from eisenberg.fritz.box ([2001:16b8:3dcc:1f00:bec1:681e:45eb:77e2]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83839344fdsm726051366b.100.2024.08.20.00.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2024 00:40:11 -0700 (PDT) Message-ID: <5d70794731198ec7bc59bd95e50a8aa81cf97c7b.camel@redhat.com> Subject: Re: [PATCH 6/9] ethernet: cavium: Replace deprecated PCI functions From: Philipp Stanner To: Andy Shevchenko Cc: onathan Corbet , Jens Axboe , Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , Linus Walleij , Bartosz Golaszewski , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Bjorn Helgaas , Alvaro Karsz , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?ISO-8859-1?Q?P=E9rez?= , Richard Cochran , Mark Brown , David Lechner , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Jonathan Cameron , Hannes Reinecke , Damien Le Moal , Chaitanya Kulkarni , "Martin K. Petersen" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, virtualization@lists.linux.dev Date: Tue, 20 Aug 2024 09:40:09 +0200 In-Reply-To: References: <20240819165148.58201-2-pstanner@redhat.com> <20240819165148.58201-8-pstanner@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-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-08-19 at 21:23 +0300, Andy Shevchenko wrote: > On Mon, Aug 19, 2024 at 06:51:46PM +0200, Philipp Stanner wrote: > > pcim_iomap_regions() and pcim_iomap_table() 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 the function pcim_iomap_region(). >=20 > ... >=20 > cavium_ptp_probe() >=20 > > - pcim_iounmap_regions(pdev, 1 << PCI_PTP_BAR_NO); > > + pcim_iounmap_region(pdev, PCI_PTP_BAR_NO); > > =C2=A0 > > =C2=A0error_free: > > =C2=A0 devm_kfree(dev, clock); >=20 > Both are questionable. Why do we need either of them? You seem to criticize my pcim_iounmap_region() etc. in other unwind paths, too. I think your criticism is often justified. This driver here, however, was the one which made me suspicious and hesitate and removing those calls; because of the code below: pcim_iounmap_region(pdev, PCI_PTP_BAR_NO); error_free: devm_kfree(dev, clock); error: /* For `cavium_ptp_get()` we need to differentiate between the case * when the core has not tried to probe this device and the case when * the probe failed. In the later case we pretend that the * initialization was successful and keep the error in * `dev->driver_data`. */ pci_set_drvdata(pdev, ERR_PTR(err)); return 0; } So in case of an error they return 0 and do... stuff. I don't want to touch that without someone who maintains (and, ideally, understands) the code details what's going on here. P.