[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <002c01d6ac73$67a966e0$36fc34a0$@codeaurora.org>
Date: Tue, 27 Oct 2020 20:41:05 +0530
From: "Rakesh Pillai" <pillair@...eaurora.org>
To: "'Doug Anderson'" <dianders@...omium.org>
Cc: "'Abhishek Kumar'" <kuabhs@...omium.org>,
"'Kalle Valo'" <kvalo@...eaurora.org>,
"'ath10k'" <ath10k@...ts.infradead.org>,
"'LKML'" <linux-kernel@...r.kernel.org>,
"'linux-wireless'" <linux-wireless@...r.kernel.org>,
"'Brian Norris'" <briannorris@...omium.org>
Subject: RE: [PATCH] ath10k: add option for chip-id based BDF selection
> -----Original Message-----
> From: Doug Anderson <dianders@...omium.org>
> Sent: Tuesday, October 27, 2020 8:26 PM
> To: Rakesh Pillai <pillair@...eaurora.org>
> Cc: Abhishek Kumar <kuabhs@...omium.org>; Kalle Valo
> <kvalo@...eaurora.org>; ath10k <ath10k@...ts.infradead.org>; LKML
> <linux-kernel@...r.kernel.org>; linux-wireless <linux-
> wireless@...r.kernel.org>; Brian Norris <briannorris@...omium.org>
> Subject: Re: [PATCH] ath10k: add option for chip-id based BDF selection
>
> Hi,
>
> On Mon, Oct 26, 2020 at 10:18 PM Rakesh Pillai <pillair@...eaurora.org>
> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Doug Anderson <dianders@...omium.org>
> > > Sent: Tuesday, October 27, 2020 4:21 AM
> > > To: Rakesh Pillai <pillair@...eaurora.org>
> > > Cc: Abhishek Kumar <kuabhs@...omium.org>; Kalle Valo
> > > <kvalo@...eaurora.org>; ath10k <ath10k@...ts.infradead.org>; LKML
> > > <linux-kernel@...r.kernel.org>; linux-wireless <linux-
> > > wireless@...r.kernel.org>; Brian Norris <briannorris@...omium.org>
> > > Subject: Re: [PATCH] ath10k: add option for chip-id based BDF selection
> > >
> > > Hi,
> > >
> > > On Sat, Oct 24, 2020 at 9:40 AM Rakesh Pillai <pillair@...eaurora.org>
> wrote:
> > > >
> > > > > if (bd_ie_type == ATH10K_BD_IE_BOARD) {
> > > > > + /* With variant and chip id */
> > > > > ret = ath10k_core_create_board_name(ar, boardname,
> > > > > - sizeof(boardname), true);
> > > > > + sizeof(boardname), true, true);
> > > >
> > > > Instead of adding a lot of code to generate a second fallback name, its
> > > better to just modify the condition inside the function
> > > “ath10k_core_create_board_name” to allow the generation of BDF tag
> using
> > > chip id, even “if ar->id.bdf_ext[0] == '\0 “.
> > > >
> > > > This will make sure that the variant string is NULL, and just board-id and
> > > chip-id is used. This will help avoid most of the code changes.
> > > > The code would look as shown below
> > > >
> > > > @@ -1493,7 +1493,7 @@ static int
> ath10k_core_create_board_name(struct
> > > ath10k *ar, char *name,
> > > > }
> > > >
> > > > if (ar->id.qmi_ids_valid) {
> > > > - if (with_variant && ar->id.bdf_ext[0] != '\0')
> > > > + if (with_variant)
> > >
> > > Wouldn't the above just be "if (with_chip_id)" instead? ...but yeah,
> > > that would be a cleaner way to do this. Abhishek: do you want to post
> > > a v2?
> >
> >
> > The parameter name passed to this function is "with_variant", since other
> non-qmi targets (eg QCA6174) use this as a flag to just add the variant field.
> > This can be renamed to something meaningful for both qmi and non-qmi
> targets.
>
> I think we still need Abhishek's change to have two booleans passed to
> this function, though, right? Thus, it'll be called 3 times:
>
> * with_chip_id = false, with_variant = false
> * with_chip_id = true, with_variant = true
> * with_chip_id = true, with_variant = false
>
> The two cases you want to combine are both with "with_chip_id = true",
> right? The "with_variant" variable being false will make the variant
> string empty.
I meant that we can use the 4th argument passed to the function " ath10k_core_create_board_name" (currently named as with_variant) as an indication to use the BDF name with variant.
But even if with_variant=true, we allow the variant string to be NULL, thereby allowing us to generate a boardname with the format "bus=snoc,qmi-board-id=0xab,qmi-chip-id=0xcd"
The combinations of args/variant-strings for generating different board names will be as follows:
1) with_variant=false : "bus=snoc,qmi-board-id=0xab"
2) with_variant=true, variant_string=NULL : " bus=snoc,qmi-board-id=0xab,qmi-chip-id=0xcd"
3) with_variant=true, variant_string="variant_xyz" : " bus=snoc,qmi-board-id=0xab,qmi-chip-id=0xcd,variant=variant_xyz"
This will minimize the code changes.
>
> -Doug
Powered by blists - more mailing lists