Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp489148ybk; Wed, 13 May 2020 05:32:23 -0700 (PDT) X-Google-Smtp-Source: APiQypKE4FZcfJpVkVTJiwzun4ysMcX5YAqa3PzwbXrmdJOv9GBnaZgcrdvPFyXGj4jjjQmNZ4Tx X-Received: by 2002:a05:6402:2293:: with SMTP id cw19mr21844245edb.351.1589373143202; Wed, 13 May 2020 05:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589373143; cv=none; d=google.com; s=arc-20160816; b=kj8Pw+O6YiBbHlNvIPvBG0KNcrG87A71Dcs03rvhjCFYPog3WiQ6CGd36cx8bvEUHJ aQ237r3Kqe465FefOdHaaUkf/HEriXXKP4lBufore8FA2gfH1Mh6leDBNi2YK3/f/vuB aJATmrGa11LIGKK/LDiwP8DqvswUQ0sZVSgXcSyDzJEsrQThk6fuoftkP1T36oxrCDKX WeLAMKnBGZGcvToBavdYzP9BJqx66+gqT690B/vPpqJONBhQcRq5EjzH6aNUjQpIGWAf zf1+L9DLIxd+irwhJP3gl+IUKE8AU/tNHnamLCaB39eGfALmZA0uX5mdWP0zpA2soeN1 EHwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=s6UKwXNDP9/u6KtJrcoesDc1tFaVGyXaG/2QuDgOJR0=; b=UvYa7JGVFnWN3ase4u20/0IiPpdG3DRc4+opTqTWZPVOW5LGESnnZUoYoEAatKpxhU 3eAQf53YA/PP7MyeIweeCsihyqOZsar+0bGVuBNKCeKxpzyK20abi8a30twanXAV1m+C hfKvZ8Tdi/bTSMW6Jsr5tfVtwbsWV+YWtdi0sT+x1n1ff1FXgbDkPBoilTeS2JNQjPzp KKXrMiM+EuwM5FqNyS2SjGC8/PJM8JPmHxNEtUsJZK2cqQQAbcclPS7C9fJTaYl7Usci OYmglO9eDd3WpWIJjCZVHqV8th5WHcM3k1evFD8D3tYi+Z0G+FMrInRM3UKuqxrAT6q1 ccYA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si10729800edg.437.2020.05.13.05.31.59; Wed, 13 May 2020 05:32:23 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731735AbgEMMah (ORCPT + 99 others); Wed, 13 May 2020 08:30:37 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39872 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729975AbgEMMag (ORCPT ); Wed, 13 May 2020 08:30:36 -0400 Received: by mail-pf1-f196.google.com with SMTP id b190so2184148pfg.6; Wed, 13 May 2020 05:30:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=s6UKwXNDP9/u6KtJrcoesDc1tFaVGyXaG/2QuDgOJR0=; b=co8jHKFL+Mb5LtsFAWfz0YLxscLUWImEz3JVJoLLy+1eHoHJIi4hF4uTrWG9HJgDTn ZToyMAiUq6QvCHrPeAWZ96cCXKk1eFQ/02XJMBb7qo7wKKIgXWQo2zBe963txR4Yxatw fM86kAWoRt5Ax8A9Dc/mB9pWO/Qe3NT1tPnlX35HxDVRTrHx5lExXQDfoccQ5ZxkuoZY L0qzOJl8vPHZbVbzNRstQuNAVB0hGC95jvV3g8vhhEjLTra9wm35eq6z/GnTFZvkgrf8 f1G3PmOqwXgW8xnMq6/+jhQpCy2zei1NulWChf0s0X/mTzSyPXjRWqB5rUS/Apjv3VRo 5mCg== X-Gm-Message-State: AGi0Pub+uZ7owmH5WLkKMnUpFV8w076KIJ0R0rdMsPp6eDZs7JyarhB+ PQuDbcVwAUaOq9i1PRja/FE= X-Received: by 2002:a63:f809:: with SMTP id n9mr24815453pgh.355.1589373036088; Wed, 13 May 2020 05:30:36 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id x23sm12936041pgf.32.2020.05.13.05.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 05:30:34 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id A33864063E; Wed, 13 May 2020 12:30:33 +0000 (UTC) Date: Wed, 13 May 2020 12:30:33 +0000 From: Luis Chamberlain To: Greg Kroah-Hartman Cc: Scott Branden , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross , Desmond Yan , James Hu Subject: Re: [PATCH v5 6/7] misc: bcm-vk: add Broadcom VK driver Message-ID: <20200513123033.GL11244@42.do-not-panic.com> References: <20200508002739.19360-1-scott.branden@broadcom.com> <20200508002739.19360-7-scott.branden@broadcom.com> <20200513003830.GJ11244@42.do-not-panic.com> <60372b2f-c03d-6384-43a7-8b97413b6672@broadcom.com> <20200513065046.GA764247@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200513065046.GA764247@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2020 at 08:50:46AM +0200, Greg Kroah-Hartman wrote: > On Tue, May 12, 2020 at 11:31:28PM -0700, Scott Branden wrote: > > Hi Luis, > > > > On 2020-05-12 5:38 p.m., Luis Chamberlain wrote: > > > On Thu, May 07, 2020 at 05:27:38PM -0700, Scott Branden wrote: > > > > +#if defined(CONFIG_REQ_FW_INTO_BUF_PRIV) > > > > + > > > > +#define KERNEL_PREAD_FLAG_PART 0x0001 /* Allow reading part of file */ > > > > +#define REQUEST_FIRMWARE_INTO_BUF request_firmware_into_buf_priv > > > > +int request_firmware_into_buf_priv(const struct firmware **firmware_p, > > > > + const char *name, struct device *device, > > > > + void *buf, size_t size, > > > > + size_t offset, unsigned int pread_flags); > > > > + > > > > +#else > > > > + > > > > +#define REQUEST_FIRMWARE_INTO_BUF request_firmware_into_buf > > > > + > > > > +#endif > > > > + > > > > +#endif > > > Please clean this up, the code must reflect only the code upstream. No > > > config stuff like this should be used on the driver. I had to stop my > > > review here. > > The CONFIG_ prefix shouldn't have been there as there is no Kconfig option > > to select this. > > Would like to just change it to a normal define without CONFIG_ prefix > > instead? > > This code is here to allow a limited version of the driver to run on older > > kernels which do not have the necessary partial file read support. > > By having it in the upstream codebase we don't need to maintain an internal > > version of the driver.? User can take the upstream kernel module and compile > > it against an old version of the kernel by via the define. > > That's not how kernel drivers in the tree work, sorry. They do not > contain "older kernel support" in them, they work as a whole with the > rest of the kernel they ship with only. > > Otherwise all drivers would be a total mess over time, can you imagine > doing this for the next 20+ years? Not maintainable. Scott, now imagine the amount of cleanup you'd need to do to your driver to get it to a state where it doesn't depend on any old kernel. That's the exact shape of the driver we want. To backport, you can look into the backports project which strives to backport drivers automatically [0] to older kernels. [0] https://backports.wiki.kernel.org/index.php/Main_Page Luis