Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2732487pxk; Tue, 15 Sep 2020 00:16:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN0wP6Y8RHTurDVpTW4L+eXTg5bScW/LGLbi8pq39wLp/AybB8cy1O4lK1DuaHW4NntCoe X-Received: by 2002:a17:906:9443:: with SMTP id z3mr19406739ejx.156.1600154203118; Tue, 15 Sep 2020 00:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600154203; cv=none; d=google.com; s=arc-20160816; b=J+9V6kvM/LLE3RU6VTd9Znxw4bZWKroJPNCyfvmHA40YlGKzyZShSHrp3oK12fAceY QRe5rbqdjOOek7mb5CL5RraLIEW/FJsC7XxwZScPdHzOurt732boRNxLDeTK+Gvl2uBX 6i+brybYFibCqYnSMlvu/Y/piVMtNQKikqXWoK/6H7lYqA8YcIL6jAWAqLyXUj8BTYuF 5ZOyXygwQarYys8YeVjKE1Izlp8lFet7EGEtUXvGWb3EHDdJ21NKQh/PLZGSy7eepaV5 PSQUCDqXYJZBFx9MUD8qIydyRVYVJgTb/nGA7HyoU9ysnCBrHhV7oQYakVZV6TqJHyYd jVTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=0AAGDKBZ0tFUr5jZMaLm57FUfXngPQn4Fl7eT0hJb94=; b=IIM957j37NPcNiCIhoLctCXU9qcJuMwMAS0t8E3lS7TH8UhTB2PNFZhOFbs6RGI+OH HzRE76gwaE4ituJZZZ9oF3tDkYmfL07Mt4GUdsBh/9nBxSefw6r5jONSSWqDRigBbhhL r/hDBXDV/y3dSS2L+uCVTdM0xbgLCBZhe462Vl29ZvyH2QpdbPPYAftfWAeKaTdsmwEn 5JjWXogBxWKRab6I9RZAlpDcoLelDVGG44sp06EJZRcTX1HftiXhuEXEoppfYRM8t9+B DxZIciJTktayl5shXzVTZKQ6Mkn9BHBpccYTzDtvIZEwkOORUbgszLKLVGqFULxPqVqw jG4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si10241761edi.491.2020.09.15.00.16.20; Tue, 15 Sep 2020 00:16:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726155AbgIOHPc (ORCPT + 99 others); Tue, 15 Sep 2020 03:15:32 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:39329 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726114AbgIOHP1 (ORCPT ); Tue, 15 Sep 2020 03:15:27 -0400 Received: by mail-ot1-f68.google.com with SMTP id u25so2280245otq.6; Tue, 15 Sep 2020 00:15:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0AAGDKBZ0tFUr5jZMaLm57FUfXngPQn4Fl7eT0hJb94=; b=LBvZdPi5b8z7Pf914TrPv2mremD6kGRtz1OXrkI2Ibm7AvHwE2l3NuMuCMBKMj9iGb Fx87uQGb0HVlW89R+qJTub4pg4hTIXTKg1yyIwDp5eOAshXTOY0vDXQ4dHFE0FnGegJF LrQNSBLhd2J3bzUmOayXMiuNLsc0/d3gBAHwg4isFiFLGfYFnfDMrcg14J3HRbPtUn5s tHOlpqa0th3oQAlOKbaYWYHEp0PK6tp7o9HH715sclBlPnx/cnVy33pArh1qDPuUZk+x aCIHfL3ZYujfEOiiSZFR6K+hVRnWIwGBZ7UbuU89FAovtMNyAzkqjx7iX7+HS9h12ykE OfyA== X-Gm-Message-State: AOAM532lCbRn2/R/15kCqClN7f1KPveLYvhsXx6B9wNpSVEEiYJA6w0H v9H9rzdi88Nz/wlVLjemg5CAo7roS4NSKb9tfs8= X-Received: by 2002:a05:6830:1008:: with SMTP id a8mr11032303otp.107.1600154122683; Tue, 15 Sep 2020 00:15:22 -0700 (PDT) MIME-Version: 1.0 References: <3cf40b9df80a99a3eee6d3af79437016038f0a44.1600051331.git.fthain@telegraphics.com.au> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 15 Sep 2020 09:15:11 +0200 Message-ID: Subject: Re: [PATCH v2] ide/macide: Convert Mac IDE driver to platform driver To: Finn Thain Cc: "David S. Miller" , Bartlomiej Zolnierkiewicz , Joshua Thompson , linux-m68k , Linux Kernel Mailing List , linux-ide@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, On Tue, Sep 15, 2020 at 3:17 AM Finn Thain wrote: > On Mon, 14 Sep 2020, Geert Uytterhoeven wrote: > > On Mon, Sep 14, 2020 at 4:47 AM Finn Thain wrote: > > > Add platform devices for the Mac IDE controller variants. Convert the > > > macide module into a platform driver to support two of those variants. > > > For the third, use a generic "pata_platform" driver instead. > > > This enables automatic loading of the appropriate module and begins > > > the process of replacing the driver with libata alternatives. > > > > > > Cc: Bartlomiej Zolnierkiewicz > > > Cc: Geert Uytterhoeven > > > Cc: Joshua Thompson > > > References: commit 5ed0794cde593 ("m68k/atari: Convert Falcon IDE drivers to platform drivers") > > > References: commit 7ad19a99ad431 ("ide: officially deprecated the legacy IDE driver") > > > Tested-by: Stan Johnson > > > Signed-off-by: Finn Thain > > > --- > > > This patch was tested successfully on a Powerbook 190 (MAC_IDE_BABOON) > > > using both pata_platform and ide_platform drivers. > > > The next step will be to try using these generic drivers with the other > > > IDE controller variants (MAC_IDE_QUADRA or MAC_IDE_PB) so that the macide > > > driver can be entirely replaced with libata drivers. > > > > > > Changed since v1: > > > - Adopted DEFINE_RES_MEM and DEFINE_RES_IRQ macros. > > > - Dropped IORESOURCE_IRQ_SHAREABLE flag as it is ignored by pata_platform.c > > > and IRQF_SHARED makes no difference in this case. > > > - Removed redundant release_mem_region() call. > > > - Enabled CONFIG_BLK_DEV_PLATFORM in mac_defconfig. We might also enable > > > CONFIG_PATA_PLATFORM but IMO migration to libata should be a separate > > > patch (as this patch has some unrelated benefits). > > > > Thanks for the update! > > > > BTW, who do you envision taking this (or the next version)? IDE or m68k? > > > > It's unclear from the diff stat. But the focus is on the platform which > probably means it is more interesting to you, as the arch maintainer. Fair enough. Looking for an Acked-by from the IDE maintainer... > > > --- a/drivers/ide/macide.c > > > +++ b/drivers/ide/macide.c > > > > > @@ -109,42 +110,61 @@ static const char *mac_ide_name[] = > > > * Probe for a Macintosh IDE interface > > > */ > > > > > > -static int __init macide_init(void) > > > +static int mac_ide_probe(struct platform_device *pdev) > > > { > > > > > printk(KERN_INFO "ide: Macintosh %s IDE controller\n", > > > mac_ide_name[macintosh_config->ide_type - 1]); > > > > > > - macide_setup_ports(&hw, base, irq); > > > + macide_setup_ports(&hw, mem->start, irq->start); > > > > > > - return ide_host_add(&d, hws, 1, NULL); > > > + rc = ide_host_add(&d, hws, 1, &host); > > > + if (rc) > > > + return rc; > > > + > > > + platform_set_drvdata(pdev, host); > > > > Move one up, to play it safe? > > > > You mean, before calling ide_host_add? The 'host' pointer is uninitialized > prior to that call. Oh right, so the IDE subsystem doesn't let you use the drvdata inside your driver (besides in remove()) in a safe way :-( Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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