* Re: [PATCH] staging: ccree: local variable "dev" not required
From: Gilad Ben-Yossef @ 2017-10-05 7:07 UTC (permalink / raw)
To: Suniel Mahesh
Cc: Greg Kroah-Hartman, Linux Crypto Mailing List, driverdev-devel,
devel, Linux kernel mailing list, karthik
In-Reply-To: <1507144330-1672-1-git-send-email-sunil.m@techveda.org>
Hi Suniel,
On Wed, Oct 4, 2017 at 10:12 PM, <sunil.m@techveda.org> wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
>
> There is no need to create a local pointer variable "dev" and
> pass it various API's, instead use plat_dev which is enumerated
> by platform core on successful probe.
>
> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
> ---
I'm sorry but I don't understand what is the problem you are trying to solve or
what is the improvement suggested.
Why is having a local variable undesirable? I think having it makes
the code more
readable, not less.
Thanks,
Gilad
> Note:
> - Patch was tested and built(ARCH=arm) on staging-testing.
> - No build issues reported, however it was not tested on
> real hardware.
> ---
> drivers/staging/ccree/ssi_driver.c | 63 +++++++++++++++++++-------------------
> 1 file changed, 31 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c
> index 5f03c25..eb907ce 100644
> --- a/drivers/staging/ccree/ssi_driver.c
> +++ b/drivers/staging/ccree/ssi_driver.c
> @@ -205,12 +205,11 @@ static int init_cc_resources(struct platform_device *plat_dev)
> struct resource *req_mem_cc_regs = NULL;
> void __iomem *cc_base = NULL;
> struct ssi_drvdata *new_drvdata;
> - struct device *dev = &plat_dev->dev;
> - struct device_node *np = dev->of_node;
> + struct device_node *np = plat_dev->dev.of_node;
> u32 signature_val;
> int rc = 0;
>
> - new_drvdata = devm_kzalloc(dev, sizeof(*new_drvdata), GFP_KERNEL);
> + new_drvdata = devm_kzalloc(&plat_dev->dev, sizeof(*new_drvdata), GFP_KERNEL);
> if (!new_drvdata) {
> rc = -ENOMEM;
> goto post_drvdata_err;
> @@ -225,16 +224,16 @@ static int init_cc_resources(struct platform_device *plat_dev)
> /* First CC registers space */
> req_mem_cc_regs = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
> /* Map registers space */
> - new_drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs);
> + new_drvdata->cc_base = devm_ioremap_resource(&plat_dev->dev, req_mem_cc_regs);
> if (IS_ERR(new_drvdata->cc_base)) {
> - dev_err(dev, "Failed to ioremap registers");
> + dev_err(&plat_dev->dev, "Failed to ioremap registers");
> rc = PTR_ERR(new_drvdata->cc_base);
> goto post_drvdata_err;
> }
>
> - dev_dbg(dev, "Got MEM resource (%s): %pR\n", req_mem_cc_regs->name,
> + dev_dbg(&plat_dev->dev, "Got MEM resource (%s): %pR\n", req_mem_cc_regs->name,
> req_mem_cc_regs);
> - dev_dbg(dev, "CC registers mapped from %pa to 0x%p\n",
> + dev_dbg(&plat_dev->dev, "CC registers mapped from %pa to 0x%p\n",
> &req_mem_cc_regs->start, new_drvdata->cc_base);
>
> cc_base = new_drvdata->cc_base;
> @@ -242,120 +241,120 @@ static int init_cc_resources(struct platform_device *plat_dev)
> /* Then IRQ */
> new_drvdata->irq = platform_get_irq(plat_dev, 0);
> if (new_drvdata->irq < 0) {
> - dev_err(dev, "Failed getting IRQ resource\n");
> + dev_err(&plat_dev->dev, "Failed getting IRQ resource\n");
> rc = new_drvdata->irq;
> goto post_drvdata_err;
> }
>
> - rc = devm_request_irq(dev, new_drvdata->irq, cc_isr,
> + rc = devm_request_irq(&plat_dev->dev, new_drvdata->irq, cc_isr,
> IRQF_SHARED, "arm_cc7x", new_drvdata);
> if (rc) {
> - dev_err(dev, "Could not register to interrupt %d\n",
> + dev_err(&plat_dev->dev, "Could not register to interrupt %d\n",
> new_drvdata->irq);
> goto post_drvdata_err;
> }
> - dev_dbg(dev, "Registered to IRQ: %d\n", new_drvdata->irq);
> + dev_dbg(&plat_dev->dev, "Registered to IRQ: %d\n", new_drvdata->irq);
>
> rc = cc_clk_on(new_drvdata);
> if (rc)
> goto post_drvdata_err;
>
> - if (!dev->dma_mask)
> - dev->dma_mask = &dev->coherent_dma_mask;
> + if (!plat_dev->dev.dma_mask)
> + plat_dev->dev.dma_mask = &plat_dev->dev.coherent_dma_mask;
>
> - if (!dev->coherent_dma_mask)
> - dev->coherent_dma_mask = DMA_BIT_MASK(DMA_BIT_MASK_LEN);
> + if (!plat_dev->dev.coherent_dma_mask)
> + plat_dev->dev.coherent_dma_mask = DMA_BIT_MASK(DMA_BIT_MASK_LEN);
>
> /* Verify correct mapping */
> signature_val = CC_HAL_READ_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_SIGNATURE));
> if (signature_val != DX_DEV_SIGNATURE) {
> - dev_err(dev, "Invalid CC signature: SIGNATURE=0x%08X != expected=0x%08X\n",
> + dev_err(&plat_dev->dev, "Invalid CC signature: SIGNATURE=0x%08X != expected=0x%08X\n",
> signature_val, (u32)DX_DEV_SIGNATURE);
> rc = -EINVAL;
> goto post_clk_err;
> }
> - dev_dbg(dev, "CC SIGNATURE=0x%08X\n", signature_val);
> + dev_dbg(&plat_dev->dev, "CC SIGNATURE=0x%08X\n", signature_val);
>
> /* Display HW versions */
> - dev_info(dev, "ARM CryptoCell %s Driver: HW version 0x%08X, Driver version %s\n",
> + dev_info(&plat_dev->dev, "ARM CryptoCell %s Driver: HW version 0x%08X, Driver version %s\n",
> SSI_DEV_NAME_STR,
> CC_HAL_READ_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_VERSION)),
> DRV_MODULE_VERSION);
>
> rc = init_cc_regs(new_drvdata, true);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "init_cc_regs failed\n");
> + dev_err(&plat_dev->dev, "init_cc_regs failed\n");
> goto post_clk_err;
> }
>
> #ifdef ENABLE_CC_SYSFS
> - rc = ssi_sysfs_init(&dev->kobj, new_drvdata);
> + rc = ssi_sysfs_init(&plat_dev->dev.kobj, new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "init_stat_db failed\n");
> + dev_err(&plat_dev->dev, "init_stat_db failed\n");
> goto post_regs_err;
> }
> #endif
>
> rc = ssi_fips_init(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "SSI_FIPS_INIT failed 0x%x\n", rc);
> + dev_err(&plat_dev->dev, "SSI_FIPS_INIT failed 0x%x\n", rc);
> goto post_sysfs_err;
> }
> rc = ssi_sram_mgr_init(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "ssi_sram_mgr_init failed\n");
> + dev_err(&plat_dev->dev, "ssi_sram_mgr_init failed\n");
> goto post_fips_init_err;
> }
>
> new_drvdata->mlli_sram_addr =
> ssi_sram_mgr_alloc(new_drvdata, MAX_MLLI_BUFF_SIZE);
> if (unlikely(new_drvdata->mlli_sram_addr == NULL_SRAM_ADDR)) {
> - dev_err(dev, "Failed to alloc MLLI Sram buffer\n");
> + dev_err(&plat_dev->dev, "Failed to alloc MLLI Sram buffer\n");
> rc = -ENOMEM;
> goto post_sram_mgr_err;
> }
>
> rc = request_mgr_init(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "request_mgr_init failed\n");
> + dev_err(&plat_dev->dev, "request_mgr_init failed\n");
> goto post_sram_mgr_err;
> }
>
> rc = ssi_buffer_mgr_init(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "buffer_mgr_init failed\n");
> + dev_err(&plat_dev->dev, "buffer_mgr_init failed\n");
> goto post_req_mgr_err;
> }
>
> rc = ssi_power_mgr_init(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "ssi_power_mgr_init failed\n");
> + dev_err(&plat_dev->dev, "ssi_power_mgr_init failed\n");
> goto post_buf_mgr_err;
> }
>
> rc = ssi_ivgen_init(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "ssi_ivgen_init failed\n");
> + dev_err(&plat_dev->dev, "ssi_ivgen_init failed\n");
> goto post_power_mgr_err;
> }
>
> /* Allocate crypto algs */
> rc = ssi_ablkcipher_alloc(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "ssi_ablkcipher_alloc failed\n");
> + dev_err(&plat_dev->dev, "ssi_ablkcipher_alloc failed\n");
> goto post_ivgen_err;
> }
>
> /* hash must be allocated before aead since hash exports APIs */
> rc = ssi_hash_alloc(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "ssi_hash_alloc failed\n");
> + dev_err(&plat_dev->dev, "ssi_hash_alloc failed\n");
> goto post_cipher_err;
> }
>
> rc = ssi_aead_alloc(new_drvdata);
> if (unlikely(rc != 0)) {
> - dev_err(dev, "ssi_aead_alloc failed\n");
> + dev_err(&plat_dev->dev, "ssi_aead_alloc failed\n");
> goto post_hash_err;
> }
>
> @@ -392,7 +391,7 @@ static int init_cc_resources(struct platform_device *plat_dev)
> post_clk_err:
> cc_clk_off(new_drvdata);
> post_drvdata_err:
> - dev_err(dev, "ccree init error occurred!\n");
> + dev_err(&plat_dev->dev, "ccree init error occurred!\n");
> return rc;
> }
>
> --
> 1.9.1
>
--
Gilad Ben-Yossef
Chief Coffee Drinker
"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
-- Jean-Baptiste Queru
^ permalink raw reply
* RE: [PATCH 06/11] MIPS: cmpxchg: Implement __cmpxchg() as a function
From: Paul Burton @ 2017-10-05 7:07 UTC (permalink / raw)
To: Greg Ungerer, Ralf Baechle; +Cc: linux-mips@linux-mips.org
In-Reply-To: <49fe6972-163d-3459-6963-582ffcc35b19@linux-m68k.org>
Hi Greg,
> On Fri, 9 Jun 2017 17:26:38 -0700, Paul Burton wrote:
> > Replace the macro definition of __cmpxchg() with an inline function,
> > which is easier to read & modify. The cmpxchg() & cmpxchg_local()
> > macros are adjusted to call the new __cmpxchg() function.
> >
> > Signed-off-by: Paul Burton <paul.burton@xxxxxxxxxx>
> > Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
> > Cc: linux-mips@xxxxxxxxxxxxxx
>
> I think this patch is breaking user space for me. I say "think"
> because it is a bit tricky to bisect for the few patches previous to this one
> since they won't compile cleanly for me (due to this
> https://www.spinics.net/lists/mips/msg68727.html).
>
> I have a Cavium Octeon 5010 MIPS64 CPU on a custom board, have been
> running it for years running various kernel versions. Linux-4.13 breaks for me,
> and I bisected back to this change.
>
> What I see is user space bomb strait after boot with console messages like
> this:
>
> mount[37] killed because of sig - 11
>
> STACK DUMP:
> <snip>
>
> I get a lot of them from various programs running from rc scripts.
> It never manages to fully boot to login/shell.
>
> If I take the linux-4.12 arch/mips/include/asm/cmpxchg.h and drop that in
> place on a linux-4.13 (or even linux-4.14-rc3) I can compile and run everything
> successfully.
>
> Any thoughts?
Are you running a uniprocessor/non-SMP kernel? Could you try this fix I submitted this fix 5 weeks ago:
https://patchwork.linux-mips.org/patch/17226/
Ralf: Could we get that merged please?
(Apologies if this email is formatted oddly.)
Thanks,
Paul
^ permalink raw reply
* Fwd: linux-next: Tree for Sep 29
From: Leon Romanovsky @ 2017-10-05 7:08 UTC (permalink / raw)
To: linux-rdma; +Cc: Doug Ledford
In-Reply-To: <20170929154838.4a3bc675-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
Hi All,
I don't know how many of you are following LKML and linux-next lists,
but be aware of the following Stephen's announcement.
*******
News: I will not be doing linux-next releases from Setp 30 to Oct 30
(inclusive).
*******
Thanks
---------- Forwarded message ----------
From: Stephen Rothwell <sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
Date: Fri, Sep 29, 2017 at 8:48 AM
Subject: linux-next: Tree for Sep 29
To: Linux-Next Mailing List <linux-next-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Linux Kernel Mailing List <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Hi all,
News: I will not be doing linux-next releases from Setp 30 to Oct 30
(inclusive).
Changes since 20170928:
The net-next tree gained a build failure, due to in interaction with the
net tree, for which I applied a merge fix patch.
The drm tree still had its build failure for which I applied a fix patch.
The ipmi tree lost its build failure.
The akpm tree lost a patch that turned up elsewhere.
Non-merge commits (relative to Linus' tree): 2815
2768 files changed, 96917 insertions(+), 40111 deletions(-)
----------------------------------------------------------------------------
I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/next/ ). If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one. You should use "git fetch" and checkout or reset to the new
master.
You can see which trees have been included by looking in the Next/Trees
file in the source. There are also quilt-import.log and merge.log
files in the Next directory. Between each merge, the tree was built
with a ppc64_defconfig for powerpc and an allmodconfig (with
CONFIG_BUILD_DOCSRC=n) for x86_64, a multi_v7_defconfig for arm and a
native build of tools/perf. After the final fixups (if any), I do an
x86_64 modules_install followed by builds for x86_64 allnoconfig,
powerpc allnoconfig (32 and 64 bit), ppc44x_defconfig, allyesconfig
and pseries_le_defconfig and i386, sparc and sparc64 defconfig. And
finally, a simple boot test of the powerpc pseries_le_defconfig kernel
in qemu.
Below is a summary of the state of the merge.
I am currently merging 267 trees (counting Linus' and 41 trees of bug
fix patches pending for the current merge release).
Stats about the size of the tree over time can be seen at
http://neuling.org/linux-next-size.html .
Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next . If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.
Thanks to Randy Dunlap for doing many randconfig builds. And to Paul
Gortmaker for triage and bug fixes.
--
Cheers,
Stephen Rothwell
$ git checkout master
$ git reset --hard stable
Merging origin/master (770b782f555d Merge tag 'acpi-4.14-rc3' of
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm)
Merging fixes/master (820bf5c419e4 Merge tag 'scsi-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi)
Merging kbuild-current/fixes (cd4175b11685 Merge branch
'parisc-4.14-2' of
git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux)
Merging arc-current/for-curr (ef6c1bae4792 arc: remove redundant
UTS_MACHINE define in arch/arc/Makefile)
Merging arm-current/fixes (746a272e4414 ARM: 8692/1: mm: abort uaccess
retries upon fatal signal)
Merging m68k-current/for-linus (558d5ad276c9 m68k/mac: Avoid
soft-lockup warning after mach_power_off)
Merging metag-fixes/fixes (b884a190afce metag/usercopy: Add missing fixups)
Merging powerpc-fixes/fixes (d8bd9f3f0925 powerpc: Handle MCE on
POWER9 with only DSISR bit 30 set)
Merging sparc/master (23198ddffb6c sparc32: Add cmpxchg64().)
Merging fscrypt-current/for-stable (42d97eb0ade3 fscrypt: fix renaming
and linking special files)
Merging net/master (9d538fa60bad net: Set sk_prot_creator when cloning
sockets to the right proto)
Merging ipsec/master (dd269db84908 xfrm: don't call
xfrm_policy_cache_flush under xfrm_state_lock)
Merging netfilter/master (7f4f7dd4417d netfilter: ipset: ipset list
may return wrong member count for set with timeout)
Merging ipvs/master (f7fb77fc1235 netfilter: nft_compat: check
extension hook mask only if set)
Merging wireless-drivers/master (3e747fa18202 Merge ath-current from ath.git)
Merging mac80211/master (265698d7e613 nl80211: fix null-ptr
dereference on invalid mesh configuration)
Merging sound-current/for-linus (bfc81a8bc18e ALSA: usb-audio: Check
out-of-bounds access by corrupted buffer descriptor)
Merging pci-current/for-linus (9561475db680 PCI: Fix race condition
with driver_override)
Merging driver-core.current/driver-core-linus (850fdec8d2fd driver
core: remove DRIVER_ATTR)
Merging tty.current/tty-linus (c91261437985 serial: sccnxp: Fix error
handling in sccnxp_probe())
Merging usb.current/usb-linus (8fec9355a968 USB: cdc-wdm: ignore
-EPIPE from GetEncapsulatedResponse)
Merging usb-gadget-fixes/fixes (c3cdce45f8d3 usb: dwc3: of-simple: Add
compatible for Spreadtrum SC9860 platform)
Merging usb-serial-fixes/usb-linus (c496ad835c31 USB: serial: cp210x:
add support for ELV TFD500)
Merging usb-chipidea-fixes/ci-for-usb-stable (cbb22ebcfb99 usb:
chipidea: core: check before accessing ci_role in ci_role_show)
Merging phy/fixes (26e03d803c81 phy: rockchip-typec: Don't set the aux
voltage swing to 400 mV)
Merging staging.current/staging-linus (b2e312061c5e Merge tag
'iio-fixes-for-4.14a' of
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into
staging-linus)
Merging char-misc.current/char-misc-linus (549e658a0919 Drivers: hv:
fcopy: restore correct transfer length)
Merging input-current/for-linus (05f5c3857647 Input: elan_i2c - extend
Flash-Write delay)
Merging crypto-current/master (40784d72aeeb crypto: axis - hide an
unused variable)
Merging ide/master (b671e1703394 PNP: ide: constify pnp_device_id)
Merging vfio-fixes/for-linus (796b755066dd vfio/pci: Fix handling of
RC integrated endpoint PCIe capability size)
Merging kselftest-fixes/fixes (eefd95e1f3d4 selftests: timers:
set-timer-lat: Fix hang when testing unsupported alarms)
Merging backlight-fixes/for-backlight-fixes (68feaca0b13e backlight:
pwm: Handle EPROBE_DEFER while requesting the PWM)
Merging ftrace-fixes/for-next-urgent (6224beb12e19 tracing: Have
branch tracer use recursive field of task struct)
Merging nand-fixes/nand/fixes (ee02f73e04c0 mtd: nand: atmel: Fix EDO
mode check)
Merging spi-nor-fixes/spi-nor/fixes (5771a8c08880 Linux v4.13-rc1)
Merging mfd-fixes/for-mfd-fixes (0f0fc5c09005 Revert "mfd: da9061: Fix
to remove BBAT_CONT register from chip model")
Merging v4l-dvb-fixes/fixes (db6321a1af84 media: platform:
VIDEO_QCOM_CAMSS should depend on HAS_DMA)
Merging reset-fixes/reset/fixes (544e3bf4f0e8 reset: Restrict
RESET_HSDK to ARC_SOC_HSDK or COMPILE_TEST)
Merging drm-intel-fixes/for-linux-next-fixes (2ba7d7e04371
drm/i915/bios: ignore HDMI on port A)
Merging drm-misc-fixes/for-linux-next-fixes (a98c75fcd0ec drm/tegra:
trace: Fix path to include)
Merging kbuild/for-next (cd4175b11685 Merge branch 'parisc-4.14-2' of
git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux)
Merging uuid/for-next (c0020756315e efi: switch to use new generic UUID API)
Merging dma-mapping/for-next (6d57339890c9 dma-coherent: fix
rmem_dma_device_init regression)
Merging asm-generic/master (a351e9b9fc24 Linux 4.11)
Merging arc/for-next (cc4a41fe5541 Linux 4.13-rc7)
Merging arm/for-next (67715a8964fc Merge branches 'fixes' and 'misc'
into for-next)
Merging arm-perf/for-next/perf (e884f80cf2a7 arm64: perf: add support
for Cortex-A35)
Merging arm-soc/for-next (ed3b42e5f399 ARM: SoC: Document merges)
Merging actions/for-next (2a6a17c006da Merge branch 'v4.15/dt' into next)
Merging alpine/alpine/for-next (a1144b2b1ec4 ARM: dts: alpine: add
valid clock-frequency values)
Merging amlogic/for-next (293cd5ae9884 Merge branch 'v4.14/drivers'
into tmp/aml-rebuild)
Merging aspeed/for-next (0eead81e7847 Merge branches 'dt-for-v4.14'
and 'defconfig-for-v4.14' into for-next)
Merging at91/at91-next (819b0a26fdd8 Merge tag 'at91-fixes' into at91-next)
Merging bcm2835/for-next (e83e7335d059 Merge branch
anholt/bcm2835-defconfig-next into for-next)
Merging berlin/berlin/for-next (5153351425c9 Merge branch 'berlin/dt'
into berlin/for-next)
Merging cortex-m/for-next (f719a0d6a854 ARM: efm32: switch to
vendor,device compatible strings)
Merging imx-mxs/for-next (88beee7ca525 Merge branch 'imx/defconfig'
into for-next)
Merging keystone/next (f922ce7bbcf5 Merge branch
'for_4.14/keystone_dts' into next)
Merging mvebu/for-next (d04177d6b4d2 Merge branch 'mvebu/dt64' into
mvebu/for-next)
Merging omap/for-next (fa2cc631e60b Merge branch 'omap-for-v4.15/soc'
into for-next)
Merging omap-pending/for-next (c20c8f750d9f ARM: OMAP2+: hwmod: fix
_idle() hwmod state sanity check sequence)
Merging reset/reset/next (66f2be767b22 reset: socfpga: build the
reset-socfpga for Stratix10 SOC)
Merging qcom/for-next (b212aba8f7bf Merge tag 'qcom-drivers-for-4.14'
into final-for-sure-4.14)
Merging realtek/for-next (74e912bc01df Merge branch 'v4.15/dt64' into next)
Merging renesas/next (4383639823e5 Merge branch 'dt-for-v4.15' into next)
Merging rockchip/for-next (0b224812590c Merge branch
'v4.14-armsoc/fixes64' into for-next)
Merging rpi/for-rpi-next (bc0195aad0da Linux 4.2-rc2)
Merging samsung/for-next (2ea659a9ef48 Linux 4.12-rc1)
Merging samsung-krzk/for-next (3bf689f9275f ARM: dts: exynos: Add dwc3
SUSPHY quirk)
Merging sunxi/sunxi/for-next (3b428b0f8e9b Merge branches
'sunxi/dt-for-4.15' and 'sunxi/dt64-for-4.15' into sunxi/for-next)
Merging tegra/for-next (b4aed883ebbe Merge branch
for-4.14/arm/defconfig into for-next)
Merging arm64/for-next/core (d1be5c99a034 arm64: cleanup
{COMPAT_,}SET_PERSONALITY() macro)
Merging clk/clk-next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging clk-samsung/for-next (8834b0950156 clk: samsung: Delete a
memory allocation error message in clk-cpu.c)
Merging c6x/for-linux-next (62016565bb04 c6x: remove unused
KTHREAD_SIZE definition)
Merging cris/for-next (8f50f2a1b46a cris: No need to append -O2 and
$(LINUXINCLUDE))
Merging h8300/h8300-next (58c57526711f h8300: Add missing include file
to asm/io.h)
Merging hexagon/linux-next (02cc2ccfe771 Revert "Hexagon: fix signal.c
compile error")
Merging ia64/next (fbb0e4da96f4 ia64: salinfo: use a waitqueue instead
a sema down/up combo)
Merging m68k/for-next (10df0ba4c2c2 m68k/defconfig: Update defconfigs
for v4.14-rc1)
Merging m68knommu/for-next (6f75ec3ed368 m68k: allow ColdFire m5441x
parts to run with MMU enabled)
Merging metag/for-next (e3cd7f013bac metag/mm: Drop pointless increment)
Merging microblaze/next (428dbf156cc5 arch: change default endian for
microblaze)
Merging mips/mips-for-linux-next (f6cccc012695 Merge branches
'4.14-fixes' and '4.15-features' into mips-for-linux-next)
Merging nios2/for-next (65d1e3ddeae1 nios2: time: Read timer in
get_cycles only if initialized)
Merging openrisc/for-next (56ce2f25ab0d openrisc: add forward
declaration for struct vm_area_struct)
Merging parisc-hd/for-next (3229c9219c30 parisc: Add CPU topology support)
Merging powerpc/next (5080332c2c89 powerpc/64s: Add workaround for P9
vector CI load issue)
Merging fsl/next (a4e89ffb5923 powerpc/e6500: Update machine check for
L1D cache err)
Merging mpc5xxx/next (39e69f55f857 powerpc: Introduce the use of the
managed version of kzalloc)
Merging s390/features (0a5aa4846f4b s390/ccwgroup: tie a ccwgroup
driver to its ccw driver)
Merging sparc-next/master (9cd6681cb116 Merge branch 'for_linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs)
Merging sh/for-next (6e2fbfdd585f sh: fix futex FUTEX_OP_SET op on
userspace addresses)
Merging tile/master (637f23abca87 tile: array underflow in setup_maxnodemem())
Merging uml/linux-next (6d20e6b235aa um: return negative in tuntap_open_tramp())
Merging unicore32/unicore32 (bc27113620ca unicore32-oldabi: add oldabi
syscall interface)
CONFLICT (content): Merge conflict in arch/unicore32/include/asm/Kbuild
Merging xtensa/xtensa-for-next (271335b9726e Merge branch
'xtensa-fixes' into xtensa-for-next)
Merging fscrypt/master (c250b7dd8e73 fscrypt: make ->dummy_context()
return bool)
Merging befs/for-next (5771a8c08880 Linux v4.13-rc1)
Merging btrfs/next (5226fcac7841 squashfs: Add zstd support)
Merging btrfs-kdave/for-next (3d90af17fbee Merge branch
'for-next-next-v4.14-20170925' into for-next-20170925)
Merging ceph/master (717e6f2893eb ceph: avoid panic in
create_session_open_msg() if utsname() returns NULL)
Merging cifs/for-next (fcbc4b4c7f5d cifs: handle large EA requests
more gracefully in smb2+)
Merging configfs/for-next (19e72d3abb63 configfs: Introduce
config_item_get_unless_zero())
Merging ecryptfs/next (be280b25c328 ecryptfs: remove private bin2hex
implementation)
Merging ext3/for_next (4c6bb69663b3 quota: Fix quota corruption with
generic/232 test)
Merging ext4/dev (b5f515735bea ext4: avoid Y2038 overflow in recently_deleted())
Merging f2fs/dev (e365806ac289 Merge branch 'for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs)
Merging freevxfs/for-next (bf1bb4b460c8 freevxfs: update Kconfig information)
Merging fscache/fscache (d52bd54db8be Merge branch 'akpm' (patches from Andrew))
Merging fuse/for-next (5b97eeacbd80 fuse: getattr cleanup)
Merging jfs/jfs-next (f070e5ac9bc7 jfs: preserve i_mode if
__jfs_set_acl() fails)
Merging nfs/linux-next (e19b205be43d Linux 4.14-rc2)
Merging nfsd/nfsd-next (7d34cd12061d MAINTAINERS: associate linux/fs.h
with VFS instead of file locking)
Merging orangefs/for-next (0b08273c8ab7 orangefs: Adjust three checks
for null pointers)
Merging overlayfs/overlayfs-next (939ae4efd51c ovl: fix false positive
ESTALE on lookup)
Merging v9fs/for-next (a333e4bf2556 fs/9p: use fscache mutex rather
than spinlock)
Merging ubifs/linux-next (89b68cd92663 UBI: Fix two typos in comments)
Merging xfs/for-next (5e5c943c1f25 xfs: revert "xfs: factor rmap btree
size into the indlen calculations")
Merging file-locks/locks-next (3b9f8ed25dbe Merge branch 'for-4.14' of
git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata)
Merging vfs/for-next (f8340cc34799 mips: switch to {get,put}_compat_sigset())
Merging vfs-jk/vfs (030b533c4fd4 fs: Avoid premature clearing of capabilities)
Merging vfs-miklos/next (0eb8af4916a5 vfs: use helper for calling f_op->fsync())
Merging printk/for-next (077a1cc06f72 printk: Clean up do_syslog()
error handling)
Merging pci/next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging pstore/for-next/pstore (e19b205be43d Linux 4.14-rc2)
Merging hid/for-next (abbc4db7a3a0 Merge branch 'for-4.14/upstream'
into for-next)
Merging i2c/i2c/for-next (aeb068c57214 i2c: i2c-stm32f7: add driver)
Merging jdelvare-hwmon/master (08d27eb20666 Merge branch 'for-linus'
of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs)
Merging dmi/master (e181b8c089da firmware: dmi_scan: Fix handling of
empty DMI strings)
Merging hwmon-staging/hwmon-next (0fc85a358283 hwmon: (sht15) remove
redundant check on status and send of status value)
Merging jc_docs/docs-next (5cb5c31cdf24 scripts/kernel-doc: warn on
excess enum value descriptions)
Merging v4l-dvb/master (d5426f4c2eba media: staging: atomisp: use
clock framework for camera clocks)
Merging v4l-dvb-next/master (1efdf1776e22 media: leds: as3645a: add
V4L2_FLASH_LED_CLASS dependency)
Merging fbdev/fbdev-for-next (23e9f4ef99dd video/console: Update BIOS
dates list for GPD win console rotation DMI quirk)
Merging pm/linux-next (273a1f886725 Merge branch 'pm-cpufreq' into linux-next)
Merging idle/next (306899f94804 x86 tsc: Add the Intel Denverton
Processor to native_calibrate_tsc())
Merging thermal/next (02bc1bd0498c Merge branch 'imx-nvmem' into next)
Merging thermal-soc/next (aa647852c32a Merge branch 'work-linus' into work-next)
Merging ieee1394/for-next (72f3c27aa646 firewire: net: max MTU off by one)
Merging dlm/next (9e1b0211c5dd dlm: recheck kthread_should_stop()
before schedule())
Merging swiotlb/linux-next (69369f52d28a swiotlb-xen: implement
xen_swiotlb_get_sgtable callback)
Merging net-next/master (de9c8a6a5f08 Merge branch 'hns3-dcb')
CONFLICT (content): Merge conflict in lib/kobject_uevent.c
Applying: net: dsa: merge fix patch for removal of phy
Merging ipsec-next/master (a1b831f23a2b xfrm: eradicate size_t)
Merging netfilter-next/master (80cee03bf1d6 Merge branch 'linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6)
Merging nfc-next/master (bd751808f9ff NFC: trf7970a: Correct register
settings for 27MHz clock)
Merging ipvs-next/master (a910d20aa007 netfilter: ipvs: Fix space
before '[' error.)
Merging wireless-drivers-next/master (96cbe3d638e4 b43: make const
arrays static, reduces object code size)
Merging bluetooth/master (76c539162f61 Bluetooth: btmrvl: *_err() and
*_info() strings should end with newlines)
Merging mac80211-next/master (1bd773c077de wireless: set correct
mandatory rate flags)
Merging rdma/for-next (1848757c3d8b Merge branches 'hns' and 'misc'
into k.o/for-next)
Merging gfs2/for-next (c2c4be28c248 gfs2: Always update inode ctime in set_acl)
Merging mtd/master (36de80740008 mtd: nand: atmel: fix buffer overflow
in atmel_pmecc_user)
Merging l2-mtd/master (d1f936d73683 Merge tag 'nand/for-4.14' of
git://git.infradead.org/l2-mtd into mtd/next)
Merging nand/nand/next (e8901f3ab5b5 dt-bindings: nand: denali: reduce
the register space in the example)
Merging spi-nor/spi-nor/next (90074de6630f mtd: spi-nor: fix DMA
unsafe buffer issue in spi_nor_read_sfdp())
Merging crypto/master (f0e2ce58f853 crypto: brcm - Explicity ACK
mailbox message)
Merging drm/drm-next (754270c7c562 Merge branch 'drm-next-4.15' of
git://people.freedesktop.org/~agd5f/linux into drm-next)
Applying: drm/amd/powerplay: uniquify ci_send_msg_to_smc
Merging drm-panel/drm/panel/for-next (e4bac408b084 drm/panel: simple:
Add support for Winstar WF35LTIACD)
Merging drm-intel/for-linux-next (4dd504f7d98a drm/i915: Use
memset64() to prefill the GTT page)
Merging drm-tegra/drm/tegra/for-next (65d5d30ccebd drm/tegra: trace:
Fix path to include)
Merging drm-misc/for-linux-next (7f909d9c74f3 drm/rockchip: Rely on
the default best_encoder() behavior)
Merging drm-exynos/exynos-drm/for-next (7d1e04231461 Merge tag
'usercopy-v4.8-rc8' of
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux)
Merging drm-msm/msm-next (642e5ef8c6c4 drm/msm: fix _NO_IMPLICIT fencing case)
Merging hdlcd/for-upstream/hdlcd (fee4964f0a6c drm/arm: hdlcd: remove
unused variables)
Merging mali-dp/for-upstream/mali-dp (e46477b8f23c drm: mali-dp:
Restore commit_tail behaviour to the runtime_pm friendly version.)
Merging sunxi-drm/sunxi-drm/for-next (7dafb83edd32 Merge branches
'sunxi/drm-fixes-for-4.13' and 'sunxi/drm-for-4.14' into
sunxi-drm/for-next)
Merging imx-drm/imx-drm/next (9303519985ed drm/imx: parallel-display:
use correct connector enum)
Merging etnaviv/etnaviv/next (65375b873cb5 drm/etnaviv: switch GEM
allocations to __GFP_RETRY_MAYFAIL)
Merging kconfig/for-next (6f7da290413b Linux 4.12)
Merging regmap/for-next (1874021ec3a8 Merge remote-tracking branches
'regmap/topic/const' and 'regmap/topic/namespace' into regmap-next)
Merging sound/for-next (729fbfc92a45 ALSA: line6: add support for POD
HD DESKTOP)
Merging sound-asoc/for-next (ca23461fc30b Merge remote-tracking
branches 'asoc/topic/tas571x', 'asoc/topic/tfa9879',
'asoc/topic/ts3a277e', 'asoc/topic/wm97xx' and 'asoc/topic/zte' into
asoc-next)
Merging modules/modules-next (0bf8bf50eddc module: Remove const
attribute from alias for MODULE_DEVICE_TABLE)
Merging input/next (8d25fee28450 Input: usbtouchscreen - use EXPERT
instead of EMBEDDED for EasyTouch)
Merging block/for-next (0b508bc926bd block: fix a build error)
Merging lightnvm/for-next (1c6286f26301 lightnvm: fix some error code
in pblk-init.c)
Merging device-mapper/for-next (bd86e3205952 dm crypt: fix memory leak
in crypt_ctr_cipher_old())
Merging pcmcia/master (e8e68fd86d22 pcmcia: do not break
rsrc_nonstatic when handling anonymous cards)
Merging mmc/next (5aa83fb178e3 mmc-host: mxcmmc: use setup_timer() helper.)
Merging kgdb/kgdb-next (7a6653fca500 kdb: Fix handling of
kallsyms_symbol_next() return value)
Merging md/for-next (7d5d7b5058fb md/raid5: cap worker count)
Merging mfd/for-mfd-next (b01e9348e106 mfd: intel_soc_pmic:
Differentiate between Bay and Cherry Trail CRC variants)
Merging backlight/for-backlight-next (2606706e4d7b backlight:
gpio_backlight: Delete pdata inversion)
Merging battery/for-next (5d01fd38a3b0 power: supply: bq27xxx: enable
writing capacity values for bq27421)
Merging omap_dss2/for-next (c456a2f30de5 video: smscufx: remove unused variable)
Merging regulator/for-next (e19b205be43d Linux 4.14-rc2)
Merging security/next-testing (ab5348c9c23c security: fix description
of values returned by cap_inode_need_killpriv)
Merging integrity/next (ed301d2614d2 ima: define "fs_unsafe" builtin policy)
CONFLICT (add/add): Merge conflict in security/apparmor/include/sig_names.h
Merging keys/keys-next (8ab2a6905b28 KEYS: Add documentation for
asymmetric keyring restrictions)
Merging selinux/next (7c620ece125c selinux: Use kmem_cache for hashtab_node)
Merging tpmdd/next (d24fc04f4cc6 tpm: fix type of a local variables in
tpm_tis_spi.c)
Merging watchdog/master (4cb30b044a8f watchdog: mei_wdt: constify
mei_cl_device_id)
Merging iommu/next (74ebe8c61aa7 Merge branches 'iommu/fixes',
'arm/omap', 'arm/exynos' and 'core' into next)
Merging dwmw2-iommu/master (910170442944 iommu/vt-d: Fix PASID table allocation)
Merging vfio/next (417fb50d5516 vfio: platform: constify amba_id)
Merging trivial/for-next (6fbc8798d946 tty: fix comment for
__tty_alloc_driver())
Merging audit/next (462d9d959613 audit: use audit_set_enabled() in
audit_enable())
Merging devicetree/for-next (092267d260d2 Merge branch 'dt-printf-v2'
into dt/next)
Merging mailbox/mailbox-for-next (1da92afbbfcd mailbox:
bcm-flexrm-mailbox: Use txdone_ack instead of txdone_poll)
Merging spi/for-next (e0e4c1bd49ea Merge remote-tracking branches
'spi/topic/slave' and 'spi/topic/spreadtrum' into spi-next)
Merging tip/auto-latest (31b2e7211636 Merge branch 'timers/urgent')
Merging clockevents/clockevents/next (6ec6257f8981 MAINTAINERS: Fix
path and add bindings to timers)
Merging edac/linux_next (345fb0a9a634 Merge tag 'edac_for_4.11' of
git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp)
Merging edac-amd/for-next (88ae80aa609c EDAC, skx_edac: Handle systems
with segmented PCI busses)
Merging irqchip/irqchip/for-next (c1ae3cfa0e89 Linux 4.11-rc1)
Merging ftrace/for-next (170b3b1050e2 tracing: Apply trace_clock
changes to instance max buffer)
Merging rcu/rcu/next (9111b9361f2e EXP: Fine-grained timer diagnostics)
Merging kvm/linux-next (31afb2ea2b10 KVM: VMX: simplify and fix
vmx_vcpu_pi_load)
Merging kvm-arm/next (9b87e7a8bfb5 KVM: arm/arm64: Support uaccess of GICC_APRn)
Merging kvm-mips/next (dc44abd6aad2 KVM: MIPS/Emulate: Properly
implement TLBR for T&E)
Merging kvm-ppc/kvm-ppc-next (67f8a8c1151c KVM: PPC: Book3S HV: Fix
bug causing host SLB to be restored incorrectly)
Merging kvms390/next (c95c895303ed KVM: s390: vsie: cleanup mcck reinjection)
Merging xen-tip/linux-next (0d805ee70a69 xen/mmu: Call
xen_cleanhighmap() with 4MB aligned for page tables mapping)
Merging percpu/for-next (1fa4df3e6889 percpu: fix iteration to prevent
skipping over block)
Merging workqueues/for-next (ebb2c2437d80 Merge tag 'mmc-v4.14-2' of
git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc)
Merging drivers-x86/for-next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging chrome-platform/for-next (859eb05676f6 platform/chrome: Use
proper protocol transfer function)
Merging hsi/for-next (67ddd75771b6 HSI: core: Use kcalloc() in two functions)
Merging leds/for-next (f292bbfaa69d leds: Replace flags bit shift with
BIT() macros)
Merging ipmi/for-next (b79bba15b3f2 ipmi: remove redundant
initialization of bmc)
Merging driver-core/driver-core-next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging usb/usb-next (38502ef49f96 usb: storage: make const arrays
static, reduces object code size)
Merging usb-gadget/next (0852659ef071 usb: gadget: f_ncm/u_ether: Move
'SKB reserve' quirk setup to u_ether)
Merging usb-serial/usb-next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging usb-chipidea-next/ci-for-usb-next (fc5b920c3b9b usb: chipidea:
do charger detection in vbus session)
Merging phy-next/next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging tty/tty-next (be7da1a2b714 serial: imx: default to half duplex rs485)
Merging char-misc/char-misc-next (e701c67c30e6 nvmem: remove unneeded
IS_ENABLED(CONFIG_NVMEM) conditional)
Merging extcon/extcon-next (f12c89504cb8 extcon: make extcon_info
static const, fixes warning)
Merging staging/staging-next (b6e2b3e1c53c staging: speakup: Fix
comment block coding style)
Merging mux/for-next (aae4e7a8bc44 Linux 4.13-rc4)
Merging slave-dma/next (626f9d448571 Merge branch 'fixes' into next)
Merging cgroup/for-next (b9d66d0a0071 Merge branch 'for-4.15' into for-next)
Merging scsi/for-next (74316f626715 Merge branch 'misc' into for-next)
Merging scsi-mkp/for-next (7dad16913b76 scsi: libsas: remove unused
variable sas_ha)
Merging target-updates/for-next (04229774f692 tcmu: Oops in unmap_thread_fn())
Merging target-merge/for-next-merge (2994a7518317 cxgb4: update
Kconfig and Makefile)
Merging target-bva/for-next (2ea659a9ef48 Linux 4.12-rc1)
Merging libata/for-next (9826313227fe Merge branch 'for-4.15' into for-next)
Merging binfmt_misc/for-next (4af75df6a410 binfmt_misc: add F option
description to documentation)
Merging vhost/linux-next (ac7380709f65 vhost: fix end of range for access_ok)
Merging rpmsg/for-next (7148e5c13dd7 Merge branches 'hwspinlock-next',
'rpmsg-next' and 'rproc-next' into for-next)
Merging gpio/for-next (45f54d0b89b4 Merge branch 'devel' into for-next)
Merging pinctrl/for-next (31c2edff2034 Merge branch 'devel' into for-next)
Merging pinctrl-samsung/for-next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging pwm/for-next (7755daf5e7e8 Merge branch 'for-4.14/drivers'
into for-next)
Merging dma-buf/for-next (194cad44c4e1 dma-buf/sync_file: improve
Kconfig description for Sync Files)
CONFLICT (content): Merge conflict in drivers/dma-buf/Kconfig
Merging userns/for-next (076a9bcacfc7 signal/mips: Remove FPE_FIXME
usage from mips)
Merging ktest/for-next (f7c6401ff84a ktest: Make sure wait_for_input
does honor the timeout)
Merging random/dev (72e5c740f633 random: reorder READ_ONCE() in get_random_uXX)
Merging aio/master (2a8a98673c13 fs: aio: fix the increment of aio-nr
and counting against aio-max-nr)
Merging kselftest/next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging y2038/y2038 (69973b830859 Linux 4.9)
Merging luto-misc/next (2dcd0af568b0 Linux 4.6)
Merging borntraeger/linux-next (e76d21c40bd6 Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net)
Merging livepatching/for-next (26d8d1e9bb48 Merge branch
'for-4.12/upstream-fixes' into for-next)
Merging coresight/next (096d08d830e9 coresight: Extend the PIDR mask
to cover relevant bits in PIDR2)
Merging rtc/rtc-next (74717b28cb32 rtc: set the alarm to the next
expiring timer)
Merging hwspinlock/for-next (bd5717a4632c hwspinlock: qcom: Correct
msb in regmap_field)
Merging nvdimm/libnvdimm-for-next (2bd6bf03f4c1 Linux 4.14-rc1)
Merging dax-misc/dax-misc (4d9a2c874667 dax: Remove i_mmap_lock protection)
Merging idr/idr-4.11 (f0f3f2d0a3e0 radix tree test suite: Specify -m32
in LDFLAGS too)
Merging kspp/for-next/kspp (be53cdda2fdd lkdtm: Update usercopy tests
for whitelisting)
Merging akpm-current/current (f5185a067d62
kernel-reboot-add-devm_register_reboot_notifier-fix)
CONFLICT (content): Merge conflict in include/linux/sched/mm.h
$ git checkout -b akpm remotes/origin/akpm/master
Applying: iopoll: avoid -Wint-in-bool-context warning
Applying: MAINTAINERS: update TPM driver infrastructure changes
Applying: drivers/pcmcia/sa1111_badge4.c: avoid unused function warning
Applying: sparc64: NG4 memset 32 bits overflow
Applying: lib/crc-ccitt: add CCITT-FALSE CRC16 variant
Merging akpm/master (4ca222de662d lib/crc-ccitt: add CCITT-FALSE CRC16 variant)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v8 2/2] media:imx274 V4l2 driver for Sony imx274 CMOS sensor
From: Sakari Ailus @ 2017-10-05 7:09 UTC (permalink / raw)
To: Leon Luo
Cc: Sakari Ailus, mchehab-DgEjT+Ai2ygdnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w,
linux-media-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sören Brinkmann
In-Reply-To: <CADu3m9y+GUaD3LXBO-TBpQj2VYR2Js_c85J9+B=ZZnpW7Jr9fQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Leon,
On Thu, Oct 05, 2017 at 12:06:16AM -0700, Leon Luo wrote:
> Hi Sakari,
> I just got an email saying the patch is accepted. Do I still need to do
> anything here? Do I need to add MEDIA_CAMERA_SUPPORT dependency to
> Kconfig and submit a new version?
Please don't send HTML e-mail.
I've added the Kconfig dependency so there's no need to send further
versions of the patch.
--
Regards,
Sakari Ailus
sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v8 2/2] media:imx274 V4l2 driver for Sony imx274 CMOS sensor
From: Sakari Ailus @ 2017-10-05 7:09 UTC (permalink / raw)
To: Leon Luo
Cc: Sakari Ailus, mchehab, robh+dt, mark.rutland, hans.verkuil,
linux-media, devicetree, linux-kernel, Sören Brinkmann
In-Reply-To: <CADu3m9y+GUaD3LXBO-TBpQj2VYR2Js_c85J9+B=ZZnpW7Jr9fQ@mail.gmail.com>
Hi Leon,
On Thu, Oct 05, 2017 at 12:06:16AM -0700, Leon Luo wrote:
> Hi Sakari,
> I just got an email saying the patch is accepted. Do I still need to do
> anything here? Do I need to add MEDIA_CAMERA_SUPPORT dependency to
> Kconfig and submit a new version?
Please don't send HTML e-mail.
I've added the Kconfig dependency so there's no need to send further
versions of the patch.
--
Regards,
Sakari Ailus
sakari.ailus@linux.intel.com
^ permalink raw reply
* (unknown),
From: mgriffit @ 2017-10-05 7:10 UTC (permalink / raw)
To: linux-ide
[-- Attachment #1: INFO_22673_linux-ide.zip --]
[-- Type: application/zip, Size: 7245 bytes --]
^ permalink raw reply
* Re: [PATCH v4 05/14] platform/x86: dell-wmi-descriptor: split WMI descriptor into it's own driver
From: Darren Hart @ 2017-10-05 7:11 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Mario Limonciello, LKML, Platform Driver, Andy Lutomirski,
quasisec, Pali Rohár, Rafael J. Wysocki, mjg59,
Christoph Hellwig, Greg KH
In-Reply-To: <CAHp75Vc0umEt0cGn5-NWva6j1T0yry1Ag7Egnn4iSvz=cs_kTg@mail.gmail.com>
On Thu, Oct 05, 2017 at 08:29:10AM +0300, Andy Shevchenko wrote:
> On Thu, Oct 5, 2017 at 4:09 AM, Darren Hart <dvhart@infradead.org> wrote:
> > On Wed, Oct 04, 2017 at 05:48:31PM -0500, Mario Limonciello wrote:
> >> All communication on individual GUIDs should occur in separate drivers.
> >> Allowing a driver to communicate with the bus to another GUID is just
> >> a hack that discourages drivers to adopt the bus model.
> >>
> >> The information found from the WMI descriptor driver is now exported
> >> for use by other drivers.
>
> > You'll want to add something like:
> >
> > #ifdef CONFIG_DELL_WMI_DESCRIPTOR_MODULE
> > if (request_module("dell_wmi_descriptor"))
> > /* FAIL */
> > #endif
> >
> > During init.
>
> I don't think #ifdef is needed.
Without the ifdef, we can't distinguish between request_module failing
to load the module because it isn't available and because it is
built-in.
>
> We may just request module.
>
> But looking in the code it seems that we simple need to select that
> module. No request_module will be needed.
The select will ensure the module is built, but there is not guarantee
to module load order. The intent of the above is to ensure the symbols
from the required module are loaded.
> Did I miss something?
Or I did :-) Is there something about this module which ensures
dell_wmi_descriptor is loaded first?
--
Darren Hart
VMware Open Source Technology Center
^ permalink raw reply
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] linux-user: Add random ioctls
From: Laurent Vivier @ 2017-10-05 7:12 UTC (permalink / raw)
To: Marco A L Barbosa, qemu-devel; +Cc: qemu-trivial
In-Reply-To: <CAHpsRN-XzxjJZb=rb0iHMv4Afv=2H3N5U7p4+NNJFPkxgSLMXg@mail.gmail.com>
On 05/10/2017 00:06, Marco A L Barbosa wrote:
> I don't know how (and if it is necessary) to add buf field to
> rand_pool_info struct. See
> https://github.com/torvalds/linux/blob/5924bbecd0267d87c24110cbe2041b5075173a25/include/uapi/linux/random.h#L17
I doesn't look really trivial...
To manage the buf field you must read buf_size and it cannot be done in
a generic way: you must define a function to translate the buffer, use
IOCTL_SPECIAL() with RNDADDENTROPY and RNDGETPOOL.
You should send your patch using "git send-email" or "git publish"
instead of adding it in you email client.
> Signed-off-by: Marco A L Barbosa <malbarbo@gmail.com
> <mailto:malbarbo@gmail.com>>
> ---
> linux-user/ioctls.h | 7 +++++++
> linux-user/syscall.c | 1 +
> linux-user/syscall_defs.h | 9 +++++++++
> linux-user/syscall_types.h | 4 ++++
> 4 files changed, 21 insertions(+)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index e6997ff230..9240a83f30 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -173,6 +173,13 @@
> IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
> IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
>
> + IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
> + IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rand_pool_info)))
..., MK_PTR(TYPE_INT)
> + IOCTL(RNDGETPOOL, IOC_R, MK_PTR(TYPE_INT))
... MK_PTR(MK_STRUCT(STRUCT_rand_pool_info))
Thanks,
Laurent
^ permalink raw reply
* Re: [Qemu-trivial] [PATCH] linux-user: Add random ioctls
From: Laurent Vivier @ 2017-10-05 7:12 UTC (permalink / raw)
To: Marco A L Barbosa, qemu-devel; +Cc: qemu-trivial
In-Reply-To: <CAHpsRN-XzxjJZb=rb0iHMv4Afv=2H3N5U7p4+NNJFPkxgSLMXg@mail.gmail.com>
On 05/10/2017 00:06, Marco A L Barbosa wrote:
> I don't know how (and if it is necessary) to add buf field to
> rand_pool_info struct. See
> https://github.com/torvalds/linux/blob/5924bbecd0267d87c24110cbe2041b5075173a25/include/uapi/linux/random.h#L17
I doesn't look really trivial...
To manage the buf field you must read buf_size and it cannot be done in
a generic way: you must define a function to translate the buffer, use
IOCTL_SPECIAL() with RNDADDENTROPY and RNDGETPOOL.
You should send your patch using "git send-email" or "git publish"
instead of adding it in you email client.
> Signed-off-by: Marco A L Barbosa <malbarbo@gmail.com
> <mailto:malbarbo@gmail.com>>
> ---
> linux-user/ioctls.h | 7 +++++++
> linux-user/syscall.c | 1 +
> linux-user/syscall_defs.h | 9 +++++++++
> linux-user/syscall_types.h | 4 ++++
> 4 files changed, 21 insertions(+)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index e6997ff230..9240a83f30 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -173,6 +173,13 @@
> IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
> IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
>
> + IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
> + IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rand_pool_info)))
..., MK_PTR(TYPE_INT)
> + IOCTL(RNDGETPOOL, IOC_R, MK_PTR(TYPE_INT))
... MK_PTR(MK_STRUCT(STRUCT_rand_pool_info))
Thanks,
Laurent
^ permalink raw reply
* [PATCH] doc: Add missing LTE interface to Interfaces list
From: John Ernberg @ 2017-10-05 7:14 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
From: John Ernberg <john.ernberg@actia.se>
---
doc/modem-api.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/doc/modem-api.txt b/doc/modem-api.txt
index c0a575f..6462b17 100644
--- a/doc/modem-api.txt
+++ b/doc/modem-api.txt
@@ -127,6 +127,7 @@ Properties boolean Powered [readwrite]
org.ofono.CallVolume
org.ofono.CellBroadcast
org.ofono.Handsfree
+ org.ofono.LongTermEvolution
org.ofono.LocationReporting
org.ofono.MessageManager
org.ofono.MessageWaiting
--
2.7.4
^ permalink raw reply related
* Re: [PATCH 16/25] xfs: scrub inodes
From: Dave Chinner @ 2017-10-05 7:13 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
In-Reply-To: <20171005052219.GE7122@magnolia>
On Wed, Oct 04, 2017 at 10:22:19PM -0700, Darrick J. Wong wrote:
> On Thu, Oct 05, 2017 at 03:04:52PM +1100, Dave Chinner wrote:
> > On Tue, Oct 03, 2017 at 01:42:30PM -0700, Darrick J. Wong wrote:
> > > + error = xfs_iget(mp, NULL, sc->sm->sm_ino, XFS_IGET_UNTRUSTED,
> > > + 0, &ips);
> >
> > I think we also want XFS_IGET_DONTCACHE here, so we don't trash the
> > inode cache with inodes that we use once for scrub and never touch
> > again.
>
> I thought about adding this, but if we let the inodes fall out of the
> cache now then we'll just have to load them back in for the bmap checks,
> right?
Well, I'm looking at ensuring that we don't blow out the memory
side of things. We've still got the inode buffer in the buffer
cache, so I don't see why we should double cache these things
and then leave both cached copied hanging around after we've
finished with them. Leave the buffer around because we do a fair few
checks with it, but don't use excessive icache memory and trash the
working set if we can avoid it...
> > > +xfs_scrub_checkpoint_log(
> > > + struct xfs_mount *mp)
> > > +{
> > > + int error;
> > > +
> > > + error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL);
> > > + if (error)
> > > + return error;
> > > + xfs_ail_push_all_sync(mp->m_ail);
> > > + return 0;
> > > +}
> >
> > Oooo, that's a nasty thing to do on busy systems with large dirty
> > logs. I hope this is a "last resort" kind of thing....
>
> It is; we only do this if the inobt says there's an inode there and the
> inode verifiers fail.
Ok, so why would pushing the log and the AIL make the verifier then
succeed? how likely is this to occur on a busy system?
> > > +/* Set us up with an inode. */
> >
> > What state are we trying to get the inode into here? We grab all the
> > various locks, but we can still have data changing via mmap pages
> > that are already faulted in and delalloc extents in the incore
> > extent list that aren't reflected on disk...
> >
> > A comment explaining what we expect here would be nice.
>
> /*
> * Grab total control of the inode metadata. It doesn't matter here if
> * the file data is still changing, we just want exclusive access to the
> * metadata.
> */
*nod*
> > > + /* Got the inode, lock it and we're ready to go. */
> > > + sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
> > > + xfs_ilock(sc->ip, sc->ilock_flags);
> > > + error = xfs_scrub_trans_alloc(sc->sm, mp, &sc->tp);
> > > + if (error)
> > > + goto out_unlock;
> > > + sc->ilock_flags |= XFS_ILOCK_EXCL;
> > > + xfs_ilock(sc->ip, XFS_ILOCK_EXCL);
> >
> > Should the inode be joined to the transaction so that cancelling the
> > transaction unlocks the inode? Then the need for the ilock_flags
> > variable goes away....
>
> This is the confluence of two semi-icky things: first, some of the
> scrubbers (particularly the dir and parent pointer scrubbers) will need
> to drop the ILOCK for short periods of time; later on, repair will want
> to keep the inode locked across all the repair transactions, so it makes
> more sense to control the lock and unlock directly.
Ok, I'll pass on this for now, see how the rest of the code falls
out.
> > > + /* di_size */
> > > + isize = be64_to_cpu(dip->di_size);
> > > + if (isize & (1ULL << 63))
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> >
> > Should we be checking against the on disk format size, or the
> > mounted filesystem maximum size (i.e. mp->m_super->s_maxbytes)?
> > 32 or 64 bit systems are going to have different maximum valid file
> > sizes..
>
> It's perfectly valid to 'truncate -s $((2 ** 60) foofile' so the only
Ugh. We can't do IO past 16TB on 32 bit systems, so I'm kinda
surprised truncate doesn't have the same s_maxbytes restriction...
> thing we can really check for here is that the upper bit isn't set
> (because the VFS does not check, but barfs on, files with that large of
> a size).
xfs_max_file_offset() sets the max file offset to 2^63 - 1, so it
looks like the lack of checking in truncate is the problem here,
not the IO path.
> > Directories have a maximum bound size, too - the data space, leaf
> > space and freespace space, each of which are 32GB in size, IIRC.
> >
> > And symlinks have a different maximum size, too.
>
> Fair enough, I'll expand the i_size checks, though ISTR the verifiers
> now check that for us.
If they do, then just drop a comment in there to say what is checked
by the verifier.
> > > + if (!S_ISDIR(mode) && !S_ISREG(mode) && !S_ISLNK(mode) && isize != 0)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> >
> > > +
> > > + /* di_nblocks */
> > > + if (flags2 & XFS_DIFLAG2_REFLINK) {
> > > + ; /* nblocks can exceed dblocks */
> > > + } else if (flags & XFS_DIFLAG_REALTIME) {
> > > + if (be64_to_cpu(dip->di_nblocks) >=
> > > + mp->m_sb.sb_dblocks + mp->m_sb.sb_rblocks)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> >
> > That doesn't seem right. the file can be on either the data or the
> > rt device, so the maximum file blocks is the size of one device or
> > the other, not both combined.
>
> di_nblocks is the sum of (data blocks + bmbt blocks + attr blocks),
> right?
Yeah, forgot it was more than just data extents.
> So in theory if you had a rt file with 1000 data blocks, 10 bmbt
> blocks to map the data blocks, and 100 attr blocks then di_nblocks has
> to be 1110.
Yup, but the additional metadata on the data device is not going to
be anywhere near the size of the data device.
/me shrugs
I can't think of an easy way to get a maximum block count, so I
guess that'll have to do...
> > > + if (nextents > fork_recs)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> > > + break;
> > > + case XFS_DINODE_FMT_BTREE:
> > > + if (nextents <= fork_recs)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> > > + break;
> > > + case XFS_DINODE_FMT_LOCAL:
> > > + case XFS_DINODE_FMT_DEV:
> > > + case XFS_DINODE_FMT_UUID:
> > > + default:
> > > + if (nextents != 0)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> > > + break;
> > > + }
> > > +
> > > + /* di_anextents */
> > > + nextents = be16_to_cpu(dip->di_anextents);
> > > + fork_recs = XFS_DFORK_ASIZE(dip, mp) / sizeof(struct xfs_bmbt_rec);
> > > + switch (dip->di_aformat) {
> > > + case XFS_DINODE_FMT_EXTENTS:
> > > + if (nextents > fork_recs)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> > > + break;
> > > + case XFS_DINODE_FMT_BTREE:
> > > + if (nextents <= fork_recs)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> > > + break;
> > > + case XFS_DINODE_FMT_LOCAL:
> > > + case XFS_DINODE_FMT_DEV:
> > > + case XFS_DINODE_FMT_UUID:
> > > + default:
> > > + if (nextents != 0)
> > > + xfs_scrub_ino_set_corrupt(sc, ino, bp);
> > > + break;
> > > + }
> >
> > Don't we need a check here first to see whether an attribute fork
> > exists or not?
>
> Do you mean the xfs_inode_fork, or something else?
SOmething else. :P
> XFS_DFORK_ASIZE returns zero if !XFS_DFORK_Q which in turn is based on
> di_forkoff so we're really only checking that di_aformat makes sense
> given the number of extents and the size of the attr fork area.
Right, but if XFS_DFORK_ASIZE == 0, the dip->di_aformat *must* be
XFS_DINODE_FMT_EXTENTS. That's the only valid configuration when
there is no attribute fork present.
If there is an attribute fork present, then it can be XFS_DINODE_FMT_LOCAL,
EXTENT or BTREE, and then the extent count needs checking.
XFS_DINODE_FMT_DEV and XFS_DINODE_FMT_UUID are both invalid for the
attribute fork.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply
* Yocto 2.3 - Pyro release for FSL boards
From: K, Ganesan (GE Healthcare) @ 2017-10-05 7:14 UTC (permalink / raw)
To: Otavio Salvador; +Cc: meta-freescale@yoctoproject.org
In-Reply-To: <CAP9ODKr0OHLgCYSRFf3N+TMeST8yG=NmyAAKs-K333ehmDTkjg@mail.gmail.com>
Thanks Otavio.
Thanks & Regards,
Ganesan K
Staff Architect, Diagnostic Cardiology, Clinical Care Solutions
GE Healthcare
T +91 80 4088 5671 | M +91 98456 79799
ganesan.k@ge.com
-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br]
Sent: Thursday, October 05, 2017 2:44 AM
To: K, Ganesan (GE Healthcare) <ganesan.k@ge.com>
Cc: meta-freescale@yoctoproject.org
Subject: EXT: Re: [meta-freescale] Yocto 2.3 - Pyro release for FSL boards
On Wed, Oct 4, 2017 at 9:16 AM, K, Ganesan (GE Healthcare) <ganesan.k@ge.com> wrote:
> What is the planned release date for Yocto 2.3 – Pyro for FSL boards?
It is available for use now. We just did not make a formal release announcement as we did not got the docs finished.
For new development, use rocko as it is going to be official really soon...
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply
* Re: [PATCH v4 4/5] cramfs: add mmap support
From: Christoph Hellwig @ 2017-10-05 7:15 UTC (permalink / raw)
To: Nicolas Pitre
Cc: Christoph Hellwig, Richard Weinberger, Alexander Viro,
linux-mm@kvack.org, linux-fsdevel, linux-embedded@vger.kernel.org,
LKML, Chris Brandt
In-Reply-To: <nycvar.YSQ.7.76.1710041608460.1693@knanqh.ubzr>
On Wed, Oct 04, 2017 at 04:47:52PM -0400, Nicolas Pitre wrote:
> The only downside so far is the lack of visibility from user space to
> confirm it actually works as intended. With the vma splitting approach
> you clearly see what gets directly mapped in /proc/*/maps thanks to
> remap_pfn_range() storing the actual physical address in vma->vm_pgoff.
> With VM_MIXEDMAP things are no longer visible. Any opinion for the best
> way to overcome this?
Add trace points that allow you to trace it using trace-cmd, perf
or just tracefs?
>
> Anyway, here's a replacement for patch 4/5 below:
This looks much better, and is about 100 lines less than the previous
version. More (mostly cosmetic) comments below:
> + blockptrs = (u32 *)(sbi->linear_virt_addr + OFFSET(inode) + pgoff*4);
missing psaces around the *
>
> + blockaddr = blockptrs[0] & ~CRAMFS_BLK_FLAGS;
> + i = 0;
> + do {
> + u32 expect = blockaddr + i * (PAGE_SIZE >> 2);
There are a lot of magic numbers in here. It seems like that's standard
for cramfs, but if you really plan to bring it back to live it would be
create to sort that out..
> + expect |= CRAMFS_BLK_FLAG_DIRECT_PTR|CRAMFS_BLK_FLAG_UNCOMPRESSED;
Too long line.
Just turn this into:
u32 expect = blockaddr + i * (PAGE_SIZE >> 2) |
CRAMFS_BLK_FLAG_DIRECT_PTR |
CRAMFS_BLK_FLAG_UNCOMPRESSED;
and it will be a lot more readable.
> +static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
> +{
> + struct inode *inode = file_inode(file);
> + struct super_block *sb = inode->i_sb;
> + struct cramfs_sb_info *sbi = CRAMFS_SB(sb);
> + unsigned int pages, vma_pages, max_pages, offset;
> + unsigned long address;
> + char *fail_reason;
> + int ret;
> +
> + if (!IS_ENABLED(CONFIG_MMU))
> + return vma->vm_flags & (VM_SHARED | VM_MAYSHARE) ? 0 : -ENOSYS;
Given that you have a separate #ifndef CONFIG_MMU section below just
have a separate implementation of cramfs_physmem_mmap for it, which
makes the code a lot more obvious.
> + /* Could COW work here? */
> + fail_reason = "vma is writable";
> + if (vma->vm_flags & VM_WRITE)
> + goto fail;
The fail_reaosn is a rather unusable style, is there any good reason
why you need it here? We generall don't add a debug printk for every
pssible failure case.
> + vma_pages = (vma->vm_end - vma->vm_start + PAGE_SIZE - 1) >> PAGE_SHIFT;
Just use vma_pages - the defintion is different, but given that vm_end
and vm_stat must be page aligned anyway it should not make a difference.
> + if (pages > max_pages - vma->vm_pgoff)
> + pages = max_pages - vma->vm_pgoff;
Use min() or min_t().
> + /* Don't map the last page if it contains some other data */
> + if (unlikely(vma->vm_pgoff + pages == max_pages)) {
> + unsigned int partial = offset_in_page(inode->i_size);
> + if (partial) {
> + char *data = sbi->linear_virt_addr + offset;
> + data += (max_pages - 1) * PAGE_SIZE + partial;
> + while ((unsigned long)data & 7)
> + if (*data++ != 0)
> + goto nonzero;
> + while (offset_in_page(data)) {
> + if (*(u64 *)data != 0) {
> + nonzero:
> + pr_debug("mmap: %s: last page is shared\n",
> + file_dentry(file)->d_name.name);
> + pages--;
> + break;
> + }
> + data += 8;
> + }
The nonzer label is in a rather unusual space, both having weird
indentation and being in the middle of the loop.
It seems like this whole partial section should just go into a little
helper where the nonzero case is at the end of said helper to make it
readable. Also lots of magic numbers again, and generally a little
too much magic for the code to be easily understandable: why do you
operate on pointers casted to longs, increment in 8-byte steps?
Why is offset_in_page used for an operation that doesn't operate on
struct page at all? Any reason you can't just use memchr_inv?
> + if (!pages) {
> + fail_reason = "no suitable block remaining";
> + goto fail;
> + } else if (pages != vma_pages) {
No if else please if you goto a different label, that just confuses the
user.
> + /*
> + * Let's create a mixed map if we can't map it all.
> + * The normal paging machinery will take care of the
> + * unpopulated vma via cramfs_readpage().
> + */
> + int i;
> + vma->vm_flags |= VM_MIXEDMAP;
> + for (i = 0; i < pages; i++) {
> + unsigned long vaddr = vma->vm_start + i*PAGE_SIZE;
> + pfn_t pfn = phys_to_pfn_t(address + i*PAGE_SIZE, PFN_DEV);
> + ret = vm_insert_mixed(vma, vaddr, pfn);
Please use spaces around the * operator, and don't use overly long
lines.
A local variable might help doing that in a readnable way:
unsigned long off = i * PAGE_SIZE;
ret = vm_insert_mixed(vma, vma->vm_start + off,
phys_to_pfn_t(address + off, PFN_DEV);
> + /* We failed to do a direct map, but normal paging is still possible */
> + vma->vm_ops = &generic_file_vm_ops;
Maybe let the mixedmap case fall through to this instead of having
a duplicate vm_ops assignment.
> +static unsigned cramfs_physmem_mmap_capabilities(struct file *file)
> +{
> + return NOMMU_MAP_COPY | NOMMU_MAP_DIRECT | NOMMU_MAP_READ | NOMMU_MAP_EXEC;
Too long line.
^ permalink raw reply
* Re: [PATCH v4 4/5] cramfs: add mmap support
From: Christoph Hellwig @ 2017-10-05 7:15 UTC (permalink / raw)
To: Nicolas Pitre
Cc: Christoph Hellwig, Richard Weinberger, Alexander Viro,
linux-mm@kvack.org, linux-fsdevel, linux-embedded@vger.kernel.org,
LKML, Chris Brandt
In-Reply-To: <nycvar.YSQ.7.76.1710041608460.1693@knanqh.ubzr>
On Wed, Oct 04, 2017 at 04:47:52PM -0400, Nicolas Pitre wrote:
> The only downside so far is the lack of visibility from user space to
> confirm it actually works as intended. With the vma splitting approach
> you clearly see what gets directly mapped in /proc/*/maps thanks to
> remap_pfn_range() storing the actual physical address in vma->vm_pgoff.
> With VM_MIXEDMAP things are no longer visible. Any opinion for the best
> way to overcome this?
Add trace points that allow you to trace it using trace-cmd, perf
or just tracefs?
>
> Anyway, here's a replacement for patch 4/5 below:
This looks much better, and is about 100 lines less than the previous
version. More (mostly cosmetic) comments below:
> + blockptrs = (u32 *)(sbi->linear_virt_addr + OFFSET(inode) + pgoff*4);
missing psaces around the *
>
> + blockaddr = blockptrs[0] & ~CRAMFS_BLK_FLAGS;
> + i = 0;
> + do {
> + u32 expect = blockaddr + i * (PAGE_SIZE >> 2);
There are a lot of magic numbers in here. It seems like that's standard
for cramfs, but if you really plan to bring it back to live it would be
create to sort that out..
> + expect |= CRAMFS_BLK_FLAG_DIRECT_PTR|CRAMFS_BLK_FLAG_UNCOMPRESSED;
Too long line.
Just turn this into:
u32 expect = blockaddr + i * (PAGE_SIZE >> 2) |
CRAMFS_BLK_FLAG_DIRECT_PTR |
CRAMFS_BLK_FLAG_UNCOMPRESSED;
and it will be a lot more readable.
> +static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
> +{
> + struct inode *inode = file_inode(file);
> + struct super_block *sb = inode->i_sb;
> + struct cramfs_sb_info *sbi = CRAMFS_SB(sb);
> + unsigned int pages, vma_pages, max_pages, offset;
> + unsigned long address;
> + char *fail_reason;
> + int ret;
> +
> + if (!IS_ENABLED(CONFIG_MMU))
> + return vma->vm_flags & (VM_SHARED | VM_MAYSHARE) ? 0 : -ENOSYS;
Given that you have a separate #ifndef CONFIG_MMU section below just
have a separate implementation of cramfs_physmem_mmap for it, which
makes the code a lot more obvious.
> + /* Could COW work here? */
> + fail_reason = "vma is writable";
> + if (vma->vm_flags & VM_WRITE)
> + goto fail;
The fail_reaosn is a rather unusable style, is there any good reason
why you need it here? We generall don't add a debug printk for every
pssible failure case.
> + vma_pages = (vma->vm_end - vma->vm_start + PAGE_SIZE - 1) >> PAGE_SHIFT;
Just use vma_pages - the defintion is different, but given that vm_end
and vm_stat must be page aligned anyway it should not make a difference.
> + if (pages > max_pages - vma->vm_pgoff)
> + pages = max_pages - vma->vm_pgoff;
Use min() or min_t().
> + /* Don't map the last page if it contains some other data */
> + if (unlikely(vma->vm_pgoff + pages == max_pages)) {
> + unsigned int partial = offset_in_page(inode->i_size);
> + if (partial) {
> + char *data = sbi->linear_virt_addr + offset;
> + data += (max_pages - 1) * PAGE_SIZE + partial;
> + while ((unsigned long)data & 7)
> + if (*data++ != 0)
> + goto nonzero;
> + while (offset_in_page(data)) {
> + if (*(u64 *)data != 0) {
> + nonzero:
> + pr_debug("mmap: %s: last page is shared\n",
> + file_dentry(file)->d_name.name);
> + pages--;
> + break;
> + }
> + data += 8;
> + }
The nonzer label is in a rather unusual space, both having weird
indentation and being in the middle of the loop.
It seems like this whole partial section should just go into a little
helper where the nonzero case is at the end of said helper to make it
readable. Also lots of magic numbers again, and generally a little
too much magic for the code to be easily understandable: why do you
operate on pointers casted to longs, increment in 8-byte steps?
Why is offset_in_page used for an operation that doesn't operate on
struct page at all? Any reason you can't just use memchr_inv?
> + if (!pages) {
> + fail_reason = "no suitable block remaining";
> + goto fail;
> + } else if (pages != vma_pages) {
No if else please if you goto a different label, that just confuses the
user.
> + /*
> + * Let's create a mixed map if we can't map it all.
> + * The normal paging machinery will take care of the
> + * unpopulated vma via cramfs_readpage().
> + */
> + int i;
> + vma->vm_flags |= VM_MIXEDMAP;
> + for (i = 0; i < pages; i++) {
> + unsigned long vaddr = vma->vm_start + i*PAGE_SIZE;
> + pfn_t pfn = phys_to_pfn_t(address + i*PAGE_SIZE, PFN_DEV);
> + ret = vm_insert_mixed(vma, vaddr, pfn);
Please use spaces around the * operator, and don't use overly long
lines.
A local variable might help doing that in a readnable way:
unsigned long off = i * PAGE_SIZE;
ret = vm_insert_mixed(vma, vma->vm_start + off,
phys_to_pfn_t(address + off, PFN_DEV);
> + /* We failed to do a direct map, but normal paging is still possible */
> + vma->vm_ops = &generic_file_vm_ops;
Maybe let the mixedmap case fall through to this instead of having
a duplicate vm_ops assignment.
> +static unsigned cramfs_physmem_mmap_capabilities(struct file *file)
> +{
> + return NOMMU_MAP_COPY | NOMMU_MAP_DIRECT | NOMMU_MAP_READ | NOMMU_MAP_EXEC;
Too long line.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH v4 12/14] platform/x86: wmi: create character devices when requested by drivers
From: Greg KH @ 2017-10-05 7:16 UTC (permalink / raw)
To: Mario Limonciello
Cc: dvhart, Andy Shevchenko, LKML, platform-driver-x86,
Andy Lutomirski, quasisec, pali.rohar, rjw, mjg59, hch
In-Reply-To: <528c9a1ca4fa2f29aedbb37d3ed13c480ef093fc.1507156392.git.mario.limonciello@dell.com>
On Wed, Oct 04, 2017 at 05:48:38PM -0500, Mario Limonciello wrote:
> For WMI operations that are only Set or Query read or write sysfs
> attributes created by WMI vendor drivers make sense.
>
> For other WMI operations that are run on Method, there needs to be a
> way to guarantee to userspace that the results from the method call
> belong to the data request to the method call. Sysfs attributes don't
> work well in this scenario because two userspace processes may be
> competing at reading/writing an attribute and step on each other's
> data.
And you protect this from happening in the ioctl? I didn't see it, but
ok, I'll take your word for it :)
> When a WMI vendor driver declares an ioctl in a file_operations object
> the WMI bus driver will create a character device that maps to those
> file operations.
>
> That character device will correspond to this path:
> /dev/wmi/$driver
>
> The WMI bus driver will interpret the IOCTL calls, test them for
> a valid instance and pass them on to the vendor driver to run.
>
> This creates an implicit policy that only driver per character
> device. If a module matches multiple GUID's, the wmi_devices
> will need to be all handled by the same wmi_driver if the same
> character device is used.
Interesting "way out" but ok, I can buy it...
> The WMI vendor drivers will be responsible for managing access to
> this character device and proper locking on it.
>
> When a WMI vendor driver is unloaded the WMI bus driver will clean
> up the character device.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
> MAINTAINERS | 1 +
> drivers/platform/x86/wmi.c | 67 +++++++++++++++++++++++++++++++++++++++++++++-
> include/linux/wmi.h | 2 ++
> include/uapi/linux/wmi.h | 10 +++++++
> 4 files changed, 79 insertions(+), 1 deletion(-)
> create mode 100644 include/uapi/linux/wmi.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0357e9b1cfaf..6db1d84999bc 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -372,6 +372,7 @@ ACPI WMI DRIVER
> L: platform-driver-x86@vger.kernel.org
> S: Orphan
> F: drivers/platform/x86/wmi.c
> +F: include/uapi/linux/wmi.h
>
> AD1889 ALSA SOUND DRIVER
> M: Thibaut Varene <T-Bone@parisc-linux.org>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index bcb41c1c7f52..5aef052b4aab 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -38,6 +38,7 @@
> #include <linux/init.h>
> #include <linux/kernel.h>
> #include <linux/list.h>
> +#include <linux/miscdevice.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/slab.h>
> @@ -69,6 +70,7 @@ struct wmi_block {
> struct wmi_device dev;
> struct list_head list;
> struct guid_block gblock;
> + struct miscdevice misc_dev;
> struct acpi_device *acpi_device;
> wmi_notify_handler handler;
> void *handler_data;
> @@ -765,22 +767,80 @@ static int wmi_dev_match(struct device *dev, struct device_driver *driver)
> return 0;
> }
>
> +static long wmi_ioctl(struct file *filp, unsigned int cmd,
> + unsigned long arg)
> +{
> + struct wmi_driver *wdriver;
> + struct wmi_block *wblock;
> + const char *driver_name;
> + struct list_head *p;
> + bool found = false;
> +
> + if (_IOC_TYPE(cmd) != WMI_IOC)
> + return -ENOTTY;
> +
> + driver_name = filp->f_path.dentry->d_iname;
> +
> + list_for_each(p, &wmi_block_list) {
> + wblock = list_entry(p, struct wmi_block, list);
> + wdriver = container_of(wblock->dev.dev.driver,
> + struct wmi_driver, driver);
> + if (strcmp(driver_name, wdriver->driver.name) == 0) {
> + found = true;
> + break;
> + }
> + }
You can provide an open() call to handle this type of logic for you, so
you don't have to do it on every ioctl() call, but I guess it's not
really a big deal, right?
> + if (!found ||
> + !wdriver->file_operations ||
> + !wdriver->file_operations->unlocked_ioctl)
> + return -ENODEV;
Shouldn't you check for unlocked_ioctl() already? No need to check it
here, right?
And if you are only passing down unlocked_ioctl, there's no need for a
whole empty file_operations structure in the driver, right? Just have
an ioctl callback to make things smaller and simpler to understand.
> + /* make sure we're not calling a higher instance */
> + if (_IOC_NR(cmd) > wblock->gblock.instance_count)
> + return -EINVAL;
What exactly does this protect from?
> + /* driver wants a character device made */
> + if (wdriver->file_operations) {
Check for unlocked_ioctl here, actually, drop the file_operations
entirely, and just have that one callback.
> + buf = kmalloc(strlen(wdriver->driver.name) + 4, GFP_KERNEL);
> + if (!buf)
> + return -ENOMEM;
No unwinding of other logic needed?
> + strcpy(buf, "wmi/");
> + strcpy(buf + 4, wdriver->driver.name);
> + wblock->misc_dev.minor = MISC_DYNAMIC_MINOR;
> + wblock->misc_dev.name = buf;
> + wblock->misc_dev.fops = &wmi_fops;
> + ret = misc_register(&wblock->misc_dev);
> + if (ret) {
> + dev_warn(dev, "failed to register char dev: %d", ret);
> + kfree(buf);
Again, no unwinding needed? Error message value returned?
> + }
> + }
> +
> if (wdriver->probe) {
> ret = wdriver->probe(dev_to_wdev(dev));
> if (ret != 0 && ACPI_FAILURE(wmi_method_enable(wblock, 0)))
> dev_warn(dev, "failed to disable device\n");
> }
> -
> return ret;
> }
>
> @@ -791,6 +851,11 @@ static int wmi_dev_remove(struct device *dev)
> container_of(dev->driver, struct wmi_driver, driver);
> int ret = 0;
>
> + if (wdriver->file_operations) {
> + kfree(wblock->misc_dev.name);
> + misc_deregister(&wblock->misc_dev);
Unregister before freeing the device name, right?
> --- /dev/null
> +++ b/include/uapi/linux/wmi.h
> @@ -0,0 +1,10 @@
> +#ifndef _UAPI_LINUX_WMI_H
> +#define _UAPI_LINUX_WMI_H
> +
> +#define WMI_IOC 'W'
> +#define WMI_IO(instance) _IO(WMI_IOC, instance)
> +#define WMI_IOR(instance) _IOR(WMI_IOC, instance, void*)
> +#define WMI_IOW(instance) _IOW(WMI_IOC, instance, void*)
> +#define WMI_IOWR(instance) _IOWR(WMI_IOC, instance, void*)
Ugh, void *, this is going to be "fun"...
My comments on just how fun is left for the actual driver that attempted
to implement these...
greg k-h
^ permalink raw reply
* Re: -|EXT|- Re: mono 5.0.1.1 TypeLoadException
From: MUGRIDGE Robin @ 2017-10-05 6:22 UTC (permalink / raw)
To: Alex J Lennon; +Cc: yocto@yoctoproject.org
In-Reply-To: <AC542F9E-FECD-4F59-B5E7-11D441C4F962@dynamicdevices.co.uk>
[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]
Hi,
I’ve managed to track this down and it turned out to be nothing to do with mono.
In the process of creating a test case, I found I had a reference to an old version of Npgsql (this is not provided via a yocto recipe). The old version I was referencing included an old version of Mono.Security.dll. My application found this version rather than the version delivered by Mono as it was in the application directory. Later versions of Npgsql have now dropped the inclusion of Mono.Security.dll.
Robin
From: Alex J Lennon [mailto:ajlennon@dynamicdevices.co.uk]
Sent: 02 October 2017 16:03
To: MUGRIDGE Robin
Cc: yocto@yoctoproject.org
Subject: -|EXT|- Re: [yocto] mono 5.0.1.1 TypeLoadException
Hi Robin,
If you supply a test case I’ll take a look.
Regards,
Alex
On 2 Oct 2017, at 15:02, MUGRIDGE Robin <Robin.Mugridge@oxinst.com<mailto:Robin.Mugridge@oxinst.com>> wrote:
Hi,
I am using mono with Krogoth. The current version of mono we are building with is 4.2.2.30.
I am trying to move mono forward to 5.0.1.1 to avoid an issue in the HttpListener class, but now get a TypeLoadException which I assume is a missing assembly or a build configuration error, but I’m struggling to work out what’s wrong…
System.TypeLoadException: Could not load type of field 'System.Net.HttpListener:tlsSettings' (9) due to: Could not resolve type with token 01000034 (from typeref, class/assembly Mono.Security.Inteace.MonoTlsSettings, Mono.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756) assembly:Mono.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756 typMono.Security.Interface.MonoTlsSettings member:<none>
Has anyone else come across this and know what the root cause is?
Thanks,
Robin
___________________________________________________________________________
This e-mail is confidential and is for the addressee only. Please refer to
www.oxinst.com/email-statement<http://www.oxinst.com/email-statement> for regulatory information.
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org<mailto:yocto@yoctoproject.org>
https://lists.yoctoproject.org/listinfo/yocto
Click here<https://www.mailcontrol.com/sr/2ZsRA7Ssu2bGX2PQPOmvUhe0y89+yNqhzi4kKcgbI2w74Qr6u8VDhtHBjwBmikGHQyO0qF!Ova7NfN+NdwfdFw==> to report this email as spam.
[-- Attachment #2: Type: text/html, Size: 8446 bytes --]
^ permalink raw reply
* Re: spi-atmel.c: problem with PDC on AT91SAM9G20
From: Igor Plyatov @ 2017-10-05 7:18 UTC (permalink / raw)
To: linux-spi-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <de4b4952-35a0-fd95-6adf-9219385644e9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Hello!
> Data corruption happens during receiving of SPI data by kernel. It
> happens quite often (once per minute or so) if OS has some light load,
> like periodical writes to SD card in parallel with communication to
> SPI device (DSP).
... skipped
For those, who has same interest or encountered the same issue as I had...
Notes:
A) My "gs_mgms_dsp" linux driver is the same for linux-2.6.39 and
linux-4.9.36
and communicates with DSP through SPI-bus, where data packets are 32
byte
long and last byte is CRC8 to check data integrity.
B) CPU is AT91SAM9G20.
I have encoutered SPI data corruption during receiving of data from DSP by
linux-4.9.36 if SPI-bus has big traffic in parallel with big traffic at MMC
interface.
Old linux-2.6.39 does not suffer from such issue, because atmel-mci.c
driver has
PIO access to MMC interface. While new kernel has changed the
atmel-mci.c driver
for use of PDC (Peripheral DMA Controller) for access to MMC interface.
Both kernels have Atmel SPI driver where PDC used for SPI data transfers.
SPI data corruption looks like duplication of one of received bytes.
Such bytes surrounded by "**" at log below.
gs_mgms_dsp spi32766.0: CRC error.
gs_mgms_dsp spi32766.0: <- 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44
gs_mgms_dsp spi32766.0: <- 45 46 47 48 49 4A 4B 4C 4D *4F 4F* 50 51 52 53 A4
gs_mgms_dsp spi32766.0: -> EIO=0x05
gs_mgms_dsp spi32766.0: CRC error.
gs_mgms_dsp spi32766.0: <- 0F C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0
gs_mgms_dsp spi32766.0: <- D1 D2 D3 D4 D5 D6 D7 D8 D9 *DB DB* DC DD DE DF 02
gs_mgms_dsp spi32766.0: -> EIO=0x05
gs_mgms_dsp spi32766.0: CRC error.
gs_mgms_dsp spi32766.0: <- 03 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68
gs_mgms_dsp spi32766.0: <- *6A 6A* 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 25
gs_mgms_dsp spi32766.0: -> EIO=0x05
gs_mgms_dsp spi32766.0: CRC error.
gs_mgms_dsp spi32766.0: <- 15 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 82 83 84
gs_mgms_dsp spi32766.0: <- 85 86 87 88 89 8A *8C 8C* 8D 8E 8F 90 91 92 93 00
gs_mgms_dsp spi32766.0: -> EIO=0x05
gs_mgms_dsp spi32766.0: CRC error.
gs_mgms_dsp spi32766.0: <- 2A EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA
gs_mgms_dsp spi32766.0: <- FB FC FD FE FF 00 01 *03 03* 04 05 06 07 08 09 0A
gs_mgms_dsp spi32766.0: -> EIO=0x05
This looks like silent SPI overruns not detected by AT91SAM9G20 HW.
At the end, after some seconds or milliseconds of communication, HW SPI
overrun
flag detected by the spi-atmel.c driver:
"atmel_spi fffcc000.spi: overrun (0/0 remaining)".
Strictly speaking this is not a regression of spi-atmel.c, but unfortunate
combination with atmel-mmc.c, where PDC used too and I suppose a HW bug in
AT91SAM9G20 CPU.
Please help to answer on questions:
1) How to modify atmel-mci.c driver to have option for PIO access to MMC
interface?
2) Why SPI overrun flag does not asserted each time? I have not found
such HW bug
in the Errata for AT91SAM9G20 CPU.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] mtd: nand: gpio: Convert to use GPIO descriptors
From: Boris Brezillon @ 2017-10-05 7:20 UTC (permalink / raw)
To: Linus Walleij
Cc: David Woodhouse, Brian Norris, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, linux-mtd, linux-arm-kernel, arm, Mike Rapoport,
Frans Klaver, Gerhard Sittig, Jamie Iles
In-Reply-To: <20170924173912.9199-1-linus.walleij@linaro.org>
On Sun, 24 Sep 2017 19:39:12 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> There is exactly one board in the kernel that defines platform data
> for the GPIO NAND driver.
>
> Use the feature to provide a lookup table for the GPIOs in the board
> file so we can convert the driver as a whole to just use GPIO
> descriptors.
>
> After this we can cut the use of <linux/of_gpio.h> and use the GPIO
> descriptor management from <linux/gpio/consumer.h> alone to grab and use
> the GPIOs used in the driver.
>
> I also created a local struct device *dev in the probe() function
> because I was getting annoyed with all the &pdev->dev dereferencing.
>
> Cc: arm@kernel.org
> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
> Cc: Frans Klaver <fransklaver@gmail.com>
> Cc: Gerhard Sittig <gsi@denx.de>
> Cc: Jamie Iles <jamie.iles@oracle.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Applied.
Thanks,
Boris
> ---
> ARM SoC folks: Please ACK this so it can be merged through the MTD
> subsystem.
>
> Everyone else on CC: can you test and/or ACK this?
>
> I don't have this PXA board, and all device tree users seem to be
> out-of-tree so I rely on third parties to test this.
> ---
> arch/arm/mach-pxa/cm-x255.c | 19 ++++---
> drivers/mtd/nand/gpio.c | 112 +++++++++++++++++++++---------------------
> include/linux/mtd/nand-gpio.h | 5 --
> 3 files changed, 70 insertions(+), 66 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/cm-x255.c b/arch/arm/mach-pxa/cm-x255.c
> index b592f79a1742..f8d67acb7194 100644
> --- a/arch/arm/mach-pxa/cm-x255.c
> +++ b/arch/arm/mach-pxa/cm-x255.c
> @@ -14,7 +14,7 @@
> #include <linux/mtd/partitions.h>
> #include <linux/mtd/physmap.h>
> #include <linux/mtd/nand-gpio.h>
> -
> +#include <linux/gpio/machine.h>
> #include <linux/spi/spi.h>
> #include <linux/spi/pxa2xx_spi.h>
>
> @@ -176,6 +176,17 @@ static inline void cmx255_init_nor(void) {}
> #endif
>
> #if defined(CONFIG_MTD_NAND_GPIO) || defined(CONFIG_MTD_NAND_GPIO_MODULE)
> +
> +static struct gpiod_lookup_table cmx255_nand_gpiod_table = {
> + .dev_id = "cmx255-nand",
> + .table = {
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_CS, "nce", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_CLE, "cle", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_ALE, "ale", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_RB, "rdy", GPIO_ACTIVE_HIGH),
> + },
> +};
> +
> static struct resource cmx255_nand_resource[] = {
> [0] = {
> .start = PXA_CS1_PHYS,
> @@ -198,11 +209,6 @@ static struct mtd_partition cmx255_nand_parts[] = {
> };
>
> static struct gpio_nand_platdata cmx255_nand_platdata = {
> - .gpio_nce = GPIO_NAND_CS,
> - .gpio_cle = GPIO_NAND_CLE,
> - .gpio_ale = GPIO_NAND_ALE,
> - .gpio_rdy = GPIO_NAND_RB,
> - .gpio_nwp = -1,
> .parts = cmx255_nand_parts,
> .num_parts = ARRAY_SIZE(cmx255_nand_parts),
> .chip_delay = 25,
> @@ -220,6 +226,7 @@ static struct platform_device cmx255_nand = {
>
> static void __init cmx255_init_nand(void)
> {
> + gpiod_add_lookup_table(&cmx255_nand_gpiod_table);
> platform_device_register(&cmx255_nand);
> }
> #else
> diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
> index fd3648952b5a..484f7fbc3f7d 100644
> --- a/drivers/mtd/nand/gpio.c
> +++ b/drivers/mtd/nand/gpio.c
> @@ -23,7 +23,7 @@
> #include <linux/slab.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/io.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/rawnand.h>
> @@ -31,12 +31,16 @@
> #include <linux/mtd/nand-gpio.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> -#include <linux/of_gpio.h>
>
> struct gpiomtd {
> void __iomem *io_sync;
> struct nand_chip nand_chip;
> struct gpio_nand_platdata plat;
> + struct gpio_desc *nce; /* Optional chip enable */
> + struct gpio_desc *cle;
> + struct gpio_desc *ale;
> + struct gpio_desc *rdy;
> + struct gpio_desc *nwp; /* Optional write protection */
> };
>
> static inline struct gpiomtd *gpio_nand_getpriv(struct mtd_info *mtd)
> @@ -78,11 +82,10 @@ static void gpio_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> gpio_nand_dosync(gpiomtd);
>
> if (ctrl & NAND_CTRL_CHANGE) {
> - if (gpio_is_valid(gpiomtd->plat.gpio_nce))
> - gpio_set_value(gpiomtd->plat.gpio_nce,
> - !(ctrl & NAND_NCE));
> - gpio_set_value(gpiomtd->plat.gpio_cle, !!(ctrl & NAND_CLE));
> - gpio_set_value(gpiomtd->plat.gpio_ale, !!(ctrl & NAND_ALE));
> + if (gpiomtd->nce)
> + gpiod_set_value(gpiomtd->nce, !(ctrl & NAND_NCE));
> + gpiod_set_value(gpiomtd->cle, !!(ctrl & NAND_CLE));
> + gpiod_set_value(gpiomtd->ale, !!(ctrl & NAND_ALE));
> gpio_nand_dosync(gpiomtd);
> }
> if (cmd == NAND_CMD_NONE)
> @@ -96,7 +99,7 @@ static int gpio_nand_devready(struct mtd_info *mtd)
> {
> struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd);
>
> - return gpio_get_value(gpiomtd->plat.gpio_rdy);
> + return gpiod_get_value(gpiomtd->rdy);
> }
>
> #ifdef CONFIG_OF
> @@ -123,12 +126,6 @@ static int gpio_nand_get_config_of(const struct device *dev,
> }
> }
>
> - plat->gpio_rdy = of_get_gpio(dev->of_node, 0);
> - plat->gpio_nce = of_get_gpio(dev->of_node, 1);
> - plat->gpio_ale = of_get_gpio(dev->of_node, 2);
> - plat->gpio_cle = of_get_gpio(dev->of_node, 3);
> - plat->gpio_nwp = of_get_gpio(dev->of_node, 4);
> -
> if (!of_property_read_u32(dev->of_node, "chip-delay", &val))
> plat->chip_delay = val;
>
> @@ -201,10 +198,11 @@ static int gpio_nand_remove(struct platform_device *pdev)
>
> nand_release(nand_to_mtd(&gpiomtd->nand_chip));
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
> - gpio_set_value(gpiomtd->plat.gpio_nwp, 0);
> - if (gpio_is_valid(gpiomtd->plat.gpio_nce))
> - gpio_set_value(gpiomtd->plat.gpio_nce, 1);
> + /* Enable write protection and disable the chip */
> + if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
> + gpiod_set_value(gpiomtd->nwp, 0);
> + if (gpiomtd->nce && !IS_ERR(gpiomtd->nce))
> + gpiod_set_value(gpiomtd->nce, 0);
>
> return 0;
> }
> @@ -215,66 +213,66 @@ static int gpio_nand_probe(struct platform_device *pdev)
> struct nand_chip *chip;
> struct mtd_info *mtd;
> struct resource *res;
> + struct device *dev = &pdev->dev;
> int ret = 0;
>
> - if (!pdev->dev.of_node && !dev_get_platdata(&pdev->dev))
> + if (!dev->of_node && !dev_get_platdata(dev))
> return -EINVAL;
>
> - gpiomtd = devm_kzalloc(&pdev->dev, sizeof(*gpiomtd), GFP_KERNEL);
> + gpiomtd = devm_kzalloc(dev, sizeof(*gpiomtd), GFP_KERNEL);
> if (!gpiomtd)
> return -ENOMEM;
>
> chip = &gpiomtd->nand_chip;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res);
> + chip->IO_ADDR_R = devm_ioremap_resource(dev, res);
> if (IS_ERR(chip->IO_ADDR_R))
> return PTR_ERR(chip->IO_ADDR_R);
>
> res = gpio_nand_get_io_sync(pdev);
> if (res) {
> - gpiomtd->io_sync = devm_ioremap_resource(&pdev->dev, res);
> + gpiomtd->io_sync = devm_ioremap_resource(dev, res);
> if (IS_ERR(gpiomtd->io_sync))
> return PTR_ERR(gpiomtd->io_sync);
> }
>
> - ret = gpio_nand_get_config(&pdev->dev, &gpiomtd->plat);
> + ret = gpio_nand_get_config(dev, &gpiomtd->plat);
> if (ret)
> return ret;
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nce)) {
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_nce,
> - "NAND NCE");
> - if (ret)
> - return ret;
> - gpio_direction_output(gpiomtd->plat.gpio_nce, 1);
> + /* Just enable the chip */
> + gpiomtd->nce = devm_gpiod_get_optional(dev, "nce", GPIOD_OUT_HIGH);
> + if (IS_ERR(gpiomtd->nce))
> + return PTR_ERR(gpiomtd->nce);
> +
> + /* We disable write protection once we know probe() will succeed */
> + gpiomtd->nwp = devm_gpiod_get_optional(dev, "nwp", GPIOD_OUT_LOW);
> + if (IS_ERR(gpiomtd->nwp)) {
> + ret = PTR_ERR(gpiomtd->nwp);
> + goto out_ce;
> }
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) {
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_nwp,
> - "NAND NWP");
> - if (ret)
> - return ret;
> + gpiomtd->nwp = devm_gpiod_get(dev, "ale", GPIOD_OUT_LOW);
> + if (IS_ERR(gpiomtd->nwp)) {
> + ret = PTR_ERR(gpiomtd->nwp);
> + goto out_ce;
> }
>
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_ale, "NAND ALE");
> - if (ret)
> - return ret;
> - gpio_direction_output(gpiomtd->plat.gpio_ale, 0);
> + gpiomtd->cle = devm_gpiod_get(dev, "cle", GPIOD_OUT_LOW);
> + if (IS_ERR(gpiomtd->cle)) {
> + ret = PTR_ERR(gpiomtd->cle);
> + goto out_ce;
> + }
>
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_cle, "NAND CLE");
> - if (ret)
> - return ret;
> - gpio_direction_output(gpiomtd->plat.gpio_cle, 0);
> -
> - if (gpio_is_valid(gpiomtd->plat.gpio_rdy)) {
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_rdy,
> - "NAND RDY");
> - if (ret)
> - return ret;
> - gpio_direction_input(gpiomtd->plat.gpio_rdy);
> - chip->dev_ready = gpio_nand_devready;
> + gpiomtd->rdy = devm_gpiod_get_optional(dev, "rdy", GPIOD_IN);
> + if (IS_ERR(gpiomtd->rdy)) {
> + ret = PTR_ERR(gpiomtd->rdy);
> + goto out_ce;
> }
> + /* Using RDY pin */
> + if (gpiomtd->rdy)
> + chip->dev_ready = gpio_nand_devready;
>
> nand_set_flash_node(chip, pdev->dev.of_node);
> chip->IO_ADDR_W = chip->IO_ADDR_R;
> @@ -285,12 +283,13 @@ static int gpio_nand_probe(struct platform_device *pdev)
> chip->cmd_ctrl = gpio_nand_cmd_ctrl;
>
> mtd = nand_to_mtd(chip);
> - mtd->dev.parent = &pdev->dev;
> + mtd->dev.parent = dev;
>
> platform_set_drvdata(pdev, gpiomtd);
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
> - gpio_direction_output(gpiomtd->plat.gpio_nwp, 1);
> + /* Disable write protection, if wired up */
> + if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
> + gpiod_direction_output(gpiomtd->nwp, 1);
>
> ret = nand_scan(mtd, 1);
> if (ret)
> @@ -305,8 +304,11 @@ static int gpio_nand_probe(struct platform_device *pdev)
> return 0;
>
> err_wp:
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
> - gpio_set_value(gpiomtd->plat.gpio_nwp, 0);
> + if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
> + gpiod_set_value(gpiomtd->nwp, 0);
> +out_ce:
> + if (gpiomtd->nce && !IS_ERR(gpiomtd->nce))
> + gpiod_set_value(gpiomtd->nce, 0);
>
> return ret;
> }
> diff --git a/include/linux/mtd/nand-gpio.h b/include/linux/mtd/nand-gpio.h
> index be4f45d89be2..98f71908212d 100644
> --- a/include/linux/mtd/nand-gpio.h
> +++ b/include/linux/mtd/nand-gpio.h
> @@ -4,11 +4,6 @@
> #include <linux/mtd/rawnand.h>
>
> struct gpio_nand_platdata {
> - int gpio_nce;
> - int gpio_nwp;
> - int gpio_cle;
> - int gpio_ale;
> - int gpio_rdy;
> void (*adjust_parts)(struct gpio_nand_platdata *, size_t);
> struct mtd_partition *parts;
> unsigned int num_parts;
^ permalink raw reply
* [PATCH] mtd: nand: gpio: Convert to use GPIO descriptors
From: Boris Brezillon @ 2017-10-05 7:20 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20170924173912.9199-1-linus.walleij@linaro.org>
On Sun, 24 Sep 2017 19:39:12 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:
> There is exactly one board in the kernel that defines platform data
> for the GPIO NAND driver.
>
> Use the feature to provide a lookup table for the GPIOs in the board
> file so we can convert the driver as a whole to just use GPIO
> descriptors.
>
> After this we can cut the use of <linux/of_gpio.h> and use the GPIO
> descriptor management from <linux/gpio/consumer.h> alone to grab and use
> the GPIOs used in the driver.
>
> I also created a local struct device *dev in the probe() function
> because I was getting annoyed with all the &pdev->dev dereferencing.
>
> Cc: arm at kernel.org
> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
> Cc: Frans Klaver <fransklaver@gmail.com>
> Cc: Gerhard Sittig <gsi@denx.de>
> Cc: Jamie Iles <jamie.iles@oracle.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Applied.
Thanks,
Boris
> ---
> ARM SoC folks: Please ACK this so it can be merged through the MTD
> subsystem.
>
> Everyone else on CC: can you test and/or ACK this?
>
> I don't have this PXA board, and all device tree users seem to be
> out-of-tree so I rely on third parties to test this.
> ---
> arch/arm/mach-pxa/cm-x255.c | 19 ++++---
> drivers/mtd/nand/gpio.c | 112 +++++++++++++++++++++---------------------
> include/linux/mtd/nand-gpio.h | 5 --
> 3 files changed, 70 insertions(+), 66 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/cm-x255.c b/arch/arm/mach-pxa/cm-x255.c
> index b592f79a1742..f8d67acb7194 100644
> --- a/arch/arm/mach-pxa/cm-x255.c
> +++ b/arch/arm/mach-pxa/cm-x255.c
> @@ -14,7 +14,7 @@
> #include <linux/mtd/partitions.h>
> #include <linux/mtd/physmap.h>
> #include <linux/mtd/nand-gpio.h>
> -
> +#include <linux/gpio/machine.h>
> #include <linux/spi/spi.h>
> #include <linux/spi/pxa2xx_spi.h>
>
> @@ -176,6 +176,17 @@ static inline void cmx255_init_nor(void) {}
> #endif
>
> #if defined(CONFIG_MTD_NAND_GPIO) || defined(CONFIG_MTD_NAND_GPIO_MODULE)
> +
> +static struct gpiod_lookup_table cmx255_nand_gpiod_table = {
> + .dev_id = "cmx255-nand",
> + .table = {
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_CS, "nce", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_CLE, "cle", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_ALE, "ale", GPIO_ACTIVE_HIGH),
> + GPIO_LOOKUP("gpio-pxa", GPIO_NAND_RB, "rdy", GPIO_ACTIVE_HIGH),
> + },
> +};
> +
> static struct resource cmx255_nand_resource[] = {
> [0] = {
> .start = PXA_CS1_PHYS,
> @@ -198,11 +209,6 @@ static struct mtd_partition cmx255_nand_parts[] = {
> };
>
> static struct gpio_nand_platdata cmx255_nand_platdata = {
> - .gpio_nce = GPIO_NAND_CS,
> - .gpio_cle = GPIO_NAND_CLE,
> - .gpio_ale = GPIO_NAND_ALE,
> - .gpio_rdy = GPIO_NAND_RB,
> - .gpio_nwp = -1,
> .parts = cmx255_nand_parts,
> .num_parts = ARRAY_SIZE(cmx255_nand_parts),
> .chip_delay = 25,
> @@ -220,6 +226,7 @@ static struct platform_device cmx255_nand = {
>
> static void __init cmx255_init_nand(void)
> {
> + gpiod_add_lookup_table(&cmx255_nand_gpiod_table);
> platform_device_register(&cmx255_nand);
> }
> #else
> diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
> index fd3648952b5a..484f7fbc3f7d 100644
> --- a/drivers/mtd/nand/gpio.c
> +++ b/drivers/mtd/nand/gpio.c
> @@ -23,7 +23,7 @@
> #include <linux/slab.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/io.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/rawnand.h>
> @@ -31,12 +31,16 @@
> #include <linux/mtd/nand-gpio.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> -#include <linux/of_gpio.h>
>
> struct gpiomtd {
> void __iomem *io_sync;
> struct nand_chip nand_chip;
> struct gpio_nand_platdata plat;
> + struct gpio_desc *nce; /* Optional chip enable */
> + struct gpio_desc *cle;
> + struct gpio_desc *ale;
> + struct gpio_desc *rdy;
> + struct gpio_desc *nwp; /* Optional write protection */
> };
>
> static inline struct gpiomtd *gpio_nand_getpriv(struct mtd_info *mtd)
> @@ -78,11 +82,10 @@ static void gpio_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> gpio_nand_dosync(gpiomtd);
>
> if (ctrl & NAND_CTRL_CHANGE) {
> - if (gpio_is_valid(gpiomtd->plat.gpio_nce))
> - gpio_set_value(gpiomtd->plat.gpio_nce,
> - !(ctrl & NAND_NCE));
> - gpio_set_value(gpiomtd->plat.gpio_cle, !!(ctrl & NAND_CLE));
> - gpio_set_value(gpiomtd->plat.gpio_ale, !!(ctrl & NAND_ALE));
> + if (gpiomtd->nce)
> + gpiod_set_value(gpiomtd->nce, !(ctrl & NAND_NCE));
> + gpiod_set_value(gpiomtd->cle, !!(ctrl & NAND_CLE));
> + gpiod_set_value(gpiomtd->ale, !!(ctrl & NAND_ALE));
> gpio_nand_dosync(gpiomtd);
> }
> if (cmd == NAND_CMD_NONE)
> @@ -96,7 +99,7 @@ static int gpio_nand_devready(struct mtd_info *mtd)
> {
> struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd);
>
> - return gpio_get_value(gpiomtd->plat.gpio_rdy);
> + return gpiod_get_value(gpiomtd->rdy);
> }
>
> #ifdef CONFIG_OF
> @@ -123,12 +126,6 @@ static int gpio_nand_get_config_of(const struct device *dev,
> }
> }
>
> - plat->gpio_rdy = of_get_gpio(dev->of_node, 0);
> - plat->gpio_nce = of_get_gpio(dev->of_node, 1);
> - plat->gpio_ale = of_get_gpio(dev->of_node, 2);
> - plat->gpio_cle = of_get_gpio(dev->of_node, 3);
> - plat->gpio_nwp = of_get_gpio(dev->of_node, 4);
> -
> if (!of_property_read_u32(dev->of_node, "chip-delay", &val))
> plat->chip_delay = val;
>
> @@ -201,10 +198,11 @@ static int gpio_nand_remove(struct platform_device *pdev)
>
> nand_release(nand_to_mtd(&gpiomtd->nand_chip));
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
> - gpio_set_value(gpiomtd->plat.gpio_nwp, 0);
> - if (gpio_is_valid(gpiomtd->plat.gpio_nce))
> - gpio_set_value(gpiomtd->plat.gpio_nce, 1);
> + /* Enable write protection and disable the chip */
> + if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
> + gpiod_set_value(gpiomtd->nwp, 0);
> + if (gpiomtd->nce && !IS_ERR(gpiomtd->nce))
> + gpiod_set_value(gpiomtd->nce, 0);
>
> return 0;
> }
> @@ -215,66 +213,66 @@ static int gpio_nand_probe(struct platform_device *pdev)
> struct nand_chip *chip;
> struct mtd_info *mtd;
> struct resource *res;
> + struct device *dev = &pdev->dev;
> int ret = 0;
>
> - if (!pdev->dev.of_node && !dev_get_platdata(&pdev->dev))
> + if (!dev->of_node && !dev_get_platdata(dev))
> return -EINVAL;
>
> - gpiomtd = devm_kzalloc(&pdev->dev, sizeof(*gpiomtd), GFP_KERNEL);
> + gpiomtd = devm_kzalloc(dev, sizeof(*gpiomtd), GFP_KERNEL);
> if (!gpiomtd)
> return -ENOMEM;
>
> chip = &gpiomtd->nand_chip;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res);
> + chip->IO_ADDR_R = devm_ioremap_resource(dev, res);
> if (IS_ERR(chip->IO_ADDR_R))
> return PTR_ERR(chip->IO_ADDR_R);
>
> res = gpio_nand_get_io_sync(pdev);
> if (res) {
> - gpiomtd->io_sync = devm_ioremap_resource(&pdev->dev, res);
> + gpiomtd->io_sync = devm_ioremap_resource(dev, res);
> if (IS_ERR(gpiomtd->io_sync))
> return PTR_ERR(gpiomtd->io_sync);
> }
>
> - ret = gpio_nand_get_config(&pdev->dev, &gpiomtd->plat);
> + ret = gpio_nand_get_config(dev, &gpiomtd->plat);
> if (ret)
> return ret;
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nce)) {
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_nce,
> - "NAND NCE");
> - if (ret)
> - return ret;
> - gpio_direction_output(gpiomtd->plat.gpio_nce, 1);
> + /* Just enable the chip */
> + gpiomtd->nce = devm_gpiod_get_optional(dev, "nce", GPIOD_OUT_HIGH);
> + if (IS_ERR(gpiomtd->nce))
> + return PTR_ERR(gpiomtd->nce);
> +
> + /* We disable write protection once we know probe() will succeed */
> + gpiomtd->nwp = devm_gpiod_get_optional(dev, "nwp", GPIOD_OUT_LOW);
> + if (IS_ERR(gpiomtd->nwp)) {
> + ret = PTR_ERR(gpiomtd->nwp);
> + goto out_ce;
> }
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) {
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_nwp,
> - "NAND NWP");
> - if (ret)
> - return ret;
> + gpiomtd->nwp = devm_gpiod_get(dev, "ale", GPIOD_OUT_LOW);
> + if (IS_ERR(gpiomtd->nwp)) {
> + ret = PTR_ERR(gpiomtd->nwp);
> + goto out_ce;
> }
>
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_ale, "NAND ALE");
> - if (ret)
> - return ret;
> - gpio_direction_output(gpiomtd->plat.gpio_ale, 0);
> + gpiomtd->cle = devm_gpiod_get(dev, "cle", GPIOD_OUT_LOW);
> + if (IS_ERR(gpiomtd->cle)) {
> + ret = PTR_ERR(gpiomtd->cle);
> + goto out_ce;
> + }
>
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_cle, "NAND CLE");
> - if (ret)
> - return ret;
> - gpio_direction_output(gpiomtd->plat.gpio_cle, 0);
> -
> - if (gpio_is_valid(gpiomtd->plat.gpio_rdy)) {
> - ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_rdy,
> - "NAND RDY");
> - if (ret)
> - return ret;
> - gpio_direction_input(gpiomtd->plat.gpio_rdy);
> - chip->dev_ready = gpio_nand_devready;
> + gpiomtd->rdy = devm_gpiod_get_optional(dev, "rdy", GPIOD_IN);
> + if (IS_ERR(gpiomtd->rdy)) {
> + ret = PTR_ERR(gpiomtd->rdy);
> + goto out_ce;
> }
> + /* Using RDY pin */
> + if (gpiomtd->rdy)
> + chip->dev_ready = gpio_nand_devready;
>
> nand_set_flash_node(chip, pdev->dev.of_node);
> chip->IO_ADDR_W = chip->IO_ADDR_R;
> @@ -285,12 +283,13 @@ static int gpio_nand_probe(struct platform_device *pdev)
> chip->cmd_ctrl = gpio_nand_cmd_ctrl;
>
> mtd = nand_to_mtd(chip);
> - mtd->dev.parent = &pdev->dev;
> + mtd->dev.parent = dev;
>
> platform_set_drvdata(pdev, gpiomtd);
>
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
> - gpio_direction_output(gpiomtd->plat.gpio_nwp, 1);
> + /* Disable write protection, if wired up */
> + if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
> + gpiod_direction_output(gpiomtd->nwp, 1);
>
> ret = nand_scan(mtd, 1);
> if (ret)
> @@ -305,8 +304,11 @@ static int gpio_nand_probe(struct platform_device *pdev)
> return 0;
>
> err_wp:
> - if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
> - gpio_set_value(gpiomtd->plat.gpio_nwp, 0);
> + if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
> + gpiod_set_value(gpiomtd->nwp, 0);
> +out_ce:
> + if (gpiomtd->nce && !IS_ERR(gpiomtd->nce))
> + gpiod_set_value(gpiomtd->nce, 0);
>
> return ret;
> }
> diff --git a/include/linux/mtd/nand-gpio.h b/include/linux/mtd/nand-gpio.h
> index be4f45d89be2..98f71908212d 100644
> --- a/include/linux/mtd/nand-gpio.h
> +++ b/include/linux/mtd/nand-gpio.h
> @@ -4,11 +4,6 @@
> #include <linux/mtd/rawnand.h>
>
> struct gpio_nand_platdata {
> - int gpio_nce;
> - int gpio_nwp;
> - int gpio_cle;
> - int gpio_ale;
> - int gpio_rdy;
> void (*adjust_parts)(struct gpio_nand_platdata *, size_t);
> struct mtd_partition *parts;
> unsigned int num_parts;
^ permalink raw reply
* Re: [RESEND PATCH v5 10/16] mtd: nand: qcom: add command elements in BAM transaction
From: Boris Brezillon @ 2017-10-05 7:22 UTC (permalink / raw)
To: Abhishek Sahu
Cc: David Woodhouse, Brian Norris, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, linux-arm-msm, linux-kernel, linux-mtd,
Andy Gross, Archit Taneja, Sricharan R
In-Reply-To: <1506325886-23347-1-git-send-email-absahu@codeaurora.org>
On Mon, 25 Sep 2017 13:21:25 +0530
Abhishek Sahu <absahu@codeaurora.org> wrote:
> All the QPIC register read/write through BAM DMA requires
> command descriptor which contains the array of command elements.
>
> Reviewed-by: Archit Taneja <architt@codeaurora.org>
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Applied both.
Thanks,
Boris
> ---
>
> * Changes from v4: None
>
> The BAM DMA patches [1] got merged in 4.14-rc1 so now all the build
> dependencies are solved and this patch can be merged.
> This patch can be cleanly applied over v4.14-rc1.
>
> [1] http://www.spinics.net/lists/dmaengine/msg13665.html
>
> drivers/mtd/nand/qcom_nandc.c | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
> index 7977a70..b0a4734 100644
> --- a/drivers/mtd/nand/qcom_nandc.c
> +++ b/drivers/mtd/nand/qcom_nandc.c
> @@ -22,6 +22,7 @@
> #include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/delay.h>
> +#include <linux/dma/qcom_bam_dma.h>
>
> /* NANDc reg offsets */
> #define NAND_FLASH_CMD 0x00
> @@ -199,6 +200,7 @@
> */
> #define dev_cmd_reg_addr(nandc, reg) ((nandc)->props->dev_cmd_reg_start + (reg))
>
> +#define QPIC_PER_CW_CMD_ELEMENTS 32
> #define QPIC_PER_CW_CMD_SGL 32
> #define QPIC_PER_CW_DATA_SGL 8
>
> @@ -221,8 +223,13 @@
> /*
> * This data type corresponds to the BAM transaction which will be used for all
> * NAND transfers.
> + * @bam_ce - the array of BAM command elements
> * @cmd_sgl - sgl for NAND BAM command pipe
> * @data_sgl - sgl for NAND BAM consumer/producer pipe
> + * @bam_ce_pos - the index in bam_ce which is available for next sgl
> + * @bam_ce_start - the index in bam_ce which marks the start position ce
> + * for current sgl. It will be used for size calculation
> + * for current sgl
> * @cmd_sgl_pos - current index in command sgl.
> * @cmd_sgl_start - start index in command sgl.
> * @tx_sgl_pos - current index in data sgl for tx.
> @@ -231,8 +238,11 @@
> * @rx_sgl_start - start index in data sgl for rx.
> */
> struct bam_transaction {
> + struct bam_cmd_element *bam_ce;
> struct scatterlist *cmd_sgl;
> struct scatterlist *data_sgl;
> + u32 bam_ce_pos;
> + u32 bam_ce_start;
> u32 cmd_sgl_pos;
> u32 cmd_sgl_start;
> u32 tx_sgl_pos;
> @@ -462,7 +472,8 @@ static void free_bam_transaction(struct qcom_nand_controller *nandc)
>
> bam_txn_size =
> sizeof(*bam_txn) + num_cw *
> - ((sizeof(*bam_txn->cmd_sgl) * QPIC_PER_CW_CMD_SGL) +
> + ((sizeof(*bam_txn->bam_ce) * QPIC_PER_CW_CMD_ELEMENTS) +
> + (sizeof(*bam_txn->cmd_sgl) * QPIC_PER_CW_CMD_SGL) +
> (sizeof(*bam_txn->data_sgl) * QPIC_PER_CW_DATA_SGL));
>
> bam_txn_buf = devm_kzalloc(nandc->dev, bam_txn_size, GFP_KERNEL);
> @@ -472,6 +483,10 @@ static void free_bam_transaction(struct qcom_nand_controller *nandc)
> bam_txn = bam_txn_buf;
> bam_txn_buf += sizeof(*bam_txn);
>
> + bam_txn->bam_ce = bam_txn_buf;
> + bam_txn_buf +=
> + sizeof(*bam_txn->bam_ce) * QPIC_PER_CW_CMD_ELEMENTS * num_cw;
> +
> bam_txn->cmd_sgl = bam_txn_buf;
> bam_txn_buf +=
> sizeof(*bam_txn->cmd_sgl) * QPIC_PER_CW_CMD_SGL * num_cw;
> @@ -489,6 +504,8 @@ static void clear_bam_transaction(struct qcom_nand_controller *nandc)
> if (!nandc->props->is_bam)
> return;
>
> + bam_txn->bam_ce_pos = 0;
> + bam_txn->bam_ce_start = 0;
> bam_txn->cmd_sgl_pos = 0;
> bam_txn->cmd_sgl_start = 0;
> bam_txn->tx_sgl_pos = 0;
^ permalink raw reply
* Re: [PATCH v4 3/5] clk: aspeed: Add platform driver and register PLLs
From: Andrew Jeffery @ 2017-10-05 7:22 UTC (permalink / raw)
To: Joel Stanley, Lee Jones, Michael Turquette, Stephen Boyd
Cc: linux-kernel, linux-clk, linux-arm-kernel, Benjamin Herrenschmidt,
Jeremy Kerr, Rick Altherr, Ryan Chen, Arnd Bergmann
In-Reply-To: <20171003065540.11722-4-joel@jms.id.au>
[-- Attachment #1: Type: text/plain, Size: 7658 bytes --]
On Tue, 2017-10-03 at 17:25 +1030, Joel Stanley wrote:
> This registers a platform driver to set up all of the non-core clocks.
>
> The clocks that have configurable rates are now registered.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
>
> --
> v4:
> - Add eclk div table to fix ast2500 calculation
> - Add defines to document the BIT() macros
> - Pass dev where we can when registering clocks
> - Check for errors when registering clk_hws
> v3:
> - Fix bclk and eclk calculation
> - Seperate out ast2400 and ast25000 for pll calculation
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> drivers/clk/clk-aspeed.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 163 insertions(+)
>
> diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
> index d39cf51a5114..adb295292189 100644
> --- a/drivers/clk/clk-aspeed.c
> +++ b/drivers/clk/clk-aspeed.c
> @@ -14,6 +14,8 @@
> #include <linux/clk-provider.h>
> #include <linux/mfd/syscon.h>
> #include <linux/of_address.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> #include <linux/regmap.h>
> #include <linux/slab.h>
> #include <linux/spinlock.h>
> @@ -114,6 +116,32 @@ static const struct aspeed_gate_data aspeed_gates[] __initconst = {
> [ASPEED_CLK_GATE_LHCCLK] = { 28, -1, "lhclk-gate", "lhclk", 0 }, /* LPC master/LPC+ */
> };
>
> +static const char * const eclk_parents[] = {"d1pll", "hpll", "mpll"};
Hate to throw a spanner in the works, but I think we need some extra bits here
for handling the AST2400. ECLK with M-PLL as the parent divides the clock rate
by 2, there are four cases to handle where the last two cases are inverted, and
d1pll isn't a valid parent.
Also this table looks to be in reverse order to the field defined in the
datasheet.
> +
> +static const struct clk_div_table ast2500_eclk_div_table[] = {
> + { 0x0, 2 },
> + { 0x1, 2 },
> + { 0x2, 3 },
> + { 0x3, 4 },
> + { 0x4, 5 },
> + { 0x5, 6 },
> + { 0x6, 7 },
> + { 0x7, 8 },
> + { 0 }
> +};
> +
> +static const struct clk_div_table ast2500_mac_div_table[] = {
> + { 0x0, 4 }, /* Yep, really. Aspeed confirmed this is correct */
> + { 0x1, 4 },
> + { 0x2, 6 },
> + { 0x3, 8 },
> + { 0x4, 10 },
> + { 0x5, 12 },
> + { 0x6, 14 },
> + { 0x7, 16 },
> + { 0 }
> +};
> +
> static const struct clk_div_table ast2400_div_table[] = {
> { 0x0, 2 },
> { 0x1, 4 },
> @@ -179,6 +207,141 @@ static struct clk_hw *aspeed_ast2500_calc_pll(const char *name, u32 val)
> mult, div);
> }
>
> +struct aspeed_clk_soc_data {
> + const struct clk_div_table *div_table;
> + const struct clk_div_table *mac_div_table;
> + const struct clk_div_table *eclk_div_table;
> + struct clk_hw *(*calc_pll)(const char *name, u32 val);
As a note, I just discovered the D-PLL (and D2-PLL where applicable) frequency
function is slightly different to M-PLL and H-PLL on both the AST2400 and
AST2500. I don't think that is significant yet, but it's something to watch out
for. The point is this callback isn't a general-purpose "calculate a PLL
frequency" function, so the name might be inappropriate.
> +};
> +
> +static const struct aspeed_clk_soc_data ast2500_data = {
> + .div_table = ast2500_div_table,
> + .mac_div_table = ast2500_mac_div_table,
> + .eclk_div_table = ast2500_eclk_div_table,
> + .calc_pll = aspeed_ast2500_calc_pll,
> +};
> +
> +static const struct aspeed_clk_soc_data ast2400_data = {
> + .div_table = ast2400_div_table,
> + .mac_div_table = ast2400_div_table,
> + .eclk_div_table = ast2400_div_table,
> + .calc_pll = aspeed_ast2400_calc_pll,
> +};
> +
> +static int aspeed_clk_probe(struct platform_device *pdev)
> +{
> + const struct aspeed_clk_soc_data *soc_data;
> + struct device *dev = &pdev->dev;
> + struct regmap *map;
> + struct clk_hw *hw;
> + u32 val, rate;
> +
> + map = syscon_node_to_regmap(dev->of_node);
> + if (IS_ERR(map)) {
> + dev_err(dev, "no syscon regmap\n");
> + return PTR_ERR(map);
> + }
> +
> + /* SoC generations share common layouts but have different divisors */
> + soc_data = of_device_get_match_data(dev);
> + if (!soc_data) {
> + dev_err(dev, "no match data for platform\n");
> + return -EINVAL;
> + }
> +
> + /* UART clock div13 setting */
> + regmap_read(map, ASPEED_MISC_CTRL, &val);
> + if (val & UART_DIV13_EN)
> + rate = 24000000 / 13;
> + else
> + rate = 24000000;
> + /* TODO: Find the parent data for the uart clock */
> + hw = clk_hw_register_fixed_rate(dev, "uart", NULL, 0, rate);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_UART] = hw;
> +
> + /*
> + * Memory controller (M-PLL) PLL. This clock is configured by the
> + * bootloader, and is exposed to Linux as a read-only clock rate.
> + */
> + regmap_read(map, ASPEED_MPLL_PARAM, &val);
> + hw = soc_data->calc_pll("mpll", val);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_MPLL] = hw;
> +
> + /* SD/SDIO clock divider (TODO: There's a gate too) */
That sneaky gate bit!
> + hw = clk_hw_register_divider_table(dev, "sdio", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION, 12, 3, 0,
> + soc_data->div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_SDIO] = hw;
> +
> + /* MAC AHB bus clock divider */
> + hw = clk_hw_register_divider_table(dev, "mac", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION, 16, 3, 0,
> + soc_data->mac_div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_MAC] = hw;
> +
> + /* LPC Host (LHCLK) clock divider */
> + hw = clk_hw_register_divider_table(dev, "lhclk", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION, 20, 3, 0,
> + soc_data->div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_LHCLK] = hw;
> +
> + /* Video Engine (ECLK) mux and clock divider */
> + hw = clk_hw_register_mux(dev, "eclk_mux",
> + eclk_parents, ARRAY_SIZE(eclk_parents), 0,
> + scu_base + ASPEED_CLK_SELECTION, 2, 2,
> + 0, &aspeed_clk_lock);
See my comment on the eclk_parents table above.
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_ECLK_MUX] = hw;
> + hw = clk_hw_register_divider_table(dev, "eclk", "eclk_mux", 0,
> + scu_base + ASPEED_CLK_SELECTION, 28, 3, 0,
> + soc_data->eclk_div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_ECLK] = hw;
> +
> + /* P-Bus (BCLK) clock divider */
> + hw = clk_hw_register_divider_table(dev, "bclk", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION_2, 0, 2, 0,
> + soc_data->div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_BCLK] = hw;
> +
> + return 0;
> +};
> +
> +static const struct of_device_id aspeed_clk_dt_ids[] = {
> + { .compatible = "aspeed,ast2400-scu", .data = &ast2400_data },
> + { .compatible = "aspeed,ast2500-scu", .data = &ast2500_data },
> + { }
> +};
> +
> +static struct platform_driver aspeed_clk_driver = {
> + .probe = aspeed_clk_probe,
> + .driver = {
> + .name = "aspeed-clk",
> + .of_match_table = aspeed_clk_dt_ids,
> + .suppress_bind_attrs = true,
> + },
> +};
> +builtin_platform_driver(aspeed_clk_driver);
> +
> static void __init aspeed_ast2400_cc(struct regmap *map)
> {
> struct clk_hw *hw;
Cheers,
Andrew
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH v4 3/5] clk: aspeed: Add platform driver and register PLLs
From: Andrew Jeffery @ 2017-10-05 7:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20171003065540.11722-4-joel@jms.id.au>
On Tue, 2017-10-03 at 17:25 +1030, Joel Stanley wrote:
> This registers a platform driver to set up all of the non-core clocks.
>?
> The clocks that have configurable rates are now registered.
>?
> Signed-off-by: Joel Stanley <joel@jms.id.au>
>?
> --
> v4:
> ?- Add eclk div table to fix ast2500 calculation
> ?- Add defines to document the BIT() macros
> ?- Pass dev where we can when registering clocks
> ?- Check for errors when registering clk_hws
> v3:
> ?- Fix bclk and eclk calculation
> ?- Seperate out ast2400 and ast25000 for pll calculation
>?
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> ?drivers/clk/clk-aspeed.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++
> ?1 file changed, 163 insertions(+)
>?
> diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c
> index d39cf51a5114..adb295292189 100644
> --- a/drivers/clk/clk-aspeed.c
> +++ b/drivers/clk/clk-aspeed.c
> @@ -14,6 +14,8 @@
> ?#include <linux/clk-provider.h>
> ?#include <linux/mfd/syscon.h>
> ?#include <linux/of_address.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> ?#include <linux/regmap.h>
> ?#include <linux/slab.h>
> ?#include <linux/spinlock.h>
> @@ -114,6 +116,32 @@ static const struct aspeed_gate_data aspeed_gates[] __initconst = {
> ? [ASPEED_CLK_GATE_LHCCLK] = { 28, -1, "lhclk-gate", "lhclk", 0 }, /* LPC master/LPC+ */
> ?};
> ?
> +static const char * const eclk_parents[] = {"d1pll", "hpll", "mpll"};
Hate to throw a spanner in the works, but I think we need some extra bits here
for handling the AST2400. ECLK with M-PLL as the parent divides the clock rate
by 2, there are four cases to handle where the last two cases are inverted, and
d1pll isn't a valid parent.
Also this table looks to be in reverse order to the field defined in the
datasheet.
> +
> +static const struct clk_div_table ast2500_eclk_div_table[] = {
> + { 0x0, 2 },
> + { 0x1, 2 },
> + { 0x2, 3 },
> + { 0x3, 4 },
> + { 0x4, 5 },
> + { 0x5, 6 },
> + { 0x6, 7 },
> + { 0x7, 8 },
> + { 0 }
> +};
> +
> +static const struct clk_div_table ast2500_mac_div_table[] = {
> + { 0x0, 4 }, /* Yep, really. Aspeed confirmed this is correct */
> + { 0x1, 4 },
> + { 0x2, 6 },
> + { 0x3, 8 },
> + { 0x4, 10 },
> + { 0x5, 12 },
> + { 0x6, 14 },
> + { 0x7, 16 },
> + { 0 }
> +};
> +
> ?static const struct clk_div_table ast2400_div_table[] = {
> ? { 0x0, 2 },
> ? { 0x1, 4 },
> @@ -179,6 +207,141 @@ static struct clk_hw *aspeed_ast2500_calc_pll(const char *name, u32 val)
> ? mult, div);
> ?}
> ?
> +struct aspeed_clk_soc_data {
> + const struct clk_div_table *div_table;
> + const struct clk_div_table *mac_div_table;
> + const struct clk_div_table *eclk_div_table;
> + struct clk_hw *(*calc_pll)(const char *name, u32 val);
As a note, I just discovered the D-PLL (and D2-PLL where applicable) frequency
function is slightly different to M-PLL and H-PLL on both the AST2400 and
AST2500. I don't think that is significant yet, but it's something to watch out
for. The point is this callback isn't a general-purpose "calculate a PLL
frequency" function, so the name might be inappropriate.
> +};
> +
> +static const struct aspeed_clk_soc_data ast2500_data = {
> + .div_table = ast2500_div_table,
> + .mac_div_table = ast2500_mac_div_table,
> + .eclk_div_table = ast2500_eclk_div_table,
> + .calc_pll = aspeed_ast2500_calc_pll,
> +};
> +
> +static const struct aspeed_clk_soc_data ast2400_data = {
> + .div_table = ast2400_div_table,
> + .mac_div_table = ast2400_div_table,
> + .eclk_div_table = ast2400_div_table,
> + .calc_pll = aspeed_ast2400_calc_pll,
> +};
> +
> +static int aspeed_clk_probe(struct platform_device *pdev)
> +{
> + const struct aspeed_clk_soc_data *soc_data;
> + struct device *dev = &pdev->dev;
> + struct regmap *map;
> + struct clk_hw *hw;
> + u32 val, rate;
> +
> + map = syscon_node_to_regmap(dev->of_node);
> + if (IS_ERR(map)) {
> + dev_err(dev, "no syscon regmap\n");
> + return PTR_ERR(map);
> + }
> +
> + /* SoC generations share common layouts but have different divisors */
> + soc_data = of_device_get_match_data(dev);
> + if (!soc_data) {
> + dev_err(dev, "no match data for platform\n");
> + return -EINVAL;
> + }
> +
> + /* UART clock div13 setting */
> + regmap_read(map, ASPEED_MISC_CTRL, &val);
> + if (val & UART_DIV13_EN)
> + rate = 24000000 / 13;
> + else
> + rate = 24000000;
> + /* TODO: Find the parent data for the uart clock */
> + hw = clk_hw_register_fixed_rate(dev, "uart", NULL, 0, rate);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_UART] = hw;
> +
> + /*
> + ?* Memory controller (M-PLL) PLL. This clock is configured by the
> + ?* bootloader, and is exposed to Linux as a read-only clock rate.
> + ?*/
> + regmap_read(map, ASPEED_MPLL_PARAM, &val);
> + hw = soc_data->calc_pll("mpll", val);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_MPLL] = hw;
> +
> + /* SD/SDIO clock divider (TODO: There's a gate too) */
That sneaky gate bit!
> + hw = clk_hw_register_divider_table(dev, "sdio", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION, 12, 3, 0,
> + soc_data->div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_SDIO] = hw;
> +
> + /* MAC AHB bus clock divider */
> + hw = clk_hw_register_divider_table(dev, "mac", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION, 16, 3, 0,
> + soc_data->mac_div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_MAC] = hw;
> +
> + /* LPC Host (LHCLK) clock divider */
> + hw = clk_hw_register_divider_table(dev, "lhclk", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION, 20, 3, 0,
> + soc_data->div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_LHCLK] = hw;
> +
> + /* Video Engine (ECLK) mux and clock divider */
> + hw = clk_hw_register_mux(dev, "eclk_mux",
> + eclk_parents, ARRAY_SIZE(eclk_parents), 0,
> + scu_base + ASPEED_CLK_SELECTION, 2, 2,
> + 0, &aspeed_clk_lock);
See my comment on the eclk_parents table above.
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_ECLK_MUX] = hw;
> + hw = clk_hw_register_divider_table(dev, "eclk", "eclk_mux", 0,
> + scu_base + ASPEED_CLK_SELECTION, 28, 3, 0,
> + soc_data->eclk_div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_ECLK] = hw;
> +
> + /* P-Bus (BCLK) clock divider */
> + hw = clk_hw_register_divider_table(dev, "bclk", "hpll", 0,
> + scu_base + ASPEED_CLK_SELECTION_2, 0, 2, 0,
> + soc_data->div_table,
> + &aspeed_clk_lock);
> + if (IS_ERR(hw))
> + return PTR_ERR(hw);
> + aspeed_clk_data->hws[ASPEED_CLK_BCLK] = hw;
> +
> + return 0;
> +};
> +
> +static const struct of_device_id aspeed_clk_dt_ids[] = {
> + { .compatible = "aspeed,ast2400-scu", .data = &ast2400_data },
> + { .compatible = "aspeed,ast2500-scu", .data = &ast2500_data },
> + { }
> +};
> +
> +static struct platform_driver aspeed_clk_driver = {
> + .probe??= aspeed_clk_probe,
> + .driver = {
> + .name = "aspeed-clk",
> + .of_match_table = aspeed_clk_dt_ids,
> + .suppress_bind_attrs = true,
> + },
> +};
> +builtin_platform_driver(aspeed_clk_driver);
> +
> ?static void __init aspeed_ast2400_cc(struct regmap *map)
> ?{
> ? struct clk_hw *hw;
Cheers,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171005/82c465d9/attachment.sig>
^ permalink raw reply
* Re: [PATCH 13/25] xfs: scrub inode btrees
From: Dave Chinner @ 2017-10-05 7:22 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
In-Reply-To: <20171005054714.GF7122@magnolia>
On Wed, Oct 04, 2017 at 10:47:14PM -0700, Darrick J. Wong wrote:
> On Thu, Oct 05, 2017 at 01:08:10PM +1100, Dave Chinner wrote:
> > On Tue, Oct 03, 2017 at 01:42:11PM -0700, Darrick J. Wong wrote:
> > > +/* Count the number of free inodes. */
> > > +static unsigned int
> > > +xfs_scrub_iallocbt_freecount(
> > > + xfs_inofree_t freemask)
> > > +{
> > > + int bits = XFS_INODES_PER_CHUNK;
> > > + unsigned int ret = 0;
> > > +
> > > + while (bits--) {
> > > + if (freemask & 1)
> > > + ret++;
> > > + freemask >>= 1;
> > > + }
> >
> >
> > Seems a little cumbersome. Perhaps a loop using xfs_next_bit()
> > might be a bit faster, something like:
> >
> > nextbit = xfs_next_bit(&freemask, 1, 0);
> > while (nextbit != -1) {
> > ret++;
> > nextbit = xfs_next_bit(&freemask, 1, nextbit + 1);
> > }
>
> <nod> A pity there's no popcnt()...
Oh, hweight64().
> > > + error = xfs_icache_inode_is_allocated(mp, bs->cur->bc_tp,
> > > + fsino + clusterino, &inuse);
> > > + if (error == -ENODATA) {
> > > + /* Not cached, just read the disk buffer */
> >
> > I think that is wrong. xfs_icache_inode_is_allocated() returns
> > -ENOENT if the inode is not in cache....
>
> I changed it to ENODATA so that we can tell the difference between
> inode not in cache (ENODATA) and inode racing with unlink (ENOENT).
>
> (Patch was sent to the ML a while ago and I omitted it from this posting...)
Ah, if it's not committed upstream yet, include it in the next
posting, please :)
> > > + /* Make sure the freemask matches the inode records. */
> > > + blks_per_cluster = xfs_icluster_size_fsb(mp);
> > > + nr_inodes = XFS_OFFBNO_TO_AGINO(mp, blks_per_cluster, 0);
> >
> > Does this setup and loop work for the case where we have 64k
> > filesystem blocks and so two or more inode chunks per filesystem
> > block (i.e. ppc64)?
>
> I think the answer is yes, at worst case we end up processing a block's
> worth of inodes at a time. The last time I ran scrub on ppc64 (last
> week) it worked fine.
Hmmm - there's nothing to count how many inodes are scrubbed, is
there? Perhaps it would be good to gcount as we go so we know if
we've scrubbed all the inodes?
Hmmm - I might have missed it, but is there anywhere in this code
where we check the inode number in the inode that we have read
actually matches the agino we are attempting to validate?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply
* Re: [PATCH v4 4/8] mtd: nand: atmel: Avoid ECC errors when leaving backup mode
From: Boris Brezillon @ 2017-10-05 7:22 UTC (permalink / raw)
To: Romain Izard
Cc: Michael Turquette, Stephen Boyd, Lee Jones, Wenyou Yang, Josh Wu,
Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, Thierry Reding, Richard Genoud,
Greg Kroah-Hartman, Jiri Slaby, Alan Stern, Ludovic Desroches,
Nicolas Ferre, Alexandre Belloni, linux-clk, linux-kernel,
linux-mtd, linux-pwm, linux-serial, linux-usb
In-Reply-To: <20170928094627.31017-5-romain.izard.pro@gmail.com>
On Thu, 28 Sep 2017 11:46:23 +0200
Romain Izard <romain.izard.pro@gmail.com> wrote:
> During backup mode, the contents of all registers will be cleared as the
> SoC will be completely powered down. For a product that boots on NAND
> Flash memory, the bootloader will obviously use the related controller
> to read the Flash and correct any detected error in the memory, before
> handling back control to the kernel's resuming entry point.
>
> But it does not clean the NAND controller registers after use and on its
> side the kernel driver expects the error locator to be powered down and
> in a clean state. Add a resume hook for the PMECC error locator, and
> reset its registers.
>
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Applied.
Thanks,
Boris
> ---
> Changes in v3:
> * keep the PMECC disabled when not in use, and use atmel_pmecc_resume to
> reset the controller after the bootloader has left it enabled.
>
> Changes in v4:
> * export atmel_pmecc_reset instead of atmel_pmecc_resume
> * use the correct pointer in atmel_nand_controller_resume
>
> drivers/mtd/nand/atmel/nand-controller.c | 3 +++
> drivers/mtd/nand/atmel/pmecc.c | 17 +++++++++--------
> drivers/mtd/nand/atmel/pmecc.h | 1 +
> 3 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
> index f25eca79f4e5..8afcff9a66ea 100644
> --- a/drivers/mtd/nand/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/atmel/nand-controller.c
> @@ -2530,6 +2530,9 @@ static __maybe_unused int atmel_nand_controller_resume(struct device *dev)
> struct atmel_nand_controller *nc = dev_get_drvdata(dev);
> struct atmel_nand *nand;
>
> + if (nc->pmecc)
> + atmel_pmecc_reset(nc->pmecc);
> +
> list_for_each_entry(nand, &nc->chips, node) {
> int i;
>
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 146af8218314..0a3f12141c45 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -765,6 +765,13 @@ void atmel_pmecc_get_generated_eccbytes(struct atmel_pmecc_user *user,
> }
> EXPORT_SYMBOL_GPL(atmel_pmecc_get_generated_eccbytes);
>
> +void atmel_pmecc_reset(struct atmel_pmecc *pmecc)
> +{
> + writel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);
> + writel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);
> +}
> +EXPORT_SYMBOL_GPL(atmel_pmecc_reset);
> +
> int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op)
> {
> struct atmel_pmecc *pmecc = user->pmecc;
> @@ -797,10 +804,7 @@ EXPORT_SYMBOL_GPL(atmel_pmecc_enable);
>
> void atmel_pmecc_disable(struct atmel_pmecc_user *user)
> {
> - struct atmel_pmecc *pmecc = user->pmecc;
> -
> - writel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);
> - writel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);
> + atmel_pmecc_reset(user->pmecc);
> mutex_unlock(&user->pmecc->lock);
> }
> EXPORT_SYMBOL_GPL(atmel_pmecc_disable);
> @@ -855,10 +859,7 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>
> /* Disable all interrupts before registering the PMECC handler. */
> writel(0xffffffff, pmecc->regs.base + ATMEL_PMECC_IDR);
> -
> - /* Reset the ECC engine */
> - writel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);
> - writel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);
> + atmel_pmecc_reset(pmecc);
>
> return pmecc;
> }
> diff --git a/drivers/mtd/nand/atmel/pmecc.h b/drivers/mtd/nand/atmel/pmecc.h
> index a8ddbfca2ea5..817e0dd9fd15 100644
> --- a/drivers/mtd/nand/atmel/pmecc.h
> +++ b/drivers/mtd/nand/atmel/pmecc.h
> @@ -61,6 +61,7 @@ atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
> struct atmel_pmecc_user_req *req);
> void atmel_pmecc_destroy_user(struct atmel_pmecc_user *user);
>
> +void atmel_pmecc_reset(struct atmel_pmecc *pmecc);
> int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op);
> void atmel_pmecc_disable(struct atmel_pmecc_user *user);
> int atmel_pmecc_wait_rdy(struct atmel_pmecc_user *user);
^ permalink raw reply
* Re: [PATCH v4 4/8] mtd: nand: atmel: Avoid ECC errors when leaving backup mode
From: Boris Brezillon @ 2017-10-05 7:22 UTC (permalink / raw)
To: Romain Izard
Cc: Michael Turquette, Stephen Boyd, Lee Jones, Wenyou Yang, Josh Wu,
Richard Weinberger, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, Thierry Reding, Richard Genoud,
Greg Kroah-Hartman, Jiri Slaby, Alan Stern, Ludovic Desroches,
Nicolas Ferre, Alexandre Belloni
In-Reply-To: <20170928094627.31017-5-romain.izard.pro@gmail.com>
On Thu, 28 Sep 2017 11:46:23 +0200
Romain Izard <romain.izard.pro@gmail.com> wrote:
> During backup mode, the contents of all registers will be cleared as the
> SoC will be completely powered down. For a product that boots on NAND
> Flash memory, the bootloader will obviously use the related controller
> to read the Flash and correct any detected error in the memory, before
> handling back control to the kernel's resuming entry point.
>
> But it does not clean the NAND controller registers after use and on its
> side the kernel driver expects the error locator to be powered down and
> in a clean state. Add a resume hook for the PMECC error locator, and
> reset its registers.
>
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Applied.
Thanks,
Boris
> ---
> Changes in v3:
> * keep the PMECC disabled when not in use, and use atmel_pmecc_resume to
> reset the controller after the bootloader has left it enabled.
>
> Changes in v4:
> * export atmel_pmecc_reset instead of atmel_pmecc_resume
> * use the correct pointer in atmel_nand_controller_resume
>
> drivers/mtd/nand/atmel/nand-controller.c | 3 +++
> drivers/mtd/nand/atmel/pmecc.c | 17 +++++++++--------
> drivers/mtd/nand/atmel/pmecc.h | 1 +
> 3 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
> index f25eca79f4e5..8afcff9a66ea 100644
> --- a/drivers/mtd/nand/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/atmel/nand-controller.c
> @@ -2530,6 +2530,9 @@ static __maybe_unused int atmel_nand_controller_resume(struct device *dev)
> struct atmel_nand_controller *nc = dev_get_drvdata(dev);
> struct atmel_nand *nand;
>
> + if (nc->pmecc)
> + atmel_pmecc_reset(nc->pmecc);
> +
> list_for_each_entry(nand, &nc->chips, node) {
> int i;
>
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 146af8218314..0a3f12141c45 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -765,6 +765,13 @@ void atmel_pmecc_get_generated_eccbytes(struct atmel_pmecc_user *user,
> }
> EXPORT_SYMBOL_GPL(atmel_pmecc_get_generated_eccbytes);
>
> +void atmel_pmecc_reset(struct atmel_pmecc *pmecc)
> +{
> + writel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);
> + writel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);
> +}
> +EXPORT_SYMBOL_GPL(atmel_pmecc_reset);
> +
> int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op)
> {
> struct atmel_pmecc *pmecc = user->pmecc;
> @@ -797,10 +804,7 @@ EXPORT_SYMBOL_GPL(atmel_pmecc_enable);
>
> void atmel_pmecc_disable(struct atmel_pmecc_user *user)
> {
> - struct atmel_pmecc *pmecc = user->pmecc;
> -
> - writel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);
> - writel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);
> + atmel_pmecc_reset(user->pmecc);
> mutex_unlock(&user->pmecc->lock);
> }
> EXPORT_SYMBOL_GPL(atmel_pmecc_disable);
> @@ -855,10 +859,7 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
>
> /* Disable all interrupts before registering the PMECC handler. */
> writel(0xffffffff, pmecc->regs.base + ATMEL_PMECC_IDR);
> -
> - /* Reset the ECC engine */
> - writel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);
> - writel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);
> + atmel_pmecc_reset(pmecc);
>
> return pmecc;
> }
> diff --git a/drivers/mtd/nand/atmel/pmecc.h b/drivers/mtd/nand/atmel/pmecc.h
> index a8ddbfca2ea5..817e0dd9fd15 100644
> --- a/drivers/mtd/nand/atmel/pmecc.h
> +++ b/drivers/mtd/nand/atmel/pmecc.h
> @@ -61,6 +61,7 @@ atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
> struct atmel_pmecc_user_req *req);
> void atmel_pmecc_destroy_user(struct atmel_pmecc_user *user);
>
> +void atmel_pmecc_reset(struct atmel_pmecc *pmecc);
> int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op);
> void atmel_pmecc_disable(struct atmel_pmecc_user *user);
> int atmel_pmecc_wait_rdy(struct atmel_pmecc_user *user);
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.