From: Anton Blanchard <anton@samba.org>
To: linux-scsi@vger.kernel.org
Cc: groudier@free.fr
Subject: Make sym2 driver use pci_enable_device
Date: Tue, 15 Apr 2003 09:32:39 +1000 [thread overview]
Message-ID: <20030414233239.GD2067@krispykreme> (raw)
Hi,
The sym2 driver should use the generic pci_enable_device() and
pci_set_master() functions.
The next step is to use pci_enable_mwi(), however that needs some more
thought. The current code warns of chip bugs requiring MWI to be enabled.
If this is so we should use the generic MWI hook and if that returns an
error we should warn or fail to load. The driver should not be guessing:
#if defined(__i386__) && !defined(MODULE)
if (!cache_line_size && boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
switch(boot_cpu_data.x86) {
case 4: suggested_cache_line_size = 4; break;
case 6: if (boot_cpu_data.x86_model > 8) break;
case 5: suggested_cache_line_size = 8; break;
}
}
#endif /* __i386__ */
Anton
===== sym_glue.c 1.16 vs edited =====
--- 1.16/drivers/scsi/sym53c8xx_2/sym_glue.c Thu Feb 20 23:16:32 2003
+++ edited/sym_glue.c Tue Apr 15 07:06:05 2003
@@ -2562,41 +2561,8 @@
pci_read_config_word(pdev, PCI_COMMAND, &command);
pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_line_size);
- /*
- * Enable missing capabilities in the PCI COMMAND register.
- */
-#ifdef SYM_CONF_IOMAPPED
-#define PCI_COMMAND_BITS_TO_ENABLE (PCI_COMMAND_IO | \
- PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_PARITY)
-#else
-#define PCI_COMMAND_BITS_TO_ENABLE \
- (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_PARITY)
-#endif
- if ((command & PCI_COMMAND_BITS_TO_ENABLE)
- != PCI_COMMAND_BITS_TO_ENABLE) {
- printf_info("%s: setting%s%s%s%s...\n", sym_name(device),
- (command & PCI_COMMAND_IO) ? "" : " PCI_COMMAND_IO",
- (command & PCI_COMMAND_MEMORY) ? "" : " PCI_COMMAND_MEMORY",
- (command & PCI_COMMAND_MASTER) ? "" : " PCI_COMMAND_MASTER",
- (command & PCI_COMMAND_PARITY) ? "" : " PCI_COMMAND_PARITY");
- command |= PCI_COMMAND_BITS_TO_ENABLE;
- pci_write_config_word(pdev, PCI_COMMAND, command);
- }
-#undef PCI_COMMAND_BITS_TO_ENABLE
-
- /*
- * If cache line size is not configured, suggest
- * a value for well known CPUs.
- */
-#if defined(__i386__) && !defined(MODULE)
- if (!cache_line_size && boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
- switch(boot_cpu_data.x86) {
- case 4: suggested_cache_line_size = 4; break;
- case 6: if (boot_cpu_data.x86_model > 8) break;
- case 5: suggested_cache_line_size = 8; break;
- }
- }
-#endif /* __i386__ */
+ pci_enable_device(pdev);
+ pci_set_master(pdev);
/*
* Some features are required to be enabled in order to
next reply other threads:[~2003-04-14 23:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-14 23:32 Anton Blanchard [this message]
2003-04-15 15:41 ` Make sym2 driver use pci_enable_device Anton Blanchard
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=20030414233239.GD2067@krispykreme \
--to=anton@samba.org \
--cc=groudier@free.fr \
--cc=linux-scsi@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