* [PATCH] pata_cmd640: don't read CFR pointlessly
@ 2010-05-08 18:27 Sergei Shtylyov
2010-05-08 21:27 ` Jeff Garzik
2010-05-14 21:32 ` Jeff Garzik
0 siblings, 2 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2010-05-08 18:27 UTC (permalink / raw)
To: jgarzik; +Cc: linux-ide
cmd640_hardware_init() reads CFR but doesn't use the value read...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
The patch is against the recent Linus' tree.
drivers/ata/pata_cmd640.c | 3 ---
1 file changed, 3 deletions(-)
Index: linux-2.6/drivers/ata/pata_cmd640.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_cmd640.c
+++ linux-2.6/drivers/ata/pata_cmd640.c
@@ -181,13 +181,10 @@ static struct ata_port_operations cmd640
static void cmd640_hardware_init(struct pci_dev *pdev)
{
- u8 r;
u8 ctrl;
/* CMD640 detected, commiserations */
pci_write_config_byte(pdev, 0x5B, 0x00);
- /* Get version info */
- pci_read_config_byte(pdev, CFR, &r);
/* PIO0 command cycles */
pci_write_config_byte(pdev, CMDTIM, 0);
/* 512 byte bursts (sector) */
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pata_cmd640: don't read CFR pointlessly
2010-05-08 18:27 [PATCH] pata_cmd640: don't read CFR pointlessly Sergei Shtylyov
@ 2010-05-08 21:27 ` Jeff Garzik
2010-05-08 21:38 ` Sergei Shtylyov
2010-05-14 21:32 ` Jeff Garzik
1 sibling, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2010-05-08 21:27 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-ide
On 05/08/2010 02:27 PM, Sergei Shtylyov wrote:
> cmd640_hardware_init() reads CFR but doesn't use the value read...
>
> Signed-off-by: Sergei Shtylyov<sshtylyov@ru.mvista.com>
>
> ---
> The patch is against the recent Linus' tree.
>
> drivers/ata/pata_cmd640.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> Index: linux-2.6/drivers/ata/pata_cmd640.c
> ===================================================================
> --- linux-2.6.orig/drivers/ata/pata_cmd640.c
> +++ linux-2.6/drivers/ata/pata_cmd640.c
> @@ -181,13 +181,10 @@ static struct ata_port_operations cmd640
>
> static void cmd640_hardware_init(struct pci_dev *pdev)
> {
> - u8 r;
> u8 ctrl;
>
> /* CMD640 detected, commiserations */
> pci_write_config_byte(pdev, 0x5B, 0x00);
> - /* Get version info */
> - pci_read_config_byte(pdev, CFR,&r);
> /* PIO0 command cycles */
Agreed with this patch, but we lose some information: all that remains
is an uncommented 'CFR' definition. Without the code comment, which is
deleted in this patch, we have no idea what that register does. Given
that the chipset docs are not public AFAIK, this is a net loss of
information about this chipset, IMO.
Maybe revise this patch, or add a second patch, which adds a comment
where 'CFR' is defined? Something as simple as "/* version info */"
would be sufficient.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pata_cmd640: don't read CFR pointlessly
2010-05-08 21:27 ` Jeff Garzik
@ 2010-05-08 21:38 ` Sergei Shtylyov
2010-05-08 21:44 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2010-05-08 21:38 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Sergei Shtylyov, linux-ide
Hello.
Jeff Garzik wrote:
>> cmd640_hardware_init() reads CFR but doesn't use the value read...
>>
>> Signed-off-by: Sergei Shtylyov<sshtylyov@ru.mvista.com>
>>
>> ---
>> The patch is against the recent Linus' tree.
>>
>> drivers/ata/pata_cmd640.c | 3 ---
>> 1 file changed, 3 deletions(-)
>>
>> Index: linux-2.6/drivers/ata/pata_cmd640.c
>> ===================================================================
>> --- linux-2.6.orig/drivers/ata/pata_cmd640.c
>> +++ linux-2.6/drivers/ata/pata_cmd640.c
>> @@ -181,13 +181,10 @@ static struct ata_port_operations cmd640
>>
>> static void cmd640_hardware_init(struct pci_dev *pdev)
>> {
>> - u8 r;
>> u8 ctrl;
>>
>> /* CMD640 detected, commiserations */
>> pci_write_config_byte(pdev, 0x5B, 0x00);
>> - /* Get version info */
>> - pci_read_config_byte(pdev, CFR,&r);
>> /* PIO0 command cycles */
>
> Agreed with this patch, but we lose some information: all that
> remains is an uncommented 'CFR' definition. Without the code comment,
> which is deleted in this patch, we have no idea what that register does.
It does several different things.
> Given that the chipset docs are not public AFAIK,
They were public once. And I think I've given you that spec along
with other PCI-64x specs for publishing on
gkernel.sourceforge.net/specs/ already (can't open
sii/cmd64x-specs.tar.bz2 now to check).
> this is a net loss of information about this chipset, IMO.
>
> Maybe revise this patch, or add a second patch, which adds a comment
> where 'CFR' is defined? Something as simple as "/* version info */"
> would be sufficient.
That wouldn't be a good description. The "official" name of the
register is configuration register.
> Jeff
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pata_cmd640: don't read CFR pointlessly
2010-05-08 21:38 ` Sergei Shtylyov
@ 2010-05-08 21:44 ` Jeff Garzik
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2010-05-08 21:44 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Sergei Shtylyov, linux-ide
On 05/08/2010 05:38 PM, Sergei Shtylyov wrote:
> They were public once. And I think I've given you that spec along with
> other PCI-64x specs for publishing on gkernel.sourceforge.net/specs/
> already (can't open sii/cmd64x-specs.tar.bz2 now to check).
Based on this, I retract my comment. Will apply patch as-is.
cmd64x-specs.tar was missing from my local doc archive, and I naively
assumed everything in my public doc archive (gkernel.sf.net/specs/) was
also stored locally.
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pata_cmd640: don't read CFR pointlessly
2010-05-08 18:27 [PATCH] pata_cmd640: don't read CFR pointlessly Sergei Shtylyov
2010-05-08 21:27 ` Jeff Garzik
@ 2010-05-14 21:32 ` Jeff Garzik
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2010-05-14 21:32 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-ide
On 05/08/2010 02:27 PM, Sergei Shtylyov wrote:
> cmd640_hardware_init() reads CFR but doesn't use the value read...
>
> Signed-off-by: Sergei Shtylyov<sshtylyov@ru.mvista.com>
>
> ---
> The patch is against the recent Linus' tree.
>
> drivers/ata/pata_cmd640.c | 3 ---
> 1 file changed, 3 deletions(-)
applied
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-14 21:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-08 18:27 [PATCH] pata_cmd640: don't read CFR pointlessly Sergei Shtylyov
2010-05-08 21:27 ` Jeff Garzik
2010-05-08 21:38 ` Sergei Shtylyov
2010-05-08 21:44 ` Jeff Garzik
2010-05-14 21:32 ` Jeff Garzik
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).