mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.4.20/drivers/ide/pdc202xx.c
@ 2002-12-23 22:35 Nikolai Zhubr
  2002-12-25 21:29 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolai Zhubr @ 2002-12-23 22:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: Marcelo Tosatti

Hi, this patch fixes misdetection of 80-pin vs 40-pin IDE cable
connected to Promise 202xx IDE controller (kernel 2.4.20). The original
code used hwif->dma_base field which is yet unset upon the call,
therefore some random value was returned. The patch came out of reading
2.5.xx code. I've tested it with both 40pin and 80pin cables, pdc20276
controller. I'm not subscribed, please CC me if necessary. Thank you.

diff -u --recursive linux-2.4.20/drivers/ide/pdc202xx.c linux-2.4.20-zh/drivers/ide/pdc202xx.c
--- linux-2.4.20/drivers/ide/pdc202xx.c Sat Aug  3 04:39:44 2002
+++ linux-2.4.20-zh/drivers/ide/pdc202xx.c      Mon Dec 23 21:32:53 2002
@@ -1121,6 +1121,10 @@
 {
        unsigned short mask = (hwif->channel) ? (1<<11) : (1<<10);
        unsigned short CIS;
+       struct pci_dev *dev     = hwif->pci_dev;
+       unsigned long high_16   = pci_resource_start(dev, 4);
+       unsigned long indexreg  = high_16 + (hwif->channel ? 0x09 : 0x01);
+       unsigned long datareg   = (indexreg + 2);
 
                switch(hwif->pci_dev->device) {
                case PCI_DEVICE_ID_PROMISE_20276:
@@ -1128,8 +1132,8 @@
                case PCI_DEVICE_ID_PROMISE_20269:
                case PCI_DEVICE_ID_PROMISE_20268:
                case PCI_DEVICE_ID_PROMISE_20270:
-                       OUT_BYTE(0x0b, (hwif->dma_base + 1));
-                       return (!(IN_BYTE((hwif->dma_base + 3)) & 0x04));
+                       OUT_BYTE(0x0b, indexreg);
+                       return (!(IN_BYTE(datareg) & 0x04));
                        /* check 80pin cable */
                default:
                        pci_read_config_word(hwif->pci_dev, 0x50, &CIS);
-- 
Best regards,
 Nikolai Zhubr



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] 2.4.20/drivers/ide/pdc202xx.c
  2002-12-23 22:35 [PATCH] 2.4.20/drivers/ide/pdc202xx.c Nikolai Zhubr
@ 2002-12-25 21:29 ` Alan Cox
  2002-12-26 12:06   ` Tomas Szepe
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2002-12-25 21:29 UTC (permalink / raw)
  To: Nikolai Zhubr; +Cc: Linux Kernel Mailing List, Marcelo Tosatti

On Mon, 2002-12-23 at 22:35, Nikolai Zhubr wrote:
> Hi, this patch fixes misdetection of 80-pin vs 40-pin IDE cable
> connected to Promise 202xx IDE controller (kernel 2.4.20). The original

2.4.21pre updates the IDE massively. This should already be fixed


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] 2.4.20/drivers/ide/pdc202xx.c
  2002-12-25 21:29 ` Alan Cox
@ 2002-12-26 12:06   ` Tomas Szepe
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Szepe @ 2002-12-26 12:06 UTC (permalink / raw)
  To: Alan Cox; +Cc: Nikolai Zhubr, Linux Kernel Mailing List, Marcelo Tosatti

> On Mon, 2002-12-23 at 22:35, Nikolai Zhubr wrote:
> > Hi, this patch fixes misdetection of 80-pin vs 40-pin IDE cable
> > connected to Promise 202xx IDE controller (kernel 2.4.20). The original
> 
> 2.4.21pre updates the IDE massively. This should already be fixed

Well it's fixed but a new bug has been introduced.  2.4.21-pre2 won't
let you set UDMA3+ on the secondary channel of a PDC20268 no matter what,
even ide1=ata66 is no use.

-- 
Tomas Szepe <szepe@pinerecords.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-26 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-23 22:35 [PATCH] 2.4.20/drivers/ide/pdc202xx.c Nikolai Zhubr
2002-12-25 21:29 ` Alan Cox
2002-12-26 12:06   ` Tomas Szepe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome