linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class
@ 2014-08-01 14:51 Rostislav Lisovy
  2014-08-03 13:16 ` Sasha Levin
  0 siblings, 1 reply; 5+ messages in thread
From: Rostislav Lisovy @ 2014-08-01 14:51 UTC (permalink / raw)
  To: Russell King, Bjorn Helgaas, Yijing Wang, linux-arm-kernel, linux-kernel
  Cc: Nicholas Krause, Rostislav Lisovy

Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
---
 arch/arm/kernel/bios32.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 17a26c1..e511ad1 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -255,10 +255,9 @@ static void pci_fixup_it8152(struct pci_dev *dev)
 {
 	int i;
 	/* fixup for ITE 8152 devices */
-	/* FIXME: add defines for class 0x68000 and 0x80103 */
 	if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
-	    dev->class == 0x68000 ||
-	    dev->class == 0x80103) {
+	    dev->class == (PCI_CLASS_BRIDGE_OTHER << 8) ||
+	    dev->class == ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03)) {
 		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
 			dev->resource[i].start = 0;
 			dev->resource[i].end   = 0;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class
  2014-08-01 14:51 [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class Rostislav Lisovy
@ 2014-08-03 13:16 ` Sasha Levin
  2014-08-04  9:31   ` Rostislav Lisovy
  0 siblings, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2014-08-03 13:16 UTC (permalink / raw)
  To: Rostislav Lisovy, Russell King, Bjorn Helgaas, Yijing Wang,
	linux-arm-kernel, linux-kernel
  Cc: Nicholas Krause

On 08/01/2014 10:51 AM, Rostislav Lisovy wrote:
> Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
> ---
>  arch/arm/kernel/bios32.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index 17a26c1..e511ad1 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -255,10 +255,9 @@ static void pci_fixup_it8152(struct pci_dev *dev)
>  {
>  	int i;
>  	/* fixup for ITE 8152 devices */
> -	/* FIXME: add defines for class 0x68000 and 0x80103 */
>  	if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
> -	    dev->class == 0x68000 ||
> -	    dev->class == 0x80103) {
> +	    dev->class == (PCI_CLASS_BRIDGE_OTHER << 8) ||
> +	    dev->class == ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03)) {
>  		for (i = 0; i < PCI_NUM_RESOURCES; i++) {
>  			dev->resource[i].start = 0;
>  			dev->resource[i].end   = 0;
> 

Care to explain how your new code is equivalent to the old one?


Thanks,
Sasha

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class
  2014-08-03 13:16 ` Sasha Levin
@ 2014-08-04  9:31   ` Rostislav Lisovy
  2014-08-25  8:39     ` Rostislav Lisovy
  0 siblings, 1 reply; 5+ messages in thread
From: Rostislav Lisovy @ 2014-08-04  9:31 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Russell King, Bjorn Helgaas, Yijing Wang, linux-arm-kernel,
	linux-kernel, Nicholas Krause

On Sun, 2014-08-03 at 09:16 -0400, Sasha Levin wrote:
> > -     /* FIXME: add defines for class 0x68000 and 0x80103 */
> >       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
> > -         dev->class == 0x68000 ||
> > -         dev->class == 0x80103) {
> > +         dev->class == (PCI_CLASS_BRIDGE_OTHER << 8) ||
> > +         dev->class == ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03)) {
> >               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
> >                       dev->resource[i].start = 0;
> >                       dev->resource[i].end   = 0;
> > 
> 
> Care to explain how your new code is equivalent to the old one?

The header file include/linux/pci_ids.h defines
#define PCI_CLASS_BRIDGE_OTHER          0x0680
#define PCI_CLASS_SYSTEM_DMA            0x0801

((struct pci_dev*)dev)->class
corresponds to the 3 bytes Class code in the PCI Configuration space
header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.

In that case
(PCI_CLASS_BRIDGE_OTHER << 8)
is equivalent to 0x68000 (imagine the leading zero)
and
((PCI_CLASS_SYSTEM_DMA << 8) | 0x03))
is equivalent to 0x80103.

