Re: [PATCH treewide 0/9] Remove obsolete IDE headers

2023-08-23 Thread Damien Le Moal
On 8/18/23 01:07, Geert Uytterhoeven wrote:
>   Hi all,
> 
> This patch series removes all unused  headers and
> .   was still included by 3 PATA
> drivers for m68k platforms, but without any real need.
> 
> The first 5 patches have no dependencies.
> The last patch depends on the 3 pata patches.
> 
> Thanks for your comments!
> 
> Geert Uytterhoeven (9):
>   ARM: Remove 
>   parisc: Remove 
>   powerpc: Remove 
>   sparc: Remove 
>   asm-generic: Remove ide_iops.h
>   ata: pata_buddha: Remove #include 
>   ata: pata_falcon: Remove #include 
>   ata: pata_gayle: Remove #include 
>   m68k: Remove 

Applied to libata for-6.6. Thanks !

-- 
Damien Le Moal
Western Digital Research



[PATCH treewide 0/9] Remove obsolete IDE headers

2023-08-17 Thread Geert Uytterhoeven
Hi all,

This patch series removes all unused  headers and
.   was still included by 3 PATA
drivers for m68k platforms, but without any real need.

The first 5 patches have no dependencies.
The last patch depends on the 3 pata patches.

Thanks for your comments!

Geert Uytterhoeven (9):
  ARM: Remove 
  parisc: Remove 
  powerpc: Remove 
  sparc: Remove 
  asm-generic: Remove ide_iops.h
  ata: pata_buddha: Remove #include 
  ata: pata_falcon: Remove #include 
  ata: pata_gayle: Remove #include 
  m68k: Remove 

 arch/arm/include/asm/ide.h | 24 -
 arch/m68k/include/asm/ide.h| 67 ---
 arch/parisc/include/asm/ide.h  | 54 ---
 arch/powerpc/include/asm/ide.h | 18 ---
 arch/sparc/include/asm/ide.h   | 97 --
 drivers/ata/pata_buddha.c  |  1 -
 drivers/ata/pata_falcon.c  |  1 -
 drivers/ata/pata_gayle.c   |  1 -
 include/asm-generic/ide_iops.h | 39 --
 9 files changed, 302 deletions(-)
 delete mode 100644 arch/arm/include/asm/ide.h
 delete mode 100644 arch/m68k/include/asm/ide.h
 delete mode 100644 arch/parisc/include/asm/ide.h
 delete mode 100644 arch/powerpc/include/asm/ide.h
 delete mode 100644 arch/sparc/include/asm/ide.h
 delete mode 100644 include/asm-generic/ide_iops.h

-- 
2.34.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH 00/21] Rid W=1 warnings from IDE

2021-06-16 Thread Christoph Hellwig
On Mon, Jun 14, 2021 at 10:12:28AM +0100, Lee Jones wrote:
> On Mon, 07 Jun 2021, Christoph Hellwig wrote:
> 
> > Please don't touch this code as it is about to be removed entirely.
> 
> Do you have an ETA for this work?

I just resent the series.


Re: [PATCH 00/21] Rid W=1 warnings from IDE

2021-06-14 Thread Lee Jones
On Mon, 07 Jun 2021, Christoph Hellwig wrote:

> Please don't touch this code as it is about to be removed entirely.

Do you have an ETA for this work?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH 00/21] Rid W=1 warnings from IDE

2021-06-07 Thread Christoph Hellwig
Please don't touch this code as it is about to be removed entirely.


[PATCH 21/21] ide: pmac: Staticise local function 'pmac_ide_probe'

2021-06-02 Thread Lee Jones
Fixes the following W=1 kernel build warning(s):

 drivers/ide/pmac.c:1418:12: warning: no previous prototype for 
‘pmac_ide_probe’ [-Wmissing-prototypes]

Cc: "David S. Miller" 
Cc: Michael Ellerman 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linux-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones 
---
 drivers/ide/pmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index ea0b064b5f56b..d51a2e252b6f2 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1415,7 +1415,7 @@ static struct pci_driver pmac_ide_pci_driver = {
 };
 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match);
 
-int __init pmac_ide_probe(void)
+static int __init pmac_ide_probe(void)
 {
int error;
 
-- 
2.31.1



[PATCH 00/21] Rid W=1 warnings from IDE

2021-06-02 Thread Lee Jones
This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Lee Jones (21):
  ide: alim15x3: Document alim15x3_init_one()'s 'id' param
  ide: ide-dma: Document ide_dma_unmap_sg()'s missing 'cmd' param
  ide: ide-dma-sff: Provide some missing 'param' descriptions
  ide: ide-io: Fix a few kernel-doc misdemeanours
  ide: ide-proc: Strip out unused fops structure and accompanying
call-back
  ide: cs5530: Fix incorrect documentation for function
init_chipset_cs5530()
  ide: ide-probe: Fix-up incorrectly documented function
probe_for_drive()
  ide: hpt366: Provide some missing descriptions for 'f_{low,high}'
  ide: piix: Remove unused variable 'sitre'
  ide: pdc202xx_new: Supply missing description for 'set_indexed_reg()'s
'value' param
  ide: slc90e66: Remove unused variable 'sitre'
  ide: it821x: Fix a couple of incorrectly documented functions
  ide: siimage: Fix some incorrectly documented functions/params
  ide: via82cxxx: Fix misdocumentation of via_set_speed()'s 'hwif' param
  ide: ide-cd_ioctl: Remove unused variable 'stat'
  ide: ide-cd: Demote kernel-doc abuse
  ide: ide-acpi: Mark debugging variable 'bus' as __maybe_unused
  ide: ide-io: Document ide_intr()'s param 'irq'
  ide: piix: Fix incorrectly documented param 'hwif'
  ide: ide-acpi: Provide missing description for param 'obj_loc'
  ide: pmac: Staticise local function 'pmac_ide_probe'

 drivers/ide/alim15x3.c |  1 +
 drivers/ide/cs5530.c   |  2 +-
 drivers/ide/hpt366.c   |  2 ++
 drivers/ide/ide-acpi.c |  4 +++-
 drivers/ide/ide-cd.c   |  2 +-
 drivers/ide/ide-cd_ioctl.c |  3 +--
 drivers/ide/ide-dma-sff.c  |  4 
 drivers/ide/ide-dma.c  |  1 +
 drivers/ide/ide-io.c   |  9 +
 drivers/ide/ide-probe.c|  2 +-
 drivers/ide/ide-proc.c | 13 -
 drivers/ide/it821x.c   |  4 ++--
 drivers/ide/pdc202xx_new.c |  1 +
 drivers/ide/piix.c |  4 +---
 drivers/ide/pmac.c |  2 +-
 drivers/ide/siimage.c  |  4 ++--
 drivers/ide/slc90e66.c |  3 +--
 drivers/ide/via82cxxx.c|  2 +-
 18 files changed, 29 insertions(+), 34 deletions(-)

Cc: Adrian Sun 
Cc: Alan Cox 
Cc: Andre Hedrick 
Cc: Benjamin Herrenschmidt 
Cc: Benoit Poulot-Cazajous 
Cc: Christian Brunner 
Cc: "Christopher J. Reimer" 
Cc: CJ 
Cc: Clear Zhang 
Cc: "David S. Miller" 
Cc: Duncan Laurie 
Cc: Erik Andersen 
Cc: Frank Tiernan 
Cc: Gadi Oxman 
Cc: Jens Axboe 
Cc: linux-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Mark Lord 
Cc: Michael Ellerman 
Cc: Mike Waychison 
Cc: or 
Cc: Paul Mackerras 
Cc: Robert Bringman 
Cc: Scott Snyder 
Cc: Sergei Shtylyov 
Cc: "Software, Inc" 
Cc: support to 
Cc: Tim Hockin 
-- 
2.31.1



Re: [PATCH 05/10] MIPS: switch workpad_defconfig from legacy IDE to libata

2021-03-24 Thread Thomas Bogendoerfer
On Thu, Mar 18, 2021 at 05:57:01AM +0100, Christoph Hellwig wrote:
> Use libata instead of the deprecated legacy ide driver in
> workpad_defconfig.
> 
> Signed-off-by: Christoph Hellwig 
> ---
>  arch/mips/configs/workpad_defconfig | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.[ RFC1925, 2.3 ]


Re: remove the legacy ide driver

2021-03-21 Thread John Paul Adrian Glaubitz
Hello Christoph!

On 3/18/21 5:56 AM, Christoph Hellwig wrote:
> libata mostly covers all hardware supported by the legacy ide driver.
> There are three mips drivers that are not supported, but the linux-mips
> list could not identify any users of those.  There also are two m68k
> drivers that do not have libata equivalents, which might or might not
> have users, so we'll need some input and possibly help from the m68k
> community here.

I think those drivers were the Q60 driver and the MacIDE driver, weren't they?

Either way, I have so far been unsuccessful in obtaining access to these 
machines
but I assume once we gain access to such machines, Bartlomiej could convert the
drivers the same way he already converted the falcon, gayle and buddha drivers,
for example.

One could also just convert the drivers to libata and include them untested, the
conversion itself seems pretty little work for someone experienced with libata.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: [PATCH 10/10] ide: remove the legacy ide driver

2021-03-19 Thread Maciej W. Rozycki
On Sat, 20 Mar 2021, Maciej W. Rozycki wrote:

> > been scheduled for removal for a while.  Finally kill it off so that we
> > can start cleaning up various bits of cruft it forced on the block layer.
> 
>  You need to adjust Documentation/admin-guide/kernel-parameters.txt too, 
> i.e. remove all the `ide*' options, possibly more (I haven't checked in 
> detail).

 And also Documentation/ide/ide.rst.  Also do we have all the necessary 
`hdparm' features supported in libata nowadays for PATA devices?

  Maciej


Re: [PATCH 10/10] ide: remove the legacy ide driver

2021-03-19 Thread Maciej W. Rozycki
On Thu, 18 Mar 2021, Christoph Hellwig wrote:

> The legay ide driver has been replace with libata startin in 2003 and has

 s/legay/legacy/;s/replace/replaced/;s/startin/startin/ (though I'd say 
"back in" instead in the latter case).

> been scheduled for removal for a while.  Finally kill it off so that we
> can start cleaning up various bits of cruft it forced on the block layer.

 You need to adjust Documentation/admin-guide/kernel-parameters.txt too, 
i.e. remove all the `ide*' options, possibly more (I haven't checked in 
detail).

  Maciej


Re: remove the legacy ide driver

2021-03-19 Thread Maciej W. Rozycki
On Thu, 18 Mar 2021, Christoph Hellwig wrote:

> we've been trying to get rid of the legacy ide driver for a while now,
> and finally scheduled a removal for 2021, which is three month old now.

 Hmm, there's still a regression in that pata_legacy unconditionally pokes 
at random I/O port locations corresponding to all the known possible ATA 
interface mappings with ISA option cards:

scsi host0: pata_legacy
ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
ata1.00: ATA-4: ST310211A, 3.54, max UDMA/100
ata1.00: 19541088 sectors, multi 16: LBA
ata1.00: configured for PIO
scsi 0:0:0:0: Direct-Access ATA  ST310211A3.54 PQ: 0 ANSI: 5
scsi 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] 19541088 512-byte logical blocks: (10.0 GB/9.32 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't 
support DPO or FUA
 sda: sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
scsi host1: pata_legacy
ata2: PATA max PIO4 cmd 0x170 ctl 0x376 irq 15
scsi host1: pata_legacy
ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
scsi host1: pata_legacy
ata4: PATA max PIO4 cmd 0x168 ctl 0x36e irq 10
scsi host1: pata_legacy
ata5: PATA max PIO4 cmd 0x1e0 ctl 0x3e6 irq 8
scsi host1: pata_legacy
ata6: PATA max PIO4 cmd 0x160 ctl 0x366 irq 12

This seems needlessly dangerous to me.  With the old IDE driver I could 
(and did) specify "ide_generic.probe_mask=1" to avoid this clutter (the 
ISA card used with this system has a single ATA port only).

 I guess it's easy to fix by carrying the `probe_mask' parameter over and 
I think we'd rather wait with the removal of the IDE subsystem until we 
have a release with this option supported.  I may look into it unless 
someone beats me to it.

 Overall I find it rather disturbing that nobody has noticed this issue 
over all these years.

 NB it is only earlier this year that I recovered this system from a PSU 
failure several years ago, which took the disk the system previously had 
with it, so myself I had no chance to get at it any earlier, though I did 
mean to have a look as soon as I saw the notice about the scheduled IDE 
removal.

  Maciej


Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-19 Thread Serge Belyshev
Al Viro  writes:

> ...
>
> Do you have reports of libata variants of drivers actually tested on
> those?

PATA_CMD64X works fine on my 164LX for many years, last tested with 5.12-rc3.

(with a caveat: in my setup with CF card DMA is broken, but it is broken
with BLK_DEV_CMD64X as well).


Re: remove the legacy ide driver

2021-03-18 Thread Christoph Hellwig
On Fri, Mar 19, 2021 at 12:43:48PM +1100, Finn Thain wrote:
> A few months ago I wrote another patch to move some more platforms away 
> from macide but it has not been tested yet. That is not to say you should 
> wait. However, my patch does have some changes that are missing from your 
> patch series, relating to ide platform devices in arch/m68k/mac/config.c. 
> I hope to be able to test this patch before the 5.13 merge window closes.

Normally we do not remove drivers for hardware that is still used.  So
at leat for macide my plan was not to take it away unless the users 
are sufficiently happy.  Or in other words:  I think waiting it the
right choice, but hopefully we can make that wait as short as possible.


Re: remove the legacy ide driver

2021-03-18 Thread Finn Thain
On Thu, 18 Mar 2021, Christoph Hellwig wrote:

> Hi all,
> 
> we've been trying to get rid of the legacy ide driver for a while now,
> and finally scheduled a removal for 2021, which is three month old now.
> 
> In general distros and most defconfigs have switched to libata long ago,
> but there are a few exceptions.  This series first switches over all
> remaining defconfigs to use libata and then removes the legacy ide
> driver.
> 
> libata mostly covers all hardware supported by the legacy ide driver.
> There are three mips drivers that are not supported, but the linux-mips
> list could not identify any users of those.  There also are two m68k
> drivers that do not have libata equivalents, which might or might not
> have users, so we'll need some input and possibly help from the m68k
> community here.
> 

A few months ago I wrote another patch to move some more platforms away 
from macide but it has not been tested yet. That is not to say you should 
wait. However, my patch does have some changes that are missing from your 
patch series, relating to ide platform devices in arch/m68k/mac/config.c. 
I hope to be able to test this patch before the 5.13 merge window closes.


Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-18 Thread Måns Rullgård
Måns Rullgård  writes:

> Christoph Hellwig  writes:
>
>> On Thu, Mar 18, 2021 at 05:54:55AM +, Al Viro wrote:
>>> On Thu, Mar 18, 2021 at 05:56:57AM +0100, Christoph Hellwig wrote:
>>> > Switch the alpha defconfig from the legacy ide driver to libata.
>>> 
>>> Umm...  I don't have an IDE alpha box in a usable shape (fans on
>>> CPU module shat themselves), and it would take a while to resurrect
>>> it, but I remember the joy it used to cause in some versions.
>>> 
>>> Do you have reports of libata variants of drivers actually tested on
>>> those?
>>
>> No, I haven't.  The whole point is that we're not going to keep 4
>> lines of code around despite notice for users that don't exist or
>> care.  If there is a regression we'll fix it, but we're not going to
>> make life miserable just because we can.
>
> The pata_ali driver works fine on my UP1500 machine, unless something
> broke recently.  I'll build the latest kernel and report back.

5.11.7 seems fine too.

-- 
Måns Rullgård


Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-18 Thread Måns Rullgård
Christoph Hellwig  writes:

> On Thu, Mar 18, 2021 at 05:54:55AM +, Al Viro wrote:
>> On Thu, Mar 18, 2021 at 05:56:57AM +0100, Christoph Hellwig wrote:
>> > Switch the alpha defconfig from the legacy ide driver to libata.
>> 
>> Umm...  I don't have an IDE alpha box in a usable shape (fans on
>> CPU module shat themselves), and it would take a while to resurrect
>> it, but I remember the joy it used to cause in some versions.
>> 
>> Do you have reports of libata variants of drivers actually tested on
>> those?
>
> No, I haven't.  The whole point is that we're not going to keep 4
> lines of code around despite notice for users that don't exist or
> care.  If there is a regression we'll fix it, but we're not going to
> make life miserable just because we can.

The pata_ali driver works fine on my UP1500 machine, unless something
broke recently.  I'll build the latest kernel and report back.

-- 
Måns Rullgård


Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-18 Thread John Paul Adrian Glaubitz
Hi Al!

On 3/18/21 6:54 AM, Al Viro wrote:
> On Thu, Mar 18, 2021 at 05:56:57AM +0100, Christoph Hellwig wrote:
>> Switch the alpha defconfig from the legacy ide driver to libata.
> 
> Umm...  I don't have an IDE alpha box in a usable shape (fans on
> CPU module shat themselves), and it would take a while to resurrect
> it, but I remember the joy it used to cause in some versions.
> 
> Do you have reports of libata variants of drivers actually tested on
> those?

At least pata_cypress works fine on my AlphaStation XP1000:

root@tsunami:~> lspci
:00:07.0 ISA bridge: Contaq Microsystems 82c693
:00:07.1 IDE interface: Contaq Microsystems 82c693
:00:07.2 IDE interface: Contaq Microsystems 82c693
:00:07.3 USB controller: Contaq Microsystems 82c693
:00:0d.0 VGA compatible controller: Texas Instruments TVP4020 [Permedia 2] 
(rev 01)
0001:01:03.0 Ethernet controller: Digital Equipment Corporation DECchip 
21142/43 (rev 41)
0001:01:06.0 SCSI storage controller: QLogic Corp. ISP1020 Fast-wide SCSI (rev 
06)
0001:01:08.0 PCI bridge: Digital Equipment Corporation DECchip 21152 (rev 03)
0001:02:09.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet 
Controller (rev 05)
root@tsunami:~> lsmod|grep pata
pata_cypress3595  3
libata235071  2 ata_generic,pata_cypress
root@tsunami:~>

I also have two AlphaStation 233 currently in storage which I assume use
different IDE chipset which I could test as well.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-18 Thread Christoph Hellwig
On Thu, Mar 18, 2021 at 05:54:55AM +, Al Viro wrote:
> On Thu, Mar 18, 2021 at 05:56:57AM +0100, Christoph Hellwig wrote:
> > Switch the alpha defconfig from the legacy ide driver to libata.
> 
> Umm...  I don't have an IDE alpha box in a usable shape (fans on
> CPU module shat themselves), and it would take a while to resurrect
> it, but I remember the joy it used to cause in some versions.
> 
> Do you have reports of libata variants of drivers actually tested on
> those?

No, I haven't.  The whole point is that we're not going to keep 4
lines of code around despite notice for users that don't exist or
care.  If there is a regression we'll fix it, but we're not going to
make life miserable just because we can.


Re: [PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-18 Thread Al Viro
On Thu, Mar 18, 2021 at 05:56:57AM +0100, Christoph Hellwig wrote:
> Switch the alpha defconfig from the legacy ide driver to libata.

Umm...  I don't have an IDE alpha box in a usable shape (fans on
CPU module shat themselves), and it would take a while to resurrect
it, but I remember the joy it used to cause in some versions.

Do you have reports of libata variants of drivers actually tested on
those?


[PATCH 09/10] m68k: use libata instead of the legacy ide driver

2021-03-17 Thread Christoph Hellwig
Switch the m68 defconfigs from the deprecated ide subsystem to use libata
instead.  The gayle and buddha and falcon drivers are enabled for libata,
while support for the q40 and macide drivers is lost.

Signed-off-by: Christoph Hellwig 
---
 arch/m68k/configs/amiga_defconfig | 10 +-
 arch/m68k/configs/atari_defconfig |  8 
 arch/m68k/configs/mac_defconfig   |  5 -
 arch/m68k/configs/multi_defconfig | 15 ++-
 arch/m68k/configs/q40_defconfig   |  4 
 5 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/arch/m68k/configs/amiga_defconfig 
b/arch/m68k/configs/amiga_defconfig
index 786656090c5029..fba7275de0fb5f 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -323,11 +323,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
 CONFIG_DUMMY_IRQ=m
-CONFIG_IDE=y
-CONFIG_IDE_GD_ATAPI=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_BLK_DEV_GAYLE=y
-CONFIG_BLK_DEV_BUDDHA=y
 CONFIG_RAID_ATTRS=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
@@ -344,6 +339,11 @@ CONFIG_GVP11_SCSI=y
 CONFIG_SCSI_A4000T=y
 CONFIG_SCSI_ZORRO7XX=y
 CONFIG_SCSI_ZORRO_ESP=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_ATA_BMDMA is not set
+CONFIG_PATA_GAYLE=y
+CONFIG_PATA_BUDDHA=y
 CONFIG_MD=y
 CONFIG_MD_LINEAR=m
 CONFIG_BLK_DEV_DM=m
diff --git a/arch/m68k/configs/atari_defconfig 
b/arch/m68k/configs/atari_defconfig
index 413232626d9d57..235d038be9 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -324,10 +324,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
 CONFIG_DUMMY_IRQ=m
-CONFIG_IDE=y
-CONFIG_IDE_GD_ATAPI=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_BLK_DEV_FALCON_IDE=y
 CONFIG_RAID_ATTRS=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
@@ -339,6 +335,10 @@ CONFIG_SCSI_SAS_ATTRS=m
 CONFIG_ISCSI_TCP=m
 CONFIG_ISCSI_BOOT_SYSFS=m
 CONFIG_ATARI_SCSI=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_ATA_BMDMA is not set
+CONFIG_PATA_FALCON=y
 CONFIG_MD=y
 CONFIG_MD_LINEAR=m
 CONFIG_BLK_DEV_DM=m
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index bf15e6c1c939bb..cc92cc4601cb1f 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -315,11 +315,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
 CONFIG_DUMMY_IRQ=m
-CONFIG_IDE=y
-CONFIG_IDE_GD_ATAPI=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_BLK_DEV_PLATFORM=y
-CONFIG_BLK_DEV_MAC_IDE=y
 CONFIG_RAID_ATTRS=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
diff --git a/arch/m68k/configs/multi_defconfig 
b/arch/m68k/configs/multi_defconfig
index 5466d48fcd9d51..9be9f2ad4ddb84 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -344,15 +344,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
 CONFIG_DUMMY_IRQ=m
-CONFIG_IDE=y
-CONFIG_IDE_GD_ATAPI=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_BLK_DEV_PLATFORM=y
-CONFIG_BLK_DEV_GAYLE=y
-CONFIG_BLK_DEV_BUDDHA=y
-CONFIG_BLK_DEV_FALCON_IDE=y
-CONFIG_BLK_DEV_MAC_IDE=y
-CONFIG_BLK_DEV_Q40IDE=y
 CONFIG_RAID_ATTRS=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
@@ -376,6 +367,12 @@ CONFIG_MVME147_SCSI=y
 CONFIG_MVME16x_SCSI=y
 CONFIG_BVME6000_SCSI=y
 CONFIG_SUN3X_ESP=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_ATA_BMDMA is not set
+CONFIG_PATA_FALCON=y
+CONFIG_PATA_GAYLE=y
+CONFIG_PATA_BUDDHA=y
 CONFIG_MD=y
 CONFIG_MD_LINEAR=m
 CONFIG_BLK_DEV_DM=m
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig
index 3ae421cb24a439..ac35e448b1c58f 100644
--- a/arch/m68k/configs/q40_defconfig
+++ b/arch/m68k/configs/q40_defconfig
@@ -314,10 +314,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_ATA_OVER_ETH=m
 CONFIG_DUMMY_IRQ=m
-CONFIG_IDE=y
-CONFIG_IDE_GD_ATAPI=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_BLK_DEV_Q40IDE=y
 CONFIG_RAID_ATTRS=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
-- 
2.30.1



[PATCH 05/10] MIPS: switch workpad_defconfig from legacy IDE to libata

2021-03-17 Thread Christoph Hellwig
Use libata instead of the deprecated legacy ide driver in
workpad_defconfig.

Signed-off-by: Christoph Hellwig 
---
 arch/mips/configs/workpad_defconfig | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/mips/configs/workpad_defconfig 
b/arch/mips/configs/workpad_defconfig
index 891a5f77305da1..4798dc86c9ceaf 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -26,9 +26,12 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_IPV6 is not set
 CONFIG_NETWORK_SECMARK=y
 CONFIG_BLK_DEV_RAM=m
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECS=m
-CONFIG_IDE_GENERIC=y
+# CONFIG_SCSI_PROC_FS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_ATA_FORCE is not set
+# CONFIG_ATA_BMDMA is not set
 CONFIG_NETDEVICES=y
 CONFIG_PCMCIA_3C574=m
 CONFIG_PCMCIA_3C589=m
-- 
2.30.1



remove the legacy ide driver

2021-03-17 Thread Christoph Hellwig
Hi all,

we've been trying to get rid of the legacy ide driver for a while now,
and finally scheduled a removal for 2021, which is three month old now.

In general distros and most defconfigs have switched to libata long ago,
but there are a few exceptions.  This series first switches over all
remaining defconfigs to use libata and then removes the legacy ide
driver.

libata mostly covers all hardware supported by the legacy ide driver.
There are three mips drivers that are not supported, but the linux-mips
list could not identify any users of those.  There also are two m68k
drivers that do not have libata equivalents, which might or might not
have users, so we'll need some input and possibly help from the m68k
community here.


[PATCH 01/10] alpha: use libata instead of the legacy ide driver

2021-03-17 Thread Christoph Hellwig
Switch the alpha defconfig from the legacy ide driver to libata.

Signed-off-by: Christoph Hellwig 
---
 arch/alpha/configs/defconfig | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/alpha/configs/defconfig b/arch/alpha/configs/defconfig
index 724c4075df408e..dd2dd9f0861f18 100644
--- a/arch/alpha/configs/defconfig
+++ b/arch/alpha/configs/defconfig
@@ -25,19 +25,18 @@ CONFIG_PNP=y
 CONFIG_ISAPNP=y
 CONFIG_BLK_DEV_FD=y
 CONFIG_BLK_DEV_LOOP=m
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_IDE_GENERIC=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_ALI15X3=y
-CONFIG_BLK_DEV_CMD64X=y
-CONFIG_BLK_DEV_CY82C693=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_SCSI_AIC7XXX=m
 CONFIG_AIC7XXX_CMDS_PER_DEVICE=253
 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_ATA=y
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_ALI=y
+CONFIG_PATA_CMD64X=y
+CONFIG_PATA_CYPRESS=y
+CONFIG_ATA_GENERIC=y
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 CONFIG_NET_ETHERNET=y
-- 
2.30.1



Re: [PATCH] ide: fix warning comparing pointer to 0

2021-03-11 Thread Jens Axboe
On 3/11/21 2:48 AM, Jiapeng Chong wrote:
> Fix the following coccicheck warning:
> 
> ./drivers/ide/pmac.c:1680:38-39: WARNING comparing pointer to 0.
> 
> Reported-by: Abaci Robot 
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/ide/pmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index ea0b064..d5171e0 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -1677,7 +1677,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const 
> struct ide_port_info *d)
>   /* We won't need pci_dev if we switch to generic consistent
>* DMA routines ...
>*/
> - if (dev == NULL || pmif->dma_regs == 0)
> + if (!dev || pmif->dma_regs)
>   return -ENODEV;

This looks utterly broken - the warning is most definitely about
dma_regs, not dev, and you swapped the condition (failing on dma_regs
being set, not NULL).

I'd just leave this one alone, drivers/ide/ should be going away soon.

-- 
Jens Axboe



[PATCH v2] ide: fix warning comparing pointer to 0

2021-03-11 Thread Jiapeng Chong
Fix the following coccicheck warning:

./drivers/ide/pmac.c:1680:38-39: WARNING comparing pointer to 0.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
Changes in v2:
  - Modified if condition.

 drivers/ide/pmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index ea0b064..8e1388b 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1677,7 +1677,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const 
struct ide_port_info *d)
/* We won't need pci_dev if we switch to generic consistent
 * DMA routines ...
 */
-   if (dev == NULL || pmif->dma_regs == 0)
+   if (!dev || !pmif->dma_regs)
return -ENODEV;
/*
 * Allocate space for the DBDMA commands.
-- 
1.8.3.1



[PATCH] ide: fix warning comparing pointer to 0

2021-03-11 Thread Jiapeng Chong
Fix the following coccicheck warning:

./drivers/ide/pmac.c:1680:38-39: WARNING comparing pointer to 0.

Reported-by: Abaci Robot 
Signed-off-by: Jiapeng Chong 
---
 drivers/ide/pmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index ea0b064..d5171e0 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1677,7 +1677,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const 
struct ide_port_info *d)
/* We won't need pci_dev if we switch to generic consistent
 * DMA routines ...
 */
-   if (dev == NULL || pmif->dma_regs == 0)
+   if (!dev || pmif->dma_regs)
return -ENODEV;
/*
 * Allocate space for the DBDMA commands.
-- 
1.8.3.1



[PATCH -next] ide/pmac: use DIV_ROUND_UP macro to do calculation

2020-12-22 Thread Zheng Yongjun
Don't open-code DIV_ROUND_UP() kernel macro.

Signed-off-by: Zheng Yongjun 
---
 drivers/ide/pmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index ea0b064b5f56..6c0237af610d 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -105,8 +105,8 @@ static const char* model_name[] = {
  */
 
 /* Number of IDE_SYSCLK_NS ticks, argument is in nanoseconds */
-#define SYSCLK_TICKS(t)(((t) + IDE_SYSCLK_NS - 1) / 
IDE_SYSCLK_NS)
-#define SYSCLK_TICKS_66(t) (((t) + IDE_SYSCLK_66_NS - 1) / 
IDE_SYSCLK_66_NS)
+#define SYSCLK_TICKS(t)DIV_ROUND_UP(t, IDE_SYSCLK_NS)
+#define SYSCLK_TICKS_66(t) DIV_ROUND_UP(t, IDE_SYSCLK_66_NS)
 #define IDE_SYSCLK_NS  30  /* 33Mhz cell */
 #define IDE_SYSCLK_66_NS   15  /* 66Mhz cell */
 
-- 
2.22.0



Re: [PATCH] powerpc: switch 85xx defconfigs from legacy ide to libata

2020-10-06 Thread Michael Ellerman
On Thu, 24 Sep 2020 06:13:10 +0200, Christoph Hellwig wrote:
> Switch the 85xx defconfigs from the soon to be removed legacy ide
> driver to libata.

Applied to powerpc/next.

[1/1] powerpc: switch 85xx defconfigs from legacy ide to libata
  https://git.kernel.org/powerpc/c/874dc62f548f28649ac3d7e31025b1e8cec3868a

cheers


[PATCH] powerpc: switch 85xx defconfigs from legacy ide to libata

2020-09-23 Thread Christoph Hellwig
Switch the 85xx defconfigs from the soon to be removed legacy ide
driver to libata.

Signed-off-by: Christoph Hellwig 
---
 arch/powerpc/configs/85xx/mpc85xx_cds_defconfig | 6 +++---
 arch/powerpc/configs/85xx/tqm8540_defconfig | 6 +++---
 arch/powerpc/configs/85xx/tqm8541_defconfig | 6 +++---
 arch/powerpc/configs/85xx/tqm8555_defconfig | 6 +++---
 arch/powerpc/configs/85xx/tqm8560_defconfig | 6 +++---
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig 
b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
index 0683d8c292a89b..cea72e85ed2614 100644
--- a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
+++ b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
@@ -29,9 +29,9 @@ CONFIG_SYN_COOKIES=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_VIA82CXXX=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_PATA_VIA=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_E1000=y
diff --git a/arch/powerpc/configs/85xx/tqm8540_defconfig 
b/arch/powerpc/configs/85xx/tqm8540_defconfig
index 98982a0e82d804..bbf040aa1f9aa7 100644
--- a/arch/powerpc/configs/85xx/tqm8540_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8540_defconfig
@@ -30,9 +30,9 @@ CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_VIA82CXXX=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_PATA_VIA=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_E100=y
diff --git a/arch/powerpc/configs/85xx/tqm8541_defconfig 
b/arch/powerpc/configs/85xx/tqm8541_defconfig
index a6e21db1dafe3a..523ad8dcfd9d08 100644
--- a/arch/powerpc/configs/85xx/tqm8541_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8541_defconfig
@@ -30,9 +30,9 @@ CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_VIA82CXXX=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_PATA_VIA=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_E100=y
diff --git a/arch/powerpc/configs/85xx/tqm8555_defconfig 
b/arch/powerpc/configs/85xx/tqm8555_defconfig
index ca1de3979474ba..0032ce1e8c9cbf 100644
--- a/arch/powerpc/configs/85xx/tqm8555_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8555_defconfig
@@ -30,9 +30,9 @@ CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_VIA82CXXX=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_PATA_VIA=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_E100=y
diff --git a/arch/powerpc/configs/85xx/tqm8560_defconfig 
b/arch/powerpc/configs/85xx/tqm8560_defconfig
index ca3b8c8ef30f9c..a80b971f7d6e0b 100644
--- a/arch/powerpc/configs/85xx/tqm8560_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8560_defconfig
@@ -30,9 +30,9 @@ CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_VIA82CXXX=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_PATA_VIA=y
 CONFIG_NETDEVICES=y
 CONFIG_GIANFAR=y
 CONFIG_E100=y
-- 
2.28.0



Re: [PATCH -next] ide: Fix symbol undeclared warnings

2020-09-18 Thread Michael Ellerman
David Miller  writes:
> From: Michael Ellerman 
> Date: Thu, 17 Sep 2020 22:01:00 +1000
>
>> Wang Wensheng  writes:
>>> Build the object file with `C=2` and get the following warnings:
>>> make allmodconfig ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-
>>> make C=2 drivers/ide/pmac.o ARCH=powerpc64
>>> CROSS_COMPILE=powerpc64-linux-gnu-
>>>
>>> drivers/ide/pmac.c:228:23: warning: symbol 'mdma_timings_33' was not
>>> declared. Should it be static?
>>> drivers/ide/pmac.c:241:23: warning: symbol 'mdma_timings_33k' was not
>>> declared. Should it be static?
>>> drivers/ide/pmac.c:254:23: warning: symbol 'mdma_timings_66' was not
>>> declared. Should it be static?
>>> drivers/ide/pmac.c:272:3: warning: symbol 'kl66_udma_timings' was not
>>> declared. Should it be static?
>>> drivers/ide/pmac.c:1418:12: warning: symbol 'pmac_ide_probe' was not
>>> declared. Should it be static?
>>>
>>> Signed-off-by: Wang Wensheng 
>>> ---
>>>  drivers/ide/pmac.c | 10 +-
>>>  1 file changed, 5 insertions(+), 5 deletions(-)
>> 
>> TIL davem maintains IDE?
>> 
>> But I suspect he isn't that interested in this powerpc only driver, so
>> I'll grab this.
>
> I did have it in my queue, but if you want to take it that's fine too :)

That's OK, if you've got it already you take it. Thanks.

cheers


Re: [PATCH -next] ide: Fix symbol undeclared warnings

2020-09-17 Thread David Miller
From: Michael Ellerman 
Date: Thu, 17 Sep 2020 22:01:00 +1000

> Wang Wensheng  writes:
>> Build the object file with `C=2` and get the following warnings:
>> make allmodconfig ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-
>> make C=2 drivers/ide/pmac.o ARCH=powerpc64
>> CROSS_COMPILE=powerpc64-linux-gnu-
>>
>> drivers/ide/pmac.c:228:23: warning: symbol 'mdma_timings_33' was not
>> declared. Should it be static?
>> drivers/ide/pmac.c:241:23: warning: symbol 'mdma_timings_33k' was not
>> declared. Should it be static?
>> drivers/ide/pmac.c:254:23: warning: symbol 'mdma_timings_66' was not
>> declared. Should it be static?
>> drivers/ide/pmac.c:272:3: warning: symbol 'kl66_udma_timings' was not
>> declared. Should it be static?
>> drivers/ide/pmac.c:1418:12: warning: symbol 'pmac_ide_probe' was not
>> declared. Should it be static?
>>
>> Signed-off-by: Wang Wensheng 
>> ---
>>  drivers/ide/pmac.c | 10 +-
>>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> TIL davem maintains IDE?
> 
> But I suspect he isn't that interested in this powerpc only driver, so
> I'll grab this.

I did have it in my queue, but if you want to take it that's fine too :)


Re: [PATCH -next] ide: Fix symbol undeclared warnings

2020-09-17 Thread Michael Ellerman
Wang Wensheng  writes:
> Build the object file with `C=2` and get the following warnings:
> make allmodconfig ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-
> make C=2 drivers/ide/pmac.o ARCH=powerpc64
> CROSS_COMPILE=powerpc64-linux-gnu-
>
> drivers/ide/pmac.c:228:23: warning: symbol 'mdma_timings_33' was not
> declared. Should it be static?
> drivers/ide/pmac.c:241:23: warning: symbol 'mdma_timings_33k' was not
> declared. Should it be static?
> drivers/ide/pmac.c:254:23: warning: symbol 'mdma_timings_66' was not
> declared. Should it be static?
> drivers/ide/pmac.c:272:3: warning: symbol 'kl66_udma_timings' was not
> declared. Should it be static?
> drivers/ide/pmac.c:1418:12: warning: symbol 'pmac_ide_probe' was not
> declared. Should it be static?
>
> Signed-off-by: Wang Wensheng 
> ---
>  drivers/ide/pmac.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

TIL davem maintains IDE?

But I suspect he isn't that interested in this powerpc only driver, so
I'll grab this.

cheers


> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index ea0b064b5f56..6bb2fc6755c2 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -225,7 +225,7 @@ struct mdma_timings_t {
>   int cycleTime;
>  };
>  
> -struct mdma_timings_t mdma_timings_33[] =
> +static struct mdma_timings_t mdma_timings_33[] =
>  {
>  { 240, 240, 480 },
>  { 180, 180, 360 },
> @@ -238,7 +238,7 @@ struct mdma_timings_t mdma_timings_33[] =
>  {   0,   0,   0 }
>  };
>  
> -struct mdma_timings_t mdma_timings_33k[] =
> +static struct mdma_timings_t mdma_timings_33k[] =
>  {
>  { 240, 240, 480 },
>  { 180, 180, 360 },
> @@ -251,7 +251,7 @@ struct mdma_timings_t mdma_timings_33k[] =
>  {   0,   0,   0 }
>  };
>  
> -struct mdma_timings_t mdma_timings_66[] =
> +static struct mdma_timings_t mdma_timings_66[] =
>  {
>  { 240, 240, 480 },
>  { 180, 180, 360 },
> @@ -265,7 +265,7 @@ struct mdma_timings_t mdma_timings_66[] =
>  };
>  
>  /* KeyLargo ATA-4 Ultra DMA timings (rounded) */
> -struct {
> +static struct {
>   int addrSetup; /* ??? */
>   int rdy2pause;
>   int wrDataSetup;
> @@ -1415,7 +1415,7 @@ static struct pci_driver pmac_ide_pci_driver = {
>  };
>  MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match);
>  
> -int __init pmac_ide_probe(void)
> +static int __init pmac_ide_probe(void)
>  {
>   int error;
>  
> -- 
> 2.25.0


[PATCH -next] ide: Fix symbol undeclared warnings

2020-09-16 Thread Wang Wensheng
Build the object file with `C=2` and get the following warnings:
make allmodconfig ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-
make C=2 drivers/ide/pmac.o ARCH=powerpc64
CROSS_COMPILE=powerpc64-linux-gnu-

drivers/ide/pmac.c:228:23: warning: symbol 'mdma_timings_33' was not
declared. Should it be static?
drivers/ide/pmac.c:241:23: warning: symbol 'mdma_timings_33k' was not
declared. Should it be static?
drivers/ide/pmac.c:254:23: warning: symbol 'mdma_timings_66' was not
declared. Should it be static?
drivers/ide/pmac.c:272:3: warning: symbol 'kl66_udma_timings' was not
declared. Should it be static?
drivers/ide/pmac.c:1418:12: warning: symbol 'pmac_ide_probe' was not
declared. Should it be static?

Signed-off-by: Wang Wensheng 
---
 drivers/ide/pmac.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index ea0b064b5f56..6bb2fc6755c2 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -225,7 +225,7 @@ struct mdma_timings_t {
int cycleTime;
 };
 
-struct mdma_timings_t mdma_timings_33[] =
+static struct mdma_timings_t mdma_timings_33[] =
 {
 { 240, 240, 480 },
 { 180, 180, 360 },
@@ -238,7 +238,7 @@ struct mdma_timings_t mdma_timings_33[] =
 {   0,   0,   0 }
 };
 
-struct mdma_timings_t mdma_timings_33k[] =
+static struct mdma_timings_t mdma_timings_33k[] =
 {
 { 240, 240, 480 },
 { 180, 180, 360 },
@@ -251,7 +251,7 @@ struct mdma_timings_t mdma_timings_33k[] =
 {   0,   0,   0 }
 };
 
-struct mdma_timings_t mdma_timings_66[] =
+static struct mdma_timings_t mdma_timings_66[] =
 {
 { 240, 240, 480 },
 { 180, 180, 360 },
@@ -265,7 +265,7 @@ struct mdma_timings_t mdma_timings_66[] =
 };
 
 /* KeyLargo ATA-4 Ultra DMA timings (rounded) */
-struct {
+static struct {
int addrSetup; /* ??? */
int rdy2pause;
int wrDataSetup;
@@ -1415,7 +1415,7 @@ static struct pci_driver pmac_ide_pci_driver = {
 };
 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match);
 
-int __init pmac_ide_probe(void)
+static int __init pmac_ide_probe(void)
 {
int error;
 
-- 
2.25.0



[PATCH AUTOSEL 4.4 074/100] ide: remove set but not used variable 'hwif'

2020-02-14 Thread Sasha Levin
From: Wang Hai 

[ Upstream commit 98949a1946d70771789def0c9dbc239497f9f138 ]

Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 0add5bb3cee85..fbfe5761328fc 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1024,7 +1024,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1080,7 +1079,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
2.20.1



[PATCH AUTOSEL 4.9 106/141] ide: remove set but not used variable 'hwif'

2020-02-14 Thread Sasha Levin
From: Wang Hai 

[ Upstream commit 98949a1946d70771789def0c9dbc239497f9f138 ]

Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index b20025a5a8d93..9c48ff85b 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1024,7 +1024,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1080,7 +1079,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
2.20.1



[PATCH AUTOSEL 4.14 140/186] ide: remove set but not used variable 'hwif'

2020-02-14 Thread Sasha Levin
From: Wang Hai 

[ Upstream commit 98949a1946d70771789def0c9dbc239497f9f138 ]

Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 203ed4adc04ae..7db083ec5ee06 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1024,7 +1024,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1080,7 +1079,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
2.20.1



[PATCH AUTOSEL 4.19 190/252] ide: remove set but not used variable 'hwif'

2020-02-14 Thread Sasha Levin
From: Wang Hai 

[ Upstream commit 98949a1946d70771789def0c9dbc239497f9f138 ]

Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 203ed4adc04ae..7db083ec5ee06 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1024,7 +1024,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1080,7 +1079,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
2.20.1



[PATCH AUTOSEL 5.4 354/459] ide: remove set but not used variable 'hwif'

2020-02-14 Thread Sasha Levin
From: Wang Hai 

[ Upstream commit 98949a1946d70771789def0c9dbc239497f9f138 ]

Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index b5647e34e74ee..ea0b064b5f56b 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1019,7 +1019,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1075,7 +1074,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
2.20.1



[PATCH AUTOSEL 5.5 414/542] ide: remove set but not used variable 'hwif'

2020-02-14 Thread Sasha Levin
From: Wang Hai 

[ Upstream commit 98949a1946d70771789def0c9dbc239497f9f138 ]

Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index b5647e34e74ee..ea0b064b5f56b 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1019,7 +1019,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1075,7 +1074,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
2.20.1



Re: [PATCH] ide: remove set but not used variable 'hwif'

2020-01-20 Thread David Miller
From: Wang Hai 
Date: Sat, 26 Oct 2019 09:57:38 +0800

> Fix the following gcc warning:
> 
> drivers/ide/pmac.c: In function pmac_ide_setup_device:
> drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
> [-Wunused-but-set-variable]
> 
> Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
> Reported-by: Hulk Robot 
> Signed-off-by: Wang Hai 

Applied.


[PATCH] ide: remove set but not used variable 'hwif'

2019-10-26 Thread Wang Hai
Fix the following gcc warning:

drivers/ide/pmac.c: In function pmac_ide_setup_device:
drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used
[-Wunused-but-set-variable]

Fixes: d58b0c39e32f ("powerpc/macio: Rework hotplug media bay support")
Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---
 drivers/ide/pmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index b5647e3..ea0b064 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1019,7 +1019,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
struct device_node *np = pmif->node;
const int *bidp;
struct ide_host *host;
-   ide_hwif_t *hwif;
struct ide_hw *hws[] = { hw };
struct ide_port_info d = pmac_port_info;
int rc;
@@ -1075,7 +1074,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
rc = -ENOMEM;
goto bail;
}
-   hwif = pmif->hwif = host->ports[0];
+   pmif->hwif = host->ports[0];
 
if (on_media_bay(pmif)) {
/* Fixup bus ID for media bay */
-- 
1.8.3.1



Re: Re: Kernel panic when loading the IDE controller driver

2019-02-26 Thread Bartlomiej Zolnierkiewicz


On 02/14/2019 06:54 PM, Christophe Leroy wrote:
> 
> 
> Le 13/02/2019 à 16:27, Christophe Leroy a écrit :
>>
>>
>> Le 13/02/2019 à 13:53, sgosavi1 a écrit :
>>>> Why using 4.15.13 which is obsolete instead of using one of the Long
>>>> Term Support versions which are still maintained, like 4.14 or 4.19 ?
>>>> (see the complete list at https://www.kernel.org/category/releases.html)
>>>
>>> Well, when I started this task 4.15.13 was probably the latest stable
>>> release and hence we decided to port this version. In the older kernel, we
>>> have the m8260_setup.c source file for our board where the function
>>> "io_block_mapping" was used to configure the non-standard IO port address
>>> starting at 0xe000 location. This address was passed as the base address
>>> followed by control address and IRQ number to the ide-core.ko module. In the
>>> new kernel we do not have an option to send these addresses and IRQ numbers
>>> as arguments to the driver. Instead the ide-generic.c source file in the new
>>> kernel uses the standard IO port values and IRQ values. I modified the code
>>> in the above file to used the addresses and IRQ number we used in the past.
>>> Also, added code in the "MMU_init" function call available under
>>> arch/PowerPC/init_32.c to setup the IO port address range by adding the
>>> "io_block_mapping" call and the required IO port address range.
>>>
>>> Is there anything else that needs to be added or how can we configure the
>>> desired IO address range in the new kernel?
>>>
>>
>> Maybe look around 
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9a0e77f28b50128df0c9e26ae489e44e29a7270a
>>
>> Also look at ide_platform.c. I imagine there must be some way to set it up 
>> in your device tree.

Please don't add new users to subsystem deprecated almost 10 years ago..

>> Maybe Bartlomiej Zolnierkiewicz can help ?
>>
>> Christophe
> 
> Le 14/02/2019 à 09:17, sgosavi1 a écrit :>> Maybe look around
>>
>> I have gone through this before and also tried the pata_platform driver but
>> no success yet. I haven't found any example that passes the IO ports and IRQ
>> information through the device tree to the driver code.

Please look at pata_of_platform.c driver from libata subsystem,
it should have all required functionality.

>> Thanks,
>> Sachin.
> 
> 
> Maybe someone from the IDE SUBSYSTEM would be able to help better ?
> 
> Entire thread at 
> http://linuxppc.10917.n7.nabble.com/Kernel-panic-when-loading-the-IDE-controller-driver-td150020.html#none
> 
> Christophe

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R Institute Poland
Samsung Electronics


Re: Kernel panic when loading the IDE controller driver

2019-02-21 Thread sgosavi1
Hi All,


I finally got the FLASH controller driver working and it is now successfully
reporting the presence of 2GB Flash in the board. I used the new "libata"
driver code present in the new kernel source under drivers/ata/. Also did
the required additions in the device tree to provide the IO port, IRQ and
PIO mode details to the driver. 

However now I am getting the below errors.


[4.200145] scsi host0: pata_of_platform
[4.236999] ata1: PATA max PIO4 mmio cmd 0xe000 ctl 0xe20c irq 63
[4.439985] ata1.01: ATA-7: 2GB ATA Flash Disk, C A254G4, max UDMA/133
[4.463419] ata1.01: 3571344 sectors, multi 0: LBA48
[4.483384] ata1.01: configured for PIO
[4.512936] scsi 0:0:1:0: Direct-Access ATA  2GB ATA Flash Di
54G4 PQ: 0 ANSI: 5
[4.555994] sd 0:0:1:0: [sda] 3571344 512-byte logical blocks: (1.83
GB/1.70 GiB)
[4.591975] sd 0:0:1:0: [sda] Write Protect is off
[4.611307] sd 0:0:1:0: [sda] Mode Sense: 00 3a 00 00
[4.629733] sd 0:0:1:0: [sda] Write cache: disabled, read cache: enabled,
doesn't support DPO or FUA
[4.823702]
[4.823702] AT THE START OF CPU_STARTUP_ENTRY FUNCTION
[4.823734]
[4.823734] *INSIDE IDLE LOOP
[   36.163139] ata1: drained 65536 bytes to clear DRQ
[   36.185451] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
frozen
[   36.199598] ata1.01: cmd 20/00:08:00:00:00/00:00:00:00:00/f0 tag 0 pio
4096 in
[   36.199598]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4
(timeout)
[   36.229002] ata1: soft resetting link
[   36.559637] ata1.01: configured for PIO
[   36.567563] ata1.01: device reported invalid CHS sector 0
[   36.578396] ata1: EH complete
[   68.919134] ata1: drained 65536 bytes to clear DRQ
[   68.928530] ata1.01: limiting speed to UDMA7:PIO5
[   68.937856] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
frozen
[   68.952487] ata1.01: cmd 20/00:08:00:00:00/00:00:00:00:00/f0 tag 0 pio
4096 in
[   68.952487]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4
(timeout)
[   68.981876] ata1: soft resetting link
[   69.311683] ata1.01: configured for PIO
[   69.319304] ata1.01: device reported invalid CHS sector 0
[   69.330274] ata1: EH complete
[  101.687134] ata1: drained 65536 bytes to clear DRQ
[  101.696646] ata1.01: limiting speed to PIO0
[  101.704921] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
frozen
[  101.719288] ata1.01: cmd 20/00:08:00:00:00/00:00:00:00:00/f0 tag 0 pio
4096 in
[  101.719288]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4
(timeout)
[  101.748593] ata1: soft resetting link
[  102.079594] ata1.01: configured for PIO
[  102.087204] ata1.01: device reported invalid CHS sector 0
[  102.098144] ata1: EH complete
[  132.407134] ata1: drained 65536 bytes to clear DRQ
[  132.416687] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
frozen
[  132.430752] ata1.01: cmd 20/00:08:00:00:00/00:00:00:00:00/f0 tag 0 pio
4096 in
[  132.430752]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4
(timeout)
[  132.460168] ata1: soft resetting link
[  132.791594] ata1.01: configured for PIO
[  132.799048] ata1.01: device reported invalid CHS sector 0
[  132.810076] ata1: EH complete
[  165.175163] ata1: drained 65536 bytes to clear DRQ
[  165.186023] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
frozen
[  165.200192] ata1.01: cmd 20/00:08:00:00:00/00:00:00:00:00/f0 tag 0 pio
4096 in
[  165.200192]  res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4
(timeout)
[  165.229531] ata1: soft resetting link


Can anyone suggest why I am getting the above errors?

Thanks,
Sachin.



--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html


Re: Kernel panic when loading the IDE controller driver

2019-02-15 Thread sgosavi1
Hi,

> Hopefully there are examples of passing these values through ACPI.


Are you suggesting here to look at the ide-acpi.c sourc file available as
part of the driver code? In my original post I mentioned that I have
modified the ide-generic.c source file to use the IO port addresses and IRQ
number that we used in the older kernel. Also, added code in the kernel
under arch/PowerPC/mm/init_32.c source to configure the addresses required
by the driver as IO ports. But the error I am getting still continues to
suggest that probably the required address range is still setup by the
kernel as IO ports. 


How can we configure a set of virtual address as IO ports in the kernel
version 4.15.13?


Sachin 



--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html


Re: Kernel panic when loading the IDE controller driver

2019-02-14 Thread Michal Suchánek
On Thu, 14 Feb 2019 01:17:11 -0700 (MST)
sgosavi1  wrote:

> > Maybe look around 
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
> > id=9a0e77f28b50128df0c9e26ae489e44e29a7270a  
> 
> >Also look at ide_platform.c. I imagine there must be some way to set it 
> >up in your device tree.  
> 
> I have gone through this before and also tried the pata_platform driver but
> no success yet. I haven't found any example that passes the IO ports and IRQ
> information through the device tree to the driver code.

Hopefully there are examples of passing these values through ACPI.

Thanks

Michal


Re: Kernel panic when loading the IDE controller driver

2019-02-14 Thread Christophe Leroy




Le 13/02/2019 à 16:27, Christophe Leroy a écrit :



Le 13/02/2019 à 13:53, sgosavi1 a écrit :

Why using 4.15.13 which is obsolete instead of using one of the Long
Term Support versions which are still maintained, like 4.14 or 4.19 ?
(see the complete list at https://www.kernel.org/category/releases.html)


Well, when I started this task 4.15.13 was probably the latest stable
release and hence we decided to port this version. In the older 
kernel, we

have the m8260_setup.c source file for our board where the function
"io_block_mapping" was used to configure the non-standard IO port address
starting at 0xe000 location. This address was passed as the base 
address
followed by control address and IRQ number to the ide-core.ko module. 
In the
new kernel we do not have an option to send these addresses and IRQ 
numbers
as arguments to the driver. Instead the ide-generic.c source file in 
the new
kernel uses the standard IO port values and IRQ values. I modified the 
code
in the above file to used the addresses and IRQ number we used in the 
past.

Also, added code in the "MMU_init" function call available under
arch/PowerPC/init_32.c to setup the IO port address range by adding the
"io_block_mapping" call and the required IO port address range.

Is there anything else that needs to be added or how can we configure the
desired IO address range in the new kernel?



Maybe look around 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9a0e77f28b50128df0c9e26ae489e44e29a7270a 



Also look at ide_platform.c. I imagine there must be some way to set it 
up in your device tree.


Maybe Bartlomiej Zolnierkiewicz can help ?

Christophe


Le 14/02/2019 à 09:17, sgosavi1 a écrit :>> Maybe look around
>
> I have gone through this before and also tried the pata_platform 
driver but
> no success yet. I haven't found any example that passes the IO ports 
and IRQ

> information through the device tree to the driver code.
>
> Thanks,
> Sachin.


Maybe someone from the IDE SUBSYSTEM would be able to help better ?

Entire thread at 
http://linuxppc.10917.n7.nabble.com/Kernel-panic-when-loading-the-IDE-controller-driver-td150020.html#none


Christophe


Re: Kernel panic when loading the IDE controller driver

2019-02-14 Thread sgosavi1
> Maybe look around 
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
> id=9a0e77f28b50128df0c9e26ae489e44e29a7270a

>Also look at ide_platform.c. I imagine there must be some way to set it 
>up in your device tree.

I have gone through this before and also tried the pata_platform driver but
no success yet. I haven't found any example that passes the IO ports and IRQ
information through the device tree to the driver code.

Thanks,
Sachin.



--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html


Re: Kernel panic when loading the IDE controller driver

2019-02-13 Thread Christophe Leroy




Le 13/02/2019 à 13:53, sgosavi1 a écrit :

Why using 4.15.13 which is obsolete instead of using one of the Long
Term Support versions which are still maintained, like 4.14 or 4.19 ?
(see the complete list at https://www.kernel.org/category/releases.html)


Well, when I started this task 4.15.13 was probably the latest stable
release and hence we decided to port this version. In the older kernel, we
have the m8260_setup.c source file for our board where the function
"io_block_mapping" was used to configure the non-standard IO port address
starting at 0xe000 location. This address was passed as the base address
followed by control address and IRQ number to the ide-core.ko module. In the
new kernel we do not have an option to send these addresses and IRQ numbers
as arguments to the driver. Instead the ide-generic.c source file in the new
kernel uses the standard IO port values and IRQ values. I modified the code
in the above file to used the addresses and IRQ number we used in the past.
Also, added code in the "MMU_init" function call available under
arch/PowerPC/init_32.c to setup the IO port address range by adding the
"io_block_mapping" call and the required IO port address range.

Is there anything else that needs to be added or how can we configure the
desired IO address range in the new kernel?



Maybe look around 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9a0e77f28b50128df0c9e26ae489e44e29a7270a


Also look at ide_platform.c. I imagine there must be some way to set it 
up in your device tree.


Maybe Bartlomiej Zolnierkiewicz can help ?

Christophe


Re: Kernel panic when loading the IDE controller driver

2019-02-13 Thread sgosavi1
> Why using 4.15.13 which is obsolete instead of using one of the Long 
> Term Support versions which are still maintained, like 4.14 or 4.19 ? 
> (see the complete list at https://www.kernel.org/category/releases.html)

Well, when I started this task 4.15.13 was probably the latest stable
release and hence we decided to port this version. In the older kernel, we
have the m8260_setup.c source file for our board where the function
"io_block_mapping" was used to configure the non-standard IO port address
starting at 0xe000 location. This address was passed as the base address
followed by control address and IRQ number to the ide-core.ko module. In the
new kernel we do not have an option to send these addresses and IRQ numbers
as arguments to the driver. Instead the ide-generic.c source file in the new
kernel uses the standard IO port values and IRQ values. I modified the code
in the above file to used the addresses and IRQ number we used in the past.
Also, added code in the "MMU_init" function call available under
arch/PowerPC/init_32.c to setup the IO port address range by adding the
"io_block_mapping" call and the required IO port address range.

Is there anything else that needs to be added or how can we configure the
desired IO address range in the new kernel?

Thanks,
Sachin



--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html


Re: Kernel panic when loading the IDE controller driver

2019-02-13 Thread Christophe Leroy




Le 13/02/2019 à 13:24, sgosavi1 a écrit :

What it the last linux version known to work properly?



We have used it successfully in the Linux-2.6.17.6 version.


Oh, ok, there's a big gap between the two versions.

Why using 4.15.13 which is obsolete instead of using one of the Long 
Term Support versions which are still maintained, like 4.14 or 4.19 ? 
(see the complete list at https://www.kernel.org/category/releases.html)


Christophe




Thanks,
Sachin.



--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html



Re: Kernel panic when loading the IDE controller driver

2019-02-13 Thread sgosavi1
> What it the last linux version known to work properly?


We have used it successfully in the Linux-2.6.17.6 version. 


Thanks,
Sachin.



--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html


Re: Kernel panic when loading the IDE controller driver

2019-02-13 Thread Christophe Leroy

Hi,

Le 13/02/2019 à 12:01, sgosavi1 a écrit :

Hi All,

I have been working on porting Linux-4.15.13 kernel on our existing MPC8270
processor board. For this exercise, I have used pq2fads as a reference
board, its associated device tree and used cuImage for building the kernel.


What it the last linux version known to work properly ?

Christophe



I am facing an issue with the generic IDE flash controller driver in the new
kernel source where it fails to detect the Flash controller connected to 2GB
NAND flash available on the board. We have used non-standard IO port
addresses for this driver in the older kernel and I have added the required
code in the new kernel to setup the set of addresses that we need as IO
ports. Also, modified the code in the drivers/ide/ source to use the
non-standard IO port address. However, during boot up while inserting the
module I continue to get the below errors.

[4.116587] ide: forcing hda as a disk (3543/255/63)
[4.184190] Probing IDE interface ide0...
[4.226330] Machine check in kernel mode.
[4.233809] Caused by (from SRR1=49030):
[4.233826] Transfer error ack signal
[4.249263] IN from bad port e00e at 004123ef

I understand that this is an addressing issue but not sure exactly what am I
missing to fix the problem. Can you provide me your inputs on debugging this
issue?

Thanks,
Sachin.




--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html



Kernel panic when loading the IDE controller driver

2019-02-13 Thread sgosavi1
Hi All,

I have been working on porting Linux-4.15.13 kernel on our existing MPC8270
processor board. For this exercise, I have used pq2fads as a reference
board, its associated device tree and used cuImage for building the kernel.
I am facing an issue with the generic IDE flash controller driver in the new
kernel source where it fails to detect the Flash controller connected to 2GB
NAND flash available on the board. We have used non-standard IO port
addresses for this driver in the older kernel and I have added the required
code in the new kernel to setup the set of addresses that we need as IO
ports. Also, modified the code in the drivers/ide/ source to use the
non-standard IO port address. However, during boot up while inserting the
module I continue to get the below errors.

[4.116587] ide: forcing hda as a disk (3543/255/63)
[4.184190] Probing IDE interface ide0...
[4.226330] Machine check in kernel mode.
[4.233809] Caused by (from SRR1=49030):
[4.233826] Transfer error ack signal
[4.249263] IN from bad port e00e at 004123ef

I understand that this is an addressing issue but not sure exactly what am I
missing to fix the problem. Can you provide me your inputs on debugging this
issue?

Thanks,
Sachin.




--
Sent from: http://linuxppc.10917.n7.nabble.com/linuxppc-dev-f3.html


Re: ide: Use of_node_name_eq for node name comparisons

2018-12-23 Thread Michael Ellerman
On Wed, 2018-12-05 at 19:50:25 UTC, Rob Herring wrote:
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
> 
> Cc: "David S. Miller" 
> Cc: Benjamin Herrenschmidt 
> Cc: Paul Mackerras 
> Cc: Michael Ellerman 
> Cc: linux-...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Rob Herring 

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c1fa31b0fc90a80d64a334e5d35dca

cheers


[PATCH AUTOSEL 3.18 10/16] ide: pmac: add of_node_put()

2018-12-12 Thread Sasha Levin
From: Yangtao Li 

[ Upstream commit a51921c0db3fd26c4ed83dc0ec5d32988fa02aa5 ]

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 2db803cd095c..57a0bd00789f 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -920,6 +920,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);
 
+   of_node_put(root);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3)) {
/* Some drives fail to detect 80c cable in PowerBook */
-- 
2.19.1



[PATCH AUTOSEL 4.4 13/23] ide: pmac: add of_node_put()

2018-12-12 Thread Sasha Levin
From: Yangtao Li 

[ Upstream commit a51921c0db3fd26c4ed83dc0ec5d32988fa02aa5 ]

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 96a345248224..0add5bb3cee8 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -920,6 +920,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);
 
+   of_node_put(root);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3)) {
/* Some drives fail to detect 80c cable in PowerBook */
-- 
2.19.1



[PATCH AUTOSEL 4.9 14/34] ide: pmac: add of_node_put()

2018-12-12 Thread Sasha Levin
From: Yangtao Li 

[ Upstream commit a51921c0db3fd26c4ed83dc0ec5d32988fa02aa5 ]

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 0c5d3a99468e..b20025a5a8d9 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -920,6 +920,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);
 
+   of_node_put(root);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3)) {
/* Some drives fail to detect 80c cable in PowerBook */
-- 
2.19.1



[PATCH AUTOSEL 4.14 16/41] ide: pmac: add of_node_put()

2018-12-12 Thread Sasha Levin
From: Yangtao Li 

[ Upstream commit a51921c0db3fd26c4ed83dc0ec5d32988fa02aa5 ]

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index c5b902b86b44..203ed4adc04a 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -920,6 +920,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);
 
+   of_node_put(root);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3)) {
/* Some drives fail to detect 80c cable in PowerBook */
-- 
2.19.1



[PATCH AUTOSEL 4.19 31/73] ide: pmac: add of_node_put()

2018-12-12 Thread Sasha Levin
From: Yangtao Li 

[ Upstream commit a51921c0db3fd26c4ed83dc0ec5d32988fa02aa5 ]

use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/ide/pmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index c5b902b86b44..203ed4adc04a 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -920,6 +920,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);
 
+   of_node_put(root);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3)) {
/* Some drives fail to detect 80c cable in PowerBook */
-- 
2.19.1



[PATCH] ide: Use of_node_name_eq for node name comparisons

2018-12-05 Thread Rob Herring
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

Cc: "David S. Miller" 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: linux-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Rob Herring 
---
 drivers/ide/pmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index c5b902b86b44..ec46aa84d18d 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1045,7 +1045,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, 
struct ide_hw *hw)
d.port_ops = _ide_ata4_port_ops;
d.udma_mask = ATA_UDMA5;
} else if (of_device_is_compatible(np, "keylargo-ata")) {
-   if (strcmp(np->name, "ata-4") == 0) {
+   if (of_node_name_eq(np, "ata-4")) {
pmif->kind = controller_kl_ata4;
d.port_ops = _ide_ata4_port_ops;
d.udma_mask = ATA_UDMA4;
-- 
2.19.1



[PATCH] ide: pmac: add of_node_put()

2018-11-20 Thread Yangtao Li
use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li 
---
 drivers/ide/pmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index c5b902b86b44..203ed4adc04a 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -920,6 +920,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif)
struct device_node *root = of_find_node_by_path("/");
const char *model = of_get_property(root, "model", NULL);
 
+   of_node_put(root);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3)) {
/* Some drives fail to detect 80c cable in PowerBook */
-- 
2.17.0



Re: ide: pmac: Convert to using %pOF instead of full_name

2017-09-01 Thread Michael Ellerman
On Tue, 2017-07-18 at 21:43:07 UTC, Rob Herring wrote:
> Now that we have a custom printf format specifier, convert users of
> full_name to use %pOF instead. This is preparation to remove storing
> of the full path string for each node.
> 
> Signed-off-by: Rob Herring 
> Cc: "David S. Miller" 
> Cc: Benjamin Herrenschmidt 
> Cc: Paul Mackerras 
> Cc: Michael Ellerman 
> Cc: linux-...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Acked-by: David S. Miller 

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/859420e3155d8192b31a93cd92d32c

cheers


Re: [PATCH] ide: pmac: Convert to using %pOF instead of full_name

2017-07-18 Thread David Miller
From: Rob Herring 
Date: Tue, 18 Jul 2017 16:43:07 -0500

> Now that we have a custom printf format specifier, convert users of
> full_name to use %pOF instead. This is preparation to remove storing
> of the full path string for each node.
> 
> Signed-off-by: Rob Herring 

Acked-by: David S. Miller 


[PATCH] ide: pmac: Convert to using %pOF instead of full_name

2017-07-18 Thread Rob Herring
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <r...@kernel.org>
Cc: "David S. Miller" <da...@davemloft.net>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Michael Ellerman <m...@ellerman.id.au>
Cc: linux-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
---
 drivers/ide/pmac.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 0c5d3a99468e..c5b902b86b44 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1145,8 +1145,8 @@ static int pmac_ide_macio_attach(struct macio_dev *mdev,
return -ENOMEM;

if (macio_resource_count(mdev) == 0) {
-   printk(KERN_WARNING "ide-pmac: no address for %s\n",
-   mdev->ofdev.dev.of_node->full_name);
+   printk(KERN_WARNING "ide-pmac: no address for %pOF\n",
+   mdev->ofdev.dev.of_node);
rc = -ENXIO;
goto out_free_pmif;
}
@@ -1154,7 +1154,7 @@ static int pmac_ide_macio_attach(struct macio_dev *mdev,
/* Request memory resource for IO ports */
if (macio_request_resource(mdev, 0, "ide-pmac (ports)")) {
printk(KERN_ERR "ide-pmac: can't request MMIO resource for "
-   "%s!\n", mdev->ofdev.dev.of_node->full_name);
+   "%pOF!\n", mdev->ofdev.dev.of_node);
rc = -EBUSY;
goto out_free_pmif;
}
@@ -1165,8 +1165,8 @@ static int pmac_ide_macio_attach(struct macio_dev *mdev,
 * where that happens though...
 */
if (macio_irq_count(mdev) == 0) {
-   printk(KERN_WARNING "ide-pmac: no intrs for device %s, using "
-   "13\n", mdev->ofdev.dev.of_node->full_name);
+   printk(KERN_WARNING "ide-pmac: no intrs for device %pOF, using "
+   "13\n", mdev->ofdev.dev.of_node);
irq = irq_create_mapping(NULL, 13);
} else
irq = macio_irq(mdev, 0);
@@ -1183,8 +1183,8 @@ static int pmac_ide_macio_attach(struct macio_dev *mdev,
if (macio_resource_count(mdev) >= 2) {
if (macio_request_resource(mdev, 1, "ide-pmac (dma)"))
printk(KERN_WARNING "ide-pmac: can't request DMA "
-   "resource for %s!\n",
-   mdev->ofdev.dev.of_node->full_name);
+   "resource for %pOF!\n",
+   mdev->ofdev.dev.of_node);
else
pmif->dma_regs = ioremap(macio_resource_start(mdev, 1), 
0x1000);
} else
@@ -1274,7 +1274,7 @@ static int pmac_ide_pci_attach(struct pci_dev *pdev,

if (pci_enable_device(pdev)) {
printk(KERN_WARNING "ide-pmac: Can't enable PCI device for "
-   "%s\n", np->full_name);
+   "%pOF\n", np);
rc = -ENXIO;
goto out_free_pmif;
}
@@ -1282,7 +1282,7 @@ static int pmac_ide_pci_attach(struct pci_dev *pdev,

if (pci_request_regions(pdev, "Kauai ATA")) {
printk(KERN_ERR "ide-pmac: Cannot obtain PCI resources for "
-   "%s\n", np->full_name);
+   "%pOF\n", np);
rc = -ENXIO;
goto out_free_pmif;
}
--
2.11.0



Re: powerpc: disable IDE subsystem in pasemi_defconfig

2016-11-17 Thread Michael Ellerman
On Wed, 2016-03-02 at 15:50:23 UTC, Bartlomiej Zolnierkiewicz wrote:
> This patch disables deprecated IDE subsystem in pasemi_defconfig
> (no IDE host drivers are selected in this config so there is no valid
> reason to enable IDE subsystem itself).
> 
> Cc: Olof Johansson <o...@lixom.net>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/23bf36cd120f97e85ce089c841197f

cheers


Re: [patch] ide: missing break statement in set_timings_mdma()

2016-07-26 Thread David Miller
From: Dan Carpenter 
Date: Thu, 14 Jul 2016 13:48:02 +0300

> There was clearly supposed to be a break statement here.  Currently we
> use the k2 ata timings instead of sh ata ones we intended.  Probably no
> one has this hardware anymore so it likely doesn't make a difference
> beyond the static checker warning.
> 
> Signed-off-by: Dan Carpenter 

Applied.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [patch] ide: missing break statement in set_timings_mdma()

2016-07-14 Thread Benjamin Herrenschmidt
On Thu, 2016-07-14 at 13:48 +0300, Dan Carpenter wrote:
> There was clearly supposed to be a break statement here.  Currently we
> use the k2 ata timings instead of sh ata ones we intended.  Probably no
> one has this hardware anymore so it likely doesn't make a difference
> beyond the static checker warning.
> 
> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>

Acked-by: Benjamin Herrenschmidt <b...@kernel.crashing.org>

Should probably also:

CC: sta...@vger.kernel.org

> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index 7f0434f..0c5d3a9 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -707,6 +707,7 @@ set_timings_mdma(ide_drive_t *drive, int intf_type, u32 
> *timings, u32 *timings2,
>   *timings = ((*timings) & ~TR_133_PIOREG_MDMA_MASK) | tr;
>   *timings2 = (*timings2) & ~TR_133_UDMAREG_UDMA_EN;
>   }
> + break;
>   case controller_un_ata6:
>   case controller_k2_ata6: {
>   /* 100Mhz cell */
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[patch] ide: missing break statement in set_timings_mdma()

2016-07-14 Thread Dan Carpenter
There was clearly supposed to be a break statement here.  Currently we
use the k2 ata timings instead of sh ata ones we intended.  Probably no
one has this hardware anymore so it likely doesn't make a difference
beyond the static checker warning.

Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 7f0434f..0c5d3a9 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -707,6 +707,7 @@ set_timings_mdma(ide_drive_t *drive, int intf_type, u32 
*timings, u32 *timings2,
*timings = ((*timings) & ~TR_133_PIOREG_MDMA_MASK) | tr;
*timings2 = (*timings2) & ~TR_133_UDMAREG_UDMA_EN;
}
+   break;
case controller_un_ata6:
case controller_k2_ata6: {
/* 100Mhz cell */
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/85xx: disable IDE subsystem in stx_gp3_defconfig

2016-02-03 Thread Bartlomiej Zolnierkiewicz
This patch disables deprecated IDE subsystem in stx_gp3_defconfig
(no IDE host drivers are selected in this config so there is no valid
reason to enable IDE subsystem itself).

Cc: Scott Wood <o...@buserror.net>
Cc: Kumar Gala <ga...@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>
---
 arch/powerpc/configs/85xx/stx_gp3_defconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/configs/85xx/stx_gp3_defconfig 
b/arch/powerpc/configs/85xx/stx_gp3_defconfig
index f66d16b..b451905 100644
--- a/arch/powerpc/configs/85xx/stx_gp3_defconfig
+++ b/arch/powerpc/configs/85xx/stx_gp3_defconfig
@@ -31,8 +31,6 @@ CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECD=m
 CONFIG_SCSI=m
 CONFIG_BLK_DEV_SD=m
 CONFIG_CHR_DEV_ST=m
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: disable IDE subsystem in pasemi_defconfig

2016-02-03 Thread Bartlomiej Zolnierkiewicz
This patch disables deprecated IDE subsystem in pasemi_defconfig
(no IDE host drivers are selected in this config so there is no valid
reason to enable IDE subsystem itself).

Cc: Olof Johansson <o...@lixom.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>
---
 arch/powerpc/configs/pasemi_defconfig | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/powerpc/configs/pasemi_defconfig 
b/arch/powerpc/configs/pasemi_defconfig
index 8f94782..d7654e4 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -58,9 +58,6 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=16384
 CONFIG_EEPROM_LEGACY=y
-CONFIG_IDE=y
-CONFIG_BLK_DEV_IDECD=y
-CONFIG_IDE_TASK_IOCTL=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=y
 CONFIG_CHR_DEV_OSST=y
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: disable IDE subsystem in pq2fads_defconfig

2016-02-03 Thread Bartlomiej Zolnierkiewicz
This patch disables deprecated IDE subsystem in pq2fads_defconfig
(no IDE host drivers are selected in this config so there is no valid
reason to enable IDE subsystem itself).

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>
---
 arch/powerpc/configs/pq2fads_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/configs/pq2fads_defconfig 
b/arch/powerpc/configs/pq2fads_defconfig
index 3e336ee..1e77d45 100644
--- a/arch/powerpc/configs/pq2fads_defconfig
+++ b/arch/powerpc/configs/pq2fads_defconfig
@@ -40,7 +40,6 @@ CONFIG_MTD_CFI_I4=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_BLK_DEV_LOOP=y
-CONFIG_IDE=y
 CONFIG_NETDEVICES=y
 CONFIG_TUN=y
 CONFIG_FS_ENET=y
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/85xx: disable IDE subsystem in ksi8560_defconfig

2016-02-03 Thread Bartlomiej Zolnierkiewicz
This patch disables deprecated IDE subsystem in ksi8560_defconfig
(no IDE host drivers are selected in this config so there is no valid
reason to enable IDE subsystem itself).

Cc: Scott Wood <o...@buserror.net>
Cc: Kumar Gala <ga...@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>
---
 arch/powerpc/configs/85xx/ksi8560_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/configs/85xx/ksi8560_defconfig 
b/arch/powerpc/configs/85xx/ksi8560_defconfig
index 3be85c5..6f753a7 100644
--- a/arch/powerpc/configs/85xx/ksi8560_defconfig
+++ b/arch/powerpc/configs/85xx/ksi8560_defconfig
@@ -34,7 +34,6 @@ CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
 CONFIG_NETDEVICES=y
 CONFIG_FS_ENET=y
 # CONFIG_FS_ENET_HAS_SCC is not set
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/86xx: disable IDE subsystem in mpc8610_hpcd_defconfig

2016-02-03 Thread Bartlomiej Zolnierkiewicz
This patch disables deprecated IDE subsystem in mpc8610_hpcd_defconfig
(no IDE host drivers are selected in this config so there is no valid
reason to enable IDE subsystem itself).

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>
---
 arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig 
b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
index e32207d..1ef927f 100644
--- a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
@@ -49,7 +49,6 @@ CONFIG_MTD_NAND_FSL_ELBC=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=131072
-CONFIG_IDE=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
 CONFIG_ATA=y
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/83xx: disable IDE subsystem in mpc834x_itx_defconfig

2016-02-03 Thread Bartlomiej Zolnierkiewicz
This patch disables deprecated IDE subsystem in mpc834x_itx_defconfig
(no IDE host drivers are selected in this config so there is no valid
reason to enable IDE subsystem itself).

Cc: Scott Wood <o...@buserror.net>
Cc: Kumar Gala <ga...@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnier...@samsung.com>
---
 arch/powerpc/configs/83xx/mpc834x_itx_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig 
b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
index 2a5fdcb..87fc15b 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
@@ -35,7 +35,6 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-CONFIG_IDE=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
 CONFIG_SCSI_SPI_ATTRS=y
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] mpc85xx_defconfig: add IDE support for MPC85xxCDS

2012-07-23 Thread Zhao Chenhui
On Fri, Jul 20, 2012 at 03:09:00PM +0100, Alan Cox wrote:
 On Fri, 20 Jul 2012 20:45:25 +0800
 Zhao Chenhui chenhui.z...@freescale.com wrote:
 
  Add IDE support for MPC85xxCDS.
  
  Signed-off-by: Zhao Chenhui chenhui.z...@freescale.com
  ---
   arch/powerpc/configs/mpc85xx_defconfig |2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)
  
  diff --git a/arch/powerpc/configs/mpc85xx_defconfig 
  b/arch/powerpc/configs/mpc85xx_defconfig
  index 03ee911..45eda33 100644
  --- a/arch/powerpc/configs/mpc85xx_defconfig
  +++ b/arch/powerpc/configs/mpc85xx_defconfig
  @@ -105,6 +105,8 @@ CONFIG_BLK_DEV_RAM=y
   CONFIG_BLK_DEV_RAM_SIZE=131072
   CONFIG_MISC_DEVICES=y
   CONFIG_EEPROM_LEGACY=y
  +CONFIG_IDE=y
  +CONFIG_BLK_DEV_VIA82CXXX=y
 
 CONFIG_IDE is obsolete we shouldn't be adding it to anything as it will
 eventually go away. Please use the ATA drivers.
 

Thanks. I will replace it with the ATA driver.

-Chenhui

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] mpc85xx_defconfig: add IDE support for MPC85xxCDS

2012-07-20 Thread Zhao Chenhui
Add IDE support for MPC85xxCDS.

Signed-off-by: Zhao Chenhui chenhui.z...@freescale.com
---
 arch/powerpc/configs/mpc85xx_defconfig |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/mpc85xx_defconfig 
b/arch/powerpc/configs/mpc85xx_defconfig
index 03ee911..45eda33 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -105,6 +105,8 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=131072
 CONFIG_MISC_DEVICES=y
 CONFIG_EEPROM_LEGACY=y
+CONFIG_IDE=y
+CONFIG_BLK_DEV_VIA82CXXX=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
-- 
1.6.4.1


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] mpc85xx_defconfig: add IDE support for MPC85xxCDS

2012-07-20 Thread Alan Cox
On Fri, 20 Jul 2012 20:45:25 +0800
Zhao Chenhui chenhui.z...@freescale.com wrote:

 Add IDE support for MPC85xxCDS.
 
 Signed-off-by: Zhao Chenhui chenhui.z...@freescale.com
 ---
  arch/powerpc/configs/mpc85xx_defconfig |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/arch/powerpc/configs/mpc85xx_defconfig 
 b/arch/powerpc/configs/mpc85xx_defconfig
 index 03ee911..45eda33 100644
 --- a/arch/powerpc/configs/mpc85xx_defconfig
 +++ b/arch/powerpc/configs/mpc85xx_defconfig
 @@ -105,6 +105,8 @@ CONFIG_BLK_DEV_RAM=y
  CONFIG_BLK_DEV_RAM_SIZE=131072
  CONFIG_MISC_DEVICES=y
  CONFIG_EEPROM_LEGACY=y
 +CONFIG_IDE=y
 +CONFIG_BLK_DEV_VIA82CXXX=y

CONFIG_IDE is obsolete we shouldn't be adding it to anything as it will
eventually go away. Please use the ATA drivers.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


ata/ide driver for MPC512x

2012-01-19 Thread Matthias Fuchs
Hi,

do we have an ata/ide driver for MPC512x internal ATA controller?
So something that is compatible to fsl,mpc5121-pata?

Matthias
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] libata: Convert LED disk trigger from IDE to libata

