linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Matthew Whitehead <tedheadster@gmail.com>
Cc: linux-ide@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems
Date: Wed, 30 Nov 2016 14:12:58 +0100	[thread overview]
Message-ID: <1963956.oQHPLFR1eb@amdc3058> (raw)
In-Reply-To: <1480441982-20992-1-git-send-email-tedheadster@gmail.com>


Hi,

On Tuesday, November 29, 2016 12:53:02 PM Matthew Whitehead wrote:
> If there is no PCI bus detected in drivers/ata/pata_legacy.c, it registers all the
> common legacy PATA devices. This includes I/O ports (0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160)
> and also their associated interrupts (14,15,11,10,8,12).
> 
> Unfortunately, on such systems those interrupt lines are at a premium because there is no
> PCI alternative. This patch allows you to disable individual port/interrupt pairs by providing
> a list of ports to skip allocating.
> 
> modprobe pata_legacy ignore_ports=0x1e8,0x168,0x1e0,0x160
> 
> Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
> ---
>  drivers/ata/pata_legacy.c |   32 +++++++++++++++++++++++++-------
>  1 files changed, 25 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
> index 4fe9d21..753c7ce 100644
> --- a/drivers/ata/pata_legacy.c
> +++ b/drivers/ata/pata_legacy.c
> @@ -130,6 +130,8 @@ static struct legacy_data legacy_data[NR_HOST];
>  static struct ata_host *legacy_host[NR_HOST];
>  static int nr_legacy_host;
>  
> +static int ignore_ports[NR_HOST];
> +static int ignore_ports_count;
>  
>  static int probe_all;		/* Set to check all ISA port ranges */
>  static int ht6560a;		/* HT 6560A on primary 1, second 2, both 3 */
> @@ -1168,6 +1170,17 @@ static __init void probe_qdi_vlb(void)
>  	}
>  }
>  
> +int find_port(int port)

this should be static

> +{
> +	int i;
> +	for (i = 0 ; i < ignore_ports_count; i++) {
> +		if (port == ignore_ports[i])
> +			return 1;
> +	}
> +	return 0;
> +}
> +		
> +
>  /**
>   *	legacy_init		-	attach legacy interfaces
>   *
> @@ -1212,17 +1225,22 @@ static __init int legacy_init(void)
>  	if (winbond == 1)
>  		winbond = 0x130;	/* Default port, alt is 1B0 */
>  
> -	if (primary == 0 || all)
> +	if ((primary == 0 || all) && (!find_port(0x1F0)))

extra parentheses are not necessary

>  		legacy_probe_add(0x1F0, 14, UNKNOWN, 0);
> -	if (secondary == 0 || all)
> +	if ((secondary == 0 || all) && (!find_port(0x170)))
>  		legacy_probe_add(0x170, 15, UNKNOWN, 0);

ditto

>  	if (probe_all || !pci_present) {
>  		/* ISA/VLB extra ports */
> -		legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
> -		legacy_probe_add(0x168, 10, UNKNOWN, 0);
> -		legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
> -		legacy_probe_add(0x160, 12, UNKNOWN, 0);
> +
> +		if (!find_port(0x1E0))

I believe it should be 0x1E8

> +			legacy_probe_add(0x1E8, 11, UNKNOWN, 0);
> +		if (!find_port(0x168))
> +			legacy_probe_add(0x168, 10, UNKNOWN, 0);
> +		if (!find_port(0x1E0))
> +			legacy_probe_add(0x1E0, 8, UNKNOWN, 0);
> +		if (!find_port(0x160))
> +			legacy_probe_add(0x160, 12, UNKNOWN, 0);
>  	}
>  
>  	if (opti82c46x)
> @@ -1272,6 +1290,6 @@ module_param(qdi, int, 0);
>  module_param(winbond, int, 0);
>  module_param(pio_mask, int, 0);
>  module_param(iordy_mask, int, 0);
> -
> +module_param_array(ignore_ports, int, &ignore_ports_count, 0444);

please leave a newline before module_init()

>  module_init(legacy_init);
>  module_exit(legacy_exit);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


  parent reply	other threads:[~2016-11-30 13:13 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 17:53 [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Matthew Whitehead
2016-11-29 19:41 ` Tejun Heo
2016-11-29 20:12   ` tedheadster
2016-11-29 20:46     ` Tejun Heo
2016-11-30 13:06       ` Bartlomiej Zolnierkiewicz
2016-11-30 17:13         ` tedheadster
2016-11-30 13:11 ` Sergei Shtylyov
2016-11-30 14:53   ` One Thousand Gnomes
2016-11-30 15:03     ` tedheadster
2016-11-30 18:15       ` One Thousand Gnomes
2016-12-02 13:37         ` tedheadster
2016-12-02 16:24           ` One Thousand Gnomes
2016-11-30 20:22       ` Tejun Heo
     [not found]         ` <CAP8WD_bZWeLBhLXqJG5uDwBe+zBubw+A+ecSuaihOuwvw9QoCQ@mail.gmail.com>
2016-12-02 17:07           ` Tejun Heo
2016-12-05 14:19             ` tedheadster
2016-12-05 19:23               ` Tejun Heo
     [not found]                 ` <CAP8WD_becq+h2=-g7t-6Pp1psmkCCvdB0YUcg+wYPocUP4dYdw@mail.gmail.com>
2016-12-12 17:01                   ` Tejun Heo
     [not found]                     ` <CAP8WD_YMtnsuYmJHGz1eLmrQNemsB1Z6Soyb6f72brAfMNUNeg@mail.gmail.com>
2016-12-20  2:12                       ` tedheadster
2016-12-22 16:37                         ` Tejun Heo
2016-12-22 17:14                           ` tedheadster
2016-12-22 17:19                             ` Tejun Heo
2016-12-22 18:30                             ` tedheadster
2016-12-22 19:22                               ` Tejun Heo
2017-01-03 17:34                                 ` One Thousand Gnomes
     [not found]                                   ` <CAP8WD_bS61spyQkd7cvktFf_dPc0wgNZ8qEa7GVrXgUobHQdvw@mail.gmail.com>
2017-01-19 21:37                                     ` Tejun Heo
2017-01-20 17:08                                       ` tedheadster
2017-01-20 19:19                                         ` Tejun Heo
2017-01-20 19:38                                           ` Tejun Heo
2017-01-23 23:36                                             ` Gwendal Grignou
2017-01-23 23:57                                               ` tedheadster
2017-01-24 16:19                                                 ` Tejun Heo
2017-01-27  3:01                                                   ` tedheadster
2017-02-07 20:21                                                     ` Gwendal Grignou
2017-02-08 19:43                                                       ` Tejun Heo
2017-02-09 23:49                                                         ` Gwendal Grignou
2017-02-10  0:36                                                           ` tedheadster
2017-02-10 13:19                                                             ` Tejun Heo
2017-02-23 19:26                                                               ` tedheadster
2017-03-03 17:00                                                                 ` [PATCH] libata: transport: Remove circular dependency at free time Gwendal Grignou
2017-03-03 18:28                                                                   ` Sergei Shtylyov
2017-03-03 18:36                                                                     ` Tejun Heo
2017-03-06 20:09                                                                   ` Tejun Heo
2017-03-06 20:11                                                                     ` Sergei Shtylyov
2017-03-06 20:26                                                                       ` Tejun Heo
2017-01-24 15:57                                               ` [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Tejun Heo
2016-12-12 12:21               ` Bartlomiej Zolnierkiewicz
2016-11-30 13:12 ` Bartlomiej Zolnierkiewicz [this message]
2016-11-30 13:15 ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1963956.oQHPLFR1eb@amdc3058 \
    --to=b.zolnierkie@samsung.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=tedheadster@gmail.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).