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 6D7F4187555 for ; Tue, 20 Aug 2024 07:40:18 +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=1724139619; cv=none; b=Zha78fqdMfWR4+BHBmtP42e4+Fw6pd+lJpxOJ/lRpteAgNtq5JLZeLYcF5WtLTW1Dl+CS78ylJipuVwPYuCl5bM/ZUzaCl02hMjk4Is8LFDB7gbwtAXXLFGdnSuXqOnKOU6noexHIXVZuM4m7jhJoT3802LQ0am3wjKGp8/75v8= 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=eJta+Jvo; 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="eJta+Jvo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724139617; 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=eJta+JvoAWDoq+TClca86nb1bs8xpBb+o5RHBqIDL2NFV2l3yaEvTzSxTrb7IuvYQv56o6 QzM3HYFuNwLshv5bg817PpSVjUKuJq3S3C/WUtSLa8o0NPrg98ZWcQ1T3mBx2E72TvWBKq kD2JUPT7cJsgtQdSvVBw+Tu7sM+zyso= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-GRxrlpSpOnOcc7CyTbvtHw-1; Tue, 20 Aug 2024 03:40:14 -0400 X-MC-Unique: GRxrlpSpOnOcc7CyTbvtHw-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2ef2b4482e5so5173751fa.3 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=MfE6z47WZ9ynOfJpkYxiI0oQPUfzFfEvE6EOlXW0CiNLUkvyqZ/px4z4KwDkdVuIMY 9OnLPStwecDTjWrM2cK9JNEdF6ixihMkDObhVZ4Tl1MKKw5958f6AHsb86YrDI+K+9Je J5qQlDWozpsiMnfaFfiik+p26QyUglMDz75ADiKbHWXaruy+UNCfEx4ISoOkDCRUXqIx xtn2DyXI4/4qVGTkZ/OQg7vbbjezLtWUYpmuTjgQ6T1EW5VMbDUW0FvNCKWCepH3Ug3r lYYgAW7sAx06+3Can2d80i3kKf22kwfqn3ssaF2gLJtvnmlejsBq2s4CIhKizDTTkq7G U37Q== X-Forwarded-Encrypted: i=1; AJvYcCXgHTx+o5WXM8w6HBL2OrRQ3KSlxjGxC6U7wjhmXOK27JYX0eIcbbrxLofOSCXldYpzswwi8qFJ71VjlPE=@vger.kernel.org X-Gm-Message-State: AOJu0YxAIgDi3Avgxsmrj9zA5h0YyBIHxAJ9/9qaemf4FrGEcSk/l7TM 33k1Tt6iDfY/5h3B/Q0ceTgg0FBKj7PqueDKlhbmaM3EOnG1zNcqqmUWoC71+/RF+XnO+y3zeB3 VVyWdIscWXL0vIx1Lw9gU28g0Jx98TztJ+b8hmbdsorZ+XmgQYb4JBI+ugcpSqA== X-Received: by 2002:a05:6512:3d04:b0:52f:c0dd:d168 with SMTP id 2adb3069b0e04-5331c6e53bfmr4778925e87.7.1724139612407; 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-kernel@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.