diff mbox

ide: hpt366: fix incorrect mask when checking at cmd_high_time

Message ID 1468321179-7647-1-git-send-email-colin.king@canonical.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Colin Ian King July 12, 2016, 10:59 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

According to the HPT366 data sheet, PCI config space dword 0x40-0x43
bits 11:8 specify the primary drive cmd_high_time, however,
currently just 3 bits of the 4 are being used because the mask
is 0x07 and not 0x0f.  Fix the mask, allowing for the 40MHz clock
to be detected.

Also add in missing space between switch and parenthesis to clean
up a checkpatch warning.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/ide/hpt366.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergei Shtylyov July 12, 2016, 11:04 a.m. UTC | #1
On 7/12/2016 1:59 PM, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> According to the HPT366 data sheet, PCI config space dword 0x40-0x43
> bits 11:8 specify the primary drive cmd_high_time, however,
> currently just 3 bits of the 4 are being used because the mask
> is 0x07 and not 0x0f.  Fix the mask, allowing for the 40MHz clock
> to be detected.
>
> Also add in missing space between switch and parenthesis to clean
> up a checkpatch warning.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov July 12, 2016, 11:09 a.m. UTC | #2
On 7/12/2016 2:04 PM, Sergei Shtylyov wrote:

>> From: Colin Ian King <colin.king@canonical.com>
>>
>> According to the HPT366 data sheet, PCI config space dword 0x40-0x43
>> bits 11:8 specify the primary drive cmd_high_time, however,
>> currently just 3 bits of the 4 are being used because the mask
>> is 0x07 and not 0x0f.  Fix the mask, allowing for the 40MHz clock
>> to be detected.
>>
>> Also add in missing space between switch and parenthesis to clean
>> up a checkpatch warning.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

    BTW, drivers/ata/pata_hpt366.c has the same bug...

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Colin Ian King July 12, 2016, 11:10 a.m. UTC | #3
On 12/07/16 12:09, Sergei Shtylyov wrote:
> On 7/12/2016 2:04 PM, Sergei Shtylyov wrote:
> 
>>> From: Colin Ian King <colin.king@canonical.com>
>>>
>>> According to the HPT366 data sheet, PCI config space dword 0x40-0x43
>>> bits 11:8 specify the primary drive cmd_high_time, however,
>>> currently just 3 bits of the 4 are being used because the mask
>>> is 0x07 and not 0x0f.  Fix the mask, allowing for the 40MHz clock
>>> to be detected.
>>>
>>> Also add in missing space between switch and parenthesis to clean
>>> up a checkpatch warning.
>>>
>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>
>> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
>    BTW, drivers/ata/pata_hpt366.c has the same bug...

OK, I'll fix that too in a moment.

> 
> MBR, Sergei
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov July 12, 2016, 11:16 a.m. UTC | #4
On 7/12/2016 2:10 PM, Colin Ian King wrote:

>>>> From: Colin Ian King <colin.king@canonical.com>
>>>>
>>>> According to the HPT366 data sheet, PCI config space dword 0x40-0x43
>>>> bits 11:8 specify the primary drive cmd_high_time, however,
>>>> currently just 3 bits of the 4 are being used because the mask
>>>> is 0x07 and not 0x0f.  Fix the mask, allowing for the 40MHz clock
>>>> to be detected.
>>>>
>>>> Also add in missing space between switch and parenthesis to clean
>>>> up a checkpatch warning.
>>>>
>>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>>
>>> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>>    BTW, drivers/ata/pata_hpt366.c has the same bug...
>
> OK, I'll fix that too in a moment.

    TIA! Don't forget to increment the version though. :-)

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 26, 2016, 10:26 p.m. UTC | #5
From: Colin King <colin.king@canonical.com>
Date: Tue, 12 Jul 2016 11:59:39 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> According to the HPT366 data sheet, PCI config space dword 0x40-0x43
> bits 11:8 specify the primary drive cmd_high_time, however,
> currently just 3 bits of the 4 are being used because the mask
> is 0x07 and not 0x0f.  Fix the mask, allowing for the 40MHz clock
> to be detected.
> 
> Also add in missing space between switch and parenthesis to clean
> up a checkpatch warning.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c
index f94baad..f1dc6b6 100644
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -1012,7 +1012,7 @@  static int init_chipset_hpt366(struct pci_dev *dev)
 		pci_read_config_dword(dev, 0x40, &itr1);
 
 		/* Detect PCI clock by looking at cmd_high_time. */
-		switch((itr1 >> 8) & 0x07) {
+		switch ((itr1 >> 8) & 0x0f) {
 			case 0x09:
 				pci_clk = 40;
 				break;