Subject: Re: [PATCH net v3.16]r8169: Not enable/disable bus mastering when is enabled on BIOS

From: Sergei Shtylyov <[email-masked]>
Date: Sat, 12 Mar 2016 22:09:31 +0300

Hello.

On 03/12/2016 09:33 AM, Corcodel Marian wrote:

>   This patch not enable/disable bus mastering when is enabled on BIOS..
>   pci_disable_device function also disable bus mastering for, disable bus mastering
>    is dedicate function.
>
> Signed-off-by: Corcodel Marian <[email-masked]>
> ---
>   drivers/net/ethernet/realtek/r8169.c | 29 ++++++++++++++++++++++++++---
>   1 file changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 02aec96..ec555e7 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
[...]
> @@ -7103,7 +7120,13 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>
>   	rtl_ack_events(tp, 0xffff);
>
> -	pci_set_master(pdev);
> +	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
> +	if (cmd & PCI_COMMAND_MASTER)
> +		tp->bios_support = true;
> +	else {

    Documentation/CodingStyle requites {} on all branches of the *if* 
statement if at least one branch has them.

> +		tp->bios_support = false;
> +		pci_set_master(pdev);
> +	}
>
>   	/*
>   	 * Pretend we are using VLANs; This bypasses a nasty bug where

MBR, Sergei