2011-10-06 Thread Sergei Shtylyov

Hello.

On 03-10-2011 20:07, Jörg Sommer wrote:


This patch converts the trigger for the LED at the front of Apple's
iBooks to libata. It's merely a replacement of the string ide by disk.



The patch is taken from http://dev.gentoo.org/~josejx/ata.patch. I've
asked Joseph Jezak if he intends to send this patch upstream, but as he
did not reply I'll do so.


   The patch needs to be signed off, it cannot be applied otherwise.


---
  arch/powerpc/configs/pmac32_defconfig |2 +-
  arch/powerpc/configs/ppc6xx_defconfig |2 +-
  drivers/ata/libata-core.c |4 ++
  drivers/ide/ide-disk.c|2 +-
  drivers/leds/Kconfig  |   10 +++---
  drivers/leds/Makefile |2 +-
  drivers/leds/ledtrig-disk.c   |   64 +
  drivers/leds/ledtrig-ide-disk.c   |   64 -
  drivers/macintosh/Kconfig |   11 +++---
  drivers/macintosh/via-pmu-led.c   |4 +-
  include/linux/leds.h  |6 ++--
  11 files changed, 87 insertions(+), 84 deletions(-)
  create mode 100644 drivers/leds/ledtrig-disk.c
  delete mode 100644 drivers/leds/ledtrig-ide-disk.c


   You should use -C/-M git options to detect file renames.


diff --git a/arch/powerpc/configs/pmac32_defconfig 
b/arch/powerpc/configs/pmac32_defconfig
index f8b394a..cff5d4e 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -180,7 +180,7 @@ CONFIG_ADB=y
  CONFIG_ADB_CUDA=y
  CONFIG_ADB_PMU=y
  CONFIG_ADB_PMU_LED=y
-CONFIG_ADB_PMU_LED_IDE=y
+CONFIG_ADB_PMU_LED_DISK=y
  CONFIG_PMAC_APM_EMU=m
  CONFIG_PMAC_MEDIABAY=y
  CONFIG_PMAC_BACKLIGHT=y
diff --git a/arch/powerpc/configs/ppc6xx_defconfig 
b/arch/powerpc/configs/ppc6xx_defconfig
index 04360f9..c56464d 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -471,7 +471,7 @@ CONFIG_ADB=y
  CONFIG_ADB_CUDA=y
  CONFIG_ADB_PMU=y
  CONFIG_ADB_PMU_LED=y
-CONFIG_ADB_PMU_LED_IDE=y
+CONFIG_ADB_PMU_LED_DISK=y
  CONFIG_PMAC_APM_EMU=y
  CONFIG_PMAC_MEDIABAY=y
  CONFIG_PMAC_BACKLIGHT=y


   Defconfigs should be changed by a separate patch.


diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4a3a5ae..d37e3a2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -66,6 +66,7 @@
  #includeasm/byteorder.h
  #includelinux/cdrom.h
  #includelinux/ratelimit.h
+#includelinux/leds.h

  #include libata.h
  #include libata-transport.h