Best regards;
Rostislav



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class
  2014-08-04  9:31   ` Rostislav Lisovy
@ 2014-08-25  8:39     ` Rostislav Lisovy
  2014-08-25  9:02       ` Yijing Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Rostislav Lisovy @ 2014-08-25  8:39 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Russell King, Bjorn Helgaas, Yijing Wang, linux-arm-kernel,
	linux-kernel, Nicholas Krause

On Mon, 2014-08-04 at 11:31 +0200, Rostislav Lisovy wrote:
> On Sun, 2014-08-03 at 09:16 -0400, Sasha Levin wrote:
> > > -     /* FIXME: add defines for class 0x68000 and 0x80103 */
> > >       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
> > > -         dev->class == 0x68000 ||
> > > -         dev->class == 0x80103) {
> > > +         dev->class == (PCI_CLASS_BRIDGE_OTHER << 8) ||
> > > +         dev->class == ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03)) {
> > >               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
> > >                       dev->resource[i].start = 0;
> > >                       dev->resource[i].end   = 0;
> > > 
> > 
> > Care to explain how your new code is equivalent to the old one?
> 
> The header file include/linux/pci_ids.h defines
> #define PCI_CLASS_BRIDGE_OTHER          0x0680
> #define PCI_CLASS_SYSTEM_DMA            0x0801
> 
> ((struct pci_dev*)dev)->class
> corresponds to the 3 bytes Class code in the PCI Configuration space
> header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.
> 
> In that case
> (PCI_CLASS_BRIDGE_OTHER << 8)
> is equivalent to 0x68000 (imagine the leading zero)
> and
> ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03))
> is equivalent to 0x80103.
> 

Just a kind reminder in case anyone is interested in reviewing and
accepting the patch.

Best regards;
Rostislav Lisovy



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class
  2014-08-25  8:39     ` Rostislav Lisovy
@ 2014-08-25  9:02       ` Yijing Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Yijing Wang @ 2014-08-25  9:02 UTC (permalink / raw)
  To: Rostislav Lisovy, Sasha Levin
  Cc: Russell King, Bjorn Helgaas, linux-arm-kernel, linux-kernel,
	Nicholas Krause

On 2014/8/25 16:39, Rostislav Lisovy wrote:
> On Mon, 2014-08-04 at 11:31 +0200, Rostislav Lisovy wrote:
>> On Sun, 2014-08-03 at 09:16 -0400, Sasha Levin wrote:
>>>> -     /* FIXME: add defines for class 0x68000 and 0x80103 */
>>>>       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
>>>> -         dev->class == 0x68000 ||
>>>> -         dev->class == 0x80103) {
>>>> +         dev->class == (PCI_CLASS_BRIDGE_OTHER << 8) ||
>>>> +         dev->class == ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03)) {
>>>>               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
>>>>                       dev->resource[i].start = 0;
>>>>                       dev->resource[i].end   = 0;
>>>>
>>>
>>> Care to explain how your new code is equivalent to the old one?
>>
>> The header file include/linux/pci_ids.h defines
>> #define PCI_CLASS_BRIDGE_OTHER          0x0680
>> #define PCI_CLASS_SYSTEM_DMA            0x0801
>>
>> ((struct pci_dev*)dev)->class
>> corresponds to the 3 bytes Class code in the PCI Configuration space
>> header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.
>>
>> In that case
>> (PCI_CLASS_BRIDGE_OTHER << 8)
>> is equivalent to 0x68000 (imagine the leading zero)
>> and
>> ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03))
>> is equivalent to 0x80103.
>>
> 
> Just a kind reminder in case anyone is interested in reviewing and
> accepting the patch.

Reviewed-by : Yijing Wang <wangyijing@huawei.com>

> 
> Best regards;
> Rostislav Lisovy
> 
> 
> 
> .
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-25  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01 14:51 [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class Rostislav Lisovy
2014-08-03 13:16 ` Sasha Levin
2014-08-04  9:31   ` Rostislav Lisovy
2014-08-25  8:39     ` Rostislav Lisovy
2014-08-25  9:02       ` Yijing Wang

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).