From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
Cc: linux-ide@vger.kernel.org, David Miller <davem@davemloft.net>,
petkovbb@gmail.com
Subject: Re: [PATCH 1/2] ide-generic: add some notes to clarify probing PCI devices
Date: Tue, 21 Feb 2017 17:21:35 +0100 [thread overview]
Message-ID: <1566626.Q6WeQGxH4p@amdc3058> (raw)
In-Reply-To: <20170221142237.GB11234@giustizia>
Hi,
On Tuesday, February 21, 2017 11:22:37 AM Luiz Carlos Ramos wrote:
> Some inline comments were added in ide-generic, to make clear to
> developers the way probe_mask is managed when PCI IDE devices are
> present.
>
> A not-so-deep analysis of the code could make it is buggy, as it seems
> that if a device is detected, the probing procedure is avoided,
> suggesting some kind of reversed logic.
>
> Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
Looks fine overall, some minor nits below.
> ---
> drivers/ide/ide-generic.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
> index 54d7c4685d23aa5e62ce606e7b994a57bb54b08a..ee11edcdba3170c077381d603918498d79ffa3bb 100644
> --- a/drivers/ide/ide-generic.c
> +++ b/drivers/ide/ide-generic.c
> @@ -96,6 +96,33 @@ static int __init ide_generic_init(void)
> printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" "
> "module parameter for probing all legacy ISA IDE ports\n");
>
> + /* Here the logic seems reversed, but it's not. *primary would
> + * be 1 if there is a device at 0x1f0 and *secondary would be 1
> + * if a device is detected at 0x170.
> + *
> + * However, the main intention here is to not allow PCI IDE devices
> + * using ide-generic unless the user chooses so, as this driver is
> + * designed to support ISA IDE devices mainly.
designed to support legacy ISA IDE devices that don't have chipset specific
support.
> + *
> + * In this case, users are strongly encouraged to use the designated
> + * PCI IDE driver, and not isa-generic.
PCI IDE drivers, and not ide-generic.
> + *
> + * Pure ISA IDE devices OTOH will use ide-generic. In this case, *primary
> + * and *secondary will return from ide_generic_check_pci_legacy_iobases()
> + * with zero (because they are not PCI...), and probe_mask will be set
> + * accordingly (to 0x01, 0x02 or 0x03, depending on which io ports are
> + * present).
> + *
> + * Users would even use ide-generic with such PCI IDE devices, choosing a
Users who would like to use ide-generic with PCI IDE devices (which is not
recommended) should choose a
> + * nonzero value for probe_mask when initializing ide-generic. Using
> + * probe_mask=0x03 is sufficient to make it detect common IDE interfaces
> + * (with primary at 0x1f0 and secondary at 0x170), but in the more
> + * general case, one should set probe_mask to 0x3f to check all possible
> + * io addresses. In this case, it is up to the user the task of checking
IO addresses. When using probe_mask it is up to the user to check
> + * for eventual conflicts between ide-generic and any other driver and
> + * manage those conflicts properly.
> + */
> +
> if (primary == 0)
> probe_mask |= 0x1;
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
prev parent reply other threads:[~2017-02-21 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170221142225epcas5p288f7cd6fa53598a370179edc993a9cf9@epcas5p2.samsung.com>
2017-02-21 14:22 ` [PATCH 1/2] ide-generic: add some notes to clarify probing PCI devices Luiz Carlos Ramos
2017-02-21 16:21 ` Bartlomiej Zolnierkiewicz [this message]
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=1566626.Q6WeQGxH4p@amdc3058 \
--to=b.zolnierkie@samsung.com \
--cc=davem@davemloft.net \
--cc=linux-ide@vger.kernel.org \
--cc=lramos.prof@yahoo.com.br \
--cc=petkovbb@gmail.com \
/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