Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7833488rwl; Thu, 23 Mar 2023 09:10:57 -0700 (PDT) X-Google-Smtp-Source: AK7set/QBhw7pij8IJkMlRWZ+rd5IbyOdlxjZl0bQyOfwzhp9gWqsawjGyM+k0Z5ugMmcAIDzCdB X-Received: by 2002:aa7:df0c:0:b0:501:d43e:d1e3 with SMTP id c12-20020aa7df0c000000b00501d43ed1e3mr11824621edy.8.1679587856875; Thu, 23 Mar 2023 09:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679587856; cv=none; d=google.com; s=arc-20160816; b=w+299PlZJbyWzk+0omNokc++nn3N0A7+Qx0VxHRKyOOzk56iC7lIksFMD6PpetHXCu 0217Yx0YUnUNT66wbgobwnhK6EOxoOzc2fKgHc8dcz4kxW3xAtDs0JE6JeWNCeXcfpTB tICTzw8+3jowjCDr3Y25JqoOefiW4rPIe8oDYB6Z0G9H1IVhDKOMvUh4wrgsLsxsM35x LWjeTE3vg87Bnp3wEqAqY1XkwUZUOEk0BbimCG5luYOmlXegNPsh54cbWEJ44mgscbNo WscAgLRem0c53X4nTCP/mubBXYlha2S2gyMs4EbEp+q1a1wxFPLWaEeFwm98T63VpJIr bWLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=m9cJvBuivYNKJuFdcKESUTfOGxq48CppcAp3h9WFGe0=; b=AE81pCZvVNnh2wgrIHZ38u3RJAAfQlkJyINB74GxkJbFSfiVrF0X1t3KeGZ4j5725o Hw7bAU/Rj491w3ayQ+aq59pFSz7pDdccXGoCnidTbFwnZD4lJiQ661UNi4xZWtT1kUXG uZvFYy7HSebq1BbYCmat4/vkNCo3NXDb4vzYa5Vlirlk3rB4oq0eWp+pMR8Ly99pcMd4 uRtxOl4MIfvHsCVajIde0zyuXHzOvsXxvYvdYjLcs7Pg12qVAk08sPhrrF6x0hcfIbFe 3tTHQiXuFQejMLvO6AifQchOWHeSzywKDi7gmJt3i9F5lZcSP9fA5xi465ukYRyTl6ba pUiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A6OB1ziW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r26-20020aa7da1a000000b004fa69502824si18819960eds.134.2023.03.23.09.10.33; Thu, 23 Mar 2023 09:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A6OB1ziW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231597AbjCWQJm (ORCPT + 99 others); Thu, 23 Mar 2023 12:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231209AbjCWQJf (ORCPT ); Thu, 23 Mar 2023 12:09:35 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7BD32CCF; Thu, 23 Mar 2023 09:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679587764; x=1711123764; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=oqSdem/sOUPFA6LJjb47XXFK2yU7aMg4ahHIKQNpGhA=; b=A6OB1ziWY98bUcoTF0iMFohkk+yPuAVoixJURXM2iRc1n5pjzupm/E/p k0zVXbCCNrcEPwZTLGRPzWvc4RlZcF9SAjz96Row8AiLOiXQutQhzmLwS 0PBUi3SFikayrPxcZcOphXi56DF4XorAemfY6D6XbWXrRpoFpCUFjX1jC grnDup1fjR7ywFx4grnw5tdJnk9yLJDFXhxdoP4HvxaJiB4jZJZGqYu12 DDAPajZHXBt2d1xzj2LX3ivs4KrRaFtpEJ+/tGk3cfBCGIbv8rpmgf3wd TJW64cC2mzWo5TDE+CyiemhfnIPmxt1zkz84+4/H896uZdpWVRPfrrXc+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="323400518" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="323400518" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 09:08:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="714869188" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="714869188" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.70]) by orsmga001.jf.intel.com with SMTP; 23 Mar 2023 09:08:09 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 23 Mar 2023 18:08:08 +0200 Date: Thu, 23 Mar 2023 18:08:08 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Niklas Schnelle Cc: Geert Uytterhoeven , linux-arch@vger.kernel.org, Arnd Bergmann , linux-fbdev@vger.kernel.org, Albert Ou , Arnd Bergmann , "Rafael J. Wysocki" , Greg Kroah-Hartman , Helge Deller , Paul Walmsley , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Alan Stern , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Bjorn Helgaas , Palmer Dabbelt , Mauro Carvalho Chehab Subject: Re: [PATCH v3 35/38] video: handle HAS_IOPORT dependencies Message-ID: References: <20230314121216.413434-1-schnelle@linux.ibm.com> <20230314121216.413434-36-schnelle@linux.ibm.com> <917b95c9af1b80843b8a361d1b7fa337a25105e7.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <917b95c9af1b80843b8a361d1b7fa337a25105e7.camel@linux.ibm.com> X-Patchwork-Hint: comment X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 23, 2023 at 03:17:38PM +0100, Niklas Schnelle wrote: > On Wed, 2023-03-15 at 12:19 +0200, Ville Syrjälä wrote: > > On Wed, Mar 15, 2023 at 09:16:50AM +0100, Geert Uytterhoeven wrote: > > > Hi Niklas, > > > > > > On Tue, Mar 14, 2023 at 1:13 PM Niklas Schnelle wrote: > > > > In a future patch HAS_IOPORT=n will result in inb()/outb() and friends > > > > not being declared. We thus need to add HAS_IOPORT as dependency for > > > > those drivers using them and guard inline code in headers. > > > > > > > > Co-developed-by: Arnd Bergmann > > > > Signed-off-by: Niklas Schnelle > > > > > > Thanks for your patch! > > > > > > > --- a/drivers/video/fbdev/Kconfig > > > > +++ b/drivers/video/fbdev/Kconfig > > > > > > > @@ -1284,7 +1285,7 @@ config FB_ATY128_BACKLIGHT > > > > > > > > config FB_ATY > > > > tristate "ATI Mach64 display support" if PCI || ATARI > > > > - depends on FB && !SPARC32 > > > > + depends on FB && HAS_IOPORT && !SPARC32 > > > > > > On Atari, this works without ATARI_ROM_ISA, hence it must not depend > > > on HAS_IOPORT. > > > The only call to inb() is inside a section protected by #ifdef > > > CONFIG_PCI. So: > > > > That piece of code is a nop anyway. We immediately overwrite > > clk_wr_offset with a hardcoded selection after the register reads. > > So if you nuke that nop code then no IOPORT dependency required > > at all. > > > > I agree this "looks" like a nop but are we sure the inb() doesn't have > side effects?  Yes. It's just trying to check which PLL dividers/etc. are currently used. In VGA mode it gets it from a the GENMO and in non-VGA mode from CLOCK_CNTL. And then it says "screw that" and just uses index 3 instead. Though I must say that mach64 GX seems to use that clk_wr_offset very differently so I'm not sure the PCI+GX combo is even working currently, assuming those even exist. I don't think I have anything older than a PCI mach64 VT myself. > (for reference drivers/video/fbdev/aty/aty/atyfb_base.c: > atyfb_setup_generc() towards the end) > > It does feel a bit out of scope for this series but if it's really a > nop nuking it surely is the cleaner solution. > > Thanks, > Niklas -- Ville Syrjälä Intel