All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: David Daney <ddaney@caviumnetworks.com>,
	Tomasz Nowicki <tomasz.nowicki@linaro.org>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	Len Brown <lenb@kernel.org>, Robert Richter <rrichter@cavium.com>,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH] acpi, property: Export acpi_dev_prop_read_single call.
Date: Wed, 05 Aug 2015 16:49:37 -0700	[thread overview]
Message-ID: <55C2A111.5090607@gmail.com> (raw)
In-Reply-To: <9593183.WnSqkeFNYV@vostro.rjw.lan>

On 08/05/2015 04:55 PM, Rafael J. Wysocki wrote:
> On Wednesday, August 05, 2015 04:17:21 PM David Daney wrote:
>> On 08/05/2015 04:23 PM, Rafael J. Wysocki wrote:
>>> On Wednesday, August 05, 2015 01:14:49 PM David Daney wrote:
>>>> On 08/05/2015 10:26 AM, David Daney wrote:
>>>>> On 08/05/2015 06:43 AM, Tomasz Nowicki wrote:
>>>>>> On 05.08.2015 15:48, Rafael J. Wysocki wrote:
>>>>>>> On Tuesday, August 04, 2015 04:01:59 PM David Daney wrote:
>>>>>>>> From: Tomasz Nowicki <tomasz.nowicki@linaro.org>
>>>>>>>>
>>>>>>>> Fixes the following build error when building drivers as modules:
>>>>>>>>
>>>>>>>>     ERROR: "acpi_dev_prop_read_single" [drivers/net/phy/mdio-octeon.ko]
>>>>>>>> undefined!
>>>>>>>>     ERROR: "acpi_dev_prop_read_single"
>>>>>>>> [drivers/net/ethernet/cavium/thunder/thunder_bgx.ko] undefined!
>>>>>>>
>>>>>>> Can you please tell me why the drivers in question use that function
>>>>>>> directly, although they aren't supposed to?
>>>>>>>
>>>>>>> Clearly, their authors had not tried to build them as modules or they
>>>>>>> would have noticed the problem at the development stage already.
>>>>>>>
>>>>>>> What would be wrong with using the generic device properties API
>>>>>>> instead?
>>>>>>>
>>>>>> Yes, you are right. We should use:
>>>>>> int device_property_read_u64_array(struct device *dev, const char
>>>>>> *propname, u64 *val, size_t nval);
>>>>>>
>>>>>
>>>>> Thanks all, for the review and suggestions.  We we try the suggested
>>>>> approach and see how it goes...
>>>>>
>>>>
>>>> Actually I don't think device_property_read_u64_array() will work.
>>>>
>>>> We are traversing a reference to a different acpi_device via
>>>> acpi_dev_get_property_reference(),
>>>
>>> Why?
>>
>> Network device has a "phy-handle" (traversed with
>> acpi_dev_get_property_reference()), and we want to get some properties
>> of that phy.
>>
>> I could turn the question around to you:  Why export
>> acpi_dev_get_property_reference()?  If there is a reason to export that,
>> then you should let people use the result.
>
> The GPIO core uses it and you *can* use the result (please see my other
> message).

It was somewhat of a rhetorical question.

I would actually like to do as you suggest, so I am looking at unwinding 
the driver code to use the interfaces you suggest.

It is a multi-step process for me though.  First I had to make the 
existing code work.  I now have it working, so next I will try to fix it.

>
> I wonder how does the ACPI table in question look like.  Do you have
> an acpidump output from that system by any chance?

Not handy.  I will be producing one soon though.

The good news is that I can change the firmware to make it correct if it 
has problems.


Thanks for your patience,
David Daney



  reply	other threads:[~2015-08-05 23:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 23:01 [PATCH] acpi, property: Export acpi_dev_prop_read_single call David Daney
2015-08-05 13:48 ` Rafael J. Wysocki
2015-08-05 13:43   ` Tomasz Nowicki
2015-08-05 17:26     ` David Daney
2015-08-05 17:26       ` David Daney
2015-08-05 20:14       ` David Daney
2015-08-05 23:23         ` Rafael J. Wysocki
2015-08-05 23:17           ` David Daney
2015-08-05 23:17             ` David Daney
2015-08-05 23:55             ` Rafael J. Wysocki
2015-08-05 23:49               ` David Daney [this message]
2015-08-05 23:45           ` Rafael J. Wysocki

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=55C2A111.5090607@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=david.daney@cavium.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rrichter@cavium.com \
    --cc=tomasz.nowicki@linaro.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.