Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2561016imm; Sat, 9 Jun 2018 19:13:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKv/5fMP4jQ4qBTwdqNvC4vNHdl7h+sgwGLD2q51iWRMCfVZxr0cGedkYX94CcCFcM07ERk X-Received: by 2002:a62:2394:: with SMTP id q20-v6mr12045319pfj.1.1528596797923; Sat, 09 Jun 2018 19:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528596797; cv=none; d=google.com; s=arc-20160816; b=hQTtytbPTBlFDsMQKGF6ybiXtzPnZtRp8/+X0fIIIiieXTeYG+agXlK3u/ra9r3cfn hZHv2icIfh0eLFyfhyCC1rrd2666PNtw4MHMiPq9w42Wp6RpmmUGmKYd9dS7Ge1uwUVR TNzG4B2FTz08l+cmX1eDTo1kL7vVuUBobENs1pSTi7I5R2DIF0aHO22UiA5QaIfW/1Gp toxrIYljyvDUG5RKKgifj27epCHNqNWDvwg/H+3h+JcRAYztLqkvqdn62uLVcW7hl9mg wcAT04NlCkWNXHt8D+23sSRRgsA59scfG1vREtdsiot3smKI4ts/B3v0TcYaekztHJyk dJfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:arc-authentication-results; bh=4SQjG/YM04Of/RnfO0KWZ1XNHd5Uyw0/lg5sVEvXdUU=; b=AMj6FI9Hct9XG0isNhXu/Os3CcXh24+UDQF6UgXb9vPT3o6yVw19k+DVNMDoVVjDSx y7TX0Tz0gwpE4JonR3C9eZd9H3sBi73wQM8bR2QiYxVV6+YucuyL/lZmbTyxAQPrM1vc 5MHYYMoHpAjsNsOR45+9ypASmLyO7Vw+gdTj3PozapqS2NgbbXHJez0+41SjOcHZ8XgK NlyyTrfXFCAiOHZuF8kB38jJo7dRaYu3jTGYdHUGhaBNZDPpnrhPMkY58m9o9OyNW0jW pCiyPzUd0b/197AL7g62TXmoqsKTJKn2cfIN+QGmsU3+6OVgzzjD8Rds6DVBbVVLwNlY IHJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3-v6si11209458plp.443.2018.06.09.19.12.30; Sat, 09 Jun 2018 19:13:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753629AbeFJCLj (ORCPT + 99 others); Sat, 9 Jun 2018 22:11:39 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:48604 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753611AbeFJCLi (ORCPT ); Sat, 9 Jun 2018 22:11:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id D9FD927620; Sat, 9 Jun 2018 22:11:09 -0400 (EDT) Date: Sun, 10 Jun 2018 12:11:36 +1000 (AEST) From: Finn Thain To: Andreas Schwab , "Joshua M. Thompson" cc: Michael Schmitz , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH v2 08/12] macintosh/via-pmu68k: Don't load driver on unsupported hardware In-Reply-To: <87a7s4854x.fsf@igel.home> Message-ID: References: <9f015684-4d91-70e4-d2a4-89fe167ff8ab@gmail.com> <87a7s4854x.fsf@igel.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Jun 2018, Andreas Schwab wrote: > On Jun 09 2018, Finn Thain wrote: > > > There is no ABI issue AFAIK. The value of pmu_kind is visible to userland > > only on powerpc. /dev/pmu and /proc/pmu/* do not exist on m68k. > > Then why are PMU_68K_V1 and PMU_68K_V2 defined in the first place? > I think your question is academic. Mistakes were made, and dead code appears in the kernel headers. The author of via-pmu68k.c (apparently Joshua M. Thompson) may have a better answer, but if you want my guess, it is simply that pmu_kind was cut and pasted from via-pmu.c, and then given values corresponding to internal kernel system controller type values. See via-pmu68k.c: case MAC_ADB_PB1: pmu_kind = PMU_68K_V1; break; case MAC_ADB_PB2: pmu_kind = PMU_68K_V2; break; Note that the MAC_ADB_PB1 and MAC_ADB_PB2 categories are quite artificial and were never useful to userland and were never visible to userland. The same applies to PMU_68K_V1 and PMU_68K_V2. The MAC_ADB_PB1 and MAC_ADB_PB2 categories are used internally by the kernel to distinguish the M50753 devices which have no built-in RTC (MAC_ADB_PB1) from the M68HC05 devices which do have a built-in RTC (MAC_ADB_PB2). This distinction is completely hidden by the kernel behind the RTC UAPIs. It is not useful to userland. With this patch series, MAC_ADB_PB1/PMU_68K_V1 models will have no PMU driver loaded at all, while MAC_ADB_PB2/PMU_68K_V2 models will have pmu_kind set to PMU_UNKNOWN, and this will become visible to userland for the first time. Can please you explain why this change is problematic? You seem to be worried about breaking code which doesn't exist, and which, if it did exist, is already broken for other reasons. -- > Andreas. > >