@@ -4823,6 +4824,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
  {
struct ata_port *ap = qc-ap;

+   /* Trigger the LED (if available) */
+   ledtrig_disk_activity();
+
/* XXX: New EH and old EH use different mechanisms to
 * synchronize EH with regular execution path.
 *


   This also seems a material for the separate patch. You should first do a 
file/function rename and then add support for libata, I think.



diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 2747980..cb25bd6 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, 
struct request *rq,
BUG_ON(drive-dev_flags  IDE_DFLAG_BLOCKED);
BUG_ON(rq-cmd_type != REQ_TYPE_FS);

-   ledtrig_ide_activity();
+   ledtrig_disk_activity();


   Hm, the trigger point seems asymmetric to that one you added to libata. 
Here you trigger before executing a request, and in libata after a command 
completes; also, in libata you also trigger on ATAPI devices, while here only 
on ATA devices...


WBR, Sergei
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] libata: Convert LED disk trigger from IDE to libata

2011-10-04 Thread nello martuscielli
Hi Jorg,

you submitted the patch slightly modified by Acrux (from CruxPPC) [1]
Anyway this patch is widely used by any ibook/powerbook owners with
great satisfaction.
I also use this patch from Jan 2011 and i'd like to see it upstreamed.

Btw, guess you should add:

Signed-off-by: Joseph Jezak jos...@gentoo.org
Acked-by: Nico Macrionitis ac...@cruxppc.org


cheers,
Nello

[1] http://forums.gentoo.org/viewtopic-p-6550023.html#6550023
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] libata: Convert LED disk trigger from IDE to libata

2011-10-03 Thread Jörg Sommer
This patch converts the trigger for the LED at the front of Apple's
iBooks to libata. It's merely a replacement of the string ide by disk.

The patch is taken from http://dev.gentoo.org/~josejx/ata.patch. I've
asked Joseph Jezak if he intends to send this patch upstream, but as he
did not reply I'll do so.
---
 arch/powerpc/configs/pmac32_defconfig |2 +-
 arch/powerpc/configs/ppc6xx_defconfig |2 +-
 drivers/ata/libata-core.c |4 ++
 drivers/ide/ide-disk.c|2 +-
 drivers/leds/Kconfig  |   10 +++---
 drivers/leds/Makefile |2 +-
 drivers/leds/ledtrig-disk.c   |   64 +
 drivers/leds/ledtrig-ide-disk.c   |   64 -
 drivers/macintosh/Kconfig |   11 +++---
 drivers/macintosh/via-pmu-led.c   |4 +-
 include/linux/leds.h  |6 ++--
 11 files changed, 87 insertions(+), 84 deletions(-)
 create mode 100644 drivers/leds/ledtrig-disk.c
 delete mode 100644 drivers/leds/ledtrig-ide-disk.c

diff --git a/arch/powerpc/configs/pmac32_defconfig 
b/arch/powerpc/configs/pmac32_defconfig
index f8b394a..cff5d4e 100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
@@ -180,7 +180,7 @@ CONFIG_ADB=y
 CONFIG_ADB_CUDA=y
 CONFIG_ADB_PMU=y
 CONFIG_ADB_PMU_LED=y
-CONFIG_ADB_PMU_LED_IDE=y
+CONFIG_ADB_PMU_LED_DISK=y
 CONFIG_PMAC_APM_EMU=m
 CONFIG_PMAC_MEDIABAY=y
 CONFIG_PMAC_BACKLIGHT=y
diff --git a/arch/powerpc/configs/ppc6xx_defconfig 
b/arch/powerpc/configs/ppc6xx_defconfig
index 04360f9..c56464d 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -471,7 +471,7 @@ CONFIG_ADB=y
 CONFIG_ADB_CUDA=y
 CONFIG_ADB_PMU=y
 CONFIG_ADB_PMU_LED=y
-CONFIG_ADB_PMU_LED_IDE=y
+CONFIG_ADB_PMU_LED_DISK=y
 CONFIG_PMAC_APM_EMU=y
 CONFIG_PMAC_MEDIABAY=y
 CONFIG_PMAC_BACKLIGHT=y
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4a3a5ae..d37e3a2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -66,6 +66,7 @@
 #include asm/byteorder.h
 #include linux/cdrom.h
 #include linux/ratelimit.h
+#include linux/leds.h
 
 #include libata.h
 #include libata-transport.h
@@ -4823,6 +4824,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
 {
struct ata_port *ap = qc-ap;
 
+   /* Trigger the LED (if available) */
+   ledtrig_disk_activity();
+
/* XXX: New EH and old EH use different mechanisms to
 * synchronize EH with regular execution path.
 *
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 2747980..cb25bd6 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, 
struct request *rq,
BUG_ON(drive-dev_flags  IDE_DFLAG_BLOCKED);
BUG_ON(rq-cmd_type != REQ_TYPE_FS);
 
-   ledtrig_ide_activity();
+   ledtrig_disk_activity();
 
pr_debug(%s: %sing: block=%llu, sectors=%u, buffer=0x%08lx\n,
 drive-name, rq_data_dir(rq) == READ ? read : writ,
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index b591e72..1934d8a 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -404,12 +404,12 @@ config LEDS_TRIGGER_TIMER
 
  If unsure, say Y.
 
-config LEDS_TRIGGER_IDE_DISK
-   bool LED IDE Disk Trigger
-   depends on IDE_GD_ATA
-   depends on LEDS_TRIGGERS
+config LEDS_TRIGGER_DISK
+   bool LED Disk Trigger
+   depends on IDE_GD_ATA || ATA
+depends on LEDS_TRIGGERS
help
- This allows LEDs to be controlled by IDE disk activity.
+ This allows LEDs to be controlled by disk activity.
  If unsure, say Y.
 
 config LEDS_TRIGGER_HEARTBEAT
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index bbfd2e3..350cc89 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -49,7 +49,7 @@ obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o
 
 # LED Triggers
 obj-$(CONFIG_LEDS_TRIGGER_TIMER)   += ledtrig-timer.o
-obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK)+= ledtrig-ide-disk.o
+obj-$(CONFIG_LEDS_TRIGGER_DISK)+= ledtrig-disk.o
 obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)   += ledtrig-heartbeat.o
 obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)   += ledtrig-backlight.o
 obj-$(CONFIG_LEDS_TRIGGER_GPIO)+= ledtrig-gpio.o
diff --git a/drivers/leds/ledtrig-disk.c b/drivers/leds/ledtrig-disk.c
new file mode 100644
index 000..0ebb2eb
--- /dev/null
+++ b/drivers/leds/ledtrig-disk.c
@@ -0,0 +1,64 @@
+/*
+ * LED Disk Activity Trigger
+ *
+ * Copyright 2006 Openedhand Ltd.
+ *
+ * Author: Richard Purdie rpur...@openedhand.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include linux/module.h
+#include linux/jiffies.h

mpc8xx IDE hard drive enumeration

2011-05-12 Thread Burton Samograd
Hello list,

 

I'm currently attempting to get Linux running on a custom board and have
gotten to the point of trying to get our IDE FlashCard working.  I have
ported u-boot and have the flash card working as expected (as in being
able to read and write sectors) so it looks like it is possible to get
it working in Linux with the parameters I have setup (this is using
CONFIG_IDE_8XX_DIRECT and the various CFG_PCMCIA_* parameters).

 

I have built the kernel with IDE Block Device support and have selected
the MPC8xx IDE support as well, using 8xx_DIRECT as the interface.  I
have ensured that my parameters for PCMCIA match those of u-boot.  I get
the following on bootup with regards to the IDE subsystem (having
defined DEBUG and added some additional debugging into in
drivers/ide/ppc/mpc8xx.c):

 

...

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 50MHz system bus speed for PIO modes; override with
idebus=xx

win-br: 0xfe10, PCMCIA_MEM_SIZE: 0x80, pcmcia_phy_end: 0xfe100080

win-br: 0xfe100080, PCMCIA_MEM_SIZE: 0x80, pcmcia_phy_end: 0xfe100100

win-br: 0xfe100100, PCMCIA_MEM_SIZE: 0x80, pcmcia_phy_end: 0xfe100180

win-br: 0xfe100c00, PCMCIA_MEM_SIZE: 0x80, pcmcia_phy_end: 0xfe100c80

win-br: 0xfe100c80, PCMCIA_MEM_SIZE: 0x80, pcmcia_phy_end: 0xfe100d00

win-br: 0xfe100d00, PCMCIA_MEM_SIZE: 0x80, pcmcia_phy_end: 0xfe100d80

PCMCIA slot A: phys mem fe10...fe100d80 (size 0d80)

PCMCIA virt base: c100

base: c100 +  = c100

port[0]: c100 +  = c100

port[1]: c100 + 0081 = c181

port[2]: c100 + 0082 = c182

port[3]: c100 + 0083 = c183

port[4]: c100 + 0084 = c184

port[5]: c100 + 0085 = c185

port[6]: c100 + 0086 = c186

port[7]: c100 + 0087 = c187

port[8]: c100 + 0106 = c1000106

port[9]: c100 + 000a = c10a

...

 

The IDE driver is calling m8xx_ide_init_hwif_ports successfully (not so
if I define 8xx_PCCARD) and from the source it just seems to be getting
the PCMCIA parameters that are setup by u-boot.  Everything seems fine
up to this point.

 

Now, I'm wondering, why is it not enumerating the drives on the found
hwif ports?  Would I need to specify the drives on the command line, or
some other step that I might be missing?  Can anyone see anything
drastically wrong with the PCMCIA parameters (even though they seem to
work fine with u-boot).  

 

We are using a rather old kernel (2.6.12 I think, with customizations
for our hardware), but this is a rather old custom board with very
limited ram so we are attempting to get the older kernel working first
before looking into upgrading.

 

Any help appreciated.

 

--

Burton Samograd

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] Add cmd64x IDE driver to default pmac32 config

2010-07-08 Thread lawrence rust
On Thu, 2010-07-08 at 15:00 +1000, Benjamin Herrenschmidt wrote:
 On Sat, 2010-07-03 at 20:21 +0200, lawrence rust wrote:
  The Blue/White Apple PowerMac G3 and early G4's use a cmd64x compatible
  IDE disk controller.  E.g. lspci shows...
  
  01:01.0 IDE interface: Silicon Image, Inc. PCI0646 (rev 07)
  
  Unfortunately the default pmac32 configuration does not include this
  driver and so PowerMac G3's can't load a root filesystem.  This is an
  issue on a least Ubuntu since version 9.04, which uses the default
  config as a starting point.
  
  Signed-off-by: Lawrence Rust lawrence at softsystem.co.uk
 
 Shouldn't we just switch the whole thing to libata now anyways ?

Sure. it would be preferable but unfortunately the PowerMac on-board IDE
controller (CONFIG_BLK_DEV_IDE_PMAC), used for the DVD drive on B/W
G3's, doesn't have a PATA equivalent.  So it's pragmatic (until the IDE
code is removed) to use the IDE cmd64x driver to minimise kernel code
size.

A minor correction to my previous post, the first version of Ubuntu to
suffer from this problem was 9.10.

-- Lawrence
 
 Cheers,
 Ben.
 
  diff -uprN a/arch/powerpc/configs/pmac32_defconfig 
  b/arch/powerpc/configs/pmac32_defconfig 
  --- a/arch/powerpc/configs/pmac32_defconfig 2010-05-16 23:17:36.0 
  +0200
  +++ b/arch/powerpc/configs/pmac32_defconfig 2010-07-03 20:11:10.0 
  +0200
  @@ -738,7 +738,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
   # CONFIG_BLK_DEV_AEC62XX is not set
   # CONFIG_BLK_DEV_ALI15X3 is not set
   # CONFIG_BLK_DEV_AMD74XX is not set
  -# CONFIG_BLK_DEV_CMD64X is not set
  +CONFIG_BLK_DEV_CMD64X=y
   # CONFIG_BLK_DEV_TRIFLEX is not set
   # CONFIG_BLK_DEV_CS5520 is not set
   # CONFIG_BLK_DEV_CS5530 is not set
  
  
  
  
  ___
  Linuxppc-dev mailing list
  Linuxppc-dev@lists.ozlabs.org
  https://lists.ozlabs.org/listinfo/linuxppc-dev
 
 


-- 
-- Lawrence Rust


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cmd64x IDE driver to default pmac32 config

2010-07-08 Thread Benjamin Herrenschmidt
On Thu, 2010-07-08 at 08:18 +0200, lawrence rust wrote:
 
 Sure. it would be preferable but unfortunately the PowerMac on-board IDE
 controller (CONFIG_BLK_DEV_IDE_PMAC), used for the DVD drive on B/W
 G3's, doesn't have a PATA equivalent.  So it's pragmatic (until the IDE
 code is removed) to use the IDE cmd64x driver to minimise kernel code
 size.

Sure it does nowadays: drivers/ata/pata_macio.c :-)

I merged that upstream in december last year, so it didn't make 2.6.32
which your distro probably uses, but it is in .33 and later.

 A minor correction to my previous post, the first version of Ubuntu to
 suffer from this problem was 9.10. 

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cmd64x IDE driver to default pmac32 config

2010-07-08 Thread lawrence rust
On Thu, 2010-07-08 at 16:30 +1000, Benjamin Herrenschmidt wrote:
 On Thu, 2010-07-08 at 08:18 +0200, lawrence rust wrote:
  
  Sure. it would be preferable but unfortunately the PowerMac on-board IDE
  controller (CONFIG_BLK_DEV_IDE_PMAC), used for the DVD drive on B/W
  G3's, doesn't have a PATA equivalent.  So it's pragmatic (until the IDE
  code is removed) to use the IDE cmd64x driver to minimise kernel code
  size.
 
 Sure it does nowadays: drivers/ata/pata_macio.c :-)
 
 I merged that upstream in december last year, so it didn't make 2.6.32
 which your distro probably uses, but it is in .33 and later.

OK I see that - good news.  However, for the moment I believe that it's
safer to stay with IDE.  It's the smallest of changes but the wholesale
move to libata could well break numerous system install scripts - e.g.
for yaboot.

-- Lawrence


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cmd64x IDE driver to default pmac32 config

2010-07-08 Thread Benjamin Herrenschmidt
On Thu, 2010-07-08 at 11:01 +0200, lawrence rust wrote:
 On Thu, 2010-07-08 at 16:30 +1000, Benjamin Herrenschmidt wrote:
  On Thu, 2010-07-08 at 08:18 +0200, lawrence rust wrote:
   
   Sure. it would be preferable but unfortunately the PowerMac on-board IDE
   controller (CONFIG_BLK_DEV_IDE_PMAC), used for the DVD drive on B/W
   G3's, doesn't have a PATA equivalent.  So it's pragmatic (until the IDE
   code is removed) to use the IDE cmd64x driver to minimise kernel code
   size.
  
  Sure it does nowadays: drivers/ata/pata_macio.c :-)
  
  I merged that upstream in december last year, so it didn't make 2.6.32
  which your distro probably uses, but it is in .33 and later.
 
 OK I see that - good news.  However, for the moment I believe that it's
 safer to stay with IDE.  It's the smallest of changes but the wholesale
 move to libata could well break numerous system install scripts - e.g.
 for yaboot.

Well, distros have moved over mostly... I don't think keeping the
defaults to the old stuff upstream is going to help getting things like
yaboot fixed. I'll talk to Tony see what the situation there is
tomorrow, but I'd rather fix yaboot and switch the default over.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] Add cmd64x IDE driver to default pmac32 config

2010-07-07 Thread Benjamin Herrenschmidt
On Sat, 2010-07-03 at 20:21 +0200, lawrence rust wrote:
 The Blue/White Apple PowerMac G3 and early G4's use a cmd64x compatible
 IDE disk controller.  E.g. lspci shows...
 
 01:01.0 IDE interface: Silicon Image, Inc. PCI0646 (rev 07)
 
 Unfortunately the default pmac32 configuration does not include this
 driver and so PowerMac G3's can't load a root filesystem.  This is an
 issue on a least Ubuntu since version 9.04, which uses the default
 config as a starting point.
 
 Signed-off-by: Lawrence Rust lawrence at softsystem.co.uk

Shouldn't we just switch the whole thing to libata now anyways ?

Cheers,
Ben.

 diff -uprN a/arch/powerpc/configs/pmac32_defconfig 
 b/arch/powerpc/configs/pmac32_defconfig 
 --- a/arch/powerpc/configs/pmac32_defconfig   2010-05-16 23:17:36.0 
 +0200
 +++ b/arch/powerpc/configs/pmac32_defconfig   2010-07-03 20:11:10.0 
 +0200
 @@ -738,7 +738,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
  # CONFIG_BLK_DEV_AEC62XX is not set
  # CONFIG_BLK_DEV_ALI15X3 is not set
  # CONFIG_BLK_DEV_AMD74XX is not set
 -# CONFIG_BLK_DEV_CMD64X is not set
 +CONFIG_BLK_DEV_CMD64X=y
  # CONFIG_BLK_DEV_TRIFLEX is not set
  # CONFIG_BLK_DEV_CS5520 is not set
  # CONFIG_BLK_DEV_CS5530 is not set
 
 
 
 
 ___
 Linuxppc-dev mailing list
 Linuxppc-dev@lists.ozlabs.org
 https://lists.ozlabs.org/listinfo/linuxppc-dev


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] Add cmd64x IDE driver to default pmac32 config

2010-07-03 Thread lawrence rust
The Blue/White Apple PowerMac G3 and early G4's use a cmd64x compatible
IDE disk controller.  E.g. lspci shows...

01:01.0 IDE interface: Silicon Image, Inc. PCI0646 (rev 07)

Unfortunately the default pmac32 configuration does not include this
driver and so PowerMac G3's can't load a root filesystem.  This is an
issue on a least Ubuntu since version 9.04, which uses the default
config as a starting point.

Signed-off-by: Lawrence Rust lawrence at softsystem.co.uk

diff -uprN a/arch/powerpc/configs/pmac32_defconfig 
b/arch/powerpc/configs/pmac32_defconfig 
--- a/arch/powerpc/configs/pmac32_defconfig 2010-05-16 23:17:36.0 
+0200
+++ b/arch/powerpc/configs/pmac32_defconfig 2010-07-03 20:11:10.0 
+0200
@@ -738,7 +738,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
-# CONFIG_BLK_DEV_CMD64X is not set
+CONFIG_BLK_DEV_CMD64X=y
 # CONFIG_BLK_DEV_TRIFLEX is not set
 # CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set




___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: PATA/legacy IDE subsystem on PowerMac

2010-05-19 Thread jjDaNiMoTh
2010/5/18 Benjamin Herrenschmidt b...@kernel.crashing.org:
[cut]
 Nothing obvious... the disk seem to be detected properly. Do you have
 the support for mac partitions and the SCSI disk driver (BLK_DEV_SD)
 enabled ?

The PATA modules was built statically, and BLK_DEV_SD as a module (and
not included in the ramfs).
Now it boot correctly, many thanks.

Have a nice day
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


PATA/legacy IDE subsystem on PowerMac

2010-05-18 Thread JJDaNiMoTh
Hello,

I hope I've posted to the right list.
I'm the maintainer of the linux kernel in ArchlinuxPPC [1].

We actually set statically the support for the PowerMac on-board IDE support 
(under ATA/ATAPI/MFM/RLL support (DEPRECATED) ), and the disk is recognized 
correctly (hda*).
If we try to remove this legacy support, enabling Serial ATA and Parallel ATA 
drivers -- Apple PowerMac/PowerBook internal 'MacIO' IDE (NEW) statically, 
the kernel doesn't recognize the partition on the HD. We tried different 
powerbook, and the result is the same.

Because we haven't log, I take two photos [2] [3].

With legacy stuff, I used hda6 as root device: with PATA, neither hda{5,6,7} or 
sda{5,6,7} work.
As you can see from the photos, seems that the hd isn't attached to any device 
under /dev.
With request I could upload somewhere the configs (working and not working) 
used, but they differ only for the things above.

Please let me in the right direction.
Many thanks to all.


[1] http://www.archlinuxppc.org
[2] http://img268.imageshack.us/img268/5787/dsc04701x.jpg
[3] http://img204.imageshack.us/img204/6476/dsc04701v.jpg


signature.asc
Description: This is a digitally signed message part.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: PATA/legacy IDE subsystem on PowerMac

2010-05-18 Thread Benjamin Herrenschmidt
On Tue, 2010-05-18 at 21:16 +0200, JJDaNiMoTh wrote:
 Hello,
 
 I hope I've posted to the right list.
 I'm the maintainer of the linux kernel in ArchlinuxPPC [1].
 
 We actually set statically the support for the PowerMac on-board IDE support 
 (under ATA/ATAPI/MFM/RLL support (DEPRECATED) ), and the disk is recognized 
 correctly (hda*).
 If we try to remove this legacy support, enabling Serial ATA and Parallel ATA 
 drivers -- Apple PowerMac/PowerBook internal 'MacIO' IDE (NEW) statically, 
 the kernel doesn't recognize the partition on the HD. We tried different 
 powerbook, and the result is the same.
 
 Because we haven't log, I take two photos [2] [3].
 
 With legacy stuff, I used hda6 as root device: with PATA, neither hda{5,6,7} 
 or 
 sda{5,6,7} work.
 As you can see from the photos, seems that the hd isn't attached to any 
 device 
 under /dev.
 With request I could upload somewhere the configs (working and not working) 
 used, but they differ only for the things above.

Nothing obvious... the disk seem to be detected properly. Do you have
the support for mac partitions and the SCSI disk driver (BLK_DEV_SD)
enabled ?

Cheers,
Ben.

 Please let me in the right direction.
 Many thanks to all.
 
 
 [1] http://www.archlinuxppc.org
 [2] http://img268.imageshack.us/img268/5787/dsc04701x.jpg
 [3] http://img204.imageshack.us/img204/6476/dsc04701v.jpg
 ___
 Linuxppc-dev mailing list
 Linuxppc-dev@lists.ozlabs.org
 https://lists.ozlabs.org/listinfo/linuxppc-dev


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-03 Thread Jeff Garzik

On 12/01/2009 07:36 PM, Benjamin Herrenschmidt wrote:

This is a libata driver for the macio IDE controller used on most Apple
PowerMac and PowerBooks. It's a libata equivalent of drivers/ide/ppc/pmac.c

It supports all the features of its predecessor, including mediabay hotplug
and suspend/resume. It should also support module load/unload.

The timing calculations have been simplified to use pre-calculated tables
compared to drivers/ide/pmac.c and it uses the new mediabay interface
provided by a previous patch.

Signed-off-by: Benjamin Herrenschmidtb...@kernel.crashing.org
---

v2. Better tested now, seems to be reasonably solid.

Addressed Tejun comments and made remove more robust vs. media-bay,
should also fix Andreas problem.


  drivers/ata/Kconfig  |   10
  drivers/ata/Makefile |1
  drivers/ata/pata_macio.c | 1427 
+++
  3 files changed, 1438 insertions(+)


Looks fine to me.  Two minor comments, which might perhaps be ignored if 
that is your taste:


* prefer enums to #define's, for constants

* prefer direct function call to ap-ops-foo_bar(), because 
ap-ops-foo_bar() is guaranteed to be a constant value known to the 
driver.  The driver is the entity responsible for the function pointer.


Maybe saves a cycle or two.  Not terribly important, but hey, calling 
ap-ops-sff_exec_command() from pata_macio_bmdma_setup() is a hot path.


Jeff





___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-03 Thread Mikael Pettersson
Benjamin Herrenschmidt writes:
  This is a libata driver for the macio IDE controller used on most Apple
  PowerMac and PowerBooks. It's a libata equivalent of drivers/ide/ppc/pmac.c
  
  It supports all the features of its predecessor, including mediabay hotplug
  and suspend/resume. It should also support module load/unload.
  
  The timing calculations have been simplified to use pre-calculated tables
  compared to drivers/ide/pmac.c and it uses the new mediabay interface
  provided by a previous patch.
  
  Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
  ---
  
  v2. Better tested now, seems to be reasonably solid.
  
  Addressed Tejun comments and made remove more robust vs. media-bay,
  should also fix Andreas problem.

Tested in 2.6.32-rc8 and 2.6.32 final on a G4 eMac.
Works fine, except for the yaboot problem:

 /sbin/installkernel 2.6.32 vmlinux System.map 
ofpath: Driver:  is not supported
ybin: Unable to find OpenFirmware path for boot=/dev/sda2
ybin: Please add ofboot=path where path is the OpenFirmware path to 
/dev/sda2 to /etc/yaboot.conf
ofpath: Driver:  is not supported
ybin: Unable to determine OpenFirmware path for macosx=/dev/sda4
ybin: Try specifying the real OpenFirmware path for macosx=/dev/sda4 in 
/etc/yaboot.conf

(userspace is YDL 6.2)

/Mikael
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-03 Thread Benjamin Herrenschmidt
On Thu, 2009-12-03 at 03:12 -0500, Jeff Garzik wrote:

 Looks fine to me.  Two minor comments, which might perhaps be ignored if 
 that is your taste:
 
 * prefer enums to #define's, for constants

yeah well ... I lifted those definitions from the old driver and didn't
feel like changing them all :-) I might do a separate patch later to
clean that up, we don't actually use a lot of those anymore since I use
pre-calculated tables, though they are good to keep as documentation.

 * prefer direct function call to ap-ops-foo_bar(), because 
 ap-ops-foo_bar() is guaranteed to be a constant value known to the 
 driver.  The driver is the entity responsible for the function pointer.

 Maybe saves a cycle or two.  Not terribly important, but hey, calling 
 ap-ops-sff_exec_command() from pata_macio_bmdma_setup() is a hot path.

Makes sense. I'm tempted to make that a separate patch tho, since I've
already queued up the existing one and it's just a relatively minor
performance optim. 

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-02 Thread Andreas Schwab
Benjamin Herrenschmidt b...@kernel.crashing.org writes:

 v2. Better tested now, seems to be reasonably solid.

 Addressed Tejun comments and made remove more robust vs. media-bay,
 should also fix Andreas problem.

Thanks, this works fine now, including suspend *and* resume. :-)

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-01 Thread Tejun Heo
(cc'ing Holger Macht, please read the comment below pata_macio_mb_event())
Hello,

On 12/01/2009 04:08 PM, Benjamin Herrenschmidt wrote:
 This is a libata driver for the macio IDE controller used on most Apple
 PowerMac and PowerBooks. It's a libata equivalent of drivers/ide/ppc/pmac.c

Don't know much about the controller or the platform so my comments
will be pretty confined.

 +/*
 + * Wait 1s for disk to answer on IDE bus after a hard reset
 + * of the device (via GPIO/FCR).
 + *
 + * Some devices seem to pollute the bus even after dropping
 + * the BSY bit (typically some combo drives slave on the UDMA
 + * bus) after a hard reset. Since we hard reset all drives on
 + * KeyLargo ATA66, we have to keep that delay around. I may end
 + * up not hard resetting anymore on these and keep the delay only
 + * for older interfaces instead (we have to reset when coming
 + * from MacOS...) --BenH.
 + */
 +#define IDE_WAKEUP_DELAY (1*HZ)

nitpick: In libata, it's common to use msecs for timing values so that
might be a better option.

 +static const struct pata_macio_timing *pata_macio_find_timing(
 + struct pata_macio_priv *priv,
 + int mode)
 +{
 + int i = 0;
 +
 + while (priv-timings[i].mode  0) {
 + if (priv-timings[i].mode == mode)
 + return priv-timings[i];
 + i++;
 + }
 + return NULL;

Wouldn't for (i = 0; ...) look better?

 +static void pata_macio_bmdma_start(struct ata_queued_cmd *qc)
 +{
 + struct ata_port *ap = qc-ap;
 + struct pata_macio_priv *priv = ap-private_data;
 + struct dbdma_regs __iomem *dma_regs = ap-ioaddr.bmdma_addr;
 +
 + dev_dbgdma(priv-dev, %s: qc %p\n, __func__, qc);
 +
 + writel((RUN  16) | RUN, dma_regs-control);
 + /* Make sure it gets to the controller right now */
 + (void)readl(dma_regs-control);

Is flushing necessary here?  There's no ordering issue here, right?

 +static void pata_macio_bmdma_stop(struct ata_queued_cmd *qc)
 +{
 + struct ata_port *ap = qc-ap;
 + struct pata_macio_priv *priv = ap-private_data;
 + struct dbdma_regs __iomem *dma_regs = ap-ioaddr.bmdma_addr;
 +
 + dev_dbgdma(priv-dev, %s: qc %p\n, __func__, qc);
 +
 + /* Stop the DMA engine and wait for it to full halt */
 + writel (((RUN|WAKE|DEAD)  16), dma_regs-control);
 + while (readl(dma_regs-status)  RUN)
 + udelay(1);

Heh... this is a scary looking loop.  It would be great if the above
loop can be capped somehow.

 +static u8 pata_macio_bmdma_status(struct ata_port *ap)
 +{
 + struct pata_macio_priv *priv = ap-private_data;
 + struct dbdma_regs __iomem *dma_regs = ap-ioaddr.bmdma_addr;
 + u32 dstat, rstat = ATA_DMA_INTR;
 + unsigned long timeout = 0;
 +
 + dstat = readl(dma_regs-status);
 +
 + dev_dbgdma(priv-dev, %s: dstat=%x\n, __func__, dstat);
 +
 + /* We have to things to deal with here:
   ^^
   two

 +/* port_start is when we allocate the DMA command list */
 +static int pata_macio_port_start(struct ata_port *ap)
 +{
 + struct pata_macio_priv *priv = ap-private_data;
 + struct dbdma_regs __iomem *dma_regs = ap-ioaddr.bmdma_addr;
 +
 + if (dma_regs == NULL)
 + return 0;
 +
 + /* Make sure DMA controller is stopped */
 + writel((RUN|PAUSE|FLUSH|WAKE|DEAD)  16, dma_regs-control);
 + while (readl(dma_regs-status)  RUN)
 + udelay(1);

Hmmm this probably belongs to -freeze() which is responsible for
stopping any in-flight operations and masking IRQ and libata will call
it during initialization before requesting IRQ, so you won't need to
call it explicitly here.

 +#ifdef CONFIG_PMAC_MEDIABAY
 +static void pata_macio_mb_event(struct macio_dev* mdev, int mb_state)
 +{
 + struct ata_host *host = macio_get_drvdata(mdev);
 + struct ata_port *ap;
 + struct ata_eh_info *ehi;
 + struct ata_device *dev;
 + unsigned long flags;
 +
 + if (!host)
 + return;
 + ap = host-ports[0];
 + spin_lock_irqsave(ap-lock, flags);
 + ehi = ap-link.eh_info;
 + if (mb_state == MB_CD) {
 + ata_ehi_push_desc(ehi, mediabay plug);
 + ata_ehi_hotplugged(ehi);
 + ata_port_freeze(ap);
 + } else {
 + ata_ehi_push_desc(ehi, mediabay unplug);
 + ata_for_each_dev(dev, ap-link, ALL)
 + dev-flags |= ATA_DFLAG_DETACH;
 + ata_port_schedule_eh(ap);

I think you'll need an ata_port_freeze() or abort() here because at
this point the drive is already gone and all in-flight commands need
to be failed right away.  Holger, do you remember why
ata_acpi_detach_device() is using ata_port_schedule_eh() instead?  Was
it because ata_port_freeze() might end up poking registers after
hotunplug happened?  ISTR reports where accessing any register there
causing the whole system to lock up

Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-01 Thread Benjamin Herrenschmidt
On Tue, 2009-12-01 at 11:48 +0100, Mikael Pettersson wrote:
 Thanks for reviving pata_macio.
 
 Does the new version work with yaboot? (the previous one didn't)

Well, yaboot itself should have no problem. However, the ybin script
that automagically finds the right OF path might indeed still be busted,
it will have to be updated I'm afraid as it's more/less hard coded to
know about IDE gunk

I'll have a look. The new yaboot maintainer (Tony Breeds) happens to sit
2 cubicles away from me at work so it shouldn't be a huge deal.

Thanks for reminding me tho !

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-01 Thread Mikael Pettersson
Benjamin Herrenschmidt writes:
  This is a libata driver for the macio IDE controller used on most Apple
  PowerMac and PowerBooks. It's a libata equivalent of drivers/ide/ppc/pmac.c
  
  It supports all the features of its predecessor, including mediabay hotplug
  and suspend/resume. It should also support module load/unload.
  
  The timing calculations have been simplified to use pre-calculated tables
  compared to drivers/ide/pmac.c and it uses the new mediabay interface
  provided by a previous patch.
  
  Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
  ---
  
  Only lightly tested so far, this is for review, NOT for merge.
  
  I would like to merge it eventually via the powerpc tree since there's a
  few dependent patches, though I would need the libata fix for
  bmdma_stop to go in first, unless I carry it as well with appropriate
  acks.
  
  I have addressed some of the comments from the previous version (almost a
  year ago I think). I have kept the single function for the PIO and DMA
  timings due to the one bit overlap between the fields in the HW register
  on the shasta chipset. It seems to work fine.

Thanks for reviving pata_macio.

Does the new version work with yaboot? (the previous one didn't)

/Mikael
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/5] libata/drivers: Add pata_macio, driver Apple PowerMac/PowerBook IDE controller

2009-12-01 Thread Tejun Heo
On 12/01/2009 09:44 PM, Holger Macht wrote:
 I do not remember any specific reason for using ata_port_schedule_eh(). I
 guess it's just there because the previous implementation used
 it. ata_port_freeze()/abort() might as well work properly. However, I
 would hesitate to change the existing code, because verifying that
 everything works contains quite some effort. There are so many different
 use cases this code can be accessed with and it has to be verified with
 all kind of different hardware to make sure we get no hard
 freezes. Testing that freeze()/abort() in this new driver would be worth a
 try, though. Next time I have setup my test environment again I can verify
 that it also works in the general libata-acpi code.

Yeap, agreed.  It was pretty painful get it right the last time
around, so changing it on a hunch would be a pretty bad idea.  If you
have a chance to try freeze or abort, please keep me posted.

Thanks.

-- 
tejun
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


  1   2   3   4   >