lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 04 Feb 2018 21:31:46 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Realtek linux nic maintainers <nic_swsd@...ltek.com>,
        "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc:     Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [PATCH v1] r8169: switch to device-managed functions in probe
 (part 2)

On Sun, 2018-02-04 at 21:29 +0200, Andy Shevchenko wrote:
> This is a follow up to the commit
> 
>   4c45d24a759d ("r8169: switch to device-managed functions in probe")
> 
> to move towards managed resources even more.
> 

Oops, sorry, it's not ready-yet version.


> Cc: Heiner Kallweit <hkallweit1@...il.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/net/ethernet/realtek/r8169.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169.c
> b/drivers/net/ethernet/realtek/r8169.c
> index 0bf7d1759250..88aa3728d674 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -8397,7 +8397,6 @@ static int rtl_init_one(struct pci_dev *pdev,
> const struct pci_device_id *ent)
>  	struct rtl8169_private *tp;
>  	struct mii_if_info *mii;
>  	struct net_device *dev;
> -	void __iomem *ioaddr;
>  	int chipset, i;
>  	int rc;
>  
> @@ -8455,20 +8454,13 @@ static int rtl_init_one(struct pci_dev *pdev,
> const struct pci_device_id *ent)
>  		return -ENODEV;
>  	}
>  
> -	rc = pci_request_regions(pdev, MODULENAME);
> +	rc = pcim_iomap_regions(pdev, BIT(region), MODULENAME);
>  	if (rc < 0) {
> -		netif_err(tp, probe, dev, "could not request
> regions\n");
> +		netif_err(tp, probe, dev, "cannot remap MMIO,
> aborting\n");
>  		return rc;
>  	}
>  
> -	/* ioremap MMIO region */
> -	ioaddr = devm_ioremap(&pdev->dev, pci_resource_start(pdev,
> region),
> -			      R8169_REGS_SIZE);
> -	if (!ioaddr) {
> -		netif_err(tp, probe, dev, "cannot remap MMIO,
> aborting\n");
> -		return -EIO;
> -	}
> -	tp->mmio_addr = ioaddr;
> +	tp->mmio_addr = pcim_iomap_table(pdev)[region];
>  
>  	if (!pci_is_pcie(pdev))
>  		netif_info(tp, probe, dev, "not PCI Express\n");
> @@ -8667,7 +8659,7 @@ static int rtl_init_one(struct pci_dev *pdev,
> const struct pci_device_id *ent)
>  	pci_set_drvdata(pdev, dev);
>  
>  	netif_info(tp, probe, dev, "%s at 0x%p, %pM, XID %08x IRQ
> %d\n",
> -		   rtl_chip_infos[chipset].name, ioaddr, dev-
> >dev_addr,
> +		   rtl_chip_infos[chipset].name, tp->mmio_addr, dev-
> >dev_addr,
>  		   (u32)(RTL_R32(TxConfig) & 0x9cf0f8ff), pdev->irq);
>  	if (rtl_chip_infos[chipset].jumbo_max != JUMBO_1K) {
>  		netif_info(tp, probe, dev, "jumbo features [frames:
> %d bytes, "

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