From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface
Date: Tue, 10 Jun 2008 22:50:59 +0200 [thread overview]
Message-ID: <20080610205059.18469.44856.sendpatchset@localhost.localdomain> (raw)
Register secondary interface also when user requested not to probe devices.
While at it:
- remove write-only second_port_toggled variable
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/pci/cmd640.c | 51 +++++++++++++++++++----------------------------
1 file changed, 21 insertions(+), 30 deletions(-)
Index: b/drivers/ide/pci/cmd640.c
===================================================================
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -687,9 +687,6 @@ static int cmd640x_init_one(unsigned lon
*/
static int __init cmd640x_init(void)
{
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
- int second_port_toggled = 0;
-#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
int second_port_cmd640 = 0, rc;
const char *bus_type, *port2;
unsigned int index;
@@ -778,46 +775,40 @@ static int __init cmd640x_init(void)
put_cmd640_reg(CMDTIM, 0);
put_cmd640_reg(BRST, 0x40);
- cmd_hwif1 = ide_find_port();
+ b = get_cmd640_reg(CNTRL);
/*
* Try to enable the secondary interface, if not already enabled
*/
- if (cmd_hwif1 &&
- cmd_hwif1->drives[0].noprobe && cmd_hwif1->drives[1].noprobe) {
- port2 = "not probed";
+ if (secondary_port_responding()) {
+ if ((b & CNTRL_ENA_2ND)) {
+ second_port_cmd640 = 1;
+ port2 = "okay";
+ } else if (cmd640_vlb) {
+ second_port_cmd640 = 1;
+ port2 = "alive";
+ } else
+ port2 = "not cmd640";
} else {
- b = get_cmd640_reg(CNTRL);
+ put_cmd640_reg(CNTRL, b ^ CNTRL_ENA_2ND); /* toggle the bit */
if (secondary_port_responding()) {
- if ((b & CNTRL_ENA_2ND)) {
- second_port_cmd640 = 1;
- port2 = "okay";
- } else if (cmd640_vlb) {
- second_port_cmd640 = 1;
- port2 = "alive";
- } else
- port2 = "not cmd640";
+ second_port_cmd640 = 1;
+ port2 = "enabled";
} else {
- put_cmd640_reg(CNTRL, b ^ CNTRL_ENA_2ND); /* toggle the bit */
- if (secondary_port_responding()) {
- second_port_cmd640 = 1;
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
- second_port_toggled = 1;
-#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
- port2 = "enabled";
- } else {
- put_cmd640_reg(CNTRL, b); /* restore original setting */
- port2 = "not responding";
- }
+ put_cmd640_reg(CNTRL, b); /* restore original setting */
+ port2 = "not responding";
}
}
/*
* Initialize data for secondary cmd640 port, if enabled
*/
- if (second_port_cmd640 && cmd_hwif1) {
- ide_init_port_hw(cmd_hwif1, &hw[1]);
- idx[1] = cmd_hwif1->index;
+ if (second_port_cmd640) {
+ cmd_hwif1 = ide_find_port();
+ if (cmd_hwif1) {
+ ide_init_port_hw(cmd_hwif1, &hw[1]);
+ idx[1] = cmd_hwif1->index;
+ }
}
printk(KERN_INFO "cmd640: %sserialized, secondary interface %s\n",
second_port_cmd640 ? "" : "not ", port2);
next reply other threads:[~2008-06-10 20:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 20:50 Bartlomiej Zolnierkiewicz [this message]
2008-06-10 20:51 ` [PATCH 02/14] ide: ->port_init_devs -> ->init_dev Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 03/14] cmd640: add ->init_dev method Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 04/14] rapide: use struct ide_port_info Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 05/14] ide-h8300: " Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 06/14] ide_platform: " Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 07/14] ide: print message on error in ide_find_port_slot() Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 08/14] ide-h8300: print driver banner message early Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 09/14] ide-pnp: " Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 10/14] ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 11/14] ide: remove superfluous BUG_ON() from set_geometry_intr() Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 12/14] ide: remove needless includes from ide.c Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 13/14] ide: remove needless includes from ide-taskfile.c Bartlomiej Zolnierkiewicz
2008-06-10 20:53 ` [PATCH 14/14] ide: remove needless includes from setup-pci.c Bartlomiej Zolnierkiewicz
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=20080610205059.18469.44856.sendpatchset@localhost.localdomain \
--to=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.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).