LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	<xuwei5@huawei.com>, <mika.westerberg@linux.intel.com>,
	<lee.jones@linaro.org>
Cc: <rjw@rjwysocki.net>, <linux-kernel@vger.kernel.org>,
	<arnd@arndb.de>, <graeme.gregory@linaro.org>,
	<helgaas@kernel.org>, <z.liuxinliang@hisilicon.com>,
	<linuxarm@huawei.com>
Subject: Re: [PATCH 2/2] HISI LPC: Add ACPI UART support
Date: Fri, 4 May 2018 13:33:35 +0100	[thread overview]
Message-ID: <3fd88684-7bdd-b3b4-cddc-a551d5d820ff@huawei.com> (raw)
In-Reply-To: <1525366584.21176.654.camel@linux.intel.com>

On 03/05/2018 17:56, Andy Shevchenko wrote:
> On Thu, 2018-05-03 at 23:08 +0800, John Garry wrote:
>> On the Huawei D03 development board the system UART is
>> the UART connected on the LPC bus.
>>
>> The profile for the device driver required for this HW
>> would be as follows:
>> - platform driver
>> - supports 16550
>> - supports ACPI
>> - supports polling mode
>> - supports IO space
>>
>> In principle we should use the PNP driver (8250_dw.c) for
>> 8250-devices with ACPI FW. However since this host driver
>> does not support PNP devices, and modifying the PNP core
>> code to support it is not worth the effort, use the generic
>> 8250 isa driver.
>>
>> For this, we need to setup the MFD cell platform data for
>> a serial 8250 Port.
>>
>> In addition to this change, we also make the following
>> changes:
>> - set child ACPI device as enumerated. This fixes a conflict
>>   in serdev setup for the UART
>> - use platform device ID auto for creating the uart child
>>   platform device to avoid conflict with platform devices
>>   created for serial8250_isa_devs from 8250_core.c
>

Hi Andy,

>> +	mfd_cell->platform_data = devm_kmemdup(hostdev, &ref_port,
>> +					       sizeof(ref_port),
>> GFP_KERNEL);
>
> Isn't this done by MFD core?

It does, but what we are copying from is on the stack and could be 
overwritten by the point we call the mfd_add_devices(). But this could 
be improved.

BTW, As seen in other discussion, future of MFD usage is in doubt, so 
all this may be dropped.

Thanks very much,
John

>
>

      reply	other threads:[~2018-05-04 12:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 15:08 [PATCH 0/2] HISI LPC " John Garry
2018-05-03 15:08 ` [PATCH 1/2] HISI LPC: Reference static MFD cells for ACPI support John Garry
2018-05-03 16:54   ` Andy Shevchenko
2018-05-04  9:02     ` Lee Jones
2018-05-04  9:27       ` John Garry
2018-05-04 10:03         ` Lee Jones
2018-05-04 10:21           ` John Garry
2018-05-04 12:29     ` John Garry
2018-05-03 15:08 ` [PATCH 2/2] HISI LPC: Add ACPI UART support John Garry
2018-05-03 16:56   ` Andy Shevchenko
2018-05-04 12:33     ` John Garry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fd88684-7bdd-b3b4-cddc-a551d5d820ff@huawei.com \
    --to=john.garry@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=graeme.gregory@linaro.org \
    --cc=helgaas@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=xuwei5@huawei.com \
    --cc=z.liuxinliang@hisilicon.com \
    --subject='Re: [PATCH 2/2] HISI LPC: Add ACPI UART support' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).