Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3407862pxy; Mon, 26 Apr 2021 00:38:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgkchB8X/KyesTXAgI/IFCYUgJFHp1EZV7ZYlZiTiHMf3ExbcxTUrk9aA81op2sGNew422 X-Received: by 2002:a17:906:564f:: with SMTP id v15mr6431733ejr.96.1619422706817; Mon, 26 Apr 2021 00:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619422706; cv=none; d=google.com; s=arc-20160816; b=fGDZs7d/ZAQsPojx/YIKz6Y1HicikzK2qxWz0s0w9Kx5mDW3tWEkPzxnwDKeG4ZqLk D33rxpYcryNL+Oh1tt8Eo9dfTE4dc3LjsLjkosbodUR9gUVLoDDIbgp39oPPoHTQCxKU J9fa1CBzLAHolSWXxenmoO+tQEk4e5YIeebIMyg3eeMzN7K89JmTAC+LMmrpvoAyQW/b 47n4aklQd1lnNTHRb3OGg5e2RdcNgkGq2d4NvVuNvOlJz4q0ELpCABUPiUSgAvXcFGnk xH2TTRyelttM+4M3L2WQAgg4Zt2knDD7ttHQkSq9+CbtHWYvyaOSGtKuQoP9txcOz+zw +clQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=MAcnFXNuft50TXxe0rbtTLltHbWeGCDe3zCSsbms/PA=; b=Vp+sLqOx+KCUb0UJGzOFZoZ1TIWBHL7Tcl7XiImn4unURZ4D3J7zqi4/T0cw58x2Rl tMbkMFzGrGqpAe+kV/IlpNduorBDBlTwKKkw5AsiEYwgTgH9Vr/Kgqz2WrjvM9YQb+mp 2P9Os3WoZ3d0TYnuab58RiPm756P01eWFm9ErMbT15IKHvtONKjc0Em5sdbe8hAJULrD 1Jge/fSpZYb1sxch0lpzEwWj2xe3/mF3nFy24E5oYjZ0xMJZUjTTftViSotwd33rFzFe coFY8/fDabd1BVn7k/Sq4bQY1WS8kRIBJvOVYTtGKLPU/PoZXjvN9ALw1ctQlbWGL40g ThRw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fastmail.com.au Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si12886496ejt.647.2021.04.26.00.38.02; Mon, 26 Apr 2021 00:38:26 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fastmail.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232391AbhDZHhw (ORCPT + 99 others); Mon, 26 Apr 2021 03:37:52 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:42142 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232447AbhDZHgZ (ORCPT ); Mon, 26 Apr 2021 03:36:25 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 182C620306; Mon, 26 Apr 2021 03:35:40 -0400 (EDT) Date: Mon, 26 Apr 2021 17:35:45 +1000 (AEST) From: Finn Thain To: Michael Schmitz cc: Finn Thain , Geert Uytterhoeven , Christoph Hellwig , Joshua Thompson , "David S. Miller" , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Subject: Re: [PATCH] m68k/mac: Replace macide driver with generic platform driver In-Reply-To: <12ca8e6e-de1d-fe8d-a27d-b3a6c3581d50@gmail.com> Message-ID: <3de9a93d-2f7-a650-1fa-c2129a4a765b@nippy.intranet> References: <793432cca963b632709c4d1312baa9874d73e1d8.1619341585.git.fthain@telegraphics.com.au> <12ca8e6e-de1d-fe8d-a27d-b3a6c3581d50@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Apr 2021, Michael Schmitz wrote: > Am 25.04.2021 um 21:06 schrieb Finn Thain: > > This was tested on my Quadra 630. I haven't tested it on my PowerBook 150 > > because I don't have a RAM adapter board for it. > > > > Apparently, the hardware I tested doesn't need macide_clear_irq() or > > macide_test_irq() -- if it did, the generic driver would not have worked. > > It's possible that those routines are needed for the PowerBook 150 but > > we can cross that bridge if and when we come to it. > > > > BTW, macide_clear_irq() appears to suffer from a race condition. The write > > to the interrupt flags register could easily have unintended side effects > > as it may alter other flag bits. Fortunately, all of the other bits are > > unused by Linux. Moreover, when tested on my Quadra 630, that assignment > > (*ide_ifr &= ~0x20) was observed to have no effect on bit 5. > > You are worried that the bit clear might not be done atomic? > The edge-triggered interrupt flag bits are usually cleared by writing 1 to the flag bit. Under this scheme, writing a 0 to a flag bit has no effect. The assignment statement here is trying to clear bit 5 by writing 0. But what about the other bits that we're writing 0 to? Some of them may also be flag bits, and they may have been asserted in between the load and store. AFAICS this scheme just can't work for edge-triggered interrupts. So perhaps this is a level-triggered interrupt? > Regarding the missing effect of clearing bit 5, I suspect this has never > before been tested rigorously (I don't remember ever using a Quadra > 630). > > The logic attempted to replicate what the MacOS IDE driver did. Fair enough. Maybe we have found a bug in the MacOS IDE driver. > The Linux IDE driver has its own way to test and clear a port's > interrupt flag, so this extra code can quite probably go. > > Thanks for cleaning this up! > > Reviewed-by: Michael Schmitz > Thanks for your review.